org.babyfish.jimmer.sql.fetcher.FetcherParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jimmer-sql Show documentation
Show all versions of jimmer-sql Show documentation
A revolutionary ORM framework for both java and kotlin
// Generated from org/babyfish/jimmer/sql/fetcher/Fetcher.g4 by ANTLR 4.13.0
package org.babyfish.jimmer.sql.fetcher;
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 FetcherParser extends Parser {
static { RuntimeMetaData.checkVersion("4.13.0", 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, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9,
T__9=10, T__10=11, T__11=12, Identifier=13, Number=14, WS=15;
public static final int
RULE_fetcher = 0, RULE_fetchBody = 1, RULE_field = 2, RULE_argument = 3,
RULE_entityType = 4;
private static String[] makeRuleNames() {
return new String[] {
"fetcher", "fetchBody", "field", "argument", "entityType"
};
}
public static final String[] ruleNames = makeRuleNames();
private static String[] makeLiteralNames() {
return new String[] {
null, "'{'", "'}'", "'@'", "'implicit'", "'('", "','", "')'", "':'",
"'true'", "'false'", "''", "'.'"
};
}
private static final String[] _LITERAL_NAMES = makeLiteralNames();
private static String[] makeSymbolicNames() {
return new String[] {
null, null, null, null, null, null, null, null, null, null, null, null,
null, "Identifier", "Number", "WS"
};
}
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 "Fetcher.g4"; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String getSerializedATN() { return _serializedATN; }
@Override
public ATN getATN() { return _ATN; }
public FetcherParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
@SuppressWarnings("CheckReturnValue")
public static class FetcherContext extends ParserRuleContext {
public EntityTypeContext type;
public FetchBodyContext body;
public TerminalNode EOF() { return getToken(FetcherParser.EOF, 0); }
public FetchBodyContext fetchBody() {
return getRuleContext(FetchBodyContext.class,0);
}
public EntityTypeContext entityType() {
return getRuleContext(EntityTypeContext.class,0);
}
public FetcherContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_fetcher; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof FetcherListener ) ((FetcherListener)listener).enterFetcher(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof FetcherListener ) ((FetcherListener)listener).exitFetcher(this);
}
}
public final FetcherContext fetcher() throws RecognitionException {
FetcherContext _localctx = new FetcherContext(_ctx, getState());
enterRule(_localctx, 0, RULE_fetcher);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(11);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Identifier) {
{
setState(10);
((FetcherContext)_localctx).type = entityType();
}
}
setState(13);
((FetcherContext)_localctx).body = fetchBody();
setState(14);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class FetchBodyContext extends ParserRuleContext {
public FieldContext field;
public List fields = new ArrayList();
public List field() {
return getRuleContexts(FieldContext.class);
}
public FieldContext field(int i) {
return getRuleContext(FieldContext.class,i);
}
public FetchBodyContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_fetchBody; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof FetcherListener ) ((FetcherListener)listener).enterFetchBody(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof FetcherListener ) ((FetcherListener)listener).exitFetchBody(this);
}
}
public final FetchBodyContext fetchBody() throws RecognitionException {
FetchBodyContext _localctx = new FetchBodyContext(_ctx, getState());
enterRule(_localctx, 2, RULE_fetchBody);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(16);
match(T__0);
setState(20);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__2 || _la==Identifier) {
{
{
setState(17);
((FetchBodyContext)_localctx).field = field();
((FetchBodyContext)_localctx).fields.add(((FetchBodyContext)_localctx).field);
}
}
setState(22);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(23);
match(T__1);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class FieldContext extends ParserRuleContext {
public Token implicit;
public Token prop;
public ArgumentContext argument;
public List arguments = new ArrayList();
public FetchBodyContext body;
public TerminalNode Identifier() { return getToken(FetcherParser.Identifier, 0); }
public List argument() {
return getRuleContexts(ArgumentContext.class);
}
public ArgumentContext argument(int i) {
return getRuleContext(ArgumentContext.class,i);
}
public FetchBodyContext fetchBody() {
return getRuleContext(FetchBodyContext.class,0);
}
public FieldContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_field; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof FetcherListener ) ((FetcherListener)listener).enterField(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof FetcherListener ) ((FetcherListener)listener).exitField(this);
}
}
public final FieldContext field() throws RecognitionException {
FieldContext _localctx = new FieldContext(_ctx, getState());
enterRule(_localctx, 4, RULE_field);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(27);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__2) {
{
setState(25);
match(T__2);
setState(26);
((FieldContext)_localctx).implicit = match(T__3);
}
}
setState(29);
((FieldContext)_localctx).prop = match(Identifier);
setState(41);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__4) {
{
setState(30);
match(T__4);
setState(31);
((FieldContext)_localctx).argument = argument();
((FieldContext)_localctx).arguments.add(((FieldContext)_localctx).argument);
setState(36);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__5) {
{
{
setState(32);
match(T__5);
setState(33);
((FieldContext)_localctx).argument = argument();
((FieldContext)_localctx).arguments.add(((FieldContext)_localctx).argument);
}
}
setState(38);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(39);
match(T__6);
}
}
setState(44);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__0) {
{
setState(43);
((FieldContext)_localctx).body = fetchBody();
}
}
setState(47);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__5) {
{
setState(46);
match(T__5);
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ArgumentContext extends ParserRuleContext {
public Token name;
public Token value;
public TerminalNode Number() { return getToken(FetcherParser.Number, 0); }
public TerminalNode Identifier() { return getToken(FetcherParser.Identifier, 0); }
public ArgumentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_argument; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof FetcherListener ) ((FetcherListener)listener).enterArgument(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof FetcherListener ) ((FetcherListener)listener).exitArgument(this);
}
}
public final ArgumentContext argument() throws RecognitionException {
ArgumentContext _localctx = new ArgumentContext(_ctx, getState());
enterRule(_localctx, 6, RULE_argument);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
{
setState(49);
((ArgumentContext)_localctx).name = match(Identifier);
}
setState(50);
match(T__7);
setState(51);
((ArgumentContext)_localctx).value = _input.LT(1);
_la = _input.LA(1);
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 19968L) != 0)) ) {
((ArgumentContext)_localctx).value = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class EntityTypeContext extends ParserRuleContext {
public Token Identifier;
public List parts = new ArrayList();
public List Identifier() { return getTokens(FetcherParser.Identifier); }
public TerminalNode Identifier(int i) {
return getToken(FetcherParser.Identifier, i);
}
public EntityTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_entityType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof FetcherListener ) ((FetcherListener)listener).enterEntityType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof FetcherListener ) ((FetcherListener)listener).exitEntityType(this);
}
}
public final EntityTypeContext entityType() throws RecognitionException {
EntityTypeContext _localctx = new EntityTypeContext(_ctx, getState());
enterRule(_localctx, 8, RULE_entityType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(53);
((EntityTypeContext)_localctx).Identifier = match(Identifier);
((EntityTypeContext)_localctx).parts.add(((EntityTypeContext)_localctx).Identifier);
setState(58);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__11) {
{
{
setState(54);
match(T__11);
setState(55);
((EntityTypeContext)_localctx).Identifier = match(Identifier);
((EntityTypeContext)_localctx).parts.add(((EntityTypeContext)_localctx).Identifier);
}
}
setState(60);
_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 final String _serializedATN =
"\u0004\u0001\u000f>\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+
"\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0001"+
"\u0000\u0003\u0000\f\b\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001"+
"\u0001\u0001\u0001\u0005\u0001\u0013\b\u0001\n\u0001\f\u0001\u0016\t\u0001"+
"\u0001\u0001\u0001\u0001\u0001\u0002\u0001\u0002\u0003\u0002\u001c\b\u0002"+
"\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0005\u0002"+
"#\b\u0002\n\u0002\f\u0002&\t\u0002\u0001\u0002\u0001\u0002\u0003\u0002"+
"*\b\u0002\u0001\u0002\u0003\u0002-\b\u0002\u0001\u0002\u0003\u00020\b"+
"\u0002\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0004\u0001"+
"\u0004\u0001\u0004\u0005\u00049\b\u0004\n\u0004\f\u0004<\t\u0004\u0001"+
"\u0004\u0000\u0000\u0005\u0000\u0002\u0004\u0006\b\u0000\u0001\u0002\u0000"+
"\t\u000b\u000e\u000e@\u0000\u000b\u0001\u0000\u0000\u0000\u0002\u0010"+
"\u0001\u0000\u0000\u0000\u0004\u001b\u0001\u0000\u0000\u0000\u00061\u0001"+
"\u0000\u0000\u0000\b5\u0001\u0000\u0000\u0000\n\f\u0003\b\u0004\u0000"+
"\u000b\n\u0001\u0000\u0000\u0000\u000b\f\u0001\u0000\u0000\u0000\f\r\u0001"+
"\u0000\u0000\u0000\r\u000e\u0003\u0002\u0001\u0000\u000e\u000f\u0005\u0000"+
"\u0000\u0001\u000f\u0001\u0001\u0000\u0000\u0000\u0010\u0014\u0005\u0001"+
"\u0000\u0000\u0011\u0013\u0003\u0004\u0002\u0000\u0012\u0011\u0001\u0000"+
"\u0000\u0000\u0013\u0016\u0001\u0000\u0000\u0000\u0014\u0012\u0001\u0000"+
"\u0000\u0000\u0014\u0015\u0001\u0000\u0000\u0000\u0015\u0017\u0001\u0000"+
"\u0000\u0000\u0016\u0014\u0001\u0000\u0000\u0000\u0017\u0018\u0005\u0002"+
"\u0000\u0000\u0018\u0003\u0001\u0000\u0000\u0000\u0019\u001a\u0005\u0003"+
"\u0000\u0000\u001a\u001c\u0005\u0004\u0000\u0000\u001b\u0019\u0001\u0000"+
"\u0000\u0000\u001b\u001c\u0001\u0000\u0000\u0000\u001c\u001d\u0001\u0000"+
"\u0000\u0000\u001d)\u0005\r\u0000\u0000\u001e\u001f\u0005\u0005\u0000"+
"\u0000\u001f$\u0003\u0006\u0003\u0000 !\u0005\u0006\u0000\u0000!#\u0003"+
"\u0006\u0003\u0000\" \u0001\u0000\u0000\u0000#&\u0001\u0000\u0000\u0000"+
"$\"\u0001\u0000\u0000\u0000$%\u0001\u0000\u0000\u0000%\'\u0001\u0000\u0000"+
"\u0000&$\u0001\u0000\u0000\u0000\'(\u0005\u0007\u0000\u0000(*\u0001\u0000"+
"\u0000\u0000)\u001e\u0001\u0000\u0000\u0000)*\u0001\u0000\u0000\u0000"+
"*,\u0001\u0000\u0000\u0000+-\u0003\u0002\u0001\u0000,+\u0001\u0000\u0000"+
"\u0000,-\u0001\u0000\u0000\u0000-/\u0001\u0000\u0000\u0000.0\u0005\u0006"+
"\u0000\u0000/.\u0001\u0000\u0000\u0000/0\u0001\u0000\u0000\u00000\u0005"+
"\u0001\u0000\u0000\u000012\u0005\r\u0000\u000023\u0005\b\u0000\u00003"+
"4\u0007\u0000\u0000\u00004\u0007\u0001\u0000\u0000\u00005:\u0005\r\u0000"+
"\u000067\u0005\f\u0000\u000079\u0005\r\u0000\u000086\u0001\u0000\u0000"+
"\u00009<\u0001\u0000\u0000\u0000:8\u0001\u0000\u0000\u0000:;\u0001\u0000"+
"\u0000\u0000;\t\u0001\u0000\u0000\u0000<:\u0001\u0000\u0000\u0000\b\u000b"+
"\u0014\u001b$),/:";
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);
}
}
}