GetResult() public method

public GetResult ( ) : ParseResult
return ParseResult
Ejemplo 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);
    }
Ejemplo n.º 2
0
    protected static ParseResult Parse(string urls)
    {
      var builder = new ParseResultBuilder();
      parser.Parse(new StringReader(urls), builder);

      return builder.GetResult();
    }
Ejemplo 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();
    }