Esempio n. 1
0
        VBLexer GenerateLexerForSnippet(StringReader sr, SnippetType type)
        {
            var lexer = new VBLexer(sr);

            lexer.SetInitialContext(type);
            return(lexer);
        }
Esempio n. 2
0
        public Expression ParseExpression()
        {
            lexer.SetInitialContext(SnippetType.Expression);
            lexer.NextToken();
            Location   startLocation = la.Location;
            Expression expr;

            Expr(out expr);
            while (la.kind == Tokens.EOL)
            {
                lexer.NextToken();
            }
            if (expr != null)
            {
                expr.StartLocation = startLocation;
                expr.EndLocation   = t.EndLocation;
                expr.AcceptVisitor(new SetParentVisitor(), null);
            }
            Expect(Tokens.EOF);
            return(expr);
        }