1 from .asp_parser_base.ASPGrammarLexer
import ASPGrammarLexer
2 from .asp_parser_base.ASPGrammarParser
import ASPGrammarParser
3 from .asp_parser_base.ASPGrammarVisitor
import ASPGrammarVisitor
4 from antlr4
import PredictionMode
5 from antlr4.CommonTokenStream
import CommonTokenStream
6 from antlr4.error.ErrorListener
import ConsoleErrorListener
7 from antlr4.error.Errors
import RecognitionException
8 from antlr4.error.ErrorStrategy
import BailErrorStrategy, DefaultErrorStrategy
9 from antlr4.InputStream
import InputStream
21 parser._interp.predictionMode = PredictionMode.SLL
23 parser.removeErrorListeners()
25 parser._errHandler = BailErrorStrategy()
28 visitor.visit(parser.output())
29 except RuntimeError
as exception:
30 if isinstance(exception, RecognitionException):
32 parser.addErrorListener(ConsoleErrorListener.INSTANCE)
34 parser._errHandler = DefaultErrorStrategy()
35 parser._interp.predictionMode = PredictionMode.LL
37 visitor.visit(parser.output())
41 def get_parameters(self):
44 def visitTerm(self, ctx):