Rubberduck.Parsing.Preprocessing.VBAPreprocessor.Preprocess C# (CSharp) Method

Preprocess() private method

private Preprocess ( string unprocessedCode ) : string
unprocessedCode string
return string
        private string Preprocess(string unprocessedCode)
        {
            SymbolTable<string, IValue> symbolTable = new SymbolTable<string, IValue>();
            var stream = new AntlrInputStream(unprocessedCode);
            var lexer = new VBALexer(stream);
            var tokens = new CommonTokenStream(lexer);
            var parser = new VBAConditionalCompilationParser(tokens);
            parser.AddErrorListener(new ExceptionErrorListener());
            var evaluator = new VBAPreprocessorVisitor(symbolTable, new VBAPredefinedCompilationConstants(_vbaVersion));
            var tree = parser.compilationUnit();
            var expr = evaluator.Visit(tree);
            return expr.Evaluate().AsString;
        }
    }