Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
g-central.yangkit.yangkit-model-impl.1.4.4.source-code.IfFeatureExpressionParser Maven / Gradle / Ivy
// Generated from IfFeatureExpression.g4 by ANTLR 4.9.3
package org.yangcentral.yangkit.antlr;
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 IfFeatureExpressionParser extends Parser {
static { RuntimeMetaData.checkVersion("4.9.3", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
NOT=1, LP=2, RP=3, AND=4, OR=5, COLON=6, SEP=7, IDENTIFIER=8;
public static final int
RULE_if_feature_expr = 0, RULE_if_feature_term = 1, RULE_if_feature_factor = 2,
RULE_identifier_ref_arg = 3;
private static String[] makeRuleNames() {
return new String[] {
"if_feature_expr", "if_feature_term", "if_feature_factor", "identifier_ref_arg"
};
}
public static final String[] ruleNames = makeRuleNames();
private static String[] makeLiteralNames() {
return new String[] {
null, "'not'", "'('", "')'", "'and'", "'or'", "':'"
};
}
private static final String[] _LITERAL_NAMES = makeLiteralNames();
private static String[] makeSymbolicNames() {
return new String[] {
null, "NOT", "LP", "RP", "AND", "OR", "COLON", "SEP", "IDENTIFIER"
};
}
private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
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 "IfFeatureExpression.g4"; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String getSerializedATN() { return _serializedATN; }
@Override
public ATN getATN() { return _ATN; }
public IfFeatureExpressionParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class If_feature_exprContext extends ParserRuleContext {
public If_feature_termContext if_feature_term() {
return getRuleContext(If_feature_termContext.class,0);
}
public List SEP() { return getTokens(IfFeatureExpressionParser.SEP); }
public TerminalNode SEP(int i) {
return getToken(IfFeatureExpressionParser.SEP, i);
}
public TerminalNode OR() { return getToken(IfFeatureExpressionParser.OR, 0); }
public If_feature_exprContext if_feature_expr() {
return getRuleContext(If_feature_exprContext.class,0);
}
public If_feature_exprContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_if_feature_expr; }
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof IfFeatureExpressionVisitor ) return ((IfFeatureExpressionVisitor extends T>)visitor).visitIf_feature_expr(this);
else return visitor.visitChildren(this);
}
}
public final If_feature_exprContext if_feature_expr() throws RecognitionException {
If_feature_exprContext _localctx = new If_feature_exprContext(_ctx, getState());
enterRule(_localctx, 0, RULE_if_feature_expr);
try {
enterOuterAlt(_localctx, 1);
{
setState(8);
if_feature_term();
setState(13);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) {
case 1:
{
setState(9);
match(SEP);
setState(10);
match(OR);
setState(11);
match(SEP);
setState(12);
if_feature_expr();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class If_feature_termContext extends ParserRuleContext {
public If_feature_factorContext if_feature_factor() {
return getRuleContext(If_feature_factorContext.class,0);
}
public List SEP() { return getTokens(IfFeatureExpressionParser.SEP); }
public TerminalNode SEP(int i) {
return getToken(IfFeatureExpressionParser.SEP, i);
}
public TerminalNode AND() { return getToken(IfFeatureExpressionParser.AND, 0); }
public If_feature_termContext if_feature_term() {
return getRuleContext(If_feature_termContext.class,0);
}
public If_feature_termContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_if_feature_term; }
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof IfFeatureExpressionVisitor ) return ((IfFeatureExpressionVisitor extends T>)visitor).visitIf_feature_term(this);
else return visitor.visitChildren(this);
}
}
public final If_feature_termContext if_feature_term() throws RecognitionException {
If_feature_termContext _localctx = new If_feature_termContext(_ctx, getState());
enterRule(_localctx, 2, RULE_if_feature_term);
try {
enterOuterAlt(_localctx, 1);
{
setState(15);
if_feature_factor();
setState(20);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) {
case 1:
{
setState(16);
match(SEP);
setState(17);
match(AND);
setState(18);
match(SEP);
setState(19);
if_feature_term();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class If_feature_factorContext extends ParserRuleContext {
public TerminalNode NOT() { return getToken(IfFeatureExpressionParser.NOT, 0); }
public List SEP() { return getTokens(IfFeatureExpressionParser.SEP); }
public TerminalNode SEP(int i) {
return getToken(IfFeatureExpressionParser.SEP, i);
}
public If_feature_factorContext if_feature_factor() {
return getRuleContext(If_feature_factorContext.class,0);
}
public TerminalNode LP() { return getToken(IfFeatureExpressionParser.LP, 0); }
public If_feature_exprContext if_feature_expr() {
return getRuleContext(If_feature_exprContext.class,0);
}
public TerminalNode RP() { return getToken(IfFeatureExpressionParser.RP, 0); }
public Identifier_ref_argContext identifier_ref_arg() {
return getRuleContext(Identifier_ref_argContext.class,0);
}
public If_feature_factorContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_if_feature_factor; }
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof IfFeatureExpressionVisitor ) return ((IfFeatureExpressionVisitor extends T>)visitor).visitIf_feature_factor(this);
else return visitor.visitChildren(this);
}
}
public final If_feature_factorContext if_feature_factor() throws RecognitionException {
If_feature_factorContext _localctx = new If_feature_factorContext(_ctx, getState());
enterRule(_localctx, 4, RULE_if_feature_factor);
int _la;
try {
setState(36);
_errHandler.sync(this);
switch (_input.LA(1)) {
case NOT:
enterOuterAlt(_localctx, 1);
{
setState(22);
match(NOT);
setState(23);
match(SEP);
setState(24);
if_feature_factor();
}
break;
case LP:
enterOuterAlt(_localctx, 2);
{
setState(25);
match(LP);
setState(27);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==SEP) {
{
setState(26);
match(SEP);
}
}
setState(29);
if_feature_expr();
setState(31);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==SEP) {
{
setState(30);
match(SEP);
}
}
setState(33);
match(RP);
}
break;
case IDENTIFIER:
enterOuterAlt(_localctx, 3);
{
setState(35);
identifier_ref_arg();
}
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 Identifier_ref_argContext extends ParserRuleContext {
public List IDENTIFIER() { return getTokens(IfFeatureExpressionParser.IDENTIFIER); }
public TerminalNode IDENTIFIER(int i) {
return getToken(IfFeatureExpressionParser.IDENTIFIER, i);
}
public TerminalNode COLON() { return getToken(IfFeatureExpressionParser.COLON, 0); }
public Identifier_ref_argContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_identifier_ref_arg; }
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof IfFeatureExpressionVisitor ) return ((IfFeatureExpressionVisitor extends T>)visitor).visitIdentifier_ref_arg(this);
else return visitor.visitChildren(this);
}
}
public final Identifier_ref_argContext identifier_ref_arg() throws RecognitionException {
Identifier_ref_argContext _localctx = new Identifier_ref_argContext(_ctx, getState());
enterRule(_localctx, 6, RULE_identifier_ref_arg);
try {
enterOuterAlt(_localctx, 1);
{
setState(40);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) {
case 1:
{
setState(38);
match(IDENTIFIER);
setState(39);
match(COLON);
}
break;
}
setState(42);
match(IDENTIFIER);
}
}
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\n/\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\5\2\20\n\2\3\3\3\3\3\3\3\3\3\3"+
"\5\3\27\n\3\3\4\3\4\3\4\3\4\3\4\5\4\36\n\4\3\4\3\4\5\4\"\n\4\3\4\3\4\3"+
"\4\5\4\'\n\4\3\5\3\5\5\5+\n\5\3\5\3\5\3\5\2\2\6\2\4\6\b\2\2\2\61\2\n\3"+
"\2\2\2\4\21\3\2\2\2\6&\3\2\2\2\b*\3\2\2\2\n\17\5\4\3\2\13\f\7\t\2\2\f"+
"\r\7\7\2\2\r\16\7\t\2\2\16\20\5\2\2\2\17\13\3\2\2\2\17\20\3\2\2\2\20\3"+
"\3\2\2\2\21\26\5\6\4\2\22\23\7\t\2\2\23\24\7\6\2\2\24\25\7\t\2\2\25\27"+
"\5\4\3\2\26\22\3\2\2\2\26\27\3\2\2\2\27\5\3\2\2\2\30\31\7\3\2\2\31\32"+
"\7\t\2\2\32\'\5\6\4\2\33\35\7\4\2\2\34\36\7\t\2\2\35\34\3\2\2\2\35\36"+
"\3\2\2\2\36\37\3\2\2\2\37!\5\2\2\2 \"\7\t\2\2! \3\2\2\2!\"\3\2\2\2\"#"+
"\3\2\2\2#$\7\5\2\2$\'\3\2\2\2%\'\5\b\5\2&\30\3\2\2\2&\33\3\2\2\2&%\3\2"+
"\2\2\'\7\3\2\2\2()\7\n\2\2)+\7\b\2\2*(\3\2\2\2*+\3\2\2\2+,\3\2\2\2,-\7"+
"\n\2\2-\t\3\2\2\2\b\17\26\35!&*";
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);
}
}
}