io.rivulet.HTMLCharReferencesParser Maven / Gradle / Ivy
The newest version!
// Generated from io/rivulet/HTMLCharReferences.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 HTMLCharReferencesParser extends Parser {
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
HEX_CHAR_REF=1, DECIMAL_CHAR_REF=2, NAMED_CHAR_REF=3, CHARS=4;
public static final String[] tokenNames = {
"", "HEX_CHAR_REF", "DECIMAL_CHAR_REF", "NAMED_CHAR_REF", "CHARS"
};
public static final int
RULE_parse = 0, RULE_hexCharRef = 1, RULE_decimalCharRef = 2, RULE_namedCharRef = 3,
RULE_unescapedChars = 4;
public static final String[] ruleNames = {
"parse", "hexCharRef", "decimalCharRef", "namedCharRef", "unescapedChars"
};
@Override
public String getGrammarFileName() { return "HTMLCharReferences.g4"; }
@Override
public String[] getTokenNames() { return tokenNames; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public ATN getATN() { return _ATN; }
public HTMLCharReferencesParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class ParseContext extends ParserRuleContext {
public DecimalCharRefContext decimalCharRef() {
return getRuleContext(DecimalCharRefContext.class,0);
}
public NamedCharRefContext namedCharRef() {
return getRuleContext(NamedCharRefContext.class,0);
}
public HexCharRefContext hexCharRef() {
return getRuleContext(HexCharRefContext.class,0);
}
public ParseContext parse() {
return getRuleContext(ParseContext.class,0);
}
public UnescapedCharsContext unescapedChars() {
return getRuleContext(UnescapedCharsContext.class,0);
}
public TerminalNode EOF() { return getToken(HTMLCharReferencesParser.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 HTMLCharReferencesListener ) ((HTMLCharReferencesListener)listener).enterParse(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof HTMLCharReferencesListener ) ((HTMLCharReferencesListener)listener).exitParse(this);
}
}
public final ParseContext parse() throws RecognitionException {
ParseContext _localctx = new ParseContext(_ctx, getState());
enterRule(_localctx, 0, RULE_parse);
try {
setState(23);
switch (_input.LA(1)) {
case HEX_CHAR_REF:
enterOuterAlt(_localctx, 1);
{
setState(10); hexCharRef();
setState(11); parse();
}
break;
case DECIMAL_CHAR_REF:
enterOuterAlt(_localctx, 2);
{
setState(13); decimalCharRef();
setState(14); parse();
}
break;
case NAMED_CHAR_REF:
enterOuterAlt(_localctx, 3);
{
setState(16); namedCharRef();
setState(17); parse();
}
break;
case CHARS:
enterOuterAlt(_localctx, 4);
{
setState(19); unescapedChars();
setState(20); parse();
}
break;
case EOF:
enterOuterAlt(_localctx, 5);
{
setState(22); 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 HexCharRefContext extends ParserRuleContext {
public Token value;
public TerminalNode HEX_CHAR_REF() { return getToken(HTMLCharReferencesParser.HEX_CHAR_REF, 0); }
public HexCharRefContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_hexCharRef; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof HTMLCharReferencesListener ) ((HTMLCharReferencesListener)listener).enterHexCharRef(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof HTMLCharReferencesListener ) ((HTMLCharReferencesListener)listener).exitHexCharRef(this);
}
}
public final HexCharRefContext hexCharRef() throws RecognitionException {
HexCharRefContext _localctx = new HexCharRefContext(_ctx, getState());
enterRule(_localctx, 2, RULE_hexCharRef);
try {
enterOuterAlt(_localctx, 1);
{
setState(25); ((HexCharRefContext)_localctx).value = match(HEX_CHAR_REF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class DecimalCharRefContext extends ParserRuleContext {
public Token value;
public TerminalNode DECIMAL_CHAR_REF() { return getToken(HTMLCharReferencesParser.DECIMAL_CHAR_REF, 0); }
public DecimalCharRefContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_decimalCharRef; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof HTMLCharReferencesListener ) ((HTMLCharReferencesListener)listener).enterDecimalCharRef(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof HTMLCharReferencesListener ) ((HTMLCharReferencesListener)listener).exitDecimalCharRef(this);
}
}
public final DecimalCharRefContext decimalCharRef() throws RecognitionException {
DecimalCharRefContext _localctx = new DecimalCharRefContext(_ctx, getState());
enterRule(_localctx, 4, RULE_decimalCharRef);
try {
enterOuterAlt(_localctx, 1);
{
setState(27); ((DecimalCharRefContext)_localctx).value = match(DECIMAL_CHAR_REF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class NamedCharRefContext extends ParserRuleContext {
public Token value;
public TerminalNode NAMED_CHAR_REF() { return getToken(HTMLCharReferencesParser.NAMED_CHAR_REF, 0); }
public NamedCharRefContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_namedCharRef; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof HTMLCharReferencesListener ) ((HTMLCharReferencesListener)listener).enterNamedCharRef(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof HTMLCharReferencesListener ) ((HTMLCharReferencesListener)listener).exitNamedCharRef(this);
}
}
public final NamedCharRefContext namedCharRef() throws RecognitionException {
NamedCharRefContext _localctx = new NamedCharRefContext(_ctx, getState());
enterRule(_localctx, 6, RULE_namedCharRef);
try {
enterOuterAlt(_localctx, 1);
{
setState(29); ((NamedCharRefContext)_localctx).value = match(NAMED_CHAR_REF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class UnescapedCharsContext extends ParserRuleContext {
public Token value;
public TerminalNode CHARS() { return getToken(HTMLCharReferencesParser.CHARS, 0); }
public UnescapedCharsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_unescapedChars; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof HTMLCharReferencesListener ) ((HTMLCharReferencesListener)listener).enterUnescapedChars(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof HTMLCharReferencesListener ) ((HTMLCharReferencesListener)listener).exitUnescapedChars(this);
}
}
public final UnescapedCharsContext unescapedChars() throws RecognitionException {
UnescapedCharsContext _localctx = new UnescapedCharsContext(_ctx, getState());
enterRule(_localctx, 8, RULE_unescapedChars);
try {
enterOuterAlt(_localctx, 1);
{
setState(31); ((UnescapedCharsContext)_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\6$\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\3\2\3\2\3\2\3\2\3\2\3"+
"\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\5\2\32\n\2\3\3\3\3\3\4\3\4\3\5\3\5\3\6"+
"\3\6\3\6\2\7\2\4\6\b\n\2\2\"\2\31\3\2\2\2\4\33\3\2\2\2\6\35\3\2\2\2\b"+
"\37\3\2\2\2\n!\3\2\2\2\f\r\5\4\3\2\r\16\5\2\2\2\16\32\3\2\2\2\17\20\5"+
"\6\4\2\20\21\5\2\2\2\21\32\3\2\2\2\22\23\5\b\5\2\23\24\5\2\2\2\24\32\3"+
"\2\2\2\25\26\5\n\6\2\26\27\5\2\2\2\27\32\3\2\2\2\30\32\7\1\2\2\31\f\3"+
"\2\2\2\31\17\3\2\2\2\31\22\3\2\2\2\31\25\3\2\2\2\31\30\3\2\2\2\32\3\3"+
"\2\2\2\33\34\7\3\2\2\34\5\3\2\2\2\35\36\7\4\2\2\36\7\3\2\2\2\37 \7\5\2"+
"\2 \t\3\2\2\2!\"\7\6\2\2\"\13\3\2\2\2\3\31";
public static final ATN _ATN =
ATNSimulator.deserialize(_serializedATN.toCharArray());
static {
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
}
}