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

com.nedap.archie.adlparser.antlr.ContainedRegexParser Maven / Gradle / Ivy

// Generated from ContainedRegex.g4 by ANTLR 4.5.1
package com.nedap.archie.adlparser.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 ContainedRegexParser extends Parser {
	static { RuntimeMetaData.checkVersion("4.5.1", RuntimeMetaData.VERSION); }

	protected static final DFA[] _decisionToDFA;
	protected static final PredictionContextCache _sharedContextCache =
		new PredictionContextCache();
	public static final int
		STRING=1, REGEX=2, SEMICOLON=3, LPAREN=4, RPAREN=5, WS=6;
	public static final int
		RULE_regex = 0;
	public static final String[] ruleNames = {
		"regex"
	};

	private static final String[] _LITERAL_NAMES = {
		null, null, null, "';'", "'{'", "'}'"
	};
	private static final String[] _SYMBOLIC_NAMES = {
		null, "STRING", "REGEX", "SEMICOLON", "LPAREN", "RPAREN", "WS"
	};
	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 "ContainedRegex.g4"; }

	@Override
	public String[] getRuleNames() { return ruleNames; }

	@Override
	public String getSerializedATN() { return _serializedATN; }

	@Override
	public ATN getATN() { return _ATN; }

	public ContainedRegexParser(TokenStream input) {
		super(input);
		_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
	}
	public static class RegexContext extends ParserRuleContext {
		public TerminalNode REGEX() { return getToken(ContainedRegexParser.REGEX, 0); }
		public TerminalNode SEMICOLON() { return getToken(ContainedRegexParser.SEMICOLON, 0); }
		public TerminalNode STRING() { return getToken(ContainedRegexParser.STRING, 0); }
		public RegexContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_regex; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof ContainedRegexListener ) ((ContainedRegexListener)listener).enterRegex(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof ContainedRegexListener ) ((ContainedRegexListener)listener).exitRegex(this);
		}
	}

	public final RegexContext regex() throws RecognitionException {
		RegexContext _localctx = new RegexContext(_ctx, getState());
		enterRule(_localctx, 0, RULE_regex);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(2);
			match(LPAREN);
			setState(3);
			match(REGEX);
			setState(6);
			_la = _input.LA(1);
			if (_la==SEMICOLON) {
				{
				setState(4);
				match(SEMICOLON);
				setState(5);
				match(STRING);
				}
			}

			setState(8);
			match(RPAREN);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static final String _serializedATN =
		"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3\b\r\4\2\t\2\3\2\3"+
		"\2\3\2\3\2\5\2\t\n\2\3\2\3\2\3\2\2\2\3\2\2\2\f\2\4\3\2\2\2\4\5\7\6\2\2"+
		"\5\b\7\4\2\2\6\7\7\5\2\2\7\t\7\3\2\2\b\6\3\2\2\2\b\t\3\2\2\2\t\n\3\2\2"+
		"\2\n\13\7\7\2\2\13\3\3\2\2\2\3\b";
	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 - 2025 Weber Informatics LLC | Privacy Policy