io.rivulet.EncodedURLParser Maven / Gradle / Ivy
The newest version!
// Generated from io/rivulet/EncodedURL.g4 by ANTLR 4.0
package io.rivulet;
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 EncodedURLParser extends Parser {
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
PERCENT_ENCODED_CHAR=1, PLUS=2, CHARS=3;
public static final String[] tokenNames = {
"", "PERCENT_ENCODED_CHAR", "'+'", "CHARS"
};
public static final int
RULE_parse = 0, RULE_percentEncodedChar = 1, RULE_plusEncodedSpace = 2,
RULE_unencodedChars = 3;
public static final String[] ruleNames = {
"parse", "percentEncodedChar", "plusEncodedSpace", "unencodedChars"
};
@Override
public String getGrammarFileName() { return "EncodedURL.g4"; }
@Override
public String[] getTokenNames() { return tokenNames; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public ATN getATN() { return _ATN; }
public EncodedURLParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class ParseContext extends ParserRuleContext {
public UnencodedCharsContext unencodedChars() {
return getRuleContext(UnencodedCharsContext.class,0);
}
public PercentEncodedCharContext percentEncodedChar() {
return getRuleContext(PercentEncodedCharContext.class,0);
}
public ParseContext parse() {
return getRuleContext(ParseContext.class,0);
}
public PlusEncodedSpaceContext plusEncodedSpace() {
return getRuleContext(PlusEncodedSpaceContext.class,0);
}
public TerminalNode EOF() { return getToken(EncodedURLParser.EOF, 0); }
public ParseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_parse; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof EncodedURLListener ) ((EncodedURLListener)listener).enterParse(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof EncodedURLListener ) ((EncodedURLListener)listener).exitParse(this);
}
}
public final ParseContext parse() throws RecognitionException {
ParseContext _localctx = new ParseContext(_ctx, getState());
enterRule(_localctx, 0, RULE_parse);
try {
setState(18);
switch (_input.LA(1)) {
case PERCENT_ENCODED_CHAR:
enterOuterAlt(_localctx, 1);
{
setState(8); percentEncodedChar();
setState(9); parse();
}
break;
case PLUS:
enterOuterAlt(_localctx, 2);
{
setState(11); plusEncodedSpace();
setState(12); parse();
}
break;
case CHARS:
enterOuterAlt(_localctx, 3);
{
setState(14); unencodedChars();
setState(15); parse();
}
break;
case EOF:
enterOuterAlt(_localctx, 4);
{
setState(17); match(EOF);
}
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 class PercentEncodedCharContext extends ParserRuleContext {
public Token value;
public TerminalNode PERCENT_ENCODED_CHAR() { return getToken(EncodedURLParser.PERCENT_ENCODED_CHAR, 0); }
public PercentEncodedCharContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_percentEncodedChar; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof EncodedURLListener ) ((EncodedURLListener)listener).enterPercentEncodedChar(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof EncodedURLListener ) ((EncodedURLListener)listener).exitPercentEncodedChar(this);
}
}
public final PercentEncodedCharContext percentEncodedChar() throws RecognitionException {
PercentEncodedCharContext _localctx = new PercentEncodedCharContext(_ctx, getState());
enterRule(_localctx, 2, RULE_percentEncodedChar);
try {
enterOuterAlt(_localctx, 1);
{
setState(20); ((PercentEncodedCharContext)_localctx).value = match(PERCENT_ENCODED_CHAR);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PlusEncodedSpaceContext extends ParserRuleContext {
public Token value;
public TerminalNode PLUS() { return getToken(EncodedURLParser.PLUS, 0); }
public PlusEncodedSpaceContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_plusEncodedSpace; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof EncodedURLListener ) ((EncodedURLListener)listener).enterPlusEncodedSpace(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof EncodedURLListener ) ((EncodedURLListener)listener).exitPlusEncodedSpace(this);
}
}
public final PlusEncodedSpaceContext plusEncodedSpace() throws RecognitionException {
PlusEncodedSpaceContext _localctx = new PlusEncodedSpaceContext(_ctx, getState());
enterRule(_localctx, 4, RULE_plusEncodedSpace);
try {
enterOuterAlt(_localctx, 1);
{
setState(22); ((PlusEncodedSpaceContext)_localctx).value = match(PLUS);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class UnencodedCharsContext extends ParserRuleContext {
public Token value;
public TerminalNode CHARS() { return getToken(EncodedURLParser.CHARS, 0); }
public UnencodedCharsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_unencodedChars; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof EncodedURLListener ) ((EncodedURLListener)listener).enterUnencodedChars(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof EncodedURLListener ) ((EncodedURLListener)listener).exitUnencodedChars(this);
}
}
public final UnencodedCharsContext unencodedChars() throws RecognitionException {
UnencodedCharsContext _localctx = new UnencodedCharsContext(_ctx, getState());
enterRule(_localctx, 6, RULE_unencodedChars);
try {
enterOuterAlt(_localctx, 1);
{
setState(24); ((UnencodedCharsContext)_localctx).value = match(CHARS);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static final String _serializedATN =
"\2\3\5\35\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\3\2\3\2\3\2\3\2\3\2\3\2\3\2"+
"\3\2\3\2\3\2\5\2\25\n\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\2\6\2\4\6\b\2\2\33"+
"\2\24\3\2\2\2\4\26\3\2\2\2\6\30\3\2\2\2\b\32\3\2\2\2\n\13\5\4\3\2\13\f"+
"\5\2\2\2\f\25\3\2\2\2\r\16\5\6\4\2\16\17\5\2\2\2\17\25\3\2\2\2\20\21\5"+
"\b\5\2\21\22\5\2\2\2\22\25\3\2\2\2\23\25\7\1\2\2\24\n\3\2\2\2\24\r\3\2"+
"\2\2\24\20\3\2\2\2\24\23\3\2\2\2\25\3\3\2\2\2\26\27\7\3\2\2\27\5\3\2\2"+
"\2\30\31\7\4\2\2\31\7\3\2\2\2\32\33\7\5\2\2\33\t\3\2\2\2\3\24";
public static final ATN _ATN =
ATNSimulator.deserialize(_serializedATN.toCharArray());
static {
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
}
}