Example #1
0
        public ClangParser CreateParser(ITokenStream s)
        {
            var parser = new ClangParser(s);
            var l      = new DebugListener(OutputHelper);

            parser.AddParseListener(l);
            parser.AddErrorListener(new SyntaxErrorThrower());
            return(parser);
        }
Example #2
0
        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);
        }