Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
rahbuisson.kotlin-parser.1.5.source-code.KotlinParser Maven / Gradle / Ivy
// Generated from KotlinParser.g4 by ANTLR 4.7
package com.github.sarahbuisson.kotlinparser;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.misc.*;
import org.antlr.v4.runtime.tree.*;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class KotlinParser extends Parser {
static { RuntimeMetaData.checkVersion("4.7", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
ShebangLine=1, DelimitedComment=2, LineComment=3, WS=4, NL=5, RESERVED=6,
DOT=7, COMMA=8, LPAREN=9, RPAREN=10, LSQUARE=11, RSQUARE=12, LCURL=13,
RCURL=14, MULT=15, MOD=16, DIV=17, ADD=18, SUB=19, INCR=20, DECR=21, CONJ=22,
DISJ=23, EXCL=24, COLON=25, SEMICOLON=26, ASSIGNMENT=27, ADD_ASSIGNMENT=28,
SUB_ASSIGNMENT=29, MULT_ASSIGNMENT=30, DIV_ASSIGNMENT=31, MOD_ASSIGNMENT=32,
ARROW=33, DOUBLE_ARROW=34, RANGE=35, COLONCOLON=36, Q_COLONCOLON=37, DOUBLE_SEMICOLON=38,
HASH=39, AT=40, QUEST=41, ELVIS=42, LANGLE=43, RANGLE=44, LE=45, GE=46,
EXCL_EQ=47, EXCL_EQEQ=48, AS_SAFE=49, EQEQ=50, EQEQEQ=51, SINGLE_QUOTE=52,
RETURN_AT=53, CONTINUE_AT=54, BREAK_AT=55, FILE=56, PACKAGE=57, IMPORT=58,
CLASS=59, INTERFACE=60, FUN=61, OBJECT=62, VAL=63, VAR=64, TYPE_ALIAS=65,
CONSTRUCTOR=66, BY=67, COMPANION=68, INIT=69, THIS=70, SUPER=71, TYPEOF=72,
WHERE=73, IF=74, ELSE=75, WHEN=76, TRY=77, CATCH=78, FINALLY=79, FOR=80,
DO=81, WHILE=82, THROW=83, RETURN=84, CONTINUE=85, BREAK=86, AS=87, IS=88,
IN=89, NOT_IS=90, NOT_IN=91, OUT=92, FIELD=93, PROPERTY=94, GET=95, SET=96,
GETTER=97, SETTER=98, RECEIVER=99, PARAM=100, SETPARAM=101, DELEGATE=102,
DYNAMIC=103, PUBLIC=104, PRIVATE=105, PROTECTED=106, INTERNAL=107, ENUM=108,
SEALED=109, ANNOTATION=110, DATA=111, INNER=112, TAILREC=113, OPERATOR=114,
INLINE=115, INFIX=116, EXTERNAL=117, SUSPEND=118, OVERRIDE=119, ABSTRACT=120,
FINAL=121, OPEN=122, CONST=123, LATEINIT=124, VARARG=125, NOINLINE=126,
CROSSINLINE=127, REIFIED=128, QUOTE_OPEN=129, TRIPLE_QUOTE_OPEN=130, RealLiteral=131,
FloatLiteral=132, DoubleLiteral=133, LongLiteral=134, IntegerLiteral=135,
HexLiteral=136, BinLiteral=137, BooleanLiteral=138, NullLiteral=139, Identifier=140,
LabelReference=141, LabelDefinition=142, FieldIdentifier=143, CharacterLiteral=144,
UNICODE_CLASS_LL=145, UNICODE_CLASS_LM=146, UNICODE_CLASS_LO=147, UNICODE_CLASS_LT=148,
UNICODE_CLASS_LU=149, UNICODE_CLASS_ND=150, UNICODE_CLASS_NL=151, Inside_Comment=152,
Inside_WS=153, Inside_NL=154, QUOTE_CLOSE=155, LineStrRef=156, LineStrText=157,
LineStrEscapedChar=158, LineStrExprStart=159, TRIPLE_QUOTE_CLOSE=160,
MultiLineStringQuote=161, MultiLineStrRef=162, MultiLineStrText=163, MultiLineStrEscapedChar=164,
MultiLineStrExprStart=165, MultiLineNL=166, StrExpr_IN=167, StrExpr_Comment=168,
StrExpr_WS=169, StrExpr_NL=170;
public static final int
RULE_kotlinFile = 0, RULE_script = 1, RULE_fileAnnotation = 2, RULE_packageHeader = 3,
RULE_importList = 4, RULE_importHeader = 5, RULE_importAlias = 6, RULE_topLevelObject = 7,
RULE_classDeclaration = 8, RULE_primaryConstructor = 9, RULE_classParameters = 10,
RULE_classParameter = 11, RULE_delegationSpecifiers = 12, RULE_delegationSpecifier = 13,
RULE_constructorInvocation = 14, RULE_explicitDelegation = 15, RULE_classBody = 16,
RULE_classMemberDeclaration = 17, RULE_anonymousInitializer = 18, RULE_secondaryConstructor = 19,
RULE_constructorDelegationCall = 20, RULE_enumClassBody = 21, RULE_enumEntries = 22,
RULE_enumEntry = 23, RULE_functionDeclaration = 24, RULE_functionValueParameters = 25,
RULE_functionValueParameter = 26, RULE_parameter = 27, RULE_functionBody = 28,
RULE_objectDeclaration = 29, RULE_companionObject = 30, RULE_propertyDeclaration = 31,
RULE_multiVariableDeclaration = 32, RULE_variableDeclaration = 33, RULE_getter = 34,
RULE_setter = 35, RULE_typeAlias = 36, RULE_typeParameters = 37, RULE_typeParameter = 38,
RULE_type = 39, RULE_typeModifierList = 40, RULE_parenthesizedType = 41,
RULE_nullableType = 42, RULE_typeReference = 43, RULE_functionType = 44,
RULE_functionTypeReceiver = 45, RULE_userType = 46, RULE_simpleUserType = 47,
RULE_functionTypeParameters = 48, RULE_typeConstraints = 49, RULE_typeConstraint = 50,
RULE_block = 51, RULE_statements = 52, RULE_statement = 53, RULE_declaration = 54,
RULE_assignment = 55, RULE_expression = 56, RULE_disjunction = 57, RULE_conjunction = 58,
RULE_equality = 59, RULE_comparison = 60, RULE_infixOperation = 61, RULE_elvisExpression = 62,
RULE_infixFunctionCall = 63, RULE_rangeExpression = 64, RULE_additiveExpression = 65,
RULE_multiplicativeExpression = 66, RULE_asExpression = 67, RULE_asExpressionTail = 68,
RULE_prefixUnaryExpression = 69, RULE_postfixUnaryExpression = 70, RULE_callExpression = 71,
RULE_labeledExpression = 72, RULE_dotQualifiedExpression = 73, RULE_assignableExpression = 74,
RULE_indexingExpression = 75, RULE_callSuffix = 76, RULE_annotatedLambda = 77,
RULE_arrayAccess = 78, RULE_valueArguments = 79, RULE_typeArguments = 80,
RULE_typeProjection = 81, RULE_typeProjectionModifierList = 82, RULE_valueArgument = 83,
RULE_primaryExpression = 84, RULE_parenthesizedExpression = 85, RULE_literalConstant = 86,
RULE_stringLiteral = 87, RULE_lineStringLiteral = 88, RULE_multiLineStringLiteral = 89,
RULE_lineStringContent = 90, RULE_lineStringExpression = 91, RULE_multiLineStringContent = 92,
RULE_multiLineStringExpression = 93, RULE_functionLiteral = 94, RULE_lambdaParameters = 95,
RULE_lambdaParameter = 96, RULE_objectLiteral = 97, RULE_collectionLiteral = 98,
RULE_thisExpression = 99, RULE_superExpression = 100, RULE_conditionalExpression = 101,
RULE_ifExpression = 102, RULE_controlStructureBody = 103, RULE_whenExpression = 104,
RULE_whenEntry = 105, RULE_whenCondition = 106, RULE_rangeTest = 107,
RULE_typeTest = 108, RULE_tryExpression = 109, RULE_catchBlock = 110,
RULE_finallyBlock = 111, RULE_loopExpression = 112, RULE_forExpression = 113,
RULE_whileExpression = 114, RULE_doWhileExpression = 115, RULE_jumpExpression = 116,
RULE_callableReference = 117, RULE_assignmentOperator = 118, RULE_equalityOperator = 119,
RULE_comparisonOperator = 120, RULE_inOperator = 121, RULE_isOperator = 122,
RULE_additiveOperator = 123, RULE_multiplicativeOperator = 124, RULE_asOperator = 125,
RULE_prefixUnaryOperator = 126, RULE_postfixUnaryOperator = 127, RULE_memberAccessOperator = 128,
RULE_modifierList = 129, RULE_modifier = 130, RULE_classModifier = 131,
RULE_memberModifier = 132, RULE_visibilityModifier = 133, RULE_varianceAnnotation = 134,
RULE_functionModifier = 135, RULE_propertyModifier = 136, RULE_inheritanceModifier = 137,
RULE_parameterModifier = 138, RULE_typeParameterModifier = 139, RULE_labelDefinition = 140,
RULE_annotations = 141, RULE_annotation = 142, RULE_annotationList = 143,
RULE_annotationUseSiteTarget = 144, RULE_unescapedAnnotation = 145, RULE_identifier = 146,
RULE_simpleIdentifier = 147, RULE_semi = 148;
public static final String[] ruleNames = {
"kotlinFile", "script", "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", "declaration", "assignment", "expression",
"disjunction", "conjunction", "equality", "comparison", "infixOperation",
"elvisExpression", "infixFunctionCall", "rangeExpression", "additiveExpression",
"multiplicativeExpression", "asExpression", "asExpressionTail", "prefixUnaryExpression",
"postfixUnaryExpression", "callExpression", "labeledExpression", "dotQualifiedExpression",
"assignableExpression", "indexingExpression", "callSuffix", "annotatedLambda",
"arrayAccess", "valueArguments", "typeArguments", "typeProjection", "typeProjectionModifierList",
"valueArgument", "primaryExpression", "parenthesizedExpression", "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",
"equalityOperator", "comparisonOperator", "inOperator", "isOperator",
"additiveOperator", "multiplicativeOperator", "asOperator", "prefixUnaryOperator",
"postfixUnaryOperator", "memberAccessOperator", "modifierList", "modifier",
"classModifier", "memberModifier", "visibilityModifier", "varianceAnnotation",
"functionModifier", "propertyModifier", "inheritanceModifier", "parameterModifier",
"typeParameterModifier", "labelDefinition", "annotations", "annotation",
"annotationList", "annotationUseSiteTarget", "unescapedAnnotation", "identifier",
"simpleIdentifier", "semi"
};
private static final String[] _LITERAL_NAMES = {
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[] _SYMBOLIC_NAMES = {
null, "ShebangLine", "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", "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"
};
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);
}
public static class KotlinFileContext extends ParserRuleContext {
public PackageHeaderContext packageHeader() {
return getRuleContext(PackageHeaderContext.class,0);
}
public ImportListContext importList() {
return getRuleContext(ImportListContext.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 FileAnnotationContext fileAnnotation() {
return getRuleContext(FileAnnotationContext.class,0);
}
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 {
enterOuterAlt(_localctx, 1);
{
setState(301);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(298);
match(NL);
}
}
setState(303);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(305);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) {
case 1:
{
setState(304);
fileAnnotation();
}
break;
}
setState(307);
packageHeader();
setState(308);
importList();
setState(312);
_errHandler.sync(this);
_la = _input.LA(1);
while (((((_la - 40)) & ~0x3f) == 0 && ((1L << (_la - 40)) & ((1L << (AT - 40)) | (1L << (FILE - 40)) | (1L << (CLASS - 40)) | (1L << (INTERFACE - 40)) | (1L << (FUN - 40)) | (1L << (OBJECT - 40)) | (1L << (VAL - 40)) | (1L << (VAR - 40)) | (1L << (TYPE_ALIAS - 40)) | (1L << (IN - 40)) | (1L << (OUT - 40)) | (1L << (FIELD - 40)) | (1L << (PROPERTY - 40)) | (1L << (GET - 40)) | (1L << (SET - 40)) | (1L << (RECEIVER - 40)) | (1L << (PARAM - 40)) | (1L << (SETPARAM - 40)) | (1L << (DELEGATE - 40)))) != 0) || ((((_la - 104)) & ~0x3f) == 0 && ((1L << (_la - 104)) & ((1L << (PUBLIC - 104)) | (1L << (PRIVATE - 104)) | (1L << (PROTECTED - 104)) | (1L << (INTERNAL - 104)) | (1L << (ENUM - 104)) | (1L << (SEALED - 104)) | (1L << (ANNOTATION - 104)) | (1L << (DATA - 104)) | (1L << (INNER - 104)) | (1L << (TAILREC - 104)) | (1L << (OPERATOR - 104)) | (1L << (INLINE - 104)) | (1L << (INFIX - 104)) | (1L << (EXTERNAL - 104)) | (1L << (SUSPEND - 104)) | (1L << (OVERRIDE - 104)) | (1L << (ABSTRACT - 104)) | (1L << (FINAL - 104)) | (1L << (OPEN - 104)) | (1L << (CONST - 104)) | (1L << (LATEINIT - 104)) | (1L << (VARARG - 104)) | (1L << (NOINLINE - 104)) | (1L << (CROSSINLINE - 104)) | (1L << (REIFIED - 104)) | (1L << (LabelReference - 104)))) != 0)) {
{
{
setState(309);
topLevelObject();
}
}
setState(314);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(315);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ScriptContext extends ParserRuleContext {
public PackageHeaderContext packageHeader() {
return getRuleContext(PackageHeaderContext.class,0);
}
public ImportListContext importList() {
return getRuleContext(ImportListContext.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 FileAnnotationContext fileAnnotation() {
return getRuleContext(FileAnnotationContext.class,0);
}
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public List semi() {
return getRuleContexts(SemiContext.class);
}
public SemiContext semi(int i) {
return getRuleContext(SemiContext.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(320);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,3,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(317);
match(NL);
}
}
}
setState(322);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,3,_ctx);
}
setState(324);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
case 1:
{
setState(323);
fileAnnotation();
}
break;
}
setState(326);
packageHeader();
setState(327);
importList();
setState(334);
_errHandler.sync(this);
_la = _input.LA(1);
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NL) | (1L << LPAREN) | (1L << LSQUARE) | (1L << LCURL) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << EXCL) | (1L << COLONCOLON) | (1L << Q_COLONCOLON) | (1L << AT) | (1L << RETURN_AT) | (1L << CONTINUE_AT) | (1L << BREAK_AT) | (1L << FILE) | (1L << IMPORT) | (1L << OBJECT))) != 0) || ((((_la - 66)) & ~0x3f) == 0 && ((1L << (_la - 66)) & ((1L << (CONSTRUCTOR - 66)) | (1L << (BY - 66)) | (1L << (COMPANION - 66)) | (1L << (INIT - 66)) | (1L << (THIS - 66)) | (1L << (SUPER - 66)) | (1L << (WHERE - 66)) | (1L << (IF - 66)) | (1L << (WHEN - 66)) | (1L << (TRY - 66)) | (1L << (CATCH - 66)) | (1L << (FINALLY - 66)) | (1L << (FOR - 66)) | (1L << (DO - 66)) | (1L << (WHILE - 66)) | (1L << (THROW - 66)) | (1L << (RETURN - 66)) | (1L << (CONTINUE - 66)) | (1L << (BREAK - 66)) | (1L << (OUT - 66)) | (1L << (FIELD - 66)) | (1L << (PROPERTY - 66)) | (1L << (GET - 66)) | (1L << (SET - 66)) | (1L << (GETTER - 66)) | (1L << (SETTER - 66)) | (1L << (RECEIVER - 66)) | (1L << (PARAM - 66)) | (1L << (SETPARAM - 66)) | (1L << (DELEGATE - 66)) | (1L << (DYNAMIC - 66)) | (1L << (PUBLIC - 66)) | (1L << (PRIVATE - 66)) | (1L << (PROTECTED - 66)) | (1L << (INTERNAL - 66)) | (1L << (ENUM - 66)) | (1L << (SEALED - 66)) | (1L << (ANNOTATION - 66)) | (1L << (DATA - 66)) | (1L << (INNER - 66)) | (1L << (TAILREC - 66)) | (1L << (OPERATOR - 66)) | (1L << (INLINE - 66)) | (1L << (INFIX - 66)) | (1L << (EXTERNAL - 66)) | (1L << (SUSPEND - 66)) | (1L << (OVERRIDE - 66)) | (1L << (ABSTRACT - 66)) | (1L << (FINAL - 66)) | (1L << (OPEN - 66)) | (1L << (CONST - 66)) | (1L << (LATEINIT - 66)) | (1L << (VARARG - 66)) | (1L << (NOINLINE - 66)) | (1L << (CROSSINLINE - 66)) | (1L << (REIFIED - 66)) | (1L << (QUOTE_OPEN - 66)))) != 0) || ((((_la - 130)) & ~0x3f) == 0 && ((1L << (_la - 130)) & ((1L << (TRIPLE_QUOTE_OPEN - 130)) | (1L << (RealLiteral - 130)) | (1L << (LongLiteral - 130)) | (1L << (IntegerLiteral - 130)) | (1L << (HexLiteral - 130)) | (1L << (BinLiteral - 130)) | (1L << (BooleanLiteral - 130)) | (1L << (NullLiteral - 130)) | (1L << (Identifier - 130)) | (1L << (LabelReference - 130)) | (1L << (LabelDefinition - 130)) | (1L << (CharacterLiteral - 130)))) != 0)) {
{
{
setState(328);
expression();
setState(330);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) {
case 1:
{
setState(329);
semi();
}
break;
}
}
}
setState(336);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(337);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 4, RULE_fileAnnotation);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(355);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(339);
match(FILE);
setState(340);
match(COLON);
setState(350);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LSQUARE:
{
setState(341);
match(LSQUARE);
setState(343);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(342);
unescapedAnnotation();
}
}
setState(345);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( ((((_la - 58)) & ~0x3f) == 0 && ((1L << (_la - 58)) & ((1L << (IMPORT - 58)) | (1L << (CONSTRUCTOR - 58)) | (1L << (BY - 58)) | (1L << (COMPANION - 58)) | (1L << (INIT - 58)) | (1L << (WHERE - 58)) | (1L << (CATCH - 58)) | (1L << (FINALLY - 58)) | (1L << (OUT - 58)) | (1L << (GETTER - 58)) | (1L << (SETTER - 58)) | (1L << (DYNAMIC - 58)) | (1L << (PUBLIC - 58)) | (1L << (PRIVATE - 58)) | (1L << (PROTECTED - 58)) | (1L << (INTERNAL - 58)) | (1L << (ENUM - 58)) | (1L << (SEALED - 58)) | (1L << (ANNOTATION - 58)) | (1L << (DATA - 58)) | (1L << (INNER - 58)) | (1L << (TAILREC - 58)) | (1L << (OPERATOR - 58)) | (1L << (INLINE - 58)) | (1L << (INFIX - 58)) | (1L << (EXTERNAL - 58)) | (1L << (SUSPEND - 58)) | (1L << (OVERRIDE - 58)) | (1L << (ABSTRACT - 58)) | (1L << (FINAL - 58)))) != 0) || ((((_la - 122)) & ~0x3f) == 0 && ((1L << (_la - 122)) & ((1L << (OPEN - 122)) | (1L << (CONST - 122)) | (1L << (LATEINIT - 122)) | (1L << (VARARG - 122)) | (1L << (NOINLINE - 122)) | (1L << (CROSSINLINE - 122)) | (1L << (REIFIED - 122)) | (1L << (Identifier - 122)))) != 0) );
setState(347);
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(349);
unescapedAnnotation();
}
break;
default:
throw new NoViableAltException(this);
}
setState(353);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,9,_ctx) ) {
case 1:
{
setState(352);
semi();
}
break;
}
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(357);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,10,_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;
}
public static class PackageHeaderContext extends ParserRuleContext {
public TerminalNode PACKAGE() { return getToken(KotlinParser.PACKAGE, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.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, 6, RULE_packageHeader);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(364);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PACKAGE) {
{
setState(359);
match(PACKAGE);
setState(360);
identifier();
setState(362);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) {
case 1:
{
setState(361);
semi();
}
break;
}
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 8, RULE_importList);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(369);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,13,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(366);
importHeader();
}
}
}
setState(371);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,13,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 10, RULE_importHeader);
try {
enterOuterAlt(_localctx, 1);
{
setState(372);
match(IMPORT);
setState(373);
identifier();
setState(377);
_errHandler.sync(this);
switch (_input.LA(1)) {
case DOT:
{
setState(374);
match(DOT);
setState(375);
match(MULT);
}
break;
case AS:
{
setState(376);
importAlias();
}
break;
case EOF:
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(380);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) {
case 1:
{
setState(379);
semi();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 12, RULE_importAlias);
try {
enterOuterAlt(_localctx, 1);
{
setState(382);
match(AS);
setState(383);
simpleIdentifier();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TopLevelObjectContext 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 PropertyDeclarationContext propertyDeclaration() {
return getRuleContext(PropertyDeclarationContext.class,0);
}
public TypeAliasContext typeAlias() {
return getRuleContext(TypeAliasContext.class,0);
}
public SemiContext semi() {
return getRuleContext(SemiContext.class,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, 14, RULE_topLevelObject);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(390);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) {
case 1:
{
setState(385);
classDeclaration();
}
break;
case 2:
{
setState(386);
functionDeclaration();
}
break;
case 3:
{
setState(387);
objectDeclaration();
}
break;
case 4:
{
setState(388);
propertyDeclaration();
}
break;
case 5:
{
setState(389);
typeAlias();
}
break;
}
setState(393);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NL || _la==SEMICOLON) {
{
setState(392);
semi();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ClassDeclarationContext extends ParserRuleContext {
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public TerminalNode CLASS() { return getToken(KotlinParser.CLASS, 0); }
public TerminalNode INTERFACE() { return getToken(KotlinParser.INTERFACE, 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 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, 16, RULE_classDeclaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(396);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(395);
modifierList();
}
}
setState(398);
_la = _input.LA(1);
if ( !(_la==CLASS || _la==INTERFACE) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(402);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(399);
match(NL);
}
}
setState(404);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(405);
simpleIdentifier();
setState(413);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) {
case 1:
{
setState(409);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(406);
match(NL);
}
}
setState(411);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(412);
typeParameters();
}
break;
}
setState(422);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) {
case 1:
{
setState(418);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(415);
match(NL);
}
}
setState(420);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(421);
primaryConstructor();
}
break;
}
setState(438);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,26,_ctx) ) {
case 1:
{
setState(427);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(424);
match(NL);
}
}
setState(429);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(430);
match(COLON);
setState(434);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(431);
match(NL);
}
}
setState(436);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(437);
delegationSpecifiers();
}
break;
}
setState(447);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) {
case 1:
{
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);
typeConstraints();
}
break;
}
setState(463);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,31,_ctx) ) {
case 1:
{
setState(452);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(449);
match(NL);
}
}
setState(454);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(455);
classBody();
}
break;
case 2:
{
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);
enumClassBody();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 18, RULE_primaryConstructor);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(466);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(465);
modifierList();
}
}
setState(475);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CONSTRUCTOR) {
{
setState(468);
match(CONSTRUCTOR);
setState(472);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(469);
match(NL);
}
}
setState(474);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(477);
classParameters();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ClassParametersContext extends ParserRuleContext {
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
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, 20, RULE_classParameters);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(479);
match(LPAREN);
setState(488);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 40)) & ~0x3f) == 0 && ((1L << (_la - 40)) & ((1L << (AT - 40)) | (1L << (FILE - 40)) | (1L << (IMPORT - 40)) | (1L << (VAL - 40)) | (1L << (VAR - 40)) | (1L << (CONSTRUCTOR - 40)) | (1L << (BY - 40)) | (1L << (COMPANION - 40)) | (1L << (INIT - 40)) | (1L << (WHERE - 40)) | (1L << (CATCH - 40)) | (1L << (FINALLY - 40)) | (1L << (IN - 40)) | (1L << (OUT - 40)) | (1L << (FIELD - 40)) | (1L << (PROPERTY - 40)) | (1L << (GET - 40)) | (1L << (SET - 40)) | (1L << (GETTER - 40)) | (1L << (SETTER - 40)) | (1L << (RECEIVER - 40)) | (1L << (PARAM - 40)) | (1L << (SETPARAM - 40)) | (1L << (DELEGATE - 40)) | (1L << (DYNAMIC - 40)))) != 0) || ((((_la - 104)) & ~0x3f) == 0 && ((1L << (_la - 104)) & ((1L << (PUBLIC - 104)) | (1L << (PRIVATE - 104)) | (1L << (PROTECTED - 104)) | (1L << (INTERNAL - 104)) | (1L << (ENUM - 104)) | (1L << (SEALED - 104)) | (1L << (ANNOTATION - 104)) | (1L << (DATA - 104)) | (1L << (INNER - 104)) | (1L << (TAILREC - 104)) | (1L << (OPERATOR - 104)) | (1L << (INLINE - 104)) | (1L << (INFIX - 104)) | (1L << (EXTERNAL - 104)) | (1L << (SUSPEND - 104)) | (1L << (OVERRIDE - 104)) | (1L << (ABSTRACT - 104)) | (1L << (FINAL - 104)) | (1L << (OPEN - 104)) | (1L << (CONST - 104)) | (1L << (LATEINIT - 104)) | (1L << (VARARG - 104)) | (1L << (NOINLINE - 104)) | (1L << (CROSSINLINE - 104)) | (1L << (REIFIED - 104)) | (1L << (Identifier - 104)) | (1L << (LabelReference - 104)))) != 0)) {
{
setState(480);
classParameter();
setState(485);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(481);
match(COMMA);
setState(482);
classParameter();
}
}
setState(487);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(490);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 22, RULE_classParameter);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(493);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,37,_ctx) ) {
case 1:
{
setState(492);
modifierList();
}
break;
}
setState(496);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==VAL || _la==VAR) {
{
setState(495);
_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(498);
simpleIdentifier();
setState(499);
match(COLON);
setState(500);
type();
setState(503);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ASSIGNMENT) {
{
setState(501);
match(ASSIGNMENT);
setState(502);
expression();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 24, RULE_delegationSpecifiers);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(508);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AT || _la==FILE || ((((_la - 93)) & ~0x3f) == 0 && ((1L << (_la - 93)) & ((1L << (FIELD - 93)) | (1L << (PROPERTY - 93)) | (1L << (GET - 93)) | (1L << (SET - 93)) | (1L << (RECEIVER - 93)) | (1L << (PARAM - 93)) | (1L << (SETPARAM - 93)) | (1L << (DELEGATE - 93)) | (1L << (LabelReference - 93)))) != 0)) {
{
{
setState(505);
annotations();
}
}
setState(510);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(511);
delegationSpecifier();
setState(528);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,43,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(515);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(512);
match(NL);
}
}
setState(517);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(518);
match(COMMA);
setState(522);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(519);
match(NL);
}
}
setState(524);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(525);
delegationSpecifier();
}
}
}
setState(530);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,43,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 26, RULE_delegationSpecifier);
try {
setState(534);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,44,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(531);
constructorInvocation();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(532);
userType();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(533);
explicitDelegation();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 28, RULE_constructorInvocation);
try {
enterOuterAlt(_localctx, 1);
{
setState(536);
userType();
setState(537);
callSuffix();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 30, RULE_explicitDelegation);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(539);
userType();
setState(543);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(540);
match(NL);
}
}
setState(545);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(546);
match(BY);
setState(550);
_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(547);
match(NL);
}
}
}
setState(552);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,46,_ctx);
}
setState(553);
expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 32, RULE_classBody);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(555);
match(LCURL);
setState(559);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,47,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(556);
match(NL);
}
}
}
setState(561);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,47,_ctx);
}
setState(565);
_errHandler.sync(this);
_la = _input.LA(1);
while (((((_la - 40)) & ~0x3f) == 0 && ((1L << (_la - 40)) & ((1L << (AT - 40)) | (1L << (FILE - 40)) | (1L << (CLASS - 40)) | (1L << (INTERFACE - 40)) | (1L << (FUN - 40)) | (1L << (OBJECT - 40)) | (1L << (VAL - 40)) | (1L << (VAR - 40)) | (1L << (TYPE_ALIAS - 40)) | (1L << (CONSTRUCTOR - 40)) | (1L << (COMPANION - 40)) | (1L << (INIT - 40)) | (1L << (IN - 40)) | (1L << (OUT - 40)) | (1L << (FIELD - 40)) | (1L << (PROPERTY - 40)) | (1L << (GET - 40)) | (1L << (SET - 40)) | (1L << (RECEIVER - 40)) | (1L << (PARAM - 40)) | (1L << (SETPARAM - 40)) | (1L << (DELEGATE - 40)))) != 0) || ((((_la - 104)) & ~0x3f) == 0 && ((1L << (_la - 104)) & ((1L << (PUBLIC - 104)) | (1L << (PRIVATE - 104)) | (1L << (PROTECTED - 104)) | (1L << (INTERNAL - 104)) | (1L << (ENUM - 104)) | (1L << (SEALED - 104)) | (1L << (ANNOTATION - 104)) | (1L << (DATA - 104)) | (1L << (INNER - 104)) | (1L << (TAILREC - 104)) | (1L << (OPERATOR - 104)) | (1L << (INLINE - 104)) | (1L << (INFIX - 104)) | (1L << (EXTERNAL - 104)) | (1L << (SUSPEND - 104)) | (1L << (OVERRIDE - 104)) | (1L << (ABSTRACT - 104)) | (1L << (FINAL - 104)) | (1L << (OPEN - 104)) | (1L << (CONST - 104)) | (1L << (LATEINIT - 104)) | (1L << (VARARG - 104)) | (1L << (NOINLINE - 104)) | (1L << (CROSSINLINE - 104)) | (1L << (REIFIED - 104)) | (1L << (LabelReference - 104)))) != 0)) {
{
{
setState(562);
classMemberDeclaration();
}
}
setState(567);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(571);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(568);
match(NL);
}
}
setState(573);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(574);
match(RCURL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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 SemiContext semi() {
return getRuleContext(SemiContext.class,0);
}
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, 34, RULE_classMemberDeclaration);
try {
enterOuterAlt(_localctx, 1);
{
setState(584);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,50,_ctx) ) {
case 1:
{
setState(576);
classDeclaration();
}
break;
case 2:
{
setState(577);
functionDeclaration();
}
break;
case 3:
{
setState(578);
objectDeclaration();
}
break;
case 4:
{
setState(579);
companionObject();
}
break;
case 5:
{
setState(580);
propertyDeclaration();
}
break;
case 6:
{
setState(581);
anonymousInitializer();
}
break;
case 7:
{
setState(582);
secondaryConstructor();
}
break;
case 8:
{
setState(583);
typeAlias();
}
break;
}
setState(587);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,51,_ctx) ) {
case 1:
{
setState(586);
semi();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 36, RULE_anonymousInitializer);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(589);
match(INIT);
setState(593);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(590);
match(NL);
}
}
setState(595);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(596);
block();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 38, RULE_secondaryConstructor);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(599);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(598);
modifierList();
}
}
setState(601);
match(CONSTRUCTOR);
setState(605);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(602);
match(NL);
}
}
setState(607);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(608);
functionValueParameters();
setState(623);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,57,_ctx) ) {
case 1:
{
setState(612);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(609);
match(NL);
}
}
setState(614);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(615);
match(COLON);
setState(619);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(616);
match(NL);
}
}
setState(621);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(622);
constructorDelegationCall();
}
break;
}
setState(628);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(625);
match(NL);
}
}
setState(630);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(631);
block();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 40, RULE_constructorDelegationCall);
int _la;
try {
setState(649);
_errHandler.sync(this);
switch (_input.LA(1)) {
case THIS:
enterOuterAlt(_localctx, 1);
{
setState(633);
match(THIS);
setState(637);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(634);
match(NL);
}
}
setState(639);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(640);
valueArguments();
}
break;
case SUPER:
enterOuterAlt(_localctx, 2);
{
setState(641);
match(SUPER);
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);
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;
}
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, 42, RULE_enumClassBody);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(651);
match(LCURL);
setState(655);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,62,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(652);
match(NL);
}
}
}
setState(657);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,62,_ctx);
}
setState(659);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 58)) & ~0x3f) == 0 && ((1L << (_la - 58)) & ((1L << (IMPORT - 58)) | (1L << (CONSTRUCTOR - 58)) | (1L << (BY - 58)) | (1L << (COMPANION - 58)) | (1L << (INIT - 58)) | (1L << (WHERE - 58)) | (1L << (CATCH - 58)) | (1L << (FINALLY - 58)) | (1L << (OUT - 58)) | (1L << (GETTER - 58)) | (1L << (SETTER - 58)) | (1L << (DYNAMIC - 58)) | (1L << (PUBLIC - 58)) | (1L << (PRIVATE - 58)) | (1L << (PROTECTED - 58)) | (1L << (INTERNAL - 58)) | (1L << (ENUM - 58)) | (1L << (SEALED - 58)) | (1L << (ANNOTATION - 58)) | (1L << (DATA - 58)) | (1L << (INNER - 58)) | (1L << (TAILREC - 58)) | (1L << (OPERATOR - 58)) | (1L << (INLINE - 58)) | (1L << (INFIX - 58)) | (1L << (EXTERNAL - 58)) | (1L << (SUSPEND - 58)) | (1L << (OVERRIDE - 58)) | (1L << (ABSTRACT - 58)) | (1L << (FINAL - 58)))) != 0) || ((((_la - 122)) & ~0x3f) == 0 && ((1L << (_la - 122)) & ((1L << (OPEN - 122)) | (1L << (CONST - 122)) | (1L << (LATEINIT - 122)) | (1L << (VARARG - 122)) | (1L << (NOINLINE - 122)) | (1L << (CROSSINLINE - 122)) | (1L << (REIFIED - 122)) | (1L << (Identifier - 122)))) != 0)) {
{
setState(658);
enumEntries();
}
}
setState(680);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,67,_ctx) ) {
case 1:
{
setState(664);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(661);
match(NL);
}
}
setState(666);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(667);
match(SEMICOLON);
setState(671);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,65,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(668);
match(NL);
}
}
}
setState(673);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,65,_ctx);
}
setState(677);
_errHandler.sync(this);
_la = _input.LA(1);
while (((((_la - 40)) & ~0x3f) == 0 && ((1L << (_la - 40)) & ((1L << (AT - 40)) | (1L << (FILE - 40)) | (1L << (CLASS - 40)) | (1L << (INTERFACE - 40)) | (1L << (FUN - 40)) | (1L << (OBJECT - 40)) | (1L << (VAL - 40)) | (1L << (VAR - 40)) | (1L << (TYPE_ALIAS - 40)) | (1L << (CONSTRUCTOR - 40)) | (1L << (COMPANION - 40)) | (1L << (INIT - 40)) | (1L << (IN - 40)) | (1L << (OUT - 40)) | (1L << (FIELD - 40)) | (1L << (PROPERTY - 40)) | (1L << (GET - 40)) | (1L << (SET - 40)) | (1L << (RECEIVER - 40)) | (1L << (PARAM - 40)) | (1L << (SETPARAM - 40)) | (1L << (DELEGATE - 40)))) != 0) || ((((_la - 104)) & ~0x3f) == 0 && ((1L << (_la - 104)) & ((1L << (PUBLIC - 104)) | (1L << (PRIVATE - 104)) | (1L << (PROTECTED - 104)) | (1L << (INTERNAL - 104)) | (1L << (ENUM - 104)) | (1L << (SEALED - 104)) | (1L << (ANNOTATION - 104)) | (1L << (DATA - 104)) | (1L << (INNER - 104)) | (1L << (TAILREC - 104)) | (1L << (OPERATOR - 104)) | (1L << (INLINE - 104)) | (1L << (INFIX - 104)) | (1L << (EXTERNAL - 104)) | (1L << (SUSPEND - 104)) | (1L << (OVERRIDE - 104)) | (1L << (ABSTRACT - 104)) | (1L << (FINAL - 104)) | (1L << (OPEN - 104)) | (1L << (CONST - 104)) | (1L << (LATEINIT - 104)) | (1L << (VARARG - 104)) | (1L << (NOINLINE - 104)) | (1L << (CROSSINLINE - 104)) | (1L << (REIFIED - 104)) | (1L << (LabelReference - 104)))) != 0)) {
{
{
setState(674);
classMemberDeclaration();
}
}
setState(679);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
}
setState(685);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(682);
match(NL);
}
}
setState(687);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(688);
match(RCURL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 44, RULE_enumEntries);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(697);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(690);
enumEntry();
setState(694);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,69,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(691);
match(NL);
}
}
}
setState(696);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,69,_ctx);
}
}
}
setState(699);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( ((((_la - 58)) & ~0x3f) == 0 && ((1L << (_la - 58)) & ((1L << (IMPORT - 58)) | (1L << (CONSTRUCTOR - 58)) | (1L << (BY - 58)) | (1L << (COMPANION - 58)) | (1L << (INIT - 58)) | (1L << (WHERE - 58)) | (1L << (CATCH - 58)) | (1L << (FINALLY - 58)) | (1L << (OUT - 58)) | (1L << (GETTER - 58)) | (1L << (SETTER - 58)) | (1L << (DYNAMIC - 58)) | (1L << (PUBLIC - 58)) | (1L << (PRIVATE - 58)) | (1L << (PROTECTED - 58)) | (1L << (INTERNAL - 58)) | (1L << (ENUM - 58)) | (1L << (SEALED - 58)) | (1L << (ANNOTATION - 58)) | (1L << (DATA - 58)) | (1L << (INNER - 58)) | (1L << (TAILREC - 58)) | (1L << (OPERATOR - 58)) | (1L << (INLINE - 58)) | (1L << (INFIX - 58)) | (1L << (EXTERNAL - 58)) | (1L << (SUSPEND - 58)) | (1L << (OVERRIDE - 58)) | (1L << (ABSTRACT - 58)) | (1L << (FINAL - 58)))) != 0) || ((((_la - 122)) & ~0x3f) == 0 && ((1L << (_la - 122)) & ((1L << (OPEN - 122)) | (1L << (CONST - 122)) | (1L << (LATEINIT - 122)) | (1L << (VARARG - 122)) | (1L << (NOINLINE - 122)) | (1L << (CROSSINLINE - 122)) | (1L << (REIFIED - 122)) | (1L << (Identifier - 122)))) != 0) );
setState(702);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,71,_ctx) ) {
case 1:
{
setState(701);
match(SEMICOLON);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 46, RULE_enumEntry);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(704);
simpleIdentifier();
setState(712);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,73,_ctx) ) {
case 1:
{
setState(708);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(705);
match(NL);
}
}
setState(710);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(711);
valueArguments();
}
break;
}
setState(721);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,75,_ctx) ) {
case 1:
{
setState(717);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(714);
match(NL);
}
}
setState(719);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(720);
classBody();
}
break;
}
setState(730);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,77,_ctx) ) {
case 1:
{
setState(726);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(723);
match(NL);
}
}
setState(728);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(729);
match(COMMA);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class FunctionDeclarationContext extends ParserRuleContext {
public TerminalNode FUN() { return getToken(KotlinParser.FUN, 0); }
public FunctionValueParametersContext functionValueParameters() {
return getRuleContext(FunctionValueParametersContext.class,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, 48, RULE_functionDeclaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(733);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(732);
modifierList();
}
}
setState(735);
match(FUN);
setState(751);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,81,_ctx) ) {
case 1:
{
setState(739);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(736);
match(NL);
}
}
setState(741);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(742);
type();
setState(746);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(743);
match(NL);
}
}
setState(748);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(749);
match(DOT);
}
break;
}
setState(760);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,83,_ctx) ) {
case 1:
{
setState(756);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(753);
match(NL);
}
}
setState(758);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(759);
typeParameters();
}
break;
}
setState(769);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,85,_ctx) ) {
case 1:
{
setState(765);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(762);
match(NL);
}
}
setState(767);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(768);
identifier();
}
break;
}
setState(774);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(771);
match(NL);
}
}
setState(776);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(777);
functionValueParameters();
setState(792);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,89,_ctx) ) {
case 1:
{
setState(781);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(778);
match(NL);
}
}
setState(783);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(784);
match(COLON);
setState(788);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(785);
match(NL);
}
}
setState(790);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(791);
type();
}
break;
}
setState(801);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,91,_ctx) ) {
case 1:
{
setState(797);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(794);
match(NL);
}
}
setState(799);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(800);
typeConstraints();
}
break;
}
setState(810);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,93,_ctx) ) {
case 1:
{
setState(806);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(803);
match(NL);
}
}
setState(808);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(809);
functionBody();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class FunctionValueParametersContext extends ParserRuleContext {
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
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, 50, RULE_functionValueParameters);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(812);
match(LPAREN);
setState(821);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 40)) & ~0x3f) == 0 && ((1L << (_la - 40)) & ((1L << (AT - 40)) | (1L << (FILE - 40)) | (1L << (IMPORT - 40)) | (1L << (CONSTRUCTOR - 40)) | (1L << (BY - 40)) | (1L << (COMPANION - 40)) | (1L << (INIT - 40)) | (1L << (WHERE - 40)) | (1L << (CATCH - 40)) | (1L << (FINALLY - 40)) | (1L << (IN - 40)) | (1L << (OUT - 40)) | (1L << (FIELD - 40)) | (1L << (PROPERTY - 40)) | (1L << (GET - 40)) | (1L << (SET - 40)) | (1L << (GETTER - 40)) | (1L << (SETTER - 40)) | (1L << (RECEIVER - 40)) | (1L << (PARAM - 40)) | (1L << (SETPARAM - 40)) | (1L << (DELEGATE - 40)) | (1L << (DYNAMIC - 40)))) != 0) || ((((_la - 104)) & ~0x3f) == 0 && ((1L << (_la - 104)) & ((1L << (PUBLIC - 104)) | (1L << (PRIVATE - 104)) | (1L << (PROTECTED - 104)) | (1L << (INTERNAL - 104)) | (1L << (ENUM - 104)) | (1L << (SEALED - 104)) | (1L << (ANNOTATION - 104)) | (1L << (DATA - 104)) | (1L << (INNER - 104)) | (1L << (TAILREC - 104)) | (1L << (OPERATOR - 104)) | (1L << (INLINE - 104)) | (1L << (INFIX - 104)) | (1L << (EXTERNAL - 104)) | (1L << (SUSPEND - 104)) | (1L << (OVERRIDE - 104)) | (1L << (ABSTRACT - 104)) | (1L << (FINAL - 104)) | (1L << (OPEN - 104)) | (1L << (CONST - 104)) | (1L << (LATEINIT - 104)) | (1L << (VARARG - 104)) | (1L << (NOINLINE - 104)) | (1L << (CROSSINLINE - 104)) | (1L << (REIFIED - 104)) | (1L << (Identifier - 104)) | (1L << (LabelReference - 104)))) != 0)) {
{
setState(813);
functionValueParameter();
setState(818);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(814);
match(COMMA);
setState(815);
functionValueParameter();
}
}
setState(820);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(823);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 52, RULE_functionValueParameter);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(826);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,96,_ctx) ) {
case 1:
{
setState(825);
modifierList();
}
break;
}
setState(828);
parameter();
setState(831);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ASSIGNMENT) {
{
setState(829);
match(ASSIGNMENT);
setState(830);
expression();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 54, RULE_parameter);
try {
enterOuterAlt(_localctx, 1);
{
setState(833);
simpleIdentifier();
setState(834);
match(COLON);
setState(835);
type();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 56, RULE_functionBody);
try {
int _alt;
setState(846);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LCURL:
enterOuterAlt(_localctx, 1);
{
setState(837);
block();
}
break;
case ASSIGNMENT:
enterOuterAlt(_localctx, 2);
{
setState(838);
match(ASSIGNMENT);
setState(842);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,98,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(839);
match(NL);
}
}
}
setState(844);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,98,_ctx);
}
setState(845);
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;
}
public static class ObjectDeclarationContext extends ParserRuleContext {
public TerminalNode OBJECT() { return getToken(KotlinParser.OBJECT, 0); }
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 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, 58, RULE_objectDeclaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(849);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(848);
modifierList();
}
}
setState(851);
match(OBJECT);
setState(855);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(852);
match(NL);
}
}
setState(857);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(858);
simpleIdentifier();
setState(866);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,103,_ctx) ) {
case 1:
{
setState(862);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(859);
match(NL);
}
}
setState(864);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(865);
primaryConstructor();
}
break;
}
setState(882);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,106,_ctx) ) {
case 1:
{
setState(871);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(868);
match(NL);
}
}
setState(873);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(874);
match(COLON);
setState(878);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(875);
match(NL);
}
}
setState(880);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(881);
delegationSpecifiers();
}
break;
}
setState(891);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,108,_ctx) ) {
case 1:
{
setState(887);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(884);
match(NL);
}
}
setState(889);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(890);
classBody();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 60, RULE_companionObject);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(894);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(893);
modifierList();
}
}
setState(896);
match(COMPANION);
setState(900);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(897);
match(NL);
}
}
setState(902);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(904);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(903);
modifierList();
}
}
setState(906);
match(OBJECT);
setState(914);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,113,_ctx) ) {
case 1:
{
setState(910);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(907);
match(NL);
}
}
setState(912);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(913);
simpleIdentifier();
}
break;
}
setState(930);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,116,_ctx) ) {
case 1:
{
setState(919);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(916);
match(NL);
}
}
setState(921);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(922);
match(COLON);
setState(926);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(923);
match(NL);
}
}
setState(928);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(929);
delegationSpecifiers();
}
break;
}
setState(939);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,118,_ctx) ) {
case 1:
{
setState(935);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(932);
match(NL);
}
}
setState(937);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(938);
classBody();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PropertyDeclarationContext extends ParserRuleContext {
public TerminalNode VAL() { return getToken(KotlinParser.VAL, 0); }
public TerminalNode VAR() { return getToken(KotlinParser.VAR, 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 SemiContext semi() {
return getRuleContext(SemiContext.class,0);
}
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 List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public GetterContext getter() {
return getRuleContext(GetterContext.class,0);
}
public SetterContext setter() {
return getRuleContext(SetterContext.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, 62, RULE_propertyDeclaration);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(942);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(941);
modifierList();
}
}
setState(944);
_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(952);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,121,_ctx) ) {
case 1:
{
setState(948);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(945);
match(NL);
}
}
setState(950);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(951);
typeParameters();
}
break;
}
setState(969);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,124,_ctx) ) {
case 1:
{
setState(957);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(954);
match(NL);
}
}
setState(959);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(960);
type();
setState(964);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(961);
match(NL);
}
}
setState(966);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(967);
match(DOT);
}
break;
}
{
setState(974);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(971);
match(NL);
}
}
setState(976);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(979);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LPAREN:
{
setState(977);
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(978);
variableDeclaration();
}
break;
default:
throw new NoViableAltException(this);
}
}
setState(988);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,128,_ctx) ) {
case 1:
{
setState(984);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(981);
match(NL);
}
}
setState(986);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(987);
typeConstraints();
}
break;
}
setState(1004);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,131,_ctx) ) {
case 1:
{
setState(993);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(990);
match(NL);
}
}
setState(995);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(996);
_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(1000);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,130,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(997);
match(NL);
}
}
}
setState(1002);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,130,_ctx);
}
setState(1003);
expression();
}
break;
}
setState(1007);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,132,_ctx) ) {
case 1:
{
setState(1006);
semi();
}
break;
}
setState(1033);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,139,_ctx) ) {
case 1:
{
setState(1010);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,133,_ctx) ) {
case 1:
{
setState(1009);
getter();
}
break;
}
setState(1019);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,135,_ctx) ) {
case 1:
{
setState(1015);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1012);
match(NL);
}
}
setState(1017);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1018);
setter();
}
break;
}
}
break;
case 2:
{
setState(1022);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,136,_ctx) ) {
case 1:
{
setState(1021);
setter();
}
break;
}
setState(1031);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,138,_ctx) ) {
case 1:
{
setState(1027);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1024);
match(NL);
}
}
setState(1029);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1030);
getter();
}
break;
}
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 64, RULE_multiVariableDeclaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1035);
match(LPAREN);
setState(1036);
variableDeclaration();
setState(1041);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1037);
match(COMMA);
setState(1038);
variableDeclaration();
}
}
setState(1043);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1044);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 66, RULE_variableDeclaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1046);
simpleIdentifier();
setState(1049);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COLON) {
{
setState(1047);
match(COLON);
setState(1048);
type();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 68, RULE_getter);
int _la;
try {
int _alt;
setState(1100);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,151,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1052);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(1051);
modifierList();
}
}
setState(1054);
match(GETTER);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1056);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(1055);
modifierList();
}
}
setState(1058);
match(GETTER);
setState(1062);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1059);
match(NL);
}
}
setState(1064);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1065);
match(LPAREN);
setState(1066);
match(RPAREN);
setState(1081);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,147,_ctx) ) {
case 1:
{
setState(1070);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1067);
match(NL);
}
}
setState(1072);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1073);
match(COLON);
setState(1077);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1074);
match(NL);
}
}
setState(1079);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1080);
type();
}
break;
}
setState(1086);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1083);
match(NL);
}
}
setState(1088);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1098);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LCURL:
{
setState(1089);
block();
}
break;
case ASSIGNMENT:
{
setState(1090);
match(ASSIGNMENT);
setState(1094);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,149,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1091);
match(NL);
}
}
}
setState(1096);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,149,_ctx);
}
setState(1097);
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;
}
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, 70, RULE_setter);
int _la;
try {
int _alt;
setState(1137);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,159,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1103);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(1102);
modifierList();
}
}
setState(1105);
match(SETTER);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1107);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(1106);
modifierList();
}
}
setState(1109);
match(SETTER);
setState(1113);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1110);
match(NL);
}
}
setState(1115);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1116);
match(LPAREN);
setState(1121);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,156,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
setState(1119);
_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(1117);
annotations();
}
break;
case VARARG:
case NOINLINE:
case CROSSINLINE:
{
setState(1118);
parameterModifier();
}
break;
default:
throw new NoViableAltException(this);
}
}
}
setState(1123);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,156,_ctx);
}
setState(1126);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,157,_ctx) ) {
case 1:
{
setState(1124);
simpleIdentifier();
}
break;
case 2:
{
setState(1125);
parameter();
}
break;
}
setState(1128);
match(RPAREN);
setState(1132);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1129);
match(NL);
}
}
setState(1134);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1135);
functionBody();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 72, RULE_typeAlias);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1140);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AT || _la==FILE || ((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IN - 89)) | (1L << (OUT - 89)) | (1L << (FIELD - 89)) | (1L << (PROPERTY - 89)) | (1L << (GET - 89)) | (1L << (SET - 89)) | (1L << (RECEIVER - 89)) | (1L << (PARAM - 89)) | (1L << (SETPARAM - 89)) | (1L << (DELEGATE - 89)) | (1L << (PUBLIC - 89)) | (1L << (PRIVATE - 89)) | (1L << (PROTECTED - 89)) | (1L << (INTERNAL - 89)) | (1L << (ENUM - 89)) | (1L << (SEALED - 89)) | (1L << (ANNOTATION - 89)) | (1L << (DATA - 89)) | (1L << (INNER - 89)) | (1L << (TAILREC - 89)) | (1L << (OPERATOR - 89)) | (1L << (INLINE - 89)) | (1L << (INFIX - 89)) | (1L << (EXTERNAL - 89)) | (1L << (SUSPEND - 89)) | (1L << (OVERRIDE - 89)) | (1L << (ABSTRACT - 89)) | (1L << (FINAL - 89)) | (1L << (OPEN - 89)) | (1L << (CONST - 89)) | (1L << (LATEINIT - 89)) | (1L << (VARARG - 89)) | (1L << (NOINLINE - 89)) | (1L << (CROSSINLINE - 89)) | (1L << (REIFIED - 89)) | (1L << (LabelReference - 89)))) != 0)) {
{
setState(1139);
modifierList();
}
}
setState(1142);
match(TYPE_ALIAS);
setState(1146);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1143);
match(NL);
}
}
setState(1148);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1149);
simpleIdentifier();
setState(1157);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,163,_ctx) ) {
case 1:
{
setState(1153);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1150);
match(NL);
}
}
setState(1155);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1156);
typeParameters();
}
break;
}
setState(1162);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1159);
match(NL);
}
}
setState(1164);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1165);
match(ASSIGNMENT);
setState(1169);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1166);
match(NL);
}
}
setState(1171);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1172);
type();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 74, RULE_typeParameters);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1174);
match(LANGLE);
setState(1178);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,166,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1175);
match(NL);
}
}
}
setState(1180);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,166,_ctx);
}
setState(1181);
typeParameter();
setState(1198);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,169,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1185);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1182);
match(NL);
}
}
setState(1187);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1188);
match(COMMA);
setState(1192);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,168,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1189);
match(NL);
}
}
}
setState(1194);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,168,_ctx);
}
setState(1195);
typeParameter();
}
}
}
setState(1200);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,169,_ctx);
}
setState(1204);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1201);
match(NL);
}
}
setState(1206);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1207);
match(RANGLE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 76, RULE_typeParameter);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1210);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,171,_ctx) ) {
case 1:
{
setState(1209);
modifierList();
}
break;
}
setState(1215);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1212);
match(NL);
}
}
setState(1217);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1218);
simpleIdentifier();
setState(1233);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,175,_ctx) ) {
case 1:
{
setState(1222);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1219);
match(NL);
}
}
setState(1224);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1225);
match(COLON);
setState(1229);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1226);
match(NL);
}
}
setState(1231);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1232);
type();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TypeContext 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 FunctionTypeContext functionType() {
return getRuleContext(FunctionTypeContext.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, 78, RULE_type);
try {
enterOuterAlt(_localctx, 1);
{
setState(1236);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,176,_ctx) ) {
case 1:
{
setState(1235);
typeModifierList();
}
break;
}
setState(1242);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,177,_ctx) ) {
case 1:
{
setState(1238);
parenthesizedType();
}
break;
case 2:
{
setState(1239);
nullableType();
}
break;
case 3:
{
setState(1240);
typeReference();
}
break;
case 4:
{
setState(1241);
functionType();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 80, RULE_typeModifierList);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1252);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
setState(1252);
_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(1244);
annotations();
}
break;
case SUSPEND:
{
setState(1245);
match(SUSPEND);
setState(1249);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1246);
match(NL);
}
}
setState(1251);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
default:
throw new NoViableAltException(this);
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(1254);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,180,_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;
}
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, 82, RULE_parenthesizedType);
try {
enterOuterAlt(_localctx, 1);
{
setState(1256);
match(LPAREN);
setState(1257);
type();
setState(1258);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 84, RULE_nullableType);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1262);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,181,_ctx) ) {
case 1:
{
setState(1260);
typeReference();
}
break;
case 2:
{
setState(1261);
parenthesizedType();
}
break;
}
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(1271);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(1270);
match(QUEST);
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(1273);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,183,_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;
}
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, 86, RULE_typeReference);
try {
setState(1281);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,184,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1275);
match(LPAREN);
setState(1276);
typeReference();
setState(1277);
match(RPAREN);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1279);
userType();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(1280);
match(DYNAMIC);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class FunctionTypeContext extends ParserRuleContext {
public FunctionTypeParametersContext functionTypeParameters() {
return getRuleContext(FunctionTypeParametersContext.class,0);
}
public TerminalNode ARROW() { return getToken(KotlinParser.ARROW, 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 TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
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, 88, RULE_functionType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1297);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,187,_ctx) ) {
case 1:
{
setState(1283);
functionTypeReceiver();
setState(1287);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1284);
match(NL);
}
}
setState(1289);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1290);
match(DOT);
setState(1294);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1291);
match(NL);
}
}
setState(1296);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
}
setState(1299);
functionTypeParameters();
setState(1303);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1300);
match(NL);
}
}
setState(1305);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1306);
match(ARROW);
setState(1314);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,190,_ctx) ) {
case 1:
{
setState(1310);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1307);
match(NL);
}
}
setState(1312);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1313);
type();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 90, RULE_functionTypeReceiver);
try {
setState(1319);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,191,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1316);
parenthesizedType();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1317);
nullableType();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(1318);
typeReference();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 92, RULE_userType);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1321);
simpleUserType();
setState(1338);
_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(1325);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1322);
match(NL);
}
}
setState(1327);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1328);
match(DOT);
setState(1332);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1329);
match(NL);
}
}
setState(1334);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1335);
simpleUserType();
}
}
}
setState(1340);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,194,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 94, RULE_simpleUserType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1341);
simpleIdentifier();
setState(1349);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,196,_ctx) ) {
case 1:
{
setState(1345);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1342);
match(NL);
}
}
setState(1347);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1348);
typeArguments();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 96, RULE_functionTypeParameters);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1351);
match(LPAREN);
setState(1354);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,197,_ctx) ) {
case 1:
{
setState(1352);
parameter();
}
break;
case 2:
{
setState(1353);
type();
}
break;
}
setState(1363);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1356);
match(COMMA);
setState(1359);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,198,_ctx) ) {
case 1:
{
setState(1357);
parameter();
}
break;
case 2:
{
setState(1358);
type();
}
break;
}
}
}
setState(1365);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1366);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 98, RULE_typeConstraints);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1368);
match(WHERE);
setState(1372);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1369);
match(NL);
}
}
setState(1374);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1375);
typeConstraint();
setState(1392);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,203,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1379);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1376);
match(NL);
}
}
setState(1381);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1382);
match(COMMA);
setState(1386);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1383);
match(NL);
}
}
setState(1388);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1389);
typeConstraint();
}
}
}
setState(1394);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,203,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 100, RULE_typeConstraint);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1398);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AT || _la==FILE || ((((_la - 93)) & ~0x3f) == 0 && ((1L << (_la - 93)) & ((1L << (FIELD - 93)) | (1L << (PROPERTY - 93)) | (1L << (GET - 93)) | (1L << (SET - 93)) | (1L << (RECEIVER - 93)) | (1L << (PARAM - 93)) | (1L << (SETPARAM - 93)) | (1L << (DELEGATE - 93)) | (1L << (LabelReference - 93)))) != 0)) {
{
{
setState(1395);
annotations();
}
}
setState(1400);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1401);
simpleIdentifier();
setState(1405);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1402);
match(NL);
}
}
setState(1407);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1408);
match(COLON);
setState(1412);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1409);
match(NL);
}
}
setState(1414);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1415);
type();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class BlockContext 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 statement() {
return getRuleContexts(StatementContext.class);
}
public StatementContext statement(int i) {
return getRuleContext(StatementContext.class,i);
}
public List semi() {
return getRuleContexts(SemiContext.class);
}
public SemiContext semi(int i) {
return getRuleContext(SemiContext.class,i);
}
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, 102, RULE_block);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1417);
match(LCURL);
setState(1421);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,207,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1418);
match(NL);
}
}
}
setState(1423);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,207,_ctx);
}
setState(1429);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,208,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1424);
statement();
setState(1425);
semi();
}
}
}
setState(1431);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,208,_ctx);
}
setState(1436);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,210,_ctx) ) {
case 1:
{
setState(1432);
statement();
setState(1434);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,209,_ctx) ) {
case 1:
{
setState(1433);
semi();
}
break;
}
}
break;
}
setState(1441);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1438);
match(NL);
}
}
setState(1443);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1444);
match(RCURL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StatementsContext extends ParserRuleContext {
public List statement() {
return getRuleContexts(StatementContext.class);
}
public StatementContext statement(int i) {
return getRuleContext(StatementContext.class,i);
}
public List semi() {
return getRuleContexts(SemiContext.class);
}
public SemiContext semi(int i) {
return getRuleContext(SemiContext.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, 104, RULE_statements);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1458);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,214,_ctx) ) {
case 1:
{
setState(1451);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,212,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1446);
statement();
setState(1447);
semi();
}
}
}
setState(1453);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,212,_ctx);
}
setState(1454);
statement();
setState(1456);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,213,_ctx) ) {
case 1:
{
setState(1455);
semi();
}
break;
}
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StatementContext extends ParserRuleContext {
public DeclarationContext declaration() {
return getRuleContext(DeclarationContext.class,0);
}
public AssignmentContext assignment() {
return getRuleContext(AssignmentContext.class,0);
}
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.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, 106, RULE_statement);
try {
setState(1463);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,215,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1460);
declaration();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1461);
assignment();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(1462);
expression();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 108, RULE_declaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1468);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==LabelDefinition) {
{
{
setState(1465);
labelDefinition();
}
}
setState(1470);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1475);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,217,_ctx) ) {
case 1:
{
setState(1471);
classDeclaration();
}
break;
case 2:
{
setState(1472);
functionDeclaration();
}
break;
case 3:
{
setState(1473);
propertyDeclaration();
}
break;
case 4:
{
setState(1474);
typeAlias();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AssignmentContext extends ParserRuleContext {
public AssignableExpressionContext assignableExpression() {
return getRuleContext(AssignableExpressionContext.class,0);
}
public AssignmentOperatorContext assignmentOperator() {
return getRuleContext(AssignmentOperatorContext.class,0);
}
public DisjunctionContext disjunction() {
return getRuleContext(DisjunctionContext.class,0);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public AssignmentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_assignment; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterAssignment(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitAssignment(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitAssignment(this);
else return visitor.visitChildren(this);
}
}
public final AssignmentContext assignment() throws RecognitionException {
AssignmentContext _localctx = new AssignmentContext(_ctx, getState());
enterRule(_localctx, 110, RULE_assignment);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1477);
assignableExpression();
setState(1478);
assignmentOperator();
setState(1482);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,218,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1479);
match(NL);
}
}
}
setState(1484);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,218,_ctx);
}
setState(1485);
disjunction();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ExpressionContext extends ParserRuleContext {
public DisjunctionContext disjunction() {
return getRuleContext(DisjunctionContext.class,0);
}
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, 112, RULE_expression);
try {
enterOuterAlt(_localctx, 1);
{
setState(1487);
disjunction();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 114, RULE_disjunction);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1489);
conjunction();
setState(1506);
_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(1493);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1490);
match(NL);
}
}
setState(1495);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1496);
match(DISJ);
setState(1500);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,220,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1497);
match(NL);
}
}
}
setState(1502);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,220,_ctx);
}
setState(1503);
conjunction();
}
}
}
setState(1508);
_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;
}
public static class ConjunctionContext extends ParserRuleContext {
public List equality() {
return getRuleContexts(EqualityContext.class);
}
public EqualityContext equality(int i) {
return getRuleContext(EqualityContext.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, 116, RULE_conjunction);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1509);
equality();
setState(1526);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,224,_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(CONJ);
setState(1520);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,223,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1517);
match(NL);
}
}
}
setState(1522);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,223,_ctx);
}
setState(1523);
equality();
}
}
}
setState(1528);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,224,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class EqualityContext extends ParserRuleContext {
public List comparison() {
return getRuleContexts(ComparisonContext.class);
}
public ComparisonContext comparison(int i) {
return getRuleContext(ComparisonContext.class,i);
}
public List equalityOperator() {
return getRuleContexts(EqualityOperatorContext.class);
}
public EqualityOperatorContext equalityOperator(int i) {
return getRuleContext(EqualityOperatorContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public EqualityContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_equality; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterEquality(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitEquality(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitEquality(this);
else return visitor.visitChildren(this);
}
}
public final EqualityContext equality() throws RecognitionException {
EqualityContext _localctx = new EqualityContext(_ctx, getState());
enterRule(_localctx, 118, RULE_equality);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1529);
comparison();
setState(1541);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,226,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1530);
equalityOperator();
setState(1534);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,225,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1531);
match(NL);
}
}
}
setState(1536);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,225,_ctx);
}
setState(1537);
comparison();
}
}
}
setState(1543);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,226,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ComparisonContext extends ParserRuleContext {
public List infixOperation() {
return getRuleContexts(InfixOperationContext.class);
}
public InfixOperationContext infixOperation(int i) {
return getRuleContext(InfixOperationContext.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, 120, RULE_comparison);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1544);
infixOperation();
setState(1554);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,228,_ctx) ) {
case 1:
{
setState(1545);
comparisonOperator();
setState(1549);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,227,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1546);
match(NL);
}
}
}
setState(1551);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,227,_ctx);
}
setState(1552);
infixOperation();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class InfixOperationContext extends ParserRuleContext {
public List elvisExpression() {
return getRuleContexts(ElvisExpressionContext.class);
}
public ElvisExpressionContext elvisExpression(int i) {
return getRuleContext(ElvisExpressionContext.class,i);
}
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 IsOperatorContext isOperator() {
return getRuleContext(IsOperatorContext.class,0);
}
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public InfixOperationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_infixOperation; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterInfixOperation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitInfixOperation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitInfixOperation(this);
else return visitor.visitChildren(this);
}
}
public final InfixOperationContext infixOperation() throws RecognitionException {
InfixOperationContext _localctx = new InfixOperationContext(_ctx, getState());
enterRule(_localctx, 122, RULE_infixOperation);
int _la;
try {
int _alt;
setState(1583);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,233,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1556);
elvisExpression();
setState(1568);
_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(1557);
inOperator();
setState(1561);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,229,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1558);
match(NL);
}
}
}
setState(1563);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,229,_ctx);
}
setState(1564);
elvisExpression();
}
}
}
setState(1570);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,230,_ctx);
}
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1571);
elvisExpression();
setState(1581);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,232,_ctx) ) {
case 1:
{
setState(1572);
isOperator();
setState(1576);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1573);
match(NL);
}
}
setState(1578);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1579);
type();
}
break;
}
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 124, RULE_elvisExpression);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1585);
infixFunctionCall();
setState(1602);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,236,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1589);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1586);
match(NL);
}
}
setState(1591);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1592);
match(ELVIS);
setState(1596);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,235,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1593);
match(NL);
}
}
}
setState(1598);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,235,_ctx);
}
setState(1599);
infixFunctionCall();
}
}
}
setState(1604);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,236,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 126, RULE_infixFunctionCall);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1605);
rangeExpression();
setState(1617);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,238,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1606);
simpleIdentifier();
setState(1610);
_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(1607);
match(NL);
}
}
}
setState(1612);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,237,_ctx);
}
setState(1613);
rangeExpression();
}
}
}
setState(1619);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,238,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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 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, 128, RULE_rangeExpression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1620);
additiveExpression();
setState(1631);
_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(1621);
match(RANGE);
setState(1625);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,239,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1622);
match(NL);
}
}
}
setState(1627);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,239,_ctx);
}
setState(1628);
additiveExpression();
}
}
}
setState(1633);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,240,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 130, RULE_additiveExpression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1634);
multiplicativeExpression();
setState(1646);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,242,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1635);
additiveOperator();
setState(1639);
_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(1636);
match(NL);
}
}
}
setState(1641);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,241,_ctx);
}
setState(1642);
multiplicativeExpression();
}
}
}
setState(1648);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,242,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class MultiplicativeExpressionContext extends ParserRuleContext {
public List asExpression() {
return getRuleContexts(AsExpressionContext.class);
}
public AsExpressionContext asExpression(int i) {
return getRuleContext(AsExpressionContext.class,i);
}
public List multiplicativeOperator() {
return getRuleContexts(MultiplicativeOperatorContext.class);
}
public MultiplicativeOperatorContext multiplicativeOperator(int i) {
return getRuleContext(MultiplicativeOperatorContext.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, 132, RULE_multiplicativeExpression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1649);
asExpression();
setState(1661);
_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(1650);
multiplicativeOperator();
setState(1654);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,243,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1651);
match(NL);
}
}
}
setState(1656);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,243,_ctx);
}
setState(1657);
asExpression();
}
}
}
setState(1663);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,244,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AsExpressionContext extends ParserRuleContext {
public PrefixUnaryExpressionContext prefixUnaryExpression() {
return getRuleContext(PrefixUnaryExpressionContext.class,0);
}
public AsExpressionTailContext asExpressionTail() {
return getRuleContext(AsExpressionTailContext.class,0);
}
public AsExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_asExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterAsExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitAsExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitAsExpression(this);
else return visitor.visitChildren(this);
}
}
public final AsExpressionContext asExpression() throws RecognitionException {
AsExpressionContext _localctx = new AsExpressionContext(_ctx, getState());
enterRule(_localctx, 134, RULE_asExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(1664);
prefixUnaryExpression();
setState(1666);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,245,_ctx) ) {
case 1:
{
setState(1665);
asExpressionTail();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AsExpressionTailContext extends ParserRuleContext {
public AsOperatorContext asOperator() {
return getRuleContext(AsOperatorContext.class,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 AsExpressionTailContext asExpressionTail() {
return getRuleContext(AsExpressionTailContext.class,0);
}
public AsExpressionTailContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_asExpressionTail; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterAsExpressionTail(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitAsExpressionTail(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitAsExpressionTail(this);
else return visitor.visitChildren(this);
}
}
public final AsExpressionTailContext asExpressionTail() throws RecognitionException {
AsExpressionTailContext _localctx = new AsExpressionTailContext(_ctx, getState());
enterRule(_localctx, 136, RULE_asExpressionTail);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1671);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1668);
match(NL);
}
}
setState(1673);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1674);
asOperator();
setState(1678);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1675);
match(NL);
}
}
setState(1680);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1681);
type();
setState(1683);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,248,_ctx) ) {
case 1:
{
setState(1682);
asExpressionTail();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PrefixUnaryExpressionContext extends ParserRuleContext {
public PostfixUnaryExpressionContext postfixUnaryExpression() {
return getRuleContext(PostfixUnaryExpressionContext.class,0);
}
public List prefixUnaryOperator() {
return getRuleContexts(PrefixUnaryOperatorContext.class);
}
public PrefixUnaryOperatorContext prefixUnaryOperator(int i) {
return getRuleContext(PrefixUnaryOperatorContext.class,i);
}
public List annotations() {
return getRuleContexts(AnnotationsContext.class);
}
public AnnotationsContext annotations(int i) {
return getRuleContext(AnnotationsContext.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, 138, RULE_prefixUnaryExpression);
int _la;
try {
int _alt;
setState(1699);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,251,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1688);
_errHandler.sync(this);
_la = _input.LA(1);
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << EXCL))) != 0)) {
{
{
setState(1685);
prefixUnaryOperator();
}
}
setState(1690);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1691);
postfixUnaryExpression();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1695);
_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(1692);
annotations();
}
}
}
setState(1697);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,250,_ctx);
}
setState(1698);
postfixUnaryExpression();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PostfixUnaryExpressionContext extends ParserRuleContext {
public AssignableExpressionContext assignableExpression() {
return getRuleContext(AssignableExpressionContext.class,0);
}
public CallExpressionContext callExpression() {
return getRuleContext(CallExpressionContext.class,0);
}
public LabeledExpressionContext labeledExpression() {
return getRuleContext(LabeledExpressionContext.class,0);
}
public DotQualifiedExpressionContext dotQualifiedExpression() {
return getRuleContext(DotQualifiedExpressionContext.class,0);
}
public List postfixUnaryOperator() {
return getRuleContexts(PostfixUnaryOperatorContext.class);
}
public PostfixUnaryOperatorContext postfixUnaryOperator(int i) {
return getRuleContext(PostfixUnaryOperatorContext.class,i);
}
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public CallableReferenceContext callableReference() {
return getRuleContext(CallableReferenceContext.class,0);
}
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
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, 140, RULE_postfixUnaryExpression);
try {
int _alt;
setState(1721);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,254,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1701);
assignableExpression();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1702);
callExpression();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(1703);
labeledExpression();
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
setState(1704);
dotQualifiedExpression();
}
break;
case 5:
enterOuterAlt(_localctx, 5);
{
setState(1705);
assignableExpression();
setState(1709);
_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(1706);
postfixUnaryOperator();
}
}
}
setState(1711);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,252,_ctx);
}
}
break;
case 6:
enterOuterAlt(_localctx, 6);
{
setState(1712);
match(LPAREN);
setState(1713);
callableReference();
setState(1714);
match(RPAREN);
setState(1716);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(1715);
postfixUnaryOperator();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(1718);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,253,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
}
break;
case 7:
enterOuterAlt(_localctx, 7);
{
setState(1720);
callableReference();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class CallExpressionContext extends ParserRuleContext {
public AssignableExpressionContext assignableExpression() {
return getRuleContext(AssignableExpressionContext.class,0);
}
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 CallExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_callExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterCallExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitCallExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitCallExpression(this);
else return visitor.visitChildren(this);
}
}
public final CallExpressionContext callExpression() throws RecognitionException {
CallExpressionContext _localctx = new CallExpressionContext(_ctx, getState());
enterRule(_localctx, 142, RULE_callExpression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1723);
assignableExpression();
setState(1725);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,255,_ctx) ) {
case 1:
{
setState(1724);
typeArguments();
}
break;
}
setState(1728);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,256,_ctx) ) {
case 1:
{
setState(1727);
valueArguments();
}
break;
}
setState(1733);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,257,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1730);
annotatedLambda();
}
}
}
setState(1735);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,257,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class LabeledExpressionContext extends ParserRuleContext {
public LabelDefinitionContext labelDefinition() {
return getRuleContext(LabelDefinitionContext.class,0);
}
public PostfixUnaryExpressionContext postfixUnaryExpression() {
return getRuleContext(PostfixUnaryExpressionContext.class,0);
}
public LabeledExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_labeledExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterLabeledExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitLabeledExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitLabeledExpression(this);
else return visitor.visitChildren(this);
}
}
public final LabeledExpressionContext labeledExpression() throws RecognitionException {
LabeledExpressionContext _localctx = new LabeledExpressionContext(_ctx, getState());
enterRule(_localctx, 144, RULE_labeledExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(1736);
labelDefinition();
setState(1737);
postfixUnaryExpression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class DotQualifiedExpressionContext extends ParserRuleContext {
public AssignableExpressionContext assignableExpression() {
return getRuleContext(AssignableExpressionContext.class,0);
}
public List memberAccessOperator() {
return getRuleContexts(MemberAccessOperatorContext.class);
}
public MemberAccessOperatorContext memberAccessOperator(int i) {
return getRuleContext(MemberAccessOperatorContext.class,i);
}
public List postfixUnaryExpression() {
return getRuleContexts(PostfixUnaryExpressionContext.class);
}
public PostfixUnaryExpressionContext postfixUnaryExpression(int i) {
return getRuleContext(PostfixUnaryExpressionContext.class,i);
}
public List NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
public DotQualifiedExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_dotQualifiedExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterDotQualifiedExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitDotQualifiedExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitDotQualifiedExpression(this);
else return visitor.visitChildren(this);
}
}
public final DotQualifiedExpressionContext dotQualifiedExpression() throws RecognitionException {
DotQualifiedExpressionContext _localctx = new DotQualifiedExpressionContext(_ctx, getState());
enterRule(_localctx, 146, RULE_dotQualifiedExpression);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1739);
assignableExpression();
setState(1749);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(1743);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1740);
match(NL);
}
}
setState(1745);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1746);
memberAccessOperator();
setState(1747);
postfixUnaryExpression();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(1751);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,259,_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;
}
public static class AssignableExpressionContext extends ParserRuleContext {
public PrimaryExpressionContext primaryExpression() {
return getRuleContext(PrimaryExpressionContext.class,0);
}
public IndexingExpressionContext indexingExpression() {
return getRuleContext(IndexingExpressionContext.class,0);
}
public AssignableExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_assignableExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterAssignableExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitAssignableExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitAssignableExpression(this);
else return visitor.visitChildren(this);
}
}
public final AssignableExpressionContext assignableExpression() throws RecognitionException {
AssignableExpressionContext _localctx = new AssignableExpressionContext(_ctx, getState());
enterRule(_localctx, 148, RULE_assignableExpression);
try {
setState(1755);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,260,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1753);
primaryExpression();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1754);
indexingExpression();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class IndexingExpressionContext extends ParserRuleContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public List arrayAccess() {
return getRuleContexts(ArrayAccessContext.class);
}
public ArrayAccessContext arrayAccess(int i) {
return getRuleContext(ArrayAccessContext.class,i);
}
public IndexingExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_indexingExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterIndexingExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitIndexingExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitIndexingExpression(this);
else return visitor.visitChildren(this);
}
}
public final IndexingExpressionContext indexingExpression() throws RecognitionException {
IndexingExpressionContext _localctx = new IndexingExpressionContext(_ctx, getState());
enterRule(_localctx, 150, RULE_indexingExpression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1757);
identifier();
setState(1759);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(1758);
arrayAccess();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(1761);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,261,_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;
}
public static class CallSuffixContext extends ParserRuleContext {
public ValueArgumentsContext valueArguments() {
return getRuleContext(ValueArgumentsContext.class,0);
}
public TypeArgumentsContext typeArguments() {
return getRuleContext(TypeArgumentsContext.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, 152, RULE_callSuffix);
int _la;
try {
int _alt;
setState(1780);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,265,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1764);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LANGLE) {
{
setState(1763);
typeArguments();
}
}
setState(1766);
valueArguments();
setState(1770);
_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(1767);
annotatedLambda();
}
}
}
setState(1772);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,263,_ctx);
}
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1773);
typeArguments();
setState(1777);
_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(1774);
annotatedLambda();
}
}
}
setState(1779);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,264,_ctx);
}
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 154, RULE_annotatedLambda);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1785);
_errHandler.sync(this);
_la = _input.LA(1);
while (((((_la - 58)) & ~0x3f) == 0 && ((1L << (_la - 58)) & ((1L << (IMPORT - 58)) | (1L << (CONSTRUCTOR - 58)) | (1L << (BY - 58)) | (1L << (COMPANION - 58)) | (1L << (INIT - 58)) | (1L << (WHERE - 58)) | (1L << (CATCH - 58)) | (1L << (FINALLY - 58)) | (1L << (OUT - 58)) | (1L << (GETTER - 58)) | (1L << (SETTER - 58)) | (1L << (DYNAMIC - 58)) | (1L << (PUBLIC - 58)) | (1L << (PRIVATE - 58)) | (1L << (PROTECTED - 58)) | (1L << (INTERNAL - 58)) | (1L << (ENUM - 58)) | (1L << (SEALED - 58)) | (1L << (ANNOTATION - 58)) | (1L << (DATA - 58)) | (1L << (INNER - 58)) | (1L << (TAILREC - 58)) | (1L << (OPERATOR - 58)) | (1L << (INLINE - 58)) | (1L << (INFIX - 58)) | (1L << (EXTERNAL - 58)) | (1L << (SUSPEND - 58)) | (1L << (OVERRIDE - 58)) | (1L << (ABSTRACT - 58)) | (1L << (FINAL - 58)))) != 0) || ((((_la - 122)) & ~0x3f) == 0 && ((1L << (_la - 122)) & ((1L << (OPEN - 122)) | (1L << (CONST - 122)) | (1L << (LATEINIT - 122)) | (1L << (VARARG - 122)) | (1L << (NOINLINE - 122)) | (1L << (CROSSINLINE - 122)) | (1L << (REIFIED - 122)) | (1L << (Identifier - 122)))) != 0)) {
{
{
setState(1782);
unescapedAnnotation();
}
}
setState(1787);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1789);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LabelDefinition) {
{
setState(1788);
match(LabelDefinition);
}
}
setState(1794);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1791);
match(NL);
}
}
setState(1796);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1797);
functionLiteral();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 156, RULE_arrayAccess);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1799);
match(LSQUARE);
setState(1808);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NL) | (1L << LPAREN) | (1L << LSQUARE) | (1L << LCURL) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << EXCL) | (1L << COLONCOLON) | (1L << Q_COLONCOLON) | (1L << AT) | (1L << RETURN_AT) | (1L << CONTINUE_AT) | (1L << BREAK_AT) | (1L << FILE) | (1L << IMPORT) | (1L << OBJECT))) != 0) || ((((_la - 66)) & ~0x3f) == 0 && ((1L << (_la - 66)) & ((1L << (CONSTRUCTOR - 66)) | (1L << (BY - 66)) | (1L << (COMPANION - 66)) | (1L << (INIT - 66)) | (1L << (THIS - 66)) | (1L << (SUPER - 66)) | (1L << (WHERE - 66)) | (1L << (IF - 66)) | (1L << (WHEN - 66)) | (1L << (TRY - 66)) | (1L << (CATCH - 66)) | (1L << (FINALLY - 66)) | (1L << (FOR - 66)) | (1L << (DO - 66)) | (1L << (WHILE - 66)) | (1L << (THROW - 66)) | (1L << (RETURN - 66)) | (1L << (CONTINUE - 66)) | (1L << (BREAK - 66)) | (1L << (OUT - 66)) | (1L << (FIELD - 66)) | (1L << (PROPERTY - 66)) | (1L << (GET - 66)) | (1L << (SET - 66)) | (1L << (GETTER - 66)) | (1L << (SETTER - 66)) | (1L << (RECEIVER - 66)) | (1L << (PARAM - 66)) | (1L << (SETPARAM - 66)) | (1L << (DELEGATE - 66)) | (1L << (DYNAMIC - 66)) | (1L << (PUBLIC - 66)) | (1L << (PRIVATE - 66)) | (1L << (PROTECTED - 66)) | (1L << (INTERNAL - 66)) | (1L << (ENUM - 66)) | (1L << (SEALED - 66)) | (1L << (ANNOTATION - 66)) | (1L << (DATA - 66)) | (1L << (INNER - 66)) | (1L << (TAILREC - 66)) | (1L << (OPERATOR - 66)) | (1L << (INLINE - 66)) | (1L << (INFIX - 66)) | (1L << (EXTERNAL - 66)) | (1L << (SUSPEND - 66)) | (1L << (OVERRIDE - 66)) | (1L << (ABSTRACT - 66)) | (1L << (FINAL - 66)) | (1L << (OPEN - 66)) | (1L << (CONST - 66)) | (1L << (LATEINIT - 66)) | (1L << (VARARG - 66)) | (1L << (NOINLINE - 66)) | (1L << (CROSSINLINE - 66)) | (1L << (REIFIED - 66)) | (1L << (QUOTE_OPEN - 66)))) != 0) || ((((_la - 130)) & ~0x3f) == 0 && ((1L << (_la - 130)) & ((1L << (TRIPLE_QUOTE_OPEN - 130)) | (1L << (RealLiteral - 130)) | (1L << (LongLiteral - 130)) | (1L << (IntegerLiteral - 130)) | (1L << (HexLiteral - 130)) | (1L << (BinLiteral - 130)) | (1L << (BooleanLiteral - 130)) | (1L << (NullLiteral - 130)) | (1L << (Identifier - 130)) | (1L << (LabelReference - 130)) | (1L << (LabelDefinition - 130)) | (1L << (CharacterLiteral - 130)))) != 0)) {
{
setState(1800);
expression();
setState(1805);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1801);
match(COMMA);
setState(1802);
expression();
}
}
setState(1807);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1810);
match(RSQUARE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ValueArgumentsContext extends ParserRuleContext {
public TerminalNode LPAREN() { return getToken(KotlinParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(KotlinParser.RPAREN, 0); }
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, 158, RULE_valueArguments);
int _la;
try {
setState(1828);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,273,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1812);
match(LPAREN);
setState(1814);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NL) | (1L << LPAREN) | (1L << LSQUARE) | (1L << LCURL) | (1L << MULT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << EXCL) | (1L << COLONCOLON) | (1L << Q_COLONCOLON) | (1L << AT) | (1L << RETURN_AT) | (1L << CONTINUE_AT) | (1L << BREAK_AT) | (1L << FILE) | (1L << IMPORT) | (1L << OBJECT))) != 0) || ((((_la - 66)) & ~0x3f) == 0 && ((1L << (_la - 66)) & ((1L << (CONSTRUCTOR - 66)) | (1L << (BY - 66)) | (1L << (COMPANION - 66)) | (1L << (INIT - 66)) | (1L << (THIS - 66)) | (1L << (SUPER - 66)) | (1L << (WHERE - 66)) | (1L << (IF - 66)) | (1L << (WHEN - 66)) | (1L << (TRY - 66)) | (1L << (CATCH - 66)) | (1L << (FINALLY - 66)) | (1L << (FOR - 66)) | (1L << (DO - 66)) | (1L << (WHILE - 66)) | (1L << (THROW - 66)) | (1L << (RETURN - 66)) | (1L << (CONTINUE - 66)) | (1L << (BREAK - 66)) | (1L << (OUT - 66)) | (1L << (FIELD - 66)) | (1L << (PROPERTY - 66)) | (1L << (GET - 66)) | (1L << (SET - 66)) | (1L << (GETTER - 66)) | (1L << (SETTER - 66)) | (1L << (RECEIVER - 66)) | (1L << (PARAM - 66)) | (1L << (SETPARAM - 66)) | (1L << (DELEGATE - 66)) | (1L << (DYNAMIC - 66)) | (1L << (PUBLIC - 66)) | (1L << (PRIVATE - 66)) | (1L << (PROTECTED - 66)) | (1L << (INTERNAL - 66)) | (1L << (ENUM - 66)) | (1L << (SEALED - 66)) | (1L << (ANNOTATION - 66)) | (1L << (DATA - 66)) | (1L << (INNER - 66)) | (1L << (TAILREC - 66)) | (1L << (OPERATOR - 66)) | (1L << (INLINE - 66)) | (1L << (INFIX - 66)) | (1L << (EXTERNAL - 66)) | (1L << (SUSPEND - 66)) | (1L << (OVERRIDE - 66)) | (1L << (ABSTRACT - 66)) | (1L << (FINAL - 66)) | (1L << (OPEN - 66)) | (1L << (CONST - 66)) | (1L << (LATEINIT - 66)) | (1L << (VARARG - 66)) | (1L << (NOINLINE - 66)) | (1L << (CROSSINLINE - 66)) | (1L << (REIFIED - 66)) | (1L << (QUOTE_OPEN - 66)))) != 0) || ((((_la - 130)) & ~0x3f) == 0 && ((1L << (_la - 130)) & ((1L << (TRIPLE_QUOTE_OPEN - 130)) | (1L << (RealLiteral - 130)) | (1L << (LongLiteral - 130)) | (1L << (IntegerLiteral - 130)) | (1L << (HexLiteral - 130)) | (1L << (BinLiteral - 130)) | (1L << (BooleanLiteral - 130)) | (1L << (NullLiteral - 130)) | (1L << (Identifier - 130)) | (1L << (LabelReference - 130)) | (1L << (LabelDefinition - 130)) | (1L << (CharacterLiteral - 130)))) != 0)) {
{
setState(1813);
valueArgument();
}
}
setState(1816);
match(RPAREN);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1817);
match(LPAREN);
setState(1818);
valueArgument();
setState(1823);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1819);
match(COMMA);
setState(1820);
valueArgument();
}
}
setState(1825);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1826);
match(RPAREN);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 160, RULE_typeArguments);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1830);
match(LANGLE);
setState(1834);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1831);
match(NL);
}
}
setState(1836);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1837);
typeProjection();
setState(1848);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,276,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1841);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1838);
match(NL);
}
}
setState(1843);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1844);
match(COMMA);
setState(1845);
typeProjection();
}
}
}
setState(1850);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,276,_ctx);
}
setState(1854);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1851);
match(NL);
}
}
setState(1856);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1857);
match(RANGLE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 162, RULE_typeProjection);
try {
setState(1864);
_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(1860);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,278,_ctx) ) {
case 1:
{
setState(1859);
typeProjectionModifierList();
}
break;
}
setState(1862);
type();
}
break;
case MULT:
enterOuterAlt(_localctx, 2);
{
setState(1863);
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;
}
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, 164, RULE_typeProjectionModifierList);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1867);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(1866);
varianceAnnotation();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(1869);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,280,_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;
}
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, 166, RULE_valueArgument);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1885);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,283,_ctx) ) {
case 1:
{
setState(1871);
simpleIdentifier();
setState(1875);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1872);
match(NL);
}
}
setState(1877);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1878);
match(ASSIGNMENT);
setState(1882);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,282,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1879);
match(NL);
}
}
}
setState(1884);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,282,_ctx);
}
}
break;
}
setState(1888);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==MULT) {
{
setState(1887);
match(MULT);
}
}
setState(1893);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,285,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1890);
match(NL);
}
}
}
setState(1895);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,285,_ctx);
}
setState(1896);
expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PrimaryExpressionContext extends ParserRuleContext {
public ParenthesizedExpressionContext parenthesizedExpression() {
return getRuleContext(ParenthesizedExpressionContext.class,0);
}
public LiteralConstantContext literalConstant() {
return getRuleContext(LiteralConstantContext.class,0);
}
public StringLiteralContext stringLiteral() {
return getRuleContext(StringLiteralContext.class,0);
}
public SimpleIdentifierContext simpleIdentifier() {
return getRuleContext(SimpleIdentifierContext.class,0);
}
public FunctionLiteralContext functionLiteral() {
return getRuleContext(FunctionLiteralContext.class,0);
}
public ObjectLiteralContext objectLiteral() {
return getRuleContext(ObjectLiteralContext.class,0);
}
public CollectionLiteralContext collectionLiteral() {
return getRuleContext(CollectionLiteralContext.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 LoopExpressionContext loopExpression() {
return getRuleContext(LoopExpressionContext.class,0);
}
public JumpExpressionContext jumpExpression() {
return getRuleContext(JumpExpressionContext.class,0);
}
public PrimaryExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_primaryExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).enterPrimaryExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof KotlinParserListener ) ((KotlinParserListener)listener).exitPrimaryExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof KotlinParserVisitor ) return ((KotlinParserVisitor extends T>)visitor).visitPrimaryExpression(this);
else return visitor.visitChildren(this);
}
}
public final PrimaryExpressionContext primaryExpression() throws RecognitionException {
PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState());
enterRule(_localctx, 168, RULE_primaryExpression);
try {
setState(1911);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LPAREN:
enterOuterAlt(_localctx, 1);
{
setState(1898);
parenthesizedExpression();
}
break;
case RealLiteral:
case LongLiteral:
case IntegerLiteral:
case HexLiteral:
case BinLiteral:
case BooleanLiteral:
case NullLiteral:
case CharacterLiteral:
enterOuterAlt(_localctx, 2);
{
setState(1899);
literalConstant();
}
break;
case QUOTE_OPEN:
case TRIPLE_QUOTE_OPEN:
enterOuterAlt(_localctx, 3);
{
setState(1900);
stringLiteral();
}
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, 4);
{
setState(1901);
simpleIdentifier();
}
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, 5);
{
setState(1902);
functionLiteral();
}
break;
case OBJECT:
enterOuterAlt(_localctx, 6);
{
setState(1903);
objectLiteral();
}
break;
case LSQUARE:
enterOuterAlt(_localctx, 7);
{
setState(1904);
collectionLiteral();
}
break;
case THIS:
enterOuterAlt(_localctx, 8);
{
setState(1905);
thisExpression();
}
break;
case SUPER:
enterOuterAlt(_localctx, 9);
{
setState(1906);
superExpression();
}
break;
case IF:
case WHEN:
enterOuterAlt(_localctx, 10);
{
setState(1907);
conditionalExpression();
}
break;
case TRY:
enterOuterAlt(_localctx, 11);
{
setState(1908);
tryExpression();
}
break;
case FOR:
case DO:
case WHILE:
enterOuterAlt(_localctx, 12);
{
setState(1909);
loopExpression();
}
break;
case RETURN_AT:
case CONTINUE_AT:
case BREAK_AT:
case THROW:
case RETURN:
case CONTINUE:
case BREAK:
enterOuterAlt(_localctx, 13);
{
setState(1910);
jumpExpression();
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 170, RULE_parenthesizedExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(1913);
match(LPAREN);
setState(1914);
expression();
setState(1915);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class LiteralConstantContext extends ParserRuleContext {
public TerminalNode BooleanLiteral() { return getToken(KotlinParser.BooleanLiteral, 0); }
public TerminalNode IntegerLiteral() { return getToken(KotlinParser.IntegerLiteral, 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, 172, RULE_literalConstant);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1917);
_la = _input.LA(1);
if ( !(((((_la - 131)) & ~0x3f) == 0 && ((1L << (_la - 131)) & ((1L << (RealLiteral - 131)) | (1L << (LongLiteral - 131)) | (1L << (IntegerLiteral - 131)) | (1L << (HexLiteral - 131)) | (1L << (BinLiteral - 131)) | (1L << (BooleanLiteral - 131)) | (1L << (NullLiteral - 131)) | (1L << (CharacterLiteral - 131)))) != 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;
}
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, 174, RULE_stringLiteral);
try {
setState(1921);
_errHandler.sync(this);
switch (_input.LA(1)) {
case QUOTE_OPEN:
enterOuterAlt(_localctx, 1);
{
setState(1919);
lineStringLiteral();
}
break;
case TRIPLE_QUOTE_OPEN:
enterOuterAlt(_localctx, 2);
{
setState(1920);
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;
}
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, 176, RULE_lineStringLiteral);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1923);
match(QUOTE_OPEN);
setState(1928);
_errHandler.sync(this);
_la = _input.LA(1);
while (((((_la - 156)) & ~0x3f) == 0 && ((1L << (_la - 156)) & ((1L << (LineStrRef - 156)) | (1L << (LineStrText - 156)) | (1L << (LineStrEscapedChar - 156)) | (1L << (LineStrExprStart - 156)))) != 0)) {
{
setState(1926);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LineStrRef:
case LineStrText:
case LineStrEscapedChar:
{
setState(1924);
lineStringContent();
}
break;
case LineStrExprStart:
{
setState(1925);
lineStringExpression();
}
break;
default:
throw new NoViableAltException(this);
}
}
setState(1930);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1931);
match(QUOTE_CLOSE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 178, RULE_multiLineStringLiteral);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1933);
match(TRIPLE_QUOTE_OPEN);
setState(1940);
_errHandler.sync(this);
_la = _input.LA(1);
while (((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & ((1L << (QUOTE_OPEN - 129)) | (1L << (MultiLineStringQuote - 129)) | (1L << (MultiLineStrRef - 129)) | (1L << (MultiLineStrText - 129)) | (1L << (MultiLineStrEscapedChar - 129)) | (1L << (MultiLineStrExprStart - 129)))) != 0)) {
{
setState(1938);
_errHandler.sync(this);
switch (_input.LA(1)) {
case MultiLineStrRef:
case MultiLineStrText:
case MultiLineStrEscapedChar:
{
setState(1934);
multiLineStringContent();
}
break;
case MultiLineStrExprStart:
{
setState(1935);
multiLineStringExpression();
}
break;
case QUOTE_OPEN:
{
setState(1936);
lineStringLiteral();
}
break;
case MultiLineStringQuote:
{
setState(1937);
match(MultiLineStringQuote);
}
break;
default:
throw new NoViableAltException(this);
}
}
setState(1942);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1943);
match(TRIPLE_QUOTE_CLOSE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 180, RULE_lineStringContent);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1945);
_la = _input.LA(1);
if ( !(((((_la - 156)) & ~0x3f) == 0 && ((1L << (_la - 156)) & ((1L << (LineStrRef - 156)) | (1L << (LineStrText - 156)) | (1L << (LineStrEscapedChar - 156)))) != 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;
}
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, 182, RULE_lineStringExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(1947);
match(LineStrExprStart);
setState(1948);
expression();
setState(1949);
match(RCURL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 184, RULE_multiLineStringContent);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1951);
_la = _input.LA(1);
if ( !(((((_la - 162)) & ~0x3f) == 0 && ((1L << (_la - 162)) & ((1L << (MultiLineStrRef - 162)) | (1L << (MultiLineStrText - 162)) | (1L << (MultiLineStrEscapedChar - 162)))) != 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;
}
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, 186, RULE_multiLineStringExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(1953);
match(MultiLineStrExprStart);
setState(1954);
expression();
setState(1955);
match(RCURL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 188, RULE_functionLiteral);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1960);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AT || _la==FILE || ((((_la - 93)) & ~0x3f) == 0 && ((1L << (_la - 93)) & ((1L << (FIELD - 93)) | (1L << (PROPERTY - 93)) | (1L << (GET - 93)) | (1L << (SET - 93)) | (1L << (RECEIVER - 93)) | (1L << (PARAM - 93)) | (1L << (SETPARAM - 93)) | (1L << (DELEGATE - 93)) | (1L << (LabelReference - 93)))) != 0)) {
{
{
setState(1957);
annotations();
}
}
setState(1962);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2009);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,299,_ctx) ) {
case 1:
{
setState(1963);
match(LCURL);
setState(1967);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,293,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1964);
match(NL);
}
}
}
setState(1969);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,293,_ctx);
}
setState(1970);
statements();
setState(1974);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1971);
match(NL);
}
}
setState(1976);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1977);
match(RCURL);
}
break;
case 2:
{
setState(1979);
match(LCURL);
setState(1983);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,295,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1980);
match(NL);
}
}
}
setState(1985);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,295,_ctx);
}
setState(1986);
lambdaParameters();
setState(1990);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(1987);
match(NL);
}
}
setState(1992);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1993);
match(ARROW);
setState(1997);
_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(1994);
match(NL);
}
}
}
setState(1999);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,297,_ctx);
}
setState(2000);
statements();
setState(2004);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2001);
match(NL);
}
}
setState(2006);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2007);
match(RCURL);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 190, RULE_lambdaParameters);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(2012);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LPAREN || _la==IMPORT || ((((_la - 66)) & ~0x3f) == 0 && ((1L << (_la - 66)) & ((1L << (CONSTRUCTOR - 66)) | (1L << (BY - 66)) | (1L << (COMPANION - 66)) | (1L << (INIT - 66)) | (1L << (WHERE - 66)) | (1L << (CATCH - 66)) | (1L << (FINALLY - 66)) | (1L << (OUT - 66)) | (1L << (GETTER - 66)) | (1L << (SETTER - 66)) | (1L << (DYNAMIC - 66)) | (1L << (PUBLIC - 66)) | (1L << (PRIVATE - 66)) | (1L << (PROTECTED - 66)) | (1L << (INTERNAL - 66)) | (1L << (ENUM - 66)) | (1L << (SEALED - 66)) | (1L << (ANNOTATION - 66)) | (1L << (DATA - 66)) | (1L << (INNER - 66)) | (1L << (TAILREC - 66)) | (1L << (OPERATOR - 66)) | (1L << (INLINE - 66)) | (1L << (INFIX - 66)) | (1L << (EXTERNAL - 66)) | (1L << (SUSPEND - 66)) | (1L << (OVERRIDE - 66)) | (1L << (ABSTRACT - 66)) | (1L << (FINAL - 66)) | (1L << (OPEN - 66)) | (1L << (CONST - 66)) | (1L << (LATEINIT - 66)) | (1L << (VARARG - 66)) | (1L << (NOINLINE - 66)) | (1L << (CROSSINLINE - 66)) | (1L << (REIFIED - 66)))) != 0) || _la==Identifier) {
{
setState(2011);
lambdaParameter();
}
}
setState(2030);
_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(2017);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2014);
match(NL);
}
}
setState(2019);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2020);
match(COMMA);
setState(2024);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2021);
match(NL);
}
}
setState(2026);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2027);
lambdaParameter();
}
}
}
setState(2032);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,303,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 192, RULE_lambdaParameter);
int _la;
try {
setState(2051);
_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(2033);
variableDeclaration();
}
break;
case LPAREN:
enterOuterAlt(_localctx, 2);
{
setState(2034);
multiVariableDeclaration();
setState(2049);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,306,_ctx) ) {
case 1:
{
setState(2038);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2035);
match(NL);
}
}
setState(2040);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2041);
match(COLON);
setState(2045);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2042);
match(NL);
}
}
setState(2047);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2048);
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;
}
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, 194, RULE_objectLiteral);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(2053);
match(OBJECT);
setState(2068);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,310,_ctx) ) {
case 1:
{
setState(2057);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2054);
match(NL);
}
}
setState(2059);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2060);
match(COLON);
setState(2064);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2061);
match(NL);
}
}
setState(2066);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2067);
delegationSpecifiers();
}
break;
}
setState(2073);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2070);
match(NL);
}
}
setState(2075);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2076);
classBody();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 196, RULE_collectionLiteral);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(2078);
match(LSQUARE);
setState(2080);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NL) | (1L << LPAREN) | (1L << LSQUARE) | (1L << LCURL) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << EXCL) | (1L << COLONCOLON) | (1L << Q_COLONCOLON) | (1L << AT) | (1L << RETURN_AT) | (1L << CONTINUE_AT) | (1L << BREAK_AT) | (1L << FILE) | (1L << IMPORT) | (1L << OBJECT))) != 0) || ((((_la - 66)) & ~0x3f) == 0 && ((1L << (_la - 66)) & ((1L << (CONSTRUCTOR - 66)) | (1L << (BY - 66)) | (1L << (COMPANION - 66)) | (1L << (INIT - 66)) | (1L << (THIS - 66)) | (1L << (SUPER - 66)) | (1L << (WHERE - 66)) | (1L << (IF - 66)) | (1L << (WHEN - 66)) | (1L << (TRY - 66)) | (1L << (CATCH - 66)) | (1L << (FINALLY - 66)) | (1L << (FOR - 66)) | (1L << (DO - 66)) | (1L << (WHILE - 66)) | (1L << (THROW - 66)) | (1L << (RETURN - 66)) | (1L << (CONTINUE - 66)) | (1L << (BREAK - 66)) | (1L << (OUT - 66)) | (1L << (FIELD - 66)) | (1L << (PROPERTY - 66)) | (1L << (GET - 66)) | (1L << (SET - 66)) | (1L << (GETTER - 66)) | (1L << (SETTER - 66)) | (1L << (RECEIVER - 66)) | (1L << (PARAM - 66)) | (1L << (SETPARAM - 66)) | (1L << (DELEGATE - 66)) | (1L << (DYNAMIC - 66)) | (1L << (PUBLIC - 66)) | (1L << (PRIVATE - 66)) | (1L << (PROTECTED - 66)) | (1L << (INTERNAL - 66)) | (1L << (ENUM - 66)) | (1L << (SEALED - 66)) | (1L << (ANNOTATION - 66)) | (1L << (DATA - 66)) | (1L << (INNER - 66)) | (1L << (TAILREC - 66)) | (1L << (OPERATOR - 66)) | (1L << (INLINE - 66)) | (1L << (INFIX - 66)) | (1L << (EXTERNAL - 66)) | (1L << (SUSPEND - 66)) | (1L << (OVERRIDE - 66)) | (1L << (ABSTRACT - 66)) | (1L << (FINAL - 66)) | (1L << (OPEN - 66)) | (1L << (CONST - 66)) | (1L << (LATEINIT - 66)) | (1L << (VARARG - 66)) | (1L << (NOINLINE - 66)) | (1L << (CROSSINLINE - 66)) | (1L << (REIFIED - 66)) | (1L << (QUOTE_OPEN - 66)))) != 0) || ((((_la - 130)) & ~0x3f) == 0 && ((1L << (_la - 130)) & ((1L << (TRIPLE_QUOTE_OPEN - 130)) | (1L << (RealLiteral - 130)) | (1L << (LongLiteral - 130)) | (1L << (IntegerLiteral - 130)) | (1L << (HexLiteral - 130)) | (1L << (BinLiteral - 130)) | (1L << (BooleanLiteral - 130)) | (1L << (NullLiteral - 130)) | (1L << (Identifier - 130)) | (1L << (LabelReference - 130)) | (1L << (LabelDefinition - 130)) | (1L << (CharacterLiteral - 130)))) != 0)) {
{
setState(2079);
expression();
}
}
setState(2086);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(2082);
match(COMMA);
setState(2083);
expression();
}
}
setState(2088);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2089);
match(RSQUARE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 198, RULE_thisExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(2091);
match(THIS);
setState(2093);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,314,_ctx) ) {
case 1:
{
setState(2092);
match(LabelReference);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 200, RULE_superExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(2095);
match(SUPER);
setState(2112);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,317,_ctx) ) {
case 1:
{
setState(2096);
match(LANGLE);
setState(2100);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2097);
match(NL);
}
}
setState(2102);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2103);
type();
setState(2107);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2104);
match(NL);
}
}
setState(2109);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2110);
match(RANGLE);
}
break;
}
setState(2115);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,318,_ctx) ) {
case 1:
{
setState(2114);
match(LabelReference);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 202, RULE_conditionalExpression);
try {
setState(2119);
_errHandler.sync(this);
switch (_input.LA(1)) {
case IF:
enterOuterAlt(_localctx, 1);
{
setState(2117);
ifExpression();
}
break;
case WHEN:
enterOuterAlt(_localctx, 2);
{
setState(2118);
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;
}
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, 204, RULE_ifExpression);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(2121);
match(IF);
setState(2125);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2122);
match(NL);
}
}
setState(2127);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2128);
match(LPAREN);
setState(2129);
expression();
setState(2130);
match(RPAREN);
setState(2134);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,321,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(2131);
match(NL);
}
}
}
setState(2136);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,321,_ctx);
}
setState(2138);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,322,_ctx) ) {
case 1:
{
setState(2137);
controlStructureBody();
}
break;
}
setState(2141);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,323,_ctx) ) {
case 1:
{
setState(2140);
match(SEMICOLON);
}
break;
}
setState(2159);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,327,_ctx) ) {
case 1:
{
setState(2146);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==NL) {
{
{
setState(2143);
match(NL);
}
}
setState(2148);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(2149);
match(ELSE);
setState(2153);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,325,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(2150);
match(NL);
}
}
}
setState(2155);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,325,_ctx);
}
setState(2157);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,326,_ctx) ) {
case 1:
{
setState(2156);
controlStructureBody();
}
break;
}
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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, 206, RULE_controlStructureBody);
try {
setState(2163);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,328,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(2161);
block();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(2162);
expression();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
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 NL() { return getTokens(KotlinParser.NL); }
public TerminalNode NL(int i) {
return getToken(KotlinParser.NL, i);
}
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