コード例 #1
0
    public Expression Parse(Type rootType, String source) {
      if (__parser == null) {
        var grammar = new ODataFilterGrammar();
        __parser = new Parser(grammar);
      }
      var parseTree = __parser.Parse(source);
      if (parseTree == null || parseTree.Root == null) {
        throw new Exception("Unable to parse: " + source);
      }
      var expr = ParseTreeVisitor.Parse(rootType, parseTree.Root);

      return expr;
    }
コード例 #2
0
        public Expression Parse(Type rootType, String source)
        {
            if (__parser == null)
            {
                var grammar = new ODataFilterGrammar();
                __parser = new Parser(grammar);
            }
            var parseTree = __parser.Parse(source);

            if (parseTree == null || parseTree.Root == null)
            {
                throw new Exception("Unable to parse: " + source);
            }
            var expr = ParseTreeVisitor.Parse(rootType, parseTree.Root);

            return(expr);
        }
コード例 #3
0
 public ExpressionTreeBuilder()
 {
     var grammer = new ODataFilterGrammar();
       _parser = new Parser(grammer);
 }