VBLexer GenerateLexerForSnippet(StringReader sr, SnippetType type) { var lexer = new VBLexer(sr); lexer.SetInitialContext(type); return(lexer); }
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); }