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

org.apache.druid.data.input.influx.InfluxLineProtocolParser Maven / Gradle / Ivy

// Generated from org/apache/druid/data/input/influx/InfluxLineProtocol.g4 by ANTLR 4.5.1
package org.apache.druid.data.input.influx;
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 InfluxLineProtocolParser 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
		T__0=1, T__1=2, T__2=3, NEWLINE=4, NUMBER=5, BOOLEAN=6, QUOTED_STRING=7, 
		IDENTIFIER_STRING=8;
	public static final int
		RULE_lines = 0, RULE_line = 1, RULE_timestamp = 2, RULE_field_set = 3, 
		RULE_tag_set = 4, RULE_tag_pair = 5, RULE_field_pair = 6, RULE_identifier = 7, 
		RULE_field_value = 8, RULE_eol = 9;
	public static final String[] ruleNames = {
		"lines", "line", "timestamp", "field_set", "tag_set", "tag_pair", "field_pair", 
		"identifier", "field_value", "eol"
	};

	private static final String[] _LITERAL_NAMES = {
		null, "','", "' '", "'='", "'\n'"
	};
	private static final String[] _SYMBOLIC_NAMES = {
		null, null, null, null, "NEWLINE", "NUMBER", "BOOLEAN", "QUOTED_STRING", 
		"IDENTIFIER_STRING"
	};
	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 "InfluxLineProtocol.g4"; }

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

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

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

	public InfluxLineProtocolParser(TokenStream input) {
		super(input);
		_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
	}
	public static class LinesContext extends ParserRuleContext {
		public List line() {
			return getRuleContexts(LineContext.class);
		}
		public LineContext line(int i) {
			return getRuleContext(LineContext.class,i);
		}
		public TerminalNode EOF() { return getToken(InfluxLineProtocolParser.EOF, 0); }
		public LinesContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_lines; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).enterLines(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).exitLines(this);
		}
	}

	public final LinesContext lines() throws RecognitionException {
		LinesContext _localctx = new LinesContext(_ctx, getState());
		enterRule(_localctx, 0, RULE_lines);
		int _la;
		try {
			int _alt;
			enterOuterAlt(_localctx, 1);
			{
			setState(20);
			line();
			setState(25);
			_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(21);
					match(NEWLINE);
					setState(22);
					line();
					}
					} 
				}
				setState(27);
				_errHandler.sync(this);
				_alt = getInterpreter().adaptivePredict(_input,0,_ctx);
			}
			setState(29);
			_la = _input.LA(1);
			if (_la==NEWLINE) {
				{
				setState(28);
				match(NEWLINE);
				}
			}

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

	public static class LineContext extends ParserRuleContext {
		public IdentifierContext identifier() {
			return getRuleContext(IdentifierContext.class,0);
		}
		public Field_setContext field_set() {
			return getRuleContext(Field_setContext.class,0);
		}
		public Tag_setContext tag_set() {
			return getRuleContext(Tag_setContext.class,0);
		}
		public TimestampContext timestamp() {
			return getRuleContext(TimestampContext.class,0);
		}
		public LineContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_line; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).enterLine(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).exitLine(this);
		}
	}

	public final LineContext line() throws RecognitionException {
		LineContext _localctx = new LineContext(_ctx, getState());
		enterRule(_localctx, 2, RULE_line);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(33);
			identifier();
			setState(36);
			_la = _input.LA(1);
			if (_la==T__0) {
				{
				setState(34);
				match(T__0);
				setState(35);
				tag_set();
				}
			}

			setState(38);
			match(T__1);
			setState(39);
			field_set();
			setState(42);
			_la = _input.LA(1);
			if (_la==T__1) {
				{
				setState(40);
				match(T__1);
				setState(41);
				timestamp();
				}
			}

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

	public static class TimestampContext extends ParserRuleContext {
		public TerminalNode NUMBER() { return getToken(InfluxLineProtocolParser.NUMBER, 0); }
		public TimestampContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_timestamp; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).enterTimestamp(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).exitTimestamp(this);
		}
	}

	public final TimestampContext timestamp() throws RecognitionException {
		TimestampContext _localctx = new TimestampContext(_ctx, getState());
		enterRule(_localctx, 4, RULE_timestamp);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(44);
			match(NUMBER);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class Field_setContext extends ParserRuleContext {
		public List field_pair() {
			return getRuleContexts(Field_pairContext.class);
		}
		public Field_pairContext field_pair(int i) {
			return getRuleContext(Field_pairContext.class,i);
		}
		public Field_setContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_field_set; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).enterField_set(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).exitField_set(this);
		}
	}

	public final Field_setContext field_set() throws RecognitionException {
		Field_setContext _localctx = new Field_setContext(_ctx, getState());
		enterRule(_localctx, 6, RULE_field_set);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(46);
			field_pair();
			setState(51);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while (_la==T__0) {
				{
				{
				setState(47);
				match(T__0);
				setState(48);
				field_pair();
				}
				}
				setState(53);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class Tag_setContext extends ParserRuleContext {
		public List tag_pair() {
			return getRuleContexts(Tag_pairContext.class);
		}
		public Tag_pairContext tag_pair(int i) {
			return getRuleContext(Tag_pairContext.class,i);
		}
		public Tag_setContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_tag_set; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).enterTag_set(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).exitTag_set(this);
		}
	}

	public final Tag_setContext tag_set() throws RecognitionException {
		Tag_setContext _localctx = new Tag_setContext(_ctx, getState());
		enterRule(_localctx, 8, RULE_tag_set);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(54);
			tag_pair();
			setState(59);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while (_la==T__0) {
				{
				{
				setState(55);
				match(T__0);
				setState(56);
				tag_pair();
				}
				}
				setState(61);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class Tag_pairContext extends ParserRuleContext {
		public List identifier() {
			return getRuleContexts(IdentifierContext.class);
		}
		public IdentifierContext identifier(int i) {
			return getRuleContext(IdentifierContext.class,i);
		}
		public Tag_pairContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_tag_pair; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).enterTag_pair(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).exitTag_pair(this);
		}
	}

	public final Tag_pairContext tag_pair() throws RecognitionException {
		Tag_pairContext _localctx = new Tag_pairContext(_ctx, getState());
		enterRule(_localctx, 10, RULE_tag_pair);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(62);
			identifier();
			setState(63);
			match(T__2);
			setState(64);
			identifier();
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class Field_pairContext extends ParserRuleContext {
		public IdentifierContext identifier() {
			return getRuleContext(IdentifierContext.class,0);
		}
		public Field_valueContext field_value() {
			return getRuleContext(Field_valueContext.class,0);
		}
		public Field_pairContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_field_pair; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).enterField_pair(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).exitField_pair(this);
		}
	}

	public final Field_pairContext field_pair() throws RecognitionException {
		Field_pairContext _localctx = new Field_pairContext(_ctx, getState());
		enterRule(_localctx, 12, RULE_field_pair);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(66);
			identifier();
			setState(67);
			match(T__2);
			setState(68);
			field_value();
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class IdentifierContext extends ParserRuleContext {
		public TerminalNode IDENTIFIER_STRING() { return getToken(InfluxLineProtocolParser.IDENTIFIER_STRING, 0); }
		public TerminalNode NUMBER() { return getToken(InfluxLineProtocolParser.NUMBER, 0); }
		public TerminalNode BOOLEAN() { return getToken(InfluxLineProtocolParser.BOOLEAN, 0); }
		public IdentifierContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_identifier; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).enterIdentifier(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).exitIdentifier(this);
		}
	}

	public final IdentifierContext identifier() throws RecognitionException {
		IdentifierContext _localctx = new IdentifierContext(_ctx, getState());
		enterRule(_localctx, 14, RULE_identifier);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(70);
			_la = _input.LA(1);
			if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NUMBER) | (1L << BOOLEAN) | (1L << IDENTIFIER_STRING))) != 0)) ) {
			_errHandler.recoverInline(this);
			} else {
				consume();
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class Field_valueContext extends ParserRuleContext {
		public TerminalNode QUOTED_STRING() { return getToken(InfluxLineProtocolParser.QUOTED_STRING, 0); }
		public TerminalNode NUMBER() { return getToken(InfluxLineProtocolParser.NUMBER, 0); }
		public TerminalNode BOOLEAN() { return getToken(InfluxLineProtocolParser.BOOLEAN, 0); }
		public Field_valueContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_field_value; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).enterField_value(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).exitField_value(this);
		}
	}

	public final Field_valueContext field_value() throws RecognitionException {
		Field_valueContext _localctx = new Field_valueContext(_ctx, getState());
		enterRule(_localctx, 16, RULE_field_value);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(72);
			_la = _input.LA(1);
			if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NUMBER) | (1L << BOOLEAN) | (1L << QUOTED_STRING))) != 0)) ) {
			_errHandler.recoverInline(this);
			} else {
				consume();
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class EolContext extends ParserRuleContext {
		public TerminalNode NEWLINE() { return getToken(InfluxLineProtocolParser.NEWLINE, 0); }
		public TerminalNode EOF() { return getToken(InfluxLineProtocolParser.EOF, 0); }
		public EolContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_eol; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).enterEol(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InfluxLineProtocolListener ) ((InfluxLineProtocolListener)listener).exitEol(this);
		}
	}

	public final EolContext eol() throws RecognitionException {
		EolContext _localctx = new EolContext(_ctx, getState());
		enterRule(_localctx, 18, RULE_eol);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(74);
			_la = _input.LA(1);
			if ( !(_la==EOF || _la==NEWLINE) ) {
			_errHandler.recoverInline(this);
			} else {
				consume();
			}
			}
		}
		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\nO\4\2\t\2\4\3\t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2\2\3\2\2\2>\13\3\2\2\2?=\3\2\2\2@A\5\20\t\2AB\7\5\2\2BC\5\20\t\2C\r"+
		"\3\2\2\2DE\5\20\t\2EF\7\5\2\2FG\5\22\n\2G\17\3\2\2\2HI\t\2\2\2I\21\3\2"+
		"\2\2JK\t\3\2\2K\23\3\2\2\2LM\t\4\2\2M\25\3\2\2\2\b\33\37&,\65=";
	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