All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opendaylight.yangtools.yang.parser.antlr.IfFeatureExpressionParser Maven / Gradle / Ivy

There is a newer version: 14.0.4
Show newest version
// Generated from org/opendaylight/yangtools/yang/parser/antlr/IfFeatureExpressionParser.g4 by ANTLR 4.13.1
package org.opendaylight.yangtools.yang.parser.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", "CheckReturnValue"})
public class IfFeatureExpressionParser extends Parser {
	static { RuntimeMetaData.checkVersion("4.13.1", 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 "IfFeatureExpressionParser.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);
	}

	@SuppressWarnings("CheckReturnValue")
	public static class If_feature_exprContext extends ParserRuleContext {
		public List if_feature_term() {
			return getRuleContexts(If_feature_termContext.class);
		}
		public If_feature_termContext if_feature_term(int i) {
			return getRuleContext(If_feature_termContext.class,i);
		}
		public List SEP() { return getTokens(IfFeatureExpressionParser.SEP); }
		public TerminalNode SEP(int i) {
			return getToken(IfFeatureExpressionParser.SEP, i);
		}
		public List OR() { return getTokens(IfFeatureExpressionParser.OR); }
		public TerminalNode OR(int i) {
			return getToken(IfFeatureExpressionParser.OR, i);
		}
		public If_feature_exprContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_if_feature_expr; }
	}

	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 {
			int _alt;
			enterOuterAlt(_localctx, 1);
			{
			setState(8);
			if_feature_term();
			setState(15);
			_errHandler.sync(this);
			_alt = getInterpreter().adaptivePredict(_input,0,_ctx);
			while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					setState(9);
					match(SEP);
					setState(10);
					match(OR);
					setState(11);
					match(SEP);
					setState(12);
					if_feature_term();
					}
					} 
				}
				setState(17);
				_errHandler.sync(this);
				_alt = getInterpreter().adaptivePredict(_input,0,_ctx);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	@SuppressWarnings("CheckReturnValue")
	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 List AND() { return getTokens(IfFeatureExpressionParser.AND); }
		public TerminalNode AND(int i) {
			return getToken(IfFeatureExpressionParser.AND, i);
		}
		public List if_feature_term() {
			return getRuleContexts(If_feature_termContext.class);
		}
		public If_feature_termContext if_feature_term(int i) {
			return getRuleContext(If_feature_termContext.class,i);
		}
		public If_feature_termContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_if_feature_term; }
	}

	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 {
			int _alt;
			enterOuterAlt(_localctx, 1);
			{
			setState(18);
			if_feature_factor();
			setState(25);
			_errHandler.sync(this);
			_alt = getInterpreter().adaptivePredict(_input,1,_ctx);
			while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					setState(19);
					match(SEP);
					setState(20);
					match(AND);
					setState(21);
					match(SEP);
					setState(22);
					if_feature_term();
					}
					} 
				}
				setState(27);
				_errHandler.sync(this);
				_alt = getInterpreter().adaptivePredict(_input,1,_ctx);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	@SuppressWarnings("CheckReturnValue")
	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; }
	}

	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(42);
			_errHandler.sync(this);
			switch (_input.LA(1)) {
			case NOT:
				enterOuterAlt(_localctx, 1);
				{
				setState(28);
				match(NOT);
				setState(29);
				match(SEP);
				setState(30);
				if_feature_factor();
				}
				break;
			case LP:
				enterOuterAlt(_localctx, 2);
				{
				setState(31);
				match(LP);
				setState(33);
				_errHandler.sync(this);
				_la = _input.LA(1);
				if (_la==SEP) {
					{
					setState(32);
					match(SEP);
					}
				}

				setState(35);
				if_feature_expr();
				setState(37);
				_errHandler.sync(this);
				_la = _input.LA(1);
				if (_la==SEP) {
					{
					setState(36);
					match(SEP);
					}
				}

				setState(39);
				match(RP);
				}
				break;
			case IDENTIFIER:
				enterOuterAlt(_localctx, 3);
				{
				setState(41);
				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;
	}

	@SuppressWarnings("CheckReturnValue")
	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; }
	}

	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(46);
			_errHandler.sync(this);
			switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) {
			case 1:
				{
				setState(44);
				match(IDENTIFIER);
				setState(45);
				match(COLON);
				}
				break;
			}
			setState(48);
			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 =
		"\u0004\u0001\b3\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+
		"\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0001\u0000\u0001\u0000\u0001"+
		"\u0000\u0001\u0000\u0001\u0000\u0005\u0000\u000e\b\u0000\n\u0000\f\u0000"+
		"\u0011\t\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+
		"\u0005\u0001\u0018\b\u0001\n\u0001\f\u0001\u001b\t\u0001\u0001\u0002\u0001"+
		"\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0003\u0002\"\b\u0002\u0001"+
		"\u0002\u0001\u0002\u0003\u0002&\b\u0002\u0001\u0002\u0001\u0002\u0001"+
		"\u0002\u0003\u0002+\b\u0002\u0001\u0003\u0001\u0003\u0003\u0003/\b\u0003"+
		"\u0001\u0003\u0001\u0003\u0001\u0003\u0000\u0000\u0004\u0000\u0002\u0004"+
		"\u0006\u0000\u00005\u0000\b\u0001\u0000\u0000\u0000\u0002\u0012\u0001"+
		"\u0000\u0000\u0000\u0004*\u0001\u0000\u0000\u0000\u0006.\u0001\u0000\u0000"+
		"\u0000\b\u000f\u0003\u0002\u0001\u0000\t\n\u0005\u0007\u0000\u0000\n\u000b"+
		"\u0005\u0005\u0000\u0000\u000b\f\u0005\u0007\u0000\u0000\f\u000e\u0003"+
		"\u0002\u0001\u0000\r\t\u0001\u0000\u0000\u0000\u000e\u0011\u0001\u0000"+
		"\u0000\u0000\u000f\r\u0001\u0000\u0000\u0000\u000f\u0010\u0001\u0000\u0000"+
		"\u0000\u0010\u0001\u0001\u0000\u0000\u0000\u0011\u000f\u0001\u0000\u0000"+
		"\u0000\u0012\u0019\u0003\u0004\u0002\u0000\u0013\u0014\u0005\u0007\u0000"+
		"\u0000\u0014\u0015\u0005\u0004\u0000\u0000\u0015\u0016\u0005\u0007\u0000"+
		"\u0000\u0016\u0018\u0003\u0002\u0001\u0000\u0017\u0013\u0001\u0000\u0000"+
		"\u0000\u0018\u001b\u0001\u0000\u0000\u0000\u0019\u0017\u0001\u0000\u0000"+
		"\u0000\u0019\u001a\u0001\u0000\u0000\u0000\u001a\u0003\u0001\u0000\u0000"+
		"\u0000\u001b\u0019\u0001\u0000\u0000\u0000\u001c\u001d\u0005\u0001\u0000"+
		"\u0000\u001d\u001e\u0005\u0007\u0000\u0000\u001e+\u0003\u0004\u0002\u0000"+
		"\u001f!\u0005\u0002\u0000\u0000 \"\u0005\u0007\u0000\u0000! \u0001\u0000"+
		"\u0000\u0000!\"\u0001\u0000\u0000\u0000\"#\u0001\u0000\u0000\u0000#%\u0003"+
		"\u0000\u0000\u0000$&\u0005\u0007\u0000\u0000%$\u0001\u0000\u0000\u0000"+
		"%&\u0001\u0000\u0000\u0000&\'\u0001\u0000\u0000\u0000\'(\u0005\u0003\u0000"+
		"\u0000(+\u0001\u0000\u0000\u0000)+\u0003\u0006\u0003\u0000*\u001c\u0001"+
		"\u0000\u0000\u0000*\u001f\u0001\u0000\u0000\u0000*)\u0001\u0000\u0000"+
		"\u0000+\u0005\u0001\u0000\u0000\u0000,-\u0005\b\u0000\u0000-/\u0005\u0006"+
		"\u0000\u0000.,\u0001\u0000\u0000\u0000./\u0001\u0000\u0000\u0000/0\u0001"+
		"\u0000\u0000\u000001\u0005\b\u0000\u00001\u0007\u0001\u0000\u0000\u0000"+
		"\u0006\u000f\u0019!%*.";
	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);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy