1 package it.unical.mat.parsers.asp.asp_parser_base;
4 import org.antlr.v4.runtime.atn.*;
5 import org.antlr.v4.runtime.dfa.DFA;
6 import org.antlr.v4.runtime.*;
7 import org.antlr.v4.runtime.misc.*;
8 import org.antlr.v4.runtime.tree.*;
10 import java.util.Iterator;
11 import java.util.ArrayList;
13 @SuppressWarnings({
"all",
"warnings",
"unchecked",
"unused",
"cast"})
15 static { RuntimeMetaData.checkVersion(
"4.7", RuntimeMetaData.VERSION); }
17 protected static final DFA[] _decisionToDFA;
18 protected static final PredictionContextCache _sharedContextCache =
19 new PredictionContextCache();
20 public static final int
21 T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, IDENTIFIER=6, INTEGER=7, STRING=8,
23 public static final int
24 RULE_output = 0, RULE_predicate_atom = 1, RULE_term = 2;
25 public static final String[] ruleNames = {
26 "output",
"predicate_atom",
"term"
29 private static final String[] _LITERAL_NAMES = {
30 null,
"'('",
"','",
"')'",
"'['",
"']'"
32 private static final String[] _SYMBOLIC_NAMES = {
33 null,
null,
null,
null,
null,
null,
"IDENTIFIER",
"INTEGER",
"STRING",
36 public static final Vocabulary VOCABULARY =
new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
44 tokenNames =
new String[_SYMBOLIC_NAMES.length];
45 for (
int i = 0; i < tokenNames.length; i++) {
46 tokenNames[i] = VOCABULARY.getLiteralName(i);
47 if (tokenNames[i] ==
null) {
48 tokenNames[i] = VOCABULARY.getSymbolicName(i);
51 if (tokenNames[i] ==
null) {
52 tokenNames[i] =
"<INVALID>";
59 public String[] getTokenNames() {
65 public Vocabulary getVocabulary() {
70 public String getGrammarFileName() {
return "ASPGrammar.g4"; }
73 public String[] getRuleNames() {
return ruleNames; }
76 public String getSerializedATN() {
return _serializedATN; }
79 public ATN getATN() {
return _ATN; }
81 public ASPGrammarParser(TokenStream input) {
83 _interp =
new ParserATNSimulator(
this,_ATN,_decisionToDFA,_sharedContextCache);
85 public static class OutputContext
extends ParserRuleContext {
86 public List<Predicate_atomContext> predicate_atom() {
87 return getRuleContexts(Predicate_atomContext.class);
89 public Predicate_atomContext predicate_atom(
int i) {
90 return getRuleContext(Predicate_atomContext.class,i);
92 public OutputContext(ParserRuleContext parent,
int invokingState) {
93 super(parent, invokingState);
95 @Override
public int getRuleIndex() {
return RULE_output; }
97 public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
98 if ( visitor instanceof ASPGrammarVisitor )
return ((ASPGrammarVisitor<? extends T>)visitor).visitOutput(
this);
99 else return visitor.visitChildren(
this);
103 public final OutputContext output() throws RecognitionException {
104 OutputContext _localctx =
new OutputContext(_ctx, getState());
105 enterRule(_localctx, 0, RULE_output);
108 enterOuterAlt(_localctx, 1);
111 _errHandler.sync(
this);
113 while (_la==IDENTIFIER) {
121 _errHandler.sync(
this);
126 catch (RecognitionException re) {
127 _localctx.exception = re;
128 _errHandler.reportError(
this, re);
129 _errHandler.recover(
this, re);
137 public static class Predicate_atomContext
extends ParserRuleContext {
138 public TerminalNode IDENTIFIER() {
return getToken(ASPGrammarParser.IDENTIFIER, 0); }
139 public List<TermContext> term() {
140 return getRuleContexts(TermContext.class);
142 public TermContext term(
int i) {
143 return getRuleContext(TermContext.class,i);
145 public Predicate_atomContext(ParserRuleContext parent,
int invokingState) {
146 super(parent, invokingState);
148 @Override
public int getRuleIndex() {
return RULE_predicate_atom; }
150 public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
151 if ( visitor instanceof ASPGrammarVisitor )
return ((ASPGrammarVisitor<? extends T>)visitor).visitPredicate_atom(
this);
152 else return visitor.visitChildren(
this);
156 public final Predicate_atomContext predicate_atom() throws RecognitionException {
157 Predicate_atomContext _localctx =
new Predicate_atomContext(_ctx, getState());
158 enterRule(_localctx, 2, RULE_predicate_atom);
161 enterOuterAlt(_localctx, 1);
166 _errHandler.sync(
this);
175 _errHandler.sync(
this);
187 _errHandler.sync(
this);
197 catch (RecognitionException re) {
198 _localctx.exception = re;
199 _errHandler.reportError(
this, re);
200 _errHandler.recover(
this, re);
208 public static class TermContext
extends ParserRuleContext {
209 public TerminalNode IDENTIFIER() {
return getToken(ASPGrammarParser.IDENTIFIER, 0); }
210 public TerminalNode INTEGER() {
return getToken(ASPGrammarParser.INTEGER, 0); }
211 public Predicate_atomContext predicate_atom() {
212 return getRuleContext(Predicate_atomContext.class,0);
214 public List<TermContext> term() {
215 return getRuleContexts(TermContext.class);
217 public TermContext term(
int i) {
218 return getRuleContext(TermContext.class,i);
220 public TerminalNode STRING() {
return getToken(ASPGrammarParser.STRING, 0); }
221 public TermContext(ParserRuleContext parent,
int invokingState) {
222 super(parent, invokingState);
224 @Override
public int getRuleIndex() {
return RULE_term; }
226 public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
227 if ( visitor instanceof ASPGrammarVisitor )
return ((ASPGrammarVisitor<? extends T>)visitor).visitTerm(
this);
228 else return visitor.visitChildren(
this);
232 public final TermContext term() throws RecognitionException {
233 TermContext _localctx =
new TermContext(_ctx, getState());
234 enterRule(_localctx, 4, RULE_term);
238 _errHandler.sync(
this);
239 switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) {
241 enterOuterAlt(_localctx, 1);
248 enterOuterAlt(_localctx, 2);
255 enterOuterAlt(_localctx, 3);
262 enterOuterAlt(_localctx, 4);
267 _errHandler.sync(
this);
269 if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << IDENTIFIER) | (1L << INTEGER) | (1L << STRING))) != 0)) {
274 _errHandler.sync(
this);
286 _errHandler.sync(
this);
297 enterOuterAlt(_localctx, 5);
305 catch (RecognitionException re) {
306 _localctx.exception = re;
307 _errHandler.reportError(
this, re);
308 _errHandler.recover(
this, re);
316 public static final String _serializedATN =
317 "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\13/\4\2\t\2\4\3\t"+
318 "\3\4\4\t\4\3\2\7\2\n\n\2\f\2\16\2\r\13\2\3\3\3\3\3\3\3\3\3\3\7\3\24\n"+
319 "\3\f\3\16\3\27\13\3\3\3\3\3\5\3\33\n\3\3\4\3\4\3\4\3\4\3\4\3\4\3\4\7\4"+
320 "$\n\4\f\4\16\4\'\13\4\5\4)\n\4\3\4\3\4\5\4-\n\4\3\4\2\2\5\2\4\6\2\2\2"+
321 "\64\2\13\3\2\2\2\4\16\3\2\2\2\6,\3\2\2\2\b\n\5\4\3\2\t\b\3\2\2\2\n\r\3"+
322 "\2\2\2\13\t\3\2\2\2\13\f\3\2\2\2\f\3\3\2\2\2\r\13\3\2\2\2\16\32\7\b\2"+
323 "\2\17\20\7\3\2\2\20\25\5\6\4\2\21\22\7\4\2\2\22\24\5\6\4\2\23\21\3\2\2"+
324 "\2\24\27\3\2\2\2\25\23\3\2\2\2\25\26\3\2\2\2\26\30\3\2\2\2\27\25\3\2\2"+
325 "\2\30\31\7\5\2\2\31\33\3\2\2\2\32\17\3\2\2\2\32\33\3\2\2\2\33\5\3\2\2"+
326 "\2\34-\7\b\2\2\35-\7\t\2\2\36-\5\4\3\2\37(\7\6\2\2 %\5\6\4\2!\"\7\4\2"+
327 "\2\"$\5\6\4\2#!\3\2\2\2$\'\3\2\2\2%#\3\2\2\2%&\3\2\2\2&)\3\2\2\2\'%\3"+
328 "\2\2\2( \3\2\2\2()\3\2\2\2)*\3\2\2\2*-\7\7\2\2+-\7\n\2\2,\34\3\2\2\2,"+
329 "\35\3\2\2\2,\36\3\2\2\2,\37\3\2\2\2,+\3\2\2\2-\7\3\2\2\2\b\13\25\32%("+
331 public static final ATN _ATN =
332 new ATNDeserializer().deserialize(_serializedATN.toCharArray());
334 _decisionToDFA =
new DFA[_ATN.getNumberOfDecisions()];
335 for (
int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
336 _decisionToDFA[i] =
new DFA(_ATN.getDecisionState(i), i);