edu.illinois.cs.cs125.questioner.antlr.KotlinParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plugin Show documentation
Show all versions of plugin Show documentation
Questioner Gradle plugin for CS 124.
// Generated from edu/illinois/cs/cs125/questioner/antlr/kotlin/KotlinParser.g4 by ANTLR 4.13.2
package edu.illinois.cs.cs125.questioner.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", "this-escape"})
public class KotlinParser extends Parser {
static { RuntimeMetaData.checkVersion("4.13.2", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
ShebangLine=1, JavadocComment=2, DelimitedComment=3, LineComment=4, WS=5,
NL=6, RESERVED=7, DOT=8, COMMA=9, LPAREN=10, RPAREN=11, LSQUARE=12, RSQUARE=13,
LCURL=14, RCURL=15, MULT=16, MOD=17, DIV=18, ADD=19, SUB=20, INCR=21,
DECR=22, CONJ=23, DISJ=24, EXCL=25, COLON=26, SEMICOLON=27, ASSIGNMENT=28,
ADD_ASSIGNMENT=29, SUB_ASSIGNMENT=30, MULT_ASSIGNMENT=31, DIV_ASSIGNMENT=32,
MOD_ASSIGNMENT=33, ARROW=34, DOUBLE_ARROW=35, RANGE=36, RANGE_UNTIL=37,
COLONCOLON=38, Q_COLONCOLON=39, DOUBLE_SEMICOLON=40, HASH=41, AT=42, QUEST=43,
ELVIS=44, LANGLE=45, RANGLE=46, LE=47, GE=48, EXCL_EQ=49, EXCL_EQEQ=50,
AS_SAFE=51, EQEQ=52, EQEQEQ=53, SINGLE_QUOTE=54, RETURN_AT=55, CONTINUE_AT=56,
BREAK_AT=57, FILE=58, PACKAGE=59, IMPORT=60, CLASS=61, INTERFACE=62, FUN=63,
OBJECT=64, VAL=65, VAR=66, TYPE_ALIAS=67, CONSTRUCTOR=68, BY=69, COMPANION=70,
INIT=71, THIS=72, SUPER=73, TYPEOF=74, WHERE=75, IF=76, ELSE=77, WHEN=78,
TRY=79, CATCH=80, FINALLY=81, FOR=82, DO=83, WHILE=84, THROW=85, RETURN=86,
CONTINUE=87, BREAK=88, AS=89, IS=90, IN=91, NOT_IS=92, NOT_IN=93, OUT=94,
FIELD=95, PROPERTY=96, GET=97, SET=98, GETTER=99, SETTER=100, RECEIVER=101,
PARAM=102, SETPARAM=103, DELEGATE=104, DYNAMIC=105, PUBLIC=106, PRIVATE=107,
PROTECTED=108, INTERNAL=109, ENUM=110, SEALED=111, ANNOTATION=112, DATA=113,
INNER=114, TAILREC=115, OPERATOR=116, INLINE=117, INFIX=118, EXTERNAL=119,
SUSPEND=120, OVERRIDE=121, ABSTRACT=122, FINAL=123, OPEN=124, CONST=125,
LATEINIT=126, VARARG=127, NOINLINE=128, CROSSINLINE=129, REIFIED=130,
QUOTE_OPEN=131, TRIPLE_QUOTE_OPEN=132, RealLiteral=133, FloatLiteral=134,
DoubleLiteral=135, LongLiteral=136, IntegerLiteral=137, HexLiteral=138,
BinLiteral=139, BooleanLiteral=140, NullLiteral=141, Identifier=142, LabelReference=143,
LabelDefinition=144, FieldIdentifier=145, CharacterLiteral=146, UNICODE_CLASS_LL=147,
UNICODE_CLASS_LM=148, UNICODE_CLASS_LO=149, UNICODE_CLASS_LT=150, UNICODE_CLASS_LU=151,
UNICODE_CLASS_ND=152, UNICODE_CLASS_NL=153, Inside_Comment=154, Inside_WS=155,
Inside_NL=156, QUOTE_CLOSE=157, LineStrRef=158, LineStrText=159, LineStrEscapedChar=160,
LineStrExprStart=161, TRIPLE_QUOTE_CLOSE=162, MultiLineStringQuote=163,
MultiLineStrRef=164, MultiLineStrText=165, MultiLineStrEscapedChar=166,
MultiLineStrExprStart=167, MultiLineNL=168, StrExpr_IN=169, StrExpr_Comment=170,
StrExpr_WS=171, StrExpr_NL=172;
public static final int
RULE_kotlinFile = 0, RULE_script = 1, RULE_preamble = 2, RULE_fileAnnotations = 3,
RULE_fileAnnotation = 4, RULE_packageHeader = 5, RULE_importList = 6,
RULE_importHeader = 7, RULE_importAlias = 8, RULE_topLevelObject = 9,
RULE_classDeclaration = 10, RULE_primaryConstructor = 11, RULE_classParameters = 12,
RULE_classParameter = 13, RULE_delegationSpecifiers = 14, RULE_delegationSpecifier = 15,
RULE_constructorInvocation = 16, RULE_explicitDelegation = 17, RULE_classBody = 18,
RULE_classMemberDeclaration = 19, RULE_anonymousInitializer = 20, RULE_secondaryConstructor = 21,
RULE_constructorDelegationCall = 22, RULE_enumClassBody = 23, RULE_enumEntries = 24,
RULE_enumEntry = 25, RULE_functionDeclaration = 26, RULE_functionValueParameters = 27,
RULE_functionValueParameter = 28, RULE_parameter = 29, RULE_functionBody = 30,
RULE_objectDeclaration = 31, RULE_companionObject = 32, RULE_propertyDeclaration = 33,
RULE_multiVariableDeclaration = 34, RULE_variableDeclaration = 35, RULE_getter = 36,
RULE_setter = 37, RULE_typeAlias = 38, RULE_typeParameters = 39, RULE_typeParameter = 40,
RULE_type = 41, RULE_typeModifierList = 42, RULE_parenthesizedType = 43,
RULE_nullableType = 44, RULE_typeReference = 45, RULE_functionType = 46,
RULE_functionTypeReceiver = 47, RULE_userType = 48, RULE_simpleUserType = 49,
RULE_functionTypeParameters = 50, RULE_typeConstraints = 51, RULE_typeConstraint = 52,
RULE_block = 53, RULE_statements = 54, RULE_statement = 55, RULE_blockLevelExpression = 56,
RULE_declaration = 57, RULE_expression = 58, RULE_disjunction = 59, RULE_conjunction = 60,
RULE_equalityComparison = 61, RULE_comparison = 62, RULE_namedInfix = 63,
RULE_elvisExpression = 64, RULE_infixFunctionCall = 65, RULE_rangeExpression = 66,
RULE_additiveExpression = 67, RULE_multiplicativeExpression = 68, RULE_typeRHS = 69,
RULE_prefixUnaryExpression = 70, RULE_postfixUnaryExpression = 71, RULE_atomicExpression = 72,
RULE_parenthesizedExpression = 73, RULE_callSuffix = 74, RULE_annotatedLambda = 75,
RULE_arrayAccess = 76, RULE_valueArguments = 77, RULE_typeArguments = 78,
RULE_typeProjection = 79, RULE_typeProjectionModifierList = 80, RULE_valueArgument = 81,
RULE_literalConstant = 82, RULE_stringLiteral = 83, RULE_lineStringLiteral = 84,
RULE_multiLineStringLiteral = 85, RULE_lineStringContent = 86, RULE_lineStringExpression = 87,
RULE_multiLineStringContent = 88, RULE_multiLineStringExpression = 89,
RULE_functionLiteral = 90, RULE_lambdaParameters = 91, RULE_lambdaParameter = 92,
RULE_objectLiteral = 93, RULE_collectionLiteral = 94, RULE_thisExpression = 95,
RULE_superExpression = 96, RULE_conditionalExpression = 97, RULE_ifExpression = 98,
RULE_controlStructureBody = 99, RULE_whenExpression = 100, RULE_whenEntry = 101,
RULE_whenCondition = 102, RULE_rangeTest = 103, RULE_typeTest = 104, RULE_tryExpression = 105,
RULE_catchBlock = 106, RULE_finallyBlock = 107, RULE_loopExpression = 108,
RULE_forExpression = 109, RULE_whileExpression = 110, RULE_doWhileExpression = 111,
RULE_jumpExpression = 112, RULE_callableReference = 113, RULE_assignmentOperator = 114,
RULE_equalityOperation = 115, RULE_comparisonOperator = 116, RULE_inOperator = 117,
RULE_isOperator = 118, RULE_additiveOperator = 119, RULE_multiplicativeOperation = 120,
RULE_typeOperation = 121, RULE_prefixUnaryOperation = 122, RULE_postfixUnaryOperation = 123,
RULE_memberAccessOperator = 124, RULE_modifierList = 125, RULE_modifier = 126,
RULE_classModifier = 127, RULE_memberModifier = 128, RULE_visibilityModifier = 129,
RULE_varianceAnnotation = 130, RULE_functionModifier = 131, RULE_propertyModifier = 132,
RULE_inheritanceModifier = 133, RULE_parameterModifier = 134, RULE_typeParameterModifier = 135,
RULE_labelDefinition = 136, RULE_annotations = 137, RULE_annotation = 138,
RULE_annotationList = 139, RULE_annotationUseSiteTarget = 140, RULE_unescapedAnnotation = 141,
RULE_identifier = 142, RULE_simpleIdentifier = 143, RULE_semi = 144, RULE_anysemi = 145;
private static String[] makeRuleNames() {
return new String[] {
"kotlinFile", "script", "preamble", "fileAnnotations", "fileAnnotation",
"packageHeader", "importList", "importHeader", "importAlias", "topLevelObject",
"classDeclaration", "primaryConstructor", "classParameters", "classParameter",
"delegationSpecifiers", "delegationSpecifier", "constructorInvocation",
"explicitDelegation", "classBody", "classMemberDeclaration", "anonymousInitializer",
"secondaryConstructor", "constructorDelegationCall", "enumClassBody",
"enumEntries", "enumEntry", "functionDeclaration", "functionValueParameters",
"functionValueParameter", "parameter", "functionBody", "objectDeclaration",
"companionObject", "propertyDeclaration", "multiVariableDeclaration",
"variableDeclaration", "getter", "setter", "typeAlias", "typeParameters",
"typeParameter", "type", "typeModifierList", "parenthesizedType", "nullableType",
"typeReference", "functionType", "functionTypeReceiver", "userType",
"simpleUserType", "functionTypeParameters", "typeConstraints", "typeConstraint",
"block", "statements", "statement", "blockLevelExpression", "declaration",
"expression", "disjunction", "conjunction", "equalityComparison", "comparison",
"namedInfix", "elvisExpression", "infixFunctionCall", "rangeExpression",
"additiveExpression", "multiplicativeExpression", "typeRHS", "prefixUnaryExpression",
"postfixUnaryExpression", "atomicExpression", "parenthesizedExpression",
"callSuffix", "annotatedLambda", "arrayAccess", "valueArguments", "typeArguments",
"typeProjection", "typeProjectionModifierList", "valueArgument", "literalConstant",
"stringLiteral", "lineStringLiteral", "multiLineStringLiteral", "lineStringContent",
"lineStringExpression", "multiLineStringContent", "multiLineStringExpression",
"functionLiteral", "lambdaParameters", "lambdaParameter", "objectLiteral",
"collectionLiteral", "thisExpression", "superExpression", "conditionalExpression",
"ifExpression", "controlStructureBody", "whenExpression", "whenEntry",
"whenCondition", "rangeTest", "typeTest", "tryExpression", "catchBlock",
"finallyBlock", "loopExpression", "forExpression", "whileExpression",
"doWhileExpression", "jumpExpression", "callableReference", "assignmentOperator",
"equalityOperation", "comparisonOperator", "inOperator", "isOperator",
"additiveOperator", "multiplicativeOperation", "typeOperation", "prefixUnaryOperation",
"postfixUnaryOperation", "memberAccessOperator", "modifierList", "modifier",
"classModifier", "memberModifier", "visibilityModifier", "varianceAnnotation",
"functionModifier", "propertyModifier", "inheritanceModifier", "parameterModifier",
"typeParameterModifier", "labelDefinition", "annotations", "annotation",
"annotationList", "annotationUseSiteTarget", "unescapedAnnotation", "identifier",
"simpleIdentifier", "semi", "anysemi"
};
}
public static final String[] ruleNames = makeRuleNames();
private static String[] makeLiteralNames() {
return new String[] {
null, null, null, null, null, null, null, "'...'", "'.'", "','", "'('",
null, "'['", null, "'{'", "'}'", "'*'", "'%'", "'/'", "'+'", "'-'", "'++'",
"'--'", "'&&'", "'||'", "'!'", "':'", "';'", "'='", "'+='", "'-='", "'*='",
"'/='", "'%='", "'->'", "'=>'", "'..'", "'..<'", "'::'", "'?::'", "';;'",
"'#'", "'@'", "'?'", "'?:'", "'<'", "'>'", "'<='", "'>='", "'!='", "'!=='",
"'as?'", "'=='", "'==='", "'''", null, null, null, "'@file'", "'package'",
"'import'", "'class'", "'interface'", "'fun'", "'object'", "'val'", "'var'",
"'typealias'", "'constructor'", "'by'", "'companion'", "'init'", "'this'",
"'super'", "'typeof'", "'where'", "'if'", "'else'", "'when'", "'try'",
"'catch'", "'finally'", "'for'", "'do'", "'while'", "'throw'", "'return'",
"'continue'", "'break'", "'as'", "'is'", "'in'", null, null, "'out'",
"'@field'", "'@property'", "'@get'", "'@set'", "'get'", "'set'", "'@receiver'",
"'@param'", "'@setparam'", "'@delegate'", "'dynamic'", "'public'", "'private'",
"'protected'", "'internal'", "'enum'", "'sealed'", "'annotation'", "'data'",
"'inner'", "'tailrec'", "'operator'", "'inline'", "'infix'", "'external'",
"'suspend'", "'override'", "'abstract'", "'final'", "'open'", "'const'",
"'lateinit'", "'vararg'", "'noinline'", "'crossinline'", "'reified'",
null, "'\"\"\"'", null, null, null, null, null, null, null, null, "'null'"
};
}
private static final String[] _LITERAL_NAMES = makeLiteralNames();
private static String[] makeSymbolicNames() {
return new String[] {
null, "ShebangLine", "JavadocComment", "DelimitedComment", "LineComment",
"WS", "NL", "RESERVED", "DOT", "COMMA", "LPAREN", "RPAREN", "LSQUARE",
"RSQUARE", "LCURL", "RCURL", "MULT", "MOD", "DIV", "ADD", "SUB", "INCR",
"DECR", "CONJ", "DISJ", "EXCL", "COLON", "SEMICOLON", "ASSIGNMENT", "ADD_ASSIGNMENT",
"SUB_ASSIGNMENT", "MULT_ASSIGNMENT", "DIV_ASSIGNMENT", "MOD_ASSIGNMENT",
"ARROW", "DOUBLE_ARROW", "RANGE", "RANGE_UNTIL", "COLONCOLON", "Q_COLONCOLON",
"DOUBLE_SEMICOLON", "HASH", "AT", "QUEST", "ELVIS", "LANGLE", "RANGLE",
"LE", "GE", "EXCL_EQ", "EXCL_EQEQ", "AS_SAFE", "EQEQ", "EQEQEQ", "SINGLE_QUOTE",
"RETURN_AT", "CONTINUE_AT", "BREAK_AT", "FILE", "PACKAGE", "IMPORT",
"CLASS", "INTERFACE", "FUN", "OBJECT", "VAL", "VAR", "TYPE_ALIAS", "CONSTRUCTOR",
"BY", "COMPANION", "INIT", "THIS", "SUPER", "TYPEOF", "WHERE", "IF",
"ELSE", "WHEN", "TRY", "CATCH", "FINALLY", "FOR", "DO", "WHILE", "THROW",
"RETURN", "CONTINUE", "BREAK", "AS", "IS", "IN", "NOT_IS", "NOT_IN",
"OUT", "FIELD", "PROPERTY", "GET", "SET", "GETTER", "SETTER", "RECEIVER",
"PARAM", "SETPARAM", "DELEGATE", "DYNAMIC", "PUBLIC", "PRIVATE", "PROTECTED",
"INTERNAL", "ENUM", "SEALED", "ANNOTATION", "DATA", "INNER", "TAILREC",
"OPERATOR", "INLINE", "INFIX", "EXTERNAL", "SUSPEND", "OVERRIDE", "ABSTRACT",
"FINAL", "OPEN", "CONST", "LATEINIT", "VARARG", "NOINLINE", "CROSSINLINE",
"REIFIED", "QUOTE_OPEN", "TRIPLE_QUOTE_OPEN", "RealLiteral", "FloatLiteral",
"DoubleLiteral", "LongLiteral", "IntegerLiteral", "HexLiteral", "BinLiteral",
"BooleanLiteral", "NullLiteral", "Identifier", "LabelReference", "LabelDefinition",
"FieldIdentifier", "CharacterLiteral", "UNICODE_CLASS_LL", "UNICODE_CLASS_LM",
"UNICODE_CLASS_LO", "UNICODE_CLASS_LT", "UNICODE_CLASS_LU", "UNICODE_CLASS_ND",
"UNICODE_CLASS_NL", "Inside_Comment", "Inside_WS", "Inside_NL", "QUOTE_CLOSE",
"LineStrRef", "LineStrText", "LineStrEscapedChar", "LineStrExprStart",
"TRIPLE_QUOTE_CLOSE", "MultiLineStringQuote", "MultiLineStrRef", "MultiLineStrText",
"MultiLineStrEscapedChar", "MultiLineStrExprStart", "MultiLineNL", "StrExpr_IN",
"StrExpr_Comment", "StrExpr_WS", "StrExpr_NL"
};
}
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 "KotlinParser.g4"; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String getSerializedATN() { return _serializedATN; }
@Override
public ATN getATN() { return _ATN; }
public KotlinParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
@SuppressWarnings("CheckReturnValue")
public static class KotlinFileContext extends ParserRuleContext {
public PreambleContext preamble() {
return getRuleContext(PreambleContext.class,0);
}
public TerminalNode EOF() { return getToken(KotlinParser.EOF, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List anysemi() {
return getRuleContexts(AnysemiContext.class);
}
public AnysemiContext anysemi(int i) {
return getRuleContext(AnysemiContext.class,i);
}
public List topLevelObject() {
return getRuleContexts(TopLevelObjectContext.class);
}
public TopLevelObjectContext topLevelObject(int i) {
return getRuleContext(TopLevelObjectContext.class,i);
}
public KotlinFileContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_kotlinFile; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterKotlinFile(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitKotlinFile(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitKotlinFile(this);
else return visitor.visitChildren(this);
}
}
public final KotlinFileContext kotlinFile() throws RecognitionException {
KotlinFileContext _localctx = new KotlinFileContext(_ctx, getState());
enterRule(_localctx, 0, RULE_kotlinFile);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(295);
_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(292);
match(NL);
}
}
}
setState(297);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,0,_ctx);
}
setState(298);
preamble();
setState(302);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL || _la==SEMICOLON) {
{
{
setState(299);
anysemi();
}
}
setState(304);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(319);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -2017608235015471092L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -2303041994737L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & 32775L) != 0)) {
{
setState(305);
topLevelObject();
setState(316);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL || _la==SEMICOLON) {
{
{
setState(307);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(306);
anysemi();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(309);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,2,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
setState(312);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -2017608235015471092L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -2303041994737L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & 32775L) != 0)) {
{
setState(311);
topLevelObject();
}
}
}
}
setState(318);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(321);
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 ScriptContext extends ParserRuleContext {
public PreambleContext preamble() {
return getRuleContext(PreambleContext.class,0);
}
public TerminalNode EOF() { return getToken(KotlinParser.EOF, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List anysemi() {
return getRuleContexts(AnysemiContext.class);
}
public AnysemiContext anysemi(int i) {
return getRuleContext(AnysemiContext.class,i);
}
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public ScriptContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_script; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterScript(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitScript(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitScript(this);
else return visitor.visitChildren(this);
}
}
public final ScriptContext script() throws RecognitionException {
ScriptContext _localctx = new ScriptContext(_ctx, getState());
enterRule(_localctx, 2, RULE_script);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(326);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,6,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(323);
match(NL);
}
}
}
setState(328);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,6,_ctx);
}
setState(329);
preamble();
setState(333);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,7,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(330);
anysemi();
}
}
}
setState(335);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,7,_ctx);
}
setState(350);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1693358682612978752L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -1040196623L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & 393023L) != 0)) {
{
setState(336);
expression();
setState(347);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL || _la==SEMICOLON) {
{
{
setState(338);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(337);
anysemi();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(340);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,8,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
setState(343);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,9,_ctx) ) {
case 1:
{
setState(342);
expression();
}
break;
}
}
}
setState(349);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(352);
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 PreambleContext extends ParserRuleContext {
public PackageHeaderContext packageHeader() {
return getRuleContext(PackageHeaderContext.class,0);
}
public ImportListContext importList() {
return getRuleContext(ImportListContext.class,0);
}
public FileAnnotationsContext fileAnnotations() {
return getRuleContext(FileAnnotationsContext.class,0);
}
public PreambleContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_preamble; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterPreamble(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitPreamble(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitPreamble(this);
else return visitor.visitChildren(this);
}
}
public final PreambleContext preamble() throws RecognitionException {
PreambleContext _localctx = new PreambleContext(_ctx, getState());
enterRule(_localctx, 4, RULE_preamble);
try {
enterOuterAlt(_localctx, 1);
{
setState(355);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,12,_ctx) ) {
case 1:
{
setState(354);
fileAnnotations();
}
break;
}
setState(357);
packageHeader();
setState(358);
importList();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class FileAnnotationsContext extends ParserRuleContext {
public List fileAnnotation() {
return getRuleContexts(FileAnnotationContext.class);
}
public FileAnnotationContext fileAnnotation(int i) {
return getRuleContext(FileAnnotationContext.class,i);
}
public FileAnnotationsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_fileAnnotations; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterFileAnnotations(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitFileAnnotations(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitFileAnnotations(this);
else return visitor.visitChildren(this);
}
}
public final FileAnnotationsContext fileAnnotations() throws RecognitionException {
FileAnnotationsContext _localctx = new FileAnnotationsContext(_ctx, getState());
enterRule(_localctx, 6, RULE_fileAnnotations);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(361);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(360);
fileAnnotation();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(363);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,13,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class FileAnnotationContext extends ParserRuleContext {
public List FILE() { return getTokens(KotlinParser.FILE); }
public TerminalNode FILE(int i) {
return getToken(KotlinParser.FILE, i);
}
public List COLON() { return getTokens(KotlinParser.COLON); }
public TerminalNode COLON(int i) {
return getToken(KotlinParser.COLON, i);
}
public List LSQUARE() { return getTokens(KotlinParser.LSQUARE); }
public TerminalNode LSQUARE(int i) {
return getToken(KotlinParser.LSQUARE, i);
}
public List RSQUARE() { return getTokens(KotlinParser.RSQUARE); }
public TerminalNode RSQUARE(int i) {
return getToken(KotlinParser.RSQUARE, i);
}
public List unescapedAnnotation() {
return getRuleContexts(UnescapedAnnotationContext.class);
}
public UnescapedAnnotationContext unescapedAnnotation(int i) {
return getRuleContext(UnescapedAnnotationContext.class,i);
}
public List semi() {
return getRuleContexts(SemiContext.class);
}
public SemiContext semi(int i) {
return getRuleContext(SemiContext.class,i);
}
public FileAnnotationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_fileAnnotation; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterFileAnnotation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitFileAnnotation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitFileAnnotation(this);
else return visitor.visitChildren(this);
}
}
public final FileAnnotationContext fileAnnotation() throws RecognitionException {
FileAnnotationContext _localctx = new FileAnnotationContext(_ctx, getState());
enterRule(_localctx, 8, RULE_fileAnnotation);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(381);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(365);
match(FILE);
setState(366);
match(COLON);
setState(376);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LSQUARE:
{
setState(367);
match(LSQUARE);
setState(369);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(368);
unescapedAnnotation();
}
}
setState(371);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( ((((_la - 60)) & ~0x3f) == 0 && ((1L << (_la - 60)) & -33517921595647L) != 0) || ((((_la - 124)) & ~0x3f) == 0 && ((1L << (_la - 124)) & 262271L) != 0) );
setState(373);
match(RSQUARE);
}
break;
case IMPORT:
case CONSTRUCTOR:
case BY:
case COMPANION:
case INIT:
case WHERE:
case CATCH:
case FINALLY:
case OUT:
case GETTER:
case SETTER:
case DYNAMIC:
case PUBLIC:
case PRIVATE:
case PROTECTED:
case INTERNAL:
case ENUM:
case SEALED:
case ANNOTATION:
case DATA:
case INNER:
case TAILREC:
case OPERATOR:
case INLINE:
case INFIX:
case EXTERNAL:
case SUSPEND:
case OVERRIDE:
case ABSTRACT:
case FINAL:
case OPEN:
case CONST:
case LATEINIT:
case VARARG:
case NOINLINE:
case CROSSINLINE:
case REIFIED:
case Identifier:
{
setState(375);
unescapedAnnotation();
}
break;
default:
throw new NoViableAltException(this);
}
setState(379);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) {
case 1:
{
setState(378);
semi();
}
break;
}
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(383);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,17,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class PackageHeaderContext extends ParserRuleContext {
public TerminalNode PACKAGE() { return getToken(KotlinParser.PACKAGE, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public SemiContext semi() {
return getRuleContext(SemiContext.class,0);
}
public PackageHeaderContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_packageHeader; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterPackageHeader(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitPackageHeader(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitPackageHeader(this);
else return visitor.visitChildren(this);
}
}
public final PackageHeaderContext packageHeader() throws RecognitionException {
PackageHeaderContext _localctx = new PackageHeaderContext(_ctx, getState());
enterRule(_localctx, 10, RULE_packageHeader);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(393);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) {
case 1:
{
setState(386);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(385);
modifierList();
}
}
setState(388);
match(PACKAGE);
setState(389);
identifier();
setState(391);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) {
case 1:
{
setState(390);
semi();
}
break;
}
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ImportListContext extends ParserRuleContext {
public List importHeader() {
return getRuleContexts(ImportHeaderContext.class);
}
public ImportHeaderContext importHeader(int i) {
return getRuleContext(ImportHeaderContext.class,i);
}
public ImportListContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_importList; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterImportList(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitImportList(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitImportList(this);
else return visitor.visitChildren(this);
}
}
public final ImportListContext importList() throws RecognitionException {
ImportListContext _localctx = new ImportListContext(_ctx, getState());
enterRule(_localctx, 12, RULE_importList);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(398);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,21,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(395);
importHeader();
}
}
}
setState(400);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,21,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ImportHeaderContext extends ParserRuleContext {
public TerminalNode IMPORT() { return getToken(KotlinParser.IMPORT, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode DOT() { return getToken(KotlinParser.DOT, 0); }
public TerminalNode MULT() { return getToken(KotlinParser.MULT, 0); }
public ImportAliasContext importAlias() {
return getRuleContext(ImportAliasContext.class,0);
}
public SemiContext semi() {
return getRuleContext(SemiContext.class,0);
}
public ImportHeaderContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_importHeader; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterImportHeader(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitImportHeader(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitImportHeader(this);
else return visitor.visitChildren(this);
}
}
public final ImportHeaderContext importHeader() throws RecognitionException {
ImportHeaderContext _localctx = new ImportHeaderContext(_ctx, getState());
enterRule(_localctx, 14, RULE_importHeader);
try {
enterOuterAlt(_localctx, 1);
{
setState(401);
match(IMPORT);
setState(402);
identifier();
setState(406);
_errHandler.sync(this);
switch (_input.LA(1)) {
case DOT:
{
setState(403);
match(DOT);
setState(404);
match(MULT);
}
break;
case AS:
{
setState(405);
importAlias();
}
break;
case EOF:
case JavadocComment:
case DelimitedComment:
case NL:
case LPAREN:
case LSQUARE:
case LCURL:
case ADD:
case SUB:
case INCR:
case DECR:
case EXCL:
case SEMICOLON:
case COLONCOLON:
case Q_COLONCOLON:
case AT:
case RETURN_AT:
case CONTINUE_AT:
case BREAK_AT:
case FILE:
case IMPORT:
case CLASS:
case INTERFACE:
case FUN:
case OBJECT:
case VAL:
case VAR:
case TYPE_ALIAS:
case CONSTRUCTOR:
case BY:
case COMPANION:
case INIT:
case THIS:
case SUPER:
case WHERE:
case IF:
case WHEN:
case TRY:
case CATCH:
case FINALLY:
case FOR:
case DO:
case WHILE:
case THROW:
case RETURN:
case CONTINUE:
case BREAK:
case IN:
case OUT:
case FIELD:
case PROPERTY:
case GET:
case SET:
case GETTER:
case SETTER:
case RECEIVER:
case PARAM:
case SETPARAM:
case DELEGATE:
case DYNAMIC:
case PUBLIC:
case PRIVATE:
case PROTECTED:
case INTERNAL:
case ENUM:
case SEALED:
case ANNOTATION:
case DATA:
case INNER:
case TAILREC:
case OPERATOR:
case INLINE:
case INFIX:
case EXTERNAL:
case SUSPEND:
case OVERRIDE:
case ABSTRACT:
case FINAL:
case OPEN:
case CONST:
case LATEINIT:
case VARARG:
case NOINLINE:
case CROSSINLINE:
case REIFIED:
case QUOTE_OPEN:
case TRIPLE_QUOTE_OPEN:
case RealLiteral:
case LongLiteral:
case IntegerLiteral:
case HexLiteral:
case BinLiteral:
case BooleanLiteral:
case NullLiteral:
case Identifier:
case LabelReference:
case LabelDefinition:
case CharacterLiteral:
break;
default:
break;
}
setState(409);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) {
case 1:
{
setState(408);
semi();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ImportAliasContext extends ParserRuleContext {
public TerminalNode AS() { return getToken(KotlinParser.AS, 0); }
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public ImportAliasContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_importAlias; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterImportAlias(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitImportAlias(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitImportAlias(this);
else return visitor.visitChildren(this);
}
}
public final ImportAliasContext importAlias() throws RecognitionException {
ImportAliasContext _localctx = new ImportAliasContext(_ctx, getState());
enterRule(_localctx, 16, RULE_importAlias);
try {
enterOuterAlt(_localctx, 1);
{
setState(411);
match(AS);
setState(412);
simpleIdentifier();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TopLevelObjectContext extends ParserRuleContext {
public ClassDeclarationContext classDeclaration() {
return getRuleContext(ClassDeclarationContext.class,0);
}
public ObjectDeclarationContext objectDeclaration() {
return getRuleContext(ObjectDeclarationContext.class,0);
}
public FunctionDeclarationContext functionDeclaration() {
return getRuleContext(FunctionDeclarationContext.class,0);
}
public PropertyDeclarationContext propertyDeclaration() {
return getRuleContext(PropertyDeclarationContext.class,0);
}
public TypeAliasContext typeAlias() {
return getRuleContext(TypeAliasContext.class,0);
}
public TerminalNode DelimitedComment() { return getToken(KotlinParser.DelimitedComment, 0); }
public TopLevelObjectContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_topLevelObject; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterTopLevelObject(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitTopLevelObject(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitTopLevelObject(this);
else return visitor.visitChildren(this);
}
}
public final TopLevelObjectContext topLevelObject() throws RecognitionException {
TopLevelObjectContext _localctx = new TopLevelObjectContext(_ctx, getState());
enterRule(_localctx, 18, RULE_topLevelObject);
try {
setState(420);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(414);
classDeclaration();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(415);
objectDeclaration();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(416);
functionDeclaration();
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
setState(417);
propertyDeclaration();
}
break;
case 5:
enterOuterAlt(_localctx, 5);
{
setState(418);
typeAlias();
}
break;
case 6:
enterOuterAlt(_localctx, 6);
{
setState(419);
match(DelimitedComment);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ClassDeclarationContext extends ParserRuleContext {
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public TerminalNode CLASS() { return getToken(KotlinParser.CLASS, 0); }
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public TypeParametersContext typeParameters() {
return getRuleContext(TypeParametersContext.class,0);
}
public PrimaryConstructorContext primaryConstructor() {
return getRuleContext(PrimaryConstructorContext.class,0);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public DelegationSpecifiersContext delegationSpecifiers() {
return getRuleContext(DelegationSpecifiersContext.class,0);
}
public TypeConstraintsContext typeConstraints() {
return getRuleContext(TypeConstraintsContext.class,0);
}
public ClassBodyContext classBody() {
return getRuleContext(ClassBodyContext.class,0);
}
public EnumClassBodyContext enumClassBody() {
return getRuleContext(EnumClassBodyContext.class,0);
}
public TerminalNode JavadocComment() { return getToken(KotlinParser.JavadocComment, 0); }
public TerminalNode DelimitedComment() { return getToken(KotlinParser.DelimitedComment, 0); }
public TerminalNode INTERFACE() { return getToken(KotlinParser.INTERFACE, 0); }
public TerminalNode FUN() { return getToken(KotlinParser.FUN, 0); }
public ClassDeclarationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_classDeclaration; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterClassDeclaration(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitClassDeclaration(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitClassDeclaration(this);
else return visitor.visitChildren(this);
}
}
public final ClassDeclarationContext classDeclaration() throws RecognitionException {
ClassDeclarationContext _localctx = new ClassDeclarationContext(_ctx, getState());
enterRule(_localctx, 20, RULE_classDeclaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(428);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==JavadocComment || _la==DelimitedComment) {
{
setState(422);
_la = _input.LA(1);
if ( !(_la==JavadocComment || _la==DelimitedComment) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(424);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(423);
match(NL);
}
}
setState(426);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==NL );
}
}
setState(431);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(430);
modifierList();
}
}
setState(438);
_errHandler.sync(this);
switch (_input.LA(1)) {
case CLASS:
{
setState(433);
match(CLASS);
}
break;
case INTERFACE:
case FUN:
{
{
setState(435);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FUN) {
{
setState(434);
match(FUN);
}
}
setState(437);
match(INTERFACE);
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(443);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(440);
match(NL);
}
}
setState(445);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(446);
simpleIdentifier();
setState(454);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,32,_ctx) ) {
case 1:
{
setState(450);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(447);
match(NL);
}
}
setState(452);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(453);
typeParameters();
}
break;
}
setState(463);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) {
case 1:
{
setState(459);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(456);
match(NL);
}
}
setState(461);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(462);
primaryConstructor();
}
break;
}
setState(479);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,37,_ctx) ) {
case 1:
{
setState(468);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(465);
match(NL);
}
}
setState(470);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(471);
match(COLON);
setState(475);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(472);
match(NL);
}
}
setState(477);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(478);
delegationSpecifiers();
}
break;
}
setState(488);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,39,_ctx) ) {
case 1:
{
setState(484);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(481);
match(NL);
}
}
setState(486);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(487);
typeConstraints();
}
break;
}
setState(504);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,42,_ctx) ) {
case 1:
{
setState(493);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(490);
match(NL);
}
}
setState(495);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(496);
classBody();
}
break;
case 2:
{
setState(500);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(497);
match(NL);
}
}
setState(502);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(503);
enumClassBody();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class PrimaryConstructorContext extends ParserRuleContext {
public ClassParametersContext classParameters() {
return getRuleContext(ClassParametersContext.class,0);
}
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public TerminalNode CONSTRUCTOR() { return getToken(KotlinParser.CONSTRUCTOR, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public PrimaryConstructorContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_primaryConstructor; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterPrimaryConstructor(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitPrimaryConstructor(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitPrimaryConstructor(this);
else return visitor.visitChildren(this);
}
}
public final PrimaryConstructorContext primaryConstructor() throws RecognitionException {
PrimaryConstructorContext _localctx = new PrimaryConstructorContext(_ctx, getState());
enterRule(_localctx, 22, RULE_primaryConstructor);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(507);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(506);
modifierList();
}
}
setState(516);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CONSTRUCTOR) {
{
setState(509);
match(CONSTRUCTOR);
setState(513);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(510);
match(NL);
}
}
setState(515);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(518);
classParameters();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ClassParametersContext extends ParserRuleContext {
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List classParameter() {
return getRuleContexts(ClassParameterContext.class);
}
public ClassParameterContext classParameter(int i) {
return getRuleContext(ClassParameterContext.class,i);
}
public List COMMA() { return getTokens(KotlinParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(KotlinParser.COMMA, i);
}
public ClassParametersContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_classParameters; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterClassParameters(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitClassParameters(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitClassParameters(this);
else return visitor.visitChildren(this);
}
}
public final ClassParametersContext classParameters() throws RecognitionException {
ClassParametersContext _localctx = new ClassParametersContext(_ctx, getState());
enterRule(_localctx, 24, RULE_classParameters);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(520);
match(LPAREN);
setState(524);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,46,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(521);
match(NL);
}
}
}
setState(526);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,46,_ctx);
}
setState(556);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 42)) & ~0x3f) == 0 && ((1L << (_la - 42)) & -3939815418167295L) != 0) || ((((_la - 106)) & ~0x3f) == 0 && ((1L << (_la - 106)) & 206191984639L) != 0)) {
{
setState(527);
classParameter();
setState(544);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,49,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(531);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(528);
match(NL);
}
}
setState(533);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(534);
match(COMMA);
setState(538);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(535);
match(NL);
}
}
setState(540);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(541);
classParameter();
}
}
}
setState(546);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,49,_ctx);
}
setState(554);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,51,_ctx) ) {
case 1:
{
setState(550);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(547);
match(NL);
}
}
setState(552);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(553);
match(COMMA);
}
break;
}
}
}
setState(561);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(558);
match(NL);
}
}
setState(563);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(564);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ClassParameterContext extends ParserRuleContext {
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public TerminalNode ASSIGNMENT() { return getToken(KotlinParser.ASSIGNMENT, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode VAL() { return getToken(KotlinParser.VAL, 0); }
public TerminalNode VAR() { return getToken(KotlinParser.VAR, 0); }
public ClassParameterContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_classParameter; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterClassParameter(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitClassParameter(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitClassParameter(this);
else return visitor.visitChildren(this);
}
}
public final ClassParameterContext classParameter() throws RecognitionException {
ClassParameterContext _localctx = new ClassParameterContext(_ctx, getState());
enterRule(_localctx, 26, RULE_classParameter);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(567);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,54,_ctx) ) {
case 1:
{
setState(566);
modifierList();
}
break;
}
setState(570);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==VAL || _la==VAR) {
{
setState(569);
_la = _input.LA(1);
if ( !(_la==VAL || _la==VAR) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(572);
simpleIdentifier();
setState(573);
match(COLON);
setState(574);
type();
setState(577);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ASSIGNMENT) {
{
setState(575);
match(ASSIGNMENT);
setState(576);
expression();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class DelegationSpecifiersContext extends ParserRuleContext {
public List delegationSpecifier() {
return getRuleContexts(DelegationSpecifierContext.class);
}
public DelegationSpecifierContext delegationSpecifier(int i) {
return getRuleContext(DelegationSpecifierContext.class,i);
}
public List annotations() {
return getRuleContexts(AnnotationsContext.class);
}
public AnnotationsContext annotations(int i) {
return getRuleContext(AnnotationsContext.class,i);
}
public List COMMA() { return getTokens(KotlinParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(KotlinParser.COMMA, i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public DelegationSpecifiersContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_delegationSpecifiers; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterDelegationSpecifiers(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitDelegationSpecifiers(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitDelegationSpecifiers(this);
else return visitor.visitChildren(this);
}
}
public final DelegationSpecifiersContext delegationSpecifiers() throws RecognitionException {
DelegationSpecifiersContext _localctx = new DelegationSpecifiersContext(_ctx, getState());
enterRule(_localctx, 28, RULE_delegationSpecifiers);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(582);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AT || _la==FILE || ((((_la - 95)) & ~0x3f) == 0 && ((1L << (_la - 95)) & 281474976711631L) != 0)) {
{
{
setState(579);
annotations();
}
}
setState(584);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(585);
delegationSpecifier();
setState(602);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,60,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(589);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(586);
match(NL);
}
}
setState(591);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(592);
match(COMMA);
setState(596);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(593);
match(NL);
}
}
setState(598);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(599);
delegationSpecifier();
}
}
}
setState(604);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,60,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class DelegationSpecifierContext extends ParserRuleContext {
public ConstructorInvocationContext constructorInvocation() {
return getRuleContext(ConstructorInvocationContext.class,0);
}
public UserTypeContext userType() {
return getRuleContext(UserTypeContext.class,0);
}
public ExplicitDelegationContext explicitDelegation() {
return getRuleContext(ExplicitDelegationContext.class,0);
}
public DelegationSpecifierContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_delegationSpecifier; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterDelegationSpecifier(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitDelegationSpecifier(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitDelegationSpecifier(this);
else return visitor.visitChildren(this);
}
}
public final DelegationSpecifierContext delegationSpecifier() throws RecognitionException {
DelegationSpecifierContext _localctx = new DelegationSpecifierContext(_ctx, getState());
enterRule(_localctx, 30, RULE_delegationSpecifier);
try {
setState(608);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,61,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(605);
constructorInvocation();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(606);
userType();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(607);
explicitDelegation();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ConstructorInvocationContext extends ParserRuleContext {
public UserTypeContext userType() {
return getRuleContext(UserTypeContext.class,0);
}
public CallSuffixContext callSuffix() {
return getRuleContext(CallSuffixContext.class,0);
}
public ConstructorInvocationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_constructorInvocation; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterConstructorInvocation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitConstructorInvocation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitConstructorInvocation(this);
else return visitor.visitChildren(this);
}
}
public final ConstructorInvocationContext constructorInvocation() throws RecognitionException {
ConstructorInvocationContext _localctx = new ConstructorInvocationContext(_ctx, getState());
enterRule(_localctx, 32, RULE_constructorInvocation);
try {
enterOuterAlt(_localctx, 1);
{
setState(610);
userType();
setState(611);
callSuffix();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ExplicitDelegationContext extends ParserRuleContext {
public UserTypeContext userType() {
return getRuleContext(UserTypeContext.class,0);
}
public TerminalNode BY() { return getToken(KotlinParser.BY, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public ExplicitDelegationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_explicitDelegation; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterExplicitDelegation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitExplicitDelegation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitExplicitDelegation(this);
else return visitor.visitChildren(this);
}
}
public final ExplicitDelegationContext explicitDelegation() throws RecognitionException {
ExplicitDelegationContext _localctx = new ExplicitDelegationContext(_ctx, getState());
enterRule(_localctx, 34, RULE_explicitDelegation);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(613);
userType();
setState(617);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(614);
match(NL);
}
}
setState(619);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(620);
match(BY);
setState(624);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,63,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(621);
match(NL);
}
}
}
setState(626);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,63,_ctx);
}
setState(627);
expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ClassBodyContext extends ParserRuleContext {
public TerminalNode LCURL() { return getToken(KotlinParser.LCURL, 0); }
public TerminalNode RCURL() { return getToken(KotlinParser.RCURL, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List classMemberDeclaration() {
return getRuleContexts(ClassMemberDeclarationContext.class);
}
public ClassMemberDeclarationContext classMemberDeclaration(int i) {
return getRuleContext(ClassMemberDeclarationContext.class,i);
}
public ClassBodyContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_classBody; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterClassBody(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitClassBody(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitClassBody(this);
else return visitor.visitChildren(this);
}
}
public final ClassBodyContext classBody() throws RecognitionException {
ClassBodyContext _localctx = new ClassBodyContext(_ctx, getState());
enterRule(_localctx, 36, RULE_classBody);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(629);
match(LCURL);
setState(633);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,64,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(630);
match(NL);
}
}
}
setState(635);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,64,_ctx);
}
setState(639);
_errHandler.sync(this);
_la = _input.LA(1);
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & -2017608235015471092L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -2303041994529L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & 32775L) != 0)) {
{
{
setState(636);
classMemberDeclaration();
}
}
setState(641);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(645);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(642);
match(NL);
}
}
setState(647);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(648);
match(RCURL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ClassMemberDeclarationContext extends ParserRuleContext {
public ClassDeclarationContext classDeclaration() {
return getRuleContext(ClassDeclarationContext.class,0);
}
public FunctionDeclarationContext functionDeclaration() {
return getRuleContext(FunctionDeclarationContext.class,0);
}
public ObjectDeclarationContext objectDeclaration() {
return getRuleContext(ObjectDeclarationContext.class,0);
}
public CompanionObjectContext companionObject() {
return getRuleContext(CompanionObjectContext.class,0);
}
public PropertyDeclarationContext propertyDeclaration() {
return getRuleContext(PropertyDeclarationContext.class,0);
}
public AnonymousInitializerContext anonymousInitializer() {
return getRuleContext(AnonymousInitializerContext.class,0);
}
public SecondaryConstructorContext secondaryConstructor() {
return getRuleContext(SecondaryConstructorContext.class,0);
}
public TypeAliasContext typeAlias() {
return getRuleContext(TypeAliasContext.class,0);
}
public List anysemi() {
return getRuleContexts(AnysemiContext.class);
}
public AnysemiContext anysemi(int i) {
return getRuleContext(AnysemiContext.class,i);
}
public ClassMemberDeclarationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_classMemberDeclaration; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterClassMemberDeclaration(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitClassMemberDeclaration(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitClassMemberDeclaration(this);
else return visitor.visitChildren(this);
}
}
public final ClassMemberDeclarationContext classMemberDeclaration() throws RecognitionException {
ClassMemberDeclarationContext _localctx = new ClassMemberDeclarationContext(_ctx, getState());
enterRule(_localctx, 38, RULE_classMemberDeclaration);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(658);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,67,_ctx) ) {
case 1:
{
setState(650);
classDeclaration();
}
break;
case 2:
{
setState(651);
functionDeclaration();
}
break;
case 3:
{
setState(652);
objectDeclaration();
}
break;
case 4:
{
setState(653);
companionObject();
}
break;
case 5:
{
setState(654);
propertyDeclaration();
}
break;
case 6:
{
setState(655);
anonymousInitializer();
}
break;
case 7:
{
setState(656);
secondaryConstructor();
}
break;
case 8:
{
setState(657);
typeAlias();
}
break;
}
setState(663);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,68,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(660);
anysemi();
}
}
}
setState(665);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,68,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class AnonymousInitializerContext extends ParserRuleContext {
public TerminalNode INIT() { return getToken(KotlinParser.INIT, 0); }
public BlockContext block() {
return getRuleContext(BlockContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public AnonymousInitializerContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_anonymousInitializer; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterAnonymousInitializer(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitAnonymousInitializer(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitAnonymousInitializer(this);
else return visitor.visitChildren(this);
}
}
public final AnonymousInitializerContext anonymousInitializer() throws RecognitionException {
AnonymousInitializerContext _localctx = new AnonymousInitializerContext(_ctx, getState());
enterRule(_localctx, 40, RULE_anonymousInitializer);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(666);
match(INIT);
setState(670);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(667);
match(NL);
}
}
setState(672);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(673);
block();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class SecondaryConstructorContext extends ParserRuleContext {
public TerminalNode CONSTRUCTOR() { return getToken(KotlinParser.CONSTRUCTOR, 0); }
public FunctionValueParametersContext functionValueParameters() {
return getRuleContext(FunctionValueParametersContext.class,0);
}
public BlockContext block() {
return getRuleContext(BlockContext.class,0);
}
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public ConstructorDelegationCallContext constructorDelegationCall() {
return getRuleContext(ConstructorDelegationCallContext.class,0);
}
public SecondaryConstructorContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_secondaryConstructor; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterSecondaryConstructor(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitSecondaryConstructor(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitSecondaryConstructor(this);
else return visitor.visitChildren(this);
}
}
public final SecondaryConstructorContext secondaryConstructor() throws RecognitionException {
SecondaryConstructorContext _localctx = new SecondaryConstructorContext(_ctx, getState());
enterRule(_localctx, 42, RULE_secondaryConstructor);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(676);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(675);
modifierList();
}
}
setState(678);
match(CONSTRUCTOR);
setState(682);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(679);
match(NL);
}
}
setState(684);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(685);
functionValueParameters();
setState(700);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,74,_ctx) ) {
case 1:
{
setState(689);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(686);
match(NL);
}
}
setState(691);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(692);
match(COLON);
setState(696);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(693);
match(NL);
}
}
setState(698);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(699);
constructorDelegationCall();
}
break;
}
setState(705);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(702);
match(NL);
}
}
setState(707);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(708);
block();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ConstructorDelegationCallContext extends ParserRuleContext {
public TerminalNode THIS() { return getToken(KotlinParser.THIS, 0); }
public ValueArgumentsContext valueArguments() {
return getRuleContext(ValueArgumentsContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public TerminalNode SUPER() { return getToken(KotlinParser.SUPER, 0); }
public ConstructorDelegationCallContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_constructorDelegationCall; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterConstructorDelegationCall(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitConstructorDelegationCall(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitConstructorDelegationCall(this);
else return visitor.visitChildren(this);
}
}
public final ConstructorDelegationCallContext constructorDelegationCall() throws RecognitionException {
ConstructorDelegationCallContext _localctx = new ConstructorDelegationCallContext(_ctx, getState());
enterRule(_localctx, 44, RULE_constructorDelegationCall);
int _la;
try {
setState(726);
_errHandler.sync(this);
switch (_input.LA(1)) {
case THIS:
enterOuterAlt(_localctx, 1);
{
setState(710);
match(THIS);
setState(714);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(711);
match(NL);
}
}
setState(716);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(717);
valueArguments();
}
break;
case SUPER:
enterOuterAlt(_localctx, 2);
{
setState(718);
match(SUPER);
setState(722);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(719);
match(NL);
}
}
setState(724);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(725);
valueArguments();
}
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 EnumClassBodyContext extends ParserRuleContext {
public TerminalNode LCURL() { return getToken(KotlinParser.LCURL, 0); }
public TerminalNode RCURL() { return getToken(KotlinParser.RCURL, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public EnumEntriesContext enumEntries() {
return getRuleContext(EnumEntriesContext.class,0);
}
public TerminalNode SEMICOLON() { return getToken(KotlinParser.SEMICOLON, 0); }
public List classMemberDeclaration() {
return getRuleContexts(ClassMemberDeclarationContext.class);
}
public ClassMemberDeclarationContext classMemberDeclaration(int i) {
return getRuleContext(ClassMemberDeclarationContext.class,i);
}
public EnumClassBodyContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_enumClassBody; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterEnumClassBody(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitEnumClassBody(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitEnumClassBody(this);
else return visitor.visitChildren(this);
}
}
public final EnumClassBodyContext enumClassBody() throws RecognitionException {
EnumClassBodyContext _localctx = new EnumClassBodyContext(_ctx, getState());
enterRule(_localctx, 46, RULE_enumClassBody);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(728);
match(LCURL);
setState(732);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,79,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(729);
match(NL);
}
}
}
setState(734);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,79,_ctx);
}
setState(736);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 60)) & ~0x3f) == 0 && ((1L << (_la - 60)) & -33517921595647L) != 0) || ((((_la - 124)) & ~0x3f) == 0 && ((1L << (_la - 124)) & 262271L) != 0)) {
{
setState(735);
enumEntries();
}
}
setState(757);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,84,_ctx) ) {
case 1:
{
setState(741);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(738);
match(NL);
}
}
setState(743);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(744);
match(SEMICOLON);
setState(748);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,82,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(745);
match(NL);
}
}
}
setState(750);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,82,_ctx);
}
setState(754);
_errHandler.sync(this);
_la = _input.LA(1);
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & -2017608235015471092L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -2303041994529L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & 32775L) != 0)) {
{
{
setState(751);
classMemberDeclaration();
}
}
setState(756);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
}
setState(762);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(759);
match(NL);
}
}
setState(764);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(765);
match(RCURL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class EnumEntriesContext extends ParserRuleContext {
public List enumEntry() {
return getRuleContexts(EnumEntryContext.class);
}
public EnumEntryContext enumEntry(int i) {
return getRuleContext(EnumEntryContext.class,i);
}
public TerminalNode SEMICOLON() { return getToken(KotlinParser.SEMICOLON, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public EnumEntriesContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_enumEntries; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterEnumEntries(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitEnumEntries(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitEnumEntries(this);
else return visitor.visitChildren(this);
}
}
public final EnumEntriesContext enumEntries() throws RecognitionException {
EnumEntriesContext _localctx = new EnumEntriesContext(_ctx, getState());
enterRule(_localctx, 48, RULE_enumEntries);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(774);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(767);
enumEntry();
setState(771);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,86,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(768);
match(NL);
}
}
}
setState(773);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,86,_ctx);
}
}
}
setState(776);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( ((((_la - 60)) & ~0x3f) == 0 && ((1L << (_la - 60)) & -33517921595647L) != 0) || ((((_la - 124)) & ~0x3f) == 0 && ((1L << (_la - 124)) & 262271L) != 0) );
setState(779);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,88,_ctx) ) {
case 1:
{
setState(778);
match(SEMICOLON);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class EnumEntryContext extends ParserRuleContext {
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public ValueArgumentsContext valueArguments() {
return getRuleContext(ValueArgumentsContext.class,0);
}
public ClassBodyContext classBody() {
return getRuleContext(ClassBodyContext.class,0);
}
public TerminalNode COMMA() { return getToken(KotlinParser.COMMA, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public EnumEntryContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_enumEntry; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterEnumEntry(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitEnumEntry(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitEnumEntry(this);
else return visitor.visitChildren(this);
}
}
public final EnumEntryContext enumEntry() throws RecognitionException {
EnumEntryContext _localctx = new EnumEntryContext(_ctx, getState());
enterRule(_localctx, 50, RULE_enumEntry);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(781);
simpleIdentifier();
setState(789);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,90,_ctx) ) {
case 1:
{
setState(785);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(782);
match(NL);
}
}
setState(787);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(788);
valueArguments();
}
break;
}
setState(798);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,92,_ctx) ) {
case 1:
{
setState(794);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(791);
match(NL);
}
}
setState(796);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(797);
classBody();
}
break;
}
setState(807);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,94,_ctx) ) {
case 1:
{
setState(803);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(800);
match(NL);
}
}
setState(805);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(806);
match(COMMA);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class FunctionDeclarationContext extends ParserRuleContext {
public TerminalNode FUN() { return getToken(KotlinParser.FUN, 0); }
public FunctionValueParametersContext functionValueParameters() {
return getRuleContext(FunctionValueParametersContext.class,0);
}
public TerminalNode JavadocComment() { return getToken(KotlinParser.JavadocComment, 0); }
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public List type() {
return getRuleContexts(TypeContext.class);
}
public TypeContext type(int i) {
return getRuleContext(TypeContext.class,i);
}
public TerminalNode DOT() { return getToken(KotlinParser.DOT, 0); }
public TypeParametersContext typeParameters() {
return getRuleContext(TypeParametersContext.class,0);
}
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public TypeConstraintsContext typeConstraints() {
return getRuleContext(TypeConstraintsContext.class,0);
}
public FunctionBodyContext functionBody() {
return getRuleContext(FunctionBodyContext.class,0);
}
public FunctionDeclarationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_functionDeclaration; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterFunctionDeclaration(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitFunctionDeclaration(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitFunctionDeclaration(this);
else return visitor.visitChildren(this);
}
}
public final FunctionDeclarationContext functionDeclaration() throws RecognitionException {
FunctionDeclarationContext _localctx = new FunctionDeclarationContext(_ctx, getState());
enterRule(_localctx, 52, RULE_functionDeclaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(815);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==JavadocComment) {
{
setState(809);
match(JavadocComment);
setState(811);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(810);
match(NL);
}
}
setState(813);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==NL );
}
}
setState(818);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(817);
modifierList();
}
}
setState(820);
match(FUN);
setState(836);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,100,_ctx) ) {
case 1:
{
setState(824);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(821);
match(NL);
}
}
setState(826);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(827);
type();
setState(831);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(828);
match(NL);
}
}
setState(833);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(834);
match(DOT);
}
break;
}
setState(845);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,102,_ctx) ) {
case 1:
{
setState(841);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(838);
match(NL);
}
}
setState(843);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(844);
typeParameters();
}
break;
}
setState(854);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,104,_ctx) ) {
case 1:
{
setState(850);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(847);
match(NL);
}
}
setState(852);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(853);
identifier();
}
break;
}
setState(859);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(856);
match(NL);
}
}
setState(861);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(862);
functionValueParameters();
setState(877);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,108,_ctx) ) {
case 1:
{
setState(866);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(863);
match(NL);
}
}
setState(868);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(869);
match(COLON);
setState(873);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(870);
match(NL);
}
}
setState(875);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(876);
type();
}
break;
}
setState(886);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,110,_ctx) ) {
case 1:
{
setState(882);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(879);
match(NL);
}
}
setState(884);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(885);
typeConstraints();
}
break;
}
setState(895);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,112,_ctx) ) {
case 1:
{
setState(891);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(888);
match(NL);
}
}
setState(893);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(894);
functionBody();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class FunctionValueParametersContext extends ParserRuleContext {
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List functionValueParameter() {
return getRuleContexts(FunctionValueParameterContext.class);
}
public FunctionValueParameterContext functionValueParameter(int i) {
return getRuleContext(FunctionValueParameterContext.class,i);
}
public List COMMA() { return getTokens(KotlinParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(KotlinParser.COMMA, i);
}
public FunctionValueParametersContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_functionValueParameters; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterFunctionValueParameters(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitFunctionValueParameters(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitFunctionValueParameters(this);
else return visitor.visitChildren(this);
}
}
public final FunctionValueParametersContext functionValueParameters() throws RecognitionException {
FunctionValueParametersContext _localctx = new FunctionValueParametersContext(_ctx, getState());
enterRule(_localctx, 54, RULE_functionValueParameters);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(897);
match(LPAREN);
setState(901);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,113,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(898);
match(NL);
}
}
}
setState(903);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,113,_ctx);
}
setState(933);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 42)) & ~0x3f) == 0 && ((1L << (_la - 42)) & -3939815443333119L) != 0) || ((((_la - 106)) & ~0x3f) == 0 && ((1L << (_la - 106)) & 206191984639L) != 0)) {
{
setState(904);
functionValueParameter();
setState(921);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,116,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(908);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(905);
match(NL);
}
}
setState(910);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(911);
match(COMMA);
setState(915);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(912);
match(NL);
}
}
setState(917);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(918);
functionValueParameter();
}
}
}
setState(923);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,116,_ctx);
}
setState(931);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,118,_ctx) ) {
case 1:
{
setState(927);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(924);
match(NL);
}
}
setState(929);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(930);
match(COMMA);
}
break;
}
}
}
setState(938);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(935);
match(NL);
}
}
setState(940);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(941);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class FunctionValueParameterContext extends ParserRuleContext {
public ParameterContext parameter() {
return getRuleContext(ParameterContext.class,0);
}
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public TerminalNode ASSIGNMENT() { return getToken(KotlinParser.ASSIGNMENT, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public FunctionValueParameterContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_functionValueParameter; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterFunctionValueParameter(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitFunctionValueParameter(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitFunctionValueParameter(this);
else return visitor.visitChildren(this);
}
}
public final FunctionValueParameterContext functionValueParameter() throws RecognitionException {
FunctionValueParameterContext _localctx = new FunctionValueParameterContext(_ctx, getState());
enterRule(_localctx, 56, RULE_functionValueParameter);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(944);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,121,_ctx) ) {
case 1:
{
setState(943);
modifierList();
}
break;
}
setState(946);
parameter();
setState(949);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ASSIGNMENT) {
{
setState(947);
match(ASSIGNMENT);
setState(948);
expression();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ParameterContext extends ParserRuleContext {
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public ParameterContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_parameter; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterParameter(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitParameter(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitParameter(this);
else return visitor.visitChildren(this);
}
}
public final ParameterContext parameter() throws RecognitionException {
ParameterContext _localctx = new ParameterContext(_ctx, getState());
enterRule(_localctx, 58, RULE_parameter);
try {
enterOuterAlt(_localctx, 1);
{
setState(951);
simpleIdentifier();
setState(952);
match(COLON);
setState(953);
type();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class FunctionBodyContext extends ParserRuleContext {
public BlockContext block() {
return getRuleContext(BlockContext.class,0);
}
public TerminalNode ASSIGNMENT() { return getToken(KotlinParser.ASSIGNMENT, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public FunctionBodyContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_functionBody; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterFunctionBody(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitFunctionBody(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitFunctionBody(this);
else return visitor.visitChildren(this);
}
}
public final FunctionBodyContext functionBody() throws RecognitionException {
FunctionBodyContext _localctx = new FunctionBodyContext(_ctx, getState());
enterRule(_localctx, 60, RULE_functionBody);
try {
int _alt;
setState(964);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LCURL:
enterOuterAlt(_localctx, 1);
{
setState(955);
block();
}
break;
case ASSIGNMENT:
enterOuterAlt(_localctx, 2);
{
setState(956);
match(ASSIGNMENT);
setState(960);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,123,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(957);
match(NL);
}
}
}
setState(962);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,123,_ctx);
}
setState(963);
expression();
}
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 ObjectDeclarationContext extends ParserRuleContext {
public TerminalNode OBJECT() { return getToken(KotlinParser.OBJECT, 0); }
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public TerminalNode JavadocComment() { return getToken(KotlinParser.JavadocComment, 0); }
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public PrimaryConstructorContext primaryConstructor() {
return getRuleContext(PrimaryConstructorContext.class,0);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public DelegationSpecifiersContext delegationSpecifiers() {
return getRuleContext(DelegationSpecifiersContext.class,0);
}
public ClassBodyContext classBody() {
return getRuleContext(ClassBodyContext.class,0);
}
public ObjectDeclarationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_objectDeclaration; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterObjectDeclaration(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitObjectDeclaration(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitObjectDeclaration(this);
else return visitor.visitChildren(this);
}
}
public final ObjectDeclarationContext objectDeclaration() throws RecognitionException {
ObjectDeclarationContext _localctx = new ObjectDeclarationContext(_ctx, getState());
enterRule(_localctx, 62, RULE_objectDeclaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(972);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==JavadocComment) {
{
setState(966);
match(JavadocComment);
setState(968);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(967);
match(NL);
}
}
setState(970);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==NL );
}
}
setState(975);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(974);
modifierList();
}
}
setState(977);
match(OBJECT);
setState(981);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(978);
match(NL);
}
}
setState(983);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(984);
simpleIdentifier();
setState(992);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,130,_ctx) ) {
case 1:
{
setState(988);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(985);
match(NL);
}
}
setState(990);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(991);
primaryConstructor();
}
break;
}
setState(1008);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,133,_ctx) ) {
case 1:
{
setState(997);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(994);
match(NL);
}
}
setState(999);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1000);
match(COLON);
setState(1004);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1001);
match(NL);
}
}
setState(1006);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1007);
delegationSpecifiers();
}
break;
}
setState(1017);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,135,_ctx) ) {
case 1:
{
setState(1013);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1010);
match(NL);
}
}
setState(1015);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1016);
classBody();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class CompanionObjectContext extends ParserRuleContext {
public TerminalNode COMPANION() { return getToken(KotlinParser.COMPANION, 0); }
public TerminalNode OBJECT() { return getToken(KotlinParser.OBJECT, 0); }
public List modifierList() {
return getRuleContexts(ModifierListContext.class);
}
public ModifierListContext modifierList(int i) {
return getRuleContext(ModifierListContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public DelegationSpecifiersContext delegationSpecifiers() {
return getRuleContext(DelegationSpecifiersContext.class,0);
}
public ClassBodyContext classBody() {
return getRuleContext(ClassBodyContext.class,0);
}
public CompanionObjectContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_companionObject; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterCompanionObject(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitCompanionObject(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitCompanionObject(this);
else return visitor.visitChildren(this);
}
}
public final CompanionObjectContext companionObject() throws RecognitionException {
CompanionObjectContext _localctx = new CompanionObjectContext(_ctx, getState());
enterRule(_localctx, 64, RULE_companionObject);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1020);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(1019);
modifierList();
}
}
setState(1022);
match(COMPANION);
setState(1026);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1023);
match(NL);
}
}
setState(1028);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1030);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(1029);
modifierList();
}
}
setState(1032);
match(OBJECT);
setState(1040);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,140,_ctx) ) {
case 1:
{
setState(1036);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1033);
match(NL);
}
}
setState(1038);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1039);
simpleIdentifier();
}
break;
}
setState(1056);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,143,_ctx) ) {
case 1:
{
setState(1045);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1042);
match(NL);
}
}
setState(1047);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1048);
match(COLON);
setState(1052);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1049);
match(NL);
}
}
setState(1054);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1055);
delegationSpecifiers();
}
break;
}
setState(1065);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,145,_ctx) ) {
case 1:
{
setState(1061);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1058);
match(NL);
}
}
setState(1063);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1064);
classBody();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class PropertyDeclarationContext extends ParserRuleContext {
public TerminalNode VAL() { return getToken(KotlinParser.VAL, 0); }
public TerminalNode VAR() { return getToken(KotlinParser.VAR, 0); }
public TerminalNode JavadocComment() { return getToken(KotlinParser.JavadocComment, 0); }
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public TypeParametersContext typeParameters() {
return getRuleContext(TypeParametersContext.class,0);
}
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TerminalNode DOT() { return getToken(KotlinParser.DOT, 0); }
public TypeConstraintsContext typeConstraints() {
return getRuleContext(TypeConstraintsContext.class,0);
}
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List setter() {
return getRuleContexts(SetterContext.class);
}
public SetterContext setter(int i) {
return getRuleContext(SetterContext.class,i);
}
public List getter() {
return getRuleContexts(GetterContext.class);
}
public GetterContext getter(int i) {
return getRuleContext(GetterContext.class,i);
}
public MultiVariableDeclarationContext multiVariableDeclaration() {
return getRuleContext(MultiVariableDeclarationContext.class,0);
}
public VariableDeclarationContext variableDeclaration() {
return getRuleContext(VariableDeclarationContext.class,0);
}
public TerminalNode BY() { return getToken(KotlinParser.BY, 0); }
public TerminalNode ASSIGNMENT() { return getToken(KotlinParser.ASSIGNMENT, 0); }
public SemiContext semi() {
return getRuleContext(SemiContext.class,0);
}
public PropertyDeclarationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_propertyDeclaration; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterPropertyDeclaration(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitPropertyDeclaration(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitPropertyDeclaration(this);
else return visitor.visitChildren(this);
}
}
public final PropertyDeclarationContext propertyDeclaration() throws RecognitionException {
PropertyDeclarationContext _localctx = new PropertyDeclarationContext(_ctx, getState());
enterRule(_localctx, 66, RULE_propertyDeclaration);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1073);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==JavadocComment) {
{
setState(1067);
match(JavadocComment);
setState(1069);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(1068);
match(NL);
}
}
setState(1071);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==NL );
}
}
setState(1076);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(1075);
modifierList();
}
}
setState(1078);
_la = _input.LA(1);
if ( !(_la==VAL || _la==VAR) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1086);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,150,_ctx) ) {
case 1:
{
setState(1082);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1079);
match(NL);
}
}
setState(1084);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1085);
typeParameters();
}
break;
}
setState(1103);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,153,_ctx) ) {
case 1:
{
setState(1091);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1088);
match(NL);
}
}
setState(1093);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1094);
type();
setState(1098);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1095);
match(NL);
}
}
setState(1100);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1101);
match(DOT);
}
break;
}
{
setState(1108);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1105);
match(NL);
}
}
setState(1110);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1113);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LPAREN:
{
setState(1111);
multiVariableDeclaration();
}
break;
case IMPORT:
case CONSTRUCTOR:
case BY:
case COMPANION:
case INIT:
case WHERE:
case CATCH:
case FINALLY:
case OUT:
case GETTER:
case SETTER:
case DYNAMIC:
case PUBLIC:
case PRIVATE:
case PROTECTED:
case INTERNAL:
case ENUM:
case SEALED:
case ANNOTATION:
case DATA:
case INNER:
case TAILREC:
case OPERATOR:
case INLINE:
case INFIX:
case EXTERNAL:
case SUSPEND:
case OVERRIDE:
case ABSTRACT:
case FINAL:
case OPEN:
case CONST:
case LATEINIT:
case VARARG:
case NOINLINE:
case CROSSINLINE:
case REIFIED:
case Identifier:
{
setState(1112);
variableDeclaration();
}
break;
default:
throw new NoViableAltException(this);
}
}
setState(1122);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,157,_ctx) ) {
case 1:
{
setState(1118);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1115);
match(NL);
}
}
setState(1120);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1121);
typeConstraints();
}
break;
}
setState(1138);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,160,_ctx) ) {
case 1:
{
setState(1127);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1124);
match(NL);
}
}
setState(1129);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1130);
_la = _input.LA(1);
if ( !(_la==ASSIGNMENT || _la==BY) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1134);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,159,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1131);
match(NL);
}
}
}
setState(1136);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,159,_ctx);
}
setState(1137);
expression();
}
break;
}
setState(1146);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,162,_ctx) ) {
case 1:
{
setState(1140);
match(NL);
setState(1141);
setter();
setState(1144);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,161,_ctx) ) {
case 1:
{
setState(1142);
match(NL);
setState(1143);
getter();
}
break;
}
}
break;
}
setState(1154);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,164,_ctx) ) {
case 1:
{
setState(1148);
match(NL);
setState(1149);
getter();
setState(1152);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,163,_ctx) ) {
case 1:
{
setState(1150);
match(NL);
setState(1151);
setter();
}
break;
}
}
break;
}
setState(1168);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,167,_ctx) ) {
case 1:
{
setState(1156);
getter();
setState(1160);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,165,_ctx) ) {
case 1:
{
setState(1157);
semi();
setState(1158);
setter();
}
break;
}
}
break;
case 2:
{
setState(1162);
setter();
setState(1166);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,166,_ctx) ) {
case 1:
{
setState(1163);
semi();
setState(1164);
getter();
}
break;
}
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class MultiVariableDeclarationContext extends ParserRuleContext {
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public List variableDeclaration() {
return getRuleContexts(VariableDeclarationContext.class);
}
public VariableDeclarationContext variableDeclaration(int i) {
return getRuleContext(VariableDeclarationContext.class,i);
}
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
public List COMMA() { return getTokens(KotlinParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(KotlinParser.COMMA, i);
}
public MultiVariableDeclarationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_multiVariableDeclaration; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterMultiVariableDeclaration(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitMultiVariableDeclaration(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitMultiVariableDeclaration(this);
else return visitor.visitChildren(this);
}
}
public final MultiVariableDeclarationContext multiVariableDeclaration() throws RecognitionException {
MultiVariableDeclarationContext _localctx = new MultiVariableDeclarationContext(_ctx, getState());
enterRule(_localctx, 68, RULE_multiVariableDeclaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1170);
match(LPAREN);
setState(1171);
variableDeclaration();
setState(1176);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1172);
match(COMMA);
setState(1173);
variableDeclaration();
}
}
setState(1178);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1179);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class VariableDeclarationContext extends ParserRuleContext {
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public VariableDeclarationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_variableDeclaration; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterVariableDeclaration(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitVariableDeclaration(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitVariableDeclaration(this);
else return visitor.visitChildren(this);
}
}
public final VariableDeclarationContext variableDeclaration() throws RecognitionException {
VariableDeclarationContext _localctx = new VariableDeclarationContext(_ctx, getState());
enterRule(_localctx, 70, RULE_variableDeclaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1181);
simpleIdentifier();
setState(1184);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COLON) {
{
setState(1182);
match(COLON);
setState(1183);
type();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class GetterContext extends ParserRuleContext {
public TerminalNode GETTER() { return getToken(KotlinParser.GETTER, 0); }
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
public BlockContext block() {
return getRuleContext(BlockContext.class,0);
}
public TerminalNode ASSIGNMENT() { return getToken(KotlinParser.ASSIGNMENT, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public GetterContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_getter; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterGetter(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitGetter(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitGetter(this);
else return visitor.visitChildren(this);
}
}
public final GetterContext getter() throws RecognitionException {
GetterContext _localctx = new GetterContext(_ctx, getState());
enterRule(_localctx, 72, RULE_getter);
int _la;
try {
int _alt;
setState(1235);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,179,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1187);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(1186);
modifierList();
}
}
setState(1189);
match(GETTER);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1191);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(1190);
modifierList();
}
}
setState(1193);
match(GETTER);
setState(1197);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1194);
match(NL);
}
}
setState(1199);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1200);
match(LPAREN);
setState(1201);
match(RPAREN);
setState(1216);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,175,_ctx) ) {
case 1:
{
setState(1205);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1202);
match(NL);
}
}
setState(1207);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1208);
match(COLON);
setState(1212);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1209);
match(NL);
}
}
setState(1214);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1215);
type();
}
break;
}
setState(1221);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1218);
match(NL);
}
}
setState(1223);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1233);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LCURL:
{
setState(1224);
block();
}
break;
case ASSIGNMENT:
{
setState(1225);
match(ASSIGNMENT);
setState(1229);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,177,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1226);
match(NL);
}
}
}
setState(1231);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,177,_ctx);
}
setState(1232);
expression();
}
break;
default:
throw new NoViableAltException(this);
}
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class SetterContext extends ParserRuleContext {
public TerminalNode SETTER() { return getToken(KotlinParser.SETTER, 0); }
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
public FunctionBodyContext functionBody() {
return getRuleContext(FunctionBodyContext.class,0);
}
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public ParameterContext parameter() {
return getRuleContext(ParameterContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List annotations() {
return getRuleContexts(AnnotationsContext.class);
}
public AnnotationsContext annotations(int i) {
return getRuleContext(AnnotationsContext.class,i);
}
public List parameterModifier() {
return getRuleContexts(ParameterModifierContext.class);
}
public ParameterModifierContext parameterModifier(int i) {
return getRuleContext(ParameterModifierContext.class,i);
}
public SetterContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_setter; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterSetter(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitSetter(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitSetter(this);
else return visitor.visitChildren(this);
}
}
public final SetterContext setter() throws RecognitionException {
SetterContext _localctx = new SetterContext(_ctx, getState());
enterRule(_localctx, 74, RULE_setter);
int _la;
try {
int _alt;
setState(1272);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,187,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1238);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(1237);
modifierList();
}
}
setState(1240);
match(SETTER);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1242);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(1241);
modifierList();
}
}
setState(1244);
match(SETTER);
setState(1248);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1245);
match(NL);
}
}
setState(1250);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1251);
match(LPAREN);
setState(1256);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,184,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
setState(1254);
_errHandler.sync(this);
switch (_input.LA(1)) {
case AT:
case FILE:
case FIELD:
case PROPERTY:
case GET:
case SET:
case RECEIVER:
case PARAM:
case SETPARAM:
case DELEGATE:
case LabelReference:
{
setState(1252);
annotations();
}
break;
case VARARG:
case NOINLINE:
case CROSSINLINE:
{
setState(1253);
parameterModifier();
}
break;
default:
throw new NoViableAltException(this);
}
}
}
setState(1258);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,184,_ctx);
}
setState(1261);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,185,_ctx) ) {
case 1:
{
setState(1259);
simpleIdentifier();
}
break;
case 2:
{
setState(1260);
parameter();
}
break;
}
setState(1263);
match(RPAREN);
setState(1267);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1264);
match(NL);
}
}
setState(1269);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1270);
functionBody();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TypeAliasContext extends ParserRuleContext {
public TerminalNode TYPE_ALIAS() { return getToken(KotlinParser.TYPE_ALIAS, 0); }
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public TerminalNode ASSIGNMENT() { return getToken(KotlinParser.ASSIGNMENT, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public TypeParametersContext typeParameters() {
return getRuleContext(TypeParametersContext.class,0);
}
public TypeAliasContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeAlias; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterTypeAlias(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitTypeAlias(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitTypeAlias(this);
else return visitor.visitChildren(this);
}
}
public final TypeAliasContext typeAlias() throws RecognitionException {
TypeAliasContext _localctx = new TypeAliasContext(_ctx, getState());
enterRule(_localctx, 76, RULE_typeAlias);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1275);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 91)) & ~0x3f) == 0 && ((1L << (_la - 91)) & 4504699138981113L) != 0)) {
{
setState(1274);
modifierList();
}
}
setState(1277);
match(TYPE_ALIAS);
setState(1281);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1278);
match(NL);
}
}
setState(1283);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1284);
simpleIdentifier();
setState(1292);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,191,_ctx) ) {
case 1:
{
setState(1288);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1285);
match(NL);
}
}
setState(1290);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1291);
typeParameters();
}
break;
}
setState(1297);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1294);
match(NL);
}
}
setState(1299);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1300);
match(ASSIGNMENT);
setState(1304);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1301);
match(NL);
}
}
setState(1306);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1307);
type();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TypeParametersContext extends ParserRuleContext {
public TerminalNode LANGLE() { return getToken(KotlinParser.LANGLE, 0); }
public List typeParameter() {
return getRuleContexts(TypeParameterContext.class);
}
public TypeParameterContext typeParameter(int i) {
return getRuleContext(TypeParameterContext.class,i);
}
public TerminalNode RANGLE() { return getToken(KotlinParser.RANGLE, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List COMMA() { return getTokens(KotlinParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(KotlinParser.COMMA, i);
}
public TypeParametersContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeParameters; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterTypeParameters(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitTypeParameters(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitTypeParameters(this);
else return visitor.visitChildren(this);
}
}
public final TypeParametersContext typeParameters() throws RecognitionException {
TypeParametersContext _localctx = new TypeParametersContext(_ctx, getState());
enterRule(_localctx, 78, RULE_typeParameters);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1309);
match(LANGLE);
setState(1313);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,194,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1310);
match(NL);
}
}
}
setState(1315);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,194,_ctx);
}
setState(1316);
typeParameter();
setState(1333);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,197,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1320);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1317);
match(NL);
}
}
setState(1322);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1323);
match(COMMA);
setState(1327);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,196,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1324);
match(NL);
}
}
}
setState(1329);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,196,_ctx);
}
setState(1330);
typeParameter();
}
}
}
setState(1335);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,197,_ctx);
}
setState(1339);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1336);
match(NL);
}
}
setState(1341);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1342);
match(RANGLE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TypeParameterContext extends ParserRuleContext {
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public ModifierListContext modifierList() {
return getRuleContext(ModifierListContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TypeParameterContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeParameter; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterTypeParameter(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitTypeParameter(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitTypeParameter(this);
else return visitor.visitChildren(this);
}
}
public final TypeParameterContext typeParameter() throws RecognitionException {
TypeParameterContext _localctx = new TypeParameterContext(_ctx, getState());
enterRule(_localctx, 80, RULE_typeParameter);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1345);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,199,_ctx) ) {
case 1:
{
setState(1344);
modifierList();
}
break;
}
setState(1350);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1347);
match(NL);
}
}
setState(1352);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1353);
simpleIdentifier();
setState(1368);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,203,_ctx) ) {
case 1:
{
setState(1357);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1354);
match(NL);
}
}
setState(1359);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1360);
match(COLON);
setState(1364);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1361);
match(NL);
}
}
setState(1366);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1367);
type();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TypeContext extends ParserRuleContext {
public FunctionTypeContext functionType() {
return getRuleContext(FunctionTypeContext.class,0);
}
public ParenthesizedTypeContext parenthesizedType() {
return getRuleContext(ParenthesizedTypeContext.class,0);
}
public NullableTypeContext nullableType() {
return getRuleContext(NullableTypeContext.class,0);
}
public TypeReferenceContext typeReference() {
return getRuleContext(TypeReferenceContext.class,0);
}
public TypeModifierListContext typeModifierList() {
return getRuleContext(TypeModifierListContext.class,0);
}
public TypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_type; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitType(this);
else return visitor.visitChildren(this);
}
}
public final TypeContext type() throws RecognitionException {
TypeContext _localctx = new TypeContext(_ctx, getState());
enterRule(_localctx, 82, RULE_type);
try {
enterOuterAlt(_localctx, 1);
{
setState(1371);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,204,_ctx) ) {
case 1:
{
setState(1370);
typeModifierList();
}
break;
}
setState(1377);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,205,_ctx) ) {
case 1:
{
setState(1373);
functionType();
}
break;
case 2:
{
setState(1374);
parenthesizedType();
}
break;
case 3:
{
setState(1375);
nullableType();
}
break;
case 4:
{
setState(1376);
typeReference();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TypeModifierListContext extends ParserRuleContext {
public List annotations() {
return getRuleContexts(AnnotationsContext.class);
}
public AnnotationsContext annotations(int i) {
return getRuleContext(AnnotationsContext.class,i);
}
public List SUSPEND() { return getTokens(KotlinParser.SUSPEND); }
public TerminalNode SUSPEND(int i) {
return getToken(KotlinParser.SUSPEND, i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public TypeModifierListContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeModifierList; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterTypeModifierList(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitTypeModifierList(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitTypeModifierList(this);
else return visitor.visitChildren(this);
}
}
public final TypeModifierListContext typeModifierList() throws RecognitionException {
TypeModifierListContext _localctx = new TypeModifierListContext(_ctx, getState());
enterRule(_localctx, 84, RULE_typeModifierList);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1387);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
setState(1387);
_errHandler.sync(this);
switch (_input.LA(1)) {
case AT:
case FILE:
case FIELD:
case PROPERTY:
case GET:
case SET:
case RECEIVER:
case PARAM:
case SETPARAM:
case DELEGATE:
case LabelReference:
{
setState(1379);
annotations();
}
break;
case SUSPEND:
{
setState(1380);
match(SUSPEND);
setState(1384);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1381);
match(NL);
}
}
setState(1386);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
default:
throw new NoViableAltException(this);
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(1389);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,208,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ParenthesizedTypeContext extends ParserRuleContext {
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
public ParenthesizedTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_parenthesizedType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterParenthesizedType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitParenthesizedType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitParenthesizedType(this);
else return visitor.visitChildren(this);
}
}
public final ParenthesizedTypeContext parenthesizedType() throws RecognitionException {
ParenthesizedTypeContext _localctx = new ParenthesizedTypeContext(_ctx, getState());
enterRule(_localctx, 86, RULE_parenthesizedType);
try {
enterOuterAlt(_localctx, 1);
{
setState(1391);
match(LPAREN);
setState(1392);
type();
setState(1393);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class NullableTypeContext extends ParserRuleContext {
public TypeReferenceContext typeReference() {
return getRuleContext(TypeReferenceContext.class,0);
}
public ParenthesizedTypeContext parenthesizedType() {
return getRuleContext(ParenthesizedTypeContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List QUEST() { return getTokens(KotlinParser.QUEST); }
public TerminalNode QUEST(int i) {
return getToken(KotlinParser.QUEST, i);
}
public NullableTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_nullableType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterNullableType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitNullableType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitNullableType(this);
else return visitor.visitChildren(this);
}
}
public final NullableTypeContext nullableType() throws RecognitionException {
NullableTypeContext _localctx = new NullableTypeContext(_ctx, getState());
enterRule(_localctx, 88, RULE_nullableType);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1397);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,209,_ctx) ) {
case 1:
{
setState(1395);
typeReference();
}
break;
case 2:
{
setState(1396);
parenthesizedType();
}
break;
}
setState(1402);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1399);
match(NL);
}
}
setState(1404);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1406);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(1405);
match(QUEST);
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(1408);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,211,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TypeReferenceContext extends ParserRuleContext {
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public TypeReferenceContext typeReference() {
return getRuleContext(TypeReferenceContext.class,0);
}
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
public UserTypeContext userType() {
return getRuleContext(UserTypeContext.class,0);
}
public TerminalNode DYNAMIC() { return getToken(KotlinParser.DYNAMIC, 0); }
public TypeReferenceContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeReference; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterTypeReference(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitTypeReference(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitTypeReference(this);
else return visitor.visitChildren(this);
}
}
public final TypeReferenceContext typeReference() throws RecognitionException {
TypeReferenceContext _localctx = new TypeReferenceContext(_ctx, getState());
enterRule(_localctx, 90, RULE_typeReference);
try {
setState(1416);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,212,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1410);
match(LPAREN);
setState(1411);
typeReference();
setState(1412);
match(RPAREN);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1414);
userType();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(1415);
match(DYNAMIC);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class FunctionTypeContext extends ParserRuleContext {
public FunctionTypeParametersContext functionTypeParameters() {
return getRuleContext(FunctionTypeParametersContext.class,0);
}
public TerminalNode ARROW() { return getToken(KotlinParser.ARROW, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public FunctionTypeReceiverContext functionTypeReceiver() {
return getRuleContext(FunctionTypeReceiverContext.class,0);
}
public TerminalNode DOT() { return getToken(KotlinParser.DOT, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public FunctionTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_functionType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterFunctionType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitFunctionType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitFunctionType(this);
else return visitor.visitChildren(this);
}
}
public final FunctionTypeContext functionType() throws RecognitionException {
FunctionTypeContext _localctx = new FunctionTypeContext(_ctx, getState());
enterRule(_localctx, 92, RULE_functionType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1432);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,215,_ctx) ) {
case 1:
{
setState(1418);
functionTypeReceiver();
setState(1422);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1419);
match(NL);
}
}
setState(1424);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1425);
match(DOT);
setState(1429);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1426);
match(NL);
}
}
setState(1431);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
}
setState(1434);
functionTypeParameters();
setState(1438);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1435);
match(NL);
}
}
setState(1440);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1441);
match(ARROW);
{
setState(1445);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1442);
match(NL);
}
}
setState(1447);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1448);
type();
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class FunctionTypeReceiverContext extends ParserRuleContext {
public ParenthesizedTypeContext parenthesizedType() {
return getRuleContext(ParenthesizedTypeContext.class,0);
}
public NullableTypeContext nullableType() {
return getRuleContext(NullableTypeContext.class,0);
}
public TypeReferenceContext typeReference() {
return getRuleContext(TypeReferenceContext.class,0);
}
public FunctionTypeReceiverContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_functionTypeReceiver; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterFunctionTypeReceiver(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitFunctionTypeReceiver(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitFunctionTypeReceiver(this);
else return visitor.visitChildren(this);
}
}
public final FunctionTypeReceiverContext functionTypeReceiver() throws RecognitionException {
FunctionTypeReceiverContext _localctx = new FunctionTypeReceiverContext(_ctx, getState());
enterRule(_localctx, 94, RULE_functionTypeReceiver);
try {
setState(1453);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,218,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1450);
parenthesizedType();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1451);
nullableType();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(1452);
typeReference();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class UserTypeContext extends ParserRuleContext {
public List simpleUserType() {
return getRuleContexts(SimpleUserTypeContext.class);
}
public SimpleUserTypeContext simpleUserType(int i) {
return getRuleContext(SimpleUserTypeContext.class,i);
}
public List DOT() { return getTokens(KotlinParser.DOT); }
public TerminalNode DOT(int i) {
return getToken(KotlinParser.DOT, i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public UserTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_userType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterUserType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitUserType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitUserType(this);
else return visitor.visitChildren(this);
}
}
public final UserTypeContext userType() throws RecognitionException {
UserTypeContext _localctx = new UserTypeContext(_ctx, getState());
enterRule(_localctx, 96, RULE_userType);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1455);
simpleUserType();
setState(1472);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,221,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1459);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1456);
match(NL);
}
}
setState(1461);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1462);
match(DOT);
setState(1466);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1463);
match(NL);
}
}
setState(1468);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1469);
simpleUserType();
}
}
}
setState(1474);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,221,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class SimpleUserTypeContext extends ParserRuleContext {
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public TypeArgumentsContext typeArguments() {
return getRuleContext(TypeArgumentsContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public SimpleUserTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_simpleUserType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterSimpleUserType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitSimpleUserType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitSimpleUserType(this);
else return visitor.visitChildren(this);
}
}
public final SimpleUserTypeContext simpleUserType() throws RecognitionException {
SimpleUserTypeContext _localctx = new SimpleUserTypeContext(_ctx, getState());
enterRule(_localctx, 98, RULE_simpleUserType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1475);
simpleIdentifier();
setState(1483);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,223,_ctx) ) {
case 1:
{
setState(1479);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1476);
match(NL);
}
}
setState(1481);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1482);
typeArguments();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class FunctionTypeParametersContext extends ParserRuleContext {
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
public List parameter() {
return getRuleContexts(ParameterContext.class);
}
public ParameterContext parameter(int i) {
return getRuleContext(ParameterContext.class,i);
}
public List type() {
return getRuleContexts(TypeContext.class);
}
public TypeContext type(int i) {
return getRuleContext(TypeContext.class,i);
}
public List COMMA() { return getTokens(KotlinParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(KotlinParser.COMMA, i);
}
public FunctionTypeParametersContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_functionTypeParameters; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterFunctionTypeParameters(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitFunctionTypeParameters(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitFunctionTypeParameters(this);
else return visitor.visitChildren(this);
}
}
public final FunctionTypeParametersContext functionTypeParameters() throws RecognitionException {
FunctionTypeParametersContext _localctx = new FunctionTypeParametersContext(_ctx, getState());
enterRule(_localctx, 100, RULE_functionTypeParameters);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1485);
match(LPAREN);
setState(1488);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,224,_ctx) ) {
case 1:
{
setState(1486);
parameter();
}
break;
case 2:
{
setState(1487);
type();
}
break;
}
setState(1497);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1490);
match(COMMA);
setState(1493);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,225,_ctx) ) {
case 1:
{
setState(1491);
parameter();
}
break;
case 2:
{
setState(1492);
type();
}
break;
}
}
}
setState(1499);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1500);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TypeConstraintsContext extends ParserRuleContext {
public TerminalNode WHERE() { return getToken(KotlinParser.WHERE, 0); }
public List typeConstraint() {
return getRuleContexts(TypeConstraintContext.class);
}
public TypeConstraintContext typeConstraint(int i) {
return getRuleContext(TypeConstraintContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List COMMA() { return getTokens(KotlinParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(KotlinParser.COMMA, i);
}
public TypeConstraintsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeConstraints; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterTypeConstraints(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitTypeConstraints(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitTypeConstraints(this);
else return visitor.visitChildren(this);
}
}
public final TypeConstraintsContext typeConstraints() throws RecognitionException {
TypeConstraintsContext _localctx = new TypeConstraintsContext(_ctx, getState());
enterRule(_localctx, 102, RULE_typeConstraints);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1502);
match(WHERE);
setState(1506);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1503);
match(NL);
}
}
setState(1508);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1509);
typeConstraint();
setState(1526);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,230,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1513);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1510);
match(NL);
}
}
setState(1515);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1516);
match(COMMA);
setState(1520);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1517);
match(NL);
}
}
setState(1522);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1523);
typeConstraint();
}
}
}
setState(1528);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,230,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TypeConstraintContext extends ParserRuleContext {
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public List annotations() {
return getRuleContexts(AnnotationsContext.class);
}
public AnnotationsContext annotations(int i) {
return getRuleContext(AnnotationsContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public TypeConstraintContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeConstraint; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterTypeConstraint(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitTypeConstraint(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitTypeConstraint(this);
else return visitor.visitChildren(this);
}
}
public final TypeConstraintContext typeConstraint() throws RecognitionException {
TypeConstraintContext _localctx = new TypeConstraintContext(_ctx, getState());
enterRule(_localctx, 104, RULE_typeConstraint);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1532);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AT || _la==FILE || ((((_la - 95)) & ~0x3f) == 0 && ((1L << (_la - 95)) & 281474976711631L) != 0)) {
{
{
setState(1529);
annotations();
}
}
setState(1534);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1535);
simpleIdentifier();
setState(1539);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1536);
match(NL);
}
}
setState(1541);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1542);
match(COLON);
setState(1546);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1543);
match(NL);
}
}
setState(1548);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1549);
type();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class BlockContext extends ParserRuleContext {
public TerminalNode LCURL() { return getToken(KotlinParser.LCURL, 0); }
public StatementsContext statements() {
return getRuleContext(StatementsContext.class,0);
}
public TerminalNode RCURL() { return getToken(KotlinParser.RCURL, 0); }
public BlockContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_block; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterBlock(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitBlock(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitBlock(this);
else return visitor.visitChildren(this);
}
}
public final BlockContext block() throws RecognitionException {
BlockContext _localctx = new BlockContext(_ctx, getState());
enterRule(_localctx, 106, RULE_block);
try {
enterOuterAlt(_localctx, 1);
{
setState(1551);
match(LCURL);
setState(1552);
statements();
setState(1553);
match(RCURL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class StatementsContext extends ParserRuleContext {
public List anysemi() {
return getRuleContexts(AnysemiContext.class);
}
public AnysemiContext anysemi(int i) {
return getRuleContext(AnysemiContext.class,i);
}
public List statement() {
return getRuleContexts(StatementContext.class);
}
public StatementContext statement(int i) {
return getRuleContext(StatementContext.class,i);
}
public StatementsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_statements; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterStatements(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitStatements(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitStatements(this);
else return visitor.visitChildren(this);
}
}
public final StatementsContext statements() throws RecognitionException {
StatementsContext _localctx = new StatementsContext(_ctx, getState());
enterRule(_localctx, 108, RULE_statements);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1558);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,234,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1555);
anysemi();
}
}
}
setState(1560);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,234,_ctx);
}
setState(1575);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,238,_ctx) ) {
case 1:
{
setState(1561);
statement();
setState(1572);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,237,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1563);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(1562);
anysemi();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(1565);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,235,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
setState(1568);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,236,_ctx) ) {
case 1:
{
setState(1567);
statement();
}
break;
}
}
}
}
setState(1574);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,237,_ctx);
}
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class StatementContext extends ParserRuleContext {
public DeclarationContext declaration() {
return getRuleContext(DeclarationContext.class,0);
}
public BlockLevelExpressionContext blockLevelExpression() {
return getRuleContext(BlockLevelExpressionContext.class,0);
}
public StatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_statement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitStatement(this);
else return visitor.visitChildren(this);
}
}
public final StatementContext statement() throws RecognitionException {
StatementContext _localctx = new StatementContext(_ctx, getState());
enterRule(_localctx, 110, RULE_statement);
try {
setState(1579);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,239,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1577);
declaration();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1578);
blockLevelExpression();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class BlockLevelExpressionContext extends ParserRuleContext {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public List annotations() {
return getRuleContexts(AnnotationsContext.class);
}
public AnnotationsContext annotations(int i) {
return getRuleContext(AnnotationsContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public BlockLevelExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_blockLevelExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterBlockLevelExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitBlockLevelExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitBlockLevelExpression(this);
else return visitor.visitChildren(this);
}
}
public final BlockLevelExpressionContext blockLevelExpression() throws RecognitionException {
BlockLevelExpressionContext _localctx = new BlockLevelExpressionContext(_ctx, getState());
enterRule(_localctx, 112, RULE_blockLevelExpression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1584);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,240,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1581);
annotations();
}
}
}
setState(1586);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,240,_ctx);
}
setState(1590);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,241,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1587);
match(NL);
}
}
}
setState(1592);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,241,_ctx);
}
setState(1593);
expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class DeclarationContext extends ParserRuleContext {
public ClassDeclarationContext classDeclaration() {
return getRuleContext(ClassDeclarationContext.class,0);
}
public FunctionDeclarationContext functionDeclaration() {
return getRuleContext(FunctionDeclarationContext.class,0);
}
public PropertyDeclarationContext propertyDeclaration() {
return getRuleContext(PropertyDeclarationContext.class,0);
}
public TypeAliasContext typeAlias() {
return getRuleContext(TypeAliasContext.class,0);
}
public List labelDefinition() {
return getRuleContexts(LabelDefinitionContext.class);
}
public LabelDefinitionContext labelDefinition(int i) {
return getRuleContext(LabelDefinitionContext.class,i);
}
public DeclarationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_declaration; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterDeclaration(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitDeclaration(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitDeclaration(this);
else return visitor.visitChildren(this);
}
}
public final DeclarationContext declaration() throws RecognitionException {
DeclarationContext _localctx = new DeclarationContext(_ctx, getState());
enterRule(_localctx, 114, RULE_declaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1598);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==LabelDefinition) {
{
{
setState(1595);
labelDefinition();
}
}
setState(1600);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1605);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,243,_ctx) ) {
case 1:
{
setState(1601);
classDeclaration();
}
break;
case 2:
{
setState(1602);
functionDeclaration();
}
break;
case 3:
{
setState(1603);
propertyDeclaration();
}
break;
case 4:
{
setState(1604);
typeAlias();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ExpressionContext extends ParserRuleContext {
public List disjunction() {
return getRuleContexts(DisjunctionContext.class);
}
public DisjunctionContext disjunction(int i) {
return getRuleContext(DisjunctionContext.class,i);
}
public List assignmentOperator() {
return getRuleContexts(AssignmentOperatorContext.class);
}
public AssignmentOperatorContext assignmentOperator(int i) {
return getRuleContext(AssignmentOperatorContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public ExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_expression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitExpression(this);
else return visitor.visitChildren(this);
}
}
public final ExpressionContext expression() throws RecognitionException {
ExpressionContext _localctx = new ExpressionContext(_ctx, getState());
enterRule(_localctx, 116, RULE_expression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1607);
disjunction();
setState(1619);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,245,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1608);
assignmentOperator();
setState(1612);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,244,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1609);
match(NL);
}
}
}
setState(1614);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,244,_ctx);
}
setState(1615);
disjunction();
}
}
}
setState(1621);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,245,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class DisjunctionContext extends ParserRuleContext {
public List conjunction() {
return getRuleContexts(ConjunctionContext.class);
}
public ConjunctionContext conjunction(int i) {
return getRuleContext(ConjunctionContext.class,i);
}
public List DISJ() { return getTokens(KotlinParser.DISJ); }
public TerminalNode DISJ(int i) {
return getToken(KotlinParser.DISJ, i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public DisjunctionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_disjunction; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterDisjunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitDisjunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitDisjunction(this);
else return visitor.visitChildren(this);
}
}
public final DisjunctionContext disjunction() throws RecognitionException {
DisjunctionContext _localctx = new DisjunctionContext(_ctx, getState());
enterRule(_localctx, 118, RULE_disjunction);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1622);
conjunction();
setState(1639);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,248,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1626);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1623);
match(NL);
}
}
setState(1628);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1629);
match(DISJ);
setState(1633);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,247,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1630);
match(NL);
}
}
}
setState(1635);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,247,_ctx);
}
setState(1636);
conjunction();
}
}
}
setState(1641);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,248,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ConjunctionContext extends ParserRuleContext {
public List equalityComparison() {
return getRuleContexts(EqualityComparisonContext.class);
}
public EqualityComparisonContext equalityComparison(int i) {
return getRuleContext(EqualityComparisonContext.class,i);
}
public List CONJ() { return getTokens(KotlinParser.CONJ); }
public TerminalNode CONJ(int i) {
return getToken(KotlinParser.CONJ, i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public ConjunctionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_conjunction; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterConjunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitConjunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitConjunction(this);
else return visitor.visitChildren(this);
}
}
public final ConjunctionContext conjunction() throws RecognitionException {
ConjunctionContext _localctx = new ConjunctionContext(_ctx, getState());
enterRule(_localctx, 120, RULE_conjunction);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1642);
equalityComparison();
setState(1659);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,251,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1646);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1643);
match(NL);
}
}
setState(1648);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1649);
match(CONJ);
setState(1653);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,250,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1650);
match(NL);
}
}
}
setState(1655);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,250,_ctx);
}
setState(1656);
equalityComparison();
}
}
}
setState(1661);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,251,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class EqualityComparisonContext extends ParserRuleContext {
public List comparison() {
return getRuleContexts(ComparisonContext.class);
}
public ComparisonContext comparison(int i) {
return getRuleContext(ComparisonContext.class,i);
}
public List equalityOperation() {
return getRuleContexts(EqualityOperationContext.class);
}
public EqualityOperationContext equalityOperation(int i) {
return getRuleContext(EqualityOperationContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public EqualityComparisonContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_equalityComparison; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterEqualityComparison(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitEqualityComparison(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitEqualityComparison(this);
else return visitor.visitChildren(this);
}
}
public final EqualityComparisonContext equalityComparison() throws RecognitionException {
EqualityComparisonContext _localctx = new EqualityComparisonContext(_ctx, getState());
enterRule(_localctx, 122, RULE_equalityComparison);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1662);
comparison();
setState(1674);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,253,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1663);
equalityOperation();
setState(1667);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,252,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1664);
match(NL);
}
}
}
setState(1669);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,252,_ctx);
}
setState(1670);
comparison();
}
}
}
setState(1676);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,253,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ComparisonContext extends ParserRuleContext {
public List namedInfix() {
return getRuleContexts(NamedInfixContext.class);
}
public NamedInfixContext namedInfix(int i) {
return getRuleContext(NamedInfixContext.class,i);
}
public ComparisonOperatorContext comparisonOperator() {
return getRuleContext(ComparisonOperatorContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public ComparisonContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_comparison; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterComparison(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitComparison(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitComparison(this);
else return visitor.visitChildren(this);
}
}
public final ComparisonContext comparison() throws RecognitionException {
ComparisonContext _localctx = new ComparisonContext(_ctx, getState());
enterRule(_localctx, 124, RULE_comparison);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1677);
namedInfix();
setState(1687);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,255,_ctx) ) {
case 1:
{
setState(1678);
comparisonOperator();
setState(1682);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,254,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1679);
match(NL);
}
}
}
setState(1684);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,254,_ctx);
}
setState(1685);
namedInfix();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class NamedInfixContext extends ParserRuleContext {
public List elvisExpression() {
return getRuleContexts(ElvisExpressionContext.class);
}
public ElvisExpressionContext elvisExpression(int i) {
return getRuleContext(ElvisExpressionContext.class,i);
}
public IsOperatorContext isOperator() {
return getRuleContext(IsOperatorContext.class,0);
}
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public List inOperator() {
return getRuleContexts(InOperatorContext.class);
}
public InOperatorContext inOperator(int i) {
return getRuleContext(InOperatorContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public NamedInfixContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_namedInfix; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterNamedInfix(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitNamedInfix(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitNamedInfix(this);
else return visitor.visitChildren(this);
}
}
public final NamedInfixContext namedInfix() throws RecognitionException {
NamedInfixContext _localctx = new NamedInfixContext(_ctx, getState());
enterRule(_localctx, 126, RULE_namedInfix);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1689);
elvisExpression();
setState(1712);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,259,_ctx) ) {
case 1:
{
setState(1699);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(1690);
inOperator();
setState(1694);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,256,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1691);
match(NL);
}
}
}
setState(1696);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,256,_ctx);
}
setState(1697);
elvisExpression();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(1701);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,257,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
}
break;
case 2:
{
{
setState(1703);
isOperator();
setState(1707);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1704);
match(NL);
}
}
setState(1709);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1710);
type();
}
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ElvisExpressionContext extends ParserRuleContext {
public List infixFunctionCall() {
return getRuleContexts(InfixFunctionCallContext.class);
}
public InfixFunctionCallContext infixFunctionCall(int i) {
return getRuleContext(InfixFunctionCallContext.class,i);
}
public List ELVIS() { return getTokens(KotlinParser.ELVIS); }
public TerminalNode ELVIS(int i) {
return getToken(KotlinParser.ELVIS, i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public ElvisExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_elvisExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterElvisExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitElvisExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitElvisExpression(this);
else return visitor.visitChildren(this);
}
}
public final ElvisExpressionContext elvisExpression() throws RecognitionException {
ElvisExpressionContext _localctx = new ElvisExpressionContext(_ctx, getState());
enterRule(_localctx, 128, RULE_elvisExpression);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1714);
infixFunctionCall();
setState(1731);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,262,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1718);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1715);
match(NL);
}
}
setState(1720);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1721);
match(ELVIS);
setState(1725);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,261,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1722);
match(NL);
}
}
}
setState(1727);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,261,_ctx);
}
setState(1728);
infixFunctionCall();
}
}
}
setState(1733);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,262,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class InfixFunctionCallContext extends ParserRuleContext {
public List rangeExpression() {
return getRuleContexts(RangeExpressionContext.class);
}
public RangeExpressionContext rangeExpression(int i) {
return getRuleContext(RangeExpressionContext.class,i);
}
public List simpleIdentifier() {
return getRuleContexts(SimpleIdentifierContext.class);
}
public SimpleIdentifierContext simpleIdentifier(int i) {
return getRuleContext(SimpleIdentifierContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public InfixFunctionCallContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_infixFunctionCall; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterInfixFunctionCall(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitInfixFunctionCall(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitInfixFunctionCall(this);
else return visitor.visitChildren(this);
}
}
public final InfixFunctionCallContext infixFunctionCall() throws RecognitionException {
InfixFunctionCallContext _localctx = new InfixFunctionCallContext(_ctx, getState());
enterRule(_localctx, 130, RULE_infixFunctionCall);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1734);
rangeExpression();
setState(1746);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,264,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1735);
simpleIdentifier();
setState(1739);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,263,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1736);
match(NL);
}
}
}
setState(1741);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,263,_ctx);
}
setState(1742);
rangeExpression();
}
}
}
setState(1748);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,264,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class RangeExpressionContext extends ParserRuleContext {
public List additiveExpression() {
return getRuleContexts(AdditiveExpressionContext.class);
}
public AdditiveExpressionContext additiveExpression(int i) {
return getRuleContext(AdditiveExpressionContext.class,i);
}
public List RANGE() { return getTokens(KotlinParser.RANGE); }
public TerminalNode RANGE(int i) {
return getToken(KotlinParser.RANGE, i);
}
public List RANGE_UNTIL() { return getTokens(KotlinParser.RANGE_UNTIL); }
public TerminalNode RANGE_UNTIL(int i) {
return getToken(KotlinParser.RANGE_UNTIL, i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public RangeExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_rangeExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterRangeExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitRangeExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitRangeExpression(this);
else return visitor.visitChildren(this);
}
}
public final RangeExpressionContext rangeExpression() throws RecognitionException {
RangeExpressionContext _localctx = new RangeExpressionContext(_ctx, getState());
enterRule(_localctx, 132, RULE_rangeExpression);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1749);
additiveExpression();
setState(1760);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,266,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1750);
_la = _input.LA(1);
if ( !(_la==RANGE || _la==RANGE_UNTIL) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1754);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,265,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1751);
match(NL);
}
}
}
setState(1756);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,265,_ctx);
}
setState(1757);
additiveExpression();
}
}
}
setState(1762);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,266,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class AdditiveExpressionContext extends ParserRuleContext {
public List multiplicativeExpression() {
return getRuleContexts(MultiplicativeExpressionContext.class);
}
public MultiplicativeExpressionContext multiplicativeExpression(int i) {
return getRuleContext(MultiplicativeExpressionContext.class,i);
}
public List additiveOperator() {
return getRuleContexts(AdditiveOperatorContext.class);
}
public AdditiveOperatorContext additiveOperator(int i) {
return getRuleContext(AdditiveOperatorContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public AdditiveExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_additiveExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterAdditiveExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitAdditiveExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitAdditiveExpression(this);
else return visitor.visitChildren(this);
}
}
public final AdditiveExpressionContext additiveExpression() throws RecognitionException {
AdditiveExpressionContext _localctx = new AdditiveExpressionContext(_ctx, getState());
enterRule(_localctx, 134, RULE_additiveExpression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1763);
multiplicativeExpression();
setState(1775);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,268,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1764);
additiveOperator();
setState(1768);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,267,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1765);
match(NL);
}
}
}
setState(1770);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,267,_ctx);
}
setState(1771);
multiplicativeExpression();
}
}
}
setState(1777);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,268,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class MultiplicativeExpressionContext extends ParserRuleContext {
public List typeRHS() {
return getRuleContexts(TypeRHSContext.class);
}
public TypeRHSContext typeRHS(int i) {
return getRuleContext(TypeRHSContext.class,i);
}
public List multiplicativeOperation() {
return getRuleContexts(MultiplicativeOperationContext.class);
}
public MultiplicativeOperationContext multiplicativeOperation(int i) {
return getRuleContext(MultiplicativeOperationContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public MultiplicativeExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_multiplicativeExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterMultiplicativeExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitMultiplicativeExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitMultiplicativeExpression(this);
else return visitor.visitChildren(this);
}
}
public final MultiplicativeExpressionContext multiplicativeExpression() throws RecognitionException {
MultiplicativeExpressionContext _localctx = new MultiplicativeExpressionContext(_ctx, getState());
enterRule(_localctx, 136, RULE_multiplicativeExpression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1778);
typeRHS();
setState(1790);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,270,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1779);
multiplicativeOperation();
setState(1783);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,269,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1780);
match(NL);
}
}
}
setState(1785);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,269,_ctx);
}
setState(1786);
typeRHS();
}
}
}
setState(1792);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,270,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TypeRHSContext extends ParserRuleContext {
public List prefixUnaryExpression() {
return getRuleContexts(PrefixUnaryExpressionContext.class);
}
public PrefixUnaryExpressionContext prefixUnaryExpression(int i) {
return getRuleContext(PrefixUnaryExpressionContext.class,i);
}
public List typeOperation() {
return getRuleContexts(TypeOperationContext.class);
}
public TypeOperationContext typeOperation(int i) {
return getRuleContext(TypeOperationContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public TypeRHSContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeRHS; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterTypeRHS(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitTypeRHS(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitTypeRHS(this);
else return visitor.visitChildren(this);
}
}
public final TypeRHSContext typeRHS() throws RecognitionException {
TypeRHSContext _localctx = new TypeRHSContext(_ctx, getState());
enterRule(_localctx, 138, RULE_typeRHS);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1793);
prefixUnaryExpression();
setState(1805);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,272,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1797);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1794);
match(NL);
}
}
setState(1799);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1800);
typeOperation();
setState(1801);
prefixUnaryExpression();
}
}
}
setState(1807);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,272,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class PrefixUnaryExpressionContext extends ParserRuleContext {
public PostfixUnaryExpressionContext postfixUnaryExpression() {
return getRuleContext(PostfixUnaryExpressionContext.class,0);
}
public List prefixUnaryOperation() {
return getRuleContexts(PrefixUnaryOperationContext.class);
}
public PrefixUnaryOperationContext prefixUnaryOperation(int i) {
return getRuleContext(PrefixUnaryOperationContext.class,i);
}
public PrefixUnaryExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_prefixUnaryExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterPrefixUnaryExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitPrefixUnaryExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitPrefixUnaryExpression(this);
else return visitor.visitChildren(this);
}
}
public final PrefixUnaryExpressionContext prefixUnaryExpression() throws RecognitionException {
PrefixUnaryExpressionContext _localctx = new PrefixUnaryExpressionContext(_ctx, getState());
enterRule(_localctx, 140, RULE_prefixUnaryExpression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1811);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,273,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1808);
prefixUnaryOperation();
}
}
}
setState(1813);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,273,_ctx);
}
setState(1814);
postfixUnaryExpression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class PostfixUnaryExpressionContext extends ParserRuleContext {
public AtomicExpressionContext atomicExpression() {
return getRuleContext(AtomicExpressionContext.class,0);
}
public CallableReferenceContext callableReference() {
return getRuleContext(CallableReferenceContext.class,0);
}
public List postfixUnaryOperation() {
return getRuleContexts(PostfixUnaryOperationContext.class);
}
public PostfixUnaryOperationContext postfixUnaryOperation(int i) {
return getRuleContext(PostfixUnaryOperationContext.class,i);
}
public PostfixUnaryExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_postfixUnaryExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterPostfixUnaryExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitPostfixUnaryExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitPostfixUnaryExpression(this);
else return visitor.visitChildren(this);
}
}
public final PostfixUnaryExpressionContext postfixUnaryExpression() throws RecognitionException {
PostfixUnaryExpressionContext _localctx = new PostfixUnaryExpressionContext(_ctx, getState());
enterRule(_localctx, 142, RULE_postfixUnaryExpression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1818);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,274,_ctx) ) {
case 1:
{
setState(1816);
atomicExpression();
}
break;
case 2:
{
setState(1817);
callableReference();
}
break;
}
setState(1823);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,275,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1820);
postfixUnaryOperation();
}
}
}
setState(1825);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,275,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class AtomicExpressionContext extends ParserRuleContext {
public ParenthesizedExpressionContext parenthesizedExpression() {
return getRuleContext(ParenthesizedExpressionContext.class,0);
}
public LiteralConstantContext literalConstant() {
return getRuleContext(LiteralConstantContext.class,0);
}
public FunctionLiteralContext functionLiteral() {
return getRuleContext(FunctionLiteralContext.class,0);
}
public ThisExpressionContext thisExpression() {
return getRuleContext(ThisExpressionContext.class,0);
}
public SuperExpressionContext superExpression() {
return getRuleContext(SuperExpressionContext.class,0);
}
public ConditionalExpressionContext conditionalExpression() {
return getRuleContext(ConditionalExpressionContext.class,0);
}
public TryExpressionContext tryExpression() {
return getRuleContext(TryExpressionContext.class,0);
}
public ObjectLiteralContext objectLiteral() {
return getRuleContext(ObjectLiteralContext.class,0);
}
public JumpExpressionContext jumpExpression() {
return getRuleContext(JumpExpressionContext.class,0);
}
public LoopExpressionContext loopExpression() {
return getRuleContext(LoopExpressionContext.class,0);
}
public CollectionLiteralContext collectionLiteral() {
return getRuleContext(CollectionLiteralContext.class,0);
}
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public AtomicExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_atomicExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterAtomicExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitAtomicExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitAtomicExpression(this);
else return visitor.visitChildren(this);
}
}
public final AtomicExpressionContext atomicExpression() throws RecognitionException {
AtomicExpressionContext _localctx = new AtomicExpressionContext(_ctx, getState());
enterRule(_localctx, 144, RULE_atomicExpression);
try {
setState(1838);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LPAREN:
enterOuterAlt(_localctx, 1);
{
setState(1826);
parenthesizedExpression();
}
break;
case QUOTE_OPEN:
case TRIPLE_QUOTE_OPEN:
case RealLiteral:
case LongLiteral:
case IntegerLiteral:
case HexLiteral:
case BinLiteral:
case BooleanLiteral:
case NullLiteral:
case CharacterLiteral:
enterOuterAlt(_localctx, 2);
{
setState(1827);
literalConstant();
}
break;
case LCURL:
case AT:
case FILE:
case FIELD:
case PROPERTY:
case GET:
case SET:
case RECEIVER:
case PARAM:
case SETPARAM:
case DELEGATE:
case LabelReference:
enterOuterAlt(_localctx, 3);
{
setState(1828);
functionLiteral();
}
break;
case THIS:
enterOuterAlt(_localctx, 4);
{
setState(1829);
thisExpression();
}
break;
case SUPER:
enterOuterAlt(_localctx, 5);
{
setState(1830);
superExpression();
}
break;
case IF:
case WHEN:
enterOuterAlt(_localctx, 6);
{
setState(1831);
conditionalExpression();
}
break;
case TRY:
enterOuterAlt(_localctx, 7);
{
setState(1832);
tryExpression();
}
break;
case OBJECT:
enterOuterAlt(_localctx, 8);
{
setState(1833);
objectLiteral();
}
break;
case RETURN_AT:
case CONTINUE_AT:
case BREAK_AT:
case THROW:
case RETURN:
case CONTINUE:
case BREAK:
enterOuterAlt(_localctx, 9);
{
setState(1834);
jumpExpression();
}
break;
case FOR:
case DO:
case WHILE:
enterOuterAlt(_localctx, 10);
{
setState(1835);
loopExpression();
}
break;
case LSQUARE:
enterOuterAlt(_localctx, 11);
{
setState(1836);
collectionLiteral();
}
break;
case IMPORT:
case CONSTRUCTOR:
case BY:
case COMPANION:
case INIT:
case WHERE:
case CATCH:
case FINALLY:
case OUT:
case GETTER:
case SETTER:
case DYNAMIC:
case PUBLIC:
case PRIVATE:
case PROTECTED:
case INTERNAL:
case ENUM:
case SEALED:
case ANNOTATION:
case DATA:
case INNER:
case TAILREC:
case OPERATOR:
case INLINE:
case INFIX:
case EXTERNAL:
case SUSPEND:
case OVERRIDE:
case ABSTRACT:
case FINAL:
case OPEN:
case CONST:
case LATEINIT:
case VARARG:
case NOINLINE:
case CROSSINLINE:
case REIFIED:
case Identifier:
enterOuterAlt(_localctx, 12);
{
setState(1837);
simpleIdentifier();
}
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 ParenthesizedExpressionContext extends ParserRuleContext {
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
public ParenthesizedExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_parenthesizedExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterParenthesizedExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitParenthesizedExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitParenthesizedExpression(this);
else return visitor.visitChildren(this);
}
}
public final ParenthesizedExpressionContext parenthesizedExpression() throws RecognitionException {
ParenthesizedExpressionContext _localctx = new ParenthesizedExpressionContext(_ctx, getState());
enterRule(_localctx, 146, RULE_parenthesizedExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(1840);
match(LPAREN);
setState(1841);
expression();
setState(1842);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class CallSuffixContext extends ParserRuleContext {
public TypeArgumentsContext typeArguments() {
return getRuleContext(TypeArgumentsContext.class,0);
}
public ValueArgumentsContext valueArguments() {
return getRuleContext(ValueArgumentsContext.class,0);
}
public List annotatedLambda() {
return getRuleContexts(AnnotatedLambdaContext.class);
}
public AnnotatedLambdaContext annotatedLambda(int i) {
return getRuleContext(AnnotatedLambdaContext.class,i);
}
public CallSuffixContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_callSuffix; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterCallSuffix(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitCallSuffix(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitCallSuffix(this);
else return visitor.visitChildren(this);
}
}
public final CallSuffixContext callSuffix() throws RecognitionException {
CallSuffixContext _localctx = new CallSuffixContext(_ctx, getState());
enterRule(_localctx, 148, RULE_callSuffix);
try {
int _alt;
setState(1866);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LANGLE:
enterOuterAlt(_localctx, 1);
{
setState(1844);
typeArguments();
setState(1846);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,277,_ctx) ) {
case 1:
{
setState(1845);
valueArguments();
}
break;
}
setState(1851);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,278,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1848);
annotatedLambda();
}
}
}
setState(1853);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,278,_ctx);
}
}
break;
case LPAREN:
enterOuterAlt(_localctx, 2);
{
setState(1854);
valueArguments();
setState(1858);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,279,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1855);
annotatedLambda();
}
}
}
setState(1860);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,279,_ctx);
}
}
break;
case NL:
case LCURL:
case AT:
case FILE:
case IMPORT:
case CONSTRUCTOR:
case BY:
case COMPANION:
case INIT:
case WHERE:
case CATCH:
case FINALLY:
case OUT:
case FIELD:
case PROPERTY:
case GET:
case SET:
case GETTER:
case SETTER:
case RECEIVER:
case PARAM:
case SETPARAM:
case DELEGATE:
case DYNAMIC:
case PUBLIC:
case PRIVATE:
case PROTECTED:
case INTERNAL:
case ENUM:
case SEALED:
case ANNOTATION:
case DATA:
case INNER:
case TAILREC:
case OPERATOR:
case INLINE:
case INFIX:
case EXTERNAL:
case SUSPEND:
case OVERRIDE:
case ABSTRACT:
case FINAL:
case OPEN:
case CONST:
case LATEINIT:
case VARARG:
case NOINLINE:
case CROSSINLINE:
case REIFIED:
case Identifier:
case LabelReference:
case LabelDefinition:
enterOuterAlt(_localctx, 3);
{
setState(1862);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(1861);
annotatedLambda();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(1864);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,280,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
}
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 AnnotatedLambdaContext extends ParserRuleContext {
public FunctionLiteralContext functionLiteral() {
return getRuleContext(FunctionLiteralContext.class,0);
}
public List unescapedAnnotation() {
return getRuleContexts(UnescapedAnnotationContext.class);
}
public UnescapedAnnotationContext unescapedAnnotation(int i) {
return getRuleContext(UnescapedAnnotationContext.class,i);
}
public TerminalNode LabelDefinition() { return getToken(KotlinParser.LabelDefinition, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public AnnotatedLambdaContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_annotatedLambda; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterAnnotatedLambda(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitAnnotatedLambda(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitAnnotatedLambda(this);
else return visitor.visitChildren(this);
}
}
public final AnnotatedLambdaContext annotatedLambda() throws RecognitionException {
AnnotatedLambdaContext _localctx = new AnnotatedLambdaContext(_ctx, getState());
enterRule(_localctx, 150, RULE_annotatedLambda);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1871);
_errHandler.sync(this);
_la = _input.LA(1);
while (((((_la - 60)) & ~0x3f) == 0 && ((1L << (_la - 60)) & -33517921595647L) != 0) || ((((_la - 124)) & ~0x3f) == 0 && ((1L << (_la - 124)) & 262271L) != 0)) {
{
{
setState(1868);
unescapedAnnotation();
}
}
setState(1873);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1875);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LabelDefinition) {
{
setState(1874);
match(LabelDefinition);
}
}
setState(1880);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1877);
match(NL);
}
}
setState(1882);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1883);
functionLiteral();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ArrayAccessContext extends ParserRuleContext {
public TerminalNode LSQUARE() { return getToken(KotlinParser.LSQUARE, 0); }
public TerminalNode RSQUARE() { return getToken(KotlinParser.RSQUARE, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public List COMMA() { return getTokens(KotlinParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(KotlinParser.COMMA, i);
}
public ArrayAccessContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_arrayAccess; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterArrayAccess(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitArrayAccess(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitArrayAccess(this);
else return visitor.visitChildren(this);
}
}
public final ArrayAccessContext arrayAccess() throws RecognitionException {
ArrayAccessContext _localctx = new ArrayAccessContext(_ctx, getState());
enterRule(_localctx, 152, RULE_arrayAccess);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1885);
match(LSQUARE);
setState(1894);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1693358682612978752L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -1040196623L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & 393023L) != 0)) {
{
setState(1886);
expression();
setState(1891);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1887);
match(COMMA);
setState(1888);
expression();
}
}
setState(1893);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1896);
match(RSQUARE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ValueArgumentsContext extends ParserRuleContext {
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List valueArgument() {
return getRuleContexts(ValueArgumentContext.class);
}
public ValueArgumentContext valueArgument(int i) {
return getRuleContext(ValueArgumentContext.class,i);
}
public List COMMA() { return getTokens(KotlinParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(KotlinParser.COMMA, i);
}
public ValueArgumentsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_valueArguments; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterValueArguments(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitValueArguments(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitValueArguments(this);
else return visitor.visitChildren(this);
}
}
public final ValueArgumentsContext valueArguments() throws RecognitionException {
ValueArgumentsContext _localctx = new ValueArgumentsContext(_ctx, getState());
enterRule(_localctx, 154, RULE_valueArguments);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1898);
match(LPAREN);
setState(1902);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,287,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1899);
match(NL);
}
}
}
setState(1904);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,287,_ctx);
}
setState(1940);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1693358682613044288L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -1040196623L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & 393023L) != 0)) {
{
setState(1905);
valueArgument();
setState(1922);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,290,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1909);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1906);
match(NL);
}
}
setState(1911);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1912);
match(COMMA);
setState(1916);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,289,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1913);
match(NL);
}
}
}
setState(1918);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,289,_ctx);
}
setState(1919);
valueArgument();
}
}
}
setState(1924);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,290,_ctx);
}
setState(1932);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,292,_ctx) ) {
case 1:
{
setState(1928);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1925);
match(NL);
}
}
setState(1930);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1931);
match(COMMA);
}
break;
}
setState(1937);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1934);
match(NL);
}
}
setState(1939);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1942);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TypeArgumentsContext extends ParserRuleContext {
public TerminalNode LANGLE() { return getToken(KotlinParser.LANGLE, 0); }
public List typeProjection() {
return getRuleContexts(TypeProjectionContext.class);
}
public TypeProjectionContext typeProjection(int i) {
return getRuleContext(TypeProjectionContext.class,i);
}
public TerminalNode RANGLE() { return getToken(KotlinParser.RANGLE, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List COMMA() { return getTokens(KotlinParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(KotlinParser.COMMA, i);
}
public TypeArgumentsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeArguments; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterTypeArguments(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitTypeArguments(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitTypeArguments(this);
else return visitor.visitChildren(this);
}
}
public final TypeArgumentsContext typeArguments() throws RecognitionException {
TypeArgumentsContext _localctx = new TypeArgumentsContext(_ctx, getState());
enterRule(_localctx, 156, RULE_typeArguments);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1944);
match(LANGLE);
setState(1948);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1945);
match(NL);
}
}
setState(1950);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1951);
typeProjection();
setState(1962);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,297,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1955);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1952);
match(NL);
}
}
setState(1957);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1958);
match(COMMA);
setState(1959);
typeProjection();
}
}
}
setState(1964);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,297,_ctx);
}
setState(1968);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1965);
match(NL);
}
}
setState(1970);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1971);
match(RANGLE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TypeProjectionContext extends ParserRuleContext {
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TypeProjectionModifierListContext typeProjectionModifierList() {
return getRuleContext(TypeProjectionModifierListContext.class,0);
}
public TerminalNode MULT() { return getToken(KotlinParser.MULT, 0); }
public TypeProjectionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeProjection; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterTypeProjection(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitTypeProjection(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitTypeProjection(this);
else return visitor.visitChildren(this);
}
}
public final TypeProjectionContext typeProjection() throws RecognitionException {
TypeProjectionContext _localctx = new TypeProjectionContext(_ctx, getState());
enterRule(_localctx, 158, RULE_typeProjection);
try {
setState(1978);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LPAREN:
case AT:
case FILE:
case IMPORT:
case CONSTRUCTOR:
case BY:
case COMPANION:
case INIT:
case WHERE:
case CATCH:
case FINALLY:
case IN:
case OUT:
case FIELD:
case PROPERTY:
case GET:
case SET:
case GETTER:
case SETTER:
case RECEIVER:
case PARAM:
case SETPARAM:
case DELEGATE:
case DYNAMIC:
case PUBLIC:
case PRIVATE:
case PROTECTED:
case INTERNAL:
case ENUM:
case SEALED:
case ANNOTATION:
case DATA:
case INNER:
case TAILREC:
case OPERATOR:
case INLINE:
case INFIX:
case EXTERNAL:
case SUSPEND:
case OVERRIDE:
case ABSTRACT:
case FINAL:
case OPEN:
case CONST:
case LATEINIT:
case VARARG:
case NOINLINE:
case CROSSINLINE:
case REIFIED:
case Identifier:
case LabelReference:
enterOuterAlt(_localctx, 1);
{
setState(1974);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,299,_ctx) ) {
case 1:
{
setState(1973);
typeProjectionModifierList();
}
break;
}
setState(1976);
type();
}
break;
case MULT:
enterOuterAlt(_localctx, 2);
{
setState(1977);
match(MULT);
}
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 TypeProjectionModifierListContext extends ParserRuleContext {
public List varianceAnnotation() {
return getRuleContexts(VarianceAnnotationContext.class);
}
public VarianceAnnotationContext varianceAnnotation(int i) {
return getRuleContext(VarianceAnnotationContext.class,i);
}
public TypeProjectionModifierListContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeProjectionModifierList; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterTypeProjectionModifierList(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitTypeProjectionModifierList(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitTypeProjectionModifierList(this);
else return visitor.visitChildren(this);
}
}
public final TypeProjectionModifierListContext typeProjectionModifierList() throws RecognitionException {
TypeProjectionModifierListContext _localctx = new TypeProjectionModifierListContext(_ctx, getState());
enterRule(_localctx, 160, RULE_typeProjectionModifierList);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1981);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(1980);
varianceAnnotation();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(1983);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,301,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ValueArgumentContext extends ParserRuleContext {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public TerminalNode ASSIGNMENT() { return getToken(KotlinParser.ASSIGNMENT, 0); }
public TerminalNode MULT() { return getToken(KotlinParser.MULT, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public ValueArgumentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_valueArgument; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterValueArgument(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitValueArgument(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitValueArgument(this);
else return visitor.visitChildren(this);
}
}
public final ValueArgumentContext valueArgument() throws RecognitionException {
ValueArgumentContext _localctx = new ValueArgumentContext(_ctx, getState());
enterRule(_localctx, 162, RULE_valueArgument);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1999);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,304,_ctx) ) {
case 1:
{
setState(1985);
simpleIdentifier();
setState(1989);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1986);
match(NL);
}
}
setState(1991);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1992);
match(ASSIGNMENT);
setState(1996);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,303,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1993);
match(NL);
}
}
}
setState(1998);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,303,_ctx);
}
}
break;
}
setState(2002);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==MULT) {
{
setState(2001);
match(MULT);
}
}
setState(2007);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,306,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(2004);
match(NL);
}
}
}
setState(2009);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,306,_ctx);
}
setState(2010);
expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class LiteralConstantContext extends ParserRuleContext {
public TerminalNode BooleanLiteral() { return getToken(KotlinParser.BooleanLiteral, 0); }
public TerminalNode IntegerLiteral() { return getToken(KotlinParser.IntegerLiteral, 0); }
public StringLiteralContext stringLiteral() {
return getRuleContext(StringLiteralContext.class,0);
}
public TerminalNode HexLiteral() { return getToken(KotlinParser.HexLiteral, 0); }
public TerminalNode BinLiteral() { return getToken(KotlinParser.BinLiteral, 0); }
public TerminalNode CharacterLiteral() { return getToken(KotlinParser.CharacterLiteral, 0); }
public TerminalNode RealLiteral() { return getToken(KotlinParser.RealLiteral, 0); }
public TerminalNode NullLiteral() { return getToken(KotlinParser.NullLiteral, 0); }
public TerminalNode LongLiteral() { return getToken(KotlinParser.LongLiteral, 0); }
public LiteralConstantContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_literalConstant; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterLiteralConstant(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitLiteralConstant(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitLiteralConstant(this);
else return visitor.visitChildren(this);
}
}
public final LiteralConstantContext literalConstant() throws RecognitionException {
LiteralConstantContext _localctx = new LiteralConstantContext(_ctx, getState());
enterRule(_localctx, 164, RULE_literalConstant);
try {
setState(2021);
_errHandler.sync(this);
switch (_input.LA(1)) {
case BooleanLiteral:
enterOuterAlt(_localctx, 1);
{
setState(2012);
match(BooleanLiteral);
}
break;
case IntegerLiteral:
enterOuterAlt(_localctx, 2);
{
setState(2013);
match(IntegerLiteral);
}
break;
case QUOTE_OPEN:
case TRIPLE_QUOTE_OPEN:
enterOuterAlt(_localctx, 3);
{
setState(2014);
stringLiteral();
}
break;
case HexLiteral:
enterOuterAlt(_localctx, 4);
{
setState(2015);
match(HexLiteral);
}
break;
case BinLiteral:
enterOuterAlt(_localctx, 5);
{
setState(2016);
match(BinLiteral);
}
break;
case CharacterLiteral:
enterOuterAlt(_localctx, 6);
{
setState(2017);
match(CharacterLiteral);
}
break;
case RealLiteral:
enterOuterAlt(_localctx, 7);
{
setState(2018);
match(RealLiteral);
}
break;
case NullLiteral:
enterOuterAlt(_localctx, 8);
{
setState(2019);
match(NullLiteral);
}
break;
case LongLiteral:
enterOuterAlt(_localctx, 9);
{
setState(2020);
match(LongLiteral);
}
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 StringLiteralContext extends ParserRuleContext {
public LineStringLiteralContext lineStringLiteral() {
return getRuleContext(LineStringLiteralContext.class,0);
}
public MultiLineStringLiteralContext multiLineStringLiteral() {
return getRuleContext(MultiLineStringLiteralContext.class,0);
}
public StringLiteralContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_stringLiteral; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterStringLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitStringLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitStringLiteral(this);
else return visitor.visitChildren(this);
}
}
public final StringLiteralContext stringLiteral() throws RecognitionException {
StringLiteralContext _localctx = new StringLiteralContext(_ctx, getState());
enterRule(_localctx, 166, RULE_stringLiteral);
try {
setState(2025);
_errHandler.sync(this);
switch (_input.LA(1)) {
case QUOTE_OPEN:
enterOuterAlt(_localctx, 1);
{
setState(2023);
lineStringLiteral();
}
break;
case TRIPLE_QUOTE_OPEN:
enterOuterAlt(_localctx, 2);
{
setState(2024);
multiLineStringLiteral();
}
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 LineStringLiteralContext extends ParserRuleContext {
public TerminalNode QUOTE_OPEN() { return getToken(KotlinParser.QUOTE_OPEN, 0); }
public TerminalNode QUOTE_CLOSE() { return getToken(KotlinParser.QUOTE_CLOSE, 0); }
public List lineStringContent() {
return getRuleContexts(LineStringContentContext.class);
}
public LineStringContentContext lineStringContent(int i) {
return getRuleContext(LineStringContentContext.class,i);
}
public List lineStringExpression() {
return getRuleContexts(LineStringExpressionContext.class);
}
public LineStringExpressionContext lineStringExpression(int i) {
return getRuleContext(LineStringExpressionContext.class,i);
}
public LineStringLiteralContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_lineStringLiteral; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterLineStringLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitLineStringLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitLineStringLiteral(this);
else return visitor.visitChildren(this);
}
}
public final LineStringLiteralContext lineStringLiteral() throws RecognitionException {
LineStringLiteralContext _localctx = new LineStringLiteralContext(_ctx, getState());
enterRule(_localctx, 168, RULE_lineStringLiteral);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(2027);
match(QUOTE_OPEN);
setState(2032);
_errHandler.sync(this);
_la = _input.LA(1);
while (((((_la - 158)) & ~0x3f) == 0 && ((1L << (_la - 158)) & 15L) != 0)) {
{
setState(2030);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LineStrRef:
case LineStrText:
case LineStrEscapedChar:
{
setState(2028);
lineStringContent();
}
break;
case LineStrExprStart:
{
setState(2029);
lineStringExpression();
}
break;
default:
throw new NoViableAltException(this);
}
}
setState(2034);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2035);
match(QUOTE_CLOSE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class MultiLineStringLiteralContext extends ParserRuleContext {
public TerminalNode TRIPLE_QUOTE_OPEN() { return getToken(KotlinParser.TRIPLE_QUOTE_OPEN, 0); }
public TerminalNode TRIPLE_QUOTE_CLOSE() { return getToken(KotlinParser.TRIPLE_QUOTE_CLOSE, 0); }
public List multiLineStringContent() {
return getRuleContexts(MultiLineStringContentContext.class);
}
public MultiLineStringContentContext multiLineStringContent(int i) {
return getRuleContext(MultiLineStringContentContext.class,i);
}
public List multiLineStringExpression() {
return getRuleContexts(MultiLineStringExpressionContext.class);
}
public MultiLineStringExpressionContext multiLineStringExpression(int i) {
return getRuleContext(MultiLineStringExpressionContext.class,i);
}
public List lineStringLiteral() {
return getRuleContexts(LineStringLiteralContext.class);
}
public LineStringLiteralContext lineStringLiteral(int i) {
return getRuleContext(LineStringLiteralContext.class,i);
}
public List MultiLineStringQuote() { return getTokens(KotlinParser.MultiLineStringQuote); }
public TerminalNode MultiLineStringQuote(int i) {
return getToken(KotlinParser.MultiLineStringQuote, i);
}
public MultiLineStringLiteralContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_multiLineStringLiteral; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterMultiLineStringLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitMultiLineStringLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitMultiLineStringLiteral(this);
else return visitor.visitChildren(this);
}
}
public final MultiLineStringLiteralContext multiLineStringLiteral() throws RecognitionException {
MultiLineStringLiteralContext _localctx = new MultiLineStringLiteralContext(_ctx, getState());
enterRule(_localctx, 170, RULE_multiLineStringLiteral);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(2037);
match(TRIPLE_QUOTE_OPEN);
setState(2044);
_errHandler.sync(this);
_la = _input.LA(1);
while (((((_la - 131)) & ~0x3f) == 0 && ((1L << (_la - 131)) & 133143986177L) != 0)) {
{
setState(2042);
_errHandler.sync(this);
switch (_input.LA(1)) {
case MultiLineStrRef:
case MultiLineStrText:
case MultiLineStrEscapedChar:
{
setState(2038);
multiLineStringContent();
}
break;
case MultiLineStrExprStart:
{
setState(2039);
multiLineStringExpression();
}
break;
case QUOTE_OPEN:
{
setState(2040);
lineStringLiteral();
}
break;
case MultiLineStringQuote:
{
setState(2041);
match(MultiLineStringQuote);
}
break;
default:
throw new NoViableAltException(this);
}
}
setState(2046);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2047);
match(TRIPLE_QUOTE_CLOSE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class LineStringContentContext extends ParserRuleContext {
public TerminalNode LineStrText() { return getToken(KotlinParser.LineStrText, 0); }
public TerminalNode LineStrEscapedChar() { return getToken(KotlinParser.LineStrEscapedChar, 0); }
public TerminalNode LineStrRef() { return getToken(KotlinParser.LineStrRef, 0); }
public LineStringContentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_lineStringContent; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterLineStringContent(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitLineStringContent(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitLineStringContent(this);
else return visitor.visitChildren(this);
}
}
public final LineStringContentContext lineStringContent() throws RecognitionException {
LineStringContentContext _localctx = new LineStringContentContext(_ctx, getState());
enterRule(_localctx, 172, RULE_lineStringContent);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(2049);
_la = _input.LA(1);
if ( !(((((_la - 158)) & ~0x3f) == 0 && ((1L << (_la - 158)) & 7L) != 0)) ) {
_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 LineStringExpressionContext extends ParserRuleContext {
public TerminalNode LineStrExprStart() { return getToken(KotlinParser.LineStrExprStart, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode RCURL() { return getToken(KotlinParser.RCURL, 0); }
public LineStringExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_lineStringExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterLineStringExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitLineStringExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitLineStringExpression(this);
else return visitor.visitChildren(this);
}
}
public final LineStringExpressionContext lineStringExpression() throws RecognitionException {
LineStringExpressionContext _localctx = new LineStringExpressionContext(_ctx, getState());
enterRule(_localctx, 174, RULE_lineStringExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(2051);
match(LineStrExprStart);
setState(2052);
expression();
setState(2053);
match(RCURL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class MultiLineStringContentContext extends ParserRuleContext {
public TerminalNode MultiLineStrText() { return getToken(KotlinParser.MultiLineStrText, 0); }
public TerminalNode MultiLineStrEscapedChar() { return getToken(KotlinParser.MultiLineStrEscapedChar, 0); }
public TerminalNode MultiLineStrRef() { return getToken(KotlinParser.MultiLineStrRef, 0); }
public MultiLineStringContentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_multiLineStringContent; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterMultiLineStringContent(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitMultiLineStringContent(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitMultiLineStringContent(this);
else return visitor.visitChildren(this);
}
}
public final MultiLineStringContentContext multiLineStringContent() throws RecognitionException {
MultiLineStringContentContext _localctx = new MultiLineStringContentContext(_ctx, getState());
enterRule(_localctx, 176, RULE_multiLineStringContent);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(2055);
_la = _input.LA(1);
if ( !(((((_la - 164)) & ~0x3f) == 0 && ((1L << (_la - 164)) & 7L) != 0)) ) {
_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 MultiLineStringExpressionContext extends ParserRuleContext {
public TerminalNode MultiLineStrExprStart() { return getToken(KotlinParser.MultiLineStrExprStart, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode RCURL() { return getToken(KotlinParser.RCURL, 0); }
public MultiLineStringExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_multiLineStringExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterMultiLineStringExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitMultiLineStringExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitMultiLineStringExpression(this);
else return visitor.visitChildren(this);
}
}
public final MultiLineStringExpressionContext multiLineStringExpression() throws RecognitionException {
MultiLineStringExpressionContext _localctx = new MultiLineStringExpressionContext(_ctx, getState());
enterRule(_localctx, 178, RULE_multiLineStringExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(2057);
match(MultiLineStrExprStart);
setState(2058);
expression();
setState(2059);
match(RCURL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class FunctionLiteralContext extends ParserRuleContext {
public TerminalNode LCURL() { return getToken(KotlinParser.LCURL, 0); }
public StatementsContext statements() {
return getRuleContext(StatementsContext.class,0);
}
public TerminalNode RCURL() { return getToken(KotlinParser.RCURL, 0); }
public LambdaParametersContext lambdaParameters() {
return getRuleContext(LambdaParametersContext.class,0);
}
public TerminalNode ARROW() { return getToken(KotlinParser.ARROW, 0); }
public List annotations() {
return getRuleContexts(AnnotationsContext.class);
}
public AnnotationsContext annotations(int i) {
return getRuleContext(AnnotationsContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public FunctionLiteralContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_functionLiteral; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterFunctionLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitFunctionLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitFunctionLiteral(this);
else return visitor.visitChildren(this);
}
}
public final FunctionLiteralContext functionLiteral() throws RecognitionException {
FunctionLiteralContext _localctx = new FunctionLiteralContext(_ctx, getState());
enterRule(_localctx, 180, RULE_functionLiteral);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(2064);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AT || _la==FILE || ((((_la - 95)) & ~0x3f) == 0 && ((1L << (_la - 95)) & 281474976711631L) != 0)) {
{
{
setState(2061);
annotations();
}
}
setState(2066);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2113);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,320,_ctx) ) {
case 1:
{
setState(2067);
match(LCURL);
setState(2071);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,314,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(2068);
match(NL);
}
}
}
setState(2073);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,314,_ctx);
}
setState(2074);
statements();
setState(2078);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2075);
match(NL);
}
}
setState(2080);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2081);
match(RCURL);
}
break;
case 2:
{
setState(2083);
match(LCURL);
setState(2087);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,316,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(2084);
match(NL);
}
}
}
setState(2089);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,316,_ctx);
}
setState(2090);
lambdaParameters();
setState(2094);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2091);
match(NL);
}
}
setState(2096);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2097);
match(ARROW);
setState(2101);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,318,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(2098);
match(NL);
}
}
}
setState(2103);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,318,_ctx);
}
setState(2104);
statements();
setState(2108);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2105);
match(NL);
}
}
setState(2110);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2111);
match(RCURL);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class LambdaParametersContext extends ParserRuleContext {
public List lambdaParameter() {
return getRuleContexts(LambdaParameterContext.class);
}
public LambdaParameterContext lambdaParameter(int i) {
return getRuleContext(LambdaParameterContext.class,i);
}
public List COMMA() { return getTokens(KotlinParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(KotlinParser.COMMA, i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public LambdaParametersContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_lambdaParameters; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterLambdaParameters(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitLambdaParameters(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitLambdaParameters(this);
else return visitor.visitChildren(this);
}
}
public final LambdaParametersContext lambdaParameters() throws RecognitionException {
LambdaParametersContext _localctx = new LambdaParametersContext(_ctx, getState());
enterRule(_localctx, 182, RULE_lambdaParameters);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(2116);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LPAREN || _la==IMPORT || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & 9223371905925394575L) != 0) || _la==Identifier) {
{
setState(2115);
lambdaParameter();
}
}
setState(2134);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,324,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(2121);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2118);
match(NL);
}
}
setState(2123);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2124);
match(COMMA);
setState(2128);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2125);
match(NL);
}
}
setState(2130);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2131);
lambdaParameter();
}
}
}
setState(2136);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,324,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class LambdaParameterContext extends ParserRuleContext {
public VariableDeclarationContext variableDeclaration() {
return getRuleContext(VariableDeclarationContext.class,0);
}
public MultiVariableDeclarationContext multiVariableDeclaration() {
return getRuleContext(MultiVariableDeclarationContext.class,0);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public LambdaParameterContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_lambdaParameter; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterLambdaParameter(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitLambdaParameter(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitLambdaParameter(this);
else return visitor.visitChildren(this);
}
}
public final LambdaParameterContext lambdaParameter() throws RecognitionException {
LambdaParameterContext _localctx = new LambdaParameterContext(_ctx, getState());
enterRule(_localctx, 184, RULE_lambdaParameter);
int _la;
try {
setState(2155);
_errHandler.sync(this);
switch (_input.LA(1)) {
case IMPORT:
case CONSTRUCTOR:
case BY:
case COMPANION:
case INIT:
case WHERE:
case CATCH:
case FINALLY:
case OUT:
case GETTER:
case SETTER:
case DYNAMIC:
case PUBLIC:
case PRIVATE:
case PROTECTED:
case INTERNAL:
case ENUM:
case SEALED:
case ANNOTATION:
case DATA:
case INNER:
case TAILREC:
case OPERATOR:
case INLINE:
case INFIX:
case EXTERNAL:
case SUSPEND:
case OVERRIDE:
case ABSTRACT:
case FINAL:
case OPEN:
case CONST:
case LATEINIT:
case VARARG:
case NOINLINE:
case CROSSINLINE:
case REIFIED:
case Identifier:
enterOuterAlt(_localctx, 1);
{
setState(2137);
variableDeclaration();
}
break;
case LPAREN:
enterOuterAlt(_localctx, 2);
{
setState(2138);
multiVariableDeclaration();
setState(2153);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,327,_ctx) ) {
case 1:
{
setState(2142);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2139);
match(NL);
}
}
setState(2144);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2145);
match(COLON);
setState(2149);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2146);
match(NL);
}
}
setState(2151);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2152);
type();
}
break;
}
}
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 ObjectLiteralContext extends ParserRuleContext {
public TerminalNode OBJECT() { return getToken(KotlinParser.OBJECT, 0); }
public ClassBodyContext classBody() {
return getRuleContext(ClassBodyContext.class,0);
}
public TerminalNode COLON() { return getToken(KotlinParser.COLON, 0); }
public DelegationSpecifiersContext delegationSpecifiers() {
return getRuleContext(DelegationSpecifiersContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public ObjectLiteralContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_objectLiteral; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterObjectLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitObjectLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitObjectLiteral(this);
else return visitor.visitChildren(this);
}
}
public final ObjectLiteralContext objectLiteral() throws RecognitionException {
ObjectLiteralContext _localctx = new ObjectLiteralContext(_ctx, getState());
enterRule(_localctx, 186, RULE_objectLiteral);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(2157);
match(OBJECT);
setState(2172);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,331,_ctx) ) {
case 1:
{
setState(2161);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2158);
match(NL);
}
}
setState(2163);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2164);
match(COLON);
setState(2168);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2165);
match(NL);
}
}
setState(2170);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2171);
delegationSpecifiers();
}
break;
}
setState(2177);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2174);
match(NL);
}
}
setState(2179);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2180);
classBody();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class CollectionLiteralContext extends ParserRuleContext {
public TerminalNode LSQUARE() { return getToken(KotlinParser.LSQUARE, 0); }
public TerminalNode RSQUARE() { return getToken(KotlinParser.RSQUARE, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public List COMMA() { return getTokens(KotlinParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(KotlinParser.COMMA, i);
}
public CollectionLiteralContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_collectionLiteral; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterCollectionLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitCollectionLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitCollectionLiteral(this);
else return visitor.visitChildren(this);
}
}
public final CollectionLiteralContext collectionLiteral() throws RecognitionException {
CollectionLiteralContext _localctx = new CollectionLiteralContext(_ctx, getState());
enterRule(_localctx, 188, RULE_collectionLiteral);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(2182);
match(LSQUARE);
setState(2184);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1693358682612978752L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -1040196623L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & 393023L) != 0)) {
{
setState(2183);
expression();
}
}
setState(2190);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(2186);
match(COMMA);
setState(2187);
expression();
}
}
setState(2192);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2193);
match(RSQUARE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ThisExpressionContext extends ParserRuleContext {
public TerminalNode THIS() { return getToken(KotlinParser.THIS, 0); }
public TerminalNode LabelReference() { return getToken(KotlinParser.LabelReference, 0); }
public ThisExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_thisExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterThisExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitThisExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitThisExpression(this);
else return visitor.visitChildren(this);
}
}
public final ThisExpressionContext thisExpression() throws RecognitionException {
ThisExpressionContext _localctx = new ThisExpressionContext(_ctx, getState());
enterRule(_localctx, 190, RULE_thisExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(2195);
match(THIS);
setState(2197);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,335,_ctx) ) {
case 1:
{
setState(2196);
match(LabelReference);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class SuperExpressionContext extends ParserRuleContext {
public TerminalNode SUPER() { return getToken(KotlinParser.SUPER, 0); }
public TerminalNode LANGLE() { return getToken(KotlinParser.LANGLE, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TerminalNode RANGLE() { return getToken(KotlinParser.RANGLE, 0); }
public TerminalNode LabelReference() { return getToken(KotlinParser.LabelReference, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public SuperExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_superExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterSuperExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitSuperExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitSuperExpression(this);
else return visitor.visitChildren(this);
}
}
public final SuperExpressionContext superExpression() throws RecognitionException {
SuperExpressionContext _localctx = new SuperExpressionContext(_ctx, getState());
enterRule(_localctx, 192, RULE_superExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(2199);
match(SUPER);
setState(2216);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,338,_ctx) ) {
case 1:
{
setState(2200);
match(LANGLE);
setState(2204);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2201);
match(NL);
}
}
setState(2206);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2207);
type();
setState(2211);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2208);
match(NL);
}
}
setState(2213);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2214);
match(RANGLE);
}
break;
}
setState(2219);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,339,_ctx) ) {
case 1:
{
setState(2218);
match(LabelReference);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ConditionalExpressionContext extends ParserRuleContext {
public IfExpressionContext ifExpression() {
return getRuleContext(IfExpressionContext.class,0);
}
public WhenExpressionContext whenExpression() {
return getRuleContext(WhenExpressionContext.class,0);
}
public ConditionalExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_conditionalExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterConditionalExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitConditionalExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitConditionalExpression(this);
else return visitor.visitChildren(this);
}
}
public final ConditionalExpressionContext conditionalExpression() throws RecognitionException {
ConditionalExpressionContext _localctx = new ConditionalExpressionContext(_ctx, getState());
enterRule(_localctx, 194, RULE_conditionalExpression);
try {
setState(2223);
_errHandler.sync(this);
switch (_input.LA(1)) {
case IF:
enterOuterAlt(_localctx, 1);
{
setState(2221);
ifExpression();
}
break;
case WHEN:
enterOuterAlt(_localctx, 2);
{
setState(2222);
whenExpression();
}
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 IfExpressionContext extends ParserRuleContext {
public TerminalNode IF() { return getToken(KotlinParser.IF, 0); }
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public List controlStructureBody() {
return getRuleContexts(ControlStructureBodyContext.class);
}
public ControlStructureBodyContext controlStructureBody(int i) {
return getRuleContext(ControlStructureBodyContext.class,i);
}
public TerminalNode SEMICOLON() { return getToken(KotlinParser.SEMICOLON, 0); }
public TerminalNode ELSE() { return getToken(KotlinParser.ELSE, 0); }
public IfExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_ifExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterIfExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitIfExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitIfExpression(this);
else return visitor.visitChildren(this);
}
}
public final IfExpressionContext ifExpression() throws RecognitionException {
IfExpressionContext _localctx = new IfExpressionContext(_ctx, getState());
enterRule(_localctx, 196, RULE_ifExpression);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(2225);
match(IF);
setState(2229);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2226);
match(NL);
}
}
setState(2231);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2232);
match(LPAREN);
setState(2233);
expression();
setState(2234);
match(RPAREN);
setState(2238);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,342,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(2235);
match(NL);
}
}
}
setState(2240);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,342,_ctx);
}
setState(2242);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,343,_ctx) ) {
case 1:
{
setState(2241);
controlStructureBody();
}
break;
}
setState(2245);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,344,_ctx) ) {
case 1:
{
setState(2244);
match(SEMICOLON);
}
break;
}
setState(2263);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,348,_ctx) ) {
case 1:
{
setState(2250);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2247);
match(NL);
}
}
setState(2252);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2253);
match(ELSE);
setState(2257);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,346,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(2254);
match(NL);
}
}
}
setState(2259);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,346,_ctx);
}
setState(2261);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,347,_ctx) ) {
case 1:
{
setState(2260);
controlStructureBody();
}
break;
}
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ControlStructureBodyContext extends ParserRuleContext {
public BlockContext block() {
return getRuleContext(BlockContext.class,0);
}
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public ControlStructureBodyContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_controlStructureBody; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterControlStructureBody(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitControlStructureBody(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitControlStructureBody(this);
else return visitor.visitChildren(this);
}
}
public final ControlStructureBodyContext controlStructureBody() throws RecognitionException {
ControlStructureBodyContext _localctx = new ControlStructureBodyContext(_ctx, getState());
enterRule(_localctx, 198, RULE_controlStructureBody);
try {
setState(2267);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,349,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(2265);
block();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(2266);
expression();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class WhenExpressionContext extends ParserRuleContext {
public TerminalNode WHEN() { return getToken(KotlinParser.WHEN, 0); }
public TerminalNode LCURL() { return getToken(KotlinParser.LCURL, 0); }
public TerminalNode RCURL() { return getToken(KotlinParser.RCURL, 0); }
public List