-
-
Save josejulio/8a7959ef6f7c646b88cd03bb24bf0ad6 to your computer and use it in GitHub Desktop.
Result of Minescripten.g4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated from Minescripten.g4 by ANTLR 4.7.3-SNAPSHOT | |
import { ATN } from "antlr4ts/atn/ATN"; | |
import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; | |
import { CharStream } from "antlr4ts/CharStream"; | |
import { Lexer } from "antlr4ts/Lexer"; | |
import { LexerATNSimulator } from "antlr4ts/atn/LexerATNSimulator"; | |
import { NotNull } from "antlr4ts/Decorators"; | |
import { Override } from "antlr4ts/Decorators"; | |
import { RuleContext } from "antlr4ts/RuleContext"; | |
import { Vocabulary } from "antlr4ts/Vocabulary"; | |
import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; | |
import * as Utils from "antlr4ts/misc/Utils"; | |
export class MinescriptenLexer extends Lexer { | |
public static readonly T__0 = 1; | |
public static readonly T__1 = 2; | |
public static readonly T__2 = 3; | |
public static readonly T__3 = 4; | |
public static readonly T__4 = 5; | |
public static readonly T__5 = 6; | |
public static readonly T__6 = 7; | |
public static readonly T__7 = 8; | |
public static readonly T__8 = 9; | |
public static readonly T__9 = 10; | |
public static readonly T__10 = 11; | |
public static readonly T__11 = 12; | |
public static readonly T__12 = 13; | |
public static readonly StringLiteral = 14; | |
public static readonly IntegerLiteral = 15; | |
public static readonly BooleanLiteral = 16; | |
public static readonly Identifier = 17; | |
public static readonly WS = 18; | |
// tslint:disable:no-trailing-whitespace | |
public static readonly channelNames: string[] = [ | |
"DEFAULT_TOKEN_CHANNEL", "HIDDEN", | |
]; | |
// tslint:disable:no-trailing-whitespace | |
public static readonly modeNames: string[] = [ | |
"DEFAULT_MODE", | |
]; | |
public static readonly ruleNames: string[] = [ | |
"T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", | |
"T__9", "T__10", "T__11", "T__12", "StringLiteral", "IntegerLiteral", | |
"BooleanLiteral", "Identifier", "EscapeSequence", "UnicodeEscapeSequence", | |
"Letter", "LetterOrDigit", "StringCharacter", "Digit", "HexDigit", "WS", | |
]; | |
private static readonly _LITERAL_NAMES: Array<string | undefined> = [ | |
undefined, "'fn'", "'('", "','", "')'", "'->'", "'{'", "'}'", "':'", "'struct'", | |
"';'", "'let'", "'='", "'.'", | |
]; | |
private static readonly _SYMBOLIC_NAMES: Array<string | undefined> = [ | |
undefined, undefined, undefined, undefined, undefined, undefined, undefined, | |
undefined, undefined, undefined, undefined, undefined, undefined, undefined, | |
"StringLiteral", "IntegerLiteral", "BooleanLiteral", "Identifier", "WS", | |
]; | |
public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(MinescriptenLexer._LITERAL_NAMES, MinescriptenLexer._SYMBOLIC_NAMES, []); | |
// @Override | |
// @NotNull | |
public get vocabulary(): Vocabulary { | |
return MinescriptenLexer.VOCABULARY; | |
} | |
// tslint:enable:no-trailing-whitespace | |
constructor(input: CharStream) { | |
super(input); | |
this._interp = new LexerATNSimulator(MinescriptenLexer._ATN, this); | |
} | |
// @Override | |
public get grammarFileName(): string { return "Minescripten.g4"; } | |
// @Override | |
public get ruleNames(): string[] { return MinescriptenLexer.ruleNames; } | |
// @Override | |
public readonly serializedATN = MinescriptenLexer._serializedATN; | |
// @Override | |
public get channelNames(): string[] { return MinescriptenLexer.channelNames; } | |
// @Override | |
public get modeNames(): string[] { return MinescriptenLexer.modeNames; } | |
public static readonly _serializedATN: string = | |
"\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02\x14\xA2\b\x01" + | |
"\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06" + | |
"\x04\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r" + | |
"\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t" + | |
"\x12\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t" + | |
"\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x03\x02\x03\x02\x03\x02" + | |
"\x03\x03\x03\x03\x03\x04\x03\x04\x03\x05\x03\x05\x03\x06\x03\x06\x03\x06" + | |
"\x03\x07\x03\x07\x03\b\x03\b\x03\t\x03\t\x03\n\x03\n\x03\n\x03\n\x03\n" + | |
"\x03\n\x03\n\x03\v\x03\v\x03\f\x03\f\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03" + | |
"\x0E\x03\x0F\x03\x0F\x03\x0F\x07\x0F\\\n\x0F\f\x0F\x0E\x0F_\v\x0F\x03" + | |
"\x0F\x03\x0F\x03\x10\x03\x10\x06\x10e\n\x10\r\x10\x0E\x10f\x03\x10\x03" + | |
"\x10\x03\x10\x03\x10\x06\x10m\n\x10\r\x10\x0E\x10n\x05\x10q\n\x10\x03" + | |
"\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x05" + | |
"\x11|\n\x11\x03\x12\x03\x12\x07\x12\x80\n\x12\f\x12\x0E\x12\x83\v\x12" + | |
"\x03\x13\x03\x13\x03\x13\x05\x13\x88\n\x13\x03\x14\x03\x14\x03\x14\x03" + | |
"\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x16\x03\x16\x03" + | |
"\x17\x03\x17\x03\x18\x03\x18\x03\x19\x03\x19\x03\x1A\x06\x1A\x9D\n\x1A" + | |
"\r\x1A\x0E\x1A\x9E\x03\x1A\x03\x1A\x02\x02\x02\x1B\x03\x02\x03\x05\x02" + | |
"\x04\x07\x02\x05\t\x02\x06\v\x02\x07\r\x02\b\x0F\x02\t\x11\x02\n\x13\x02" + | |
"\v\x15\x02\f\x17\x02\r\x19\x02\x0E\x1B\x02\x0F\x1D\x02\x10\x1F\x02\x11" + | |
"!\x02\x12#\x02\x13%\x02\x02\'\x02\x02)\x02\x02+\x02\x02-\x02\x02/\x02" + | |
"\x021\x02\x023\x02\x14\x03\x02\n\x03\x023;\x06\x02$$^^pptt\x05\x02C\\" + | |
"aac|\x06\x022;C\\aac|\x06\x02\f\f\x0F\x0F$$^^\x03\x022;\x05\x022;CHch" + | |
"\x05\x02\v\f\x0F\x0F\"\"\x02\xA3\x02\x03\x03\x02\x02\x02\x02\x05\x03\x02" + | |
"\x02\x02\x02\x07\x03\x02\x02\x02\x02\t\x03\x02\x02\x02\x02\v\x03\x02\x02" + | |
"\x02\x02\r\x03\x02\x02\x02\x02\x0F\x03\x02\x02\x02\x02\x11\x03\x02\x02" + | |
"\x02\x02\x13\x03\x02\x02\x02\x02\x15\x03\x02\x02\x02\x02\x17\x03\x02\x02" + | |
"\x02\x02\x19\x03\x02\x02\x02\x02\x1B\x03\x02\x02\x02\x02\x1D\x03\x02\x02" + | |
"\x02\x02\x1F\x03\x02\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02\x02\x02" + | |
"\x023\x03\x02\x02\x02\x035\x03\x02\x02\x02\x058\x03\x02\x02\x02\x07:\x03" + | |
"\x02\x02\x02\t<\x03\x02\x02\x02\v>\x03\x02\x02\x02\rA\x03\x02\x02\x02" + | |
"\x0FC\x03\x02\x02\x02\x11E\x03\x02\x02\x02\x13G\x03\x02\x02\x02\x15N\x03" + | |
"\x02\x02\x02\x17P\x03\x02\x02\x02\x19T\x03\x02\x02\x02\x1BV\x03\x02\x02" + | |
"\x02\x1DX\x03\x02\x02\x02\x1Fp\x03\x02\x02\x02!{\x03\x02\x02\x02#}\x03" + | |
"\x02\x02\x02%\x87\x03\x02\x02\x02\'\x89\x03\x02\x02\x02)\x91\x03\x02\x02" + | |
"\x02+\x93\x03\x02\x02\x02-\x95\x03\x02\x02\x02/\x97\x03\x02\x02\x021\x99" + | |
"\x03\x02\x02\x023\x9C\x03\x02\x02\x0256\x07h\x02\x0267\x07p\x02\x027\x04" + | |
"\x03\x02\x02\x0289\x07*\x02\x029\x06\x03\x02\x02\x02:;\x07.\x02\x02;\b" + | |
"\x03\x02\x02\x02<=\x07+\x02\x02=\n\x03\x02\x02\x02>?\x07/\x02\x02?@\x07" + | |
"@\x02\x02@\f\x03\x02\x02\x02AB\x07}\x02\x02B\x0E\x03\x02\x02\x02CD\x07" + | |
"\x7F\x02\x02D\x10\x03\x02\x02\x02EF\x07<\x02\x02F\x12\x03\x02\x02\x02" + | |
"GH\x07u\x02\x02HI\x07v\x02\x02IJ\x07t\x02\x02JK\x07w\x02\x02KL\x07e\x02" + | |
"\x02LM\x07v\x02\x02M\x14\x03\x02\x02\x02NO\x07=\x02\x02O\x16\x03\x02\x02" + | |
"\x02PQ\x07n\x02\x02QR\x07g\x02\x02RS\x07v\x02\x02S\x18\x03\x02\x02\x02" + | |
"TU\x07?\x02\x02U\x1A\x03\x02\x02\x02VW\x070\x02\x02W\x1C\x03\x02\x02\x02" + | |
"X]\x07$\x02\x02Y\\\x05-\x17\x02Z\\\x05%\x13\x02[Y\x03\x02\x02\x02[Z\x03" + | |
"\x02\x02\x02\\_\x03\x02\x02\x02][\x03\x02\x02\x02]^\x03\x02\x02\x02^`" + | |
"\x03\x02\x02\x02_]\x03\x02\x02\x02`a\x07$\x02\x02a\x1E\x03\x02\x02\x02" + | |
"bd\t\x02\x02\x02ce\x05/\x18\x02dc\x03\x02\x02\x02ef\x03\x02\x02\x02fd" + | |
"\x03\x02\x02\x02fg\x03\x02\x02\x02gq\x03\x02\x02\x02hi\x072\x02\x02ij" + | |
"\x07z\x02\x02jl\x03\x02\x02\x02km\x051\x19\x02lk\x03\x02\x02\x02mn\x03" + | |
"\x02\x02\x02nl\x03\x02\x02\x02no\x03\x02\x02\x02oq\x03\x02\x02\x02pb\x03" + | |
"\x02\x02\x02ph\x03\x02\x02\x02q \x03\x02\x02\x02rs\x07v\x02\x02st\x07" + | |
"t\x02\x02tu\x07w\x02\x02u|\x07g\x02\x02vw\x07h\x02\x02wx\x07c\x02\x02" + | |
"xy\x07n\x02\x02yz\x07u\x02\x02z|\x07g\x02\x02{r\x03\x02\x02\x02{v\x03" + | |
"\x02\x02\x02|\"\x03\x02\x02\x02}\x81\x05)\x15\x02~\x80\x05+\x16\x02\x7F" + | |
"~\x03\x02\x02\x02\x80\x83\x03\x02\x02\x02\x81\x7F\x03\x02\x02\x02\x81" + | |
"\x82\x03\x02\x02\x02\x82$\x03\x02\x02\x02\x83\x81\x03\x02\x02\x02\x84" + | |
"\x85\x07^\x02\x02\x85\x88\t\x03\x02\x02\x86\x88\x05\'\x14\x02\x87\x84" + | |
"\x03\x02\x02\x02\x87\x86\x03\x02\x02\x02\x88&\x03\x02\x02\x02\x89\x8A" + | |
"\x07^\x02\x02\x8A\x8B\x07w\x02\x02\x8B\x8C\x03\x02\x02\x02\x8C\x8D\x05" + | |
"1\x19\x02\x8D\x8E\x051\x19\x02\x8E\x8F\x051\x19\x02\x8F\x90\x051\x19\x02" + | |
"\x90(\x03\x02\x02\x02\x91\x92\t\x04\x02\x02\x92*\x03\x02\x02\x02\x93\x94" + | |
"\t\x05\x02\x02\x94,\x03\x02\x02\x02\x95\x96\n\x06\x02\x02\x96.\x03\x02" + | |
"\x02\x02\x97\x98\t\x07\x02\x02\x980\x03\x02\x02\x02\x99\x9A\t\b\x02\x02" + | |
"\x9A2\x03\x02\x02\x02\x9B\x9D\t\t\x02\x02\x9C\x9B\x03\x02\x02\x02\x9D" + | |
"\x9E\x03\x02\x02\x02\x9E\x9C\x03\x02\x02\x02\x9E\x9F\x03\x02\x02\x02\x9F" + | |
"\xA0\x03\x02\x02\x02\xA0\xA1\b\x1A\x02\x02\xA14\x03\x02\x02\x02\f\x02" + | |
"[]fnp{\x81\x87\x9E\x03\b\x02\x02"; | |
public static __ATN: ATN; | |
public static get _ATN(): ATN { | |
if (!MinescriptenLexer.__ATN) { | |
MinescriptenLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(MinescriptenLexer._serializedATN)); | |
} | |
return MinescriptenLexer.__ATN; | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated from Minescripten.g4 by ANTLR 4.7.3-SNAPSHOT | |
import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; | |
import { ModuleContext } from "./MinescriptenParser"; | |
import { DefinitionContext } from "./MinescriptenParser"; | |
import { FunctionContext } from "./MinescriptenParser"; | |
import { FunctionArgumentContext } from "./MinescriptenParser"; | |
import { StructContext } from "./MinescriptenParser"; | |
import { CodeContext } from "./MinescriptenParser"; | |
import { FunctionCallContext } from "./MinescriptenParser"; | |
import { VariableDefinitionContext } from "./MinescriptenParser"; | |
import { ExpressionContext } from "./MinescriptenParser"; | |
import { PathContext } from "./MinescriptenParser"; | |
import { LiteralContext } from "./MinescriptenParser"; | |
/** | |
* This interface defines a complete listener for a parse tree produced by | |
* `MinescriptenParser`. | |
*/ | |
export interface MinescriptenListener extends ParseTreeListener { | |
/** | |
* Enter a parse tree produced by `MinescriptenParser.module`. | |
* @param ctx the parse tree | |
*/ | |
enterModule?: (ctx: ModuleContext) => void; | |
/** | |
* Exit a parse tree produced by `MinescriptenParser.module`. | |
* @param ctx the parse tree | |
*/ | |
exitModule?: (ctx: ModuleContext) => void; | |
/** | |
* Enter a parse tree produced by `MinescriptenParser.definition`. | |
* @param ctx the parse tree | |
*/ | |
enterDefinition?: (ctx: DefinitionContext) => void; | |
/** | |
* Exit a parse tree produced by `MinescriptenParser.definition`. | |
* @param ctx the parse tree | |
*/ | |
exitDefinition?: (ctx: DefinitionContext) => void; | |
/** | |
* Enter a parse tree produced by `MinescriptenParser.function`. | |
* @param ctx the parse tree | |
*/ | |
enterFunction?: (ctx: FunctionContext) => void; | |
/** | |
* Exit a parse tree produced by `MinescriptenParser.function`. | |
* @param ctx the parse tree | |
*/ | |
exitFunction?: (ctx: FunctionContext) => void; | |
/** | |
* Enter a parse tree produced by `MinescriptenParser.functionArgument`. | |
* @param ctx the parse tree | |
*/ | |
enterFunctionArgument?: (ctx: FunctionArgumentContext) => void; | |
/** | |
* Exit a parse tree produced by `MinescriptenParser.functionArgument`. | |
* @param ctx the parse tree | |
*/ | |
exitFunctionArgument?: (ctx: FunctionArgumentContext) => void; | |
/** | |
* Enter a parse tree produced by `MinescriptenParser.struct`. | |
* @param ctx the parse tree | |
*/ | |
enterStruct?: (ctx: StructContext) => void; | |
/** | |
* Exit a parse tree produced by `MinescriptenParser.struct`. | |
* @param ctx the parse tree | |
*/ | |
exitStruct?: (ctx: StructContext) => void; | |
/** | |
* Enter a parse tree produced by `MinescriptenParser.code`. | |
* @param ctx the parse tree | |
*/ | |
enterCode?: (ctx: CodeContext) => void; | |
/** | |
* Exit a parse tree produced by `MinescriptenParser.code`. | |
* @param ctx the parse tree | |
*/ | |
exitCode?: (ctx: CodeContext) => void; | |
/** | |
* Enter a parse tree produced by `MinescriptenParser.functionCall`. | |
* @param ctx the parse tree | |
*/ | |
enterFunctionCall?: (ctx: FunctionCallContext) => void; | |
/** | |
* Exit a parse tree produced by `MinescriptenParser.functionCall`. | |
* @param ctx the parse tree | |
*/ | |
exitFunctionCall?: (ctx: FunctionCallContext) => void; | |
/** | |
* Enter a parse tree produced by `MinescriptenParser.variableDefinition`. | |
* @param ctx the parse tree | |
*/ | |
enterVariableDefinition?: (ctx: VariableDefinitionContext) => void; | |
/** | |
* Exit a parse tree produced by `MinescriptenParser.variableDefinition`. | |
* @param ctx the parse tree | |
*/ | |
exitVariableDefinition?: (ctx: VariableDefinitionContext) => void; | |
/** | |
* Enter a parse tree produced by `MinescriptenParser.expression`. | |
* @param ctx the parse tree | |
*/ | |
enterExpression?: (ctx: ExpressionContext) => void; | |
/** | |
* Exit a parse tree produced by `MinescriptenParser.expression`. | |
* @param ctx the parse tree | |
*/ | |
exitExpression?: (ctx: ExpressionContext) => void; | |
/** | |
* Enter a parse tree produced by `MinescriptenParser.path`. | |
* @param ctx the parse tree | |
*/ | |
enterPath?: (ctx: PathContext) => void; | |
/** | |
* Exit a parse tree produced by `MinescriptenParser.path`. | |
* @param ctx the parse tree | |
*/ | |
exitPath?: (ctx: PathContext) => void; | |
/** | |
* Enter a parse tree produced by `MinescriptenParser.literal`. | |
* @param ctx the parse tree | |
*/ | |
enterLiteral?: (ctx: LiteralContext) => void; | |
/** | |
* Exit a parse tree produced by `MinescriptenParser.literal`. | |
* @param ctx the parse tree | |
*/ | |
exitLiteral?: (ctx: LiteralContext) => void; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated from Minescripten.g4 by ANTLR 4.7.3-SNAPSHOT | |
import { ATN } from "antlr4ts/atn/ATN"; | |
import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; | |
import { FailedPredicateException } from "antlr4ts/FailedPredicateException"; | |
import { NotNull } from "antlr4ts/Decorators"; | |
import { NoViableAltException } from "antlr4ts/NoViableAltException"; | |
import { Override } from "antlr4ts/Decorators"; | |
import { Parser } from "antlr4ts/Parser"; | |
import { ParserRuleContext } from "antlr4ts/ParserRuleContext"; | |
import { ParserATNSimulator } from "antlr4ts/atn/ParserATNSimulator"; | |
import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; | |
import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; | |
import { RecognitionException } from "antlr4ts/RecognitionException"; | |
import { RuleContext } from "antlr4ts/RuleContext"; | |
//import { RuleVersion } from "antlr4ts/RuleVersion"; | |
import { TerminalNode } from "antlr4ts/tree/TerminalNode"; | |
import { Token } from "antlr4ts/Token"; | |
import { TokenStream } from "antlr4ts/TokenStream"; | |
import { Vocabulary } from "antlr4ts/Vocabulary"; | |
import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; | |
import * as Utils from "antlr4ts/misc/Utils"; | |
import { MinescriptenListener } from "./MinescriptenListener"; | |
export class MinescriptenParser extends Parser { | |
public static readonly T__0 = 1; | |
public static readonly T__1 = 2; | |
public static readonly T__2 = 3; | |
public static readonly T__3 = 4; | |
public static readonly T__4 = 5; | |
public static readonly T__5 = 6; | |
public static readonly T__6 = 7; | |
public static readonly T__7 = 8; | |
public static readonly T__8 = 9; | |
public static readonly T__9 = 10; | |
public static readonly T__10 = 11; | |
public static readonly T__11 = 12; | |
public static readonly T__12 = 13; | |
public static readonly StringLiteral = 14; | |
public static readonly IntegerLiteral = 15; | |
public static readonly BooleanLiteral = 16; | |
public static readonly Identifier = 17; | |
public static readonly WS = 18; | |
public static readonly RULE_module = 0; | |
public static readonly RULE_definition = 1; | |
public static readonly RULE_function = 2; | |
public static readonly RULE_functionArgument = 3; | |
public static readonly RULE_struct = 4; | |
public static readonly RULE_code = 5; | |
public static readonly RULE_functionCall = 6; | |
public static readonly RULE_variableDefinition = 7; | |
public static readonly RULE_expression = 8; | |
public static readonly RULE_path = 9; | |
public static readonly RULE_literal = 10; | |
// tslint:disable:no-trailing-whitespace | |
public static readonly ruleNames: string[] = [ | |
"module", "definition", "function", "functionArgument", "struct", "code", | |
"functionCall", "variableDefinition", "expression", "path", "literal", | |
]; | |
private static readonly _LITERAL_NAMES: Array<string | undefined> = [ | |
undefined, "'fn'", "'('", "','", "')'", "'->'", "'{'", "'}'", "':'", "'struct'", | |
"';'", "'let'", "'='", "'.'", | |
]; | |
private static readonly _SYMBOLIC_NAMES: Array<string | undefined> = [ | |
undefined, undefined, undefined, undefined, undefined, undefined, undefined, | |
undefined, undefined, undefined, undefined, undefined, undefined, undefined, | |
"StringLiteral", "IntegerLiteral", "BooleanLiteral", "Identifier", "WS", | |
]; | |
public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(MinescriptenParser._LITERAL_NAMES, MinescriptenParser._SYMBOLIC_NAMES, []); | |
// @Override | |
// @NotNull | |
public get vocabulary(): Vocabulary { | |
return MinescriptenParser.VOCABULARY; | |
} | |
// tslint:enable:no-trailing-whitespace | |
// @Override | |
public get grammarFileName(): string { return "Minescripten.g4"; } | |
// @Override | |
public get ruleNames(): string[] { return MinescriptenParser.ruleNames; } | |
// @Override | |
public readonly serializedATN = MinescriptenParser._serializedATN; | |
constructor(input: TokenStream) { | |
super(input); | |
this._interp = new ParserATNSimulator(MinescriptenParser._ATN, this); | |
} | |
// @RuleVersion(0) | |
public module(): ModuleContext { | |
let _localctx: ModuleContext = new ModuleContext(this._ctx, this.state); | |
this.enterRule(_localctx, 0, MinescriptenParser.RULE_module); | |
let _la: number; | |
try { | |
this.enterOuterAlt(_localctx, 1); | |
{ | |
this.state = 25; | |
this._errHandler.sync(this); | |
_la = this._input.LA(1); | |
while (_la === MinescriptenParser.T__0 || _la === MinescriptenParser.T__8) { | |
{ | |
{ | |
this.state = 22; | |
this.definition(); | |
} | |
} | |
this.state = 27; | |
this._errHandler.sync(this); | |
_la = this._input.LA(1); | |
} | |
this.state = 28; | |
this.match(MinescriptenParser.EOF); | |
} | |
} | |
catch (re) { | |
if (re instanceof RecognitionException) { | |
_localctx.exception = re; | |
this._errHandler.reportError(this, re); | |
this._errHandler.recover(this, re); | |
} else { | |
throw re; | |
} | |
} | |
finally { | |
this.exitRule(); | |
} | |
return _localctx; | |
} | |
// @RuleVersion(0) | |
public definition(): DefinitionContext { | |
let _localctx: DefinitionContext = new DefinitionContext(this._ctx, this.state); | |
this.enterRule(_localctx, 2, MinescriptenParser.RULE_definition); | |
try { | |
this.state = 32; | |
this._errHandler.sync(this); | |
switch (this._input.LA(1)) { | |
case MinescriptenParser.T__0: | |
this.enterOuterAlt(_localctx, 1); | |
{ | |
this.state = 30; | |
this.function(); | |
} | |
break; | |
case MinescriptenParser.T__8: | |
this.enterOuterAlt(_localctx, 2); | |
{ | |
this.state = 31; | |
this.struct(); | |
} | |
break; | |
default: | |
throw new NoViableAltException(this); | |
} | |
} | |
catch (re) { | |
if (re instanceof RecognitionException) { | |
_localctx.exception = re; | |
this._errHandler.reportError(this, re); | |
this._errHandler.recover(this, re); | |
} else { | |
throw re; | |
} | |
} | |
finally { | |
this.exitRule(); | |
} | |
return _localctx; | |
} | |
// @RuleVersion(0) | |
public function(): FunctionContext { | |
let _localctx: FunctionContext = new FunctionContext(this._ctx, this.state); | |
this.enterRule(_localctx, 4, MinescriptenParser.RULE_function); | |
let _la: number; | |
try { | |
this.enterOuterAlt(_localctx, 1); | |
{ | |
this.state = 34; | |
this.match(MinescriptenParser.T__0); | |
this.state = 35; | |
this.match(MinescriptenParser.Identifier); | |
this.state = 36; | |
this.match(MinescriptenParser.T__1); | |
this.state = 44; | |
this._errHandler.sync(this); | |
_la = this._input.LA(1); | |
if (_la === MinescriptenParser.Identifier) { | |
{ | |
this.state = 37; | |
this.functionArgument(); | |
this.state = 40; | |
this._errHandler.sync(this); | |
_la = this._input.LA(1); | |
do { | |
{ | |
{ | |
this.state = 38; | |
this.match(MinescriptenParser.T__2); | |
this.state = 39; | |
this.functionArgument(); | |
} | |
} | |
this.state = 42; | |
this._errHandler.sync(this); | |
_la = this._input.LA(1); | |
} while (_la === MinescriptenParser.T__2); | |
} | |
} | |
this.state = 46; | |
this.match(MinescriptenParser.T__3); | |
this.state = 49; | |
this._errHandler.sync(this); | |
_la = this._input.LA(1); | |
if (_la === MinescriptenParser.T__4) { | |
{ | |
this.state = 47; | |
this.match(MinescriptenParser.T__4); | |
this.state = 48; | |
this.match(MinescriptenParser.Identifier); | |
} | |
} | |
this.state = 51; | |
this.match(MinescriptenParser.T__5); | |
this.state = 52; | |
this.code(); | |
this.state = 53; | |
this.match(MinescriptenParser.T__6); | |
} | |
} | |
catch (re) { | |
if (re instanceof RecognitionException) { | |
_localctx.exception = re; | |
this._errHandler.reportError(this, re); | |
this._errHandler.recover(this, re); | |
} else { | |
throw re; | |
} | |
} | |
finally { | |
this.exitRule(); | |
} | |
return _localctx; | |
} | |
// @RuleVersion(0) | |
public functionArgument(): FunctionArgumentContext { | |
let _localctx: FunctionArgumentContext = new FunctionArgumentContext(this._ctx, this.state); | |
this.enterRule(_localctx, 6, MinescriptenParser.RULE_functionArgument); | |
try { | |
this.enterOuterAlt(_localctx, 1); | |
{ | |
this.state = 55; | |
this.match(MinescriptenParser.Identifier); | |
this.state = 56; | |
this.match(MinescriptenParser.T__7); | |
this.state = 57; | |
this.match(MinescriptenParser.Identifier); | |
} | |
} | |
catch (re) { | |
if (re instanceof RecognitionException) { | |
_localctx.exception = re; | |
this._errHandler.reportError(this, re); | |
this._errHandler.recover(this, re); | |
} else { | |
throw re; | |
} | |
} | |
finally { | |
this.exitRule(); | |
} | |
return _localctx; | |
} | |
// @RuleVersion(0) | |
public struct(): StructContext { | |
let _localctx: StructContext = new StructContext(this._ctx, this.state); | |
this.enterRule(_localctx, 8, MinescriptenParser.RULE_struct); | |
try { | |
this.enterOuterAlt(_localctx, 1); | |
{ | |
this.state = 59; | |
this.match(MinescriptenParser.T__8); | |
this.state = 60; | |
this.match(MinescriptenParser.Identifier); | |
} | |
} | |
catch (re) { | |
if (re instanceof RecognitionException) { | |
_localctx.exception = re; | |
this._errHandler.reportError(this, re); | |
this._errHandler.recover(this, re); | |
} else { | |
throw re; | |
} | |
} | |
finally { | |
this.exitRule(); | |
} | |
return _localctx; | |
} | |
// @RuleVersion(0) | |
public code(): CodeContext { | |
let _localctx: CodeContext = new CodeContext(this._ctx, this.state); | |
this.enterRule(_localctx, 10, MinescriptenParser.RULE_code); | |
try { | |
this.enterOuterAlt(_localctx, 1); | |
{ | |
this.state = 62; | |
this.functionCall(); | |
this.state = 63; | |
this.match(MinescriptenParser.T__9); | |
} | |
} | |
catch (re) { | |
if (re instanceof RecognitionException) { | |
_localctx.exception = re; | |
this._errHandler.reportError(this, re); | |
this._errHandler.recover(this, re); | |
} else { | |
throw re; | |
} | |
} | |
finally { | |
this.exitRule(); | |
} | |
return _localctx; | |
} | |
// @RuleVersion(0) | |
public functionCall(): FunctionCallContext { | |
let _localctx: FunctionCallContext = new FunctionCallContext(this._ctx, this.state); | |
this.enterRule(_localctx, 12, MinescriptenParser.RULE_functionCall); | |
let _la: number; | |
try { | |
this.enterOuterAlt(_localctx, 1); | |
{ | |
this.state = 65; | |
this.path(); | |
this.state = 66; | |
this.match(MinescriptenParser.T__1); | |
this.state = 67; | |
this.functionArgument(); | |
this.state = 70; | |
this._errHandler.sync(this); | |
_la = this._input.LA(1); | |
do { | |
{ | |
{ | |
this.state = 68; | |
this.match(MinescriptenParser.T__2); | |
this.state = 69; | |
this.functionArgument(); | |
} | |
} | |
this.state = 72; | |
this._errHandler.sync(this); | |
_la = this._input.LA(1); | |
} while (_la === MinescriptenParser.T__2); | |
this.state = 74; | |
this.match(MinescriptenParser.T__3); | |
} | |
} | |
catch (re) { | |
if (re instanceof RecognitionException) { | |
_localctx.exception = re; | |
this._errHandler.reportError(this, re); | |
this._errHandler.recover(this, re); | |
} else { | |
throw re; | |
} | |
} | |
finally { | |
this.exitRule(); | |
} | |
return _localctx; | |
} | |
// @RuleVersion(0) | |
public variableDefinition(): VariableDefinitionContext { | |
let _localctx: VariableDefinitionContext = new VariableDefinitionContext(this._ctx, this.state); | |
this.enterRule(_localctx, 14, MinescriptenParser.RULE_variableDefinition); | |
try { | |
this.enterOuterAlt(_localctx, 1); | |
{ | |
this.state = 76; | |
this.match(MinescriptenParser.T__10); | |
this.state = 77; | |
this.match(MinescriptenParser.Identifier); | |
this.state = 78; | |
this.match(MinescriptenParser.T__11); | |
this.state = 79; | |
this.expression(); | |
} | |
} | |
catch (re) { | |
if (re instanceof RecognitionException) { | |
_localctx.exception = re; | |
this._errHandler.reportError(this, re); | |
this._errHandler.recover(this, re); | |
} else { | |
throw re; | |
} | |
} | |
finally { | |
this.exitRule(); | |
} | |
return _localctx; | |
} | |
// @RuleVersion(0) | |
public expression(): ExpressionContext { | |
let _localctx: ExpressionContext = new ExpressionContext(this._ctx, this.state); | |
this.enterRule(_localctx, 16, MinescriptenParser.RULE_expression); | |
try { | |
this.state = 83; | |
this._errHandler.sync(this); | |
switch ( this.interpreter.adaptivePredict(this._input, 6, this._ctx) ) { | |
case 1: | |
this.enterOuterAlt(_localctx, 1); | |
{ | |
this.state = 81; | |
this.functionCall(); | |
} | |
break; | |
case 2: | |
this.enterOuterAlt(_localctx, 2); | |
{ | |
this.state = 82; | |
this.path(); | |
} | |
break; | |
} | |
} | |
catch (re) { | |
if (re instanceof RecognitionException) { | |
_localctx.exception = re; | |
this._errHandler.reportError(this, re); | |
this._errHandler.recover(this, re); | |
} else { | |
throw re; | |
} | |
} | |
finally { | |
this.exitRule(); | |
} | |
return _localctx; | |
} | |
// @RuleVersion(0) | |
public path(): PathContext { | |
let _localctx: PathContext = new PathContext(this._ctx, this.state); | |
this.enterRule(_localctx, 18, MinescriptenParser.RULE_path); | |
let _la: number; | |
try { | |
this.enterOuterAlt(_localctx, 1); | |
{ | |
this.state = 85; | |
this.match(MinescriptenParser.Identifier); | |
this.state = 88; | |
this._errHandler.sync(this); | |
_la = this._input.LA(1); | |
if (_la === MinescriptenParser.T__12) { | |
{ | |
this.state = 86; | |
this.match(MinescriptenParser.T__12); | |
this.state = 87; | |
this.path(); | |
} | |
} | |
} | |
} | |
catch (re) { | |
if (re instanceof RecognitionException) { | |
_localctx.exception = re; | |
this._errHandler.reportError(this, re); | |
this._errHandler.recover(this, re); | |
} else { | |
throw re; | |
} | |
} | |
finally { | |
this.exitRule(); | |
} | |
return _localctx; | |
} | |
// @RuleVersion(0) | |
public literal(): LiteralContext { | |
let _localctx: LiteralContext = new LiteralContext(this._ctx, this.state); | |
this.enterRule(_localctx, 20, MinescriptenParser.RULE_literal); | |
let _la: number; | |
try { | |
this.enterOuterAlt(_localctx, 1); | |
{ | |
this.state = 90; | |
_la = this._input.LA(1); | |
if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << MinescriptenParser.StringLiteral) | (1 << MinescriptenParser.IntegerLiteral) | (1 << MinescriptenParser.BooleanLiteral))) !== 0))) { | |
this._errHandler.recoverInline(this); | |
} else { | |
if (this._input.LA(1) === Token.EOF) { | |
this.matchedEOF = true; | |
} | |
this._errHandler.reportMatch(this); | |
this.consume(); | |
} | |
} | |
} | |
catch (re) { | |
if (re instanceof RecognitionException) { | |
_localctx.exception = re; | |
this._errHandler.reportError(this, re); | |
this._errHandler.recover(this, re); | |
} else { | |
throw re; | |
} | |
} | |
finally { | |
this.exitRule(); | |
} | |
return _localctx; | |
} | |
public static readonly _serializedATN: string = | |
"\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03\x14_\x04\x02" + | |
"\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" + | |
"\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x03\x02\x07\x02" + | |
"\x1A\n\x02\f\x02\x0E\x02\x1D\v\x02\x03\x02\x03\x02\x03\x03\x03\x03\x05" + | |
"\x03#\n\x03\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x06\x04+\n" + | |
"\x04\r\x04\x0E\x04,\x05\x04/\n\x04\x03\x04\x03\x04\x03\x04\x05\x044\n" + | |
"\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x05\x03\x05\x03\x05\x03\x05\x03" + | |
"\x06\x03\x06\x03\x06\x03\x07\x03\x07\x03\x07\x03\b\x03\b\x03\b\x03\b\x03" + | |
"\b\x06\bI\n\b\r\b\x0E\bJ\x03\b\x03\b\x03\t\x03\t\x03\t\x03\t\x03\t\x03" + | |
"\n\x03\n\x05\nV\n\n\x03\v\x03\v\x03\v\x05\v[\n\v\x03\f\x03\f\x03\f\x02" + | |
"\x02\x02\r\x02\x02\x04\x02\x06\x02\b\x02\n\x02\f\x02\x0E\x02\x10\x02\x12" + | |
"\x02\x14\x02\x16\x02\x02\x03\x03\x02\x10\x12\x02[\x02\x1B\x03\x02\x02" + | |
"\x02\x04\"\x03\x02\x02\x02\x06$\x03\x02\x02\x02\b9\x03\x02\x02\x02\n=" + | |
"\x03\x02\x02\x02\f@\x03\x02\x02\x02\x0EC\x03\x02\x02\x02\x10N\x03\x02" + | |
"\x02\x02\x12U\x03\x02\x02\x02\x14W\x03\x02\x02\x02\x16\\\x03\x02\x02\x02" + | |
"\x18\x1A\x05\x04\x03\x02\x19\x18\x03\x02\x02\x02\x1A\x1D\x03\x02\x02\x02" + | |
"\x1B\x19\x03\x02\x02\x02\x1B\x1C\x03\x02\x02\x02\x1C\x1E\x03\x02\x02\x02" + | |
"\x1D\x1B\x03\x02\x02\x02\x1E\x1F\x07\x02\x02\x03\x1F\x03\x03\x02\x02\x02" + | |
" #\x05\x06\x04\x02!#\x05\n\x06\x02\" \x03\x02\x02\x02\"!\x03\x02\x02\x02" + | |
"#\x05\x03\x02\x02\x02$%\x07\x03\x02\x02%&\x07\x13\x02\x02&.\x07\x04\x02" + | |
"\x02\'*\x05\b\x05\x02()\x07\x05\x02\x02)+\x05\b\x05\x02*(\x03\x02\x02" + | |
"\x02+,\x03\x02\x02\x02,*\x03\x02\x02\x02,-\x03\x02\x02\x02-/\x03\x02\x02" + | |
"\x02.\'\x03\x02\x02\x02./\x03\x02\x02\x02/0\x03\x02\x02\x0203\x07\x06" + | |
"\x02\x0212\x07\x07\x02\x0224\x07\x13\x02\x0231\x03\x02\x02\x0234\x03\x02" + | |
"\x02\x0245\x03\x02\x02\x0256\x07\b\x02\x0267\x05\f\x07\x0278\x07\t\x02" + | |
"\x028\x07\x03\x02\x02\x029:\x07\x13\x02\x02:;\x07\n\x02\x02;<\x07\x13" + | |
"\x02\x02<\t\x03\x02\x02\x02=>\x07\v\x02\x02>?\x07\x13\x02\x02?\v\x03\x02" + | |
"\x02\x02@A\x05\x0E\b\x02AB\x07\f\x02\x02B\r\x03\x02\x02\x02CD\x05\x14" + | |
"\v\x02DE\x07\x04\x02\x02EH\x05\b\x05\x02FG\x07\x05\x02\x02GI\x05\b\x05" + | |
"\x02HF\x03\x02\x02\x02IJ\x03\x02\x02\x02JH\x03\x02\x02\x02JK\x03\x02\x02" + | |
"\x02KL\x03\x02\x02\x02LM\x07\x06\x02\x02M\x0F\x03\x02\x02\x02NO\x07\r" + | |
"\x02\x02OP\x07\x13\x02\x02PQ\x07\x0E\x02\x02QR\x05\x12\n\x02R\x11\x03" + | |
"\x02\x02\x02SV\x05\x0E\b\x02TV\x05\x14\v\x02US\x03\x02\x02\x02UT\x03\x02" + | |
"\x02\x02V\x13\x03\x02\x02\x02WZ\x07\x13\x02\x02XY\x07\x0F\x02\x02Y[\x05" + | |
"\x14\v\x02ZX\x03\x02\x02\x02Z[\x03\x02\x02\x02[\x15\x03\x02\x02\x02\\" + | |
"]\t\x02\x02\x02]\x17\x03\x02\x02\x02\n\x1B\",.3JUZ"; | |
public static __ATN: ATN; | |
public static get _ATN(): ATN { | |
if (!MinescriptenParser.__ATN) { | |
MinescriptenParser.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(MinescriptenParser._serializedATN)); | |
} | |
return MinescriptenParser.__ATN; | |
} | |
} | |
export class ModuleContext extends ParserRuleContext { | |
public EOF(): TerminalNode { return this.getToken(MinescriptenParser.EOF, 0); } | |
public definition(): DefinitionContext[]; | |
public definition(i: number): DefinitionContext; | |
public definition(i?: number): DefinitionContext | DefinitionContext[] { | |
if (i === undefined) { | |
return this.getRuleContexts(DefinitionContext); | |
} else { | |
return this.getRuleContext(i, DefinitionContext); | |
} | |
} | |
constructor(parent: ParserRuleContext | undefined, invokingState: number) { | |
super(parent, invokingState); | |
} | |
// @Override | |
public readonly ruleIndex = MinescriptenParser.RULE_module; | |
// @Override | |
public enterRule(listener: MinescriptenListener): void { | |
if (listener.enterModule) { | |
listener.enterModule(this); | |
} | |
} | |
// @Override | |
public exitRule(listener: MinescriptenListener): void { | |
if (listener.exitModule) { | |
listener.exitModule(this); | |
} | |
} | |
} | |
export class DefinitionContext extends ParserRuleContext { | |
public function(): FunctionContext | undefined { | |
return this.tryGetRuleContext(0, FunctionContext); | |
} | |
public struct(): StructContext | undefined { | |
return this.tryGetRuleContext(0, StructContext); | |
} | |
constructor(parent: ParserRuleContext | undefined, invokingState: number) { | |
super(parent, invokingState); | |
} | |
// @Override | |
public readonly ruleIndex = MinescriptenParser.RULE_definition; | |
// @Override | |
public enterRule(listener: MinescriptenListener): void { | |
if (listener.enterDefinition) { | |
listener.enterDefinition(this); | |
} | |
} | |
// @Override | |
public exitRule(listener: MinescriptenListener): void { | |
if (listener.exitDefinition) { | |
listener.exitDefinition(this); | |
} | |
} | |
} | |
export class FunctionContext extends ParserRuleContext { | |
public Identifier(): TerminalNode[]; | |
public Identifier(i: number): TerminalNode; | |
public Identifier(i?: number): TerminalNode | TerminalNode[] { | |
if (i === undefined) { | |
return this.getTokens(MinescriptenParser.Identifier); | |
} else { | |
return this.getToken(MinescriptenParser.Identifier, i); | |
} | |
} | |
public code(): CodeContext { | |
return this.getRuleContext(0, CodeContext); | |
} | |
public functionArgument(): FunctionArgumentContext[]; | |
public functionArgument(i: number): FunctionArgumentContext; | |
public functionArgument(i?: number): FunctionArgumentContext | FunctionArgumentContext[] { | |
if (i === undefined) { | |
return this.getRuleContexts(FunctionArgumentContext); | |
} else { | |
return this.getRuleContext(i, FunctionArgumentContext); | |
} | |
} | |
constructor(parent: ParserRuleContext | undefined, invokingState: number) { | |
super(parent, invokingState); | |
} | |
// @Override | |
public readonly ruleIndex = MinescriptenParser.RULE_function; | |
// @Override | |
public enterRule(listener: MinescriptenListener): void { | |
if (listener.enterFunction) { | |
listener.enterFunction(this); | |
} | |
} | |
// @Override | |
public exitRule(listener: MinescriptenListener): void { | |
if (listener.exitFunction) { | |
listener.exitFunction(this); | |
} | |
} | |
} | |
export class FunctionArgumentContext extends ParserRuleContext { | |
public Identifier(): TerminalNode[]; | |
public Identifier(i: number): TerminalNode; | |
public Identifier(i?: number): TerminalNode | TerminalNode[] { | |
if (i === undefined) { | |
return this.getTokens(MinescriptenParser.Identifier); | |
} else { | |
return this.getToken(MinescriptenParser.Identifier, i); | |
} | |
} | |
constructor(parent: ParserRuleContext | undefined, invokingState: number) { | |
super(parent, invokingState); | |
} | |
// @Override | |
public readonly ruleIndex = MinescriptenParser.RULE_functionArgument; | |
// @Override | |
public enterRule(listener: MinescriptenListener): void { | |
if (listener.enterFunctionArgument) { | |
listener.enterFunctionArgument(this); | |
} | |
} | |
// @Override | |
public exitRule(listener: MinescriptenListener): void { | |
if (listener.exitFunctionArgument) { | |
listener.exitFunctionArgument(this); | |
} | |
} | |
} | |
export class StructContext extends ParserRuleContext { | |
public Identifier(): TerminalNode { return this.getToken(MinescriptenParser.Identifier, 0); } | |
constructor(parent: ParserRuleContext | undefined, invokingState: number) { | |
super(parent, invokingState); | |
} | |
// @Override | |
public readonly ruleIndex = MinescriptenParser.RULE_struct; | |
// @Override | |
public enterRule(listener: MinescriptenListener): void { | |
if (listener.enterStruct) { | |
listener.enterStruct(this); | |
} | |
} | |
// @Override | |
public exitRule(listener: MinescriptenListener): void { | |
if (listener.exitStruct) { | |
listener.exitStruct(this); | |
} | |
} | |
} | |
export class CodeContext extends ParserRuleContext { | |
public functionCall(): FunctionCallContext { | |
return this.getRuleContext(0, FunctionCallContext); | |
} | |
constructor(parent: ParserRuleContext | undefined, invokingState: number) { | |
super(parent, invokingState); | |
} | |
// @Override | |
public readonly ruleIndex = MinescriptenParser.RULE_code; | |
// @Override | |
public enterRule(listener: MinescriptenListener): void { | |
if (listener.enterCode) { | |
listener.enterCode(this); | |
} | |
} | |
// @Override | |
public exitRule(listener: MinescriptenListener): void { | |
if (listener.exitCode) { | |
listener.exitCode(this); | |
} | |
} | |
} | |
export class FunctionCallContext extends ParserRuleContext { | |
public path(): PathContext { | |
return this.getRuleContext(0, PathContext); | |
} | |
public functionArgument(): FunctionArgumentContext[]; | |
public functionArgument(i: number): FunctionArgumentContext; | |
public functionArgument(i?: number): FunctionArgumentContext | FunctionArgumentContext[] { | |
if (i === undefined) { | |
return this.getRuleContexts(FunctionArgumentContext); | |
} else { | |
return this.getRuleContext(i, FunctionArgumentContext); | |
} | |
} | |
constructor(parent: ParserRuleContext | undefined, invokingState: number) { | |
super(parent, invokingState); | |
} | |
// @Override | |
public readonly ruleIndex = MinescriptenParser.RULE_functionCall; | |
// @Override | |
public enterRule(listener: MinescriptenListener): void { | |
if (listener.enterFunctionCall) { | |
listener.enterFunctionCall(this); | |
} | |
} | |
// @Override | |
public exitRule(listener: MinescriptenListener): void { | |
if (listener.exitFunctionCall) { | |
listener.exitFunctionCall(this); | |
} | |
} | |
} | |
export class VariableDefinitionContext extends ParserRuleContext { | |
public Identifier(): TerminalNode { return this.getToken(MinescriptenParser.Identifier, 0); } | |
public expression(): ExpressionContext { | |
return this.getRuleContext(0, ExpressionContext); | |
} | |
constructor(parent: ParserRuleContext | undefined, invokingState: number) { | |
super(parent, invokingState); | |
} | |
// @Override | |
public readonly ruleIndex = MinescriptenParser.RULE_variableDefinition; | |
// @Override | |
public enterRule(listener: MinescriptenListener): void { | |
if (listener.enterVariableDefinition) { | |
listener.enterVariableDefinition(this); | |
} | |
} | |
// @Override | |
public exitRule(listener: MinescriptenListener): void { | |
if (listener.exitVariableDefinition) { | |
listener.exitVariableDefinition(this); | |
} | |
} | |
} | |
export class ExpressionContext extends ParserRuleContext { | |
public functionCall(): FunctionCallContext | undefined { | |
return this.tryGetRuleContext(0, FunctionCallContext); | |
} | |
public path(): PathContext | undefined { | |
return this.tryGetRuleContext(0, PathContext); | |
} | |
constructor(parent: ParserRuleContext | undefined, invokingState: number) { | |
super(parent, invokingState); | |
} | |
// @Override | |
public readonly ruleIndex = MinescriptenParser.RULE_expression; | |
// @Override | |
public enterRule(listener: MinescriptenListener): void { | |
if (listener.enterExpression) { | |
listener.enterExpression(this); | |
} | |
} | |
// @Override | |
public exitRule(listener: MinescriptenListener): void { | |
if (listener.exitExpression) { | |
listener.exitExpression(this); | |
} | |
} | |
} | |
export class PathContext extends ParserRuleContext { | |
public Identifier(): TerminalNode { return this.getToken(MinescriptenParser.Identifier, 0); } | |
public path(): PathContext | undefined { | |
return this.tryGetRuleContext(0, PathContext); | |
} | |
constructor(parent: ParserRuleContext | undefined, invokingState: number) { | |
super(parent, invokingState); | |
} | |
// @Override | |
public readonly ruleIndex = MinescriptenParser.RULE_path; | |
// @Override | |
public enterRule(listener: MinescriptenListener): void { | |
if (listener.enterPath) { | |
listener.enterPath(this); | |
} | |
} | |
// @Override | |
public exitRule(listener: MinescriptenListener): void { | |
if (listener.exitPath) { | |
listener.exitPath(this); | |
} | |
} | |
} | |
export class LiteralContext extends ParserRuleContext { | |
public StringLiteral(): TerminalNode | undefined { return this.tryGetToken(MinescriptenParser.StringLiteral, 0); } | |
public IntegerLiteral(): TerminalNode | undefined { return this.tryGetToken(MinescriptenParser.IntegerLiteral, 0); } | |
public BooleanLiteral(): TerminalNode | undefined { return this.tryGetToken(MinescriptenParser.BooleanLiteral, 0); } | |
constructor(parent: ParserRuleContext | undefined, invokingState: number) { | |
super(parent, invokingState); | |
} | |
// @Override | |
public readonly ruleIndex = MinescriptenParser.RULE_literal; | |
// @Override | |
public enterRule(listener: MinescriptenListener): void { | |
if (listener.enterLiteral) { | |
listener.enterLiteral(this); | |
} | |
} | |
// @Override | |
public exitRule(listener: MinescriptenListener): void { | |
if (listener.exitLiteral) { | |
listener.exitLiteral(this); | |
} | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated from Minescripten.g4 by ANTLR 4.7.3-SNAPSHOT | |
import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; | |
import { ModuleContext } from "./MinescriptenParser"; | |
import { DefinitionContext } from "./MinescriptenParser"; | |
import { FunctionContext } from "./MinescriptenParser"; | |
import { FunctionArgumentContext } from "./MinescriptenParser"; | |
import { StructContext } from "./MinescriptenParser"; | |
import { CodeContext } from "./MinescriptenParser"; | |
import { FunctionCallContext } from "./MinescriptenParser"; | |
import { VariableDefinitionContext } from "./MinescriptenParser"; | |
import { ExpressionContext } from "./MinescriptenParser"; | |
import { PathContext } from "./MinescriptenParser"; | |
import { LiteralContext } from "./MinescriptenParser"; | |
/** | |
* This interface defines a complete generic visitor for a parse tree produced | |
* by `MinescriptenParser`. | |
* | |
* @param <Result> The return type of the visit operation. Use `void` for | |
* operations with no return type. | |
*/ | |
export interface MinescriptenVisitor<Result> extends ParseTreeVisitor<Result> { | |
/** | |
* Visit a parse tree produced by `MinescriptenParser.module`. | |
* @param ctx the parse tree | |
* @return the visitor result | |
*/ | |
visitModule?: (ctx: ModuleContext) => Result; | |
/** | |
* Visit a parse tree produced by `MinescriptenParser.definition`. | |
* @param ctx the parse tree | |
* @return the visitor result | |
*/ | |
visitDefinition?: (ctx: DefinitionContext) => Result; | |
/** | |
* Visit a parse tree produced by `MinescriptenParser.function`. | |
* @param ctx the parse tree | |
* @return the visitor result | |
*/ | |
visitFunction?: (ctx: FunctionContext) => Result; | |
/** | |
* Visit a parse tree produced by `MinescriptenParser.functionArgument`. | |
* @param ctx the parse tree | |
* @return the visitor result | |
*/ | |
visitFunctionArgument?: (ctx: FunctionArgumentContext) => Result; | |
/** | |
* Visit a parse tree produced by `MinescriptenParser.struct`. | |
* @param ctx the parse tree | |
* @return the visitor result | |
*/ | |
visitStruct?: (ctx: StructContext) => Result; | |
/** | |
* Visit a parse tree produced by `MinescriptenParser.code`. | |
* @param ctx the parse tree | |
* @return the visitor result | |
*/ | |
visitCode?: (ctx: CodeContext) => Result; | |
/** | |
* Visit a parse tree produced by `MinescriptenParser.functionCall`. | |
* @param ctx the parse tree | |
* @return the visitor result | |
*/ | |
visitFunctionCall?: (ctx: FunctionCallContext) => Result; | |
/** | |
* Visit a parse tree produced by `MinescriptenParser.variableDefinition`. | |
* @param ctx the parse tree | |
* @return the visitor result | |
*/ | |
visitVariableDefinition?: (ctx: VariableDefinitionContext) => Result; | |
/** | |
* Visit a parse tree produced by `MinescriptenParser.expression`. | |
* @param ctx the parse tree | |
* @return the visitor result | |
*/ | |
visitExpression?: (ctx: ExpressionContext) => Result; | |
/** | |
* Visit a parse tree produced by `MinescriptenParser.path`. | |
* @param ctx the parse tree | |
* @return the visitor result | |
*/ | |
visitPath?: (ctx: PathContext) => Result; | |
/** | |
* Visit a parse tree produced by `MinescriptenParser.literal`. | |
* @param ctx the parse tree | |
* @return the visitor result | |
*/ | |
visitLiteral?: (ctx: LiteralContext) => Result; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment