public ClangParser CreateParser(ITokenStream s) { var parser = new ClangParser(s); var l = new DebugListener(OutputHelper); parser.AddParseListener(l); parser.AddErrorListener(new SyntaxErrorThrower()); return(parser); }
public void T(string text) { var config = new Configuration(); var collector = new Collector(config); var stream = ClangHelper.CreateTokenStream(text); var parser = new ClangParser(stream); parser.AddErrorListener(new SyntaxErrorThrower()); parser.AddParseListener(collector); parser.file(); Assert.Equal(3, config.Defines.Count); }