GetResult() public method

public GetResult ( ) : ParseResult
return ParseResult
Esempio n. 1
0
    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();
    }
Esempio n. 3
0
    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();
    }