com.atlassian.parsers.routing.path.routerpathParser Maven / Gradle / Ivy
The newest version!
// Generated from com/atlassian/parsers/routing/path/routerpath.g4 by ANTLR 4.7.1
package com.atlassian.parsers.routing.path;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.misc.*;
import org.antlr.v4.runtime.tree.*;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class routerpathParser extends Parser {
static { RuntimeMetaData.checkVersion("4.7.1", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
PARAM=1, REST=2, SLASH=3, NUMBER=4, WORD=5;
public static final int
RULE_parseRoot = 0, RULE_pathElems = 1;
public static final String[] ruleNames = {
"parseRoot", "pathElems"
};
private static final String[] _LITERAL_NAMES = {
null, "':'", "'*'", "'/'"
};
private static final String[] _SYMBOLIC_NAMES = {
null, "PARAM", "REST", "SLASH", "NUMBER", "WORD"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
/**
* @deprecated Use {@link #VOCABULARY} instead.
*/
@Deprecated
public static final String[] tokenNames;
static {
tokenNames = new String[_SYMBOLIC_NAMES.length];
for (int i = 0; i < tokenNames.length; i++) {
tokenNames[i] = VOCABULARY.getLiteralName(i);
if (tokenNames[i] == null) {
tokenNames[i] = VOCABULARY.getSymbolicName(i);
}
if (tokenNames[i] == null) {
tokenNames[i] = "";
}
}
}
@Override
@Deprecated
public String[] getTokenNames() {
return tokenNames;
}
@Override
public Vocabulary getVocabulary() {
return VOCABULARY;
}
@Override
public String getGrammarFileName() { return "routerpath.g4"; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String getSerializedATN() { return _serializedATN; }
@Override
public ATN getATN() { return _ATN; }
public routerpathParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class ParseRootContext extends ParserRuleContext {
public List SLASH() { return getTokens(routerpathParser.SLASH); }
public TerminalNode SLASH(int i) {
return getToken(routerpathParser.SLASH, i);
}
public PathElemsContext pathElems() {
return getRuleContext(PathElemsContext.class,0);
}
public ParseRootContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_parseRoot; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof routerpathListener ) ((routerpathListener)listener).enterParseRoot(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof routerpathListener ) ((routerpathListener)listener).exitParseRoot(this);
}
}
public final ParseRootContext parseRoot() throws RecognitionException {
ParseRootContext _localctx = new ParseRootContext(_ctx, getState());
enterRule(_localctx, 0, RULE_parseRoot);
int _la;
try {
setState(10);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(4);
match(SLASH);
setState(5);
pathElems();
setState(7);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==SLASH) {
{
setState(6);
match(SLASH);
}
}
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(9);
match(SLASH);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PathElemsContext extends ParserRuleContext {
public TerminalNode PARAM() { return getToken(routerpathParser.PARAM, 0); }
public TerminalNode WORD() { return getToken(routerpathParser.WORD, 0); }
public List SLASH() { return getTokens(routerpathParser.SLASH); }
public TerminalNode SLASH(int i) {
return getToken(routerpathParser.SLASH, i);
}
public List pathElems() {
return getRuleContexts(PathElemsContext.class);
}
public PathElemsContext pathElems(int i) {
return getRuleContext(PathElemsContext.class,i);
}
public TerminalNode REST() { return getToken(routerpathParser.REST, 0); }
public PathElemsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_pathElems; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof routerpathListener ) ((routerpathListener)listener).enterPathElems(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof routerpathListener ) ((routerpathListener)listener).exitPathElems(this);
}
}
public final PathElemsContext pathElems() throws RecognitionException {
PathElemsContext _localctx = new PathElemsContext(_ctx, getState());
enterRule(_localctx, 2, RULE_pathElems);
try {
int _alt;
setState(31);
_errHandler.sync(this);
switch (_input.LA(1)) {
case PARAM:
enterOuterAlt(_localctx, 1);
{
setState(12);
match(PARAM);
setState(13);
match(WORD);
setState(18);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,2,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(14);
match(SLASH);
setState(15);
pathElems();
}
}
}
setState(20);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,2,_ctx);
}
}
break;
case REST:
enterOuterAlt(_localctx, 2);
{
setState(21);
match(REST);
setState(22);
match(WORD);
}
break;
case WORD:
enterOuterAlt(_localctx, 3);
{
setState(23);
match(WORD);
setState(28);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,3,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(24);
match(SLASH);
setState(25);
pathElems();
}
}
}
setState(30);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,3,_ctx);
}
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static final String _serializedATN =
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\7$\4\2\t\2\4\3\t"+
"\3\3\2\3\2\3\2\5\2\n\n\2\3\2\5\2\r\n\2\3\3\3\3\3\3\3\3\7\3\23\n\3\f\3"+
"\16\3\26\13\3\3\3\3\3\3\3\3\3\3\3\7\3\35\n\3\f\3\16\3 \13\3\5\3\"\n\3"+
"\3\3\2\2\4\2\4\2\2\2\'\2\f\3\2\2\2\4!\3\2\2\2\6\7\7\5\2\2\7\t\5\4\3\2"+
"\b\n\7\5\2\2\t\b\3\2\2\2\t\n\3\2\2\2\n\r\3\2\2\2\13\r\7\5\2\2\f\6\3\2"+
"\2\2\f\13\3\2\2\2\r\3\3\2\2\2\16\17\7\3\2\2\17\24\7\7\2\2\20\21\7\5\2"+
"\2\21\23\5\4\3\2\22\20\3\2\2\2\23\26\3\2\2\2\24\22\3\2\2\2\24\25\3\2\2"+
"\2\25\"\3\2\2\2\26\24\3\2\2\2\27\30\7\4\2\2\30\"\7\7\2\2\31\36\7\7\2\2"+
"\32\33\7\5\2\2\33\35\5\4\3\2\34\32\3\2\2\2\35 \3\2\2\2\36\34\3\2\2\2\36"+
"\37\3\2\2\2\37\"\3\2\2\2 \36\3\2\2\2!\16\3\2\2\2!\27\3\2\2\2!\31\3\2\2"+
"\2\"\5\3\2\2\2\7\t\f\24\36!";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
}
}
}