Exemplo n.º 1
0
        public ETestParser(String code, bool addLF)
            : base(code)
        {
            ITokenStream    stream = (ITokenStream)this.InputStream;
            EIndentingLexer lexer  = (EIndentingLexer)stream.TokenSource;

            lexer.AddLF = addLF;
        }
Exemplo n.º 2
0
        JavaStatement parse_java_statement(String code)
        {
            ECleverParser   parser = new ECleverParser(code);
            ITokenStream    stream = (ITokenStream)parser.InputStream;
            EIndentingLexer lexer  = (EIndentingLexer)stream.TokenSource;

            lexer.AddLF = false;
            IParseTree      tree    = parser.java_statement();
            EPromptoBuilder builder = new EPromptoBuilder(parser);
            ParseTreeWalker walker  = new ParseTreeWalker();

            walker.Walk(builder, tree);
            return(builder.GetNodeValue <JavaStatement>(tree));
        }