EmbASP-Java
SPDGrammarParser.java
1 package it.unical.mat.parsers.pddl.solver_planning_domains;
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 SPDGrammarParser 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, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, BOOLEAN=8, INTEGER=9,
21  STRING=10, WHITE_SPACE=11;
22  public static final int
23  RULE_array = 0, RULE_json = 1, RULE_oBjEcT = 2, RULE_pair = 3, RULE_value = 4;
24  public static final String[] ruleNames = {
25  "array", "json", "oBjEcT", "pair", "value"
26  };
27 
28  private static final String[] _LITERAL_NAMES = {
29  null, "'['", "','", "']'", "'{'", "'}'", "':'", "'null'"
30  };
31  private static final String[] _SYMBOLIC_NAMES = {
32  null, null, null, null, null, null, null, null, "BOOLEAN", "INTEGER",
33  "STRING", "WHITE_SPACE"
34  };
35  public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
36 
40  @Deprecated
41  public static final String[] tokenNames;
42  static {
43  tokenNames = new String[_SYMBOLIC_NAMES.length];
44  for (int i = 0; i < tokenNames.length; i++) {
45  tokenNames[i] = VOCABULARY.getLiteralName(i);
46  if (tokenNames[i] == null) {
47  tokenNames[i] = VOCABULARY.getSymbolicName(i);
48  }
49 
50  if (tokenNames[i] == null) {
51  tokenNames[i] = "<INVALID>";
52  }
53  }
54  }
55 
56  @Override
57  @Deprecated
58  public String[] getTokenNames() {
59  return tokenNames;
60  }
61 
62  @Override
63 
64  public Vocabulary getVocabulary() {
65  return VOCABULARY;
66  }
67 
68  @Override
69  public String getGrammarFileName() { return "SPDGrammar.g4"; }
70 
71  @Override
72  public String[] getRuleNames() { return ruleNames; }
73 
74  @Override
75  public String getSerializedATN() { return _serializedATN; }
76 
77  @Override
78  public ATN getATN() { return _ATN; }
79 
80  public SPDGrammarParser(TokenStream input) {
81  super(input);
82  _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
83  }
84  public static class ArrayContext extends ParserRuleContext {
85  public List<ValueContext> value() {
86  return getRuleContexts(ValueContext.class);
87  }
88  public ValueContext value(int i) {
89  return getRuleContext(ValueContext.class,i);
90  }
91  public ArrayContext(ParserRuleContext parent, int invokingState) {
92  super(parent, invokingState);
93  }
94  @Override public int getRuleIndex() { return RULE_array; }
95  @Override
96  public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
97  if ( visitor instanceof SPDGrammarVisitor ) return ((SPDGrammarVisitor<? extends T>)visitor).visitArray(this);
98  else return visitor.visitChildren(this);
99  }
100  }
101 
102  public final ArrayContext array() throws RecognitionException {
103  ArrayContext _localctx = new ArrayContext(_ctx, getState());
104  enterRule(_localctx, 0, RULE_array);
105  int _la;
106  try {
107  enterOuterAlt(_localctx, 1);
108  {
109  setState(10);
110  match(T__0);
111  setState(11);
112  value();
113  setState(16);
114  _errHandler.sync(this);
115  _la = _input.LA(1);
116  while (_la==T__1) {
117  {
118  {
119  setState(12);
120  match(T__1);
121  setState(13);
122  value();
123  }
124  }
125  setState(18);
126  _errHandler.sync(this);
127  _la = _input.LA(1);
128  }
129  setState(19);
130  match(T__2);
131  }
132  }
133  catch (RecognitionException re) {
134  _localctx.exception = re;
135  _errHandler.reportError(this, re);
136  _errHandler.recover(this, re);
137  }
138  finally {
139  exitRule();
140  }
141  return _localctx;
142  }
143 
144  public static class JsonContext extends ParserRuleContext {
145  public List<ValueContext> value() {
146  return getRuleContexts(ValueContext.class);
147  }
148  public ValueContext value(int i) {
149  return getRuleContext(ValueContext.class,i);
150  }
151  public JsonContext(ParserRuleContext parent, int invokingState) {
152  super(parent, invokingState);
153  }
154  @Override public int getRuleIndex() { return RULE_json; }
155  @Override
156  public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
157  if ( visitor instanceof SPDGrammarVisitor ) return ((SPDGrammarVisitor<? extends T>)visitor).visitJson(this);
158  else return visitor.visitChildren(this);
159  }
160  }
161 
162  public final JsonContext json() throws RecognitionException {
163  JsonContext _localctx = new JsonContext(_ctx, getState());
164  enterRule(_localctx, 2, RULE_json);
165  int _la;
166  try {
167  enterOuterAlt(_localctx, 1);
168  {
169  setState(24);
170  _errHandler.sync(this);
171  _la = _input.LA(1);
172  while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__3) | (1L << T__6) | (1L << BOOLEAN) | (1L << INTEGER) | (1L << STRING))) != 0)) {
173  {
174  {
175  setState(21);
176  value();
177  }
178  }
179  setState(26);
180  _errHandler.sync(this);
181  _la = _input.LA(1);
182  }
183  }
184  }
185  catch (RecognitionException re) {
186  _localctx.exception = re;
187  _errHandler.reportError(this, re);
188  _errHandler.recover(this, re);
189  }
190  finally {
191  exitRule();
192  }
193  return _localctx;
194  }
195 
196  public static class OBjEcTContext extends ParserRuleContext {
197  public List<PairContext> pair() {
198  return getRuleContexts(PairContext.class);
199  }
200  public PairContext pair(int i) {
201  return getRuleContext(PairContext.class,i);
202  }
203  public OBjEcTContext(ParserRuleContext parent, int invokingState) {
204  super(parent, invokingState);
205  }
206  @Override public int getRuleIndex() { return RULE_oBjEcT; }
207  @Override
208  public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
209  if ( visitor instanceof SPDGrammarVisitor ) return ((SPDGrammarVisitor<? extends T>)visitor).visitOBjEcT(this);
210  else return visitor.visitChildren(this);
211  }
212  }
213 
214  public final OBjEcTContext oBjEcT() throws RecognitionException {
215  OBjEcTContext _localctx = new OBjEcTContext(_ctx, getState());
216  enterRule(_localctx, 4, RULE_oBjEcT);
217  int _la;
218  try {
219  setState(40);
220  _errHandler.sync(this);
221  switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) {
222  case 1:
223  enterOuterAlt(_localctx, 1);
224  {
225  setState(27);
226  match(T__3);
227  setState(28);
228  pair();
229  setState(33);
230  _errHandler.sync(this);
231  _la = _input.LA(1);
232  while (_la==T__1) {
233  {
234  {
235  setState(29);
236  match(T__1);
237  setState(30);
238  pair();
239  }
240  }
241  setState(35);
242  _errHandler.sync(this);
243  _la = _input.LA(1);
244  }
245  setState(36);
246  match(T__4);
247  }
248  break;
249  case 2:
250  enterOuterAlt(_localctx, 2);
251  {
252  setState(38);
253  match(T__3);
254  setState(39);
255  match(T__4);
256  }
257  break;
258  }
259  }
260  catch (RecognitionException re) {
261  _localctx.exception = re;
262  _errHandler.reportError(this, re);
263  _errHandler.recover(this, re);
264  }
265  finally {
266  exitRule();
267  }
268  return _localctx;
269  }
270 
271  public static class PairContext extends ParserRuleContext {
272  public TerminalNode STRING() { return getToken(SPDGrammarParser.STRING, 0); }
273  public ValueContext value() {
274  return getRuleContext(ValueContext.class,0);
275  }
276  public PairContext(ParserRuleContext parent, int invokingState) {
277  super(parent, invokingState);
278  }
279  @Override public int getRuleIndex() { return RULE_pair; }
280  @Override
281  public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
282  if ( visitor instanceof SPDGrammarVisitor ) return ((SPDGrammarVisitor<? extends T>)visitor).visitPair(this);
283  else return visitor.visitChildren(this);
284  }
285  }
286 
287  public final PairContext pair() throws RecognitionException {
288  PairContext _localctx = new PairContext(_ctx, getState());
289  enterRule(_localctx, 6, RULE_pair);
290  try {
291  enterOuterAlt(_localctx, 1);
292  {
293  setState(42);
294  match(STRING);
295  setState(43);
296  match(T__5);
297  setState(44);
298  value();
299  }
300  }
301  catch (RecognitionException re) {
302  _localctx.exception = re;
303  _errHandler.reportError(this, re);
304  _errHandler.recover(this, re);
305  }
306  finally {
307  exitRule();
308  }
309  return _localctx;
310  }
311 
312  public static class ValueContext extends ParserRuleContext {
313  public ValueContext(ParserRuleContext parent, int invokingState) {
314  super(parent, invokingState);
315  }
316  @Override public int getRuleIndex() { return RULE_value; }
317 
318  public ValueContext() { }
319  public void copyFrom(ValueContext ctx) {
320  super.copyFrom(ctx);
321  }
322  }
323  public static class NullValueContext extends ValueContext {
324  public NullValueContext(ValueContext ctx) { copyFrom(ctx); }
325  @Override
326  public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
327  if ( visitor instanceof SPDGrammarVisitor ) return ((SPDGrammarVisitor<? extends T>)visitor).visitNullValue(this);
328  else return visitor.visitChildren(this);
329  }
330  }
331  public static class ObjectValueContext extends ValueContext {
332  public OBjEcTContext oBjEcT() {
333  return getRuleContext(OBjEcTContext.class,0);
334  }
335  public ObjectValueContext(ValueContext ctx) { copyFrom(ctx); }
336  @Override
337  public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
338  if ( visitor instanceof SPDGrammarVisitor ) return ((SPDGrammarVisitor<? extends T>)visitor).visitObjectValue(this);
339  else return visitor.visitChildren(this);
340  }
341  }
342  public static class BooleanValueContext extends ValueContext {
343  public TerminalNode BOOLEAN() { return getToken(SPDGrammarParser.BOOLEAN, 0); }
344  public BooleanValueContext(ValueContext ctx) { copyFrom(ctx); }
345  @Override
346  public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
347  if ( visitor instanceof SPDGrammarVisitor ) return ((SPDGrammarVisitor<? extends T>)visitor).visitBooleanValue(this);
348  else return visitor.visitChildren(this);
349  }
350  }
351  public static class IntegerValueContext extends ValueContext {
352  public TerminalNode INTEGER() { return getToken(SPDGrammarParser.INTEGER, 0); }
353  public IntegerValueContext(ValueContext ctx) { copyFrom(ctx); }
354  @Override
355  public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
356  if ( visitor instanceof SPDGrammarVisitor ) return ((SPDGrammarVisitor<? extends T>)visitor).visitIntegerValue(this);
357  else return visitor.visitChildren(this);
358  }
359  }
360  public static class StringValueContext extends ValueContext {
361  public TerminalNode STRING() { return getToken(SPDGrammarParser.STRING, 0); }
362  public StringValueContext(ValueContext ctx) { copyFrom(ctx); }
363  @Override
364  public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
365  if ( visitor instanceof SPDGrammarVisitor ) return ((SPDGrammarVisitor<? extends T>)visitor).visitStringValue(this);
366  else return visitor.visitChildren(this);
367  }
368  }
369  public static class ArrayValueContext extends ValueContext {
370  public ArrayContext array() {
371  return getRuleContext(ArrayContext.class,0);
372  }
373  public ArrayValueContext(ValueContext ctx) { copyFrom(ctx); }
374  @Override
375  public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
376  if ( visitor instanceof SPDGrammarVisitor ) return ((SPDGrammarVisitor<? extends T>)visitor).visitArrayValue(this);
377  else return visitor.visitChildren(this);
378  }
379  }
380 
381  public final ValueContext value() throws RecognitionException {
382  ValueContext _localctx = new ValueContext(_ctx, getState());
383  enterRule(_localctx, 8, RULE_value);
384  try {
385  setState(52);
386  _errHandler.sync(this);
387  switch (_input.LA(1)) {
388  case T__0:
389  _localctx = new ArrayValueContext(_localctx);
390  enterOuterAlt(_localctx, 1);
391  {
392  setState(46);
393  array();
394  }
395  break;
396  case BOOLEAN:
397  _localctx = new BooleanValueContext(_localctx);
398  enterOuterAlt(_localctx, 2);
399  {
400  setState(47);
401  match(BOOLEAN);
402  }
403  break;
404  case INTEGER:
405  _localctx = new IntegerValueContext(_localctx);
406  enterOuterAlt(_localctx, 3);
407  {
408  setState(48);
409  match(INTEGER);
410  }
411  break;
412  case T__6:
413  _localctx = new NullValueContext(_localctx);
414  enterOuterAlt(_localctx, 4);
415  {
416  setState(49);
417  match(T__6);
418  }
419  break;
420  case T__3:
421  _localctx = new ObjectValueContext(_localctx);
422  enterOuterAlt(_localctx, 5);
423  {
424  setState(50);
425  oBjEcT();
426  }
427  break;
428  case STRING:
429  _localctx = new StringValueContext(_localctx);
430  enterOuterAlt(_localctx, 6);
431  {
432  setState(51);
433  match(STRING);
434  }
435  break;
436  default:
437  throw new NoViableAltException(this);
438  }
439  }
440  catch (RecognitionException re) {
441  _localctx.exception = re;
442  _errHandler.reportError(this, re);
443  _errHandler.recover(this, re);
444  }
445  finally {
446  exitRule();
447  }
448  return _localctx;
449  }
450 
451  public static final String _serializedATN =
452  "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\r9\4\2\t\2\4\3\t"+
453  "\3\4\4\t\4\4\5\t\5\4\6\t\6\3\2\3\2\3\2\3\2\7\2\21\n\2\f\2\16\2\24\13\2"+
454  "\3\2\3\2\3\3\7\3\31\n\3\f\3\16\3\34\13\3\3\4\3\4\3\4\3\4\7\4\"\n\4\f\4"+
455  "\16\4%\13\4\3\4\3\4\3\4\3\4\5\4+\n\4\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3"+
456  "\6\3\6\5\6\67\n\6\3\6\2\2\7\2\4\6\b\n\2\2\2<\2\f\3\2\2\2\4\32\3\2\2\2"+
457  "\6*\3\2\2\2\b,\3\2\2\2\n\66\3\2\2\2\f\r\7\3\2\2\r\22\5\n\6\2\16\17\7\4"+
458  "\2\2\17\21\5\n\6\2\20\16\3\2\2\2\21\24\3\2\2\2\22\20\3\2\2\2\22\23\3\2"+
459  "\2\2\23\25\3\2\2\2\24\22\3\2\2\2\25\26\7\5\2\2\26\3\3\2\2\2\27\31\5\n"+
460  "\6\2\30\27\3\2\2\2\31\34\3\2\2\2\32\30\3\2\2\2\32\33\3\2\2\2\33\5\3\2"+
461  "\2\2\34\32\3\2\2\2\35\36\7\6\2\2\36#\5\b\5\2\37 \7\4\2\2 \"\5\b\5\2!\37"+
462  "\3\2\2\2\"%\3\2\2\2#!\3\2\2\2#$\3\2\2\2$&\3\2\2\2%#\3\2\2\2&\'\7\7\2\2"+
463  "\'+\3\2\2\2()\7\6\2\2)+\7\7\2\2*\35\3\2\2\2*(\3\2\2\2+\7\3\2\2\2,-\7\f"+
464  "\2\2-.\7\b\2\2./\5\n\6\2/\t\3\2\2\2\60\67\5\2\2\2\61\67\7\n\2\2\62\67"+
465  "\7\13\2\2\63\67\7\t\2\2\64\67\5\6\4\2\65\67\7\f\2\2\66\60\3\2\2\2\66\61"+
466  "\3\2\2\2\66\62\3\2\2\2\66\63\3\2\2\2\66\64\3\2\2\2\66\65\3\2\2\2\67\13"+
467  "\3\2\2\2\7\22\32#*\66";
468  public static final ATN _ATN =
469  new ATNDeserializer().deserialize(_serializedATN.toCharArray());
470  static {
471  _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
472  for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
473  _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
474  }
475  }
476 }
it.unical.mat.parsers.pddl.solver_planning_domains.SPDGrammarParser.tokenNames
static final String[] tokenNames
Definition: SPDGrammarParser.java:41
it.unical.mat.parsers.pddl.solver_planning_domains.SPDGrammarParser
Definition: SPDGrammarParser.java:13