private VBAExpressionParser.ExpressionContext Parse(string expression) { var stream = new AntlrInputStream(expression); var lexer = new VBALexer(stream); var tokens = new CommonTokenStream(lexer); var parser = new VBAExpressionParser(tokens); parser.AddErrorListener(new ExceptionErrorListener()); var tree = parser.startRule(); return(tree.expression()); }
public TypeAnnotationPass(DeclarationFinder declarationFinder, VBAExpressionParser expressionParser) { _declarationFinder = declarationFinder; var typeBindingContext = new TypeBindingContext(_declarationFinder); var procedurePointerBindingContext = new ProcedurePointerBindingContext(_declarationFinder); _bindingService = new BindingService( _declarationFinder, new DefaultBindingContext(_declarationFinder, typeBindingContext, procedurePointerBindingContext), typeBindingContext, procedurePointerBindingContext); _expressionParser = expressionParser; }