001 // Generated from com/khubla/pragmatach/framework/uri/antlr4/RouteSpecification.g4 by ANTLR 4.1 002 package com.khubla.pragmatach.framework.uri.antlr4; 003 import org.antlr.v4.runtime.atn.*; 004 import org.antlr.v4.runtime.dfa.DFA; 005 import org.antlr.v4.runtime.*; 006 import org.antlr.v4.runtime.misc.*; 007 import org.antlr.v4.runtime.tree.*; 008 import java.util.List; 009 import java.util.Iterator; 010 import java.util.ArrayList; 011 012 @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) 013 public class RouteSpecificationParser extends Parser { 014 protected static final DFA[] _decisionToDFA; 015 protected static final PredictionContextCache _sharedContextCache = 016 new PredictionContextCache(); 017 public static final int 018 T__0=1, ALPHANUM=2, AMPER=3; 019 public static final String[] tokenNames = { 020 "<INVALID>", "'/'", "ALPHANUM", "'@'" 021 }; 022 public static final int 023 RULE_routespecification = 0, RULE_segment = 1, RULE_idsegment = 2, RULE_pathsegment = 3, 024 RULE_id = 4; 025 public static final String[] ruleNames = { 026 "routespecification", "segment", "idsegment", "pathsegment", "id" 027 }; 028 029 @Override 030 public String getGrammarFileName() { return "RouteSpecification.g4"; } 031 032 @Override 033 public String[] getTokenNames() { return tokenNames; } 034 035 @Override 036 public String[] getRuleNames() { return ruleNames; } 037 038 @Override 039 public ATN getATN() { return _ATN; } 040 041 public RouteSpecificationParser(TokenStream input) { 042 super(input); 043 _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); 044 } 045 public static class RoutespecificationContext extends ParserRuleContext { 046 public List<SegmentContext> segment() { 047 return getRuleContexts(SegmentContext.class); 048 } 049 public SegmentContext segment(int i) { 050 return getRuleContext(SegmentContext.class,i); 051 } 052 public RoutespecificationContext(ParserRuleContext parent, int invokingState) { 053 super(parent, invokingState); 054 } 055 @Override public int getRuleIndex() { return RULE_routespecification; } 056 @Override 057 public void enterRule(ParseTreeListener listener) { 058 if ( listener instanceof RouteSpecificationListener ) ((RouteSpecificationListener)listener).enterRoutespecification(this); 059 } 060 @Override 061 public void exitRule(ParseTreeListener listener) { 062 if ( listener instanceof RouteSpecificationListener ) ((RouteSpecificationListener)listener).exitRoutespecification(this); 063 } 064 } 065 066 public final RoutespecificationContext routespecification() throws RecognitionException { 067 RoutespecificationContext _localctx = new RoutespecificationContext(_ctx, getState()); 068 enterRule(_localctx, 0, RULE_routespecification); 069 int _la; 070 try { 071 enterOuterAlt(_localctx, 1); 072 { 073 setState(14); 074 _errHandler.sync(this); 075 _la = _input.LA(1); 076 do { 077 { 078 { 079 setState(10); match(1); 080 setState(12); 081 _la = _input.LA(1); 082 if (_la==ALPHANUM || _la==AMPER) { 083 { 084 setState(11); segment(); 085 } 086 } 087 088 } 089 } 090 setState(16); 091 _errHandler.sync(this); 092 _la = _input.LA(1); 093 } while ( _la==1 ); 094 } 095 } 096 catch (RecognitionException re) { 097 _localctx.exception = re; 098 _errHandler.reportError(this, re); 099 _errHandler.recover(this, re); 100 } 101 finally { 102 exitRule(); 103 } 104 return _localctx; 105 } 106 107 public static class SegmentContext extends ParserRuleContext { 108 public PathsegmentContext pathsegment() { 109 return getRuleContext(PathsegmentContext.class,0); 110 } 111 public IdsegmentContext idsegment() { 112 return getRuleContext(IdsegmentContext.class,0); 113 } 114 public SegmentContext(ParserRuleContext parent, int invokingState) { 115 super(parent, invokingState); 116 } 117 @Override public int getRuleIndex() { return RULE_segment; } 118 @Override 119 public void enterRule(ParseTreeListener listener) { 120 if ( listener instanceof RouteSpecificationListener ) ((RouteSpecificationListener)listener).enterSegment(this); 121 } 122 @Override 123 public void exitRule(ParseTreeListener listener) { 124 if ( listener instanceof RouteSpecificationListener ) ((RouteSpecificationListener)listener).exitSegment(this); 125 } 126 } 127 128 public final SegmentContext segment() throws RecognitionException { 129 SegmentContext _localctx = new SegmentContext(_ctx, getState()); 130 enterRule(_localctx, 2, RULE_segment); 131 try { 132 setState(20); 133 switch (_input.LA(1)) { 134 case ALPHANUM: 135 enterOuterAlt(_localctx, 1); 136 { 137 setState(18); pathsegment(); 138 } 139 break; 140 case AMPER: 141 enterOuterAlt(_localctx, 2); 142 { 143 setState(19); idsegment(); 144 } 145 break; 146 default: 147 throw new NoViableAltException(this); 148 } 149 } 150 catch (RecognitionException re) { 151 _localctx.exception = re; 152 _errHandler.reportError(this, re); 153 _errHandler.recover(this, re); 154 } 155 finally { 156 exitRule(); 157 } 158 return _localctx; 159 } 160 161 public static class IdsegmentContext extends ParserRuleContext { 162 public IdContext id() { 163 return getRuleContext(IdContext.class,0); 164 } 165 public TerminalNode AMPER() { return getToken(RouteSpecificationParser.AMPER, 0); } 166 public IdsegmentContext(ParserRuleContext parent, int invokingState) { 167 super(parent, invokingState); 168 } 169 @Override public int getRuleIndex() { return RULE_idsegment; } 170 @Override 171 public void enterRule(ParseTreeListener listener) { 172 if ( listener instanceof RouteSpecificationListener ) ((RouteSpecificationListener)listener).enterIdsegment(this); 173 } 174 @Override 175 public void exitRule(ParseTreeListener listener) { 176 if ( listener instanceof RouteSpecificationListener ) ((RouteSpecificationListener)listener).exitIdsegment(this); 177 } 178 } 179 180 public final IdsegmentContext idsegment() throws RecognitionException { 181 IdsegmentContext _localctx = new IdsegmentContext(_ctx, getState()); 182 enterRule(_localctx, 4, RULE_idsegment); 183 try { 184 enterOuterAlt(_localctx, 1); 185 { 186 setState(22); match(AMPER); 187 setState(23); id(); 188 } 189 } 190 catch (RecognitionException re) { 191 _localctx.exception = re; 192 _errHandler.reportError(this, re); 193 _errHandler.recover(this, re); 194 } 195 finally { 196 exitRule(); 197 } 198 return _localctx; 199 } 200 201 public static class PathsegmentContext extends ParserRuleContext { 202 public TerminalNode ALPHANUM() { return getToken(RouteSpecificationParser.ALPHANUM, 0); } 203 public PathsegmentContext(ParserRuleContext parent, int invokingState) { 204 super(parent, invokingState); 205 } 206 @Override public int getRuleIndex() { return RULE_pathsegment; } 207 @Override 208 public void enterRule(ParseTreeListener listener) { 209 if ( listener instanceof RouteSpecificationListener ) ((RouteSpecificationListener)listener).enterPathsegment(this); 210 } 211 @Override 212 public void exitRule(ParseTreeListener listener) { 213 if ( listener instanceof RouteSpecificationListener ) ((RouteSpecificationListener)listener).exitPathsegment(this); 214 } 215 } 216 217 public final PathsegmentContext pathsegment() throws RecognitionException { 218 PathsegmentContext _localctx = new PathsegmentContext(_ctx, getState()); 219 enterRule(_localctx, 6, RULE_pathsegment); 220 try { 221 enterOuterAlt(_localctx, 1); 222 { 223 setState(25); match(ALPHANUM); 224 } 225 } 226 catch (RecognitionException re) { 227 _localctx.exception = re; 228 _errHandler.reportError(this, re); 229 _errHandler.recover(this, re); 230 } 231 finally { 232 exitRule(); 233 } 234 return _localctx; 235 } 236 237 public static class IdContext extends ParserRuleContext { 238 public TerminalNode ALPHANUM() { return getToken(RouteSpecificationParser.ALPHANUM, 0); } 239 public IdContext(ParserRuleContext parent, int invokingState) { 240 super(parent, invokingState); 241 } 242 @Override public int getRuleIndex() { return RULE_id; } 243 @Override 244 public void enterRule(ParseTreeListener listener) { 245 if ( listener instanceof RouteSpecificationListener ) ((RouteSpecificationListener)listener).enterId(this); 246 } 247 @Override 248 public void exitRule(ParseTreeListener listener) { 249 if ( listener instanceof RouteSpecificationListener ) ((RouteSpecificationListener)listener).exitId(this); 250 } 251 } 252 253 public final IdContext id() throws RecognitionException { 254 IdContext _localctx = new IdContext(_ctx, getState()); 255 enterRule(_localctx, 8, RULE_id); 256 try { 257 enterOuterAlt(_localctx, 1); 258 { 259 setState(27); match(ALPHANUM); 260 } 261 } 262 catch (RecognitionException re) { 263 _localctx.exception = re; 264 _errHandler.reportError(this, re); 265 _errHandler.recover(this, re); 266 } 267 finally { 268 exitRule(); 269 } 270 return _localctx; 271 } 272 273 public static final String _serializedATN = 274 "\3\uacf5\uee8c\u4f5d\u8b0d\u4a45\u78bd\u1b2f\u3378\3\5 \4\2\t\2\4\3\t"+ 275 "\3\4\4\t\4\4\5\t\5\4\6\t\6\3\2\3\2\5\2\17\n\2\6\2\21\n\2\r\2\16\2\22\3"+ 276 "\3\3\3\5\3\27\n\3\3\4\3\4\3\4\3\5\3\5\3\6\3\6\3\6\2\7\2\4\6\b\n\2\2\35"+ 277 "\2\20\3\2\2\2\4\26\3\2\2\2\6\30\3\2\2\2\b\33\3\2\2\2\n\35\3\2\2\2\f\16"+ 278 "\7\3\2\2\r\17\5\4\3\2\16\r\3\2\2\2\16\17\3\2\2\2\17\21\3\2\2\2\20\f\3"+ 279 "\2\2\2\21\22\3\2\2\2\22\20\3\2\2\2\22\23\3\2\2\2\23\3\3\2\2\2\24\27\5"+ 280 "\b\5\2\25\27\5\6\4\2\26\24\3\2\2\2\26\25\3\2\2\2\27\5\3\2\2\2\30\31\7"+ 281 "\5\2\2\31\32\5\n\6\2\32\7\3\2\2\2\33\34\7\4\2\2\34\t\3\2\2\2\35\36\7\4"+ 282 "\2\2\36\13\3\2\2\2\5\16\22\26"; 283 public static final ATN _ATN = 284 ATNSimulator.deserialize(_serializedATN.toCharArray()); 285 static { 286 _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; 287 for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { 288 _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); 289 } 290 } 291 }