Esempio n. 1
0
        private FateChaosParser GetParser(AntlrInputStream stream)
        {
            var lexer = new FateChaosLexer(stream);
            var cts   = new CommonTokenStream(lexer);

            var parser = new FateChaosParser(cts);

            lexer.RemoveErrorListeners();
            parser.RemoveErrorListeners();
            parser.AddErrorListener(Listener);

            return(parser);
        }
Esempio n. 2
0
        private FateChaosParser QuickParse(string script)
        {
            var stream = new AntlrInputStream(script);
            var lexer  = new FateChaosLexer(stream);
            var cts    = new CommonTokenStream(lexer);

            var parser = new FateChaosParser(cts);

            lexer.RemoveErrorListeners();
            parser.RemoveErrorListeners();
            parser.AddErrorListener(QuickParseListener);

            return(parser);
        }