public void Now(TextReader reader, TextWriter writer) { var parser = new UrlMapParser(); var listener = new ParseResultBuilder(); parser.Parse(reader, listener); var result = listener.GetResult(); var generator = new Generator(); generator.GenerateStrongUrls(result.UrlStrongModel, writer); }
protected static ParseResult Parse(string urls) { var builder = new ParseResultBuilder(); parser.Parse(new StringReader(urls), builder); return builder.GetResult(); }
public static ParsedUrl ToUrl(this string str) { var resultBuilder = new ParseResultBuilder(); var urlParser = new UrlLineParser(); if (!urlParser.Parse(str, resultBuilder)) { throw new Exception("Dunno how to parse " + str); } return resultBuilder.GetResult().UrlStrongModel.Urls.FirstOrDefault(); }