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); }
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); }