EmbASP-Java
PDDLGrammarParser.java
1 package it.unical.mat.parsers.pddl.pddl_parser_base;
2 
3 import org.antlr.v4.runtime.atn.*;
4 import org.antlr.v4.runtime.dfa.DFA;
5 import org.antlr.v4.runtime.*;
6 import org.antlr.v4.runtime.misc.*;
7 import org.antlr.v4.runtime.tree.*;
8 import java.util.List;
9 import java.util.Iterator;
10 import java.util.ArrayList;
11 
12 @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
13 public class PDDLGrammarParser extends Parser {
14  static { RuntimeMetaData.checkVersion("4.7", RuntimeMetaData.VERSION); }
15 
16  protected static final DFA[] _decisionToDFA;
17  protected static final PredictionContextCache _sharedContextCache =
18  new PredictionContextCache();
19  public static final int
20  T__0=1, T__1=2, IDENTIFIER=3, SEPARATOR=4;
21  public static final int
22  RULE_atom = 0, RULE_output = 1;
23  public static final String[] ruleNames = {
24  "atom", "output"
25  };
26 
27  private static final String[] _LITERAL_NAMES = {
28  null, "'('", "')'"
29  };
30  private static final String[] _SYMBOLIC_NAMES = {
31  null, null, null, "IDENTIFIER", "SEPARATOR"
32  };
33  public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
34 
38  @Deprecated
39  public static final String[] tokenNames;
40  static {
41  tokenNames = new String[_SYMBOLIC_NAMES.length];
42  for (int i = 0; i < tokenNames.length; i++) {
43  tokenNames[i] = VOCABULARY.getLiteralName(i);
44  if (tokenNames[i] == null) {
45  tokenNames[i] = VOCABULARY.getSymbolicName(i);
46  }
47 
48  if (tokenNames[i] == null) {
49  tokenNames[i] = "<INVALID>";
50  }
51  }
52  }
53 
54  @Override
55  @Deprecated
56  public String[] getTokenNames() {
57  return tokenNames;
58  }
59 
60  @Override
61 
62  public Vocabulary getVocabulary() {
63  return VOCABULARY;
64  }
65 
66  @Override
67  public String getGrammarFileName() { return "PDDLGrammar.g4"; }
68 
69  @Override
70  public String[] getRuleNames() { return ruleNames; }
71 
72  @Override
73  public String getSerializedATN() { return _serializedATN; }
74 
75  @Override
76  public ATN getATN() { return _ATN; }
77 
78  public PDDLGrammarParser(TokenStream input) {
79  super(input);
80  _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
81  }
82  public static class AtomContext extends ParserRuleContext {
83  public List<TerminalNode> IDENTIFIER() { return getTokens(PDDLGrammarParser.IDENTIFIER); }
84  public TerminalNode IDENTIFIER(int i) {
85  return getToken(PDDLGrammarParser.IDENTIFIER, i);
86  }
87  public AtomContext(ParserRuleContext parent, int invokingState) {
88  super(parent, invokingState);
89  }
90  @Override public int getRuleIndex() { return RULE_atom; }
91  @Override
92  public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
93  if ( visitor instanceof PDDLGrammarVisitor ) return ((PDDLGrammarVisitor<? extends T>)visitor).visitAtom(this);
94  else return visitor.visitChildren(this);
95  }
96  }
97 
98  public final AtomContext atom() throws RecognitionException {
99  AtomContext _localctx = new AtomContext(_ctx, getState());
100  enterRule(_localctx, 0, RULE_atom);
101  int _la;
102  try {
103  enterOuterAlt(_localctx, 1);
104  {
105  setState(4);
106  match(T__0);
107  setState(8);
108  _errHandler.sync(this);
109  _la = _input.LA(1);
110  while (_la==IDENTIFIER) {
111  {
112  {
113  setState(5);
114  match(IDENTIFIER);
115  }
116  }
117  setState(10);
118  _errHandler.sync(this);
119  _la = _input.LA(1);
120  }
121  setState(11);
122  match(T__1);
123  }
124  }
125  catch (RecognitionException re) {
126  _localctx.exception = re;
127  _errHandler.reportError(this, re);
128  _errHandler.recover(this, re);
129  }
130  finally {
131  exitRule();
132  }
133  return _localctx;
134  }
135 
136  public static class OutputContext extends ParserRuleContext {
137  public List<AtomContext> atom() {
138  return getRuleContexts(AtomContext.class);
139  }
140  public AtomContext atom(int i) {
141  return getRuleContext(AtomContext.class,i);
142  }
143  public OutputContext(ParserRuleContext parent, int invokingState) {
144  super(parent, invokingState);
145  }
146  @Override public int getRuleIndex() { return RULE_output; }
147  @Override
148  public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
149  if ( visitor instanceof PDDLGrammarVisitor ) return ((PDDLGrammarVisitor<? extends T>)visitor).visitOutput(this);
150  else return visitor.visitChildren(this);
151  }
152  }
153 
154  public final OutputContext output() throws RecognitionException {
155  OutputContext _localctx = new OutputContext(_ctx, getState());
156  enterRule(_localctx, 2, RULE_output);
157  int _la;
158  try {
159  enterOuterAlt(_localctx, 1);
160  {
161  setState(16);
162  _errHandler.sync(this);
163  _la = _input.LA(1);
164  while (_la==T__0) {
165  {
166  {
167  setState(13);
168  atom();
169  }
170  }
171  setState(18);
172  _errHandler.sync(this);
173  _la = _input.LA(1);
174  }
175  }
176  }
177  catch (RecognitionException re) {
178  _localctx.exception = re;
179  _errHandler.reportError(this, re);
180  _errHandler.recover(this, re);
181  }
182  finally {
183  exitRule();
184  }
185  return _localctx;
186  }
187 
188  public static final String _serializedATN =
189  "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\6\26\4\2\t\2\4\3"+
190  "\t\3\3\2\3\2\7\2\t\n\2\f\2\16\2\f\13\2\3\2\3\2\3\3\7\3\21\n\3\f\3\16\3"+
191  "\24\13\3\3\3\2\2\4\2\4\2\2\2\25\2\6\3\2\2\2\4\22\3\2\2\2\6\n\7\3\2\2\7"+
192  "\t\7\5\2\2\b\7\3\2\2\2\t\f\3\2\2\2\n\b\3\2\2\2\n\13\3\2\2\2\13\r\3\2\2"+
193  "\2\f\n\3\2\2\2\r\16\7\4\2\2\16\3\3\2\2\2\17\21\5\2\2\2\20\17\3\2\2\2\21"+
194  "\24\3\2\2\2\22\20\3\2\2\2\22\23\3\2\2\2\23\5\3\2\2\2\24\22\3\2\2\2\4\n"+
195  "\22";
196  public static final ATN _ATN =
197  new ATNDeserializer().deserialize(_serializedATN.toCharArray());
198  static {
199  _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
200  for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
201  _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
202  }
203  }
204 }
it.unical.mat.parsers.pddl.pddl_parser_base.PDDLGrammarParser.tokenNames
static final String[] tokenNames
Definition: PDDLGrammarParser.java:39
it.unical.mat.parsers.pddl.pddl_parser_base.PDDLGrammarParser
Definition: PDDLGrammarParser.java:13