From 1812e791d351e7574785e114c4094925c9f048e6 Mon Sep 17 00:00:00 2001 From: Hongyang Date: Wed, 19 Feb 2020 15:01:22 +0800 Subject: [PATCH] init --- .../src/builtInFunction.ts | 44 +- .../src/parser/Expression.g4 | 3 + .../src/parser/expressionEngine.ts | 19 + .../src/parser/generated/ExpressionLexer.ts | 401 +- .../parser/generated/ExpressionListener.ts | 423 +- .../src/parser/generated/ExpressionParser.ts | 2218 +++--- .../src/parser/generated/ExpressionVisitor.ts | 292 +- .../tests/expression.test.js | 21 +- libraries/botbuilder-lg/src/analyzer.ts | 5 +- libraries/botbuilder-lg/src/evaluator.ts | 9 +- libraries/botbuilder-lg/src/expander.ts | 9 +- .../src/generated/LGFileLexer.ts | 1806 ++--- .../src/generated/LGFileParser.ts | 5954 ++++++++--------- .../src/generated/LGFileParserListener.ts | 834 +-- .../src/generated/LGFileParserVisitor.ts | 568 +- libraries/botbuilder-lg/src/index.ts | 1 + libraries/botbuilder-lg/src/lgExtensions.ts | 24 + libraries/botbuilder-lg/src/staticChecker.ts | 6 +- libraries/botbuilder-lg/tests/lg.test.js | 24 + .../testData/examples/EmptyArrayAndObject.lg | 9 + 20 files changed, 6422 insertions(+), 6248 deletions(-) create mode 100644 libraries/botbuilder-lg/src/lgExtensions.ts create mode 100644 libraries/botbuilder-lg/tests/testData/examples/EmptyArrayAndObject.lg diff --git a/libraries/adaptive-expressions/src/builtInFunction.ts b/libraries/adaptive-expressions/src/builtInFunction.ts index c1840f0b18..cbba6306e7 100644 --- a/libraries/adaptive-expressions/src/builtInFunction.ts +++ b/libraries/adaptive-expressions/src/builtInFunction.ts @@ -1627,6 +1627,46 @@ export class BuiltInFunctions { return {value: result, error}; } + private static isEqual(args: any []): boolean { + if (args.length === 0 ) { + return false; + } + + if (args[0] === undefined || args[0] === null) { + return args[1] === undefined || args[1] === null; + } + + if (Array.isArray(args[0]) && args[0].length === 0 && Array.isArray(args[1]) && args[1].length === 0) { + return true; + } + + if (BuiltInFunctions.getPropertyCount(args[0]) === 0 && BuiltInFunctions.getPropertyCount(args[1]) === 0) { + return true; + } + + try + { + return args[0] === args[1]; + } + catch + { + return false; + } + } + + private static getPropertyCount(obj: any): number { + let count = -1; + if (!Array.isArray(obj)) { + if (obj instanceof Map) { + count = obj.size; + } else if (typeof obj === 'object') { + count = Object.keys(obj).length; + } + } + + return count; + } + // tslint:disable-next-line: max-func-body-length private static buildFunctionLookup(): Map { // tslint:disable-next-line: no-unnecessary-local-variable @@ -1832,10 +1872,10 @@ export class BuiltInFunctions { (args: any []): boolean => args[0] <= args[1], BuiltInFunctions.validateBinaryNumberOrString, BuiltInFunctions.verifyNumberOrString), BuiltInFunctions.comparison( ExpressionType.Equal, - (args: any []): boolean => args[0] === args[1], BuiltInFunctions.validateBinary), + this.isEqual, BuiltInFunctions.validateBinary), BuiltInFunctions.comparison( ExpressionType.NotEqual, - (args: any []): boolean => args[0] !== args[1], BuiltInFunctions.validateBinary), + (args: any []): boolean => !this.isEqual(args), BuiltInFunctions.validateBinary), BuiltInFunctions.comparison( ExpressionType.GreaterThan, (args: any []): boolean => args[0] > args[1], BuiltInFunctions.validateBinaryNumberOrString, BuiltInFunctions.verifyNumberOrString), diff --git a/libraries/adaptive-expressions/src/parser/Expression.g4 b/libraries/adaptive-expressions/src/parser/Expression.g4 index ceed9e67df..8bbc79d411 100644 --- a/libraries/adaptive-expressions/src/parser/Expression.g4 +++ b/libraries/adaptive-expressions/src/parser/Expression.g4 @@ -17,6 +17,7 @@ expression primaryExpression : '(' expression ')' #parenthesisExp + | CONSTANT #constantAtom | NUMBER #numericAtom | STRING #stringAtom | IDENTIFIER #idAtom @@ -42,4 +43,6 @@ NEWLINE : '\r'? '\n' -> skip; STRING : ('\'' (~'\'')* '\'') | ('"' (~'"')* '"'); +CONSTANT : ('[' WHITESPACE* ']') | ('{' WHITESPACE* '}'); + INVALID_TOKEN_DEFAULT_MODE : . ; \ No newline at end of file diff --git a/libraries/adaptive-expressions/src/parser/expressionEngine.ts b/libraries/adaptive-expressions/src/parser/expressionEngine.ts index 9b41d5e07a..5955bead86 100644 --- a/libraries/adaptive-expressions/src/parser/expressionEngine.ts +++ b/libraries/adaptive-expressions/src/parser/expressionEngine.ts @@ -117,6 +117,25 @@ export class ExpressionEngine implements ExpressionParserInterface { } } + public visitConstantAtom(context: ep.ConstantAtomContext): Expression { + let text: string = context.text; + if (text.startsWith('[') && text.endsWith(']')) { + text = text.substr(1, text.length - 2).trim(); + if (text === '') { + return new Constant([]); + } + } + + if (text.startsWith('{') && text.endsWith('}')) { + text = text.substr(1, text.length - 2).trim(); + if (text === '') { + return new Constant({}); + } + } + + throw new Error(`Unrecognized constant: ${ text }`); + } + protected defaultResult = (): Expression => new Constant(''); private readonly MakeExpression = (type: string, ...children: Expression[]): Expression => diff --git a/libraries/adaptive-expressions/src/parser/generated/ExpressionLexer.ts b/libraries/adaptive-expressions/src/parser/generated/ExpressionLexer.ts index d890214d5b..b35ed8a810 100644 --- a/libraries/adaptive-expressions/src/parser/generated/ExpressionLexer.ts +++ b/libraries/adaptive-expressions/src/parser/generated/ExpressionLexer.ts @@ -1,198 +1,203 @@ -/** - * @module adaptive-expressions - */ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. - */ -// Generated from ../Expression.g4 by ANTLR 4.6-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 ExpressionLexer 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 T__13 = 14; - public static readonly T__14 = 15; - public static readonly T__15 = 16; - public static readonly T__16 = 17; - public static readonly T__17 = 18; - public static readonly T__18 = 19; - public static readonly T__19 = 20; - public static readonly T__20 = 21; - public static readonly T__21 = 22; - public static readonly T__22 = 23; - public static readonly NUMBER = 24; - public static readonly WHITESPACE = 25; - public static readonly IDENTIFIER = 26; - public static readonly NEWLINE = 27; - public static readonly STRING = 28; - public static readonly INVALID_TOKEN_DEFAULT_MODE = 29; - // 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", "T__13", "T__14", "T__15", "T__16", - "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "LETTER", "DIGIT", - "NUMBER", "WHITESPACE", "IDENTIFIER", "NEWLINE", "STRING", "INVALID_TOKEN_DEFAULT_MODE", - ]; - - private static readonly _LITERAL_NAMES: Array = [ - undefined, "'!'", "'-'", "'+'", "'^'", "'*'", "'/'", "'%'", "'=='", "'!='", - "'<>'", "'&'", "'<'", "'<='", "'>'", "'>='", "'&&'", "'||'", "'('", "')'", - "'.'", "'['", "']'", "','", - ]; - private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, "NUMBER", "WHITESPACE", "IDENTIFIER", - "NEWLINE", "STRING", "INVALID_TOKEN_DEFAULT_MODE", - ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(ExpressionLexer._LITERAL_NAMES, ExpressionLexer._SYMBOLIC_NAMES, []); - - // @Override - // @NotNull - public get vocabulary(): Vocabulary { - return ExpressionLexer.VOCABULARY; - } - // tslint:enable:no-trailing-whitespace - - - constructor(input: CharStream) { - super(input); - this._interp = new LexerATNSimulator(ExpressionLexer._ATN, this); - } - - // @Override - public get grammarFileName(): string { return "Expression.g4"; } - - // @Override - public get ruleNames(): string[] { return ExpressionLexer.ruleNames; } - - // @Override - public get serializedATN(): string { return ExpressionLexer._serializedATN; } - - // @Override - public get modeNames(): string[] { return ExpressionLexer.modeNames; } - - public static readonly _serializedATN: string = - "\x03\uAF6F\u8320\u479D\uB75C\u4880\u1605\u191C\uAB37\x02\x1F\xB5\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\x04\x1B\t\x1B\x04\x1C\t" + - "\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x03\x02\x03\x02" + - "\x03\x03\x03\x03\x03\x04\x03\x04\x03\x05\x03\x05\x03\x06\x03\x06\x03\x07" + - "\x03\x07\x03\b\x03\b\x03\t\x03\t\x03\t\x03\n\x03\n\x03\n\x03\v\x03\v\x03" + - "\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03" + - "\x10\x03\x10\x03\x10\x03\x11\x03\x11\x03\x11\x03\x12\x03\x12\x03\x12\x03" + - "\x13\x03\x13\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\x03\x1A\x03\x1B\x06\x1B|" + - "\n\x1B\r\x1B\x0E\x1B}\x03\x1B\x03\x1B\x06\x1B\x82\n\x1B\r\x1B\x0E\x1B" + - "\x83\x05\x1B\x86\n\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1D\x03\x1D" + - "\x03\x1D\x03\x1D\x03\x1D\x05\x1D\x91\n\x1D\x03\x1D\x03\x1D\x03\x1D\x07" + - "\x1D\x96\n\x1D\f\x1D\x0E\x1D\x99\v\x1D\x03\x1E\x05\x1E\x9C\n\x1E\x03\x1E" + - "\x03\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x07\x1F\xA4\n\x1F\f\x1F\x0E\x1F" + - "\xA7\v\x1F\x03\x1F\x03\x1F\x03\x1F\x07\x1F\xAC\n\x1F\f\x1F\x0E\x1F\xAF" + - "\v\x1F\x03\x1F\x05\x1F\xB2\n\x1F\x03 \x03 \x02\x02\x02!\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\x14\'\x02\x15)\x02\x16+\x02\x17-\x02\x18/" + - "\x02\x191\x02\x023\x02\x025\x02\x1A7\x02\x1B9\x02\x1C;\x02\x1D=\x02\x1E" + - "?\x02\x1F\x03\x02\t\x04\x02C\\c|\x03\x022;\x06\x02\v\v\"\"\xA2\xA2\uFF01" + - "\uFF01\x05\x02%%BBaa\x04\x02//aa\x03\x02))\x03\x02$$\xBF\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\x02%\x03\x02\x02\x02\x02\'\x03\x02\x02\x02\x02" + - ")\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02-\x03\x02\x02\x02\x02/\x03\x02" + - "\x02\x02\x025\x03\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02" + - "\x02;\x03\x02\x02\x02\x02=\x03\x02\x02\x02\x02?\x03\x02\x02\x02\x03A\x03" + - "\x02\x02\x02\x05C\x03\x02\x02\x02\x07E\x03\x02\x02\x02\tG\x03\x02\x02" + - "\x02\vI\x03\x02\x02\x02\rK\x03\x02\x02\x02\x0FM\x03\x02\x02\x02\x11O\x03" + - "\x02\x02\x02\x13R\x03\x02\x02\x02\x15U\x03\x02\x02\x02\x17X\x03\x02\x02" + - "\x02\x19Z\x03\x02\x02\x02\x1B\\\x03\x02\x02\x02\x1D_\x03\x02\x02\x02\x1F" + - "a\x03\x02\x02\x02!d\x03\x02\x02\x02#g\x03\x02\x02\x02%j\x03\x02\x02\x02" + - "\'l\x03\x02\x02\x02)n\x03\x02\x02\x02+p\x03\x02\x02\x02-r\x03\x02\x02" + - "\x02/t\x03\x02\x02\x021v\x03\x02\x02\x023x\x03\x02\x02\x025{\x03\x02\x02" + - "\x027\x87\x03\x02\x02\x029\x90\x03\x02\x02\x02;\x9B\x03\x02\x02\x02=\xB1" + - "\x03\x02\x02\x02?\xB3\x03\x02\x02\x02AB\x07#\x02\x02B\x04\x03\x02\x02" + - "\x02CD\x07/\x02\x02D\x06\x03\x02\x02\x02EF\x07-\x02\x02F\b\x03\x02\x02" + - "\x02GH\x07`\x02\x02H\n\x03\x02\x02\x02IJ\x07,\x02\x02J\f\x03\x02\x02\x02" + - "KL\x071\x02\x02L\x0E\x03\x02\x02\x02MN\x07\'\x02\x02N\x10\x03\x02\x02" + - "\x02OP\x07?\x02\x02PQ\x07?\x02\x02Q\x12\x03\x02\x02\x02RS\x07#\x02\x02" + - "ST\x07?\x02\x02T\x14\x03\x02\x02\x02UV\x07>\x02\x02VW\x07@\x02\x02W\x16" + - "\x03\x02\x02\x02XY\x07(\x02\x02Y\x18\x03\x02\x02\x02Z[\x07>\x02\x02[\x1A" + - "\x03\x02\x02\x02\\]\x07>\x02\x02]^\x07?\x02\x02^\x1C\x03\x02\x02\x02_" + - "`\x07@\x02\x02`\x1E\x03\x02\x02\x02ab\x07@\x02\x02bc\x07?\x02\x02c \x03" + - "\x02\x02\x02de\x07(\x02\x02ef\x07(\x02\x02f\"\x03\x02\x02\x02gh\x07~\x02" + - "\x02hi\x07~\x02\x02i$\x03\x02\x02\x02jk\x07*\x02\x02k&\x03\x02\x02\x02" + - "lm\x07+\x02\x02m(\x03\x02\x02\x02no\x070\x02\x02o*\x03\x02\x02\x02pq\x07" + - "]\x02\x02q,\x03\x02\x02\x02rs\x07_\x02\x02s.\x03\x02\x02\x02tu\x07.\x02" + - "\x02u0\x03\x02\x02\x02vw\t\x02\x02\x02w2\x03\x02\x02\x02xy\t\x03\x02\x02" + - "y4\x03\x02\x02\x02z|\x053\x1A\x02{z\x03\x02\x02\x02|}\x03\x02\x02\x02" + - "}{\x03\x02\x02\x02}~\x03\x02\x02\x02~\x85\x03\x02\x02\x02\x7F\x81\x07" + - "0\x02\x02\x80\x82\x053\x1A\x02\x81\x80\x03\x02\x02\x02\x82\x83\x03\x02" + - "\x02\x02\x83\x81\x03\x02\x02\x02\x83\x84\x03\x02\x02\x02\x84\x86\x03\x02" + - "\x02\x02\x85\x7F\x03\x02\x02\x02\x85\x86\x03\x02\x02\x02\x866\x03\x02" + - "\x02\x02\x87\x88\t\x04\x02\x02\x88\x89\x03\x02\x02\x02\x89\x8A\b\x1C\x02" + - "\x02\x8A8\x03\x02\x02\x02\x8B\x91\x051\x19\x02\x8C\x91\t\x05\x02\x02\x8D" + - "\x8E\x07B\x02\x02\x8E\x91\x07B\x02\x02\x8F\x91\x04&\'\x02\x90\x8B\x03" + - "\x02\x02\x02\x90\x8C\x03\x02\x02\x02\x90\x8D\x03\x02\x02\x02\x90\x8F\x03" + - "\x02\x02\x02\x91\x97\x03\x02\x02\x02\x92\x96\x051\x19\x02\x93\x96\x05" + - "3\x1A\x02\x94\x96\t\x06\x02\x02\x95\x92\x03\x02\x02\x02\x95\x93\x03\x02" + - "\x02\x02\x95\x94\x03\x02\x02\x02\x96\x99\x03\x02\x02\x02\x97\x95\x03\x02" + - "\x02\x02\x97\x98\x03\x02\x02\x02\x98:\x03\x02\x02\x02\x99\x97\x03\x02" + - "\x02\x02\x9A\x9C\x07\x0F\x02\x02\x9B\x9A\x03\x02\x02\x02\x9B\x9C\x03\x02" + - "\x02\x02\x9C\x9D\x03\x02\x02\x02\x9D\x9E\x07\f\x02\x02\x9E\x9F\x03\x02" + - "\x02\x02\x9F\xA0\b\x1E\x02\x02\xA0<\x03\x02\x02\x02\xA1\xA5\x07)\x02\x02" + - "\xA2\xA4\n\x07\x02\x02\xA3\xA2\x03\x02\x02\x02\xA4\xA7\x03\x02\x02\x02" + - "\xA5\xA3\x03\x02\x02\x02\xA5\xA6\x03\x02\x02\x02\xA6\xA8\x03\x02\x02\x02" + - "\xA7\xA5\x03\x02\x02\x02\xA8\xB2\x07)\x02\x02\xA9\xAD\x07$\x02\x02\xAA" + - "\xAC\n\b\x02\x02\xAB\xAA\x03\x02\x02\x02\xAC\xAF\x03\x02\x02\x02\xAD\xAB" + - "\x03\x02\x02\x02\xAD\xAE\x03\x02\x02\x02\xAE\xB0\x03\x02\x02\x02\xAF\xAD" + - "\x03\x02\x02\x02\xB0\xB2\x07$\x02\x02\xB1\xA1\x03\x02\x02\x02\xB1\xA9" + - "\x03\x02\x02\x02\xB2>\x03\x02\x02\x02\xB3\xB4\v\x02\x02\x02\xB4@\x03\x02" + - "\x02\x02\r\x02}\x83\x85\x90\x95\x97\x9B\xA5\xAD\xB1\x03\b\x02\x02"; - public static __ATN: ATN; - public static get _ATN(): ATN { - if (!ExpressionLexer.__ATN) { - ExpressionLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(ExpressionLexer._serializedATN)); - } - - return ExpressionLexer.__ATN; - } - -} - +// Generated from ../Expression.g4 by ANTLR 4.6-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 ExpressionLexer 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 T__13 = 14; + public static readonly T__14 = 15; + public static readonly T__15 = 16; + public static readonly T__16 = 17; + public static readonly T__17 = 18; + public static readonly T__18 = 19; + public static readonly T__19 = 20; + public static readonly T__20 = 21; + public static readonly T__21 = 22; + public static readonly T__22 = 23; + public static readonly NUMBER = 24; + public static readonly WHITESPACE = 25; + public static readonly IDENTIFIER = 26; + public static readonly NEWLINE = 27; + public static readonly STRING = 28; + public static readonly CONSTANT = 29; + public static readonly INVALID_TOKEN_DEFAULT_MODE = 30; + // 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", "T__13", "T__14", "T__15", "T__16", + "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "LETTER", "DIGIT", + "NUMBER", "WHITESPACE", "IDENTIFIER", "NEWLINE", "STRING", "CONSTANT", + "INVALID_TOKEN_DEFAULT_MODE", + ]; + + private static readonly _LITERAL_NAMES: Array = [ + undefined, "'!'", "'-'", "'+'", "'^'", "'*'", "'/'", "'%'", "'=='", "'!='", + "'<>'", "'&'", "'<'", "'<='", "'>'", "'>='", "'&&'", "'||'", "'('", "')'", + "'.'", "'['", "']'", "','", + ]; + private static readonly _SYMBOLIC_NAMES: Array = [ + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, "NUMBER", "WHITESPACE", "IDENTIFIER", + "NEWLINE", "STRING", "CONSTANT", "INVALID_TOKEN_DEFAULT_MODE", + ]; + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(ExpressionLexer._LITERAL_NAMES, ExpressionLexer._SYMBOLIC_NAMES, []); + + // @Override + // @NotNull + public get vocabulary(): Vocabulary { + return ExpressionLexer.VOCABULARY; + } + // tslint:enable:no-trailing-whitespace + + + constructor(input: CharStream) { + super(input); + this._interp = new LexerATNSimulator(ExpressionLexer._ATN, this); + } + + // @Override + public get grammarFileName(): string { return "Expression.g4"; } + + // @Override + public get ruleNames(): string[] { return ExpressionLexer.ruleNames; } + + // @Override + public get serializedATN(): string { return ExpressionLexer._serializedATN; } + + // @Override + public get modeNames(): string[] { return ExpressionLexer.modeNames; } + + public static readonly _serializedATN: string = + "\x03\uAF6F\u8320\u479D\uB75C\u4880\u1605\u191C\uAB37\x02 \xC9\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\x04\x1B\t\x1B\x04\x1C\t\x1C" + + "\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x03\x02\x03" + + "\x02\x03\x03\x03\x03\x03\x04\x03\x04\x03\x05\x03\x05\x03\x06\x03\x06\x03" + + "\x07\x03\x07\x03\b\x03\b\x03\t\x03\t\x03\t\x03\n\x03\n\x03\n\x03\v\x03" + + "\v\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0E\x03\x0F\x03\x0F" + + "\x03\x10\x03\x10\x03\x10\x03\x11\x03\x11\x03\x11\x03\x12\x03\x12\x03\x12" + + "\x03\x13\x03\x13\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\x03\x1A\x03\x1B\x06\x1B" + + "~\n\x1B\r\x1B\x0E\x1B\x7F\x03\x1B\x03\x1B\x06\x1B\x84\n\x1B\r\x1B\x0E" + + "\x1B\x85\x05\x1B\x88\n\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1D\x03" + + "\x1D\x03\x1D\x03\x1D\x03\x1D\x05\x1D\x93\n\x1D\x03\x1D\x03\x1D\x03\x1D" + + "\x07\x1D\x98\n\x1D\f\x1D\x0E\x1D\x9B\v\x1D\x03\x1E\x05\x1E\x9E\n\x1E\x03" + + "\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x07\x1F\xA6\n\x1F\f\x1F\x0E" + + "\x1F\xA9\v\x1F\x03\x1F\x03\x1F\x03\x1F\x07\x1F\xAE\n\x1F\f\x1F\x0E\x1F" + + "\xB1\v\x1F\x03\x1F\x05\x1F\xB4\n\x1F\x03 \x03 \x07 \xB8\n \f \x0E \xBB" + + "\v \x03 \x03 \x03 \x07 \xC0\n \f \x0E \xC3\v \x03 \x05 \xC6\n \x03!\x03" + + "!\x02\x02\x02\"\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\x14\'\x02" + + "\x15)\x02\x16+\x02\x17-\x02\x18/\x02\x191\x02\x023\x02\x025\x02\x1A7\x02" + + "\x1B9\x02\x1C;\x02\x1D=\x02\x1E?\x02\x1FA\x02 \x03\x02\t\x04\x02C\\c|" + + "\x03\x022;\x06\x02\v\v\"\"\xA2\xA2\uFF01\uFF01\x05\x02%%BBaa\x04\x02/" + + "/aa\x03\x02))\x03\x02$$\xD6\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\x02" + + "%\x03\x02\x02\x02\x02\'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03" + + "\x02\x02\x02\x02-\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x025\x03\x02\x02" + + "\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02\x02;\x03\x02\x02\x02\x02" + + "=\x03\x02\x02\x02\x02?\x03\x02\x02\x02\x02A\x03\x02\x02\x02\x03C\x03\x02" + + "\x02\x02\x05E\x03\x02\x02\x02\x07G\x03\x02\x02\x02\tI\x03\x02\x02\x02" + + "\vK\x03\x02\x02\x02\rM\x03\x02\x02\x02\x0FO\x03\x02\x02\x02\x11Q\x03\x02" + + "\x02\x02\x13T\x03\x02\x02\x02\x15W\x03\x02\x02\x02\x17Z\x03\x02\x02\x02" + + "\x19\\\x03\x02\x02\x02\x1B^\x03\x02\x02\x02\x1Da\x03\x02\x02\x02\x1Fc" + + "\x03\x02\x02\x02!f\x03\x02\x02\x02#i\x03\x02\x02\x02%l\x03\x02\x02\x02" + + "\'n\x03\x02\x02\x02)p\x03\x02\x02\x02+r\x03\x02\x02\x02-t\x03\x02\x02" + + "\x02/v\x03\x02\x02\x021x\x03\x02\x02\x023z\x03\x02\x02\x025}\x03\x02\x02" + + "\x027\x89\x03\x02\x02\x029\x92\x03\x02\x02\x02;\x9D\x03\x02\x02\x02=\xB3" + + "\x03\x02\x02\x02?\xC5\x03\x02\x02\x02A\xC7\x03\x02\x02\x02CD\x07#\x02" + + "\x02D\x04\x03\x02\x02\x02EF\x07/\x02\x02F\x06\x03\x02\x02\x02GH\x07-\x02" + + "\x02H\b\x03\x02\x02\x02IJ\x07`\x02\x02J\n\x03\x02\x02\x02KL\x07,\x02\x02" + + "L\f\x03\x02\x02\x02MN\x071\x02\x02N\x0E\x03\x02\x02\x02OP\x07\'\x02\x02" + + "P\x10\x03\x02\x02\x02QR\x07?\x02\x02RS\x07?\x02\x02S\x12\x03\x02\x02\x02" + + "TU\x07#\x02\x02UV\x07?\x02\x02V\x14\x03\x02\x02\x02WX\x07>\x02\x02XY\x07" + + "@\x02\x02Y\x16\x03\x02\x02\x02Z[\x07(\x02\x02[\x18\x03\x02\x02\x02\\]" + + "\x07>\x02\x02]\x1A\x03\x02\x02\x02^_\x07>\x02\x02_`\x07?\x02\x02`\x1C" + + "\x03\x02\x02\x02ab\x07@\x02\x02b\x1E\x03\x02\x02\x02cd\x07@\x02\x02de" + + "\x07?\x02\x02e \x03\x02\x02\x02fg\x07(\x02\x02gh\x07(\x02\x02h\"\x03\x02" + + "\x02\x02ij\x07~\x02\x02jk\x07~\x02\x02k$\x03\x02\x02\x02lm\x07*\x02\x02" + + "m&\x03\x02\x02\x02no\x07+\x02\x02o(\x03\x02\x02\x02pq\x070\x02\x02q*\x03" + + "\x02\x02\x02rs\x07]\x02\x02s,\x03\x02\x02\x02tu\x07_\x02\x02u.\x03\x02" + + "\x02\x02vw\x07.\x02\x02w0\x03\x02\x02\x02xy\t\x02\x02\x02y2\x03\x02\x02" + + "\x02z{\t\x03\x02\x02{4\x03\x02\x02\x02|~\x053\x1A\x02}|\x03\x02\x02\x02" + + "~\x7F\x03\x02\x02\x02\x7F}\x03\x02\x02\x02\x7F\x80\x03\x02\x02\x02\x80" + + "\x87\x03\x02\x02\x02\x81\x83\x070\x02\x02\x82\x84\x053\x1A\x02\x83\x82" + + "\x03\x02\x02\x02\x84\x85\x03\x02\x02\x02\x85\x83\x03\x02\x02\x02\x85\x86" + + "\x03\x02\x02\x02\x86\x88\x03\x02\x02\x02\x87\x81\x03\x02\x02\x02\x87\x88" + + "\x03\x02\x02\x02\x886\x03\x02\x02\x02\x89\x8A\t\x04\x02\x02\x8A\x8B\x03" + + "\x02\x02\x02\x8B\x8C\b\x1C\x02\x02\x8C8\x03\x02\x02\x02\x8D\x93\x051\x19" + + "\x02\x8E\x93\t\x05\x02\x02\x8F\x90\x07B\x02\x02\x90\x93\x07B\x02\x02\x91" + + "\x93\x04&\'\x02\x92\x8D\x03\x02\x02\x02\x92\x8E\x03\x02\x02\x02\x92\x8F" + + "\x03\x02\x02\x02\x92\x91\x03\x02\x02\x02\x93\x99\x03\x02\x02\x02\x94\x98" + + "\x051\x19\x02\x95\x98\x053\x1A\x02\x96\x98\t\x06\x02\x02\x97\x94\x03\x02" + + "\x02\x02\x97\x95\x03\x02\x02\x02\x97\x96\x03\x02\x02\x02\x98\x9B\x03\x02" + + "\x02\x02\x99\x97\x03\x02\x02\x02\x99\x9A\x03\x02\x02\x02\x9A:\x03\x02" + + "\x02\x02\x9B\x99\x03\x02\x02\x02\x9C\x9E\x07\x0F\x02\x02\x9D\x9C\x03\x02" + + "\x02\x02\x9D\x9E\x03\x02\x02\x02\x9E\x9F\x03\x02\x02\x02\x9F\xA0\x07\f" + + "\x02\x02\xA0\xA1\x03\x02\x02\x02\xA1\xA2\b\x1E\x02\x02\xA2<\x03\x02\x02" + + "\x02\xA3\xA7\x07)\x02\x02\xA4\xA6\n\x07\x02\x02\xA5\xA4\x03\x02\x02\x02" + + "\xA6\xA9\x03\x02\x02\x02\xA7\xA5\x03\x02\x02\x02\xA7\xA8\x03\x02\x02\x02" + + "\xA8\xAA\x03\x02\x02\x02\xA9\xA7\x03\x02\x02\x02\xAA\xB4\x07)\x02\x02" + + "\xAB\xAF\x07$\x02\x02\xAC\xAE\n\b\x02\x02\xAD\xAC\x03\x02\x02\x02\xAE" + + "\xB1\x03\x02\x02\x02\xAF\xAD\x03\x02\x02\x02\xAF\xB0\x03\x02\x02\x02\xB0" + + "\xB2\x03\x02\x02\x02\xB1\xAF\x03\x02\x02\x02\xB2\xB4\x07$\x02\x02\xB3" + + "\xA3\x03\x02\x02\x02\xB3\xAB\x03\x02\x02\x02\xB4>\x03\x02\x02\x02\xB5" + + "\xB9\x07]\x02\x02\xB6\xB8\x057\x1C\x02\xB7\xB6\x03\x02\x02\x02\xB8\xBB" + + "\x03\x02\x02\x02\xB9\xB7\x03\x02\x02\x02\xB9\xBA\x03\x02\x02\x02\xBA\xBC" + + "\x03\x02\x02\x02\xBB\xB9\x03\x02\x02\x02\xBC\xC6\x07_\x02\x02\xBD\xC1" + + "\x07}\x02\x02\xBE\xC0\x057\x1C\x02\xBF\xBE\x03\x02\x02\x02\xC0\xC3\x03" + + "\x02\x02\x02\xC1\xBF\x03\x02\x02\x02\xC1\xC2\x03\x02\x02\x02\xC2\xC4\x03" + + "\x02\x02\x02\xC3\xC1\x03\x02\x02\x02\xC4\xC6\x07\x7F\x02\x02\xC5\xB5\x03" + + "\x02\x02\x02\xC5\xBD\x03\x02\x02\x02\xC6@\x03\x02\x02\x02\xC7\xC8\v\x02" + + "\x02\x02\xC8B\x03\x02\x02\x02\x10\x02\x7F\x85\x87\x92\x97\x99\x9D\xA7" + + "\xAF\xB3\xB9\xC1\xC5\x03\b\x02\x02"; + public static __ATN: ATN; + public static get _ATN(): ATN { + if (!ExpressionLexer.__ATN) { + ExpressionLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(ExpressionLexer._serializedATN)); + } + + return ExpressionLexer.__ATN; + } + +} + diff --git a/libraries/adaptive-expressions/src/parser/generated/ExpressionListener.ts b/libraries/adaptive-expressions/src/parser/generated/ExpressionListener.ts index 5c21d6b262..912c873320 100644 --- a/libraries/adaptive-expressions/src/parser/generated/ExpressionListener.ts +++ b/libraries/adaptive-expressions/src/parser/generated/ExpressionListener.ts @@ -1,208 +1,215 @@ -/** - * @module adaptive-expressions - */ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. - */ -// Generated from ../Expression.g4 by ANTLR 4.6-SNAPSHOT - - -import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; - -import { FuncInvokeExpContext } from "./ExpressionParser"; -import { IdAtomContext } from "./ExpressionParser"; -import { StringAtomContext } from "./ExpressionParser"; -import { IndexAccessExpContext } from "./ExpressionParser"; -import { MemberAccessExpContext } from "./ExpressionParser"; -import { ParenthesisExpContext } from "./ExpressionParser"; -import { NumericAtomContext } from "./ExpressionParser"; -import { UnaryOpExpContext } from "./ExpressionParser"; -import { BinaryOpExpContext } from "./ExpressionParser"; -import { PrimaryExpContext } from "./ExpressionParser"; -import { FileContext } from "./ExpressionParser"; -import { ExpressionContext } from "./ExpressionParser"; -import { PrimaryExpressionContext } from "./ExpressionParser"; -import { ArgsListContext } from "./ExpressionParser"; - - -/** - * This interface defines a complete listener for a parse tree produced by - * `ExpressionParser`. - */ -export interface ExpressionListener extends ParseTreeListener { - /** - * Enter a parse tree produced by the `funcInvokeExp` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - enterFuncInvokeExp?: (ctx: FuncInvokeExpContext) => void; - /** - * Exit a parse tree produced by the `funcInvokeExp` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - exitFuncInvokeExp?: (ctx: FuncInvokeExpContext) => void; - - /** - * Enter a parse tree produced by the `idAtom` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - enterIdAtom?: (ctx: IdAtomContext) => void; - /** - * Exit a parse tree produced by the `idAtom` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - exitIdAtom?: (ctx: IdAtomContext) => void; - - /** - * Enter a parse tree produced by the `stringAtom` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - enterStringAtom?: (ctx: StringAtomContext) => void; - /** - * Exit a parse tree produced by the `stringAtom` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - exitStringAtom?: (ctx: StringAtomContext) => void; - - /** - * Enter a parse tree produced by the `indexAccessExp` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - enterIndexAccessExp?: (ctx: IndexAccessExpContext) => void; - /** - * Exit a parse tree produced by the `indexAccessExp` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - exitIndexAccessExp?: (ctx: IndexAccessExpContext) => void; - - /** - * Enter a parse tree produced by the `memberAccessExp` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - enterMemberAccessExp?: (ctx: MemberAccessExpContext) => void; - /** - * Exit a parse tree produced by the `memberAccessExp` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - exitMemberAccessExp?: (ctx: MemberAccessExpContext) => void; - - /** - * Enter a parse tree produced by the `parenthesisExp` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - enterParenthesisExp?: (ctx: ParenthesisExpContext) => void; - /** - * Exit a parse tree produced by the `parenthesisExp` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - exitParenthesisExp?: (ctx: ParenthesisExpContext) => void; - - /** - * Enter a parse tree produced by the `numericAtom` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - enterNumericAtom?: (ctx: NumericAtomContext) => void; - /** - * Exit a parse tree produced by the `numericAtom` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - exitNumericAtom?: (ctx: NumericAtomContext) => void; - - /** - * Enter a parse tree produced by the `unaryOpExp` - * labeled alternative in `ExpressionParser.expression`. - * @param ctx the parse tree - */ - enterUnaryOpExp?: (ctx: UnaryOpExpContext) => void; - /** - * Exit a parse tree produced by the `unaryOpExp` - * labeled alternative in `ExpressionParser.expression`. - * @param ctx the parse tree - */ - exitUnaryOpExp?: (ctx: UnaryOpExpContext) => void; - - /** - * Enter a parse tree produced by the `binaryOpExp` - * labeled alternative in `ExpressionParser.expression`. - * @param ctx the parse tree - */ - enterBinaryOpExp?: (ctx: BinaryOpExpContext) => void; - /** - * Exit a parse tree produced by the `binaryOpExp` - * labeled alternative in `ExpressionParser.expression`. - * @param ctx the parse tree - */ - exitBinaryOpExp?: (ctx: BinaryOpExpContext) => void; - - /** - * Enter a parse tree produced by the `primaryExp` - * labeled alternative in `ExpressionParser.expression`. - * @param ctx the parse tree - */ - enterPrimaryExp?: (ctx: PrimaryExpContext) => void; - /** - * Exit a parse tree produced by the `primaryExp` - * labeled alternative in `ExpressionParser.expression`. - * @param ctx the parse tree - */ - exitPrimaryExp?: (ctx: PrimaryExpContext) => void; - - /** - * Enter a parse tree produced by `ExpressionParser.file`. - * @param ctx the parse tree - */ - enterFile?: (ctx: FileContext) => void; - /** - * Exit a parse tree produced by `ExpressionParser.file`. - * @param ctx the parse tree - */ - exitFile?: (ctx: FileContext) => void; - - /** - * Enter a parse tree produced by `ExpressionParser.expression`. - * @param ctx the parse tree - */ - enterExpression?: (ctx: ExpressionContext) => void; - /** - * Exit a parse tree produced by `ExpressionParser.expression`. - * @param ctx the parse tree - */ - exitExpression?: (ctx: ExpressionContext) => void; - - /** - * Enter a parse tree produced by `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - enterPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; - /** - * Exit a parse tree produced by `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - */ - exitPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; - - /** - * Enter a parse tree produced by `ExpressionParser.argsList`. - * @param ctx the parse tree - */ - enterArgsList?: (ctx: ArgsListContext) => void; - /** - * Exit a parse tree produced by `ExpressionParser.argsList`. - * @param ctx the parse tree - */ - exitArgsList?: (ctx: ArgsListContext) => void; -} - +// Generated from ../Expression.g4 by ANTLR 4.6-SNAPSHOT + + +import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; + +import { FuncInvokeExpContext } from "./ExpressionParser"; +import { ConstantAtomContext } from "./ExpressionParser"; +import { IdAtomContext } from "./ExpressionParser"; +import { StringAtomContext } from "./ExpressionParser"; +import { IndexAccessExpContext } from "./ExpressionParser"; +import { MemberAccessExpContext } from "./ExpressionParser"; +import { ParenthesisExpContext } from "./ExpressionParser"; +import { NumericAtomContext } from "./ExpressionParser"; +import { UnaryOpExpContext } from "./ExpressionParser"; +import { BinaryOpExpContext } from "./ExpressionParser"; +import { PrimaryExpContext } from "./ExpressionParser"; +import { FileContext } from "./ExpressionParser"; +import { ExpressionContext } from "./ExpressionParser"; +import { PrimaryExpressionContext } from "./ExpressionParser"; +import { ArgsListContext } from "./ExpressionParser"; + + +/** + * This interface defines a complete listener for a parse tree produced by + * `ExpressionParser`. + */ +export interface ExpressionListener extends ParseTreeListener { + /** + * Enter a parse tree produced by the `funcInvokeExp` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + enterFuncInvokeExp?: (ctx: FuncInvokeExpContext) => void; + /** + * Exit a parse tree produced by the `funcInvokeExp` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + exitFuncInvokeExp?: (ctx: FuncInvokeExpContext) => void; + + /** + * Enter a parse tree produced by the `constantAtom` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + enterConstantAtom?: (ctx: ConstantAtomContext) => void; + /** + * Exit a parse tree produced by the `constantAtom` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + exitConstantAtom?: (ctx: ConstantAtomContext) => void; + + /** + * Enter a parse tree produced by the `idAtom` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + enterIdAtom?: (ctx: IdAtomContext) => void; + /** + * Exit a parse tree produced by the `idAtom` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + exitIdAtom?: (ctx: IdAtomContext) => void; + + /** + * Enter a parse tree produced by the `stringAtom` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + enterStringAtom?: (ctx: StringAtomContext) => void; + /** + * Exit a parse tree produced by the `stringAtom` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + exitStringAtom?: (ctx: StringAtomContext) => void; + + /** + * Enter a parse tree produced by the `indexAccessExp` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + enterIndexAccessExp?: (ctx: IndexAccessExpContext) => void; + /** + * Exit a parse tree produced by the `indexAccessExp` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + exitIndexAccessExp?: (ctx: IndexAccessExpContext) => void; + + /** + * Enter a parse tree produced by the `memberAccessExp` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + enterMemberAccessExp?: (ctx: MemberAccessExpContext) => void; + /** + * Exit a parse tree produced by the `memberAccessExp` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + exitMemberAccessExp?: (ctx: MemberAccessExpContext) => void; + + /** + * Enter a parse tree produced by the `parenthesisExp` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + enterParenthesisExp?: (ctx: ParenthesisExpContext) => void; + /** + * Exit a parse tree produced by the `parenthesisExp` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + exitParenthesisExp?: (ctx: ParenthesisExpContext) => void; + + /** + * Enter a parse tree produced by the `numericAtom` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + enterNumericAtom?: (ctx: NumericAtomContext) => void; + /** + * Exit a parse tree produced by the `numericAtom` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + exitNumericAtom?: (ctx: NumericAtomContext) => void; + + /** + * Enter a parse tree produced by the `unaryOpExp` + * labeled alternative in `ExpressionParser.expression`. + * @param ctx the parse tree + */ + enterUnaryOpExp?: (ctx: UnaryOpExpContext) => void; + /** + * Exit a parse tree produced by the `unaryOpExp` + * labeled alternative in `ExpressionParser.expression`. + * @param ctx the parse tree + */ + exitUnaryOpExp?: (ctx: UnaryOpExpContext) => void; + + /** + * Enter a parse tree produced by the `binaryOpExp` + * labeled alternative in `ExpressionParser.expression`. + * @param ctx the parse tree + */ + enterBinaryOpExp?: (ctx: BinaryOpExpContext) => void; + /** + * Exit a parse tree produced by the `binaryOpExp` + * labeled alternative in `ExpressionParser.expression`. + * @param ctx the parse tree + */ + exitBinaryOpExp?: (ctx: BinaryOpExpContext) => void; + + /** + * Enter a parse tree produced by the `primaryExp` + * labeled alternative in `ExpressionParser.expression`. + * @param ctx the parse tree + */ + enterPrimaryExp?: (ctx: PrimaryExpContext) => void; + /** + * Exit a parse tree produced by the `primaryExp` + * labeled alternative in `ExpressionParser.expression`. + * @param ctx the parse tree + */ + exitPrimaryExp?: (ctx: PrimaryExpContext) => void; + + /** + * Enter a parse tree produced by `ExpressionParser.file`. + * @param ctx the parse tree + */ + enterFile?: (ctx: FileContext) => void; + /** + * Exit a parse tree produced by `ExpressionParser.file`. + * @param ctx the parse tree + */ + exitFile?: (ctx: FileContext) => void; + + /** + * Enter a parse tree produced by `ExpressionParser.expression`. + * @param ctx the parse tree + */ + enterExpression?: (ctx: ExpressionContext) => void; + /** + * Exit a parse tree produced by `ExpressionParser.expression`. + * @param ctx the parse tree + */ + exitExpression?: (ctx: ExpressionContext) => void; + + /** + * Enter a parse tree produced by `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + enterPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; + /** + * Exit a parse tree produced by `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + */ + exitPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; + + /** + * Enter a parse tree produced by `ExpressionParser.argsList`. + * @param ctx the parse tree + */ + enterArgsList?: (ctx: ArgsListContext) => void; + /** + * Exit a parse tree produced by `ExpressionParser.argsList`. + * @param ctx the parse tree + */ + exitArgsList?: (ctx: ArgsListContext) => void; +} + diff --git a/libraries/adaptive-expressions/src/parser/generated/ExpressionParser.ts b/libraries/adaptive-expressions/src/parser/generated/ExpressionParser.ts index 24467a9129..3af64af390 100644 --- a/libraries/adaptive-expressions/src/parser/generated/ExpressionParser.ts +++ b/libraries/adaptive-expressions/src/parser/generated/ExpressionParser.ts @@ -1,1093 +1,1125 @@ -/** - * @module adaptive-expressions - */ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. - */ -// Generated from ../Expression.g4 by ANTLR 4.6-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 { ExpressionListener } from "./ExpressionListener"; -import { ExpressionVisitor } from "./ExpressionVisitor"; - - -export class ExpressionParser 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 T__13 = 14; - public static readonly T__14 = 15; - public static readonly T__15 = 16; - public static readonly T__16 = 17; - public static readonly T__17 = 18; - public static readonly T__18 = 19; - public static readonly T__19 = 20; - public static readonly T__20 = 21; - public static readonly T__21 = 22; - public static readonly T__22 = 23; - public static readonly NUMBER = 24; - public static readonly WHITESPACE = 25; - public static readonly IDENTIFIER = 26; - public static readonly NEWLINE = 27; - public static readonly STRING = 28; - public static readonly INVALID_TOKEN_DEFAULT_MODE = 29; - public static readonly RULE_file = 0; - public static readonly RULE_expression = 1; - public static readonly RULE_primaryExpression = 2; - public static readonly RULE_argsList = 3; - // tslint:disable:no-trailing-whitespace - public static readonly ruleNames: string[] = [ - "file", "expression", "primaryExpression", "argsList", - ]; - - private static readonly _LITERAL_NAMES: Array = [ - undefined, "'!'", "'-'", "'+'", "'^'", "'*'", "'/'", "'%'", "'=='", "'!='", - "'<>'", "'&'", "'<'", "'<='", "'>'", "'>='", "'&&'", "'||'", "'('", "')'", - "'.'", "'['", "']'", "','", - ]; - private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, "NUMBER", "WHITESPACE", "IDENTIFIER", - "NEWLINE", "STRING", "INVALID_TOKEN_DEFAULT_MODE", - ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(ExpressionParser._LITERAL_NAMES, ExpressionParser._SYMBOLIC_NAMES, []); - - // @Override - // @NotNull - public get vocabulary(): Vocabulary { - return ExpressionParser.VOCABULARY; - } - // tslint:enable:no-trailing-whitespace - - // @Override - public get grammarFileName(): string { return "Expression.g4"; } - - // @Override - public get ruleNames(): string[] { return ExpressionParser.ruleNames; } - - // @Override - public get serializedATN(): string { return ExpressionParser._serializedATN; } - - constructor(input: TokenStream) { - super(input); - this._interp = new ParserATNSimulator(ExpressionParser._ATN, this); - } - // @RuleVersion(0) - public file(): FileContext { - let _localctx: FileContext = new FileContext(this._ctx, this.state); - this.enterRule(_localctx, 0, ExpressionParser.RULE_file); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 8; - this.expression(0); - this.state = 9; - this.match(ExpressionParser.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; - } - - public expression(): ExpressionContext; - public expression(_p: number): ExpressionContext; - // @RuleVersion(0) - public expression(_p?: number): ExpressionContext { - if (_p === undefined) { - _p = 0; - } - - let _parentctx: ParserRuleContext = this._ctx; - let _parentState: number = this.state; - let _localctx: ExpressionContext = new ExpressionContext(this._ctx, _parentState); - let _prevctx: ExpressionContext = _localctx; - let _startState: number = 2; - this.enterRecursionRule(_localctx, 2, ExpressionParser.RULE_expression, _p); - let _la: number; - try { - let _alt: number; - this.enterOuterAlt(_localctx, 1); - { - this.state = 15; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case ExpressionParser.T__0: - case ExpressionParser.T__1: - case ExpressionParser.T__2: - { - _localctx = new UnaryOpExpContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 12; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionParser.T__0) | (1 << ExpressionParser.T__1) | (1 << ExpressionParser.T__2))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 13; - this.expression(10); - } - break; - case ExpressionParser.T__17: - case ExpressionParser.NUMBER: - case ExpressionParser.IDENTIFIER: - case ExpressionParser.STRING: - { - _localctx = new PrimaryExpContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 14; - this.primaryExpression(0); - } - break; - default: - throw new NoViableAltException(this); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 43; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - this.state = 41; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 1, this._ctx) ) { - case 1: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); - this.state = 17; - if (!(this.precpred(this._ctx, 9))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 9)"); - } - this.state = 18; - this.match(ExpressionParser.T__3); - this.state = 19; - this.expression(9); - } - break; - - case 2: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); - this.state = 20; - if (!(this.precpred(this._ctx, 8))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 8)"); - } - this.state = 21; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionParser.T__4) | (1 << ExpressionParser.T__5) | (1 << ExpressionParser.T__6))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 22; - this.expression(9); - } - break; - - case 3: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); - this.state = 23; - if (!(this.precpred(this._ctx, 7))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 7)"); - } - this.state = 24; - _la = this._input.LA(1); - if (!(_la === ExpressionParser.T__1 || _la === ExpressionParser.T__2)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 25; - this.expression(8); - } - break; - - case 4: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); - this.state = 26; - if (!(this.precpred(this._ctx, 6))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 6)"); - } - this.state = 27; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionParser.T__7) | (1 << ExpressionParser.T__8) | (1 << ExpressionParser.T__9))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 28; - this.expression(7); - } - break; - - case 5: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); - this.state = 29; - if (!(this.precpred(this._ctx, 5))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 5)"); - } - { - this.state = 30; - this.match(ExpressionParser.T__10); - } - this.state = 31; - this.expression(6); - } - break; - - case 6: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); - this.state = 32; - if (!(this.precpred(this._ctx, 4))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 4)"); - } - this.state = 33; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionParser.T__11) | (1 << ExpressionParser.T__12) | (1 << ExpressionParser.T__13) | (1 << ExpressionParser.T__14))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 34; - this.expression(5); - } - break; - - case 7: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); - this.state = 35; - if (!(this.precpred(this._ctx, 3))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 3)"); - } - this.state = 36; - this.match(ExpressionParser.T__15); - this.state = 37; - this.expression(4); - } - break; - - case 8: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); - this.state = 38; - if (!(this.precpred(this._ctx, 2))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 2)"); - } - this.state = 39; - this.match(ExpressionParser.T__16); - this.state = 40; - this.expression(3); - } - break; - } - } - } - this.state = 45; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); - } - } - } - catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } - finally { - this.unrollRecursionContexts(_parentctx); - } - return _localctx; - } - - public primaryExpression(): PrimaryExpressionContext; - public primaryExpression(_p: number): PrimaryExpressionContext; - // @RuleVersion(0) - public primaryExpression(_p?: number): PrimaryExpressionContext { - if (_p === undefined) { - _p = 0; - } - - let _parentctx: ParserRuleContext = this._ctx; - let _parentState: number = this.state; - let _localctx: PrimaryExpressionContext = new PrimaryExpressionContext(this._ctx, _parentState); - let _prevctx: PrimaryExpressionContext = _localctx; - let _startState: number = 4; - this.enterRecursionRule(_localctx, 4, ExpressionParser.RULE_primaryExpression, _p); - let _la: number; - try { - let _alt: number; - this.enterOuterAlt(_localctx, 1); - { - this.state = 54; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case ExpressionParser.T__17: - { - _localctx = new ParenthesisExpContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 47; - this.match(ExpressionParser.T__17); - this.state = 48; - this.expression(0); - this.state = 49; - this.match(ExpressionParser.T__18); - } - break; - case ExpressionParser.NUMBER: - { - _localctx = new NumericAtomContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 51; - this.match(ExpressionParser.NUMBER); - } - break; - case ExpressionParser.STRING: - { - _localctx = new StringAtomContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 52; - this.match(ExpressionParser.STRING); - } - break; - case ExpressionParser.IDENTIFIER: - { - _localctx = new IdAtomContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 53; - this.match(ExpressionParser.IDENTIFIER); - } - break; - default: - throw new NoViableAltException(this); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 72; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 6, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - this.state = 70; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 5, this._ctx) ) { - case 1: - { - _localctx = new MemberAccessExpContext(new PrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_primaryExpression); - this.state = 56; - if (!(this.precpred(this._ctx, 3))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 3)"); - } - this.state = 57; - this.match(ExpressionParser.T__19); - this.state = 58; - this.match(ExpressionParser.IDENTIFIER); - } - break; - - case 2: - { - _localctx = new FuncInvokeExpContext(new PrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_primaryExpression); - this.state = 59; - if (!(this.precpred(this._ctx, 2))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 2)"); - } - this.state = 60; - this.match(ExpressionParser.T__17); - this.state = 62; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionParser.T__0) | (1 << ExpressionParser.T__1) | (1 << ExpressionParser.T__2) | (1 << ExpressionParser.T__17) | (1 << ExpressionParser.NUMBER) | (1 << ExpressionParser.IDENTIFIER) | (1 << ExpressionParser.STRING))) !== 0)) { - { - this.state = 61; - this.argsList(); - } - } - - this.state = 64; - this.match(ExpressionParser.T__18); - } - break; - - case 3: - { - _localctx = new IndexAccessExpContext(new PrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_primaryExpression); - this.state = 65; - if (!(this.precpred(this._ctx, 1))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 1)"); - } - this.state = 66; - this.match(ExpressionParser.T__20); - this.state = 67; - this.expression(0); - this.state = 68; - this.match(ExpressionParser.T__21); - } - break; - } - } - } - this.state = 74; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 6, this._ctx); - } - } - } - catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } - finally { - this.unrollRecursionContexts(_parentctx); - } - return _localctx; - } - // @RuleVersion(0) - public argsList(): ArgsListContext { - let _localctx: ArgsListContext = new ArgsListContext(this._ctx, this.state); - this.enterRule(_localctx, 6, ExpressionParser.RULE_argsList); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 75; - this.expression(0); - this.state = 80; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === ExpressionParser.T__22) { - { - { - this.state = 76; - this.match(ExpressionParser.T__22); - this.state = 77; - this.expression(0); - } - } - this.state = 82; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - } - } - 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 sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { - switch (ruleIndex) { - case 1: - return this.expression_sempred(_localctx as ExpressionContext, predIndex); - - case 2: - return this.primaryExpression_sempred(_localctx as PrimaryExpressionContext, predIndex); - } - return true; - } - private expression_sempred(_localctx: ExpressionContext, predIndex: number): boolean { - switch (predIndex) { - case 0: - return this.precpred(this._ctx, 9); - - case 1: - return this.precpred(this._ctx, 8); - - case 2: - return this.precpred(this._ctx, 7); - - case 3: - return this.precpred(this._ctx, 6); - - case 4: - return this.precpred(this._ctx, 5); - - case 5: - return this.precpred(this._ctx, 4); - - case 6: - return this.precpred(this._ctx, 3); - - case 7: - return this.precpred(this._ctx, 2); - } - return true; - } - private primaryExpression_sempred(_localctx: PrimaryExpressionContext, predIndex: number): boolean { - switch (predIndex) { - case 8: - return this.precpred(this._ctx, 3); - - case 9: - return this.precpred(this._ctx, 2); - - case 10: - return this.precpred(this._ctx, 1); - } - return true; - } - - public static readonly _serializedATN: string = - "\x03\uAF6F\u8320\u479D\uB75C\u4880\u1605\u191C\uAB37\x03\x1FV\x04\x02" + - "\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x03\x02\x03\x02\x03\x02" + - "\x03\x03\x03\x03\x03\x03\x03\x03\x05\x03\x12\n\x03\x03\x03\x03\x03\x03" + - "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + - "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + - "\x03\x03\x03\x03\x03\x03\x03\x07\x03,\n\x03\f\x03\x0E\x03/\v\x03\x03\x04" + - "\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x05\x049\n\x04" + - "\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x05\x04A\n\x04\x03\x04" + - "\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x07\x04I\n\x04\f\x04\x0E\x04" + - "L\v\x04\x03\x05\x03\x05\x03\x05\x07\x05Q\n\x05\f\x05\x0E\x05T\v\x05\x03" + - "\x05\x02\x02\x04\x04\x06\x06\x02\x02\x04\x02\x06\x02\b\x02\x02\x07\x03" + - "\x02\x03\x05\x03\x02\x07\t\x03\x02\x04\x05\x03\x02\n\f\x03\x02\x0E\x11" + - "b\x02\n\x03\x02\x02\x02\x04\x11\x03\x02\x02\x02\x068\x03\x02\x02\x02\b" + - "M\x03\x02\x02\x02\n\v\x05\x04\x03\x02\v\f\x07\x02\x02\x03\f\x03\x03\x02" + - "\x02\x02\r\x0E\b\x03\x01\x02\x0E\x0F\t\x02\x02\x02\x0F\x12\x05\x04\x03" + - "\f\x10\x12\x05\x06\x04\x02\x11\r\x03\x02\x02\x02\x11\x10\x03\x02\x02\x02" + - "\x12-\x03\x02\x02\x02\x13\x14\f\v\x02\x02\x14\x15\x07\x06\x02\x02\x15" + - ",\x05\x04\x03\v\x16\x17\f\n\x02\x02\x17\x18\t\x03\x02\x02\x18,\x05\x04" + - "\x03\v\x19\x1A\f\t\x02\x02\x1A\x1B\t\x04\x02\x02\x1B,\x05\x04\x03\n\x1C" + - "\x1D\f\b\x02\x02\x1D\x1E\t\x05\x02\x02\x1E,\x05\x04\x03\t\x1F \f\x07\x02" + - "\x02 !\x07\r\x02\x02!,\x05\x04\x03\b\"#\f\x06\x02\x02#$\t\x06\x02\x02" + - "$,\x05\x04\x03\x07%&\f\x05\x02\x02&\'\x07\x12\x02\x02\',\x05\x04\x03\x06" + - "()\f\x04\x02\x02)*\x07\x13\x02\x02*,\x05\x04\x03\x05+\x13\x03\x02\x02" + - "\x02+\x16\x03\x02\x02\x02+\x19\x03\x02\x02\x02+\x1C\x03\x02\x02\x02+\x1F" + - "\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.\x05\x03\x02\x02" + - "\x02/-\x03\x02\x02\x0201\b\x04\x01\x0212\x07\x14\x02\x0223\x05\x04\x03" + - "\x0234\x07\x15\x02\x0249\x03\x02\x02\x0259\x07\x1A\x02\x0269\x07\x1E\x02" + - "\x0279\x07\x1C\x02\x0280\x03\x02\x02\x0285\x03\x02\x02\x0286\x03\x02\x02" + - "\x0287\x03\x02\x02\x029J\x03\x02\x02\x02:;\f\x05\x02\x02;<\x07\x16\x02" + - "\x02\f\x04\x02\x02>@\x07\x14\x02\x02?A\x05\b\x05\x02" + - "@?\x03\x02\x02\x02@A\x03\x02\x02\x02AB\x03\x02\x02\x02BI\x07\x15\x02\x02" + - "CD\f\x03\x02\x02DE\x07\x17\x02\x02EF\x05\x04\x03\x02FG\x07\x18\x02\x02" + - "GI\x03\x02\x02\x02H:\x03\x02\x02\x02H=\x03\x02\x02\x02HC\x03\x02\x02\x02" + - "IL\x03\x02\x02\x02JH\x03\x02\x02\x02JK\x03\x02\x02\x02K\x07\x03\x02\x02" + - "\x02LJ\x03\x02\x02\x02MR\x05\x04\x03\x02NO\x07\x19\x02\x02OQ\x05\x04\x03" + - "\x02PN\x03\x02\x02\x02QT\x03\x02\x02\x02RP\x03\x02\x02\x02RS\x03\x02\x02" + - "\x02S\t\x03\x02\x02\x02TR\x03\x02\x02\x02\n\x11+-8@HJR"; - public static __ATN: ATN; - public static get _ATN(): ATN { - if (!ExpressionParser.__ATN) { - ExpressionParser.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(ExpressionParser._serializedATN)); - } - - return ExpressionParser.__ATN; - } - -} - -export class FileContext extends ParserRuleContext { - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); - } - public EOF(): TerminalNode { return this.getToken(ExpressionParser.EOF, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return ExpressionParser.RULE_file; } - // @Override - public enterRule(listener: ExpressionListener): void { - if (listener.enterFile) { - listener.enterFile(this); - } - } - // @Override - public exitRule(listener: ExpressionListener): void { - if (listener.exitFile) { - listener.exitFile(this); - } - } - // @Override - public accept(visitor: ExpressionVisitor): Result { - if (visitor.visitFile) { - return visitor.visitFile(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class ExpressionContext extends ParserRuleContext { - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return ExpressionParser.RULE_expression; } - public copyFrom(ctx: ExpressionContext): void { - super.copyFrom(ctx); - } -} -export class UnaryOpExpContext extends ExpressionContext { - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); - } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionListener): void { - if (listener.enterUnaryOpExp) { - listener.enterUnaryOpExp(this); - } - } - // @Override - public exitRule(listener: ExpressionListener): void { - if (listener.exitUnaryOpExp) { - listener.exitUnaryOpExp(this); - } - } - // @Override - public accept(visitor: ExpressionVisitor): Result { - if (visitor.visitUnaryOpExp) { - return visitor.visitUnaryOpExp(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class BinaryOpExpContext extends ExpressionContext { - public expression(): ExpressionContext[]; - public expression(i: number): ExpressionContext; - public expression(i?: number): ExpressionContext | ExpressionContext[] { - if (i === undefined) { - return this.getRuleContexts(ExpressionContext); - } else { - return this.getRuleContext(i, ExpressionContext); - } - } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionListener): void { - if (listener.enterBinaryOpExp) { - listener.enterBinaryOpExp(this); - } - } - // @Override - public exitRule(listener: ExpressionListener): void { - if (listener.exitBinaryOpExp) { - listener.exitBinaryOpExp(this); - } - } - // @Override - public accept(visitor: ExpressionVisitor): Result { - if (visitor.visitBinaryOpExp) { - return visitor.visitBinaryOpExp(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class PrimaryExpContext extends ExpressionContext { - public primaryExpression(): PrimaryExpressionContext { - return this.getRuleContext(0, PrimaryExpressionContext); - } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionListener): void { - if (listener.enterPrimaryExp) { - listener.enterPrimaryExp(this); - } - } - // @Override - public exitRule(listener: ExpressionListener): void { - if (listener.exitPrimaryExp) { - listener.exitPrimaryExp(this); - } - } - // @Override - public accept(visitor: ExpressionVisitor): Result { - if (visitor.visitPrimaryExp) { - return visitor.visitPrimaryExp(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class PrimaryExpressionContext extends ParserRuleContext { - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return ExpressionParser.RULE_primaryExpression; } - public copyFrom(ctx: PrimaryExpressionContext): void { - super.copyFrom(ctx); - } -} -export class FuncInvokeExpContext extends PrimaryExpressionContext { - public primaryExpression(): PrimaryExpressionContext { - return this.getRuleContext(0, PrimaryExpressionContext); - } - public argsList(): ArgsListContext | undefined { - return this.tryGetRuleContext(0, ArgsListContext); - } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionListener): void { - if (listener.enterFuncInvokeExp) { - listener.enterFuncInvokeExp(this); - } - } - // @Override - public exitRule(listener: ExpressionListener): void { - if (listener.exitFuncInvokeExp) { - listener.exitFuncInvokeExp(this); - } - } - // @Override - public accept(visitor: ExpressionVisitor): Result { - if (visitor.visitFuncInvokeExp) { - return visitor.visitFuncInvokeExp(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class IdAtomContext extends PrimaryExpressionContext { - public IDENTIFIER(): TerminalNode { return this.getToken(ExpressionParser.IDENTIFIER, 0); } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionListener): void { - if (listener.enterIdAtom) { - listener.enterIdAtom(this); - } - } - // @Override - public exitRule(listener: ExpressionListener): void { - if (listener.exitIdAtom) { - listener.exitIdAtom(this); - } - } - // @Override - public accept(visitor: ExpressionVisitor): Result { - if (visitor.visitIdAtom) { - return visitor.visitIdAtom(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class StringAtomContext extends PrimaryExpressionContext { - public STRING(): TerminalNode { return this.getToken(ExpressionParser.STRING, 0); } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionListener): void { - if (listener.enterStringAtom) { - listener.enterStringAtom(this); - } - } - // @Override - public exitRule(listener: ExpressionListener): void { - if (listener.exitStringAtom) { - listener.exitStringAtom(this); - } - } - // @Override - public accept(visitor: ExpressionVisitor): Result { - if (visitor.visitStringAtom) { - return visitor.visitStringAtom(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class IndexAccessExpContext extends PrimaryExpressionContext { - public primaryExpression(): PrimaryExpressionContext { - return this.getRuleContext(0, PrimaryExpressionContext); - } - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); - } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionListener): void { - if (listener.enterIndexAccessExp) { - listener.enterIndexAccessExp(this); - } - } - // @Override - public exitRule(listener: ExpressionListener): void { - if (listener.exitIndexAccessExp) { - listener.exitIndexAccessExp(this); - } - } - // @Override - public accept(visitor: ExpressionVisitor): Result { - if (visitor.visitIndexAccessExp) { - return visitor.visitIndexAccessExp(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class MemberAccessExpContext extends PrimaryExpressionContext { - public primaryExpression(): PrimaryExpressionContext { - return this.getRuleContext(0, PrimaryExpressionContext); - } - public IDENTIFIER(): TerminalNode { return this.getToken(ExpressionParser.IDENTIFIER, 0); } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionListener): void { - if (listener.enterMemberAccessExp) { - listener.enterMemberAccessExp(this); - } - } - // @Override - public exitRule(listener: ExpressionListener): void { - if (listener.exitMemberAccessExp) { - listener.exitMemberAccessExp(this); - } - } - // @Override - public accept(visitor: ExpressionVisitor): Result { - if (visitor.visitMemberAccessExp) { - return visitor.visitMemberAccessExp(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class ParenthesisExpContext extends PrimaryExpressionContext { - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); - } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionListener): void { - if (listener.enterParenthesisExp) { - listener.enterParenthesisExp(this); - } - } - // @Override - public exitRule(listener: ExpressionListener): void { - if (listener.exitParenthesisExp) { - listener.exitParenthesisExp(this); - } - } - // @Override - public accept(visitor: ExpressionVisitor): Result { - if (visitor.visitParenthesisExp) { - return visitor.visitParenthesisExp(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class NumericAtomContext extends PrimaryExpressionContext { - public NUMBER(): TerminalNode { return this.getToken(ExpressionParser.NUMBER, 0); } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionListener): void { - if (listener.enterNumericAtom) { - listener.enterNumericAtom(this); - } - } - // @Override - public exitRule(listener: ExpressionListener): void { - if (listener.exitNumericAtom) { - listener.exitNumericAtom(this); - } - } - // @Override - public accept(visitor: ExpressionVisitor): Result { - if (visitor.visitNumericAtom) { - return visitor.visitNumericAtom(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class ArgsListContext extends ParserRuleContext { - public expression(): ExpressionContext[]; - public expression(i: number): ExpressionContext; - public expression(i?: number): ExpressionContext | ExpressionContext[] { - if (i === undefined) { - return this.getRuleContexts(ExpressionContext); - } else { - return this.getRuleContext(i, ExpressionContext); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return ExpressionParser.RULE_argsList; } - // @Override - public enterRule(listener: ExpressionListener): void { - if (listener.enterArgsList) { - listener.enterArgsList(this); - } - } - // @Override - public exitRule(listener: ExpressionListener): void { - if (listener.exitArgsList) { - listener.exitArgsList(this); - } - } - // @Override - public accept(visitor: ExpressionVisitor): Result { - if (visitor.visitArgsList) { - return visitor.visitArgsList(this); - } else { - return visitor.visitChildren(this); - } - } -} - - +// Generated from ../Expression.g4 by ANTLR 4.6-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 { ExpressionListener } from "./ExpressionListener"; +import { ExpressionVisitor } from "./ExpressionVisitor"; + + +export class ExpressionParser 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 T__13 = 14; + public static readonly T__14 = 15; + public static readonly T__15 = 16; + public static readonly T__16 = 17; + public static readonly T__17 = 18; + public static readonly T__18 = 19; + public static readonly T__19 = 20; + public static readonly T__20 = 21; + public static readonly T__21 = 22; + public static readonly T__22 = 23; + public static readonly NUMBER = 24; + public static readonly WHITESPACE = 25; + public static readonly IDENTIFIER = 26; + public static readonly NEWLINE = 27; + public static readonly STRING = 28; + public static readonly CONSTANT = 29; + public static readonly INVALID_TOKEN_DEFAULT_MODE = 30; + public static readonly RULE_file = 0; + public static readonly RULE_expression = 1; + public static readonly RULE_primaryExpression = 2; + public static readonly RULE_argsList = 3; + // tslint:disable:no-trailing-whitespace + public static readonly ruleNames: string[] = [ + "file", "expression", "primaryExpression", "argsList", + ]; + + private static readonly _LITERAL_NAMES: Array = [ + undefined, "'!'", "'-'", "'+'", "'^'", "'*'", "'/'", "'%'", "'=='", "'!='", + "'<>'", "'&'", "'<'", "'<='", "'>'", "'>='", "'&&'", "'||'", "'('", "')'", + "'.'", "'['", "']'", "','", + ]; + private static readonly _SYMBOLIC_NAMES: Array = [ + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, "NUMBER", "WHITESPACE", "IDENTIFIER", + "NEWLINE", "STRING", "CONSTANT", "INVALID_TOKEN_DEFAULT_MODE", + ]; + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(ExpressionParser._LITERAL_NAMES, ExpressionParser._SYMBOLIC_NAMES, []); + + // @Override + // @NotNull + public get vocabulary(): Vocabulary { + return ExpressionParser.VOCABULARY; + } + // tslint:enable:no-trailing-whitespace + + // @Override + public get grammarFileName(): string { return "Expression.g4"; } + + // @Override + public get ruleNames(): string[] { return ExpressionParser.ruleNames; } + + // @Override + public get serializedATN(): string { return ExpressionParser._serializedATN; } + + constructor(input: TokenStream) { + super(input); + this._interp = new ParserATNSimulator(ExpressionParser._ATN, this); + } + // @RuleVersion(0) + public file(): FileContext { + let _localctx: FileContext = new FileContext(this._ctx, this.state); + this.enterRule(_localctx, 0, ExpressionParser.RULE_file); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 8; + this.expression(0); + this.state = 9; + this.match(ExpressionParser.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; + } + + public expression(): ExpressionContext; + public expression(_p: number): ExpressionContext; + // @RuleVersion(0) + public expression(_p?: number): ExpressionContext { + if (_p === undefined) { + _p = 0; + } + + let _parentctx: ParserRuleContext = this._ctx; + let _parentState: number = this.state; + let _localctx: ExpressionContext = new ExpressionContext(this._ctx, _parentState); + let _prevctx: ExpressionContext = _localctx; + let _startState: number = 2; + this.enterRecursionRule(_localctx, 2, ExpressionParser.RULE_expression, _p); + let _la: number; + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 15; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case ExpressionParser.T__0: + case ExpressionParser.T__1: + case ExpressionParser.T__2: + { + _localctx = new UnaryOpExpContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 12; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionParser.T__0) | (1 << ExpressionParser.T__1) | (1 << ExpressionParser.T__2))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 13; + this.expression(10); + } + break; + case ExpressionParser.T__17: + case ExpressionParser.NUMBER: + case ExpressionParser.IDENTIFIER: + case ExpressionParser.STRING: + case ExpressionParser.CONSTANT: + { + _localctx = new PrimaryExpContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 14; + this.primaryExpression(0); + } + break; + default: + throw new NoViableAltException(this); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 43; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + this.state = 41; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 1, this._ctx) ) { + case 1: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); + this.state = 17; + if (!(this.precpred(this._ctx, 9))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 9)"); + } + this.state = 18; + this.match(ExpressionParser.T__3); + this.state = 19; + this.expression(9); + } + break; + + case 2: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); + this.state = 20; + if (!(this.precpred(this._ctx, 8))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 8)"); + } + this.state = 21; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionParser.T__4) | (1 << ExpressionParser.T__5) | (1 << ExpressionParser.T__6))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 22; + this.expression(9); + } + break; + + case 3: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); + this.state = 23; + if (!(this.precpred(this._ctx, 7))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 7)"); + } + this.state = 24; + _la = this._input.LA(1); + if (!(_la === ExpressionParser.T__1 || _la === ExpressionParser.T__2)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 25; + this.expression(8); + } + break; + + case 4: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); + this.state = 26; + if (!(this.precpred(this._ctx, 6))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 6)"); + } + this.state = 27; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionParser.T__7) | (1 << ExpressionParser.T__8) | (1 << ExpressionParser.T__9))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 28; + this.expression(7); + } + break; + + case 5: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); + this.state = 29; + if (!(this.precpred(this._ctx, 5))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 5)"); + } + { + this.state = 30; + this.match(ExpressionParser.T__10); + } + this.state = 31; + this.expression(6); + } + break; + + case 6: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); + this.state = 32; + if (!(this.precpred(this._ctx, 4))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 4)"); + } + this.state = 33; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionParser.T__11) | (1 << ExpressionParser.T__12) | (1 << ExpressionParser.T__13) | (1 << ExpressionParser.T__14))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 34; + this.expression(5); + } + break; + + case 7: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); + this.state = 35; + if (!(this.precpred(this._ctx, 3))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 3)"); + } + this.state = 36; + this.match(ExpressionParser.T__15); + this.state = 37; + this.expression(4); + } + break; + + case 8: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_expression); + this.state = 38; + if (!(this.precpred(this._ctx, 2))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 2)"); + } + this.state = 39; + this.match(ExpressionParser.T__16); + this.state = 40; + this.expression(3); + } + break; + } + } + } + this.state = 45; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); + } + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.unrollRecursionContexts(_parentctx); + } + return _localctx; + } + + public primaryExpression(): PrimaryExpressionContext; + public primaryExpression(_p: number): PrimaryExpressionContext; + // @RuleVersion(0) + public primaryExpression(_p?: number): PrimaryExpressionContext { + if (_p === undefined) { + _p = 0; + } + + let _parentctx: ParserRuleContext = this._ctx; + let _parentState: number = this.state; + let _localctx: PrimaryExpressionContext = new PrimaryExpressionContext(this._ctx, _parentState); + let _prevctx: PrimaryExpressionContext = _localctx; + let _startState: number = 4; + this.enterRecursionRule(_localctx, 4, ExpressionParser.RULE_primaryExpression, _p); + let _la: number; + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 55; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case ExpressionParser.T__17: + { + _localctx = new ParenthesisExpContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 47; + this.match(ExpressionParser.T__17); + this.state = 48; + this.expression(0); + this.state = 49; + this.match(ExpressionParser.T__18); + } + break; + case ExpressionParser.CONSTANT: + { + _localctx = new ConstantAtomContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 51; + this.match(ExpressionParser.CONSTANT); + } + break; + case ExpressionParser.NUMBER: + { + _localctx = new NumericAtomContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 52; + this.match(ExpressionParser.NUMBER); + } + break; + case ExpressionParser.STRING: + { + _localctx = new StringAtomContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 53; + this.match(ExpressionParser.STRING); + } + break; + case ExpressionParser.IDENTIFIER: + { + _localctx = new IdAtomContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 54; + this.match(ExpressionParser.IDENTIFIER); + } + break; + default: + throw new NoViableAltException(this); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 73; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 6, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + this.state = 71; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 5, this._ctx) ) { + case 1: + { + _localctx = new MemberAccessExpContext(new PrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_primaryExpression); + this.state = 57; + if (!(this.precpred(this._ctx, 3))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 3)"); + } + this.state = 58; + this.match(ExpressionParser.T__19); + this.state = 59; + this.match(ExpressionParser.IDENTIFIER); + } + break; + + case 2: + { + _localctx = new FuncInvokeExpContext(new PrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_primaryExpression); + this.state = 60; + if (!(this.precpred(this._ctx, 2))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 2)"); + } + this.state = 61; + this.match(ExpressionParser.T__17); + this.state = 63; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionParser.T__0) | (1 << ExpressionParser.T__1) | (1 << ExpressionParser.T__2) | (1 << ExpressionParser.T__17) | (1 << ExpressionParser.NUMBER) | (1 << ExpressionParser.IDENTIFIER) | (1 << ExpressionParser.STRING) | (1 << ExpressionParser.CONSTANT))) !== 0)) { + { + this.state = 62; + this.argsList(); + } + } + + this.state = 65; + this.match(ExpressionParser.T__18); + } + break; + + case 3: + { + _localctx = new IndexAccessExpContext(new PrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionParser.RULE_primaryExpression); + this.state = 66; + if (!(this.precpred(this._ctx, 1))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 1)"); + } + this.state = 67; + this.match(ExpressionParser.T__20); + this.state = 68; + this.expression(0); + this.state = 69; + this.match(ExpressionParser.T__21); + } + break; + } + } + } + this.state = 75; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 6, this._ctx); + } + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.unrollRecursionContexts(_parentctx); + } + return _localctx; + } + // @RuleVersion(0) + public argsList(): ArgsListContext { + let _localctx: ArgsListContext = new ArgsListContext(this._ctx, this.state); + this.enterRule(_localctx, 6, ExpressionParser.RULE_argsList); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 76; + this.expression(0); + this.state = 81; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === ExpressionParser.T__22) { + { + { + this.state = 77; + this.match(ExpressionParser.T__22); + this.state = 78; + this.expression(0); + } + } + this.state = 83; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + 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 sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { + switch (ruleIndex) { + case 1: + return this.expression_sempred(_localctx as ExpressionContext, predIndex); + + case 2: + return this.primaryExpression_sempred(_localctx as PrimaryExpressionContext, predIndex); + } + return true; + } + private expression_sempred(_localctx: ExpressionContext, predIndex: number): boolean { + switch (predIndex) { + case 0: + return this.precpred(this._ctx, 9); + + case 1: + return this.precpred(this._ctx, 8); + + case 2: + return this.precpred(this._ctx, 7); + + case 3: + return this.precpred(this._ctx, 6); + + case 4: + return this.precpred(this._ctx, 5); + + case 5: + return this.precpred(this._ctx, 4); + + case 6: + return this.precpred(this._ctx, 3); + + case 7: + return this.precpred(this._ctx, 2); + } + return true; + } + private primaryExpression_sempred(_localctx: PrimaryExpressionContext, predIndex: number): boolean { + switch (predIndex) { + case 8: + return this.precpred(this._ctx, 3); + + case 9: + return this.precpred(this._ctx, 2); + + case 10: + return this.precpred(this._ctx, 1); + } + return true; + } + + public static readonly _serializedATN: string = + "\x03\uAF6F\u8320\u479D\uB75C\u4880\u1605\u191C\uAB37\x03 W\x04\x02\t\x02" + + "\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x03\x02\x03\x02\x03\x02\x03" + + "\x03\x03\x03\x03\x03\x03\x03\x05\x03\x12\n\x03\x03\x03\x03\x03\x03\x03" + + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + + "\x03\x03\x03\x03\x03\x03\x07\x03,\n\x03\f\x03\x0E\x03/\v\x03\x03\x04\x03" + + "\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x05\x04:" + + "\n\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x05\x04B\n\x04" + + "\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x07\x04J\n\x04\f\x04" + + "\x0E\x04M\v\x04\x03\x05\x03\x05\x03\x05\x07\x05R\n\x05\f\x05\x0E\x05U" + + "\v\x05\x03\x05\x02\x02\x04\x04\x06\x06\x02\x02\x04\x02\x06\x02\b\x02\x02" + + "\x07\x03\x02\x03\x05\x03\x02\x07\t\x03\x02\x04\x05\x03\x02\n\f\x03\x02" + + "\x0E\x11d\x02\n\x03\x02\x02\x02\x04\x11\x03\x02\x02\x02\x069\x03\x02\x02" + + "\x02\bN\x03\x02\x02\x02\n\v\x05\x04\x03\x02\v\f\x07\x02\x02\x03\f\x03" + + "\x03\x02\x02\x02\r\x0E\b\x03\x01\x02\x0E\x0F\t\x02\x02\x02\x0F\x12\x05" + + "\x04\x03\f\x10\x12\x05\x06\x04\x02\x11\r\x03\x02\x02\x02\x11\x10\x03\x02" + + "\x02\x02\x12-\x03\x02\x02\x02\x13\x14\f\v\x02\x02\x14\x15\x07\x06\x02" + + "\x02\x15,\x05\x04\x03\v\x16\x17\f\n\x02\x02\x17\x18\t\x03\x02\x02\x18" + + ",\x05\x04\x03\v\x19\x1A\f\t\x02\x02\x1A\x1B\t\x04\x02\x02\x1B,\x05\x04" + + "\x03\n\x1C\x1D\f\b\x02\x02\x1D\x1E\t\x05\x02\x02\x1E,\x05\x04\x03\t\x1F" + + " \f\x07\x02\x02 !\x07\r\x02\x02!,\x05\x04\x03\b\"#\f\x06\x02\x02#$\t\x06" + + "\x02\x02$,\x05\x04\x03\x07%&\f\x05\x02\x02&\'\x07\x12\x02\x02\',\x05\x04" + + "\x03\x06()\f\x04\x02\x02)*\x07\x13\x02\x02*,\x05\x04\x03\x05+\x13\x03" + + "\x02\x02\x02+\x16\x03\x02\x02\x02+\x19\x03\x02\x02\x02+\x1C\x03\x02\x02" + + "\x02+\x1F\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.\x05\x03" + + "\x02\x02\x02/-\x03\x02\x02\x0201\b\x04\x01\x0212\x07\x14\x02\x0223\x05" + + "\x04\x03\x0234\x07\x15\x02\x024:\x03\x02\x02\x025:\x07\x1F\x02\x026:\x07" + + "\x1A\x02\x027:\x07\x1E\x02\x028:\x07\x1C\x02\x0290\x03\x02\x02\x0295\x03" + + "\x02\x02\x0296\x03\x02\x02\x0297\x03\x02\x02\x0298\x03\x02\x02\x02:K\x03" + + "\x02\x02\x02;<\f\x05\x02\x02<=\x07\x16\x02\x02=J\x07\x1C\x02\x02>?\f\x04" + + "\x02\x02?A\x07\x14\x02\x02@B\x05\b\x05\x02A@\x03\x02\x02\x02AB\x03\x02" + + "\x02\x02BC\x03\x02\x02\x02CJ\x07\x15\x02\x02DE\f\x03\x02\x02EF\x07\x17" + + "\x02\x02FG\x05\x04\x03\x02GH\x07\x18\x02\x02HJ\x03\x02\x02\x02I;\x03\x02" + + "\x02\x02I>\x03\x02\x02\x02ID\x03\x02\x02\x02JM\x03\x02\x02\x02KI\x03\x02" + + "\x02\x02KL\x03\x02\x02\x02L\x07\x03\x02\x02\x02MK\x03\x02\x02\x02NS\x05" + + "\x04\x03\x02OP\x07\x19\x02\x02PR\x05\x04\x03\x02QO\x03\x02\x02\x02RU\x03" + + "\x02\x02\x02SQ\x03\x02\x02\x02ST\x03\x02\x02\x02T\t\x03\x02\x02\x02US" + + "\x03\x02\x02\x02\n\x11+-9AIKS"; + public static __ATN: ATN; + public static get _ATN(): ATN { + if (!ExpressionParser.__ATN) { + ExpressionParser.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(ExpressionParser._serializedATN)); + } + + return ExpressionParser.__ATN; + } + +} + +export class FileContext extends ParserRuleContext { + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); + } + public EOF(): TerminalNode { return this.getToken(ExpressionParser.EOF, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return ExpressionParser.RULE_file; } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterFile) { + listener.enterFile(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitFile) { + listener.exitFile(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitFile) { + return visitor.visitFile(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ExpressionContext extends ParserRuleContext { + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return ExpressionParser.RULE_expression; } + public copyFrom(ctx: ExpressionContext): void { + super.copyFrom(ctx); + } +} +export class UnaryOpExpContext extends ExpressionContext { + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); + } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterUnaryOpExp) { + listener.enterUnaryOpExp(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitUnaryOpExp) { + listener.exitUnaryOpExp(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitUnaryOpExp) { + return visitor.visitUnaryOpExp(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class BinaryOpExpContext extends ExpressionContext { + public expression(): ExpressionContext[]; + public expression(i: number): ExpressionContext; + public expression(i?: number): ExpressionContext | ExpressionContext[] { + if (i === undefined) { + return this.getRuleContexts(ExpressionContext); + } else { + return this.getRuleContext(i, ExpressionContext); + } + } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterBinaryOpExp) { + listener.enterBinaryOpExp(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitBinaryOpExp) { + listener.exitBinaryOpExp(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitBinaryOpExp) { + return visitor.visitBinaryOpExp(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class PrimaryExpContext extends ExpressionContext { + public primaryExpression(): PrimaryExpressionContext { + return this.getRuleContext(0, PrimaryExpressionContext); + } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterPrimaryExp) { + listener.enterPrimaryExp(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitPrimaryExp) { + listener.exitPrimaryExp(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitPrimaryExp) { + return visitor.visitPrimaryExp(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class PrimaryExpressionContext extends ParserRuleContext { + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return ExpressionParser.RULE_primaryExpression; } + public copyFrom(ctx: PrimaryExpressionContext): void { + super.copyFrom(ctx); + } +} +export class FuncInvokeExpContext extends PrimaryExpressionContext { + public primaryExpression(): PrimaryExpressionContext { + return this.getRuleContext(0, PrimaryExpressionContext); + } + public argsList(): ArgsListContext | undefined { + return this.tryGetRuleContext(0, ArgsListContext); + } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterFuncInvokeExp) { + listener.enterFuncInvokeExp(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitFuncInvokeExp) { + listener.exitFuncInvokeExp(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitFuncInvokeExp) { + return visitor.visitFuncInvokeExp(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class ConstantAtomContext extends PrimaryExpressionContext { + public CONSTANT(): TerminalNode { return this.getToken(ExpressionParser.CONSTANT, 0); } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterConstantAtom) { + listener.enterConstantAtom(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitConstantAtom) { + listener.exitConstantAtom(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitConstantAtom) { + return visitor.visitConstantAtom(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class IdAtomContext extends PrimaryExpressionContext { + public IDENTIFIER(): TerminalNode { return this.getToken(ExpressionParser.IDENTIFIER, 0); } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterIdAtom) { + listener.enterIdAtom(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitIdAtom) { + listener.exitIdAtom(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitIdAtom) { + return visitor.visitIdAtom(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class StringAtomContext extends PrimaryExpressionContext { + public STRING(): TerminalNode { return this.getToken(ExpressionParser.STRING, 0); } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterStringAtom) { + listener.enterStringAtom(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitStringAtom) { + listener.exitStringAtom(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitStringAtom) { + return visitor.visitStringAtom(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class IndexAccessExpContext extends PrimaryExpressionContext { + public primaryExpression(): PrimaryExpressionContext { + return this.getRuleContext(0, PrimaryExpressionContext); + } + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); + } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterIndexAccessExp) { + listener.enterIndexAccessExp(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitIndexAccessExp) { + listener.exitIndexAccessExp(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitIndexAccessExp) { + return visitor.visitIndexAccessExp(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class MemberAccessExpContext extends PrimaryExpressionContext { + public primaryExpression(): PrimaryExpressionContext { + return this.getRuleContext(0, PrimaryExpressionContext); + } + public IDENTIFIER(): TerminalNode { return this.getToken(ExpressionParser.IDENTIFIER, 0); } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterMemberAccessExp) { + listener.enterMemberAccessExp(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitMemberAccessExp) { + listener.exitMemberAccessExp(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitMemberAccessExp) { + return visitor.visitMemberAccessExp(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class ParenthesisExpContext extends PrimaryExpressionContext { + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); + } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterParenthesisExp) { + listener.enterParenthesisExp(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitParenthesisExp) { + listener.exitParenthesisExp(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitParenthesisExp) { + return visitor.visitParenthesisExp(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class NumericAtomContext extends PrimaryExpressionContext { + public NUMBER(): TerminalNode { return this.getToken(ExpressionParser.NUMBER, 0); } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterNumericAtom) { + listener.enterNumericAtom(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitNumericAtom) { + listener.exitNumericAtom(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitNumericAtom) { + return visitor.visitNumericAtom(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ArgsListContext extends ParserRuleContext { + public expression(): ExpressionContext[]; + public expression(i: number): ExpressionContext; + public expression(i?: number): ExpressionContext | ExpressionContext[] { + if (i === undefined) { + return this.getRuleContexts(ExpressionContext); + } else { + return this.getRuleContext(i, ExpressionContext); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return ExpressionParser.RULE_argsList; } + // @Override + public enterRule(listener: ExpressionListener): void { + if (listener.enterArgsList) { + listener.enterArgsList(this); + } + } + // @Override + public exitRule(listener: ExpressionListener): void { + if (listener.exitArgsList) { + listener.exitArgsList(this); + } + } + // @Override + public accept(visitor: ExpressionVisitor): Result { + if (visitor.visitArgsList) { + return visitor.visitArgsList(this); + } else { + return visitor.visitChildren(this); + } + } +} + + diff --git a/libraries/adaptive-expressions/src/parser/generated/ExpressionVisitor.ts b/libraries/adaptive-expressions/src/parser/generated/ExpressionVisitor.ts index bcb33f2483..1d9d478813 100644 --- a/libraries/adaptive-expressions/src/parser/generated/ExpressionVisitor.ts +++ b/libraries/adaptive-expressions/src/parser/generated/ExpressionVisitor.ts @@ -1,145 +1,147 @@ -/** - * @module adaptive-expressions - */ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. - */ -// Generated from ../Expression.g4 by ANTLR 4.6-SNAPSHOT - - -import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; - -import { FuncInvokeExpContext } from "./ExpressionParser"; -import { IdAtomContext } from "./ExpressionParser"; -import { StringAtomContext } from "./ExpressionParser"; -import { IndexAccessExpContext } from "./ExpressionParser"; -import { MemberAccessExpContext } from "./ExpressionParser"; -import { ParenthesisExpContext } from "./ExpressionParser"; -import { NumericAtomContext } from "./ExpressionParser"; -import { UnaryOpExpContext } from "./ExpressionParser"; -import { BinaryOpExpContext } from "./ExpressionParser"; -import { PrimaryExpContext } from "./ExpressionParser"; -import { FileContext } from "./ExpressionParser"; -import { ExpressionContext } from "./ExpressionParser"; -import { PrimaryExpressionContext } from "./ExpressionParser"; -import { ArgsListContext } from "./ExpressionParser"; - - -/** - * This interface defines a complete generic visitor for a parse tree produced - * by `ExpressionParser`. - * - * @param The return type of the visit operation. Use `void` for - * operations with no return type. - */ -export interface ExpressionVisitor extends ParseTreeVisitor { - /** - * Visit a parse tree produced by the `funcInvokeExp` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitFuncInvokeExp?: (ctx: FuncInvokeExpContext) => Result; - - /** - * Visit a parse tree produced by the `idAtom` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitIdAtom?: (ctx: IdAtomContext) => Result; - - /** - * Visit a parse tree produced by the `stringAtom` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitStringAtom?: (ctx: StringAtomContext) => Result; - - /** - * Visit a parse tree produced by the `indexAccessExp` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitIndexAccessExp?: (ctx: IndexAccessExpContext) => Result; - - /** - * Visit a parse tree produced by the `memberAccessExp` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitMemberAccessExp?: (ctx: MemberAccessExpContext) => Result; - - /** - * Visit a parse tree produced by the `parenthesisExp` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitParenthesisExp?: (ctx: ParenthesisExpContext) => Result; - - /** - * Visit a parse tree produced by the `numericAtom` - * labeled alternative in `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitNumericAtom?: (ctx: NumericAtomContext) => Result; - - /** - * Visit a parse tree produced by the `unaryOpExp` - * labeled alternative in `ExpressionParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitUnaryOpExp?: (ctx: UnaryOpExpContext) => Result; - - /** - * Visit a parse tree produced by the `binaryOpExp` - * labeled alternative in `ExpressionParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitBinaryOpExp?: (ctx: BinaryOpExpContext) => Result; - - /** - * Visit a parse tree produced by the `primaryExp` - * labeled alternative in `ExpressionParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitPrimaryExp?: (ctx: PrimaryExpContext) => Result; - - /** - * Visit a parse tree produced by `ExpressionParser.file`. - * @param ctx the parse tree - * @return the visitor result - */ - visitFile?: (ctx: FileContext) => Result; - - /** - * Visit a parse tree produced by `ExpressionParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitExpression?: (ctx: ExpressionContext) => Result; - - /** - * Visit a parse tree produced by `ExpressionParser.primaryExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitPrimaryExpression?: (ctx: PrimaryExpressionContext) => Result; - - /** - * Visit a parse tree produced by `ExpressionParser.argsList`. - * @param ctx the parse tree - * @return the visitor result - */ - visitArgsList?: (ctx: ArgsListContext) => Result; -} - +// Generated from ../Expression.g4 by ANTLR 4.6-SNAPSHOT + + +import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; + +import { FuncInvokeExpContext } from "./ExpressionParser"; +import { ConstantAtomContext } from "./ExpressionParser"; +import { IdAtomContext } from "./ExpressionParser"; +import { StringAtomContext } from "./ExpressionParser"; +import { IndexAccessExpContext } from "./ExpressionParser"; +import { MemberAccessExpContext } from "./ExpressionParser"; +import { ParenthesisExpContext } from "./ExpressionParser"; +import { NumericAtomContext } from "./ExpressionParser"; +import { UnaryOpExpContext } from "./ExpressionParser"; +import { BinaryOpExpContext } from "./ExpressionParser"; +import { PrimaryExpContext } from "./ExpressionParser"; +import { FileContext } from "./ExpressionParser"; +import { ExpressionContext } from "./ExpressionParser"; +import { PrimaryExpressionContext } from "./ExpressionParser"; +import { ArgsListContext } from "./ExpressionParser"; + + +/** + * This interface defines a complete generic visitor for a parse tree produced + * by `ExpressionParser`. + * + * @param The return type of the visit operation. Use `void` for + * operations with no return type. + */ +export interface ExpressionVisitor extends ParseTreeVisitor { + /** + * Visit a parse tree produced by the `funcInvokeExp` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFuncInvokeExp?: (ctx: FuncInvokeExpContext) => Result; + + /** + * Visit a parse tree produced by the `constantAtom` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitConstantAtom?: (ctx: ConstantAtomContext) => Result; + + /** + * Visit a parse tree produced by the `idAtom` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIdAtom?: (ctx: IdAtomContext) => Result; + + /** + * Visit a parse tree produced by the `stringAtom` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitStringAtom?: (ctx: StringAtomContext) => Result; + + /** + * Visit a parse tree produced by the `indexAccessExp` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIndexAccessExp?: (ctx: IndexAccessExpContext) => Result; + + /** + * Visit a parse tree produced by the `memberAccessExp` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitMemberAccessExp?: (ctx: MemberAccessExpContext) => Result; + + /** + * Visit a parse tree produced by the `parenthesisExp` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitParenthesisExp?: (ctx: ParenthesisExpContext) => Result; + + /** + * Visit a parse tree produced by the `numericAtom` + * labeled alternative in `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitNumericAtom?: (ctx: NumericAtomContext) => Result; + + /** + * Visit a parse tree produced by the `unaryOpExp` + * labeled alternative in `ExpressionParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUnaryOpExp?: (ctx: UnaryOpExpContext) => Result; + + /** + * Visit a parse tree produced by the `binaryOpExp` + * labeled alternative in `ExpressionParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitBinaryOpExp?: (ctx: BinaryOpExpContext) => Result; + + /** + * Visit a parse tree produced by the `primaryExp` + * labeled alternative in `ExpressionParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPrimaryExp?: (ctx: PrimaryExpContext) => Result; + + /** + * Visit a parse tree produced by `ExpressionParser.file`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFile?: (ctx: FileContext) => Result; + + /** + * Visit a parse tree produced by `ExpressionParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitExpression?: (ctx: ExpressionContext) => Result; + + /** + * Visit a parse tree produced by `ExpressionParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPrimaryExpression?: (ctx: PrimaryExpressionContext) => Result; + + /** + * Visit a parse tree produced by `ExpressionParser.argsList`. + * @param ctx the parse tree + * @return the visitor result + */ + visitArgsList?: (ctx: ArgsListContext) => Result; +} + diff --git a/libraries/adaptive-expressions/tests/expression.test.js b/libraries/adaptive-expressions/tests/expression.test.js index 09193ae59e..b5a1f53266 100644 --- a/libraries/adaptive-expressions/tests/expression.test.js +++ b/libraries/adaptive-expressions/tests/expression.test.js @@ -206,12 +206,25 @@ const dataSource = [ ['and(hello, "hello")', true], ['or(items, (2 + 2) <= (4 - 1))', true], // true || false ['or(0, false)', true], // true || false - ['not(hello)', false], // false - ['not(10)', false], + ['not(hello)', false], // false'not(10)', false], ['not(0)', false], ['if(hello, \'r1\', \'r2\')', 'r1'], ['if(null, \'r1\', \'r2\')', 'r2'], ['if(hello * 5, \'r1\', \'r2\')', 'r2'], + ['emptyList == []', true], + ['emptyList != []', false], + ['emptyList == {}', false], + ['emptyObject == {}', true], + ['emptyObject != {}', false], + ['emptyObject == []', false], + ['emptyJObject == {}', true], + ['emptyJObject != {}', false], + ['emptyJObject == []', false], + ['emptyList == [ ]', true], + ['emptyList == { }', false], + ['emptyObject == { }', true], + ['emptyObject == [ ]', false], + // Conversion functions tests ['float(\'10.333\')', 10.333], @@ -477,6 +490,10 @@ const dataSource = [ ]; const scope = { + emptyList:[], + emptyObject: new Map(), + emptyJObject: {}, + path: { array: [1] }, diff --git a/libraries/botbuilder-lg/src/analyzer.ts b/libraries/botbuilder-lg/src/analyzer.ts index 8d9ddc78b4..0ea85d6146 100644 --- a/libraries/botbuilder-lg/src/analyzer.ts +++ b/libraries/botbuilder-lg/src/analyzer.ts @@ -15,6 +15,7 @@ import { Evaluator } from './evaluator'; import * as lp from './generated/LGFileParser'; import { LGFileParserVisitor } from './generated/LGFileParserVisitor'; import { LGTemplate } from './lgTemplate'; +import { LGExtensions } from './lgExtensions'; // tslint:disable-next-line: completed-docs export class AnalyzerResult { @@ -207,9 +208,7 @@ export class Analyzer extends AbstractParseTreeVisitor implement private analyzeExpression(exp: string): AnalyzerResult { const result: AnalyzerResult = new AnalyzerResult(); - exp = exp.replace(/(^\$*)/g, '') - .replace(/(^{*)/g, '') - .replace(/(}*$)/g, ''); + exp = LGExtensions.trimExpression(exp); const parsed: Expression = this._expressionParser.parse(exp); const references: readonly string[] = Extensions.references(parsed); diff --git a/libraries/botbuilder-lg/src/evaluator.ts b/libraries/botbuilder-lg/src/evaluator.ts index 2564638309..b874a9e267 100644 --- a/libraries/botbuilder-lg/src/evaluator.ts +++ b/libraries/botbuilder-lg/src/evaluator.ts @@ -18,6 +18,7 @@ import { LGTemplate } from './lgTemplate'; import { ImportResolver } from './importResolver'; import * as path from 'path'; import * as fs from 'fs'; +import { LGExtensions } from './lgExtensions'; /** * Evaluation tuntime engine @@ -310,9 +311,7 @@ export class Evaluator extends AbstractParseTreeVisitor implements LGFilePa private evalExpressionInCondition(exp: string): boolean { try { - exp = exp.replace(/(^\$*)/g, '') - .replace(/(^{*)/g, '') - .replace(/(}*$)/g, ''); + exp = LGExtensions.trimExpression(exp); const { value: result, error }: { value: any; error: string } = this.evalByExpressionEngine(exp, this.currentTarget().scope); if (error !== undefined @@ -329,9 +328,7 @@ export class Evaluator extends AbstractParseTreeVisitor implements LGFilePa } private evalExpression(exp: string): any { - exp = exp.replace(/(^\$*)/g, '') - .replace(/(^{*)/g, '') - .replace(/(}*$)/g, ''); + exp = LGExtensions.trimExpression(exp); const { value: result, error }: { value: any; error: string } = this.evalByExpressionEngine(exp, this.currentTarget().scope); if (error !== undefined) { diff --git a/libraries/botbuilder-lg/src/expander.ts b/libraries/botbuilder-lg/src/expander.ts index 10078e00ff..93d13abb5d 100644 --- a/libraries/botbuilder-lg/src/expander.ts +++ b/libraries/botbuilder-lg/src/expander.ts @@ -16,6 +16,7 @@ import { Evaluator } from './evaluator'; import * as lp from './generated/LGFileParser'; import { LGFileParserVisitor } from './generated/LGFileParserVisitor'; import { LGTemplate } from './lgTemplate'; +import { LGExtensions } from './lgExtensions'; // tslint:disable-next-line: max-classes-per-file // tslint:disable-next-line: completed-docs @@ -307,9 +308,7 @@ export class Expander extends AbstractParseTreeVisitor implements LGFi private evalExpressionInCondition(exp: string): boolean { try { - exp = exp.replace(/(^\$*)/g, '') - .replace(/(^{*)/g, '') - .replace(/(}*$)/g, ''); + exp = LGExtensions.trimExpression(exp); const { value: result, error }: { value: any; error: string } = this.evalByExpressionEngine(exp, this.currentTarget().scope); if (error @@ -326,9 +325,7 @@ export class Expander extends AbstractParseTreeVisitor implements LGFi } private evalExpression(exp: string): string[] { - exp = exp.replace(/(^\$*)/g, '') - .replace(/(^{*)/g, '') - .replace(/(}*$)/g, ''); + exp = LGExtensions.trimExpression(exp); const { value: result, error }: { value: any; error: string } = this.evalByExpressionEngine(exp, this.currentTarget().scope); if (error) { diff --git a/libraries/botbuilder-lg/src/generated/LGFileLexer.ts b/libraries/botbuilder-lg/src/generated/LGFileLexer.ts index 995cf0255c..553ebaa954 100644 --- a/libraries/botbuilder-lg/src/generated/LGFileLexer.ts +++ b/libraries/botbuilder-lg/src/generated/LGFileLexer.ts @@ -1,903 +1,903 @@ -// Generated from ../LGFileLexer.g4 by ANTLR 4.6-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 LGFileLexer extends Lexer { - public static readonly COMMENTS = 1; - public static readonly WS = 2; - public static readonly NEWLINE = 3; - public static readonly HASH = 4; - public static readonly DASH = 5; - public static readonly LEFT_SQUARE_BRACKET = 6; - public static readonly IMPORT = 7; - public static readonly INVALID_TOKEN = 8; - public static readonly WS_IN_NAME = 9; - public static readonly NEWLINE_IN_NAME = 10; - public static readonly IDENTIFIER = 11; - public static readonly DOT = 12; - public static readonly OPEN_PARENTHESIS = 13; - public static readonly CLOSE_PARENTHESIS = 14; - public static readonly COMMA = 15; - public static readonly TEXT_IN_NAME = 16; - public static readonly WS_IN_BODY = 17; - public static readonly MULTILINE_PREFIX = 18; - public static readonly NEWLINE_IN_BODY = 19; - public static readonly IF = 20; - public static readonly ELSEIF = 21; - public static readonly ELSE = 22; - public static readonly SWITCH = 23; - public static readonly CASE = 24; - public static readonly DEFAULT = 25; - public static readonly ESCAPE_CHARACTER = 26; - public static readonly EXPRESSION = 27; - public static readonly TEXT = 28; - public static readonly MULTILINE_SUFFIX = 29; - public static readonly WS_IN_STRUCTURE_NAME = 30; - public static readonly NEWLINE_IN_STRUCTURE_NAME = 31; - public static readonly STRUCTURE_NAME = 32; - public static readonly TEXT_IN_STRUCTURE_NAME = 33; - public static readonly STRUCTURED_COMMENTS = 34; - public static readonly WS_IN_STRUCTURE_BODY = 35; - public static readonly STRUCTURED_NEWLINE = 36; - public static readonly STRUCTURED_BODY_END = 37; - public static readonly STRUCTURE_IDENTIFIER = 38; - public static readonly STRUCTURE_EQUALS = 39; - public static readonly STRUCTURE_OR_MARK = 40; - public static readonly ESCAPE_CHARACTER_IN_STRUCTURE_BODY = 41; - public static readonly EXPRESSION_IN_STRUCTURE_BODY = 42; - public static readonly TEXT_IN_STRUCTURE_BODY = 43; - public static readonly TEMPLATE_NAME_MODE = 1; - public static readonly TEMPLATE_BODY_MODE = 2; - public static readonly MULTILINE_MODE = 3; - public static readonly STRUCTURE_NAME_MODE = 4; - public static readonly STRUCTURE_BODY_MODE = 5; - // tslint:disable:no-trailing-whitespace - public static readonly modeNames: string[] = [ - "DEFAULT_MODE", "TEMPLATE_NAME_MODE", "TEMPLATE_BODY_MODE", "MULTILINE_MODE", - "STRUCTURE_NAME_MODE", "STRUCTURE_BODY_MODE", - ]; - - public static readonly ruleNames: string[] = [ - "A", "C", "D", "E", "F", "H", "I", "L", "S", "T", "U", "W", "LETTER", - "NUMBER", "WHITESPACE", "EMPTY_OBJECT", "STRING_LITERAL", "EXPRESSION_FRAGMENT", - "ESCAPE_CHARACTER_FRAGMENT", "COMMENTS", "WS", "NEWLINE", "HASH", "DASH", - "LEFT_SQUARE_BRACKET", "IMPORT", "INVALID_TOKEN", "WS_IN_NAME", "NEWLINE_IN_NAME", - "IDENTIFIER", "DOT", "OPEN_PARENTHESIS", "CLOSE_PARENTHESIS", "COMMA", - "TEXT_IN_NAME", "WS_IN_BODY", "MULTILINE_PREFIX", "NEWLINE_IN_BODY", "IF", - "ELSEIF", "ELSE", "SWITCH", "CASE", "DEFAULT", "ESCAPE_CHARACTER", "EXPRESSION", - "TEXT", "MULTILINE_SUFFIX", "MULTILINE_ESCAPE_CHARACTER", "MULTILINE_EXPRESSION", - "MULTILINE_TEXT", "WS_IN_STRUCTURE_NAME", "NEWLINE_IN_STRUCTURE_NAME", - "STRUCTURE_NAME", "TEXT_IN_STRUCTURE_NAME", "STRUCTURED_COMMENTS", "WS_IN_STRUCTURE_BODY", - "STRUCTURED_NEWLINE", "STRUCTURED_BODY_END", "STRUCTURE_IDENTIFIER", "STRUCTURE_EQUALS", - "STRUCTURE_OR_MARK", "ESCAPE_CHARACTER_IN_STRUCTURE_BODY", "EXPRESSION_IN_STRUCTURE_BODY", - "TEXT_IN_STRUCTURE_BODY", - ]; - - private static readonly _LITERAL_NAMES: Array = [ - undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, undefined, "'.'", "'('", "')'", - "','", undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, "'|'", - ]; - private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, "COMMENTS", "WS", "NEWLINE", "HASH", "DASH", "LEFT_SQUARE_BRACKET", - "IMPORT", "INVALID_TOKEN", "WS_IN_NAME", "NEWLINE_IN_NAME", "IDENTIFIER", - "DOT", "OPEN_PARENTHESIS", "CLOSE_PARENTHESIS", "COMMA", "TEXT_IN_NAME", - "WS_IN_BODY", "MULTILINE_PREFIX", "NEWLINE_IN_BODY", "IF", "ELSEIF", "ELSE", - "SWITCH", "CASE", "DEFAULT", "ESCAPE_CHARACTER", "EXPRESSION", "TEXT", - "MULTILINE_SUFFIX", "WS_IN_STRUCTURE_NAME", "NEWLINE_IN_STRUCTURE_NAME", - "STRUCTURE_NAME", "TEXT_IN_STRUCTURE_NAME", "STRUCTURED_COMMENTS", "WS_IN_STRUCTURE_BODY", - "STRUCTURED_NEWLINE", "STRUCTURED_BODY_END", "STRUCTURE_IDENTIFIER", "STRUCTURE_EQUALS", - "STRUCTURE_OR_MARK", "ESCAPE_CHARACTER_IN_STRUCTURE_BODY", "EXPRESSION_IN_STRUCTURE_BODY", - "TEXT_IN_STRUCTURE_BODY", - ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(LGFileLexer._LITERAL_NAMES, LGFileLexer._SYMBOLIC_NAMES, []); - - // @Override - // @NotNull - public get vocabulary(): Vocabulary { - return LGFileLexer.VOCABULARY; - } - // tslint:enable:no-trailing-whitespace - - - ignoreWS = true; // usually we ignore whitespace, but inside template, whitespace is significant - inTemplate = false; // whether we are in the template - beginOfTemplateBody = false; // whether we are at the begining of template body - inMultiline = false; // whether we are in multiline - beginOfTemplateLine = false;// weather we are at the begining of template string - inStructuredValue = false; // weather we are in the structure value - beginOfStructureProperty = false; // weather we are at the begining of structure property - - - constructor(input: CharStream) { - super(input); - this._interp = new LexerATNSimulator(LGFileLexer._ATN, this); - } - - // @Override - public get grammarFileName(): string { return "LGFileLexer.g4"; } - - // @Override - public get ruleNames(): string[] { return LGFileLexer.ruleNames; } - - // @Override - public get serializedATN(): string { return LGFileLexer._serializedATN; } - - // @Override - public get modeNames(): string[] { return LGFileLexer.modeNames; } - - // @Override - public action(_localctx: RuleContext, ruleIndex: number, actionIndex: number): void { - switch (ruleIndex) { - case 22: - this.HASH_action(_localctx, actionIndex); - break; - - case 23: - this.DASH_action(_localctx, actionIndex); - break; - - case 25: - this.IMPORT_action(_localctx, actionIndex); - break; - - case 26: - this.INVALID_TOKEN_action(_localctx, actionIndex); - break; - - case 28: - this.NEWLINE_IN_NAME_action(_localctx, actionIndex); - break; - - case 36: - this.MULTILINE_PREFIX_action(_localctx, actionIndex); - break; - - case 37: - this.NEWLINE_IN_BODY_action(_localctx, actionIndex); - break; - - case 38: - this.IF_action(_localctx, actionIndex); - break; - - case 39: - this.ELSEIF_action(_localctx, actionIndex); - break; - - case 40: - this.ELSE_action(_localctx, actionIndex); - break; - - case 41: - this.SWITCH_action(_localctx, actionIndex); - break; - - case 42: - this.CASE_action(_localctx, actionIndex); - break; - - case 43: - this.DEFAULT_action(_localctx, actionIndex); - break; - - case 44: - this.ESCAPE_CHARACTER_action(_localctx, actionIndex); - break; - - case 45: - this.EXPRESSION_action(_localctx, actionIndex); - break; - - case 46: - this.TEXT_action(_localctx, actionIndex); - break; - - case 47: - this.MULTILINE_SUFFIX_action(_localctx, actionIndex); - break; - - case 52: - this.NEWLINE_IN_STRUCTURE_NAME_action(_localctx, actionIndex); - break; - - case 57: - this.STRUCTURED_NEWLINE_action(_localctx, actionIndex); - break; - - case 58: - this.STRUCTURED_BODY_END_action(_localctx, actionIndex); - break; - - case 59: - this.STRUCTURE_IDENTIFIER_action(_localctx, actionIndex); - break; - - case 60: - this.STRUCTURE_EQUALS_action(_localctx, actionIndex); - break; - - case 61: - this.STRUCTURE_OR_MARK_action(_localctx, actionIndex); - break; - - case 62: - this.ESCAPE_CHARACTER_IN_STRUCTURE_BODY_action(_localctx, actionIndex); - break; - - case 63: - this.EXPRESSION_IN_STRUCTURE_BODY_action(_localctx, actionIndex); - break; - - case 64: - this.TEXT_IN_STRUCTURE_BODY_action(_localctx, actionIndex); - break; - } - } - private HASH_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 0: - this.inTemplate = true; this.beginOfTemplateBody = false; - break; - } - } - private DASH_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 1: - this.beginOfTemplateLine = true; this.beginOfTemplateBody = false; - break; - } - } - private IMPORT_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 2: - this.inTemplate = false; - break; - } - } - private INVALID_TOKEN_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 3: - this.inTemplate = false; this.beginOfTemplateBody = false; - break; - } - } - private NEWLINE_IN_NAME_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 4: - this.beginOfTemplateBody = true; - break; - } - } - private MULTILINE_PREFIX_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 5: - this.inMultiline = true; this.beginOfTemplateLine = false; - break; - } - } - private NEWLINE_IN_BODY_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 6: - this.ignoreWS = true; - break; - } - } - private IF_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 7: - this.ignoreWS = true; this.beginOfTemplateLine = false; - break; - } - } - private ELSEIF_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 8: - this.ignoreWS = true; this.beginOfTemplateLine = false; - break; - } - } - private ELSE_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 9: - this.ignoreWS = true; this.beginOfTemplateLine = false; - break; - } - } - private SWITCH_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 10: - this.ignoreWS = true; this.beginOfTemplateLine = false; - break; - } - } - private CASE_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 11: - this.ignoreWS = true; this.beginOfTemplateLine = false; - break; - } - } - private DEFAULT_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 12: - this.ignoreWS = true; this.beginOfTemplateLine = false; - break; - } - } - private ESCAPE_CHARACTER_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 13: - this.ignoreWS = false; this.beginOfTemplateLine = false; - break; - } - } - private EXPRESSION_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 14: - this.ignoreWS = false; this.beginOfTemplateLine = false; - break; - } - } - private TEXT_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 15: - this.ignoreWS = false; this.beginOfTemplateLine = false; - break; - } - } - private MULTILINE_SUFFIX_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 16: - this.inMultiline = false; - break; - } - } - private NEWLINE_IN_STRUCTURE_NAME_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 17: - this.ignoreWS = true; - break; - - case 18: - this.beginOfStructureProperty = true; - break; - } - } - private STRUCTURED_NEWLINE_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 19: - this.ignoreWS = true; this.inStructuredValue = false; this.beginOfStructureProperty = true; - break; - } - } - private STRUCTURED_BODY_END_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 20: - this.inTemplate = false; this.beginOfTemplateBody = false; - break; - } - } - private STRUCTURE_IDENTIFIER_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 21: - this.beginOfStructureProperty = false; - break; - } - } - private STRUCTURE_EQUALS_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 22: - this.inStructuredValue = true; - break; - } - } - private STRUCTURE_OR_MARK_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 23: - this.ignoreWS = true; - break; - } - } - private ESCAPE_CHARACTER_IN_STRUCTURE_BODY_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 24: - this.ignoreWS = false; - break; - } - } - private EXPRESSION_IN_STRUCTURE_BODY_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 25: - this.ignoreWS = false; - break; - } - } - private TEXT_IN_STRUCTURE_BODY_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 26: - this.ignoreWS = false; this.beginOfStructureProperty = false; - break; - } - } - // @Override - public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { - switch (ruleIndex) { - case 23: - return this.DASH_sempred(_localctx, predIndex); - - case 24: - return this.LEFT_SQUARE_BRACKET_sempred(_localctx, predIndex); - - case 35: - return this.WS_IN_BODY_sempred(_localctx, predIndex); - - case 36: - return this.MULTILINE_PREFIX_sempred(_localctx, predIndex); - - case 38: - return this.IF_sempred(_localctx, predIndex); - - case 39: - return this.ELSEIF_sempred(_localctx, predIndex); - - case 40: - return this.ELSE_sempred(_localctx, predIndex); - - case 41: - return this.SWITCH_sempred(_localctx, predIndex); - - case 42: - return this.CASE_sempred(_localctx, predIndex); - - case 43: - return this.DEFAULT_sempred(_localctx, predIndex); - - case 55: - return this.STRUCTURED_COMMENTS_sempred(_localctx, predIndex); - - case 56: - return this.WS_IN_STRUCTURE_BODY_sempred(_localctx, predIndex); - - case 58: - return this.STRUCTURED_BODY_END_sempred(_localctx, predIndex); - - case 59: - return this.STRUCTURE_IDENTIFIER_sempred(_localctx, predIndex); - - case 60: - return this.STRUCTURE_EQUALS_sempred(_localctx, predIndex); - } - return true; - } - private DASH_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 0: - return this.inTemplate ; - } - return true; - } - private LEFT_SQUARE_BRACKET_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 1: - return this.inTemplate && this.beginOfTemplateBody ; - } - return true; - } - private WS_IN_BODY_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 2: - return this.ignoreWS; - } - return true; - } - private MULTILINE_PREFIX_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 3: - return !this.inMultiline && this.beginOfTemplateLine ; - } - return true; - } - private IF_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 4: - return this.beginOfTemplateLine; - } - return true; - } - private ELSEIF_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 5: - return this.beginOfTemplateLine; - } - return true; - } - private ELSE_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 6: - return this.beginOfTemplateLine ; - } - return true; - } - private SWITCH_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 7: - return this.beginOfTemplateLine; - } - return true; - } - private CASE_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 8: - return this.beginOfTemplateLine; - } - return true; - } - private DEFAULT_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 9: - return this.beginOfTemplateLine; - } - return true; - } - private STRUCTURED_COMMENTS_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 10: - return !this.inStructuredValue && this.beginOfStructureProperty; - } - return true; - } - private WS_IN_STRUCTURE_BODY_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 11: - return this.ignoreWS; - } - return true; - } - private STRUCTURED_BODY_END_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 12: - return !this.inStructuredValue; - } - return true; - } - private STRUCTURE_IDENTIFIER_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 13: - return !this.inStructuredValue && this.beginOfStructureProperty; - } - return true; - } - private STRUCTURE_EQUALS_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 14: - return !this.inStructuredValue; - } - return true; - } - - private static readonly _serializedATNSegments: number = 2; - private static readonly _serializedATNSegment0: string = - "\x03\uAF6F\u8320\u479D\uB75C\u4880\u1605\u191C\uAB37\x02-\u0246\b\x01" + - "\b\x01\b\x01\b\x01\b\x01\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\x04\x1B\t\x1B\x04\x1C\t\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t" + - "\x1F\x04 \t \x04!\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t" + - "\'\x04(\t(\x04)\t)\x04*\t*\x04+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x04" + - "0\t0\x041\t1\x042\t2\x043\t3\x044\t4\x045\t5\x046\t6\x047\t7\x048\t8\x04" + - "9\t9\x04:\t:\x04;\t;\x04<\t<\x04=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04" + - "B\tB\x03\x02\x03\x02\x03\x03\x03\x03\x03\x04\x03\x04\x03\x05\x03\x05\x03" + - "\x06\x03\x06\x03\x07\x03\x07\x03\b\x03\b\x03\t\x03\t\x03\n\x03\n\x03\v" + - "\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x10" + - "\x03\x10\x03\x11\x03\x11\x07\x11\xAB\n\x11\f\x11\x0E\x11\xAE\v\x11\x03" + - "\x11\x03\x11\x03\x12\x03\x12\x07\x12\xB4\n\x12\f\x12\x0E\x12\xB7\v\x12" + - "\x03\x12\x03\x12\x03\x12\x07\x12\xBC\n\x12\f\x12\x0E\x12\xBF\v\x12\x03" + - "\x12\x05\x12\xC2\n\x12\x03\x13\x03\x13\x03\x13\x03\x13\x03\x13\x07\x13" + - "\xC9\n\x13\f\x13\x0E\x13\xCC\v\x13\x03\x13\x03\x13\x03\x14\x03\x14\x05" + - "\x14\xD2\n\x14\x03\x15\x03\x15\x06\x15\xD6\n\x15\r\x15\x0E\x15\xD7\x03" + - "\x15\x03\x15\x03\x16\x06\x16\xDD\n\x16\r\x16\x0E\x16\xDE\x03\x16\x03\x16" + - "\x03\x17\x05\x17\xE4\n\x17\x03\x17\x03\x17\x03\x17\x03\x17\x03\x18\x03" + - "\x18\x03\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03" + - "\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x07\x1B\xFC" + - "\n\x1B\f\x1B\x0E\x1B\xFF\v\x1B\x03\x1B\x03\x1B\x03\x1B\x07\x1B\u0104\n" + - "\x1B\f\x1B\x0E\x1B\u0107\v\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1C\x03\x1C" + - "\x03\x1C\x03\x1D\x06\x1D\u0110\n\x1D\r\x1D\x0E\x1D\u0111\x03\x1D\x03\x1D" + - "\x03\x1E\x05\x1E\u0117\n\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03" + - "\x1E\x03\x1F\x03\x1F\x03\x1F\x05\x1F\u0122\n\x1F\x03\x1F\x03\x1F\x03\x1F" + - "\x07\x1F\u0127\n\x1F\f\x1F\x0E\x1F\u012A\v\x1F\x03 \x03 \x03!\x03!\x03" + - "\"\x03\"\x03#\x03#\x03$\x06$\u0135\n$\r$\x0E$\u0136\x03%\x06%\u013A\n" + - "%\r%\x0E%\u013B\x03%\x03%\x03%\x03%\x03&\x03&\x03&\x03&\x03&\x03&\x03" + - "&\x03&\x03&\x03\'\x05\'\u014C\n\'\x03\'\x03\'\x03\'\x03\'\x03\'\x03\'" + - "\x03(\x03(\x03(\x07(\u0157\n(\f(\x0E(\u015A\v(\x03(\x03(\x03(\x03(\x03" + - ")\x03)\x03)\x03)\x03)\x07)\u0165\n)\f)\x0E)\u0168\v)\x03)\x03)\x03)\x07" + - ")\u016D\n)\f)\x0E)\u0170\v)\x03)\x03)\x03)\x03)\x03*\x03*\x03*\x03*\x03" + - "*\x07*\u017B\n*\f*\x0E*\u017E\v*\x03*\x03*\x03*\x03*\x03+\x03+\x03+\x03" + - "+\x03+\x03+\x03+\x07+\u018B\n+\f+\x0E+\u018E\v+\x03+\x03+\x03+\x03+\x03" + - ",\x03,\x03,\x03,\x03,\x07,\u0199\n,\f,\x0E,\u019C\v,\x03,\x03,\x03,\x03" + - ",\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x07-\u01AA\n-\f-\x0E-\u01AD" + - "\v-\x03-\x03-\x03-\x03-\x03.\x03.\x03.\x03/\x03/\x03/\x030\x060\u01BA" + - "\n0\r0\x0E0\u01BB\x030\x030\x031\x031\x031\x031\x031\x031\x031\x031\x03" + - "2\x032\x032\x032\x033\x033\x033\x033\x034\x054\u01D1\n4\x034\x034\x06" + - "4\u01D5\n4\r4\x0E4\u01D6\x034\x034\x035\x065\u01DC\n5\r5\x0E5\u01DD\x03" + - "5\x035\x036\x056\u01E3\n6\x036\x036\x036\x036\x036\x036\x036\x037\x03" + - "7\x037\x057\u01EF\n7\x037\x037\x037\x077\u01F4\n7\f7\x0E7\u01F7\v7\x03" + - "8\x068\u01FA\n8\r8\x0E8\u01FB\x039\x039\x079\u0200\n9\f9\x0E9\u0203\v" + - "9\x039\x059\u0206\n9\x039\x039\x039\x039\x039\x03:\x06:\u020E\n:\r:\x0E" + - ":\u020F\x03:\x03:\x03:\x03:\x03;\x05;\u0217\n;\x03;\x03;\x03;\x03<\x03" + - "<\x03<\x03<\x03<\x03<\x03<\x03=\x03=\x03=\x05=\u0226\n=\x03=\x03=\x03" + - "=\x07=\u022B\n=\f=\x0E=\u022E\v=\x03=\x03=\x03=\x03>\x03>\x03>\x03>\x03" + - "?\x03?\x03?\x03@\x03@\x03@\x03A\x03A\x03A\x03B\x06B\u0241\nB\rB\x0EB\u0242" + - "\x03B\x03B\n\xCA\xFD\u0105\u0136\u01BB\u01D6\u01FB\u0242\x02\x02C\b\x02" + - "\x02\n\x02\x02\f\x02\x02\x0E\x02\x02\x10\x02\x02\x12\x02\x02\x14\x02\x02" + - "\x16\x02\x02\x18\x02\x02\x1A\x02\x02\x1C\x02\x02\x1E\x02\x02 \x02\x02" + - "\"\x02\x02$\x02\x02&\x02\x02(\x02\x02*\x02\x02,\x02\x02.\x02\x030\x02" + - "\x042\x02\x054\x02\x066\x02\x078\x02\b:\x02\t<\x02\n>\x02\v@\x02\fB\x02" + - "\rD\x02\x0EF\x02\x0FH\x02\x10J\x02\x11L\x02\x12N\x02\x13P\x02\x14R\x02" + - "\x15T\x02\x16V\x02\x17X\x02\x18Z\x02\x19\\\x02\x1A^\x02\x1B`\x02\x1Cb" + - "\x02\x1Dd\x02\x1Ef\x02\x1Fh\x02\x02j\x02\x02l\x02\x02n\x02 p\x02!r\x02" + - "\"t\x02#v\x02$x\x02%z\x02&|\x02\'~\x02(\x80\x02)\x82\x02*\x84\x02+\x86" + - "\x02,\x88\x02-\b\x02\x03\x04\x05\x06\x07\x18\x04\x02CCcc\x04\x02EEee\x04" + - "\x02FFff\x04\x02GGgg\x04\x02HHhh\x04\x02JJjj\x04\x02KKkk\x04\x02NNnn\x04" + - "\x02UUuu\x04\x02VVvv\x04\x02WWww\x04\x02YYyy\x04\x02C\\c|\x06\x02\v\v" + - "\"\"\xA2\xA2\uFF01\uFF01\x05\x02\f\f\x0F\x0F))\x05\x02\f\f\x0F\x0F$$\b" + - "\x02\f\f\x0F\x0F$$))}}\x7F\x7F\x04\x02\f\f\x0F\x0F\x06\x02\f\f\x0F\x0F" + - "]]__\x05\x02\f\f\x0F\x0F*+\x04\x02//aa\x04\x02/0aa\u0261\x02.\x03\x02" + - "\x02\x02\x020\x03\x02\x02\x02\x022\x03\x02\x02\x02\x024\x03\x02\x02\x02" + - "\x026\x03\x02\x02\x02\x028\x03\x02\x02\x02\x02:\x03\x02\x02\x02\x02<\x03" + - "\x02\x02\x02\x03>\x03\x02\x02\x02\x03@\x03\x02\x02\x02\x03B\x03\x02\x02" + - "\x02\x03D\x03\x02\x02\x02\x03F\x03\x02\x02\x02\x03H\x03\x02\x02\x02\x03" + - "J\x03\x02\x02\x02\x03L\x03\x02\x02\x02\x04N\x03\x02\x02\x02\x04P\x03\x02" + - "\x02\x02\x04R\x03\x02\x02\x02\x04T\x03\x02\x02\x02\x04V\x03\x02\x02\x02" + - "\x04X\x03\x02\x02\x02\x04Z\x03\x02\x02\x02\x04\\\x03\x02\x02\x02\x04^" + - "\x03\x02\x02\x02\x04`\x03\x02\x02\x02\x04b\x03\x02\x02\x02\x04d\x03\x02" + - "\x02\x02\x05f\x03\x02\x02\x02\x05h\x03\x02\x02\x02\x05j\x03\x02\x02\x02" + - "\x05l\x03\x02\x02\x02\x06n\x03\x02\x02\x02\x06p\x03\x02\x02\x02\x06r\x03" + - "\x02\x02\x02\x06t\x03\x02\x02\x02\x07v\x03\x02\x02\x02\x07x\x03\x02\x02" + - "\x02\x07z\x03\x02\x02\x02\x07|\x03\x02\x02\x02\x07~\x03\x02\x02\x02\x07" + - "\x80\x03\x02\x02\x02\x07\x82\x03\x02\x02\x02\x07\x84\x03\x02\x02\x02\x07" + - "\x86\x03\x02\x02\x02\x07\x88\x03\x02\x02\x02\b\x8A\x03\x02\x02\x02\n\x8C" + - "\x03\x02\x02\x02\f\x8E\x03\x02\x02\x02\x0E\x90\x03\x02\x02\x02\x10\x92" + - "\x03\x02\x02\x02\x12\x94\x03\x02\x02\x02\x14\x96\x03\x02\x02\x02\x16\x98" + - "\x03\x02\x02\x02\x18\x9A\x03\x02\x02\x02\x1A\x9C\x03\x02\x02\x02\x1C\x9E" + - "\x03\x02\x02\x02\x1E\xA0\x03\x02\x02\x02 \xA2\x03\x02\x02\x02\"\xA4\x03" + - "\x02\x02\x02$\xA6\x03\x02\x02\x02&\xA8\x03\x02\x02\x02(\xC1\x03\x02\x02" + - "\x02*\xC3\x03\x02\x02\x02,\xCF\x03\x02\x02\x02.\xD3\x03\x02\x02\x020\xDC" + - "\x03\x02\x02\x022\xE3\x03\x02\x02\x024\xE9\x03\x02\x02\x026\xEE\x03\x02" + - "\x02\x028\xF4\x03\x02\x02\x02:\xF9\x03\x02\x02\x02<\u010B\x03\x02\x02" + - "\x02>\u010F\x03\x02\x02\x02@\u0116\x03\x02\x02\x02B\u0121\x03\x02\x02" + - "\x02D\u012B\x03\x02\x02\x02F\u012D\x03\x02\x02\x02H\u012F\x03\x02\x02" + - "\x02J\u0131\x03\x02\x02\x02L\u0134\x03\x02\x02\x02N\u0139\x03\x02\x02" + - "\x02P\u0141\x03\x02\x02\x02R\u014B\x03\x02\x02\x02T\u0153\x03\x02\x02" + - "\x02V\u015F\x03\x02\x02\x02X\u0175\x03\x02\x02\x02Z\u0183\x03\x02\x02" + - "\x02\\\u0193\x03\x02\x02\x02^\u01A1\x03\x02\x02\x02`\u01B2\x03\x02\x02" + - "\x02b\u01B5\x03\x02\x02\x02d\u01B9\x03\x02\x02\x02f\u01BF\x03\x02\x02" + - "\x02h\u01C7\x03\x02\x02\x02j\u01CB\x03\x02\x02\x02l\u01D4\x03\x02\x02" + - "\x02n\u01DB\x03\x02\x02\x02p\u01E2\x03\x02\x02\x02r\u01EE\x03\x02\x02" + - "\x02t\u01F9\x03\x02\x02\x02v\u01FD\x03\x02\x02\x02x\u020D\x03\x02\x02" + - "\x02z\u0216\x03\x02\x02\x02|\u021B\x03\x02\x02\x02~\u0225\x03\x02\x02" + - "\x02\x80\u0232\x03\x02\x02\x02\x82\u0236\x03\x02\x02\x02\x84\u0239\x03" + - "\x02\x02\x02\x86\u023C\x03\x02\x02\x02\x88\u0240\x03\x02\x02\x02\x8A\x8B" + - "\t\x02\x02\x02\x8B\t\x03\x02\x02\x02\x8C\x8D\t\x03\x02\x02\x8D\v\x03\x02" + - "\x02\x02\x8E\x8F\t\x04\x02\x02\x8F\r\x03\x02\x02\x02\x90\x91\t\x05\x02" + - "\x02\x91\x0F\x03\x02\x02\x02\x92\x93\t\x06\x02\x02\x93\x11\x03\x02\x02" + - "\x02\x94\x95\t\x07\x02\x02\x95\x13\x03\x02\x02\x02\x96\x97\t\b\x02\x02" + - "\x97\x15\x03\x02\x02\x02\x98\x99\t\t\x02\x02\x99\x17\x03\x02\x02\x02\x9A" + - "\x9B\t\n\x02\x02\x9B\x19\x03\x02\x02\x02\x9C\x9D\t\v\x02\x02\x9D\x1B\x03" + - "\x02\x02\x02\x9E\x9F\t\f\x02\x02\x9F\x1D\x03\x02\x02\x02\xA0\xA1\t\r\x02" + - "\x02\xA1\x1F\x03\x02\x02\x02\xA2\xA3\t\x0E\x02\x02\xA3!\x03\x02\x02\x02" + - "\xA4\xA5\x042;\x02\xA5#\x03\x02\x02\x02\xA6\xA7\t\x0F\x02\x02\xA7%\x03" + - "\x02\x02\x02\xA8\xAC\x07}\x02\x02\xA9\xAB\x05$\x10\x02\xAA\xA9\x03\x02" + - "\x02\x02\xAB\xAE\x03\x02\x02\x02\xAC\xAA\x03\x02\x02\x02\xAC\xAD\x03\x02" + - "\x02\x02\xAD\xAF\x03\x02\x02\x02\xAE\xAC\x03\x02\x02\x02\xAF\xB0\x07\x7F" + - "\x02\x02\xB0\'\x03\x02\x02\x02\xB1\xB5\x07)\x02\x02\xB2\xB4\n\x10\x02" + - "\x02\xB3\xB2\x03\x02\x02\x02\xB4\xB7\x03\x02\x02\x02\xB5\xB3\x03\x02\x02" + - "\x02\xB5\xB6\x03\x02\x02\x02\xB6\xB8\x03\x02\x02\x02\xB7\xB5\x03\x02\x02" + - "\x02\xB8\xC2\x07)\x02\x02\xB9\xBD\x07$\x02\x02\xBA\xBC\n\x11\x02\x02\xBB" + - "\xBA\x03\x02\x02\x02\xBC\xBF\x03\x02\x02\x02\xBD\xBB\x03\x02\x02\x02\xBD" + - "\xBE\x03\x02\x02\x02\xBE\xC0\x03\x02\x02\x02\xBF\xBD\x03\x02\x02\x02\xC0" + - "\xC2\x07$\x02\x02\xC1\xB1\x03\x02\x02\x02\xC1\xB9\x03\x02\x02\x02\xC2" + - ")\x03\x02\x02\x02\xC3\xC4\x07&\x02\x02\xC4\xCA\x07}\x02\x02\xC5\xC9\x05" + - "(\x12\x02\xC6\xC9\n\x12\x02\x02\xC7\xC9\x05&\x11\x02\xC8\xC5\x03\x02\x02" + - "\x02\xC8\xC6\x03\x02\x02\x02\xC8\xC7\x03\x02\x02\x02\xC9\xCC\x03\x02\x02" + - "\x02\xCA\xCB\x03\x02\x02\x02\xCA\xC8\x03\x02\x02\x02\xCB\xCD\x03\x02\x02" + - "\x02\xCC\xCA\x03\x02\x02\x02\xCD\xCE\x07\x7F\x02\x02\xCE+\x03\x02\x02" + - "\x02\xCF\xD1\x07^\x02\x02\xD0\xD2\n\x13\x02\x02\xD1\xD0\x03\x02\x02\x02" + - "\xD1\xD2\x03\x02\x02\x02\xD2-\x03\x02\x02\x02\xD3\xD5\x07@\x02\x02\xD4" + - "\xD6\n\x13\x02\x02\xD5\xD4\x03\x02\x02\x02\xD6\xD7\x03\x02\x02\x02\xD7" + - "\xD5\x03\x02\x02\x02\xD7\xD8\x03\x02\x02\x02\xD8\xD9\x03\x02\x02\x02\xD9" + - "\xDA\b\x15\x02\x02\xDA/\x03\x02\x02\x02\xDB\xDD\x05$\x10\x02\xDC\xDB\x03" + - "\x02\x02\x02\xDD\xDE\x03\x02\x02\x02\xDE\xDC\x03\x02\x02\x02\xDE\xDF\x03" + - "\x02\x02\x02\xDF\xE0\x03\x02\x02\x02\xE0\xE1\b\x16\x02\x02\xE11\x03\x02" + - "\x02\x02\xE2\xE4\x07\x0F\x02\x02\xE3\xE2\x03\x02\x02\x02\xE3\xE4\x03\x02" + - "\x02\x02\xE4\xE5\x03\x02\x02\x02\xE5\xE6\x07\f\x02\x02\xE6\xE7\x03\x02" + - "\x02\x02\xE7\xE8\b\x17\x02\x02\xE83\x03\x02\x02\x02\xE9\xEA\x07%\x02\x02" + - "\xEA\xEB\b\x18\x03\x02\xEB\xEC\x03\x02\x02\x02\xEC\xED\b\x18\x04\x02\xED" + - "5\x03\x02\x02\x02\xEE\xEF\x07/\x02\x02\xEF\xF0\x06\x19\x02\x02\xF0\xF1" + - "\b\x19\x05\x02\xF1\xF2\x03\x02\x02\x02\xF2\xF3\b\x19\x06\x02\xF37\x03" + - "\x02\x02\x02\xF4\xF5\x07]\x02\x02\xF5\xF6\x06\x1A\x03\x02\xF6\xF7\x03" + - "\x02\x02\x02\xF7\xF8\b\x1A\x07\x02\xF89\x03\x02\x02\x02\xF9\xFD\x07]\x02" + - "\x02\xFA\xFC\n\x14\x02\x02\xFB\xFA\x03\x02\x02\x02\xFC\xFF\x03\x02\x02" + - "\x02\xFD\xFE\x03\x02\x02\x02\xFD\xFB\x03\x02\x02\x02\xFE\u0100\x03\x02" + - "\x02\x02\xFF\xFD\x03\x02\x02\x02\u0100\u0101\x07_\x02\x02\u0101\u0105" + - "\x07*\x02\x02\u0102\u0104\n\x15\x02\x02\u0103\u0102\x03\x02\x02\x02\u0104" + - "\u0107\x03\x02\x02\x02\u0105\u0106\x03\x02\x02\x02\u0105\u0103\x03\x02" + - "\x02\x02\u0106\u0108\x03\x02\x02\x02\u0107\u0105\x03\x02\x02\x02\u0108" + - "\u0109\x07+\x02\x02\u0109\u010A\b\x1B\b\x02\u010A;\x03\x02\x02\x02\u010B" + - "\u010C\v\x02\x02\x02\u010C\u010D\b\x1C\t\x02\u010D=\x03\x02\x02\x02\u010E" + - "\u0110\x05$\x10\x02\u010F\u010E\x03\x02\x02\x02\u0110\u0111\x03\x02\x02" + - "\x02\u0111\u010F\x03\x02\x02\x02\u0111\u0112\x03\x02\x02\x02\u0112\u0113" + - "\x03\x02\x02\x02\u0113\u0114\b\x1D\x02\x02\u0114?\x03\x02\x02\x02\u0115" + - "\u0117\x07\x0F\x02\x02\u0116\u0115\x03\x02\x02\x02\u0116\u0117\x03\x02" + - "\x02\x02\u0117\u0118\x03\x02\x02\x02\u0118\u0119\x07\f\x02\x02\u0119\u011A" + - "\b\x1E\n\x02\u011A\u011B\x03\x02\x02\x02\u011B\u011C\b\x1E\x02\x02\u011C" + - "\u011D\b\x1E\v\x02\u011DA\x03\x02\x02\x02\u011E\u0122\x05 \x0E\x02\u011F" + - "\u0122\x05\"\x0F\x02\u0120\u0122\x07a\x02\x02\u0121\u011E\x03\x02\x02" + - "\x02\u0121\u011F\x03\x02\x02\x02\u0121\u0120\x03\x02\x02\x02\u0122\u0128" + - "\x03\x02\x02\x02\u0123\u0127\x05 \x0E\x02\u0124\u0127\x05\"\x0F\x02\u0125" + - "\u0127\t\x16\x02\x02\u0126\u0123\x03\x02\x02\x02\u0126\u0124\x03\x02\x02" + - "\x02\u0126\u0125\x03\x02\x02\x02\u0127\u012A\x03\x02\x02\x02\u0128\u0126" + - "\x03\x02\x02\x02\u0128\u0129\x03\x02\x02\x02\u0129C\x03\x02\x02\x02\u012A" + - "\u0128\x03\x02\x02\x02\u012B\u012C\x070\x02\x02\u012CE\x03\x02\x02\x02" + - "\u012D\u012E\x07*\x02\x02\u012EG\x03\x02\x02\x02\u012F\u0130\x07+\x02" + - "\x02\u0130I\x03\x02\x02\x02\u0131\u0132\x07.\x02\x02\u0132K\x03\x02\x02" + - "\x02\u0133\u0135\n\x13\x02\x02\u0134\u0133\x03\x02\x02\x02\u0135\u0136" + - "\x03\x02\x02\x02\u0136\u0137\x03\x02\x02\x02\u0136\u0134\x03\x02\x02\x02" + - "\u0137M\x03\x02\x02\x02\u0138\u013A\x05$\x10\x02\u0139\u0138\x03\x02\x02" + - "\x02\u013A\u013B\x03\x02\x02\x02\u013B\u0139\x03\x02\x02\x02\u013B\u013C" + - "\x03\x02\x02\x02\u013C\u013D\x03\x02\x02\x02\u013D\u013E\x06%\x04\x02" + - "\u013E\u013F\x03\x02\x02\x02\u013F\u0140\b%\x02\x02\u0140O\x03\x02\x02" + - "\x02\u0141\u0142\x07b\x02\x02\u0142\u0143\x07b\x02\x02\u0143\u0144\x07" + - "b\x02\x02\u0144\u0145\x03\x02\x02\x02\u0145\u0146\x06&\x05\x02\u0146\u0147" + - "\b&\f\x02\u0147\u0148\x03\x02\x02\x02\u0148\u0149\b&\r\x02\u0149Q\x03" + - "\x02\x02\x02\u014A\u014C\x07\x0F\x02\x02\u014B\u014A\x03\x02\x02\x02\u014B" + - "\u014C\x03\x02\x02\x02\u014C\u014D\x03\x02\x02\x02\u014D\u014E\x07\f\x02" + - "\x02\u014E\u014F\b\'\x0E\x02\u014F\u0150\x03\x02\x02\x02\u0150\u0151\b" + - "\'\x02\x02\u0151\u0152\b\'\v\x02\u0152S\x03\x02\x02\x02\u0153\u0154\x05" + - "\x14\b\x02\u0154\u0158\x05\x10\x06\x02\u0155\u0157\x05$\x10\x02\u0156" + - "\u0155\x03\x02\x02\x02\u0157\u015A\x03\x02\x02\x02\u0158\u0156\x03\x02" + - "\x02\x02\u0158\u0159\x03\x02\x02\x02\u0159\u015B\x03\x02\x02\x02\u015A" + - "\u0158\x03\x02\x02\x02\u015B\u015C\x07<\x02\x02\u015C\u015D\x06(\x06\x02" + - "\u015D\u015E\b(\x0F\x02\u015EU\x03\x02\x02\x02\u015F\u0160\x05\x0E\x05" + - "\x02\u0160\u0161\x05\x16\t\x02\u0161\u0162\x05\x18\n\x02\u0162\u0166\x05" + - "\x0E\x05\x02\u0163\u0165\x05$\x10\x02\u0164\u0163\x03\x02\x02\x02\u0165" + - "\u0168\x03\x02\x02\x02\u0166\u0164\x03\x02\x02\x02\u0166\u0167\x03\x02" + - "\x02\x02\u0167\u0169\x03\x02\x02\x02\u0168\u0166\x03\x02\x02\x02\u0169" + - "\u016A\x05\x14\b\x02\u016A\u016E\x05\x10\x06\x02\u016B\u016D\x05$\x10" + - "\x02\u016C\u016B\x03\x02\x02\x02\u016D\u0170\x03\x02\x02\x02\u016E\u016C" + - "\x03\x02\x02\x02\u016E\u016F\x03\x02\x02\x02\u016F\u0171\x03\x02\x02\x02" + - "\u0170\u016E\x03\x02\x02\x02\u0171\u0172\x07<\x02\x02\u0172\u0173\x06" + - ")\x07\x02\u0173\u0174\b)\x10\x02\u0174W\x03\x02\x02\x02\u0175\u0176\x05" + - "\x0E\x05\x02\u0176\u0177\x05\x16\t\x02\u0177\u0178\x05\x18\n\x02\u0178" + - "\u017C\x05\x0E\x05\x02\u0179\u017B\x05$\x10\x02\u017A\u0179\x03\x02\x02" + - "\x02\u017B\u017E\x03\x02\x02\x02\u017C\u017A\x03\x02\x02\x02\u017C\u017D" + - "\x03\x02\x02\x02\u017D\u017F\x03\x02\x02\x02\u017E\u017C\x03\x02\x02\x02" + - "\u017F\u0180\x07<\x02\x02\u0180\u0181\x06*\b\x02\u0181\u0182\b*\x11\x02" + - "\u0182Y\x03\x02\x02\x02\u0183\u0184\x05\x18\n\x02\u0184\u0185\x05\x1E" + - "\r\x02\u0185\u0186\x05\x14\b\x02\u0186\u0187\x05\x1A\v\x02\u0187\u0188" + - "\x05\n\x03\x02\u0188\u018C\x05\x12\x07\x02\u0189\u018B\x05$\x10\x02\u018A" + - "\u0189\x03\x02\x02\x02\u018B\u018E\x03\x02\x02\x02\u018C\u018A\x03\x02" + - "\x02\x02\u018C\u018D\x03\x02\x02\x02\u018D\u018F\x03\x02\x02\x02\u018E" + - "\u018C\x03\x02\x02\x02\u018F\u0190\x07<\x02\x02\u0190\u0191\x06+\t\x02" + - "\u0191\u0192\b+\x12\x02\u0192[\x03\x02\x02\x02\u0193\u0194\x05\n\x03\x02" + - "\u0194\u0195\x05\b\x02\x02\u0195\u0196\x05\x18\n\x02\u0196\u019A\x05\x0E" + - "\x05\x02\u0197\u0199\x05$\x10\x02\u0198\u0197\x03\x02\x02\x02\u0199\u019C" + - "\x03\x02\x02\x02\u019A\u0198\x03\x02\x02\x02\u019A\u019B\x03\x02\x02\x02" + - "\u019B\u019D\x03\x02\x02\x02\u019C\u019A\x03\x02\x02\x02\u019D\u019E\x07" + - "<\x02\x02\u019E\u019F\x06,\n\x02\u019F\u01A0\b,\x13\x02\u01A0]\x03\x02" + - "\x02\x02\u01A1\u01A2\x05\f\x04\x02\u01A2\u01A3\x05\x0E\x05\x02\u01A3\u01A4" + - "\x05\x10\x06\x02\u01A4\u01A5\x05\b\x02\x02\u01A5\u01A6\x05\x1C\f\x02\u01A6" + - "\u01A7\x05\x16\t\x02\u01A7\u01AB\x05\x1A\v\x02\u01A8\u01AA\x05$\x10\x02" + - "\u01A9\u01A8\x03\x02\x02\x02\u01AA\u01AD\x03\x02\x02\x02\u01AB\u01A9\x03" + - "\x02\x02\x02\u01AB\u01AC\x03\x02\x02\x02\u01AC\u01AE\x03\x02\x02\x02\u01AD" + - "\u01AB\x03\x02\x02\x02\u01AE\u01AF\x07<\x02\x02\u01AF\u01B0\x06-\v\x02" + - "\u01B0\u01B1\b-\x14\x02\u01B1_\x03\x02\x02\x02\u01B2\u01B3\x05,\x14\x02" + - "\u01B3\u01B4\b.\x15\x02\u01B4a\x03\x02\x02\x02\u01B5\u01B6\x05*\x13\x02" + - "\u01B6\u01B7\b/\x16\x02\u01B7c\x03\x02\x02\x02\u01B8\u01BA\n\x13\x02\x02" + - "\u01B9\u01B8\x03\x02\x02\x02\u01BA\u01BB\x03\x02\x02\x02\u01BB\u01BC\x03" + - "\x02\x02\x02\u01BB\u01B9\x03\x02\x02\x02\u01BC\u01BD\x03\x02\x02\x02\u01BD" + - "\u01BE\b0\x17\x02\u01BEe\x03\x02\x02\x02\u01BF\u01C0\x07b\x02\x02\u01C0" + - "\u01C1\x07b\x02\x02\u01C1\u01C2\x07b\x02\x02\u01C2\u01C3\x03\x02\x02\x02" + - "\u01C3\u01C4\b1\x18\x02\u01C4\u01C5\x03\x02\x02\x02\u01C5\u01C6\b1\v\x02" + - "\u01C6g\x03\x02\x02\x02\u01C7\u01C8\x05,\x14\x02\u01C8\u01C9\x03\x02\x02" + - "\x02\u01C9\u01CA\b2\x19\x02\u01CAi\x03\x02\x02\x02\u01CB\u01CC\x05*\x13" + - "\x02\u01CC\u01CD\x03\x02\x02\x02\u01CD\u01CE\b3\x1A\x02\u01CEk\x03\x02" + - "\x02\x02\u01CF\u01D1\x07\x0F\x02\x02\u01D0\u01CF\x03\x02\x02\x02\u01D0" + - "\u01D1\x03\x02\x02\x02\u01D1\u01D2\x03\x02\x02\x02\u01D2\u01D5\x07\f\x02" + - "\x02\u01D3\u01D5\n\x13\x02\x02\u01D4\u01D0\x03\x02\x02\x02\u01D4\u01D3" + - "\x03\x02\x02\x02\u01D5\u01D6\x03\x02\x02\x02\u01D6\u01D7\x03\x02\x02\x02" + - "\u01D6\u01D4\x03\x02\x02\x02\u01D7\u01D8\x03\x02\x02\x02\u01D8\u01D9\b" + - "4\x1B\x02\u01D9m\x03\x02\x02\x02\u01DA\u01DC\x05$\x10\x02\u01DB\u01DA" + - "\x03\x02\x02\x02\u01DC\u01DD\x03\x02\x02\x02\u01DD\u01DB\x03\x02\x02\x02" + - "\u01DD\u01DE\x03\x02\x02\x02\u01DE\u01DF\x03\x02\x02\x02\u01DF\u01E0\b" + - "5\x02\x02\u01E0o\x03\x02\x02\x02\u01E1\u01E3\x07\x0F\x02\x02\u01E2\u01E1" + - "\x03\x02\x02\x02\u01E2\u01E3\x03\x02\x02\x02\u01E3\u01E4\x03\x02\x02\x02" + - "\u01E4\u01E5\x07\f\x02\x02\u01E5\u01E6\b6\x1C\x02\u01E6\u01E7\b6\x1D\x02" + - "\u01E7\u01E8\x03\x02\x02\x02\u01E8\u01E9\b6\x02\x02\u01E9\u01EA\b6\x1E" + - "\x02\u01EAq\x03\x02\x02\x02\u01EB\u01EF\x05 \x0E\x02\u01EC\u01EF\x05\"" + - "\x0F\x02\u01ED\u01EF\x07a\x02\x02\u01EE\u01EB\x03\x02\x02\x02\u01EE\u01EC" + - "\x03\x02\x02\x02\u01EE\u01ED\x03\x02\x02\x02\u01EF\u01F5\x03\x02\x02\x02" + - "\u01F0\u01F4\x05 \x0E\x02\u01F1\u01F4\x05\"\x0F\x02\u01F2\u01F4\t\x17" + - "\x02\x02\u01F3\u01F0\x03\x02\x02\x02\u01F3\u01F1\x03\x02\x02\x02\u01F3" + - "\u01F2\x03\x02\x02\x02\u01F4\u01F7\x03\x02\x02\x02\u01F5\u01F3\x03\x02" + - "\x02\x02\u01F5\u01F6\x03\x02\x02\x02\u01F6s\x03\x02\x02\x02\u01F7\u01F5" + - "\x03\x02\x02\x02\u01F8\u01FA\n\x13\x02\x02\u01F9\u01F8\x03\x02\x02\x02" + - "\u01FA\u01FB\x03\x02\x02\x02\u01FB\u01FC\x03\x02\x02\x02\u01FB\u01F9\x03" + - "\x02\x02\x02\u01FCu\x03\x02\x02\x02\u01FD\u0201\x07@\x02\x02\u01FE\u0200" + - "\n\x13\x02\x02\u01FF\u01FE\x03\x02\x02\x02\u0200\u0203\x03\x02\x02\x02" + - "\u0201\u01FF\x03\x02\x02\x02\u0201\u0202\x03\x02\x02\x02\u0202\u0205\x03" + - "\x02\x02\x02\u0203\u0201\x03\x02\x02\x02\u0204\u0206\x07\x0F\x02\x02\u0205" + - "\u0204\x03\x02\x02\x02\u0205\u0206\x03\x02\x02\x02\u0206\u0207\x03\x02" + - "\x02\x02\u0207\u0208\x07\f\x02\x02\u0208\u0209\x069\f\x02\u0209\u020A" + - "\x03\x02\x02\x02\u020A\u020B\b9\x02\x02\u020Bw\x03\x02\x02\x02\u020C\u020E" + - "\x05$\x10\x02\u020D\u020C\x03\x02\x02\x02\u020E\u020F\x03\x02\x02\x02" + - "\u020F\u020D\x03\x02\x02\x02\u020F\u0210\x03\x02\x02\x02\u0210\u0211\x03" + - "\x02\x02\x02\u0211\u0212\x06:\r\x02\u0212\u0213\x03\x02\x02\x02\u0213" + - "\u0214\b:\x02\x02\u0214y\x03\x02\x02\x02\u0215\u0217\x07\x0F\x02\x02\u0216" + - "\u0215\x03\x02\x02\x02\u0216\u0217\x03\x02\x02\x02\u0217\u0218\x03\x02" + - "\x02\x02\u0218\u0219\x07\f\x02\x02\u0219\u021A\b;\x1F\x02\u021A{\x03\x02" + - "\x02\x02\u021B\u021C\x07_\x02\x02\u021C\u021D\x06<\x0E\x02\u021D\u021E" + - "\b< \x02\u021E\u021F\x03\x02\x02\x02\u021F\u0220\b<\v\x02\u0220\u0221" + - "\b<\v\x02\u0221}\x03\x02\x02\x02"; - private static readonly _serializedATNSegment1: string = - "\u0222\u0226\x05 \x0E\x02\u0223\u0226\x05\"\x0F\x02\u0224\u0226\x07a\x02" + - "\x02\u0225\u0222\x03\x02\x02\x02\u0225\u0223\x03\x02\x02\x02\u0225\u0224" + - "\x03\x02\x02\x02\u0226\u022C\x03\x02\x02\x02\u0227\u022B\x05 \x0E\x02" + - "\u0228\u022B\x05\"\x0F\x02\u0229\u022B\t\x17\x02\x02\u022A\u0227\x03\x02" + - "\x02\x02\u022A\u0228\x03\x02\x02\x02\u022A\u0229\x03\x02\x02\x02\u022B" + - "\u022E\x03\x02\x02\x02\u022C\u022A\x03\x02\x02\x02\u022C\u022D\x03\x02" + - "\x02\x02\u022D\u022F\x03\x02\x02\x02\u022E\u022C\x03\x02\x02\x02\u022F" + - "\u0230\x06=\x0F\x02\u0230\u0231\b=!\x02\u0231\x7F\x03\x02\x02\x02\u0232" + - "\u0233\x07?\x02\x02\u0233\u0234\x06>\x10\x02\u0234\u0235\b>\"\x02\u0235" + - "\x81\x03\x02\x02\x02\u0236\u0237\x07~\x02\x02\u0237\u0238\b?#\x02\u0238" + - "\x83\x03\x02\x02\x02\u0239\u023A\x05,\x14\x02\u023A\u023B\b@$\x02\u023B" + - "\x85\x03\x02\x02\x02\u023C\u023D\x05*\x13\x02\u023D\u023E\bA%\x02\u023E" + - "\x87\x03\x02\x02\x02\u023F\u0241\n\x13\x02\x02\u0240\u023F\x03\x02\x02" + - "\x02\u0241\u0242\x03\x02\x02\x02\u0242\u0243\x03\x02\x02\x02\u0242\u0240" + - "\x03\x02\x02\x02\u0243\u0244\x03\x02\x02\x02\u0244\u0245\bB&\x02\u0245" + - "\x89\x03\x02\x02\x025\x02\x03\x04\x05\x06\x07\xAC\xB5\xBD\xC1\xC8\xCA" + - "\xD1\xD7\xDE\xE3\xFD\u0105\u0111\u0116\u0121\u0126\u0128\u0136\u013B\u014B" + - "\u0158\u0166\u016E\u017C\u018C\u019A\u01AB\u01BB\u01D0\u01D4\u01D6\u01DD" + - "\u01E2\u01EE\u01F3\u01F5\u01FB\u0201\u0205\u020F\u0216\u0225\u022A\u022C" + - "\u0242\'\b\x02\x02\x03\x18\x02\x07\x03\x02\x03\x19\x03\x07\x04\x02\x07" + - "\x06\x02\x03\x1B\x04\x03\x1C\x05\x03\x1E\x06\x06\x02\x02\x03&\x07\x07" + - "\x05\x02\x03\'\b\x03(\t\x03)\n\x03*\v\x03+\f\x03,\r\x03-\x0E\x03.\x0F" + - "\x03/\x10\x030\x11\x031\x12\t\x1C\x02\t\x1D\x02\t\x1E\x02\x036\x13\x03" + - "6\x14\x07\x07\x02\x03;\x15\x03<\x16\x03=\x17\x03>\x18\x03?\x19\x03@\x1A" + - "\x03A\x1B\x03B\x1C"; - public static readonly _serializedATN: string = Utils.join( - [ - LGFileLexer._serializedATNSegment0, - LGFileLexer._serializedATNSegment1, - ], - "", - ); - public static __ATN: ATN; - public static get _ATN(): ATN { - if (!LGFileLexer.__ATN) { - LGFileLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(LGFileLexer._serializedATN)); - } - - return LGFileLexer.__ATN; - } - -} - +// Generated from ../LGFileLexer.g4 by ANTLR 4.6-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 LGFileLexer extends Lexer { + public static readonly COMMENTS = 1; + public static readonly WS = 2; + public static readonly NEWLINE = 3; + public static readonly HASH = 4; + public static readonly DASH = 5; + public static readonly LEFT_SQUARE_BRACKET = 6; + public static readonly IMPORT = 7; + public static readonly INVALID_TOKEN = 8; + public static readonly WS_IN_NAME = 9; + public static readonly NEWLINE_IN_NAME = 10; + public static readonly IDENTIFIER = 11; + public static readonly DOT = 12; + public static readonly OPEN_PARENTHESIS = 13; + public static readonly CLOSE_PARENTHESIS = 14; + public static readonly COMMA = 15; + public static readonly TEXT_IN_NAME = 16; + public static readonly WS_IN_BODY = 17; + public static readonly MULTILINE_PREFIX = 18; + public static readonly NEWLINE_IN_BODY = 19; + public static readonly IF = 20; + public static readonly ELSEIF = 21; + public static readonly ELSE = 22; + public static readonly SWITCH = 23; + public static readonly CASE = 24; + public static readonly DEFAULT = 25; + public static readonly ESCAPE_CHARACTER = 26; + public static readonly EXPRESSION = 27; + public static readonly TEXT = 28; + public static readonly MULTILINE_SUFFIX = 29; + public static readonly WS_IN_STRUCTURE_NAME = 30; + public static readonly NEWLINE_IN_STRUCTURE_NAME = 31; + public static readonly STRUCTURE_NAME = 32; + public static readonly TEXT_IN_STRUCTURE_NAME = 33; + public static readonly STRUCTURED_COMMENTS = 34; + public static readonly WS_IN_STRUCTURE_BODY = 35; + public static readonly STRUCTURED_NEWLINE = 36; + public static readonly STRUCTURED_BODY_END = 37; + public static readonly STRUCTURE_IDENTIFIER = 38; + public static readonly STRUCTURE_EQUALS = 39; + public static readonly STRUCTURE_OR_MARK = 40; + public static readonly ESCAPE_CHARACTER_IN_STRUCTURE_BODY = 41; + public static readonly EXPRESSION_IN_STRUCTURE_BODY = 42; + public static readonly TEXT_IN_STRUCTURE_BODY = 43; + public static readonly TEMPLATE_NAME_MODE = 1; + public static readonly TEMPLATE_BODY_MODE = 2; + public static readonly MULTILINE_MODE = 3; + public static readonly STRUCTURE_NAME_MODE = 4; + public static readonly STRUCTURE_BODY_MODE = 5; + // tslint:disable:no-trailing-whitespace + public static readonly modeNames: string[] = [ + "DEFAULT_MODE", "TEMPLATE_NAME_MODE", "TEMPLATE_BODY_MODE", "MULTILINE_MODE", + "STRUCTURE_NAME_MODE", "STRUCTURE_BODY_MODE", + ]; + + public static readonly ruleNames: string[] = [ + "A", "C", "D", "E", "F", "H", "I", "L", "S", "T", "U", "W", "LETTER", + "NUMBER", "WHITESPACE", "EMPTY_OBJECT", "STRING_LITERAL", "EXPRESSION_FRAGMENT", + "ESCAPE_CHARACTER_FRAGMENT", "COMMENTS", "WS", "NEWLINE", "HASH", "DASH", + "LEFT_SQUARE_BRACKET", "IMPORT", "INVALID_TOKEN", "WS_IN_NAME", "NEWLINE_IN_NAME", + "IDENTIFIER", "DOT", "OPEN_PARENTHESIS", "CLOSE_PARENTHESIS", "COMMA", + "TEXT_IN_NAME", "WS_IN_BODY", "MULTILINE_PREFIX", "NEWLINE_IN_BODY", "IF", + "ELSEIF", "ELSE", "SWITCH", "CASE", "DEFAULT", "ESCAPE_CHARACTER", "EXPRESSION", + "TEXT", "MULTILINE_SUFFIX", "MULTILINE_ESCAPE_CHARACTER", "MULTILINE_EXPRESSION", + "MULTILINE_TEXT", "WS_IN_STRUCTURE_NAME", "NEWLINE_IN_STRUCTURE_NAME", + "STRUCTURE_NAME", "TEXT_IN_STRUCTURE_NAME", "STRUCTURED_COMMENTS", "WS_IN_STRUCTURE_BODY", + "STRUCTURED_NEWLINE", "STRUCTURED_BODY_END", "STRUCTURE_IDENTIFIER", "STRUCTURE_EQUALS", + "STRUCTURE_OR_MARK", "ESCAPE_CHARACTER_IN_STRUCTURE_BODY", "EXPRESSION_IN_STRUCTURE_BODY", + "TEXT_IN_STRUCTURE_BODY", + ]; + + private static readonly _LITERAL_NAMES: Array = [ + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, undefined, "'.'", "'('", "')'", + "','", undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, "'|'", + ]; + private static readonly _SYMBOLIC_NAMES: Array = [ + undefined, "COMMENTS", "WS", "NEWLINE", "HASH", "DASH", "LEFT_SQUARE_BRACKET", + "IMPORT", "INVALID_TOKEN", "WS_IN_NAME", "NEWLINE_IN_NAME", "IDENTIFIER", + "DOT", "OPEN_PARENTHESIS", "CLOSE_PARENTHESIS", "COMMA", "TEXT_IN_NAME", + "WS_IN_BODY", "MULTILINE_PREFIX", "NEWLINE_IN_BODY", "IF", "ELSEIF", "ELSE", + "SWITCH", "CASE", "DEFAULT", "ESCAPE_CHARACTER", "EXPRESSION", "TEXT", + "MULTILINE_SUFFIX", "WS_IN_STRUCTURE_NAME", "NEWLINE_IN_STRUCTURE_NAME", + "STRUCTURE_NAME", "TEXT_IN_STRUCTURE_NAME", "STRUCTURED_COMMENTS", "WS_IN_STRUCTURE_BODY", + "STRUCTURED_NEWLINE", "STRUCTURED_BODY_END", "STRUCTURE_IDENTIFIER", "STRUCTURE_EQUALS", + "STRUCTURE_OR_MARK", "ESCAPE_CHARACTER_IN_STRUCTURE_BODY", "EXPRESSION_IN_STRUCTURE_BODY", + "TEXT_IN_STRUCTURE_BODY", + ]; + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(LGFileLexer._LITERAL_NAMES, LGFileLexer._SYMBOLIC_NAMES, []); + + // @Override + // @NotNull + public get vocabulary(): Vocabulary { + return LGFileLexer.VOCABULARY; + } + // tslint:enable:no-trailing-whitespace + + + ignoreWS = true; // usually we ignore whitespace, but inside template, whitespace is significant + inTemplate = false; // whether we are in the template + beginOfTemplateBody = false; // whether we are at the begining of template body + inMultiline = false; // whether we are in multiline + beginOfTemplateLine = false;// weather we are at the begining of template string + inStructuredValue = false; // weather we are in the structure value + beginOfStructureProperty = false; // weather we are at the begining of structure property + + + constructor(input: CharStream) { + super(input); + this._interp = new LexerATNSimulator(LGFileLexer._ATN, this); + } + + // @Override + public get grammarFileName(): string { return "LGFileLexer.g4"; } + + // @Override + public get ruleNames(): string[] { return LGFileLexer.ruleNames; } + + // @Override + public get serializedATN(): string { return LGFileLexer._serializedATN; } + + // @Override + public get modeNames(): string[] { return LGFileLexer.modeNames; } + + // @Override + public action(_localctx: RuleContext, ruleIndex: number, actionIndex: number): void { + switch (ruleIndex) { + case 22: + this.HASH_action(_localctx, actionIndex); + break; + + case 23: + this.DASH_action(_localctx, actionIndex); + break; + + case 25: + this.IMPORT_action(_localctx, actionIndex); + break; + + case 26: + this.INVALID_TOKEN_action(_localctx, actionIndex); + break; + + case 28: + this.NEWLINE_IN_NAME_action(_localctx, actionIndex); + break; + + case 36: + this.MULTILINE_PREFIX_action(_localctx, actionIndex); + break; + + case 37: + this.NEWLINE_IN_BODY_action(_localctx, actionIndex); + break; + + case 38: + this.IF_action(_localctx, actionIndex); + break; + + case 39: + this.ELSEIF_action(_localctx, actionIndex); + break; + + case 40: + this.ELSE_action(_localctx, actionIndex); + break; + + case 41: + this.SWITCH_action(_localctx, actionIndex); + break; + + case 42: + this.CASE_action(_localctx, actionIndex); + break; + + case 43: + this.DEFAULT_action(_localctx, actionIndex); + break; + + case 44: + this.ESCAPE_CHARACTER_action(_localctx, actionIndex); + break; + + case 45: + this.EXPRESSION_action(_localctx, actionIndex); + break; + + case 46: + this.TEXT_action(_localctx, actionIndex); + break; + + case 47: + this.MULTILINE_SUFFIX_action(_localctx, actionIndex); + break; + + case 52: + this.NEWLINE_IN_STRUCTURE_NAME_action(_localctx, actionIndex); + break; + + case 57: + this.STRUCTURED_NEWLINE_action(_localctx, actionIndex); + break; + + case 58: + this.STRUCTURED_BODY_END_action(_localctx, actionIndex); + break; + + case 59: + this.STRUCTURE_IDENTIFIER_action(_localctx, actionIndex); + break; + + case 60: + this.STRUCTURE_EQUALS_action(_localctx, actionIndex); + break; + + case 61: + this.STRUCTURE_OR_MARK_action(_localctx, actionIndex); + break; + + case 62: + this.ESCAPE_CHARACTER_IN_STRUCTURE_BODY_action(_localctx, actionIndex); + break; + + case 63: + this.EXPRESSION_IN_STRUCTURE_BODY_action(_localctx, actionIndex); + break; + + case 64: + this.TEXT_IN_STRUCTURE_BODY_action(_localctx, actionIndex); + break; + } + } + private HASH_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 0: + this.inTemplate = true; this.beginOfTemplateBody = false; + break; + } + } + private DASH_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 1: + this.beginOfTemplateLine = true; this.beginOfTemplateBody = false; + break; + } + } + private IMPORT_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 2: + this.inTemplate = false; + break; + } + } + private INVALID_TOKEN_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 3: + this.inTemplate = false; this.beginOfTemplateBody = false; + break; + } + } + private NEWLINE_IN_NAME_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 4: + this.beginOfTemplateBody = true; + break; + } + } + private MULTILINE_PREFIX_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 5: + this.inMultiline = true; this.beginOfTemplateLine = false; + break; + } + } + private NEWLINE_IN_BODY_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 6: + this.ignoreWS = true; + break; + } + } + private IF_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 7: + this.ignoreWS = true; this.beginOfTemplateLine = false; + break; + } + } + private ELSEIF_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 8: + this.ignoreWS = true; this.beginOfTemplateLine = false; + break; + } + } + private ELSE_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 9: + this.ignoreWS = true; this.beginOfTemplateLine = false; + break; + } + } + private SWITCH_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 10: + this.ignoreWS = true; this.beginOfTemplateLine = false; + break; + } + } + private CASE_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 11: + this.ignoreWS = true; this.beginOfTemplateLine = false; + break; + } + } + private DEFAULT_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 12: + this.ignoreWS = true; this.beginOfTemplateLine = false; + break; + } + } + private ESCAPE_CHARACTER_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 13: + this.ignoreWS = false; this.beginOfTemplateLine = false; + break; + } + } + private EXPRESSION_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 14: + this.ignoreWS = false; this.beginOfTemplateLine = false; + break; + } + } + private TEXT_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 15: + this.ignoreWS = false; this.beginOfTemplateLine = false; + break; + } + } + private MULTILINE_SUFFIX_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 16: + this.inMultiline = false; + break; + } + } + private NEWLINE_IN_STRUCTURE_NAME_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 17: + this.ignoreWS = true; + break; + + case 18: + this.beginOfStructureProperty = true; + break; + } + } + private STRUCTURED_NEWLINE_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 19: + this.ignoreWS = true; this.inStructuredValue = false; this.beginOfStructureProperty = true; + break; + } + } + private STRUCTURED_BODY_END_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 20: + this.inTemplate = false; this.beginOfTemplateBody = false; + break; + } + } + private STRUCTURE_IDENTIFIER_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 21: + this.beginOfStructureProperty = false; + break; + } + } + private STRUCTURE_EQUALS_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 22: + this.inStructuredValue = true; + break; + } + } + private STRUCTURE_OR_MARK_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 23: + this.ignoreWS = true; + break; + } + } + private ESCAPE_CHARACTER_IN_STRUCTURE_BODY_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 24: + this.ignoreWS = false; + break; + } + } + private EXPRESSION_IN_STRUCTURE_BODY_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 25: + this.ignoreWS = false; + break; + } + } + private TEXT_IN_STRUCTURE_BODY_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 26: + this.ignoreWS = false; this.beginOfStructureProperty = false; + break; + } + } + // @Override + public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { + switch (ruleIndex) { + case 23: + return this.DASH_sempred(_localctx, predIndex); + + case 24: + return this.LEFT_SQUARE_BRACKET_sempred(_localctx, predIndex); + + case 35: + return this.WS_IN_BODY_sempred(_localctx, predIndex); + + case 36: + return this.MULTILINE_PREFIX_sempred(_localctx, predIndex); + + case 38: + return this.IF_sempred(_localctx, predIndex); + + case 39: + return this.ELSEIF_sempred(_localctx, predIndex); + + case 40: + return this.ELSE_sempred(_localctx, predIndex); + + case 41: + return this.SWITCH_sempred(_localctx, predIndex); + + case 42: + return this.CASE_sempred(_localctx, predIndex); + + case 43: + return this.DEFAULT_sempred(_localctx, predIndex); + + case 55: + return this.STRUCTURED_COMMENTS_sempred(_localctx, predIndex); + + case 56: + return this.WS_IN_STRUCTURE_BODY_sempred(_localctx, predIndex); + + case 58: + return this.STRUCTURED_BODY_END_sempred(_localctx, predIndex); + + case 59: + return this.STRUCTURE_IDENTIFIER_sempred(_localctx, predIndex); + + case 60: + return this.STRUCTURE_EQUALS_sempred(_localctx, predIndex); + } + return true; + } + private DASH_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 0: + return this.inTemplate ; + } + return true; + } + private LEFT_SQUARE_BRACKET_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 1: + return this.inTemplate && this.beginOfTemplateBody ; + } + return true; + } + private WS_IN_BODY_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 2: + return this.ignoreWS; + } + return true; + } + private MULTILINE_PREFIX_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 3: + return !this.inMultiline && this.beginOfTemplateLine ; + } + return true; + } + private IF_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 4: + return this.beginOfTemplateLine; + } + return true; + } + private ELSEIF_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 5: + return this.beginOfTemplateLine; + } + return true; + } + private ELSE_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 6: + return this.beginOfTemplateLine ; + } + return true; + } + private SWITCH_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 7: + return this.beginOfTemplateLine; + } + return true; + } + private CASE_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 8: + return this.beginOfTemplateLine; + } + return true; + } + private DEFAULT_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 9: + return this.beginOfTemplateLine; + } + return true; + } + private STRUCTURED_COMMENTS_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 10: + return !this.inStructuredValue && this.beginOfStructureProperty; + } + return true; + } + private WS_IN_STRUCTURE_BODY_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 11: + return this.ignoreWS; + } + return true; + } + private STRUCTURED_BODY_END_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 12: + return !this.inStructuredValue; + } + return true; + } + private STRUCTURE_IDENTIFIER_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 13: + return !this.inStructuredValue && this.beginOfStructureProperty; + } + return true; + } + private STRUCTURE_EQUALS_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 14: + return !this.inStructuredValue; + } + return true; + } + + private static readonly _serializedATNSegments: number = 2; + private static readonly _serializedATNSegment0: string = + "\x03\uAF6F\u8320\u479D\uB75C\u4880\u1605\u191C\uAB37\x02-\u0246\b\x01" + + "\b\x01\b\x01\b\x01\b\x01\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\x04\x1B\t\x1B\x04\x1C\t\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t" + + "\x1F\x04 \t \x04!\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t" + + "\'\x04(\t(\x04)\t)\x04*\t*\x04+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x04" + + "0\t0\x041\t1\x042\t2\x043\t3\x044\t4\x045\t5\x046\t6\x047\t7\x048\t8\x04" + + "9\t9\x04:\t:\x04;\t;\x04<\t<\x04=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04" + + "B\tB\x03\x02\x03\x02\x03\x03\x03\x03\x03\x04\x03\x04\x03\x05\x03\x05\x03" + + "\x06\x03\x06\x03\x07\x03\x07\x03\b\x03\b\x03\t\x03\t\x03\n\x03\n\x03\v" + + "\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x10" + + "\x03\x10\x03\x11\x03\x11\x07\x11\xAB\n\x11\f\x11\x0E\x11\xAE\v\x11\x03" + + "\x11\x03\x11\x03\x12\x03\x12\x07\x12\xB4\n\x12\f\x12\x0E\x12\xB7\v\x12" + + "\x03\x12\x03\x12\x03\x12\x07\x12\xBC\n\x12\f\x12\x0E\x12\xBF\v\x12\x03" + + "\x12\x05\x12\xC2\n\x12\x03\x13\x03\x13\x03\x13\x03\x13\x03\x13\x07\x13" + + "\xC9\n\x13\f\x13\x0E\x13\xCC\v\x13\x03\x13\x03\x13\x03\x14\x03\x14\x05" + + "\x14\xD2\n\x14\x03\x15\x03\x15\x06\x15\xD6\n\x15\r\x15\x0E\x15\xD7\x03" + + "\x15\x03\x15\x03\x16\x06\x16\xDD\n\x16\r\x16\x0E\x16\xDE\x03\x16\x03\x16" + + "\x03\x17\x05\x17\xE4\n\x17\x03\x17\x03\x17\x03\x17\x03\x17\x03\x18\x03" + + "\x18\x03\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03" + + "\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x07\x1B\xFC" + + "\n\x1B\f\x1B\x0E\x1B\xFF\v\x1B\x03\x1B\x03\x1B\x03\x1B\x07\x1B\u0104\n" + + "\x1B\f\x1B\x0E\x1B\u0107\v\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1C\x03\x1C" + + "\x03\x1C\x03\x1D\x06\x1D\u0110\n\x1D\r\x1D\x0E\x1D\u0111\x03\x1D\x03\x1D" + + "\x03\x1E\x05\x1E\u0117\n\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03" + + "\x1E\x03\x1F\x03\x1F\x03\x1F\x05\x1F\u0122\n\x1F\x03\x1F\x03\x1F\x03\x1F" + + "\x07\x1F\u0127\n\x1F\f\x1F\x0E\x1F\u012A\v\x1F\x03 \x03 \x03!\x03!\x03" + + "\"\x03\"\x03#\x03#\x03$\x06$\u0135\n$\r$\x0E$\u0136\x03%\x06%\u013A\n" + + "%\r%\x0E%\u013B\x03%\x03%\x03%\x03%\x03&\x03&\x03&\x03&\x03&\x03&\x03" + + "&\x03&\x03&\x03\'\x05\'\u014C\n\'\x03\'\x03\'\x03\'\x03\'\x03\'\x03\'" + + "\x03(\x03(\x03(\x07(\u0157\n(\f(\x0E(\u015A\v(\x03(\x03(\x03(\x03(\x03" + + ")\x03)\x03)\x03)\x03)\x07)\u0165\n)\f)\x0E)\u0168\v)\x03)\x03)\x03)\x07" + + ")\u016D\n)\f)\x0E)\u0170\v)\x03)\x03)\x03)\x03)\x03*\x03*\x03*\x03*\x03" + + "*\x07*\u017B\n*\f*\x0E*\u017E\v*\x03*\x03*\x03*\x03*\x03+\x03+\x03+\x03" + + "+\x03+\x03+\x03+\x07+\u018B\n+\f+\x0E+\u018E\v+\x03+\x03+\x03+\x03+\x03" + + ",\x03,\x03,\x03,\x03,\x07,\u0199\n,\f,\x0E,\u019C\v,\x03,\x03,\x03,\x03" + + ",\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x07-\u01AA\n-\f-\x0E-\u01AD" + + "\v-\x03-\x03-\x03-\x03-\x03.\x03.\x03.\x03/\x03/\x03/\x030\x060\u01BA" + + "\n0\r0\x0E0\u01BB\x030\x030\x031\x031\x031\x031\x031\x031\x031\x031\x03" + + "2\x032\x032\x032\x033\x033\x033\x033\x034\x054\u01D1\n4\x034\x034\x06" + + "4\u01D5\n4\r4\x0E4\u01D6\x034\x034\x035\x065\u01DC\n5\r5\x0E5\u01DD\x03" + + "5\x035\x036\x056\u01E3\n6\x036\x036\x036\x036\x036\x036\x036\x037\x03" + + "7\x037\x057\u01EF\n7\x037\x037\x037\x077\u01F4\n7\f7\x0E7\u01F7\v7\x03" + + "8\x068\u01FA\n8\r8\x0E8\u01FB\x039\x039\x079\u0200\n9\f9\x0E9\u0203\v" + + "9\x039\x059\u0206\n9\x039\x039\x039\x039\x039\x03:\x06:\u020E\n:\r:\x0E" + + ":\u020F\x03:\x03:\x03:\x03:\x03;\x05;\u0217\n;\x03;\x03;\x03;\x03<\x03" + + "<\x03<\x03<\x03<\x03<\x03<\x03=\x03=\x03=\x05=\u0226\n=\x03=\x03=\x03" + + "=\x07=\u022B\n=\f=\x0E=\u022E\v=\x03=\x03=\x03=\x03>\x03>\x03>\x03>\x03" + + "?\x03?\x03?\x03@\x03@\x03@\x03A\x03A\x03A\x03B\x06B\u0241\nB\rB\x0EB\u0242" + + "\x03B\x03B\n\xCA\xFD\u0105\u0136\u01BB\u01D6\u01FB\u0242\x02\x02C\b\x02" + + "\x02\n\x02\x02\f\x02\x02\x0E\x02\x02\x10\x02\x02\x12\x02\x02\x14\x02\x02" + + "\x16\x02\x02\x18\x02\x02\x1A\x02\x02\x1C\x02\x02\x1E\x02\x02 \x02\x02" + + "\"\x02\x02$\x02\x02&\x02\x02(\x02\x02*\x02\x02,\x02\x02.\x02\x030\x02" + + "\x042\x02\x054\x02\x066\x02\x078\x02\b:\x02\t<\x02\n>\x02\v@\x02\fB\x02" + + "\rD\x02\x0EF\x02\x0FH\x02\x10J\x02\x11L\x02\x12N\x02\x13P\x02\x14R\x02" + + "\x15T\x02\x16V\x02\x17X\x02\x18Z\x02\x19\\\x02\x1A^\x02\x1B`\x02\x1Cb" + + "\x02\x1Dd\x02\x1Ef\x02\x1Fh\x02\x02j\x02\x02l\x02\x02n\x02 p\x02!r\x02" + + "\"t\x02#v\x02$x\x02%z\x02&|\x02\'~\x02(\x80\x02)\x82\x02*\x84\x02+\x86" + + "\x02,\x88\x02-\b\x02\x03\x04\x05\x06\x07\x18\x04\x02CCcc\x04\x02EEee\x04" + + "\x02FFff\x04\x02GGgg\x04\x02HHhh\x04\x02JJjj\x04\x02KKkk\x04\x02NNnn\x04" + + "\x02UUuu\x04\x02VVvv\x04\x02WWww\x04\x02YYyy\x04\x02C\\c|\x06\x02\v\v" + + "\"\"\xA2\xA2\uFF01\uFF01\x05\x02\f\f\x0F\x0F))\x05\x02\f\f\x0F\x0F$$\b" + + "\x02\f\f\x0F\x0F$$))}}\x7F\x7F\x04\x02\f\f\x0F\x0F\x06\x02\f\f\x0F\x0F" + + "]]__\x05\x02\f\f\x0F\x0F*+\x04\x02//aa\x04\x02/0aa\u0261\x02.\x03\x02" + + "\x02\x02\x020\x03\x02\x02\x02\x022\x03\x02\x02\x02\x024\x03\x02\x02\x02" + + "\x026\x03\x02\x02\x02\x028\x03\x02\x02\x02\x02:\x03\x02\x02\x02\x02<\x03" + + "\x02\x02\x02\x03>\x03\x02\x02\x02\x03@\x03\x02\x02\x02\x03B\x03\x02\x02" + + "\x02\x03D\x03\x02\x02\x02\x03F\x03\x02\x02\x02\x03H\x03\x02\x02\x02\x03" + + "J\x03\x02\x02\x02\x03L\x03\x02\x02\x02\x04N\x03\x02\x02\x02\x04P\x03\x02" + + "\x02\x02\x04R\x03\x02\x02\x02\x04T\x03\x02\x02\x02\x04V\x03\x02\x02\x02" + + "\x04X\x03\x02\x02\x02\x04Z\x03\x02\x02\x02\x04\\\x03\x02\x02\x02\x04^" + + "\x03\x02\x02\x02\x04`\x03\x02\x02\x02\x04b\x03\x02\x02\x02\x04d\x03\x02" + + "\x02\x02\x05f\x03\x02\x02\x02\x05h\x03\x02\x02\x02\x05j\x03\x02\x02\x02" + + "\x05l\x03\x02\x02\x02\x06n\x03\x02\x02\x02\x06p\x03\x02\x02\x02\x06r\x03" + + "\x02\x02\x02\x06t\x03\x02\x02\x02\x07v\x03\x02\x02\x02\x07x\x03\x02\x02" + + "\x02\x07z\x03\x02\x02\x02\x07|\x03\x02\x02\x02\x07~\x03\x02\x02\x02\x07" + + "\x80\x03\x02\x02\x02\x07\x82\x03\x02\x02\x02\x07\x84\x03\x02\x02\x02\x07" + + "\x86\x03\x02\x02\x02\x07\x88\x03\x02\x02\x02\b\x8A\x03\x02\x02\x02\n\x8C" + + "\x03\x02\x02\x02\f\x8E\x03\x02\x02\x02\x0E\x90\x03\x02\x02\x02\x10\x92" + + "\x03\x02\x02\x02\x12\x94\x03\x02\x02\x02\x14\x96\x03\x02\x02\x02\x16\x98" + + "\x03\x02\x02\x02\x18\x9A\x03\x02\x02\x02\x1A\x9C\x03\x02\x02\x02\x1C\x9E" + + "\x03\x02\x02\x02\x1E\xA0\x03\x02\x02\x02 \xA2\x03\x02\x02\x02\"\xA4\x03" + + "\x02\x02\x02$\xA6\x03\x02\x02\x02&\xA8\x03\x02\x02\x02(\xC1\x03\x02\x02" + + "\x02*\xC3\x03\x02\x02\x02,\xCF\x03\x02\x02\x02.\xD3\x03\x02\x02\x020\xDC" + + "\x03\x02\x02\x022\xE3\x03\x02\x02\x024\xE9\x03\x02\x02\x026\xEE\x03\x02" + + "\x02\x028\xF4\x03\x02\x02\x02:\xF9\x03\x02\x02\x02<\u010B\x03\x02\x02" + + "\x02>\u010F\x03\x02\x02\x02@\u0116\x03\x02\x02\x02B\u0121\x03\x02\x02" + + "\x02D\u012B\x03\x02\x02\x02F\u012D\x03\x02\x02\x02H\u012F\x03\x02\x02" + + "\x02J\u0131\x03\x02\x02\x02L\u0134\x03\x02\x02\x02N\u0139\x03\x02\x02" + + "\x02P\u0141\x03\x02\x02\x02R\u014B\x03\x02\x02\x02T\u0153\x03\x02\x02" + + "\x02V\u015F\x03\x02\x02\x02X\u0175\x03\x02\x02\x02Z\u0183\x03\x02\x02" + + "\x02\\\u0193\x03\x02\x02\x02^\u01A1\x03\x02\x02\x02`\u01B2\x03\x02\x02" + + "\x02b\u01B5\x03\x02\x02\x02d\u01B9\x03\x02\x02\x02f\u01BF\x03\x02\x02" + + "\x02h\u01C7\x03\x02\x02\x02j\u01CB\x03\x02\x02\x02l\u01D4\x03\x02\x02" + + "\x02n\u01DB\x03\x02\x02\x02p\u01E2\x03\x02\x02\x02r\u01EE\x03\x02\x02" + + "\x02t\u01F9\x03\x02\x02\x02v\u01FD\x03\x02\x02\x02x\u020D\x03\x02\x02" + + "\x02z\u0216\x03\x02\x02\x02|\u021B\x03\x02\x02\x02~\u0225\x03\x02\x02" + + "\x02\x80\u0232\x03\x02\x02\x02\x82\u0236\x03\x02\x02\x02\x84\u0239\x03" + + "\x02\x02\x02\x86\u023C\x03\x02\x02\x02\x88\u0240\x03\x02\x02\x02\x8A\x8B" + + "\t\x02\x02\x02\x8B\t\x03\x02\x02\x02\x8C\x8D\t\x03\x02\x02\x8D\v\x03\x02" + + "\x02\x02\x8E\x8F\t\x04\x02\x02\x8F\r\x03\x02\x02\x02\x90\x91\t\x05\x02" + + "\x02\x91\x0F\x03\x02\x02\x02\x92\x93\t\x06\x02\x02\x93\x11\x03\x02\x02" + + "\x02\x94\x95\t\x07\x02\x02\x95\x13\x03\x02\x02\x02\x96\x97\t\b\x02\x02" + + "\x97\x15\x03\x02\x02\x02\x98\x99\t\t\x02\x02\x99\x17\x03\x02\x02\x02\x9A" + + "\x9B\t\n\x02\x02\x9B\x19\x03\x02\x02\x02\x9C\x9D\t\v\x02\x02\x9D\x1B\x03" + + "\x02\x02\x02\x9E\x9F\t\f\x02\x02\x9F\x1D\x03\x02\x02\x02\xA0\xA1\t\r\x02" + + "\x02\xA1\x1F\x03\x02\x02\x02\xA2\xA3\t\x0E\x02\x02\xA3!\x03\x02\x02\x02" + + "\xA4\xA5\x042;\x02\xA5#\x03\x02\x02\x02\xA6\xA7\t\x0F\x02\x02\xA7%\x03" + + "\x02\x02\x02\xA8\xAC\x07}\x02\x02\xA9\xAB\x05$\x10\x02\xAA\xA9\x03\x02" + + "\x02\x02\xAB\xAE\x03\x02\x02\x02\xAC\xAA\x03\x02\x02\x02\xAC\xAD\x03\x02" + + "\x02\x02\xAD\xAF\x03\x02\x02\x02\xAE\xAC\x03\x02\x02\x02\xAF\xB0\x07\x7F" + + "\x02\x02\xB0\'\x03\x02\x02\x02\xB1\xB5\x07)\x02\x02\xB2\xB4\n\x10\x02" + + "\x02\xB3\xB2\x03\x02\x02\x02\xB4\xB7\x03\x02\x02\x02\xB5\xB3\x03\x02\x02" + + "\x02\xB5\xB6\x03\x02\x02\x02\xB6\xB8\x03\x02\x02\x02\xB7\xB5\x03\x02\x02" + + "\x02\xB8\xC2\x07)\x02\x02\xB9\xBD\x07$\x02\x02\xBA\xBC\n\x11\x02\x02\xBB" + + "\xBA\x03\x02\x02\x02\xBC\xBF\x03\x02\x02\x02\xBD\xBB\x03\x02\x02\x02\xBD" + + "\xBE\x03\x02\x02\x02\xBE\xC0\x03\x02\x02\x02\xBF\xBD\x03\x02\x02\x02\xC0" + + "\xC2\x07$\x02\x02\xC1\xB1\x03\x02\x02\x02\xC1\xB9\x03\x02\x02\x02\xC2" + + ")\x03\x02\x02\x02\xC3\xC4\x07&\x02\x02\xC4\xCA\x07}\x02\x02\xC5\xC9\x05" + + "(\x12\x02\xC6\xC9\n\x12\x02\x02\xC7\xC9\x05&\x11\x02\xC8\xC5\x03\x02\x02" + + "\x02\xC8\xC6\x03\x02\x02\x02\xC8\xC7\x03\x02\x02\x02\xC9\xCC\x03\x02\x02" + + "\x02\xCA\xCB\x03\x02\x02\x02\xCA\xC8\x03\x02\x02\x02\xCB\xCD\x03\x02\x02" + + "\x02\xCC\xCA\x03\x02\x02\x02\xCD\xCE\x07\x7F\x02\x02\xCE+\x03\x02\x02" + + "\x02\xCF\xD1\x07^\x02\x02\xD0\xD2\n\x13\x02\x02\xD1\xD0\x03\x02\x02\x02" + + "\xD1\xD2\x03\x02\x02\x02\xD2-\x03\x02\x02\x02\xD3\xD5\x07@\x02\x02\xD4" + + "\xD6\n\x13\x02\x02\xD5\xD4\x03\x02\x02\x02\xD6\xD7\x03\x02\x02\x02\xD7" + + "\xD5\x03\x02\x02\x02\xD7\xD8\x03\x02\x02\x02\xD8\xD9\x03\x02\x02\x02\xD9" + + "\xDA\b\x15\x02\x02\xDA/\x03\x02\x02\x02\xDB\xDD\x05$\x10\x02\xDC\xDB\x03" + + "\x02\x02\x02\xDD\xDE\x03\x02\x02\x02\xDE\xDC\x03\x02\x02\x02\xDE\xDF\x03" + + "\x02\x02\x02\xDF\xE0\x03\x02\x02\x02\xE0\xE1\b\x16\x02\x02\xE11\x03\x02" + + "\x02\x02\xE2\xE4\x07\x0F\x02\x02\xE3\xE2\x03\x02\x02\x02\xE3\xE4\x03\x02" + + "\x02\x02\xE4\xE5\x03\x02\x02\x02\xE5\xE6\x07\f\x02\x02\xE6\xE7\x03\x02" + + "\x02\x02\xE7\xE8\b\x17\x02\x02\xE83\x03\x02\x02\x02\xE9\xEA\x07%\x02\x02" + + "\xEA\xEB\b\x18\x03\x02\xEB\xEC\x03\x02\x02\x02\xEC\xED\b\x18\x04\x02\xED" + + "5\x03\x02\x02\x02\xEE\xEF\x07/\x02\x02\xEF\xF0\x06\x19\x02\x02\xF0\xF1" + + "\b\x19\x05\x02\xF1\xF2\x03\x02\x02\x02\xF2\xF3\b\x19\x06\x02\xF37\x03" + + "\x02\x02\x02\xF4\xF5\x07]\x02\x02\xF5\xF6\x06\x1A\x03\x02\xF6\xF7\x03" + + "\x02\x02\x02\xF7\xF8\b\x1A\x07\x02\xF89\x03\x02\x02\x02\xF9\xFD\x07]\x02" + + "\x02\xFA\xFC\n\x14\x02\x02\xFB\xFA\x03\x02\x02\x02\xFC\xFF\x03\x02\x02" + + "\x02\xFD\xFE\x03\x02\x02\x02\xFD\xFB\x03\x02\x02\x02\xFE\u0100\x03\x02" + + "\x02\x02\xFF\xFD\x03\x02\x02\x02\u0100\u0101\x07_\x02\x02\u0101\u0105" + + "\x07*\x02\x02\u0102\u0104\n\x15\x02\x02\u0103\u0102\x03\x02\x02\x02\u0104" + + "\u0107\x03\x02\x02\x02\u0105\u0106\x03\x02\x02\x02\u0105\u0103\x03\x02" + + "\x02\x02\u0106\u0108\x03\x02\x02\x02\u0107\u0105\x03\x02\x02\x02\u0108" + + "\u0109\x07+\x02\x02\u0109\u010A\b\x1B\b\x02\u010A;\x03\x02\x02\x02\u010B" + + "\u010C\v\x02\x02\x02\u010C\u010D\b\x1C\t\x02\u010D=\x03\x02\x02\x02\u010E" + + "\u0110\x05$\x10\x02\u010F\u010E\x03\x02\x02\x02\u0110\u0111\x03\x02\x02" + + "\x02\u0111\u010F\x03\x02\x02\x02\u0111\u0112\x03\x02\x02\x02\u0112\u0113" + + "\x03\x02\x02\x02\u0113\u0114\b\x1D\x02\x02\u0114?\x03\x02\x02\x02\u0115" + + "\u0117\x07\x0F\x02\x02\u0116\u0115\x03\x02\x02\x02\u0116\u0117\x03\x02" + + "\x02\x02\u0117\u0118\x03\x02\x02\x02\u0118\u0119\x07\f\x02\x02\u0119\u011A" + + "\b\x1E\n\x02\u011A\u011B\x03\x02\x02\x02\u011B\u011C\b\x1E\x02\x02\u011C" + + "\u011D\b\x1E\v\x02\u011DA\x03\x02\x02\x02\u011E\u0122\x05 \x0E\x02\u011F" + + "\u0122\x05\"\x0F\x02\u0120\u0122\x07a\x02\x02\u0121\u011E\x03\x02\x02" + + "\x02\u0121\u011F\x03\x02\x02\x02\u0121\u0120\x03\x02\x02\x02\u0122\u0128" + + "\x03\x02\x02\x02\u0123\u0127\x05 \x0E\x02\u0124\u0127\x05\"\x0F\x02\u0125" + + "\u0127\t\x16\x02\x02\u0126\u0123\x03\x02\x02\x02\u0126\u0124\x03\x02\x02" + + "\x02\u0126\u0125\x03\x02\x02\x02\u0127\u012A\x03\x02\x02\x02\u0128\u0126" + + "\x03\x02\x02\x02\u0128\u0129\x03\x02\x02\x02\u0129C\x03\x02\x02\x02\u012A" + + "\u0128\x03\x02\x02\x02\u012B\u012C\x070\x02\x02\u012CE\x03\x02\x02\x02" + + "\u012D\u012E\x07*\x02\x02\u012EG\x03\x02\x02\x02\u012F\u0130\x07+\x02" + + "\x02\u0130I\x03\x02\x02\x02\u0131\u0132\x07.\x02\x02\u0132K\x03\x02\x02" + + "\x02\u0133\u0135\n\x13\x02\x02\u0134\u0133\x03\x02\x02\x02\u0135\u0136" + + "\x03\x02\x02\x02\u0136\u0137\x03\x02\x02\x02\u0136\u0134\x03\x02\x02\x02" + + "\u0137M\x03\x02\x02\x02\u0138\u013A\x05$\x10\x02\u0139\u0138\x03\x02\x02" + + "\x02\u013A\u013B\x03\x02\x02\x02\u013B\u0139\x03\x02\x02\x02\u013B\u013C" + + "\x03\x02\x02\x02\u013C\u013D\x03\x02\x02\x02\u013D\u013E\x06%\x04\x02" + + "\u013E\u013F\x03\x02\x02\x02\u013F\u0140\b%\x02\x02\u0140O\x03\x02\x02" + + "\x02\u0141\u0142\x07b\x02\x02\u0142\u0143\x07b\x02\x02\u0143\u0144\x07" + + "b\x02\x02\u0144\u0145\x03\x02\x02\x02\u0145\u0146\x06&\x05\x02\u0146\u0147" + + "\b&\f\x02\u0147\u0148\x03\x02\x02\x02\u0148\u0149\b&\r\x02\u0149Q\x03" + + "\x02\x02\x02\u014A\u014C\x07\x0F\x02\x02\u014B\u014A\x03\x02\x02\x02\u014B" + + "\u014C\x03\x02\x02\x02\u014C\u014D\x03\x02\x02\x02\u014D\u014E\x07\f\x02" + + "\x02\u014E\u014F\b\'\x0E\x02\u014F\u0150\x03\x02\x02\x02\u0150\u0151\b" + + "\'\x02\x02\u0151\u0152\b\'\v\x02\u0152S\x03\x02\x02\x02\u0153\u0154\x05" + + "\x14\b\x02\u0154\u0158\x05\x10\x06\x02\u0155\u0157\x05$\x10\x02\u0156" + + "\u0155\x03\x02\x02\x02\u0157\u015A\x03\x02\x02\x02\u0158\u0156\x03\x02" + + "\x02\x02\u0158\u0159\x03\x02\x02\x02\u0159\u015B\x03\x02\x02\x02\u015A" + + "\u0158\x03\x02\x02\x02\u015B\u015C\x07<\x02\x02\u015C\u015D\x06(\x06\x02" + + "\u015D\u015E\b(\x0F\x02\u015EU\x03\x02\x02\x02\u015F\u0160\x05\x0E\x05" + + "\x02\u0160\u0161\x05\x16\t\x02\u0161\u0162\x05\x18\n\x02\u0162\u0166\x05" + + "\x0E\x05\x02\u0163\u0165\x05$\x10\x02\u0164\u0163\x03\x02\x02\x02\u0165" + + "\u0168\x03\x02\x02\x02\u0166\u0164\x03\x02\x02\x02\u0166\u0167\x03\x02" + + "\x02\x02\u0167\u0169\x03\x02\x02\x02\u0168\u0166\x03\x02\x02\x02\u0169" + + "\u016A\x05\x14\b\x02\u016A\u016E\x05\x10\x06\x02\u016B\u016D\x05$\x10" + + "\x02\u016C\u016B\x03\x02\x02\x02\u016D\u0170\x03\x02\x02\x02\u016E\u016C" + + "\x03\x02\x02\x02\u016E\u016F\x03\x02\x02\x02\u016F\u0171\x03\x02\x02\x02" + + "\u0170\u016E\x03\x02\x02\x02\u0171\u0172\x07<\x02\x02\u0172\u0173\x06" + + ")\x07\x02\u0173\u0174\b)\x10\x02\u0174W\x03\x02\x02\x02\u0175\u0176\x05" + + "\x0E\x05\x02\u0176\u0177\x05\x16\t\x02\u0177\u0178\x05\x18\n\x02\u0178" + + "\u017C\x05\x0E\x05\x02\u0179\u017B\x05$\x10\x02\u017A\u0179\x03\x02\x02" + + "\x02\u017B\u017E\x03\x02\x02\x02\u017C\u017A\x03\x02\x02\x02\u017C\u017D" + + "\x03\x02\x02\x02\u017D\u017F\x03\x02\x02\x02\u017E\u017C\x03\x02\x02\x02" + + "\u017F\u0180\x07<\x02\x02\u0180\u0181\x06*\b\x02\u0181\u0182\b*\x11\x02" + + "\u0182Y\x03\x02\x02\x02\u0183\u0184\x05\x18\n\x02\u0184\u0185\x05\x1E" + + "\r\x02\u0185\u0186\x05\x14\b\x02\u0186\u0187\x05\x1A\v\x02\u0187\u0188" + + "\x05\n\x03\x02\u0188\u018C\x05\x12\x07\x02\u0189\u018B\x05$\x10\x02\u018A" + + "\u0189\x03\x02\x02\x02\u018B\u018E\x03\x02\x02\x02\u018C\u018A\x03\x02" + + "\x02\x02\u018C\u018D\x03\x02\x02\x02\u018D\u018F\x03\x02\x02\x02\u018E" + + "\u018C\x03\x02\x02\x02\u018F\u0190\x07<\x02\x02\u0190\u0191\x06+\t\x02" + + "\u0191\u0192\b+\x12\x02\u0192[\x03\x02\x02\x02\u0193\u0194\x05\n\x03\x02" + + "\u0194\u0195\x05\b\x02\x02\u0195\u0196\x05\x18\n\x02\u0196\u019A\x05\x0E" + + "\x05\x02\u0197\u0199\x05$\x10\x02\u0198\u0197\x03\x02\x02\x02\u0199\u019C" + + "\x03\x02\x02\x02\u019A\u0198\x03\x02\x02\x02\u019A\u019B\x03\x02\x02\x02" + + "\u019B\u019D\x03\x02\x02\x02\u019C\u019A\x03\x02\x02\x02\u019D\u019E\x07" + + "<\x02\x02\u019E\u019F\x06,\n\x02\u019F\u01A0\b,\x13\x02\u01A0]\x03\x02" + + "\x02\x02\u01A1\u01A2\x05\f\x04\x02\u01A2\u01A3\x05\x0E\x05\x02\u01A3\u01A4" + + "\x05\x10\x06\x02\u01A4\u01A5\x05\b\x02\x02\u01A5\u01A6\x05\x1C\f\x02\u01A6" + + "\u01A7\x05\x16\t\x02\u01A7\u01AB\x05\x1A\v\x02\u01A8\u01AA\x05$\x10\x02" + + "\u01A9\u01A8\x03\x02\x02\x02\u01AA\u01AD\x03\x02\x02\x02\u01AB\u01A9\x03" + + "\x02\x02\x02\u01AB\u01AC\x03\x02\x02\x02\u01AC\u01AE\x03\x02\x02\x02\u01AD" + + "\u01AB\x03\x02\x02\x02\u01AE\u01AF\x07<\x02\x02\u01AF\u01B0\x06-\v\x02" + + "\u01B0\u01B1\b-\x14\x02\u01B1_\x03\x02\x02\x02\u01B2\u01B3\x05,\x14\x02" + + "\u01B3\u01B4\b.\x15\x02\u01B4a\x03\x02\x02\x02\u01B5\u01B6\x05*\x13\x02" + + "\u01B6\u01B7\b/\x16\x02\u01B7c\x03\x02\x02\x02\u01B8\u01BA\n\x13\x02\x02" + + "\u01B9\u01B8\x03\x02\x02\x02\u01BA\u01BB\x03\x02\x02\x02\u01BB\u01BC\x03" + + "\x02\x02\x02\u01BB\u01B9\x03\x02\x02\x02\u01BC\u01BD\x03\x02\x02\x02\u01BD" + + "\u01BE\b0\x17\x02\u01BEe\x03\x02\x02\x02\u01BF\u01C0\x07b\x02\x02\u01C0" + + "\u01C1\x07b\x02\x02\u01C1\u01C2\x07b\x02\x02\u01C2\u01C3\x03\x02\x02\x02" + + "\u01C3\u01C4\b1\x18\x02\u01C4\u01C5\x03\x02\x02\x02\u01C5\u01C6\b1\v\x02" + + "\u01C6g\x03\x02\x02\x02\u01C7\u01C8\x05,\x14\x02\u01C8\u01C9\x03\x02\x02" + + "\x02\u01C9\u01CA\b2\x19\x02\u01CAi\x03\x02\x02\x02\u01CB\u01CC\x05*\x13" + + "\x02\u01CC\u01CD\x03\x02\x02\x02\u01CD\u01CE\b3\x1A\x02\u01CEk\x03\x02" + + "\x02\x02\u01CF\u01D1\x07\x0F\x02\x02\u01D0\u01CF\x03\x02\x02\x02\u01D0" + + "\u01D1\x03\x02\x02\x02\u01D1\u01D2\x03\x02\x02\x02\u01D2\u01D5\x07\f\x02" + + "\x02\u01D3\u01D5\n\x13\x02\x02\u01D4\u01D0\x03\x02\x02\x02\u01D4\u01D3" + + "\x03\x02\x02\x02\u01D5\u01D6\x03\x02\x02\x02\u01D6\u01D7\x03\x02\x02\x02" + + "\u01D6\u01D4\x03\x02\x02\x02\u01D7\u01D8\x03\x02\x02\x02\u01D8\u01D9\b" + + "4\x1B\x02\u01D9m\x03\x02\x02\x02\u01DA\u01DC\x05$\x10\x02\u01DB\u01DA" + + "\x03\x02\x02\x02\u01DC\u01DD\x03\x02\x02\x02\u01DD\u01DB\x03\x02\x02\x02" + + "\u01DD\u01DE\x03\x02\x02\x02\u01DE\u01DF\x03\x02\x02\x02\u01DF\u01E0\b" + + "5\x02\x02\u01E0o\x03\x02\x02\x02\u01E1\u01E3\x07\x0F\x02\x02\u01E2\u01E1" + + "\x03\x02\x02\x02\u01E2\u01E3\x03\x02\x02\x02\u01E3\u01E4\x03\x02\x02\x02" + + "\u01E4\u01E5\x07\f\x02\x02\u01E5\u01E6\b6\x1C\x02\u01E6\u01E7\b6\x1D\x02" + + "\u01E7\u01E8\x03\x02\x02\x02\u01E8\u01E9\b6\x02\x02\u01E9\u01EA\b6\x1E" + + "\x02\u01EAq\x03\x02\x02\x02\u01EB\u01EF\x05 \x0E\x02\u01EC\u01EF\x05\"" + + "\x0F\x02\u01ED\u01EF\x07a\x02\x02\u01EE\u01EB\x03\x02\x02\x02\u01EE\u01EC" + + "\x03\x02\x02\x02\u01EE\u01ED\x03\x02\x02\x02\u01EF\u01F5\x03\x02\x02\x02" + + "\u01F0\u01F4\x05 \x0E\x02\u01F1\u01F4\x05\"\x0F\x02\u01F2\u01F4\t\x17" + + "\x02\x02\u01F3\u01F0\x03\x02\x02\x02\u01F3\u01F1\x03\x02\x02\x02\u01F3" + + "\u01F2\x03\x02\x02\x02\u01F4\u01F7\x03\x02\x02\x02\u01F5\u01F3\x03\x02" + + "\x02\x02\u01F5\u01F6\x03\x02\x02\x02\u01F6s\x03\x02\x02\x02\u01F7\u01F5" + + "\x03\x02\x02\x02\u01F8\u01FA\n\x13\x02\x02\u01F9\u01F8\x03\x02\x02\x02" + + "\u01FA\u01FB\x03\x02\x02\x02\u01FB\u01FC\x03\x02\x02\x02\u01FB\u01F9\x03" + + "\x02\x02\x02\u01FCu\x03\x02\x02\x02\u01FD\u0201\x07@\x02\x02\u01FE\u0200" + + "\n\x13\x02\x02\u01FF\u01FE\x03\x02\x02\x02\u0200\u0203\x03\x02\x02\x02" + + "\u0201\u01FF\x03\x02\x02\x02\u0201\u0202\x03\x02\x02\x02\u0202\u0205\x03" + + "\x02\x02\x02\u0203\u0201\x03\x02\x02\x02\u0204\u0206\x07\x0F\x02\x02\u0205" + + "\u0204\x03\x02\x02\x02\u0205\u0206\x03\x02\x02\x02\u0206\u0207\x03\x02" + + "\x02\x02\u0207\u0208\x07\f\x02\x02\u0208\u0209\x069\f\x02\u0209\u020A" + + "\x03\x02\x02\x02\u020A\u020B\b9\x02\x02\u020Bw\x03\x02\x02\x02\u020C\u020E" + + "\x05$\x10\x02\u020D\u020C\x03\x02\x02\x02\u020E\u020F\x03\x02\x02\x02" + + "\u020F\u020D\x03\x02\x02\x02\u020F\u0210\x03\x02\x02\x02\u0210\u0211\x03" + + "\x02\x02\x02\u0211\u0212\x06:\r\x02\u0212\u0213\x03\x02\x02\x02\u0213" + + "\u0214\b:\x02\x02\u0214y\x03\x02\x02\x02\u0215\u0217\x07\x0F\x02\x02\u0216" + + "\u0215\x03\x02\x02\x02\u0216\u0217\x03\x02\x02\x02\u0217\u0218\x03\x02" + + "\x02\x02\u0218\u0219\x07\f\x02\x02\u0219\u021A\b;\x1F\x02\u021A{\x03\x02" + + "\x02\x02\u021B\u021C\x07_\x02\x02\u021C\u021D\x06<\x0E\x02\u021D\u021E" + + "\b< \x02\u021E\u021F\x03\x02\x02\x02\u021F\u0220\b<\v\x02\u0220\u0221" + + "\b<\v\x02\u0221}\x03\x02\x02\x02"; + private static readonly _serializedATNSegment1: string = + "\u0222\u0226\x05 \x0E\x02\u0223\u0226\x05\"\x0F\x02\u0224\u0226\x07a\x02" + + "\x02\u0225\u0222\x03\x02\x02\x02\u0225\u0223\x03\x02\x02\x02\u0225\u0224" + + "\x03\x02\x02\x02\u0226\u022C\x03\x02\x02\x02\u0227\u022B\x05 \x0E\x02" + + "\u0228\u022B\x05\"\x0F\x02\u0229\u022B\t\x17\x02\x02\u022A\u0227\x03\x02" + + "\x02\x02\u022A\u0228\x03\x02\x02\x02\u022A\u0229\x03\x02\x02\x02\u022B" + + "\u022E\x03\x02\x02\x02\u022C\u022A\x03\x02\x02\x02\u022C\u022D\x03\x02" + + "\x02\x02\u022D\u022F\x03\x02\x02\x02\u022E\u022C\x03\x02\x02\x02\u022F" + + "\u0230\x06=\x0F\x02\u0230\u0231\b=!\x02\u0231\x7F\x03\x02\x02\x02\u0232" + + "\u0233\x07?\x02\x02\u0233\u0234\x06>\x10\x02\u0234\u0235\b>\"\x02\u0235" + + "\x81\x03\x02\x02\x02\u0236\u0237\x07~\x02\x02\u0237\u0238\b?#\x02\u0238" + + "\x83\x03\x02\x02\x02\u0239\u023A\x05,\x14\x02\u023A\u023B\b@$\x02\u023B" + + "\x85\x03\x02\x02\x02\u023C\u023D\x05*\x13\x02\u023D\u023E\bA%\x02\u023E" + + "\x87\x03\x02\x02\x02\u023F\u0241\n\x13\x02\x02\u0240\u023F\x03\x02\x02" + + "\x02\u0241\u0242\x03\x02\x02\x02\u0242\u0243\x03\x02\x02\x02\u0242\u0240" + + "\x03\x02\x02\x02\u0243\u0244\x03\x02\x02\x02\u0244\u0245\bB&\x02\u0245" + + "\x89\x03\x02\x02\x025\x02\x03\x04\x05\x06\x07\xAC\xB5\xBD\xC1\xC8\xCA" + + "\xD1\xD7\xDE\xE3\xFD\u0105\u0111\u0116\u0121\u0126\u0128\u0136\u013B\u014B" + + "\u0158\u0166\u016E\u017C\u018C\u019A\u01AB\u01BB\u01D0\u01D4\u01D6\u01DD" + + "\u01E2\u01EE\u01F3\u01F5\u01FB\u0201\u0205\u020F\u0216\u0225\u022A\u022C" + + "\u0242\'\b\x02\x02\x03\x18\x02\x07\x03\x02\x03\x19\x03\x07\x04\x02\x07" + + "\x06\x02\x03\x1B\x04\x03\x1C\x05\x03\x1E\x06\x06\x02\x02\x03&\x07\x07" + + "\x05\x02\x03\'\b\x03(\t\x03)\n\x03*\v\x03+\f\x03,\r\x03-\x0E\x03.\x0F" + + "\x03/\x10\x030\x11\x031\x12\t\x1C\x02\t\x1D\x02\t\x1E\x02\x036\x13\x03" + + "6\x14\x07\x07\x02\x03;\x15\x03<\x16\x03=\x17\x03>\x18\x03?\x19\x03@\x1A" + + "\x03A\x1B\x03B\x1C"; + public static readonly _serializedATN: string = Utils.join( + [ + LGFileLexer._serializedATNSegment0, + LGFileLexer._serializedATNSegment1, + ], + "", + ); + public static __ATN: ATN; + public static get _ATN(): ATN { + if (!LGFileLexer.__ATN) { + LGFileLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(LGFileLexer._serializedATN)); + } + + return LGFileLexer.__ATN; + } + +} + diff --git a/libraries/botbuilder-lg/src/generated/LGFileParser.ts b/libraries/botbuilder-lg/src/generated/LGFileParser.ts index da9f8f7ad1..eed4b7a774 100644 --- a/libraries/botbuilder-lg/src/generated/LGFileParser.ts +++ b/libraries/botbuilder-lg/src/generated/LGFileParser.ts @@ -1,2977 +1,2977 @@ -// Generated from ../LGFileParser.g4 by ANTLR 4.6-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 { LGFileParserListener } from "./LGFileParserListener"; -import { LGFileParserVisitor } from "./LGFileParserVisitor"; - - -export class LGFileParser extends Parser { - public static readonly COMMENTS = 1; - public static readonly WS = 2; - public static readonly NEWLINE = 3; - public static readonly HASH = 4; - public static readonly DASH = 5; - public static readonly LEFT_SQUARE_BRACKET = 6; - public static readonly IMPORT = 7; - public static readonly INVALID_TOKEN = 8; - public static readonly WS_IN_NAME = 9; - public static readonly NEWLINE_IN_NAME = 10; - public static readonly IDENTIFIER = 11; - public static readonly DOT = 12; - public static readonly OPEN_PARENTHESIS = 13; - public static readonly CLOSE_PARENTHESIS = 14; - public static readonly COMMA = 15; - public static readonly TEXT_IN_NAME = 16; - public static readonly WS_IN_BODY = 17; - public static readonly MULTILINE_PREFIX = 18; - public static readonly NEWLINE_IN_BODY = 19; - public static readonly IF = 20; - public static readonly ELSEIF = 21; - public static readonly ELSE = 22; - public static readonly SWITCH = 23; - public static readonly CASE = 24; - public static readonly DEFAULT = 25; - public static readonly ESCAPE_CHARACTER = 26; - public static readonly EXPRESSION = 27; - public static readonly TEXT = 28; - public static readonly MULTILINE_SUFFIX = 29; - public static readonly WS_IN_STRUCTURE_NAME = 30; - public static readonly NEWLINE_IN_STRUCTURE_NAME = 31; - public static readonly STRUCTURE_NAME = 32; - public static readonly TEXT_IN_STRUCTURE_NAME = 33; - public static readonly STRUCTURED_COMMENTS = 34; - public static readonly WS_IN_STRUCTURE_BODY = 35; - public static readonly STRUCTURED_NEWLINE = 36; - public static readonly STRUCTURED_BODY_END = 37; - public static readonly STRUCTURE_IDENTIFIER = 38; - public static readonly STRUCTURE_EQUALS = 39; - public static readonly STRUCTURE_OR_MARK = 40; - public static readonly ESCAPE_CHARACTER_IN_STRUCTURE_BODY = 41; - public static readonly EXPRESSION_IN_STRUCTURE_BODY = 42; - public static readonly TEXT_IN_STRUCTURE_BODY = 43; - public static readonly RULE_file = 0; - public static readonly RULE_paragraph = 1; - public static readonly RULE_errorTemplate = 2; - public static readonly RULE_templateDefinition = 3; - public static readonly RULE_templateNameLine = 4; - public static readonly RULE_errorTemplateName = 5; - public static readonly RULE_templateName = 6; - public static readonly RULE_parameters = 7; - public static readonly RULE_templateBody = 8; - public static readonly RULE_structuredTemplateBody = 9; - public static readonly RULE_structuredBodyNameLine = 10; - public static readonly RULE_errorStructuredName = 11; - public static readonly RULE_structuredBodyContentLine = 12; - public static readonly RULE_errorStructureLine = 13; - public static readonly RULE_keyValueStructureLine = 14; - public static readonly RULE_keyValueStructureValue = 15; - public static readonly RULE_objectStructureLine = 16; - public static readonly RULE_structuredBodyEndLine = 17; - public static readonly RULE_normalTemplateBody = 18; - public static readonly RULE_templateString = 19; - public static readonly RULE_normalTemplateString = 20; - public static readonly RULE_errorTemplateString = 21; - public static readonly RULE_ifElseTemplateBody = 22; - public static readonly RULE_ifConditionRule = 23; - public static readonly RULE_ifCondition = 24; - public static readonly RULE_switchCaseTemplateBody = 25; - public static readonly RULE_switchCaseRule = 26; - public static readonly RULE_switchCaseStat = 27; - public static readonly RULE_importDefinition = 28; - // tslint:disable:no-trailing-whitespace - public static readonly ruleNames: string[] = [ - "file", "paragraph", "errorTemplate", "templateDefinition", "templateNameLine", - "errorTemplateName", "templateName", "parameters", "templateBody", "structuredTemplateBody", - "structuredBodyNameLine", "errorStructuredName", "structuredBodyContentLine", - "errorStructureLine", "keyValueStructureLine", "keyValueStructureValue", - "objectStructureLine", "structuredBodyEndLine", "normalTemplateBody", - "templateString", "normalTemplateString", "errorTemplateString", "ifElseTemplateBody", - "ifConditionRule", "ifCondition", "switchCaseTemplateBody", "switchCaseRule", - "switchCaseStat", "importDefinition", - ]; - - private static readonly _LITERAL_NAMES: Array = [ - undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, undefined, "'.'", "'('", "')'", - "','", undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, "'|'", - ]; - private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, "COMMENTS", "WS", "NEWLINE", "HASH", "DASH", "LEFT_SQUARE_BRACKET", - "IMPORT", "INVALID_TOKEN", "WS_IN_NAME", "NEWLINE_IN_NAME", "IDENTIFIER", - "DOT", "OPEN_PARENTHESIS", "CLOSE_PARENTHESIS", "COMMA", "TEXT_IN_NAME", - "WS_IN_BODY", "MULTILINE_PREFIX", "NEWLINE_IN_BODY", "IF", "ELSEIF", "ELSE", - "SWITCH", "CASE", "DEFAULT", "ESCAPE_CHARACTER", "EXPRESSION", "TEXT", - "MULTILINE_SUFFIX", "WS_IN_STRUCTURE_NAME", "NEWLINE_IN_STRUCTURE_NAME", - "STRUCTURE_NAME", "TEXT_IN_STRUCTURE_NAME", "STRUCTURED_COMMENTS", "WS_IN_STRUCTURE_BODY", - "STRUCTURED_NEWLINE", "STRUCTURED_BODY_END", "STRUCTURE_IDENTIFIER", "STRUCTURE_EQUALS", - "STRUCTURE_OR_MARK", "ESCAPE_CHARACTER_IN_STRUCTURE_BODY", "EXPRESSION_IN_STRUCTURE_BODY", - "TEXT_IN_STRUCTURE_BODY", - ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(LGFileParser._LITERAL_NAMES, LGFileParser._SYMBOLIC_NAMES, []); - - // @Override - // @NotNull - public get vocabulary(): Vocabulary { - return LGFileParser.VOCABULARY; - } - // tslint:enable:no-trailing-whitespace - - // @Override - public get grammarFileName(): string { return "LGFileParser.g4"; } - - // @Override - public get ruleNames(): string[] { return LGFileParser.ruleNames; } - - // @Override - public get serializedATN(): string { return LGFileParser._serializedATN; } - - constructor(input: TokenStream) { - super(input); - this._interp = new ParserATNSimulator(LGFileParser._ATN, this); - } - // @RuleVersion(0) - public file(): FileContext { - let _localctx: FileContext = new FileContext(this._ctx, this.state); - this.enterRule(_localctx, 0, LGFileParser.RULE_file); - try { - let _alt: number; - this.enterOuterAlt(_localctx, 1); - { - this.state = 59; - this._errHandler.sync(this); - _alt = 1 + 1; - do { - switch (_alt) { - case 1 + 1: - { - { - this.state = 58; - this.paragraph(); - } - } - break; - default: - throw new NoViableAltException(this); - } - this.state = 61; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 0, this._ctx); - } while (_alt !== 1 && _alt !== ATN.INVALID_ALT_NUMBER); - this.state = 63; - this.match(LGFileParser.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 paragraph(): ParagraphContext { - let _localctx: ParagraphContext = new ParagraphContext(this._ctx, this.state); - this.enterRule(_localctx, 2, LGFileParser.RULE_paragraph); - try { - this.state = 69; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case LGFileParser.HASH: - this.enterOuterAlt(_localctx, 1); - { - this.state = 65; - this.templateDefinition(); - } - break; - case LGFileParser.IMPORT: - this.enterOuterAlt(_localctx, 2); - { - this.state = 66; - this.importDefinition(); - } - break; - case LGFileParser.EOF: - this.enterOuterAlt(_localctx, 3); - { - this.state = 67; - this.match(LGFileParser.EOF); - } - break; - case LGFileParser.INVALID_TOKEN: - this.enterOuterAlt(_localctx, 4); - { - this.state = 68; - this.errorTemplate(); - } - 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 errorTemplate(): ErrorTemplateContext { - let _localctx: ErrorTemplateContext = new ErrorTemplateContext(this._ctx, this.state); - this.enterRule(_localctx, 4, LGFileParser.RULE_errorTemplate); - try { - let _alt: number; - this.enterOuterAlt(_localctx, 1); - { - this.state = 72; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 71; - this.match(LGFileParser.INVALID_TOKEN); - } - } - break; - default: - throw new NoViableAltException(this); - } - this.state = 74; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); - } - } - 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 templateDefinition(): TemplateDefinitionContext { - let _localctx: TemplateDefinitionContext = new TemplateDefinitionContext(this._ctx, this.state); - this.enterRule(_localctx, 6, LGFileParser.RULE_templateDefinition); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 76; - this.templateNameLine(); - this.state = 78; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 3, this._ctx) ) { - case 1: - { - this.state = 77; - this.templateBody(); - } - 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 templateNameLine(): TemplateNameLineContext { - let _localctx: TemplateNameLineContext = new TemplateNameLineContext(this._ctx, this.state); - this.enterRule(_localctx, 8, LGFileParser.RULE_templateNameLine); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 80; - this.match(LGFileParser.HASH); - this.state = 86; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 5, this._ctx) ) { - case 1: - { - { - this.state = 81; - this.templateName(); - this.state = 83; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === LGFileParser.OPEN_PARENTHESIS) { - { - this.state = 82; - this.parameters(); - } - } - - } - } - break; - - case 2: - { - this.state = 85; - this.errorTemplateName(); - } - 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 errorTemplateName(): ErrorTemplateNameContext { - let _localctx: ErrorTemplateNameContext = new ErrorTemplateNameContext(this._ctx, this.state); - this.enterRule(_localctx, 10, LGFileParser.RULE_errorTemplateName); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 91; - this._errHandler.sync(this); - _la = this._input.LA(1); - while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.IDENTIFIER) | (1 << LGFileParser.DOT) | (1 << LGFileParser.OPEN_PARENTHESIS) | (1 << LGFileParser.CLOSE_PARENTHESIS) | (1 << LGFileParser.COMMA) | (1 << LGFileParser.TEXT_IN_NAME))) !== 0)) { - { - { - this.state = 88; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.IDENTIFIER) | (1 << LGFileParser.DOT) | (1 << LGFileParser.OPEN_PARENTHESIS) | (1 << LGFileParser.CLOSE_PARENTHESIS) | (1 << LGFileParser.COMMA) | (1 << LGFileParser.TEXT_IN_NAME))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - } - } - this.state = 93; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - } - } - 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 templateName(): TemplateNameContext { - let _localctx: TemplateNameContext = new TemplateNameContext(this._ctx, this.state); - this.enterRule(_localctx, 12, LGFileParser.RULE_templateName); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 94; - this.match(LGFileParser.IDENTIFIER); - this.state = 99; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === LGFileParser.DOT) { - { - { - this.state = 95; - this.match(LGFileParser.DOT); - this.state = 96; - this.match(LGFileParser.IDENTIFIER); - } - } - this.state = 101; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - } - } - 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 parameters(): ParametersContext { - let _localctx: ParametersContext = new ParametersContext(this._ctx, this.state); - this.enterRule(_localctx, 14, LGFileParser.RULE_parameters); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 102; - this.match(LGFileParser.OPEN_PARENTHESIS); - this.state = 111; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === LGFileParser.IDENTIFIER) { - { - this.state = 103; - this.match(LGFileParser.IDENTIFIER); - this.state = 108; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === LGFileParser.COMMA) { - { - { - this.state = 104; - this.match(LGFileParser.COMMA); - this.state = 105; - this.match(LGFileParser.IDENTIFIER); - } - } - this.state = 110; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - } - } - - this.state = 113; - this.match(LGFileParser.CLOSE_PARENTHESIS); - } - } - 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 templateBody(): TemplateBodyContext { - let _localctx: TemplateBodyContext = new TemplateBodyContext(this._ctx, this.state); - this.enterRule(_localctx, 16, LGFileParser.RULE_templateBody); - try { - this.state = 119; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 10, this._ctx) ) { - case 1: - _localctx = new NormalBodyContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 115; - this.normalTemplateBody(); - } - break; - - case 2: - _localctx = new IfElseBodyContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 116; - this.ifElseTemplateBody(); - } - break; - - case 3: - _localctx = new SwitchCaseBodyContext(_localctx); - this.enterOuterAlt(_localctx, 3); - { - this.state = 117; - this.switchCaseTemplateBody(); - } - break; - - case 4: - _localctx = new StructuredBodyContext(_localctx); - this.enterOuterAlt(_localctx, 4); - { - this.state = 118; - this.structuredTemplateBody(); - } - 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 structuredTemplateBody(): StructuredTemplateBodyContext { - let _localctx: StructuredTemplateBodyContext = new StructuredTemplateBodyContext(this._ctx, this.state); - this.enterRule(_localctx, 18, LGFileParser.RULE_structuredTemplateBody); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 121; - this.structuredBodyNameLine(); - this.state = 129; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 38)) & ~0x1F) === 0 && ((1 << (_la - 38)) & ((1 << (LGFileParser.STRUCTURE_IDENTIFIER - 38)) | (1 << (LGFileParser.STRUCTURE_EQUALS - 38)) | (1 << (LGFileParser.STRUCTURE_OR_MARK - 38)) | (1 << (LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.EXPRESSION_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.TEXT_IN_STRUCTURE_BODY - 38)))) !== 0)) { - { - this.state = 125; - this._errHandler.sync(this); - _la = this._input.LA(1); - do { - { - { - this.state = 122; - this.structuredBodyContentLine(); - this.state = 123; - this.match(LGFileParser.STRUCTURED_NEWLINE); - } - } - this.state = 127; - this._errHandler.sync(this); - _la = this._input.LA(1); - } while (((((_la - 38)) & ~0x1F) === 0 && ((1 << (_la - 38)) & ((1 << (LGFileParser.STRUCTURE_IDENTIFIER - 38)) | (1 << (LGFileParser.STRUCTURE_EQUALS - 38)) | (1 << (LGFileParser.STRUCTURE_OR_MARK - 38)) | (1 << (LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.EXPRESSION_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.TEXT_IN_STRUCTURE_BODY - 38)))) !== 0)); - } - } - - this.state = 132; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === LGFileParser.STRUCTURED_BODY_END) { - { - this.state = 131; - this.structuredBodyEndLine(); - } - } - - } - } - 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 structuredBodyNameLine(): StructuredBodyNameLineContext { - let _localctx: StructuredBodyNameLineContext = new StructuredBodyNameLineContext(this._ctx, this.state); - this.enterRule(_localctx, 20, LGFileParser.RULE_structuredBodyNameLine); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 134; - this.match(LGFileParser.LEFT_SQUARE_BRACKET); - this.state = 137; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 14, this._ctx) ) { - case 1: - { - this.state = 135; - this.match(LGFileParser.STRUCTURE_NAME); - } - break; - - case 2: - { - this.state = 136; - this.errorStructuredName(); - } - 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 errorStructuredName(): ErrorStructuredNameContext { - let _localctx: ErrorStructuredNameContext = new ErrorStructuredNameContext(this._ctx, this.state); - this.enterRule(_localctx, 22, LGFileParser.RULE_errorStructuredName); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 142; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === LGFileParser.STRUCTURE_NAME || _la === LGFileParser.TEXT_IN_STRUCTURE_NAME) { - { - { - this.state = 139; - _la = this._input.LA(1); - if (!(_la === LGFileParser.STRUCTURE_NAME || _la === LGFileParser.TEXT_IN_STRUCTURE_NAME)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - } - } - this.state = 144; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - } - } - 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 structuredBodyContentLine(): StructuredBodyContentLineContext { - let _localctx: StructuredBodyContentLineContext = new StructuredBodyContentLineContext(this._ctx, this.state); - this.enterRule(_localctx, 24, LGFileParser.RULE_structuredBodyContentLine); - try { - this.state = 148; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 16, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 145; - this.keyValueStructureLine(); - } - break; - - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 146; - this.objectStructureLine(); - } - break; - - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 147; - this.errorStructureLine(); - } - 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 errorStructureLine(): ErrorStructureLineContext { - let _localctx: ErrorStructureLineContext = new ErrorStructureLineContext(this._ctx, this.state); - this.enterRule(_localctx, 26, LGFileParser.RULE_errorStructureLine); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 151; - this._errHandler.sync(this); - _la = this._input.LA(1); - do { - { - { - this.state = 150; - _la = this._input.LA(1); - if (!(((((_la - 38)) & ~0x1F) === 0 && ((1 << (_la - 38)) & ((1 << (LGFileParser.STRUCTURE_IDENTIFIER - 38)) | (1 << (LGFileParser.STRUCTURE_EQUALS - 38)) | (1 << (LGFileParser.STRUCTURE_OR_MARK - 38)) | (1 << (LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.EXPRESSION_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.TEXT_IN_STRUCTURE_BODY - 38)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - } - } - this.state = 153; - this._errHandler.sync(this); - _la = this._input.LA(1); - } while (((((_la - 38)) & ~0x1F) === 0 && ((1 << (_la - 38)) & ((1 << (LGFileParser.STRUCTURE_IDENTIFIER - 38)) | (1 << (LGFileParser.STRUCTURE_EQUALS - 38)) | (1 << (LGFileParser.STRUCTURE_OR_MARK - 38)) | (1 << (LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.EXPRESSION_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.TEXT_IN_STRUCTURE_BODY - 38)))) !== 0)); - } - } - 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 keyValueStructureLine(): KeyValueStructureLineContext { - let _localctx: KeyValueStructureLineContext = new KeyValueStructureLineContext(this._ctx, this.state); - this.enterRule(_localctx, 28, LGFileParser.RULE_keyValueStructureLine); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 155; - this.match(LGFileParser.STRUCTURE_IDENTIFIER); - this.state = 156; - this.match(LGFileParser.STRUCTURE_EQUALS); - this.state = 157; - this.keyValueStructureValue(); - this.state = 162; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === LGFileParser.STRUCTURE_OR_MARK) { - { - { - this.state = 158; - this.match(LGFileParser.STRUCTURE_OR_MARK); - this.state = 159; - this.keyValueStructureValue(); - } - } - this.state = 164; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - } - } - 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 keyValueStructureValue(): KeyValueStructureValueContext { - let _localctx: KeyValueStructureValueContext = new KeyValueStructureValueContext(this._ctx, this.state); - this.enterRule(_localctx, 30, LGFileParser.RULE_keyValueStructureValue); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 166; - this._errHandler.sync(this); - _la = this._input.LA(1); - do { - { - { - this.state = 165; - _la = this._input.LA(1); - if (!(((((_la - 41)) & ~0x1F) === 0 && ((1 << (_la - 41)) & ((1 << (LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY - 41)) | (1 << (LGFileParser.EXPRESSION_IN_STRUCTURE_BODY - 41)) | (1 << (LGFileParser.TEXT_IN_STRUCTURE_BODY - 41)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - } - } - this.state = 168; - this._errHandler.sync(this); - _la = this._input.LA(1); - } while (((((_la - 41)) & ~0x1F) === 0 && ((1 << (_la - 41)) & ((1 << (LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY - 41)) | (1 << (LGFileParser.EXPRESSION_IN_STRUCTURE_BODY - 41)) | (1 << (LGFileParser.TEXT_IN_STRUCTURE_BODY - 41)))) !== 0)); - } - } - 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 objectStructureLine(): ObjectStructureLineContext { - let _localctx: ObjectStructureLineContext = new ObjectStructureLineContext(this._ctx, this.state); - this.enterRule(_localctx, 32, LGFileParser.RULE_objectStructureLine); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 170; - this.match(LGFileParser.EXPRESSION_IN_STRUCTURE_BODY); - } - } - 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 structuredBodyEndLine(): StructuredBodyEndLineContext { - let _localctx: StructuredBodyEndLineContext = new StructuredBodyEndLineContext(this._ctx, this.state); - this.enterRule(_localctx, 34, LGFileParser.RULE_structuredBodyEndLine); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 172; - this.match(LGFileParser.STRUCTURED_BODY_END); - } - } - 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 normalTemplateBody(): NormalTemplateBodyContext { - let _localctx: NormalTemplateBodyContext = new NormalTemplateBodyContext(this._ctx, this.state); - this.enterRule(_localctx, 36, LGFileParser.RULE_normalTemplateBody); - try { - let _alt: number; - this.enterOuterAlt(_localctx, 1); - { - this.state = 175; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 174; - this.templateString(); - } - } - break; - default: - throw new NoViableAltException(this); - } - this.state = 177; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 20, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); - } - } - 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 templateString(): TemplateStringContext { - let _localctx: TemplateStringContext = new TemplateStringContext(this._ctx, this.state); - this.enterRule(_localctx, 38, LGFileParser.RULE_templateString); - try { - this.state = 181; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case LGFileParser.DASH: - this.enterOuterAlt(_localctx, 1); - { - this.state = 179; - this.normalTemplateString(); - } - break; - case LGFileParser.INVALID_TOKEN: - this.enterOuterAlt(_localctx, 2); - { - this.state = 180; - this.errorTemplateString(); - } - 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 normalTemplateString(): NormalTemplateStringContext { - let _localctx: NormalTemplateStringContext = new NormalTemplateStringContext(this._ctx, this.state); - this.enterRule(_localctx, 40, LGFileParser.RULE_normalTemplateString); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 183; - this.match(LGFileParser.DASH); - this.state = 185; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === LGFileParser.MULTILINE_PREFIX) { - { - this.state = 184; - this.match(LGFileParser.MULTILINE_PREFIX); - } - } - - this.state = 190; - this._errHandler.sync(this); - _la = this._input.LA(1); - while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.ESCAPE_CHARACTER) | (1 << LGFileParser.EXPRESSION) | (1 << LGFileParser.TEXT))) !== 0)) { - { - { - this.state = 187; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.ESCAPE_CHARACTER) | (1 << LGFileParser.EXPRESSION) | (1 << LGFileParser.TEXT))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - } - } - this.state = 192; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 194; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === LGFileParser.MULTILINE_SUFFIX) { - { - this.state = 193; - this.match(LGFileParser.MULTILINE_SUFFIX); - } - } - - } - } - 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 errorTemplateString(): ErrorTemplateStringContext { - let _localctx: ErrorTemplateStringContext = new ErrorTemplateStringContext(this._ctx, this.state); - this.enterRule(_localctx, 42, LGFileParser.RULE_errorTemplateString); - try { - let _alt: number; - this.enterOuterAlt(_localctx, 1); - { - this.state = 197; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 196; - this.match(LGFileParser.INVALID_TOKEN); - } - } - break; - default: - throw new NoViableAltException(this); - } - this.state = 199; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 25, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); - } - } - 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 ifElseTemplateBody(): IfElseTemplateBodyContext { - let _localctx: IfElseTemplateBodyContext = new IfElseTemplateBodyContext(this._ctx, this.state); - this.enterRule(_localctx, 44, LGFileParser.RULE_ifElseTemplateBody); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 202; - this._errHandler.sync(this); - _la = this._input.LA(1); - do { - { - { - this.state = 201; - this.ifConditionRule(); - } - } - this.state = 204; - this._errHandler.sync(this); - _la = this._input.LA(1); - } while (_la === LGFileParser.DASH); - } - } - 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 ifConditionRule(): IfConditionRuleContext { - let _localctx: IfConditionRuleContext = new IfConditionRuleContext(this._ctx, this.state); - this.enterRule(_localctx, 46, LGFileParser.RULE_ifConditionRule); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 206; - this.ifCondition(); - this.state = 208; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 27, this._ctx) ) { - case 1: - { - this.state = 207; - this.normalTemplateBody(); - } - 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 ifCondition(): IfConditionContext { - let _localctx: IfConditionContext = new IfConditionContext(this._ctx, this.state); - this.enterRule(_localctx, 48, LGFileParser.RULE_ifCondition); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 210; - this.match(LGFileParser.DASH); - this.state = 211; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.IF) | (1 << LGFileParser.ELSEIF) | (1 << LGFileParser.ELSE))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 215; - this._errHandler.sync(this); - _la = this._input.LA(1); - while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.WS) | (1 << LGFileParser.EXPRESSION) | (1 << LGFileParser.TEXT))) !== 0)) { - { - { - this.state = 212; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.WS) | (1 << LGFileParser.EXPRESSION) | (1 << LGFileParser.TEXT))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - } - } - this.state = 217; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - } - } - 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 switchCaseTemplateBody(): SwitchCaseTemplateBodyContext { - let _localctx: SwitchCaseTemplateBodyContext = new SwitchCaseTemplateBodyContext(this._ctx, this.state); - this.enterRule(_localctx, 50, LGFileParser.RULE_switchCaseTemplateBody); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 219; - this._errHandler.sync(this); - _la = this._input.LA(1); - do { - { - { - this.state = 218; - this.switchCaseRule(); - } - } - this.state = 221; - this._errHandler.sync(this); - _la = this._input.LA(1); - } while (_la === LGFileParser.DASH); - } - } - 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 switchCaseRule(): SwitchCaseRuleContext { - let _localctx: SwitchCaseRuleContext = new SwitchCaseRuleContext(this._ctx, this.state); - this.enterRule(_localctx, 52, LGFileParser.RULE_switchCaseRule); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 223; - this.switchCaseStat(); - this.state = 225; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 30, this._ctx) ) { - case 1: - { - this.state = 224; - this.normalTemplateBody(); - } - 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 switchCaseStat(): SwitchCaseStatContext { - let _localctx: SwitchCaseStatContext = new SwitchCaseStatContext(this._ctx, this.state); - this.enterRule(_localctx, 54, LGFileParser.RULE_switchCaseStat); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 227; - this.match(LGFileParser.DASH); - this.state = 228; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.SWITCH) | (1 << LGFileParser.CASE) | (1 << LGFileParser.DEFAULT))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 232; - this._errHandler.sync(this); - _la = this._input.LA(1); - while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.WS) | (1 << LGFileParser.EXPRESSION) | (1 << LGFileParser.TEXT))) !== 0)) { - { - { - this.state = 229; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.WS) | (1 << LGFileParser.EXPRESSION) | (1 << LGFileParser.TEXT))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - } - } - this.state = 234; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - } - } - 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 importDefinition(): ImportDefinitionContext { - let _localctx: ImportDefinitionContext = new ImportDefinitionContext(this._ctx, this.state); - this.enterRule(_localctx, 56, LGFileParser.RULE_importDefinition); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 235; - this.match(LGFileParser.IMPORT); - } - } - 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\uAF6F\u8320\u479D\uB75C\u4880\u1605\u191C\uAB37\x03-\xF0\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\x04\x1B\t\x1B\x04\x1C\t\x1C\x04" + - "\x1D\t\x1D\x04\x1E\t\x1E\x03\x02\x06\x02>\n\x02\r\x02\x0E\x02?\x03\x02" + - "\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x05\x03H\n\x03\x03\x04\x06\x04" + - "K\n\x04\r\x04\x0E\x04L\x03\x05\x03\x05\x05\x05Q\n\x05\x03\x06\x03\x06" + - "\x03\x06\x05\x06V\n\x06\x03\x06\x05\x06Y\n\x06\x03\x07\x07\x07\\\n\x07" + - "\f\x07\x0E\x07_\v\x07\x03\b\x03\b\x03\b\x07\bd\n\b\f\b\x0E\bg\v\b\x03" + - "\t\x03\t\x03\t\x03\t\x07\tm\n\t\f\t\x0E\tp\v\t\x05\tr\n\t\x03\t\x03\t" + - "\x03\n\x03\n\x03\n\x03\n\x05\nz\n\n\x03\v\x03\v\x03\v\x03\v\x06\v\x80" + - "\n\v\r\v\x0E\v\x81\x05\v\x84\n\v\x03\v\x05\v\x87\n\v\x03\f\x03\f\x03\f" + - "\x05\f\x8C\n\f\x03\r\x07\r\x8F\n\r\f\r\x0E\r\x92\v\r\x03\x0E\x03\x0E\x03" + - "\x0E\x05\x0E\x97\n\x0E\x03\x0F\x06\x0F\x9A\n\x0F\r\x0F\x0E\x0F\x9B\x03" + - "\x10\x03\x10\x03\x10\x03\x10\x03\x10\x07\x10\xA3\n\x10\f\x10\x0E\x10\xA6" + - "\v\x10\x03\x11\x06\x11\xA9\n\x11\r\x11\x0E\x11\xAA\x03\x12\x03\x12\x03" + - "\x13\x03\x13\x03\x14\x06\x14\xB2\n\x14\r\x14\x0E\x14\xB3\x03\x15\x03\x15" + - "\x05\x15\xB8\n\x15\x03\x16\x03\x16\x05\x16\xBC\n\x16\x03\x16\x07\x16\xBF" + - "\n\x16\f\x16\x0E\x16\xC2\v\x16\x03\x16\x05\x16\xC5\n\x16\x03\x17\x06\x17" + - "\xC8\n\x17\r\x17\x0E\x17\xC9\x03\x18\x06\x18\xCD\n\x18\r\x18\x0E\x18\xCE" + - "\x03\x19\x03\x19\x05\x19\xD3\n\x19\x03\x1A\x03\x1A\x03\x1A\x07\x1A\xD8" + - "\n\x1A\f\x1A\x0E\x1A\xDB\v\x1A\x03\x1B\x06\x1B\xDE\n\x1B\r\x1B\x0E\x1B" + - "\xDF\x03\x1C\x03\x1C\x05\x1C\xE4\n\x1C\x03\x1D\x03\x1D\x03\x1D\x07\x1D" + - "\xE9\n\x1D\f\x1D\x0E\x1D\xEC\v\x1D\x03\x1E\x03\x1E\x03\x1E\x03?\x02\x02" + - "\x1F\x02\x02\x04\x02\x06\x02\b\x02\n\x02\f\x02\x0E\x02\x10\x02\x12\x02" + - "\x14\x02\x16\x02\x18\x02\x1A\x02\x1C\x02\x1E\x02 \x02\"\x02$\x02&\x02" + - "(\x02*\x02,\x02.\x020\x022\x024\x026\x028\x02:\x02\x02\n\x03\x02\r\x12" + - "\x03\x02\"#\x03\x02(-\x03\x02+-\x03\x02\x1C\x1E\x03\x02\x16\x18\x04\x02" + - "\x04\x04\x1D\x1E\x03\x02\x19\x1B\xF7\x02=\x03\x02\x02\x02\x04G\x03\x02" + - "\x02\x02\x06J\x03\x02\x02\x02\bN\x03\x02\x02\x02\nR\x03\x02\x02\x02\f" + - "]\x03\x02\x02\x02\x0E`\x03\x02\x02\x02\x10h\x03\x02\x02\x02\x12y\x03\x02" + - "\x02\x02\x14{\x03\x02\x02\x02\x16\x88\x03\x02\x02\x02\x18\x90\x03\x02" + - "\x02\x02\x1A\x96\x03\x02\x02\x02\x1C\x99\x03\x02\x02\x02\x1E\x9D\x03\x02" + - "\x02\x02 \xA8\x03\x02\x02\x02\"\xAC\x03\x02\x02\x02$\xAE\x03\x02\x02\x02" + - "&\xB1\x03\x02\x02\x02(\xB7\x03\x02\x02\x02*\xB9\x03\x02\x02\x02,\xC7\x03" + - "\x02\x02\x02.\xCC\x03\x02\x02\x020\xD0\x03\x02\x02\x022\xD4\x03\x02\x02" + - "\x024\xDD\x03\x02\x02\x026\xE1\x03\x02\x02\x028\xE5\x03\x02\x02\x02:\xED" + - "\x03\x02\x02\x02<>\x05\x04\x03\x02=<\x03\x02\x02\x02>?\x03\x02\x02\x02" + - "?@\x03\x02\x02\x02?=\x03\x02\x02\x02@A\x03\x02\x02\x02AB\x07\x02\x02\x03" + - "B\x03\x03\x02\x02\x02CH\x05\b\x05\x02DH\x05:\x1E\x02EH\x07\x02\x02\x03" + - "FH\x05\x06\x04\x02GC\x03\x02\x02\x02GD\x03\x02\x02\x02GE\x03\x02\x02\x02" + - "GF\x03\x02\x02\x02H\x05\x03\x02\x02\x02IK\x07\n\x02\x02JI\x03\x02\x02" + - "\x02KL\x03\x02\x02\x02LJ\x03\x02\x02\x02LM\x03\x02\x02\x02M\x07\x03\x02" + - "\x02\x02NP\x05\n\x06\x02OQ\x05\x12\n\x02PO\x03\x02\x02\x02PQ\x03\x02\x02" + - "\x02Q\t\x03\x02\x02\x02RX\x07\x06\x02\x02SU\x05\x0E\b\x02TV\x05\x10\t" + - "\x02UT\x03\x02\x02\x02UV\x03\x02\x02\x02VY\x03\x02\x02\x02WY\x05\f\x07" + - "\x02XS\x03\x02\x02\x02XW\x03\x02\x02\x02Y\v\x03\x02\x02\x02Z\\\t\x02\x02" + - "\x02[Z\x03\x02\x02\x02\\_\x03\x02\x02\x02][\x03\x02\x02\x02]^\x03\x02" + - "\x02\x02^\r\x03\x02\x02\x02_]\x03\x02\x02\x02`e\x07\r\x02\x02ab\x07\x0E" + - "\x02\x02bd\x07\r\x02\x02ca\x03\x02\x02\x02dg\x03\x02\x02\x02ec\x03\x02" + - "\x02\x02ef\x03\x02\x02\x02f\x0F\x03\x02\x02\x02ge\x03\x02\x02\x02hq\x07" + - "\x0F\x02\x02in\x07\r\x02\x02jk\x07\x11\x02\x02km\x07\r\x02\x02lj\x03\x02" + - "\x02\x02mp\x03\x02\x02\x02nl\x03\x02\x02\x02no\x03\x02\x02\x02or\x03\x02" + - "\x02\x02pn\x03\x02\x02\x02qi\x03\x02\x02\x02qr\x03\x02\x02\x02rs\x03\x02" + - "\x02\x02st\x07\x10\x02\x02t\x11\x03\x02\x02\x02uz\x05&\x14\x02vz\x05." + - "\x18\x02wz\x054\x1B\x02xz\x05\x14\v\x02yu\x03\x02\x02\x02yv\x03\x02\x02" + - "\x02yw\x03\x02\x02\x02yx\x03\x02\x02\x02z\x13\x03\x02\x02\x02{\x83\x05" + - "\x16\f\x02|}\x05\x1A\x0E\x02}~\x07&\x02\x02~\x80\x03\x02\x02\x02\x7F|" + - "\x03\x02\x02\x02\x80\x81\x03\x02\x02\x02\x81\x7F\x03\x02\x02\x02\x81\x82" + - "\x03\x02\x02\x02\x82\x84\x03\x02\x02\x02\x83\x7F\x03\x02\x02\x02\x83\x84" + - "\x03\x02\x02\x02\x84\x86\x03\x02\x02\x02\x85\x87\x05$\x13\x02\x86\x85" + - "\x03\x02\x02\x02\x86\x87\x03\x02\x02\x02\x87\x15\x03\x02\x02\x02\x88\x8B" + - "\x07\b\x02\x02\x89\x8C\x07\"\x02\x02\x8A\x8C\x05\x18\r\x02\x8B\x89\x03" + - "\x02\x02\x02\x8B\x8A\x03\x02\x02\x02\x8C\x17\x03\x02\x02\x02\x8D\x8F\t" + - "\x03\x02\x02\x8E\x8D\x03\x02\x02\x02\x8F\x92\x03\x02\x02\x02\x90\x8E\x03" + - "\x02\x02\x02\x90\x91\x03\x02\x02\x02\x91\x19\x03\x02\x02\x02\x92\x90\x03" + - "\x02\x02\x02\x93\x97\x05\x1E\x10\x02\x94\x97\x05\"\x12\x02\x95\x97\x05" + - "\x1C\x0F\x02\x96\x93\x03\x02\x02\x02\x96\x94\x03\x02\x02\x02\x96\x95\x03" + - "\x02\x02\x02\x97\x1B\x03\x02\x02\x02\x98\x9A\t\x04\x02\x02\x99\x98\x03" + - "\x02\x02\x02\x9A\x9B\x03\x02\x02\x02\x9B\x99\x03\x02\x02\x02\x9B\x9C\x03" + - "\x02\x02\x02\x9C\x1D\x03\x02\x02\x02\x9D\x9E\x07(\x02\x02\x9E\x9F\x07" + - ")\x02\x02\x9F\xA4\x05 \x11\x02\xA0\xA1\x07*\x02\x02\xA1\xA3\x05 \x11\x02" + - "\xA2\xA0\x03\x02\x02\x02\xA3\xA6\x03\x02\x02\x02\xA4\xA2\x03\x02\x02\x02" + - "\xA4\xA5\x03\x02\x02\x02\xA5\x1F\x03\x02\x02\x02\xA6\xA4\x03\x02\x02\x02" + - "\xA7\xA9\t\x05\x02\x02\xA8\xA7\x03\x02\x02\x02\xA9\xAA\x03\x02\x02\x02" + - "\xAA\xA8\x03\x02\x02\x02\xAA\xAB\x03\x02\x02\x02\xAB!\x03\x02\x02\x02" + - "\xAC\xAD\x07,\x02\x02\xAD#\x03\x02\x02\x02\xAE\xAF\x07\'\x02\x02\xAF%" + - "\x03\x02\x02\x02\xB0\xB2\x05(\x15\x02\xB1\xB0\x03\x02\x02\x02\xB2\xB3" + - "\x03\x02\x02\x02\xB3\xB1\x03\x02\x02\x02\xB3\xB4\x03\x02\x02\x02\xB4\'" + - "\x03\x02\x02\x02\xB5\xB8\x05*\x16\x02\xB6\xB8\x05,\x17\x02\xB7\xB5\x03" + - "\x02\x02\x02\xB7\xB6\x03\x02\x02\x02\xB8)\x03\x02\x02\x02\xB9\xBB\x07" + - "\x07\x02\x02\xBA\xBC\x07\x14\x02\x02\xBB\xBA\x03\x02\x02\x02\xBB\xBC\x03" + - "\x02\x02\x02\xBC\xC0\x03\x02\x02\x02\xBD\xBF\t\x06\x02\x02\xBE\xBD\x03" + - "\x02\x02\x02\xBF\xC2\x03\x02\x02\x02\xC0\xBE\x03\x02\x02\x02\xC0\xC1\x03" + - "\x02\x02\x02\xC1\xC4\x03\x02\x02\x02\xC2\xC0\x03\x02\x02\x02\xC3\xC5\x07" + - "\x1F\x02\x02\xC4\xC3\x03\x02\x02\x02\xC4\xC5\x03\x02\x02\x02\xC5+\x03" + - "\x02\x02\x02\xC6\xC8\x07\n\x02\x02\xC7\xC6\x03\x02\x02\x02\xC8\xC9\x03" + - "\x02\x02\x02\xC9\xC7\x03\x02\x02\x02\xC9\xCA\x03\x02\x02\x02\xCA-\x03" + - "\x02\x02\x02\xCB\xCD\x050\x19\x02\xCC\xCB\x03\x02\x02\x02\xCD\xCE\x03" + - "\x02\x02\x02\xCE\xCC\x03\x02\x02\x02\xCE\xCF\x03\x02\x02\x02\xCF/\x03" + - "\x02\x02\x02\xD0\xD2\x052\x1A\x02\xD1\xD3\x05&\x14\x02\xD2\xD1\x03\x02" + - "\x02\x02\xD2\xD3\x03\x02\x02\x02\xD31\x03\x02\x02\x02\xD4\xD5\x07\x07" + - "\x02\x02\xD5\xD9\t\x07\x02\x02\xD6\xD8\t\b\x02\x02\xD7\xD6\x03\x02\x02" + - "\x02\xD8\xDB\x03\x02\x02\x02\xD9\xD7\x03\x02\x02\x02\xD9\xDA\x03\x02\x02" + - "\x02\xDA3\x03\x02\x02\x02\xDB\xD9\x03\x02\x02\x02\xDC\xDE\x056\x1C\x02" + - "\xDD\xDC\x03\x02\x02\x02\xDE\xDF\x03\x02\x02\x02\xDF\xDD\x03\x02\x02\x02" + - "\xDF\xE0\x03\x02\x02\x02\xE05\x03\x02\x02\x02\xE1\xE3\x058\x1D\x02\xE2" + - "\xE4\x05&\x14\x02\xE3\xE2\x03\x02\x02\x02\xE3\xE4\x03\x02\x02\x02\xE4" + - "7\x03\x02\x02\x02\xE5\xE6\x07\x07\x02\x02\xE6\xEA\t\t\x02\x02\xE7\xE9" + - "\t\b\x02\x02\xE8\xE7\x03\x02\x02\x02\xE9\xEC\x03\x02\x02\x02\xEA\xE8\x03" + - "\x02\x02\x02\xEA\xEB\x03\x02\x02\x02\xEB9\x03\x02\x02\x02\xEC\xEA\x03" + - "\x02\x02\x02\xED\xEE\x07\t\x02\x02\xEE;\x03\x02\x02\x02\"?GLPUX]enqy\x81" + - "\x83\x86\x8B\x90\x96\x9B\xA4\xAA\xB3\xB7\xBB\xC0\xC4\xC9\xCE\xD2\xD9\xDF" + - "\xE3\xEA"; - public static __ATN: ATN; - public static get _ATN(): ATN { - if (!LGFileParser.__ATN) { - LGFileParser.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(LGFileParser._serializedATN)); - } - - return LGFileParser.__ATN; - } - -} - -export class FileContext extends ParserRuleContext { - public EOF(): TerminalNode { return this.getToken(LGFileParser.EOF, 0); } - public paragraph(): ParagraphContext[]; - public paragraph(i: number): ParagraphContext; - public paragraph(i?: number): ParagraphContext | ParagraphContext[] { - if (i === undefined) { - return this.getRuleContexts(ParagraphContext); - } else { - return this.getRuleContext(i, ParagraphContext); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_file; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterFile) { - listener.enterFile(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitFile) { - listener.exitFile(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitFile) { - return visitor.visitFile(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class ParagraphContext extends ParserRuleContext { - public templateDefinition(): TemplateDefinitionContext | undefined { - return this.tryGetRuleContext(0, TemplateDefinitionContext); - } - public importDefinition(): ImportDefinitionContext | undefined { - return this.tryGetRuleContext(0, ImportDefinitionContext); - } - public EOF(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.EOF, 0); } - public errorTemplate(): ErrorTemplateContext | undefined { - return this.tryGetRuleContext(0, ErrorTemplateContext); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_paragraph; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterParagraph) { - listener.enterParagraph(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitParagraph) { - listener.exitParagraph(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitParagraph) { - return visitor.visitParagraph(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class ErrorTemplateContext extends ParserRuleContext { - public INVALID_TOKEN(): TerminalNode[]; - public INVALID_TOKEN(i: number): TerminalNode; - public INVALID_TOKEN(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.INVALID_TOKEN); - } else { - return this.getToken(LGFileParser.INVALID_TOKEN, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_errorTemplate; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterErrorTemplate) { - listener.enterErrorTemplate(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitErrorTemplate) { - listener.exitErrorTemplate(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitErrorTemplate) { - return visitor.visitErrorTemplate(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class TemplateDefinitionContext extends ParserRuleContext { - public templateNameLine(): TemplateNameLineContext { - return this.getRuleContext(0, TemplateNameLineContext); - } - public templateBody(): TemplateBodyContext | undefined { - return this.tryGetRuleContext(0, TemplateBodyContext); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_templateDefinition; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterTemplateDefinition) { - listener.enterTemplateDefinition(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitTemplateDefinition) { - listener.exitTemplateDefinition(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitTemplateDefinition) { - return visitor.visitTemplateDefinition(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class TemplateNameLineContext extends ParserRuleContext { - public HASH(): TerminalNode { return this.getToken(LGFileParser.HASH, 0); } - public errorTemplateName(): ErrorTemplateNameContext | undefined { - return this.tryGetRuleContext(0, ErrorTemplateNameContext); - } - public templateName(): TemplateNameContext | undefined { - return this.tryGetRuleContext(0, TemplateNameContext); - } - public parameters(): ParametersContext | undefined { - return this.tryGetRuleContext(0, ParametersContext); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_templateNameLine; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterTemplateNameLine) { - listener.enterTemplateNameLine(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitTemplateNameLine) { - listener.exitTemplateNameLine(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitTemplateNameLine) { - return visitor.visitTemplateNameLine(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class ErrorTemplateNameContext extends ParserRuleContext { - public IDENTIFIER(): TerminalNode[]; - public IDENTIFIER(i: number): TerminalNode; - public IDENTIFIER(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.IDENTIFIER); - } else { - return this.getToken(LGFileParser.IDENTIFIER, i); - } - } - public TEXT_IN_NAME(): TerminalNode[]; - public TEXT_IN_NAME(i: number): TerminalNode; - public TEXT_IN_NAME(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.TEXT_IN_NAME); - } else { - return this.getToken(LGFileParser.TEXT_IN_NAME, i); - } - } - public OPEN_PARENTHESIS(): TerminalNode[]; - public OPEN_PARENTHESIS(i: number): TerminalNode; - public OPEN_PARENTHESIS(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.OPEN_PARENTHESIS); - } else { - return this.getToken(LGFileParser.OPEN_PARENTHESIS, i); - } - } - public COMMA(): TerminalNode[]; - public COMMA(i: number): TerminalNode; - public COMMA(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.COMMA); - } else { - return this.getToken(LGFileParser.COMMA, i); - } - } - public CLOSE_PARENTHESIS(): TerminalNode[]; - public CLOSE_PARENTHESIS(i: number): TerminalNode; - public CLOSE_PARENTHESIS(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.CLOSE_PARENTHESIS); - } else { - return this.getToken(LGFileParser.CLOSE_PARENTHESIS, i); - } - } - public DOT(): TerminalNode[]; - public DOT(i: number): TerminalNode; - public DOT(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.DOT); - } else { - return this.getToken(LGFileParser.DOT, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_errorTemplateName; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterErrorTemplateName) { - listener.enterErrorTemplateName(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitErrorTemplateName) { - listener.exitErrorTemplateName(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitErrorTemplateName) { - return visitor.visitErrorTemplateName(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class TemplateNameContext extends ParserRuleContext { - public IDENTIFIER(): TerminalNode[]; - public IDENTIFIER(i: number): TerminalNode; - public IDENTIFIER(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.IDENTIFIER); - } else { - return this.getToken(LGFileParser.IDENTIFIER, i); - } - } - public DOT(): TerminalNode[]; - public DOT(i: number): TerminalNode; - public DOT(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.DOT); - } else { - return this.getToken(LGFileParser.DOT, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_templateName; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterTemplateName) { - listener.enterTemplateName(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitTemplateName) { - listener.exitTemplateName(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitTemplateName) { - return visitor.visitTemplateName(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class ParametersContext extends ParserRuleContext { - public OPEN_PARENTHESIS(): TerminalNode { return this.getToken(LGFileParser.OPEN_PARENTHESIS, 0); } - public CLOSE_PARENTHESIS(): TerminalNode { return this.getToken(LGFileParser.CLOSE_PARENTHESIS, 0); } - public IDENTIFIER(): TerminalNode[]; - public IDENTIFIER(i: number): TerminalNode; - public IDENTIFIER(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.IDENTIFIER); - } else { - return this.getToken(LGFileParser.IDENTIFIER, i); - } - } - public COMMA(): TerminalNode[]; - public COMMA(i: number): TerminalNode; - public COMMA(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.COMMA); - } else { - return this.getToken(LGFileParser.COMMA, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_parameters; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterParameters) { - listener.enterParameters(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitParameters) { - listener.exitParameters(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitParameters) { - return visitor.visitParameters(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class TemplateBodyContext extends ParserRuleContext { - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_templateBody; } - public copyFrom(ctx: TemplateBodyContext): void { - super.copyFrom(ctx); - } -} -export class SwitchCaseBodyContext extends TemplateBodyContext { - public switchCaseTemplateBody(): SwitchCaseTemplateBodyContext { - return this.getRuleContext(0, SwitchCaseTemplateBodyContext); - } - constructor(ctx: TemplateBodyContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterSwitchCaseBody) { - listener.enterSwitchCaseBody(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitSwitchCaseBody) { - listener.exitSwitchCaseBody(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitSwitchCaseBody) { - return visitor.visitSwitchCaseBody(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class NormalBodyContext extends TemplateBodyContext { - public normalTemplateBody(): NormalTemplateBodyContext { - return this.getRuleContext(0, NormalTemplateBodyContext); - } - constructor(ctx: TemplateBodyContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterNormalBody) { - listener.enterNormalBody(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitNormalBody) { - listener.exitNormalBody(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitNormalBody) { - return visitor.visitNormalBody(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class StructuredBodyContext extends TemplateBodyContext { - public structuredTemplateBody(): StructuredTemplateBodyContext { - return this.getRuleContext(0, StructuredTemplateBodyContext); - } - constructor(ctx: TemplateBodyContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterStructuredBody) { - listener.enterStructuredBody(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitStructuredBody) { - listener.exitStructuredBody(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitStructuredBody) { - return visitor.visitStructuredBody(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class IfElseBodyContext extends TemplateBodyContext { - public ifElseTemplateBody(): IfElseTemplateBodyContext { - return this.getRuleContext(0, IfElseTemplateBodyContext); - } - constructor(ctx: TemplateBodyContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterIfElseBody) { - listener.enterIfElseBody(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitIfElseBody) { - listener.exitIfElseBody(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitIfElseBody) { - return visitor.visitIfElseBody(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class StructuredTemplateBodyContext extends ParserRuleContext { - public structuredBodyNameLine(): StructuredBodyNameLineContext { - return this.getRuleContext(0, StructuredBodyNameLineContext); - } - public structuredBodyEndLine(): StructuredBodyEndLineContext | undefined { - return this.tryGetRuleContext(0, StructuredBodyEndLineContext); - } - public structuredBodyContentLine(): StructuredBodyContentLineContext[]; - public structuredBodyContentLine(i: number): StructuredBodyContentLineContext; - public structuredBodyContentLine(i?: number): StructuredBodyContentLineContext | StructuredBodyContentLineContext[] { - if (i === undefined) { - return this.getRuleContexts(StructuredBodyContentLineContext); - } else { - return this.getRuleContext(i, StructuredBodyContentLineContext); - } - } - public STRUCTURED_NEWLINE(): TerminalNode[]; - public STRUCTURED_NEWLINE(i: number): TerminalNode; - public STRUCTURED_NEWLINE(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.STRUCTURED_NEWLINE); - } else { - return this.getToken(LGFileParser.STRUCTURED_NEWLINE, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_structuredTemplateBody; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterStructuredTemplateBody) { - listener.enterStructuredTemplateBody(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitStructuredTemplateBody) { - listener.exitStructuredTemplateBody(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitStructuredTemplateBody) { - return visitor.visitStructuredTemplateBody(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class StructuredBodyNameLineContext extends ParserRuleContext { - public LEFT_SQUARE_BRACKET(): TerminalNode { return this.getToken(LGFileParser.LEFT_SQUARE_BRACKET, 0); } - public STRUCTURE_NAME(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.STRUCTURE_NAME, 0); } - public errorStructuredName(): ErrorStructuredNameContext | undefined { - return this.tryGetRuleContext(0, ErrorStructuredNameContext); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_structuredBodyNameLine; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterStructuredBodyNameLine) { - listener.enterStructuredBodyNameLine(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitStructuredBodyNameLine) { - listener.exitStructuredBodyNameLine(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitStructuredBodyNameLine) { - return visitor.visitStructuredBodyNameLine(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class ErrorStructuredNameContext extends ParserRuleContext { - public STRUCTURE_NAME(): TerminalNode[]; - public STRUCTURE_NAME(i: number): TerminalNode; - public STRUCTURE_NAME(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.STRUCTURE_NAME); - } else { - return this.getToken(LGFileParser.STRUCTURE_NAME, i); - } - } - public TEXT_IN_STRUCTURE_NAME(): TerminalNode[]; - public TEXT_IN_STRUCTURE_NAME(i: number): TerminalNode; - public TEXT_IN_STRUCTURE_NAME(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.TEXT_IN_STRUCTURE_NAME); - } else { - return this.getToken(LGFileParser.TEXT_IN_STRUCTURE_NAME, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_errorStructuredName; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterErrorStructuredName) { - listener.enterErrorStructuredName(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitErrorStructuredName) { - listener.exitErrorStructuredName(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitErrorStructuredName) { - return visitor.visitErrorStructuredName(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class StructuredBodyContentLineContext extends ParserRuleContext { - public keyValueStructureLine(): KeyValueStructureLineContext | undefined { - return this.tryGetRuleContext(0, KeyValueStructureLineContext); - } - public objectStructureLine(): ObjectStructureLineContext | undefined { - return this.tryGetRuleContext(0, ObjectStructureLineContext); - } - public errorStructureLine(): ErrorStructureLineContext | undefined { - return this.tryGetRuleContext(0, ErrorStructureLineContext); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_structuredBodyContentLine; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterStructuredBodyContentLine) { - listener.enterStructuredBodyContentLine(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitStructuredBodyContentLine) { - listener.exitStructuredBodyContentLine(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitStructuredBodyContentLine) { - return visitor.visitStructuredBodyContentLine(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class ErrorStructureLineContext extends ParserRuleContext { - public STRUCTURE_IDENTIFIER(): TerminalNode[]; - public STRUCTURE_IDENTIFIER(i: number): TerminalNode; - public STRUCTURE_IDENTIFIER(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.STRUCTURE_IDENTIFIER); - } else { - return this.getToken(LGFileParser.STRUCTURE_IDENTIFIER, i); - } - } - public STRUCTURE_EQUALS(): TerminalNode[]; - public STRUCTURE_EQUALS(i: number): TerminalNode; - public STRUCTURE_EQUALS(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.STRUCTURE_EQUALS); - } else { - return this.getToken(LGFileParser.STRUCTURE_EQUALS, i); - } - } - public STRUCTURE_OR_MARK(): TerminalNode[]; - public STRUCTURE_OR_MARK(i: number): TerminalNode; - public STRUCTURE_OR_MARK(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.STRUCTURE_OR_MARK); - } else { - return this.getToken(LGFileParser.STRUCTURE_OR_MARK, i); - } - } - public TEXT_IN_STRUCTURE_BODY(): TerminalNode[]; - public TEXT_IN_STRUCTURE_BODY(i: number): TerminalNode; - public TEXT_IN_STRUCTURE_BODY(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.TEXT_IN_STRUCTURE_BODY); - } else { - return this.getToken(LGFileParser.TEXT_IN_STRUCTURE_BODY, i); - } - } - public EXPRESSION_IN_STRUCTURE_BODY(): TerminalNode[]; - public EXPRESSION_IN_STRUCTURE_BODY(i: number): TerminalNode; - public EXPRESSION_IN_STRUCTURE_BODY(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.EXPRESSION_IN_STRUCTURE_BODY); - } else { - return this.getToken(LGFileParser.EXPRESSION_IN_STRUCTURE_BODY, i); - } - } - public ESCAPE_CHARACTER_IN_STRUCTURE_BODY(): TerminalNode[]; - public ESCAPE_CHARACTER_IN_STRUCTURE_BODY(i: number): TerminalNode; - public ESCAPE_CHARACTER_IN_STRUCTURE_BODY(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY); - } else { - return this.getToken(LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_errorStructureLine; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterErrorStructureLine) { - listener.enterErrorStructureLine(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitErrorStructureLine) { - listener.exitErrorStructureLine(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitErrorStructureLine) { - return visitor.visitErrorStructureLine(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class KeyValueStructureLineContext extends ParserRuleContext { - public STRUCTURE_IDENTIFIER(): TerminalNode { return this.getToken(LGFileParser.STRUCTURE_IDENTIFIER, 0); } - public STRUCTURE_EQUALS(): TerminalNode { return this.getToken(LGFileParser.STRUCTURE_EQUALS, 0); } - public keyValueStructureValue(): KeyValueStructureValueContext[]; - public keyValueStructureValue(i: number): KeyValueStructureValueContext; - public keyValueStructureValue(i?: number): KeyValueStructureValueContext | KeyValueStructureValueContext[] { - if (i === undefined) { - return this.getRuleContexts(KeyValueStructureValueContext); - } else { - return this.getRuleContext(i, KeyValueStructureValueContext); - } - } - public STRUCTURE_OR_MARK(): TerminalNode[]; - public STRUCTURE_OR_MARK(i: number): TerminalNode; - public STRUCTURE_OR_MARK(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.STRUCTURE_OR_MARK); - } else { - return this.getToken(LGFileParser.STRUCTURE_OR_MARK, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_keyValueStructureLine; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterKeyValueStructureLine) { - listener.enterKeyValueStructureLine(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitKeyValueStructureLine) { - listener.exitKeyValueStructureLine(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitKeyValueStructureLine) { - return visitor.visitKeyValueStructureLine(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class KeyValueStructureValueContext extends ParserRuleContext { - public TEXT_IN_STRUCTURE_BODY(): TerminalNode[]; - public TEXT_IN_STRUCTURE_BODY(i: number): TerminalNode; - public TEXT_IN_STRUCTURE_BODY(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.TEXT_IN_STRUCTURE_BODY); - } else { - return this.getToken(LGFileParser.TEXT_IN_STRUCTURE_BODY, i); - } - } - public EXPRESSION_IN_STRUCTURE_BODY(): TerminalNode[]; - public EXPRESSION_IN_STRUCTURE_BODY(i: number): TerminalNode; - public EXPRESSION_IN_STRUCTURE_BODY(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.EXPRESSION_IN_STRUCTURE_BODY); - } else { - return this.getToken(LGFileParser.EXPRESSION_IN_STRUCTURE_BODY, i); - } - } - public ESCAPE_CHARACTER_IN_STRUCTURE_BODY(): TerminalNode[]; - public ESCAPE_CHARACTER_IN_STRUCTURE_BODY(i: number): TerminalNode; - public ESCAPE_CHARACTER_IN_STRUCTURE_BODY(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY); - } else { - return this.getToken(LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_keyValueStructureValue; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterKeyValueStructureValue) { - listener.enterKeyValueStructureValue(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitKeyValueStructureValue) { - listener.exitKeyValueStructureValue(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitKeyValueStructureValue) { - return visitor.visitKeyValueStructureValue(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class ObjectStructureLineContext extends ParserRuleContext { - public EXPRESSION_IN_STRUCTURE_BODY(): TerminalNode { return this.getToken(LGFileParser.EXPRESSION_IN_STRUCTURE_BODY, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_objectStructureLine; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterObjectStructureLine) { - listener.enterObjectStructureLine(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitObjectStructureLine) { - listener.exitObjectStructureLine(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitObjectStructureLine) { - return visitor.visitObjectStructureLine(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class StructuredBodyEndLineContext extends ParserRuleContext { - public STRUCTURED_BODY_END(): TerminalNode { return this.getToken(LGFileParser.STRUCTURED_BODY_END, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_structuredBodyEndLine; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterStructuredBodyEndLine) { - listener.enterStructuredBodyEndLine(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitStructuredBodyEndLine) { - listener.exitStructuredBodyEndLine(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitStructuredBodyEndLine) { - return visitor.visitStructuredBodyEndLine(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class NormalTemplateBodyContext extends ParserRuleContext { - public templateString(): TemplateStringContext[]; - public templateString(i: number): TemplateStringContext; - public templateString(i?: number): TemplateStringContext | TemplateStringContext[] { - if (i === undefined) { - return this.getRuleContexts(TemplateStringContext); - } else { - return this.getRuleContext(i, TemplateStringContext); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_normalTemplateBody; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterNormalTemplateBody) { - listener.enterNormalTemplateBody(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitNormalTemplateBody) { - listener.exitNormalTemplateBody(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitNormalTemplateBody) { - return visitor.visitNormalTemplateBody(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class TemplateStringContext extends ParserRuleContext { - public normalTemplateString(): NormalTemplateStringContext | undefined { - return this.tryGetRuleContext(0, NormalTemplateStringContext); - } - public errorTemplateString(): ErrorTemplateStringContext | undefined { - return this.tryGetRuleContext(0, ErrorTemplateStringContext); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_templateString; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterTemplateString) { - listener.enterTemplateString(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitTemplateString) { - listener.exitTemplateString(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitTemplateString) { - return visitor.visitTemplateString(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class NormalTemplateStringContext extends ParserRuleContext { - public DASH(): TerminalNode { return this.getToken(LGFileParser.DASH, 0); } - public MULTILINE_PREFIX(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.MULTILINE_PREFIX, 0); } - public MULTILINE_SUFFIX(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.MULTILINE_SUFFIX, 0); } - public TEXT(): TerminalNode[]; - public TEXT(i: number): TerminalNode; - public TEXT(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.TEXT); - } else { - return this.getToken(LGFileParser.TEXT, i); - } - } - public EXPRESSION(): TerminalNode[]; - public EXPRESSION(i: number): TerminalNode; - public EXPRESSION(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.EXPRESSION); - } else { - return this.getToken(LGFileParser.EXPRESSION, i); - } - } - public ESCAPE_CHARACTER(): TerminalNode[]; - public ESCAPE_CHARACTER(i: number): TerminalNode; - public ESCAPE_CHARACTER(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.ESCAPE_CHARACTER); - } else { - return this.getToken(LGFileParser.ESCAPE_CHARACTER, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_normalTemplateString; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterNormalTemplateString) { - listener.enterNormalTemplateString(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitNormalTemplateString) { - listener.exitNormalTemplateString(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitNormalTemplateString) { - return visitor.visitNormalTemplateString(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class ErrorTemplateStringContext extends ParserRuleContext { - public INVALID_TOKEN(): TerminalNode[]; - public INVALID_TOKEN(i: number): TerminalNode; - public INVALID_TOKEN(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.INVALID_TOKEN); - } else { - return this.getToken(LGFileParser.INVALID_TOKEN, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_errorTemplateString; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterErrorTemplateString) { - listener.enterErrorTemplateString(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitErrorTemplateString) { - listener.exitErrorTemplateString(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitErrorTemplateString) { - return visitor.visitErrorTemplateString(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class IfElseTemplateBodyContext extends ParserRuleContext { - public ifConditionRule(): IfConditionRuleContext[]; - public ifConditionRule(i: number): IfConditionRuleContext; - public ifConditionRule(i?: number): IfConditionRuleContext | IfConditionRuleContext[] { - if (i === undefined) { - return this.getRuleContexts(IfConditionRuleContext); - } else { - return this.getRuleContext(i, IfConditionRuleContext); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_ifElseTemplateBody; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterIfElseTemplateBody) { - listener.enterIfElseTemplateBody(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitIfElseTemplateBody) { - listener.exitIfElseTemplateBody(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitIfElseTemplateBody) { - return visitor.visitIfElseTemplateBody(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class IfConditionRuleContext extends ParserRuleContext { - public ifCondition(): IfConditionContext { - return this.getRuleContext(0, IfConditionContext); - } - public normalTemplateBody(): NormalTemplateBodyContext | undefined { - return this.tryGetRuleContext(0, NormalTemplateBodyContext); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_ifConditionRule; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterIfConditionRule) { - listener.enterIfConditionRule(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitIfConditionRule) { - listener.exitIfConditionRule(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitIfConditionRule) { - return visitor.visitIfConditionRule(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class IfConditionContext extends ParserRuleContext { - public DASH(): TerminalNode { return this.getToken(LGFileParser.DASH, 0); } - public IF(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.IF, 0); } - public ELSE(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.ELSE, 0); } - public ELSEIF(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.ELSEIF, 0); } - public WS(): TerminalNode[]; - public WS(i: number): TerminalNode; - public WS(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.WS); - } else { - return this.getToken(LGFileParser.WS, i); - } - } - public TEXT(): TerminalNode[]; - public TEXT(i: number): TerminalNode; - public TEXT(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.TEXT); - } else { - return this.getToken(LGFileParser.TEXT, i); - } - } - public EXPRESSION(): TerminalNode[]; - public EXPRESSION(i: number): TerminalNode; - public EXPRESSION(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.EXPRESSION); - } else { - return this.getToken(LGFileParser.EXPRESSION, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_ifCondition; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterIfCondition) { - listener.enterIfCondition(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitIfCondition) { - listener.exitIfCondition(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitIfCondition) { - return visitor.visitIfCondition(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class SwitchCaseTemplateBodyContext extends ParserRuleContext { - public switchCaseRule(): SwitchCaseRuleContext[]; - public switchCaseRule(i: number): SwitchCaseRuleContext; - public switchCaseRule(i?: number): SwitchCaseRuleContext | SwitchCaseRuleContext[] { - if (i === undefined) { - return this.getRuleContexts(SwitchCaseRuleContext); - } else { - return this.getRuleContext(i, SwitchCaseRuleContext); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_switchCaseTemplateBody; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterSwitchCaseTemplateBody) { - listener.enterSwitchCaseTemplateBody(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitSwitchCaseTemplateBody) { - listener.exitSwitchCaseTemplateBody(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitSwitchCaseTemplateBody) { - return visitor.visitSwitchCaseTemplateBody(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class SwitchCaseRuleContext extends ParserRuleContext { - public switchCaseStat(): SwitchCaseStatContext { - return this.getRuleContext(0, SwitchCaseStatContext); - } - public normalTemplateBody(): NormalTemplateBodyContext | undefined { - return this.tryGetRuleContext(0, NormalTemplateBodyContext); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_switchCaseRule; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterSwitchCaseRule) { - listener.enterSwitchCaseRule(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitSwitchCaseRule) { - listener.exitSwitchCaseRule(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitSwitchCaseRule) { - return visitor.visitSwitchCaseRule(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class SwitchCaseStatContext extends ParserRuleContext { - public DASH(): TerminalNode { return this.getToken(LGFileParser.DASH, 0); } - public SWITCH(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.SWITCH, 0); } - public CASE(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.CASE, 0); } - public DEFAULT(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.DEFAULT, 0); } - public WS(): TerminalNode[]; - public WS(i: number): TerminalNode; - public WS(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.WS); - } else { - return this.getToken(LGFileParser.WS, i); - } - } - public TEXT(): TerminalNode[]; - public TEXT(i: number): TerminalNode; - public TEXT(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.TEXT); - } else { - return this.getToken(LGFileParser.TEXT, i); - } - } - public EXPRESSION(): TerminalNode[]; - public EXPRESSION(i: number): TerminalNode; - public EXPRESSION(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(LGFileParser.EXPRESSION); - } else { - return this.getToken(LGFileParser.EXPRESSION, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_switchCaseStat; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterSwitchCaseStat) { - listener.enterSwitchCaseStat(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitSwitchCaseStat) { - listener.exitSwitchCaseStat(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitSwitchCaseStat) { - return visitor.visitSwitchCaseStat(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class ImportDefinitionContext extends ParserRuleContext { - public IMPORT(): TerminalNode { return this.getToken(LGFileParser.IMPORT, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return LGFileParser.RULE_importDefinition; } - // @Override - public enterRule(listener: LGFileParserListener): void { - if (listener.enterImportDefinition) { - listener.enterImportDefinition(this); - } - } - // @Override - public exitRule(listener: LGFileParserListener): void { - if (listener.exitImportDefinition) { - listener.exitImportDefinition(this); - } - } - // @Override - public accept(visitor: LGFileParserVisitor): Result { - if (visitor.visitImportDefinition) { - return visitor.visitImportDefinition(this); - } else { - return visitor.visitChildren(this); - } - } -} - - +// Generated from ../LGFileParser.g4 by ANTLR 4.6-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 { LGFileParserListener } from "./LGFileParserListener"; +import { LGFileParserVisitor } from "./LGFileParserVisitor"; + + +export class LGFileParser extends Parser { + public static readonly COMMENTS = 1; + public static readonly WS = 2; + public static readonly NEWLINE = 3; + public static readonly HASH = 4; + public static readonly DASH = 5; + public static readonly LEFT_SQUARE_BRACKET = 6; + public static readonly IMPORT = 7; + public static readonly INVALID_TOKEN = 8; + public static readonly WS_IN_NAME = 9; + public static readonly NEWLINE_IN_NAME = 10; + public static readonly IDENTIFIER = 11; + public static readonly DOT = 12; + public static readonly OPEN_PARENTHESIS = 13; + public static readonly CLOSE_PARENTHESIS = 14; + public static readonly COMMA = 15; + public static readonly TEXT_IN_NAME = 16; + public static readonly WS_IN_BODY = 17; + public static readonly MULTILINE_PREFIX = 18; + public static readonly NEWLINE_IN_BODY = 19; + public static readonly IF = 20; + public static readonly ELSEIF = 21; + public static readonly ELSE = 22; + public static readonly SWITCH = 23; + public static readonly CASE = 24; + public static readonly DEFAULT = 25; + public static readonly ESCAPE_CHARACTER = 26; + public static readonly EXPRESSION = 27; + public static readonly TEXT = 28; + public static readonly MULTILINE_SUFFIX = 29; + public static readonly WS_IN_STRUCTURE_NAME = 30; + public static readonly NEWLINE_IN_STRUCTURE_NAME = 31; + public static readonly STRUCTURE_NAME = 32; + public static readonly TEXT_IN_STRUCTURE_NAME = 33; + public static readonly STRUCTURED_COMMENTS = 34; + public static readonly WS_IN_STRUCTURE_BODY = 35; + public static readonly STRUCTURED_NEWLINE = 36; + public static readonly STRUCTURED_BODY_END = 37; + public static readonly STRUCTURE_IDENTIFIER = 38; + public static readonly STRUCTURE_EQUALS = 39; + public static readonly STRUCTURE_OR_MARK = 40; + public static readonly ESCAPE_CHARACTER_IN_STRUCTURE_BODY = 41; + public static readonly EXPRESSION_IN_STRUCTURE_BODY = 42; + public static readonly TEXT_IN_STRUCTURE_BODY = 43; + public static readonly RULE_file = 0; + public static readonly RULE_paragraph = 1; + public static readonly RULE_errorTemplate = 2; + public static readonly RULE_templateDefinition = 3; + public static readonly RULE_templateNameLine = 4; + public static readonly RULE_errorTemplateName = 5; + public static readonly RULE_templateName = 6; + public static readonly RULE_parameters = 7; + public static readonly RULE_templateBody = 8; + public static readonly RULE_structuredTemplateBody = 9; + public static readonly RULE_structuredBodyNameLine = 10; + public static readonly RULE_errorStructuredName = 11; + public static readonly RULE_structuredBodyContentLine = 12; + public static readonly RULE_errorStructureLine = 13; + public static readonly RULE_keyValueStructureLine = 14; + public static readonly RULE_keyValueStructureValue = 15; + public static readonly RULE_objectStructureLine = 16; + public static readonly RULE_structuredBodyEndLine = 17; + public static readonly RULE_normalTemplateBody = 18; + public static readonly RULE_templateString = 19; + public static readonly RULE_normalTemplateString = 20; + public static readonly RULE_errorTemplateString = 21; + public static readonly RULE_ifElseTemplateBody = 22; + public static readonly RULE_ifConditionRule = 23; + public static readonly RULE_ifCondition = 24; + public static readonly RULE_switchCaseTemplateBody = 25; + public static readonly RULE_switchCaseRule = 26; + public static readonly RULE_switchCaseStat = 27; + public static readonly RULE_importDefinition = 28; + // tslint:disable:no-trailing-whitespace + public static readonly ruleNames: string[] = [ + "file", "paragraph", "errorTemplate", "templateDefinition", "templateNameLine", + "errorTemplateName", "templateName", "parameters", "templateBody", "structuredTemplateBody", + "structuredBodyNameLine", "errorStructuredName", "structuredBodyContentLine", + "errorStructureLine", "keyValueStructureLine", "keyValueStructureValue", + "objectStructureLine", "structuredBodyEndLine", "normalTemplateBody", + "templateString", "normalTemplateString", "errorTemplateString", "ifElseTemplateBody", + "ifConditionRule", "ifCondition", "switchCaseTemplateBody", "switchCaseRule", + "switchCaseStat", "importDefinition", + ]; + + private static readonly _LITERAL_NAMES: Array = [ + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, undefined, "'.'", "'('", "')'", + "','", undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, "'|'", + ]; + private static readonly _SYMBOLIC_NAMES: Array = [ + undefined, "COMMENTS", "WS", "NEWLINE", "HASH", "DASH", "LEFT_SQUARE_BRACKET", + "IMPORT", "INVALID_TOKEN", "WS_IN_NAME", "NEWLINE_IN_NAME", "IDENTIFIER", + "DOT", "OPEN_PARENTHESIS", "CLOSE_PARENTHESIS", "COMMA", "TEXT_IN_NAME", + "WS_IN_BODY", "MULTILINE_PREFIX", "NEWLINE_IN_BODY", "IF", "ELSEIF", "ELSE", + "SWITCH", "CASE", "DEFAULT", "ESCAPE_CHARACTER", "EXPRESSION", "TEXT", + "MULTILINE_SUFFIX", "WS_IN_STRUCTURE_NAME", "NEWLINE_IN_STRUCTURE_NAME", + "STRUCTURE_NAME", "TEXT_IN_STRUCTURE_NAME", "STRUCTURED_COMMENTS", "WS_IN_STRUCTURE_BODY", + "STRUCTURED_NEWLINE", "STRUCTURED_BODY_END", "STRUCTURE_IDENTIFIER", "STRUCTURE_EQUALS", + "STRUCTURE_OR_MARK", "ESCAPE_CHARACTER_IN_STRUCTURE_BODY", "EXPRESSION_IN_STRUCTURE_BODY", + "TEXT_IN_STRUCTURE_BODY", + ]; + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(LGFileParser._LITERAL_NAMES, LGFileParser._SYMBOLIC_NAMES, []); + + // @Override + // @NotNull + public get vocabulary(): Vocabulary { + return LGFileParser.VOCABULARY; + } + // tslint:enable:no-trailing-whitespace + + // @Override + public get grammarFileName(): string { return "LGFileParser.g4"; } + + // @Override + public get ruleNames(): string[] { return LGFileParser.ruleNames; } + + // @Override + public get serializedATN(): string { return LGFileParser._serializedATN; } + + constructor(input: TokenStream) { + super(input); + this._interp = new ParserATNSimulator(LGFileParser._ATN, this); + } + // @RuleVersion(0) + public file(): FileContext { + let _localctx: FileContext = new FileContext(this._ctx, this.state); + this.enterRule(_localctx, 0, LGFileParser.RULE_file); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 59; + this._errHandler.sync(this); + _alt = 1 + 1; + do { + switch (_alt) { + case 1 + 1: + { + { + this.state = 58; + this.paragraph(); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 61; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 0, this._ctx); + } while (_alt !== 1 && _alt !== ATN.INVALID_ALT_NUMBER); + this.state = 63; + this.match(LGFileParser.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 paragraph(): ParagraphContext { + let _localctx: ParagraphContext = new ParagraphContext(this._ctx, this.state); + this.enterRule(_localctx, 2, LGFileParser.RULE_paragraph); + try { + this.state = 69; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case LGFileParser.HASH: + this.enterOuterAlt(_localctx, 1); + { + this.state = 65; + this.templateDefinition(); + } + break; + case LGFileParser.IMPORT: + this.enterOuterAlt(_localctx, 2); + { + this.state = 66; + this.importDefinition(); + } + break; + case LGFileParser.EOF: + this.enterOuterAlt(_localctx, 3); + { + this.state = 67; + this.match(LGFileParser.EOF); + } + break; + case LGFileParser.INVALID_TOKEN: + this.enterOuterAlt(_localctx, 4); + { + this.state = 68; + this.errorTemplate(); + } + 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 errorTemplate(): ErrorTemplateContext { + let _localctx: ErrorTemplateContext = new ErrorTemplateContext(this._ctx, this.state); + this.enterRule(_localctx, 4, LGFileParser.RULE_errorTemplate); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 72; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 71; + this.match(LGFileParser.INVALID_TOKEN); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 74; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + } + } + 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 templateDefinition(): TemplateDefinitionContext { + let _localctx: TemplateDefinitionContext = new TemplateDefinitionContext(this._ctx, this.state); + this.enterRule(_localctx, 6, LGFileParser.RULE_templateDefinition); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 76; + this.templateNameLine(); + this.state = 78; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 3, this._ctx) ) { + case 1: + { + this.state = 77; + this.templateBody(); + } + 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 templateNameLine(): TemplateNameLineContext { + let _localctx: TemplateNameLineContext = new TemplateNameLineContext(this._ctx, this.state); + this.enterRule(_localctx, 8, LGFileParser.RULE_templateNameLine); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 80; + this.match(LGFileParser.HASH); + this.state = 86; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 5, this._ctx) ) { + case 1: + { + { + this.state = 81; + this.templateName(); + this.state = 83; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === LGFileParser.OPEN_PARENTHESIS) { + { + this.state = 82; + this.parameters(); + } + } + + } + } + break; + + case 2: + { + this.state = 85; + this.errorTemplateName(); + } + 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 errorTemplateName(): ErrorTemplateNameContext { + let _localctx: ErrorTemplateNameContext = new ErrorTemplateNameContext(this._ctx, this.state); + this.enterRule(_localctx, 10, LGFileParser.RULE_errorTemplateName); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 91; + this._errHandler.sync(this); + _la = this._input.LA(1); + while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.IDENTIFIER) | (1 << LGFileParser.DOT) | (1 << LGFileParser.OPEN_PARENTHESIS) | (1 << LGFileParser.CLOSE_PARENTHESIS) | (1 << LGFileParser.COMMA) | (1 << LGFileParser.TEXT_IN_NAME))) !== 0)) { + { + { + this.state = 88; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.IDENTIFIER) | (1 << LGFileParser.DOT) | (1 << LGFileParser.OPEN_PARENTHESIS) | (1 << LGFileParser.CLOSE_PARENTHESIS) | (1 << LGFileParser.COMMA) | (1 << LGFileParser.TEXT_IN_NAME))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 93; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + 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 templateName(): TemplateNameContext { + let _localctx: TemplateNameContext = new TemplateNameContext(this._ctx, this.state); + this.enterRule(_localctx, 12, LGFileParser.RULE_templateName); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 94; + this.match(LGFileParser.IDENTIFIER); + this.state = 99; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === LGFileParser.DOT) { + { + { + this.state = 95; + this.match(LGFileParser.DOT); + this.state = 96; + this.match(LGFileParser.IDENTIFIER); + } + } + this.state = 101; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + 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 parameters(): ParametersContext { + let _localctx: ParametersContext = new ParametersContext(this._ctx, this.state); + this.enterRule(_localctx, 14, LGFileParser.RULE_parameters); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 102; + this.match(LGFileParser.OPEN_PARENTHESIS); + this.state = 111; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === LGFileParser.IDENTIFIER) { + { + this.state = 103; + this.match(LGFileParser.IDENTIFIER); + this.state = 108; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === LGFileParser.COMMA) { + { + { + this.state = 104; + this.match(LGFileParser.COMMA); + this.state = 105; + this.match(LGFileParser.IDENTIFIER); + } + } + this.state = 110; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + + this.state = 113; + this.match(LGFileParser.CLOSE_PARENTHESIS); + } + } + 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 templateBody(): TemplateBodyContext { + let _localctx: TemplateBodyContext = new TemplateBodyContext(this._ctx, this.state); + this.enterRule(_localctx, 16, LGFileParser.RULE_templateBody); + try { + this.state = 119; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 10, this._ctx) ) { + case 1: + _localctx = new NormalBodyContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 115; + this.normalTemplateBody(); + } + break; + + case 2: + _localctx = new IfElseBodyContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 116; + this.ifElseTemplateBody(); + } + break; + + case 3: + _localctx = new SwitchCaseBodyContext(_localctx); + this.enterOuterAlt(_localctx, 3); + { + this.state = 117; + this.switchCaseTemplateBody(); + } + break; + + case 4: + _localctx = new StructuredBodyContext(_localctx); + this.enterOuterAlt(_localctx, 4); + { + this.state = 118; + this.structuredTemplateBody(); + } + 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 structuredTemplateBody(): StructuredTemplateBodyContext { + let _localctx: StructuredTemplateBodyContext = new StructuredTemplateBodyContext(this._ctx, this.state); + this.enterRule(_localctx, 18, LGFileParser.RULE_structuredTemplateBody); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 121; + this.structuredBodyNameLine(); + this.state = 129; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 38)) & ~0x1F) === 0 && ((1 << (_la - 38)) & ((1 << (LGFileParser.STRUCTURE_IDENTIFIER - 38)) | (1 << (LGFileParser.STRUCTURE_EQUALS - 38)) | (1 << (LGFileParser.STRUCTURE_OR_MARK - 38)) | (1 << (LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.EXPRESSION_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.TEXT_IN_STRUCTURE_BODY - 38)))) !== 0)) { + { + this.state = 125; + this._errHandler.sync(this); + _la = this._input.LA(1); + do { + { + { + this.state = 122; + this.structuredBodyContentLine(); + this.state = 123; + this.match(LGFileParser.STRUCTURED_NEWLINE); + } + } + this.state = 127; + this._errHandler.sync(this); + _la = this._input.LA(1); + } while (((((_la - 38)) & ~0x1F) === 0 && ((1 << (_la - 38)) & ((1 << (LGFileParser.STRUCTURE_IDENTIFIER - 38)) | (1 << (LGFileParser.STRUCTURE_EQUALS - 38)) | (1 << (LGFileParser.STRUCTURE_OR_MARK - 38)) | (1 << (LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.EXPRESSION_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.TEXT_IN_STRUCTURE_BODY - 38)))) !== 0)); + } + } + + this.state = 132; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === LGFileParser.STRUCTURED_BODY_END) { + { + this.state = 131; + this.structuredBodyEndLine(); + } + } + + } + } + 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 structuredBodyNameLine(): StructuredBodyNameLineContext { + let _localctx: StructuredBodyNameLineContext = new StructuredBodyNameLineContext(this._ctx, this.state); + this.enterRule(_localctx, 20, LGFileParser.RULE_structuredBodyNameLine); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 134; + this.match(LGFileParser.LEFT_SQUARE_BRACKET); + this.state = 137; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 14, this._ctx) ) { + case 1: + { + this.state = 135; + this.match(LGFileParser.STRUCTURE_NAME); + } + break; + + case 2: + { + this.state = 136; + this.errorStructuredName(); + } + 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 errorStructuredName(): ErrorStructuredNameContext { + let _localctx: ErrorStructuredNameContext = new ErrorStructuredNameContext(this._ctx, this.state); + this.enterRule(_localctx, 22, LGFileParser.RULE_errorStructuredName); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 142; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === LGFileParser.STRUCTURE_NAME || _la === LGFileParser.TEXT_IN_STRUCTURE_NAME) { + { + { + this.state = 139; + _la = this._input.LA(1); + if (!(_la === LGFileParser.STRUCTURE_NAME || _la === LGFileParser.TEXT_IN_STRUCTURE_NAME)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 144; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + 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 structuredBodyContentLine(): StructuredBodyContentLineContext { + let _localctx: StructuredBodyContentLineContext = new StructuredBodyContentLineContext(this._ctx, this.state); + this.enterRule(_localctx, 24, LGFileParser.RULE_structuredBodyContentLine); + try { + this.state = 148; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 16, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 145; + this.keyValueStructureLine(); + } + break; + + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 146; + this.objectStructureLine(); + } + break; + + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 147; + this.errorStructureLine(); + } + 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 errorStructureLine(): ErrorStructureLineContext { + let _localctx: ErrorStructureLineContext = new ErrorStructureLineContext(this._ctx, this.state); + this.enterRule(_localctx, 26, LGFileParser.RULE_errorStructureLine); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 151; + this._errHandler.sync(this); + _la = this._input.LA(1); + do { + { + { + this.state = 150; + _la = this._input.LA(1); + if (!(((((_la - 38)) & ~0x1F) === 0 && ((1 << (_la - 38)) & ((1 << (LGFileParser.STRUCTURE_IDENTIFIER - 38)) | (1 << (LGFileParser.STRUCTURE_EQUALS - 38)) | (1 << (LGFileParser.STRUCTURE_OR_MARK - 38)) | (1 << (LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.EXPRESSION_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.TEXT_IN_STRUCTURE_BODY - 38)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 153; + this._errHandler.sync(this); + _la = this._input.LA(1); + } while (((((_la - 38)) & ~0x1F) === 0 && ((1 << (_la - 38)) & ((1 << (LGFileParser.STRUCTURE_IDENTIFIER - 38)) | (1 << (LGFileParser.STRUCTURE_EQUALS - 38)) | (1 << (LGFileParser.STRUCTURE_OR_MARK - 38)) | (1 << (LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.EXPRESSION_IN_STRUCTURE_BODY - 38)) | (1 << (LGFileParser.TEXT_IN_STRUCTURE_BODY - 38)))) !== 0)); + } + } + 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 keyValueStructureLine(): KeyValueStructureLineContext { + let _localctx: KeyValueStructureLineContext = new KeyValueStructureLineContext(this._ctx, this.state); + this.enterRule(_localctx, 28, LGFileParser.RULE_keyValueStructureLine); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 155; + this.match(LGFileParser.STRUCTURE_IDENTIFIER); + this.state = 156; + this.match(LGFileParser.STRUCTURE_EQUALS); + this.state = 157; + this.keyValueStructureValue(); + this.state = 162; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === LGFileParser.STRUCTURE_OR_MARK) { + { + { + this.state = 158; + this.match(LGFileParser.STRUCTURE_OR_MARK); + this.state = 159; + this.keyValueStructureValue(); + } + } + this.state = 164; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + 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 keyValueStructureValue(): KeyValueStructureValueContext { + let _localctx: KeyValueStructureValueContext = new KeyValueStructureValueContext(this._ctx, this.state); + this.enterRule(_localctx, 30, LGFileParser.RULE_keyValueStructureValue); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 166; + this._errHandler.sync(this); + _la = this._input.LA(1); + do { + { + { + this.state = 165; + _la = this._input.LA(1); + if (!(((((_la - 41)) & ~0x1F) === 0 && ((1 << (_la - 41)) & ((1 << (LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY - 41)) | (1 << (LGFileParser.EXPRESSION_IN_STRUCTURE_BODY - 41)) | (1 << (LGFileParser.TEXT_IN_STRUCTURE_BODY - 41)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 168; + this._errHandler.sync(this); + _la = this._input.LA(1); + } while (((((_la - 41)) & ~0x1F) === 0 && ((1 << (_la - 41)) & ((1 << (LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY - 41)) | (1 << (LGFileParser.EXPRESSION_IN_STRUCTURE_BODY - 41)) | (1 << (LGFileParser.TEXT_IN_STRUCTURE_BODY - 41)))) !== 0)); + } + } + 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 objectStructureLine(): ObjectStructureLineContext { + let _localctx: ObjectStructureLineContext = new ObjectStructureLineContext(this._ctx, this.state); + this.enterRule(_localctx, 32, LGFileParser.RULE_objectStructureLine); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 170; + this.match(LGFileParser.EXPRESSION_IN_STRUCTURE_BODY); + } + } + 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 structuredBodyEndLine(): StructuredBodyEndLineContext { + let _localctx: StructuredBodyEndLineContext = new StructuredBodyEndLineContext(this._ctx, this.state); + this.enterRule(_localctx, 34, LGFileParser.RULE_structuredBodyEndLine); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 172; + this.match(LGFileParser.STRUCTURED_BODY_END); + } + } + 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 normalTemplateBody(): NormalTemplateBodyContext { + let _localctx: NormalTemplateBodyContext = new NormalTemplateBodyContext(this._ctx, this.state); + this.enterRule(_localctx, 36, LGFileParser.RULE_normalTemplateBody); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 175; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 174; + this.templateString(); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 177; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 20, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + } + } + 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 templateString(): TemplateStringContext { + let _localctx: TemplateStringContext = new TemplateStringContext(this._ctx, this.state); + this.enterRule(_localctx, 38, LGFileParser.RULE_templateString); + try { + this.state = 181; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case LGFileParser.DASH: + this.enterOuterAlt(_localctx, 1); + { + this.state = 179; + this.normalTemplateString(); + } + break; + case LGFileParser.INVALID_TOKEN: + this.enterOuterAlt(_localctx, 2); + { + this.state = 180; + this.errorTemplateString(); + } + 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 normalTemplateString(): NormalTemplateStringContext { + let _localctx: NormalTemplateStringContext = new NormalTemplateStringContext(this._ctx, this.state); + this.enterRule(_localctx, 40, LGFileParser.RULE_normalTemplateString); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 183; + this.match(LGFileParser.DASH); + this.state = 185; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === LGFileParser.MULTILINE_PREFIX) { + { + this.state = 184; + this.match(LGFileParser.MULTILINE_PREFIX); + } + } + + this.state = 190; + this._errHandler.sync(this); + _la = this._input.LA(1); + while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.ESCAPE_CHARACTER) | (1 << LGFileParser.EXPRESSION) | (1 << LGFileParser.TEXT))) !== 0)) { + { + { + this.state = 187; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.ESCAPE_CHARACTER) | (1 << LGFileParser.EXPRESSION) | (1 << LGFileParser.TEXT))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 192; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 194; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === LGFileParser.MULTILINE_SUFFIX) { + { + this.state = 193; + this.match(LGFileParser.MULTILINE_SUFFIX); + } + } + + } + } + 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 errorTemplateString(): ErrorTemplateStringContext { + let _localctx: ErrorTemplateStringContext = new ErrorTemplateStringContext(this._ctx, this.state); + this.enterRule(_localctx, 42, LGFileParser.RULE_errorTemplateString); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 197; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 196; + this.match(LGFileParser.INVALID_TOKEN); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 199; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 25, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + } + } + 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 ifElseTemplateBody(): IfElseTemplateBodyContext { + let _localctx: IfElseTemplateBodyContext = new IfElseTemplateBodyContext(this._ctx, this.state); + this.enterRule(_localctx, 44, LGFileParser.RULE_ifElseTemplateBody); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 202; + this._errHandler.sync(this); + _la = this._input.LA(1); + do { + { + { + this.state = 201; + this.ifConditionRule(); + } + } + this.state = 204; + this._errHandler.sync(this); + _la = this._input.LA(1); + } while (_la === LGFileParser.DASH); + } + } + 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 ifConditionRule(): IfConditionRuleContext { + let _localctx: IfConditionRuleContext = new IfConditionRuleContext(this._ctx, this.state); + this.enterRule(_localctx, 46, LGFileParser.RULE_ifConditionRule); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 206; + this.ifCondition(); + this.state = 208; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 27, this._ctx) ) { + case 1: + { + this.state = 207; + this.normalTemplateBody(); + } + 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 ifCondition(): IfConditionContext { + let _localctx: IfConditionContext = new IfConditionContext(this._ctx, this.state); + this.enterRule(_localctx, 48, LGFileParser.RULE_ifCondition); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 210; + this.match(LGFileParser.DASH); + this.state = 211; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.IF) | (1 << LGFileParser.ELSEIF) | (1 << LGFileParser.ELSE))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 215; + this._errHandler.sync(this); + _la = this._input.LA(1); + while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.WS) | (1 << LGFileParser.EXPRESSION) | (1 << LGFileParser.TEXT))) !== 0)) { + { + { + this.state = 212; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.WS) | (1 << LGFileParser.EXPRESSION) | (1 << LGFileParser.TEXT))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 217; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + 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 switchCaseTemplateBody(): SwitchCaseTemplateBodyContext { + let _localctx: SwitchCaseTemplateBodyContext = new SwitchCaseTemplateBodyContext(this._ctx, this.state); + this.enterRule(_localctx, 50, LGFileParser.RULE_switchCaseTemplateBody); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 219; + this._errHandler.sync(this); + _la = this._input.LA(1); + do { + { + { + this.state = 218; + this.switchCaseRule(); + } + } + this.state = 221; + this._errHandler.sync(this); + _la = this._input.LA(1); + } while (_la === LGFileParser.DASH); + } + } + 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 switchCaseRule(): SwitchCaseRuleContext { + let _localctx: SwitchCaseRuleContext = new SwitchCaseRuleContext(this._ctx, this.state); + this.enterRule(_localctx, 52, LGFileParser.RULE_switchCaseRule); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 223; + this.switchCaseStat(); + this.state = 225; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 30, this._ctx) ) { + case 1: + { + this.state = 224; + this.normalTemplateBody(); + } + 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 switchCaseStat(): SwitchCaseStatContext { + let _localctx: SwitchCaseStatContext = new SwitchCaseStatContext(this._ctx, this.state); + this.enterRule(_localctx, 54, LGFileParser.RULE_switchCaseStat); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 227; + this.match(LGFileParser.DASH); + this.state = 228; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.SWITCH) | (1 << LGFileParser.CASE) | (1 << LGFileParser.DEFAULT))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 232; + this._errHandler.sync(this); + _la = this._input.LA(1); + while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.WS) | (1 << LGFileParser.EXPRESSION) | (1 << LGFileParser.TEXT))) !== 0)) { + { + { + this.state = 229; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << LGFileParser.WS) | (1 << LGFileParser.EXPRESSION) | (1 << LGFileParser.TEXT))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 234; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + 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 importDefinition(): ImportDefinitionContext { + let _localctx: ImportDefinitionContext = new ImportDefinitionContext(this._ctx, this.state); + this.enterRule(_localctx, 56, LGFileParser.RULE_importDefinition); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 235; + this.match(LGFileParser.IMPORT); + } + } + 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\uAF6F\u8320\u479D\uB75C\u4880\u1605\u191C\uAB37\x03-\xF0\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\x04\x1B\t\x1B\x04\x1C\t\x1C\x04" + + "\x1D\t\x1D\x04\x1E\t\x1E\x03\x02\x06\x02>\n\x02\r\x02\x0E\x02?\x03\x02" + + "\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x05\x03H\n\x03\x03\x04\x06\x04" + + "K\n\x04\r\x04\x0E\x04L\x03\x05\x03\x05\x05\x05Q\n\x05\x03\x06\x03\x06" + + "\x03\x06\x05\x06V\n\x06\x03\x06\x05\x06Y\n\x06\x03\x07\x07\x07\\\n\x07" + + "\f\x07\x0E\x07_\v\x07\x03\b\x03\b\x03\b\x07\bd\n\b\f\b\x0E\bg\v\b\x03" + + "\t\x03\t\x03\t\x03\t\x07\tm\n\t\f\t\x0E\tp\v\t\x05\tr\n\t\x03\t\x03\t" + + "\x03\n\x03\n\x03\n\x03\n\x05\nz\n\n\x03\v\x03\v\x03\v\x03\v\x06\v\x80" + + "\n\v\r\v\x0E\v\x81\x05\v\x84\n\v\x03\v\x05\v\x87\n\v\x03\f\x03\f\x03\f" + + "\x05\f\x8C\n\f\x03\r\x07\r\x8F\n\r\f\r\x0E\r\x92\v\r\x03\x0E\x03\x0E\x03" + + "\x0E\x05\x0E\x97\n\x0E\x03\x0F\x06\x0F\x9A\n\x0F\r\x0F\x0E\x0F\x9B\x03" + + "\x10\x03\x10\x03\x10\x03\x10\x03\x10\x07\x10\xA3\n\x10\f\x10\x0E\x10\xA6" + + "\v\x10\x03\x11\x06\x11\xA9\n\x11\r\x11\x0E\x11\xAA\x03\x12\x03\x12\x03" + + "\x13\x03\x13\x03\x14\x06\x14\xB2\n\x14\r\x14\x0E\x14\xB3\x03\x15\x03\x15" + + "\x05\x15\xB8\n\x15\x03\x16\x03\x16\x05\x16\xBC\n\x16\x03\x16\x07\x16\xBF" + + "\n\x16\f\x16\x0E\x16\xC2\v\x16\x03\x16\x05\x16\xC5\n\x16\x03\x17\x06\x17" + + "\xC8\n\x17\r\x17\x0E\x17\xC9\x03\x18\x06\x18\xCD\n\x18\r\x18\x0E\x18\xCE" + + "\x03\x19\x03\x19\x05\x19\xD3\n\x19\x03\x1A\x03\x1A\x03\x1A\x07\x1A\xD8" + + "\n\x1A\f\x1A\x0E\x1A\xDB\v\x1A\x03\x1B\x06\x1B\xDE\n\x1B\r\x1B\x0E\x1B" + + "\xDF\x03\x1C\x03\x1C\x05\x1C\xE4\n\x1C\x03\x1D\x03\x1D\x03\x1D\x07\x1D" + + "\xE9\n\x1D\f\x1D\x0E\x1D\xEC\v\x1D\x03\x1E\x03\x1E\x03\x1E\x03?\x02\x02" + + "\x1F\x02\x02\x04\x02\x06\x02\b\x02\n\x02\f\x02\x0E\x02\x10\x02\x12\x02" + + "\x14\x02\x16\x02\x18\x02\x1A\x02\x1C\x02\x1E\x02 \x02\"\x02$\x02&\x02" + + "(\x02*\x02,\x02.\x020\x022\x024\x026\x028\x02:\x02\x02\n\x03\x02\r\x12" + + "\x03\x02\"#\x03\x02(-\x03\x02+-\x03\x02\x1C\x1E\x03\x02\x16\x18\x04\x02" + + "\x04\x04\x1D\x1E\x03\x02\x19\x1B\xF7\x02=\x03\x02\x02\x02\x04G\x03\x02" + + "\x02\x02\x06J\x03\x02\x02\x02\bN\x03\x02\x02\x02\nR\x03\x02\x02\x02\f" + + "]\x03\x02\x02\x02\x0E`\x03\x02\x02\x02\x10h\x03\x02\x02\x02\x12y\x03\x02" + + "\x02\x02\x14{\x03\x02\x02\x02\x16\x88\x03\x02\x02\x02\x18\x90\x03\x02" + + "\x02\x02\x1A\x96\x03\x02\x02\x02\x1C\x99\x03\x02\x02\x02\x1E\x9D\x03\x02" + + "\x02\x02 \xA8\x03\x02\x02\x02\"\xAC\x03\x02\x02\x02$\xAE\x03\x02\x02\x02" + + "&\xB1\x03\x02\x02\x02(\xB7\x03\x02\x02\x02*\xB9\x03\x02\x02\x02,\xC7\x03" + + "\x02\x02\x02.\xCC\x03\x02\x02\x020\xD0\x03\x02\x02\x022\xD4\x03\x02\x02" + + "\x024\xDD\x03\x02\x02\x026\xE1\x03\x02\x02\x028\xE5\x03\x02\x02\x02:\xED" + + "\x03\x02\x02\x02<>\x05\x04\x03\x02=<\x03\x02\x02\x02>?\x03\x02\x02\x02" + + "?@\x03\x02\x02\x02?=\x03\x02\x02\x02@A\x03\x02\x02\x02AB\x07\x02\x02\x03" + + "B\x03\x03\x02\x02\x02CH\x05\b\x05\x02DH\x05:\x1E\x02EH\x07\x02\x02\x03" + + "FH\x05\x06\x04\x02GC\x03\x02\x02\x02GD\x03\x02\x02\x02GE\x03\x02\x02\x02" + + "GF\x03\x02\x02\x02H\x05\x03\x02\x02\x02IK\x07\n\x02\x02JI\x03\x02\x02" + + "\x02KL\x03\x02\x02\x02LJ\x03\x02\x02\x02LM\x03\x02\x02\x02M\x07\x03\x02" + + "\x02\x02NP\x05\n\x06\x02OQ\x05\x12\n\x02PO\x03\x02\x02\x02PQ\x03\x02\x02" + + "\x02Q\t\x03\x02\x02\x02RX\x07\x06\x02\x02SU\x05\x0E\b\x02TV\x05\x10\t" + + "\x02UT\x03\x02\x02\x02UV\x03\x02\x02\x02VY\x03\x02\x02\x02WY\x05\f\x07" + + "\x02XS\x03\x02\x02\x02XW\x03\x02\x02\x02Y\v\x03\x02\x02\x02Z\\\t\x02\x02" + + "\x02[Z\x03\x02\x02\x02\\_\x03\x02\x02\x02][\x03\x02\x02\x02]^\x03\x02" + + "\x02\x02^\r\x03\x02\x02\x02_]\x03\x02\x02\x02`e\x07\r\x02\x02ab\x07\x0E" + + "\x02\x02bd\x07\r\x02\x02ca\x03\x02\x02\x02dg\x03\x02\x02\x02ec\x03\x02" + + "\x02\x02ef\x03\x02\x02\x02f\x0F\x03\x02\x02\x02ge\x03\x02\x02\x02hq\x07" + + "\x0F\x02\x02in\x07\r\x02\x02jk\x07\x11\x02\x02km\x07\r\x02\x02lj\x03\x02" + + "\x02\x02mp\x03\x02\x02\x02nl\x03\x02\x02\x02no\x03\x02\x02\x02or\x03\x02" + + "\x02\x02pn\x03\x02\x02\x02qi\x03\x02\x02\x02qr\x03\x02\x02\x02rs\x03\x02" + + "\x02\x02st\x07\x10\x02\x02t\x11\x03\x02\x02\x02uz\x05&\x14\x02vz\x05." + + "\x18\x02wz\x054\x1B\x02xz\x05\x14\v\x02yu\x03\x02\x02\x02yv\x03\x02\x02" + + "\x02yw\x03\x02\x02\x02yx\x03\x02\x02\x02z\x13\x03\x02\x02\x02{\x83\x05" + + "\x16\f\x02|}\x05\x1A\x0E\x02}~\x07&\x02\x02~\x80\x03\x02\x02\x02\x7F|" + + "\x03\x02\x02\x02\x80\x81\x03\x02\x02\x02\x81\x7F\x03\x02\x02\x02\x81\x82" + + "\x03\x02\x02\x02\x82\x84\x03\x02\x02\x02\x83\x7F\x03\x02\x02\x02\x83\x84" + + "\x03\x02\x02\x02\x84\x86\x03\x02\x02\x02\x85\x87\x05$\x13\x02\x86\x85" + + "\x03\x02\x02\x02\x86\x87\x03\x02\x02\x02\x87\x15\x03\x02\x02\x02\x88\x8B" + + "\x07\b\x02\x02\x89\x8C\x07\"\x02\x02\x8A\x8C\x05\x18\r\x02\x8B\x89\x03" + + "\x02\x02\x02\x8B\x8A\x03\x02\x02\x02\x8C\x17\x03\x02\x02\x02\x8D\x8F\t" + + "\x03\x02\x02\x8E\x8D\x03\x02\x02\x02\x8F\x92\x03\x02\x02\x02\x90\x8E\x03" + + "\x02\x02\x02\x90\x91\x03\x02\x02\x02\x91\x19\x03\x02\x02\x02\x92\x90\x03" + + "\x02\x02\x02\x93\x97\x05\x1E\x10\x02\x94\x97\x05\"\x12\x02\x95\x97\x05" + + "\x1C\x0F\x02\x96\x93\x03\x02\x02\x02\x96\x94\x03\x02\x02\x02\x96\x95\x03" + + "\x02\x02\x02\x97\x1B\x03\x02\x02\x02\x98\x9A\t\x04\x02\x02\x99\x98\x03" + + "\x02\x02\x02\x9A\x9B\x03\x02\x02\x02\x9B\x99\x03\x02\x02\x02\x9B\x9C\x03" + + "\x02\x02\x02\x9C\x1D\x03\x02\x02\x02\x9D\x9E\x07(\x02\x02\x9E\x9F\x07" + + ")\x02\x02\x9F\xA4\x05 \x11\x02\xA0\xA1\x07*\x02\x02\xA1\xA3\x05 \x11\x02" + + "\xA2\xA0\x03\x02\x02\x02\xA3\xA6\x03\x02\x02\x02\xA4\xA2\x03\x02\x02\x02" + + "\xA4\xA5\x03\x02\x02\x02\xA5\x1F\x03\x02\x02\x02\xA6\xA4\x03\x02\x02\x02" + + "\xA7\xA9\t\x05\x02\x02\xA8\xA7\x03\x02\x02\x02\xA9\xAA\x03\x02\x02\x02" + + "\xAA\xA8\x03\x02\x02\x02\xAA\xAB\x03\x02\x02\x02\xAB!\x03\x02\x02\x02" + + "\xAC\xAD\x07,\x02\x02\xAD#\x03\x02\x02\x02\xAE\xAF\x07\'\x02\x02\xAF%" + + "\x03\x02\x02\x02\xB0\xB2\x05(\x15\x02\xB1\xB0\x03\x02\x02\x02\xB2\xB3" + + "\x03\x02\x02\x02\xB3\xB1\x03\x02\x02\x02\xB3\xB4\x03\x02\x02\x02\xB4\'" + + "\x03\x02\x02\x02\xB5\xB8\x05*\x16\x02\xB6\xB8\x05,\x17\x02\xB7\xB5\x03" + + "\x02\x02\x02\xB7\xB6\x03\x02\x02\x02\xB8)\x03\x02\x02\x02\xB9\xBB\x07" + + "\x07\x02\x02\xBA\xBC\x07\x14\x02\x02\xBB\xBA\x03\x02\x02\x02\xBB\xBC\x03" + + "\x02\x02\x02\xBC\xC0\x03\x02\x02\x02\xBD\xBF\t\x06\x02\x02\xBE\xBD\x03" + + "\x02\x02\x02\xBF\xC2\x03\x02\x02\x02\xC0\xBE\x03\x02\x02\x02\xC0\xC1\x03" + + "\x02\x02\x02\xC1\xC4\x03\x02\x02\x02\xC2\xC0\x03\x02\x02\x02\xC3\xC5\x07" + + "\x1F\x02\x02\xC4\xC3\x03\x02\x02\x02\xC4\xC5\x03\x02\x02\x02\xC5+\x03" + + "\x02\x02\x02\xC6\xC8\x07\n\x02\x02\xC7\xC6\x03\x02\x02\x02\xC8\xC9\x03" + + "\x02\x02\x02\xC9\xC7\x03\x02\x02\x02\xC9\xCA\x03\x02\x02\x02\xCA-\x03" + + "\x02\x02\x02\xCB\xCD\x050\x19\x02\xCC\xCB\x03\x02\x02\x02\xCD\xCE\x03" + + "\x02\x02\x02\xCE\xCC\x03\x02\x02\x02\xCE\xCF\x03\x02\x02\x02\xCF/\x03" + + "\x02\x02\x02\xD0\xD2\x052\x1A\x02\xD1\xD3\x05&\x14\x02\xD2\xD1\x03\x02" + + "\x02\x02\xD2\xD3\x03\x02\x02\x02\xD31\x03\x02\x02\x02\xD4\xD5\x07\x07" + + "\x02\x02\xD5\xD9\t\x07\x02\x02\xD6\xD8\t\b\x02\x02\xD7\xD6\x03\x02\x02" + + "\x02\xD8\xDB\x03\x02\x02\x02\xD9\xD7\x03\x02\x02\x02\xD9\xDA\x03\x02\x02" + + "\x02\xDA3\x03\x02\x02\x02\xDB\xD9\x03\x02\x02\x02\xDC\xDE\x056\x1C\x02" + + "\xDD\xDC\x03\x02\x02\x02\xDE\xDF\x03\x02\x02\x02\xDF\xDD\x03\x02\x02\x02" + + "\xDF\xE0\x03\x02\x02\x02\xE05\x03\x02\x02\x02\xE1\xE3\x058\x1D\x02\xE2" + + "\xE4\x05&\x14\x02\xE3\xE2\x03\x02\x02\x02\xE3\xE4\x03\x02\x02\x02\xE4" + + "7\x03\x02\x02\x02\xE5\xE6\x07\x07\x02\x02\xE6\xEA\t\t\x02\x02\xE7\xE9" + + "\t\b\x02\x02\xE8\xE7\x03\x02\x02\x02\xE9\xEC\x03\x02\x02\x02\xEA\xE8\x03" + + "\x02\x02\x02\xEA\xEB\x03\x02\x02\x02\xEB9\x03\x02\x02\x02\xEC\xEA\x03" + + "\x02\x02\x02\xED\xEE\x07\t\x02\x02\xEE;\x03\x02\x02\x02\"?GLPUX]enqy\x81" + + "\x83\x86\x8B\x90\x96\x9B\xA4\xAA\xB3\xB7\xBB\xC0\xC4\xC9\xCE\xD2\xD9\xDF" + + "\xE3\xEA"; + public static __ATN: ATN; + public static get _ATN(): ATN { + if (!LGFileParser.__ATN) { + LGFileParser.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(LGFileParser._serializedATN)); + } + + return LGFileParser.__ATN; + } + +} + +export class FileContext extends ParserRuleContext { + public EOF(): TerminalNode { return this.getToken(LGFileParser.EOF, 0); } + public paragraph(): ParagraphContext[]; + public paragraph(i: number): ParagraphContext; + public paragraph(i?: number): ParagraphContext | ParagraphContext[] { + if (i === undefined) { + return this.getRuleContexts(ParagraphContext); + } else { + return this.getRuleContext(i, ParagraphContext); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_file; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterFile) { + listener.enterFile(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitFile) { + listener.exitFile(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitFile) { + return visitor.visitFile(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ParagraphContext extends ParserRuleContext { + public templateDefinition(): TemplateDefinitionContext | undefined { + return this.tryGetRuleContext(0, TemplateDefinitionContext); + } + public importDefinition(): ImportDefinitionContext | undefined { + return this.tryGetRuleContext(0, ImportDefinitionContext); + } + public EOF(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.EOF, 0); } + public errorTemplate(): ErrorTemplateContext | undefined { + return this.tryGetRuleContext(0, ErrorTemplateContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_paragraph; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterParagraph) { + listener.enterParagraph(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitParagraph) { + listener.exitParagraph(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitParagraph) { + return visitor.visitParagraph(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ErrorTemplateContext extends ParserRuleContext { + public INVALID_TOKEN(): TerminalNode[]; + public INVALID_TOKEN(i: number): TerminalNode; + public INVALID_TOKEN(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.INVALID_TOKEN); + } else { + return this.getToken(LGFileParser.INVALID_TOKEN, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_errorTemplate; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterErrorTemplate) { + listener.enterErrorTemplate(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitErrorTemplate) { + listener.exitErrorTemplate(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitErrorTemplate) { + return visitor.visitErrorTemplate(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class TemplateDefinitionContext extends ParserRuleContext { + public templateNameLine(): TemplateNameLineContext { + return this.getRuleContext(0, TemplateNameLineContext); + } + public templateBody(): TemplateBodyContext | undefined { + return this.tryGetRuleContext(0, TemplateBodyContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_templateDefinition; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterTemplateDefinition) { + listener.enterTemplateDefinition(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitTemplateDefinition) { + listener.exitTemplateDefinition(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitTemplateDefinition) { + return visitor.visitTemplateDefinition(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class TemplateNameLineContext extends ParserRuleContext { + public HASH(): TerminalNode { return this.getToken(LGFileParser.HASH, 0); } + public errorTemplateName(): ErrorTemplateNameContext | undefined { + return this.tryGetRuleContext(0, ErrorTemplateNameContext); + } + public templateName(): TemplateNameContext | undefined { + return this.tryGetRuleContext(0, TemplateNameContext); + } + public parameters(): ParametersContext | undefined { + return this.tryGetRuleContext(0, ParametersContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_templateNameLine; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterTemplateNameLine) { + listener.enterTemplateNameLine(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitTemplateNameLine) { + listener.exitTemplateNameLine(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitTemplateNameLine) { + return visitor.visitTemplateNameLine(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ErrorTemplateNameContext extends ParserRuleContext { + public IDENTIFIER(): TerminalNode[]; + public IDENTIFIER(i: number): TerminalNode; + public IDENTIFIER(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.IDENTIFIER); + } else { + return this.getToken(LGFileParser.IDENTIFIER, i); + } + } + public TEXT_IN_NAME(): TerminalNode[]; + public TEXT_IN_NAME(i: number): TerminalNode; + public TEXT_IN_NAME(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.TEXT_IN_NAME); + } else { + return this.getToken(LGFileParser.TEXT_IN_NAME, i); + } + } + public OPEN_PARENTHESIS(): TerminalNode[]; + public OPEN_PARENTHESIS(i: number): TerminalNode; + public OPEN_PARENTHESIS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.OPEN_PARENTHESIS); + } else { + return this.getToken(LGFileParser.OPEN_PARENTHESIS, i); + } + } + public COMMA(): TerminalNode[]; + public COMMA(i: number): TerminalNode; + public COMMA(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.COMMA); + } else { + return this.getToken(LGFileParser.COMMA, i); + } + } + public CLOSE_PARENTHESIS(): TerminalNode[]; + public CLOSE_PARENTHESIS(i: number): TerminalNode; + public CLOSE_PARENTHESIS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.CLOSE_PARENTHESIS); + } else { + return this.getToken(LGFileParser.CLOSE_PARENTHESIS, i); + } + } + public DOT(): TerminalNode[]; + public DOT(i: number): TerminalNode; + public DOT(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.DOT); + } else { + return this.getToken(LGFileParser.DOT, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_errorTemplateName; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterErrorTemplateName) { + listener.enterErrorTemplateName(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitErrorTemplateName) { + listener.exitErrorTemplateName(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitErrorTemplateName) { + return visitor.visitErrorTemplateName(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class TemplateNameContext extends ParserRuleContext { + public IDENTIFIER(): TerminalNode[]; + public IDENTIFIER(i: number): TerminalNode; + public IDENTIFIER(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.IDENTIFIER); + } else { + return this.getToken(LGFileParser.IDENTIFIER, i); + } + } + public DOT(): TerminalNode[]; + public DOT(i: number): TerminalNode; + public DOT(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.DOT); + } else { + return this.getToken(LGFileParser.DOT, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_templateName; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterTemplateName) { + listener.enterTemplateName(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitTemplateName) { + listener.exitTemplateName(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitTemplateName) { + return visitor.visitTemplateName(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ParametersContext extends ParserRuleContext { + public OPEN_PARENTHESIS(): TerminalNode { return this.getToken(LGFileParser.OPEN_PARENTHESIS, 0); } + public CLOSE_PARENTHESIS(): TerminalNode { return this.getToken(LGFileParser.CLOSE_PARENTHESIS, 0); } + public IDENTIFIER(): TerminalNode[]; + public IDENTIFIER(i: number): TerminalNode; + public IDENTIFIER(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.IDENTIFIER); + } else { + return this.getToken(LGFileParser.IDENTIFIER, i); + } + } + public COMMA(): TerminalNode[]; + public COMMA(i: number): TerminalNode; + public COMMA(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.COMMA); + } else { + return this.getToken(LGFileParser.COMMA, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_parameters; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterParameters) { + listener.enterParameters(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitParameters) { + listener.exitParameters(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitParameters) { + return visitor.visitParameters(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class TemplateBodyContext extends ParserRuleContext { + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_templateBody; } + public copyFrom(ctx: TemplateBodyContext): void { + super.copyFrom(ctx); + } +} +export class SwitchCaseBodyContext extends TemplateBodyContext { + public switchCaseTemplateBody(): SwitchCaseTemplateBodyContext { + return this.getRuleContext(0, SwitchCaseTemplateBodyContext); + } + constructor(ctx: TemplateBodyContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterSwitchCaseBody) { + listener.enterSwitchCaseBody(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitSwitchCaseBody) { + listener.exitSwitchCaseBody(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitSwitchCaseBody) { + return visitor.visitSwitchCaseBody(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class NormalBodyContext extends TemplateBodyContext { + public normalTemplateBody(): NormalTemplateBodyContext { + return this.getRuleContext(0, NormalTemplateBodyContext); + } + constructor(ctx: TemplateBodyContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterNormalBody) { + listener.enterNormalBody(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitNormalBody) { + listener.exitNormalBody(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitNormalBody) { + return visitor.visitNormalBody(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class StructuredBodyContext extends TemplateBodyContext { + public structuredTemplateBody(): StructuredTemplateBodyContext { + return this.getRuleContext(0, StructuredTemplateBodyContext); + } + constructor(ctx: TemplateBodyContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterStructuredBody) { + listener.enterStructuredBody(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitStructuredBody) { + listener.exitStructuredBody(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitStructuredBody) { + return visitor.visitStructuredBody(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class IfElseBodyContext extends TemplateBodyContext { + public ifElseTemplateBody(): IfElseTemplateBodyContext { + return this.getRuleContext(0, IfElseTemplateBodyContext); + } + constructor(ctx: TemplateBodyContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterIfElseBody) { + listener.enterIfElseBody(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitIfElseBody) { + listener.exitIfElseBody(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitIfElseBody) { + return visitor.visitIfElseBody(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class StructuredTemplateBodyContext extends ParserRuleContext { + public structuredBodyNameLine(): StructuredBodyNameLineContext { + return this.getRuleContext(0, StructuredBodyNameLineContext); + } + public structuredBodyEndLine(): StructuredBodyEndLineContext | undefined { + return this.tryGetRuleContext(0, StructuredBodyEndLineContext); + } + public structuredBodyContentLine(): StructuredBodyContentLineContext[]; + public structuredBodyContentLine(i: number): StructuredBodyContentLineContext; + public structuredBodyContentLine(i?: number): StructuredBodyContentLineContext | StructuredBodyContentLineContext[] { + if (i === undefined) { + return this.getRuleContexts(StructuredBodyContentLineContext); + } else { + return this.getRuleContext(i, StructuredBodyContentLineContext); + } + } + public STRUCTURED_NEWLINE(): TerminalNode[]; + public STRUCTURED_NEWLINE(i: number): TerminalNode; + public STRUCTURED_NEWLINE(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.STRUCTURED_NEWLINE); + } else { + return this.getToken(LGFileParser.STRUCTURED_NEWLINE, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_structuredTemplateBody; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterStructuredTemplateBody) { + listener.enterStructuredTemplateBody(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitStructuredTemplateBody) { + listener.exitStructuredTemplateBody(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitStructuredTemplateBody) { + return visitor.visitStructuredTemplateBody(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class StructuredBodyNameLineContext extends ParserRuleContext { + public LEFT_SQUARE_BRACKET(): TerminalNode { return this.getToken(LGFileParser.LEFT_SQUARE_BRACKET, 0); } + public STRUCTURE_NAME(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.STRUCTURE_NAME, 0); } + public errorStructuredName(): ErrorStructuredNameContext | undefined { + return this.tryGetRuleContext(0, ErrorStructuredNameContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_structuredBodyNameLine; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterStructuredBodyNameLine) { + listener.enterStructuredBodyNameLine(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitStructuredBodyNameLine) { + listener.exitStructuredBodyNameLine(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitStructuredBodyNameLine) { + return visitor.visitStructuredBodyNameLine(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ErrorStructuredNameContext extends ParserRuleContext { + public STRUCTURE_NAME(): TerminalNode[]; + public STRUCTURE_NAME(i: number): TerminalNode; + public STRUCTURE_NAME(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.STRUCTURE_NAME); + } else { + return this.getToken(LGFileParser.STRUCTURE_NAME, i); + } + } + public TEXT_IN_STRUCTURE_NAME(): TerminalNode[]; + public TEXT_IN_STRUCTURE_NAME(i: number): TerminalNode; + public TEXT_IN_STRUCTURE_NAME(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.TEXT_IN_STRUCTURE_NAME); + } else { + return this.getToken(LGFileParser.TEXT_IN_STRUCTURE_NAME, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_errorStructuredName; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterErrorStructuredName) { + listener.enterErrorStructuredName(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitErrorStructuredName) { + listener.exitErrorStructuredName(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitErrorStructuredName) { + return visitor.visitErrorStructuredName(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class StructuredBodyContentLineContext extends ParserRuleContext { + public keyValueStructureLine(): KeyValueStructureLineContext | undefined { + return this.tryGetRuleContext(0, KeyValueStructureLineContext); + } + public objectStructureLine(): ObjectStructureLineContext | undefined { + return this.tryGetRuleContext(0, ObjectStructureLineContext); + } + public errorStructureLine(): ErrorStructureLineContext | undefined { + return this.tryGetRuleContext(0, ErrorStructureLineContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_structuredBodyContentLine; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterStructuredBodyContentLine) { + listener.enterStructuredBodyContentLine(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitStructuredBodyContentLine) { + listener.exitStructuredBodyContentLine(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitStructuredBodyContentLine) { + return visitor.visitStructuredBodyContentLine(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ErrorStructureLineContext extends ParserRuleContext { + public STRUCTURE_IDENTIFIER(): TerminalNode[]; + public STRUCTURE_IDENTIFIER(i: number): TerminalNode; + public STRUCTURE_IDENTIFIER(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.STRUCTURE_IDENTIFIER); + } else { + return this.getToken(LGFileParser.STRUCTURE_IDENTIFIER, i); + } + } + public STRUCTURE_EQUALS(): TerminalNode[]; + public STRUCTURE_EQUALS(i: number): TerminalNode; + public STRUCTURE_EQUALS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.STRUCTURE_EQUALS); + } else { + return this.getToken(LGFileParser.STRUCTURE_EQUALS, i); + } + } + public STRUCTURE_OR_MARK(): TerminalNode[]; + public STRUCTURE_OR_MARK(i: number): TerminalNode; + public STRUCTURE_OR_MARK(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.STRUCTURE_OR_MARK); + } else { + return this.getToken(LGFileParser.STRUCTURE_OR_MARK, i); + } + } + public TEXT_IN_STRUCTURE_BODY(): TerminalNode[]; + public TEXT_IN_STRUCTURE_BODY(i: number): TerminalNode; + public TEXT_IN_STRUCTURE_BODY(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.TEXT_IN_STRUCTURE_BODY); + } else { + return this.getToken(LGFileParser.TEXT_IN_STRUCTURE_BODY, i); + } + } + public EXPRESSION_IN_STRUCTURE_BODY(): TerminalNode[]; + public EXPRESSION_IN_STRUCTURE_BODY(i: number): TerminalNode; + public EXPRESSION_IN_STRUCTURE_BODY(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.EXPRESSION_IN_STRUCTURE_BODY); + } else { + return this.getToken(LGFileParser.EXPRESSION_IN_STRUCTURE_BODY, i); + } + } + public ESCAPE_CHARACTER_IN_STRUCTURE_BODY(): TerminalNode[]; + public ESCAPE_CHARACTER_IN_STRUCTURE_BODY(i: number): TerminalNode; + public ESCAPE_CHARACTER_IN_STRUCTURE_BODY(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY); + } else { + return this.getToken(LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_errorStructureLine; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterErrorStructureLine) { + listener.enterErrorStructureLine(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitErrorStructureLine) { + listener.exitErrorStructureLine(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitErrorStructureLine) { + return visitor.visitErrorStructureLine(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class KeyValueStructureLineContext extends ParserRuleContext { + public STRUCTURE_IDENTIFIER(): TerminalNode { return this.getToken(LGFileParser.STRUCTURE_IDENTIFIER, 0); } + public STRUCTURE_EQUALS(): TerminalNode { return this.getToken(LGFileParser.STRUCTURE_EQUALS, 0); } + public keyValueStructureValue(): KeyValueStructureValueContext[]; + public keyValueStructureValue(i: number): KeyValueStructureValueContext; + public keyValueStructureValue(i?: number): KeyValueStructureValueContext | KeyValueStructureValueContext[] { + if (i === undefined) { + return this.getRuleContexts(KeyValueStructureValueContext); + } else { + return this.getRuleContext(i, KeyValueStructureValueContext); + } + } + public STRUCTURE_OR_MARK(): TerminalNode[]; + public STRUCTURE_OR_MARK(i: number): TerminalNode; + public STRUCTURE_OR_MARK(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.STRUCTURE_OR_MARK); + } else { + return this.getToken(LGFileParser.STRUCTURE_OR_MARK, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_keyValueStructureLine; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterKeyValueStructureLine) { + listener.enterKeyValueStructureLine(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitKeyValueStructureLine) { + listener.exitKeyValueStructureLine(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitKeyValueStructureLine) { + return visitor.visitKeyValueStructureLine(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class KeyValueStructureValueContext extends ParserRuleContext { + public TEXT_IN_STRUCTURE_BODY(): TerminalNode[]; + public TEXT_IN_STRUCTURE_BODY(i: number): TerminalNode; + public TEXT_IN_STRUCTURE_BODY(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.TEXT_IN_STRUCTURE_BODY); + } else { + return this.getToken(LGFileParser.TEXT_IN_STRUCTURE_BODY, i); + } + } + public EXPRESSION_IN_STRUCTURE_BODY(): TerminalNode[]; + public EXPRESSION_IN_STRUCTURE_BODY(i: number): TerminalNode; + public EXPRESSION_IN_STRUCTURE_BODY(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.EXPRESSION_IN_STRUCTURE_BODY); + } else { + return this.getToken(LGFileParser.EXPRESSION_IN_STRUCTURE_BODY, i); + } + } + public ESCAPE_CHARACTER_IN_STRUCTURE_BODY(): TerminalNode[]; + public ESCAPE_CHARACTER_IN_STRUCTURE_BODY(i: number): TerminalNode; + public ESCAPE_CHARACTER_IN_STRUCTURE_BODY(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY); + } else { + return this.getToken(LGFileParser.ESCAPE_CHARACTER_IN_STRUCTURE_BODY, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_keyValueStructureValue; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterKeyValueStructureValue) { + listener.enterKeyValueStructureValue(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitKeyValueStructureValue) { + listener.exitKeyValueStructureValue(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitKeyValueStructureValue) { + return visitor.visitKeyValueStructureValue(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ObjectStructureLineContext extends ParserRuleContext { + public EXPRESSION_IN_STRUCTURE_BODY(): TerminalNode { return this.getToken(LGFileParser.EXPRESSION_IN_STRUCTURE_BODY, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_objectStructureLine; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterObjectStructureLine) { + listener.enterObjectStructureLine(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitObjectStructureLine) { + listener.exitObjectStructureLine(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitObjectStructureLine) { + return visitor.visitObjectStructureLine(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class StructuredBodyEndLineContext extends ParserRuleContext { + public STRUCTURED_BODY_END(): TerminalNode { return this.getToken(LGFileParser.STRUCTURED_BODY_END, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_structuredBodyEndLine; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterStructuredBodyEndLine) { + listener.enterStructuredBodyEndLine(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitStructuredBodyEndLine) { + listener.exitStructuredBodyEndLine(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitStructuredBodyEndLine) { + return visitor.visitStructuredBodyEndLine(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class NormalTemplateBodyContext extends ParserRuleContext { + public templateString(): TemplateStringContext[]; + public templateString(i: number): TemplateStringContext; + public templateString(i?: number): TemplateStringContext | TemplateStringContext[] { + if (i === undefined) { + return this.getRuleContexts(TemplateStringContext); + } else { + return this.getRuleContext(i, TemplateStringContext); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_normalTemplateBody; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterNormalTemplateBody) { + listener.enterNormalTemplateBody(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitNormalTemplateBody) { + listener.exitNormalTemplateBody(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitNormalTemplateBody) { + return visitor.visitNormalTemplateBody(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class TemplateStringContext extends ParserRuleContext { + public normalTemplateString(): NormalTemplateStringContext | undefined { + return this.tryGetRuleContext(0, NormalTemplateStringContext); + } + public errorTemplateString(): ErrorTemplateStringContext | undefined { + return this.tryGetRuleContext(0, ErrorTemplateStringContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_templateString; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterTemplateString) { + listener.enterTemplateString(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitTemplateString) { + listener.exitTemplateString(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitTemplateString) { + return visitor.visitTemplateString(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class NormalTemplateStringContext extends ParserRuleContext { + public DASH(): TerminalNode { return this.getToken(LGFileParser.DASH, 0); } + public MULTILINE_PREFIX(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.MULTILINE_PREFIX, 0); } + public MULTILINE_SUFFIX(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.MULTILINE_SUFFIX, 0); } + public TEXT(): TerminalNode[]; + public TEXT(i: number): TerminalNode; + public TEXT(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.TEXT); + } else { + return this.getToken(LGFileParser.TEXT, i); + } + } + public EXPRESSION(): TerminalNode[]; + public EXPRESSION(i: number): TerminalNode; + public EXPRESSION(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.EXPRESSION); + } else { + return this.getToken(LGFileParser.EXPRESSION, i); + } + } + public ESCAPE_CHARACTER(): TerminalNode[]; + public ESCAPE_CHARACTER(i: number): TerminalNode; + public ESCAPE_CHARACTER(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.ESCAPE_CHARACTER); + } else { + return this.getToken(LGFileParser.ESCAPE_CHARACTER, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_normalTemplateString; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterNormalTemplateString) { + listener.enterNormalTemplateString(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitNormalTemplateString) { + listener.exitNormalTemplateString(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitNormalTemplateString) { + return visitor.visitNormalTemplateString(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ErrorTemplateStringContext extends ParserRuleContext { + public INVALID_TOKEN(): TerminalNode[]; + public INVALID_TOKEN(i: number): TerminalNode; + public INVALID_TOKEN(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.INVALID_TOKEN); + } else { + return this.getToken(LGFileParser.INVALID_TOKEN, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_errorTemplateString; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterErrorTemplateString) { + listener.enterErrorTemplateString(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitErrorTemplateString) { + listener.exitErrorTemplateString(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitErrorTemplateString) { + return visitor.visitErrorTemplateString(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class IfElseTemplateBodyContext extends ParserRuleContext { + public ifConditionRule(): IfConditionRuleContext[]; + public ifConditionRule(i: number): IfConditionRuleContext; + public ifConditionRule(i?: number): IfConditionRuleContext | IfConditionRuleContext[] { + if (i === undefined) { + return this.getRuleContexts(IfConditionRuleContext); + } else { + return this.getRuleContext(i, IfConditionRuleContext); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_ifElseTemplateBody; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterIfElseTemplateBody) { + listener.enterIfElseTemplateBody(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitIfElseTemplateBody) { + listener.exitIfElseTemplateBody(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitIfElseTemplateBody) { + return visitor.visitIfElseTemplateBody(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class IfConditionRuleContext extends ParserRuleContext { + public ifCondition(): IfConditionContext { + return this.getRuleContext(0, IfConditionContext); + } + public normalTemplateBody(): NormalTemplateBodyContext | undefined { + return this.tryGetRuleContext(0, NormalTemplateBodyContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_ifConditionRule; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterIfConditionRule) { + listener.enterIfConditionRule(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitIfConditionRule) { + listener.exitIfConditionRule(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitIfConditionRule) { + return visitor.visitIfConditionRule(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class IfConditionContext extends ParserRuleContext { + public DASH(): TerminalNode { return this.getToken(LGFileParser.DASH, 0); } + public IF(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.IF, 0); } + public ELSE(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.ELSE, 0); } + public ELSEIF(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.ELSEIF, 0); } + public WS(): TerminalNode[]; + public WS(i: number): TerminalNode; + public WS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.WS); + } else { + return this.getToken(LGFileParser.WS, i); + } + } + public TEXT(): TerminalNode[]; + public TEXT(i: number): TerminalNode; + public TEXT(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.TEXT); + } else { + return this.getToken(LGFileParser.TEXT, i); + } + } + public EXPRESSION(): TerminalNode[]; + public EXPRESSION(i: number): TerminalNode; + public EXPRESSION(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.EXPRESSION); + } else { + return this.getToken(LGFileParser.EXPRESSION, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_ifCondition; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterIfCondition) { + listener.enterIfCondition(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitIfCondition) { + listener.exitIfCondition(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitIfCondition) { + return visitor.visitIfCondition(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class SwitchCaseTemplateBodyContext extends ParserRuleContext { + public switchCaseRule(): SwitchCaseRuleContext[]; + public switchCaseRule(i: number): SwitchCaseRuleContext; + public switchCaseRule(i?: number): SwitchCaseRuleContext | SwitchCaseRuleContext[] { + if (i === undefined) { + return this.getRuleContexts(SwitchCaseRuleContext); + } else { + return this.getRuleContext(i, SwitchCaseRuleContext); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_switchCaseTemplateBody; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterSwitchCaseTemplateBody) { + listener.enterSwitchCaseTemplateBody(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitSwitchCaseTemplateBody) { + listener.exitSwitchCaseTemplateBody(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitSwitchCaseTemplateBody) { + return visitor.visitSwitchCaseTemplateBody(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class SwitchCaseRuleContext extends ParserRuleContext { + public switchCaseStat(): SwitchCaseStatContext { + return this.getRuleContext(0, SwitchCaseStatContext); + } + public normalTemplateBody(): NormalTemplateBodyContext | undefined { + return this.tryGetRuleContext(0, NormalTemplateBodyContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_switchCaseRule; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterSwitchCaseRule) { + listener.enterSwitchCaseRule(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitSwitchCaseRule) { + listener.exitSwitchCaseRule(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitSwitchCaseRule) { + return visitor.visitSwitchCaseRule(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class SwitchCaseStatContext extends ParserRuleContext { + public DASH(): TerminalNode { return this.getToken(LGFileParser.DASH, 0); } + public SWITCH(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.SWITCH, 0); } + public CASE(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.CASE, 0); } + public DEFAULT(): TerminalNode | undefined { return this.tryGetToken(LGFileParser.DEFAULT, 0); } + public WS(): TerminalNode[]; + public WS(i: number): TerminalNode; + public WS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.WS); + } else { + return this.getToken(LGFileParser.WS, i); + } + } + public TEXT(): TerminalNode[]; + public TEXT(i: number): TerminalNode; + public TEXT(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.TEXT); + } else { + return this.getToken(LGFileParser.TEXT, i); + } + } + public EXPRESSION(): TerminalNode[]; + public EXPRESSION(i: number): TerminalNode; + public EXPRESSION(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(LGFileParser.EXPRESSION); + } else { + return this.getToken(LGFileParser.EXPRESSION, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_switchCaseStat; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterSwitchCaseStat) { + listener.enterSwitchCaseStat(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitSwitchCaseStat) { + listener.exitSwitchCaseStat(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitSwitchCaseStat) { + return visitor.visitSwitchCaseStat(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ImportDefinitionContext extends ParserRuleContext { + public IMPORT(): TerminalNode { return this.getToken(LGFileParser.IMPORT, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return LGFileParser.RULE_importDefinition; } + // @Override + public enterRule(listener: LGFileParserListener): void { + if (listener.enterImportDefinition) { + listener.enterImportDefinition(this); + } + } + // @Override + public exitRule(listener: LGFileParserListener): void { + if (listener.exitImportDefinition) { + listener.exitImportDefinition(this); + } + } + // @Override + public accept(visitor: LGFileParserVisitor): Result { + if (visitor.visitImportDefinition) { + return visitor.visitImportDefinition(this); + } else { + return visitor.visitChildren(this); + } + } +} + + diff --git a/libraries/botbuilder-lg/src/generated/LGFileParserListener.ts b/libraries/botbuilder-lg/src/generated/LGFileParserListener.ts index 18808bb84f..a4bf324dc3 100644 --- a/libraries/botbuilder-lg/src/generated/LGFileParserListener.ts +++ b/libraries/botbuilder-lg/src/generated/LGFileParserListener.ts @@ -1,417 +1,417 @@ -// Generated from ../LGFileParser.g4 by ANTLR 4.6-SNAPSHOT - - -import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; - -import { SwitchCaseBodyContext } from "./LGFileParser"; -import { NormalBodyContext } from "./LGFileParser"; -import { StructuredBodyContext } from "./LGFileParser"; -import { IfElseBodyContext } from "./LGFileParser"; -import { FileContext } from "./LGFileParser"; -import { ParagraphContext } from "./LGFileParser"; -import { ErrorTemplateContext } from "./LGFileParser"; -import { TemplateDefinitionContext } from "./LGFileParser"; -import { TemplateNameLineContext } from "./LGFileParser"; -import { ErrorTemplateNameContext } from "./LGFileParser"; -import { TemplateNameContext } from "./LGFileParser"; -import { ParametersContext } from "./LGFileParser"; -import { TemplateBodyContext } from "./LGFileParser"; -import { StructuredTemplateBodyContext } from "./LGFileParser"; -import { StructuredBodyNameLineContext } from "./LGFileParser"; -import { ErrorStructuredNameContext } from "./LGFileParser"; -import { StructuredBodyContentLineContext } from "./LGFileParser"; -import { ErrorStructureLineContext } from "./LGFileParser"; -import { KeyValueStructureLineContext } from "./LGFileParser"; -import { KeyValueStructureValueContext } from "./LGFileParser"; -import { ObjectStructureLineContext } from "./LGFileParser"; -import { StructuredBodyEndLineContext } from "./LGFileParser"; -import { NormalTemplateBodyContext } from "./LGFileParser"; -import { TemplateStringContext } from "./LGFileParser"; -import { NormalTemplateStringContext } from "./LGFileParser"; -import { ErrorTemplateStringContext } from "./LGFileParser"; -import { IfElseTemplateBodyContext } from "./LGFileParser"; -import { IfConditionRuleContext } from "./LGFileParser"; -import { IfConditionContext } from "./LGFileParser"; -import { SwitchCaseTemplateBodyContext } from "./LGFileParser"; -import { SwitchCaseRuleContext } from "./LGFileParser"; -import { SwitchCaseStatContext } from "./LGFileParser"; -import { ImportDefinitionContext } from "./LGFileParser"; - - -/** - * This interface defines a complete listener for a parse tree produced by - * `LGFileParser`. - */ -export interface LGFileParserListener extends ParseTreeListener { - /** - * Enter a parse tree produced by the `switchCaseBody` - * labeled alternative in `LGFileParser.templateBody`. - * @param ctx the parse tree - */ - enterSwitchCaseBody?: (ctx: SwitchCaseBodyContext) => void; - /** - * Exit a parse tree produced by the `switchCaseBody` - * labeled alternative in `LGFileParser.templateBody`. - * @param ctx the parse tree - */ - exitSwitchCaseBody?: (ctx: SwitchCaseBodyContext) => void; - - /** - * Enter a parse tree produced by the `normalBody` - * labeled alternative in `LGFileParser.templateBody`. - * @param ctx the parse tree - */ - enterNormalBody?: (ctx: NormalBodyContext) => void; - /** - * Exit a parse tree produced by the `normalBody` - * labeled alternative in `LGFileParser.templateBody`. - * @param ctx the parse tree - */ - exitNormalBody?: (ctx: NormalBodyContext) => void; - - /** - * Enter a parse tree produced by the `structuredBody` - * labeled alternative in `LGFileParser.templateBody`. - * @param ctx the parse tree - */ - enterStructuredBody?: (ctx: StructuredBodyContext) => void; - /** - * Exit a parse tree produced by the `structuredBody` - * labeled alternative in `LGFileParser.templateBody`. - * @param ctx the parse tree - */ - exitStructuredBody?: (ctx: StructuredBodyContext) => void; - - /** - * Enter a parse tree produced by the `ifElseBody` - * labeled alternative in `LGFileParser.templateBody`. - * @param ctx the parse tree - */ - enterIfElseBody?: (ctx: IfElseBodyContext) => void; - /** - * Exit a parse tree produced by the `ifElseBody` - * labeled alternative in `LGFileParser.templateBody`. - * @param ctx the parse tree - */ - exitIfElseBody?: (ctx: IfElseBodyContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.file`. - * @param ctx the parse tree - */ - enterFile?: (ctx: FileContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.file`. - * @param ctx the parse tree - */ - exitFile?: (ctx: FileContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.paragraph`. - * @param ctx the parse tree - */ - enterParagraph?: (ctx: ParagraphContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.paragraph`. - * @param ctx the parse tree - */ - exitParagraph?: (ctx: ParagraphContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.errorTemplate`. - * @param ctx the parse tree - */ - enterErrorTemplate?: (ctx: ErrorTemplateContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.errorTemplate`. - * @param ctx the parse tree - */ - exitErrorTemplate?: (ctx: ErrorTemplateContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.templateDefinition`. - * @param ctx the parse tree - */ - enterTemplateDefinition?: (ctx: TemplateDefinitionContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.templateDefinition`. - * @param ctx the parse tree - */ - exitTemplateDefinition?: (ctx: TemplateDefinitionContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.templateNameLine`. - * @param ctx the parse tree - */ - enterTemplateNameLine?: (ctx: TemplateNameLineContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.templateNameLine`. - * @param ctx the parse tree - */ - exitTemplateNameLine?: (ctx: TemplateNameLineContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.errorTemplateName`. - * @param ctx the parse tree - */ - enterErrorTemplateName?: (ctx: ErrorTemplateNameContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.errorTemplateName`. - * @param ctx the parse tree - */ - exitErrorTemplateName?: (ctx: ErrorTemplateNameContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.templateName`. - * @param ctx the parse tree - */ - enterTemplateName?: (ctx: TemplateNameContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.templateName`. - * @param ctx the parse tree - */ - exitTemplateName?: (ctx: TemplateNameContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.parameters`. - * @param ctx the parse tree - */ - enterParameters?: (ctx: ParametersContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.parameters`. - * @param ctx the parse tree - */ - exitParameters?: (ctx: ParametersContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.templateBody`. - * @param ctx the parse tree - */ - enterTemplateBody?: (ctx: TemplateBodyContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.templateBody`. - * @param ctx the parse tree - */ - exitTemplateBody?: (ctx: TemplateBodyContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.structuredTemplateBody`. - * @param ctx the parse tree - */ - enterStructuredTemplateBody?: (ctx: StructuredTemplateBodyContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.structuredTemplateBody`. - * @param ctx the parse tree - */ - exitStructuredTemplateBody?: (ctx: StructuredTemplateBodyContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.structuredBodyNameLine`. - * @param ctx the parse tree - */ - enterStructuredBodyNameLine?: (ctx: StructuredBodyNameLineContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.structuredBodyNameLine`. - * @param ctx the parse tree - */ - exitStructuredBodyNameLine?: (ctx: StructuredBodyNameLineContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.errorStructuredName`. - * @param ctx the parse tree - */ - enterErrorStructuredName?: (ctx: ErrorStructuredNameContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.errorStructuredName`. - * @param ctx the parse tree - */ - exitErrorStructuredName?: (ctx: ErrorStructuredNameContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.structuredBodyContentLine`. - * @param ctx the parse tree - */ - enterStructuredBodyContentLine?: (ctx: StructuredBodyContentLineContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.structuredBodyContentLine`. - * @param ctx the parse tree - */ - exitStructuredBodyContentLine?: (ctx: StructuredBodyContentLineContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.errorStructureLine`. - * @param ctx the parse tree - */ - enterErrorStructureLine?: (ctx: ErrorStructureLineContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.errorStructureLine`. - * @param ctx the parse tree - */ - exitErrorStructureLine?: (ctx: ErrorStructureLineContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.keyValueStructureLine`. - * @param ctx the parse tree - */ - enterKeyValueStructureLine?: (ctx: KeyValueStructureLineContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.keyValueStructureLine`. - * @param ctx the parse tree - */ - exitKeyValueStructureLine?: (ctx: KeyValueStructureLineContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.keyValueStructureValue`. - * @param ctx the parse tree - */ - enterKeyValueStructureValue?: (ctx: KeyValueStructureValueContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.keyValueStructureValue`. - * @param ctx the parse tree - */ - exitKeyValueStructureValue?: (ctx: KeyValueStructureValueContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.objectStructureLine`. - * @param ctx the parse tree - */ - enterObjectStructureLine?: (ctx: ObjectStructureLineContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.objectStructureLine`. - * @param ctx the parse tree - */ - exitObjectStructureLine?: (ctx: ObjectStructureLineContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.structuredBodyEndLine`. - * @param ctx the parse tree - */ - enterStructuredBodyEndLine?: (ctx: StructuredBodyEndLineContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.structuredBodyEndLine`. - * @param ctx the parse tree - */ - exitStructuredBodyEndLine?: (ctx: StructuredBodyEndLineContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.normalTemplateBody`. - * @param ctx the parse tree - */ - enterNormalTemplateBody?: (ctx: NormalTemplateBodyContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.normalTemplateBody`. - * @param ctx the parse tree - */ - exitNormalTemplateBody?: (ctx: NormalTemplateBodyContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.templateString`. - * @param ctx the parse tree - */ - enterTemplateString?: (ctx: TemplateStringContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.templateString`. - * @param ctx the parse tree - */ - exitTemplateString?: (ctx: TemplateStringContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.normalTemplateString`. - * @param ctx the parse tree - */ - enterNormalTemplateString?: (ctx: NormalTemplateStringContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.normalTemplateString`. - * @param ctx the parse tree - */ - exitNormalTemplateString?: (ctx: NormalTemplateStringContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.errorTemplateString`. - * @param ctx the parse tree - */ - enterErrorTemplateString?: (ctx: ErrorTemplateStringContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.errorTemplateString`. - * @param ctx the parse tree - */ - exitErrorTemplateString?: (ctx: ErrorTemplateStringContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.ifElseTemplateBody`. - * @param ctx the parse tree - */ - enterIfElseTemplateBody?: (ctx: IfElseTemplateBodyContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.ifElseTemplateBody`. - * @param ctx the parse tree - */ - exitIfElseTemplateBody?: (ctx: IfElseTemplateBodyContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.ifConditionRule`. - * @param ctx the parse tree - */ - enterIfConditionRule?: (ctx: IfConditionRuleContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.ifConditionRule`. - * @param ctx the parse tree - */ - exitIfConditionRule?: (ctx: IfConditionRuleContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.ifCondition`. - * @param ctx the parse tree - */ - enterIfCondition?: (ctx: IfConditionContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.ifCondition`. - * @param ctx the parse tree - */ - exitIfCondition?: (ctx: IfConditionContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.switchCaseTemplateBody`. - * @param ctx the parse tree - */ - enterSwitchCaseTemplateBody?: (ctx: SwitchCaseTemplateBodyContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.switchCaseTemplateBody`. - * @param ctx the parse tree - */ - exitSwitchCaseTemplateBody?: (ctx: SwitchCaseTemplateBodyContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.switchCaseRule`. - * @param ctx the parse tree - */ - enterSwitchCaseRule?: (ctx: SwitchCaseRuleContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.switchCaseRule`. - * @param ctx the parse tree - */ - exitSwitchCaseRule?: (ctx: SwitchCaseRuleContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.switchCaseStat`. - * @param ctx the parse tree - */ - enterSwitchCaseStat?: (ctx: SwitchCaseStatContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.switchCaseStat`. - * @param ctx the parse tree - */ - exitSwitchCaseStat?: (ctx: SwitchCaseStatContext) => void; - - /** - * Enter a parse tree produced by `LGFileParser.importDefinition`. - * @param ctx the parse tree - */ - enterImportDefinition?: (ctx: ImportDefinitionContext) => void; - /** - * Exit a parse tree produced by `LGFileParser.importDefinition`. - * @param ctx the parse tree - */ - exitImportDefinition?: (ctx: ImportDefinitionContext) => void; -} - +// Generated from ../LGFileParser.g4 by ANTLR 4.6-SNAPSHOT + + +import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; + +import { SwitchCaseBodyContext } from "./LGFileParser"; +import { NormalBodyContext } from "./LGFileParser"; +import { StructuredBodyContext } from "./LGFileParser"; +import { IfElseBodyContext } from "./LGFileParser"; +import { FileContext } from "./LGFileParser"; +import { ParagraphContext } from "./LGFileParser"; +import { ErrorTemplateContext } from "./LGFileParser"; +import { TemplateDefinitionContext } from "./LGFileParser"; +import { TemplateNameLineContext } from "./LGFileParser"; +import { ErrorTemplateNameContext } from "./LGFileParser"; +import { TemplateNameContext } from "./LGFileParser"; +import { ParametersContext } from "./LGFileParser"; +import { TemplateBodyContext } from "./LGFileParser"; +import { StructuredTemplateBodyContext } from "./LGFileParser"; +import { StructuredBodyNameLineContext } from "./LGFileParser"; +import { ErrorStructuredNameContext } from "./LGFileParser"; +import { StructuredBodyContentLineContext } from "./LGFileParser"; +import { ErrorStructureLineContext } from "./LGFileParser"; +import { KeyValueStructureLineContext } from "./LGFileParser"; +import { KeyValueStructureValueContext } from "./LGFileParser"; +import { ObjectStructureLineContext } from "./LGFileParser"; +import { StructuredBodyEndLineContext } from "./LGFileParser"; +import { NormalTemplateBodyContext } from "./LGFileParser"; +import { TemplateStringContext } from "./LGFileParser"; +import { NormalTemplateStringContext } from "./LGFileParser"; +import { ErrorTemplateStringContext } from "./LGFileParser"; +import { IfElseTemplateBodyContext } from "./LGFileParser"; +import { IfConditionRuleContext } from "./LGFileParser"; +import { IfConditionContext } from "./LGFileParser"; +import { SwitchCaseTemplateBodyContext } from "./LGFileParser"; +import { SwitchCaseRuleContext } from "./LGFileParser"; +import { SwitchCaseStatContext } from "./LGFileParser"; +import { ImportDefinitionContext } from "./LGFileParser"; + + +/** + * This interface defines a complete listener for a parse tree produced by + * `LGFileParser`. + */ +export interface LGFileParserListener extends ParseTreeListener { + /** + * Enter a parse tree produced by the `switchCaseBody` + * labeled alternative in `LGFileParser.templateBody`. + * @param ctx the parse tree + */ + enterSwitchCaseBody?: (ctx: SwitchCaseBodyContext) => void; + /** + * Exit a parse tree produced by the `switchCaseBody` + * labeled alternative in `LGFileParser.templateBody`. + * @param ctx the parse tree + */ + exitSwitchCaseBody?: (ctx: SwitchCaseBodyContext) => void; + + /** + * Enter a parse tree produced by the `normalBody` + * labeled alternative in `LGFileParser.templateBody`. + * @param ctx the parse tree + */ + enterNormalBody?: (ctx: NormalBodyContext) => void; + /** + * Exit a parse tree produced by the `normalBody` + * labeled alternative in `LGFileParser.templateBody`. + * @param ctx the parse tree + */ + exitNormalBody?: (ctx: NormalBodyContext) => void; + + /** + * Enter a parse tree produced by the `structuredBody` + * labeled alternative in `LGFileParser.templateBody`. + * @param ctx the parse tree + */ + enterStructuredBody?: (ctx: StructuredBodyContext) => void; + /** + * Exit a parse tree produced by the `structuredBody` + * labeled alternative in `LGFileParser.templateBody`. + * @param ctx the parse tree + */ + exitStructuredBody?: (ctx: StructuredBodyContext) => void; + + /** + * Enter a parse tree produced by the `ifElseBody` + * labeled alternative in `LGFileParser.templateBody`. + * @param ctx the parse tree + */ + enterIfElseBody?: (ctx: IfElseBodyContext) => void; + /** + * Exit a parse tree produced by the `ifElseBody` + * labeled alternative in `LGFileParser.templateBody`. + * @param ctx the parse tree + */ + exitIfElseBody?: (ctx: IfElseBodyContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.file`. + * @param ctx the parse tree + */ + enterFile?: (ctx: FileContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.file`. + * @param ctx the parse tree + */ + exitFile?: (ctx: FileContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.paragraph`. + * @param ctx the parse tree + */ + enterParagraph?: (ctx: ParagraphContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.paragraph`. + * @param ctx the parse tree + */ + exitParagraph?: (ctx: ParagraphContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.errorTemplate`. + * @param ctx the parse tree + */ + enterErrorTemplate?: (ctx: ErrorTemplateContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.errorTemplate`. + * @param ctx the parse tree + */ + exitErrorTemplate?: (ctx: ErrorTemplateContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.templateDefinition`. + * @param ctx the parse tree + */ + enterTemplateDefinition?: (ctx: TemplateDefinitionContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.templateDefinition`. + * @param ctx the parse tree + */ + exitTemplateDefinition?: (ctx: TemplateDefinitionContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.templateNameLine`. + * @param ctx the parse tree + */ + enterTemplateNameLine?: (ctx: TemplateNameLineContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.templateNameLine`. + * @param ctx the parse tree + */ + exitTemplateNameLine?: (ctx: TemplateNameLineContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.errorTemplateName`. + * @param ctx the parse tree + */ + enterErrorTemplateName?: (ctx: ErrorTemplateNameContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.errorTemplateName`. + * @param ctx the parse tree + */ + exitErrorTemplateName?: (ctx: ErrorTemplateNameContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.templateName`. + * @param ctx the parse tree + */ + enterTemplateName?: (ctx: TemplateNameContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.templateName`. + * @param ctx the parse tree + */ + exitTemplateName?: (ctx: TemplateNameContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.parameters`. + * @param ctx the parse tree + */ + enterParameters?: (ctx: ParametersContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.parameters`. + * @param ctx the parse tree + */ + exitParameters?: (ctx: ParametersContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.templateBody`. + * @param ctx the parse tree + */ + enterTemplateBody?: (ctx: TemplateBodyContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.templateBody`. + * @param ctx the parse tree + */ + exitTemplateBody?: (ctx: TemplateBodyContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.structuredTemplateBody`. + * @param ctx the parse tree + */ + enterStructuredTemplateBody?: (ctx: StructuredTemplateBodyContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.structuredTemplateBody`. + * @param ctx the parse tree + */ + exitStructuredTemplateBody?: (ctx: StructuredTemplateBodyContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.structuredBodyNameLine`. + * @param ctx the parse tree + */ + enterStructuredBodyNameLine?: (ctx: StructuredBodyNameLineContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.structuredBodyNameLine`. + * @param ctx the parse tree + */ + exitStructuredBodyNameLine?: (ctx: StructuredBodyNameLineContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.errorStructuredName`. + * @param ctx the parse tree + */ + enterErrorStructuredName?: (ctx: ErrorStructuredNameContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.errorStructuredName`. + * @param ctx the parse tree + */ + exitErrorStructuredName?: (ctx: ErrorStructuredNameContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.structuredBodyContentLine`. + * @param ctx the parse tree + */ + enterStructuredBodyContentLine?: (ctx: StructuredBodyContentLineContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.structuredBodyContentLine`. + * @param ctx the parse tree + */ + exitStructuredBodyContentLine?: (ctx: StructuredBodyContentLineContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.errorStructureLine`. + * @param ctx the parse tree + */ + enterErrorStructureLine?: (ctx: ErrorStructureLineContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.errorStructureLine`. + * @param ctx the parse tree + */ + exitErrorStructureLine?: (ctx: ErrorStructureLineContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.keyValueStructureLine`. + * @param ctx the parse tree + */ + enterKeyValueStructureLine?: (ctx: KeyValueStructureLineContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.keyValueStructureLine`. + * @param ctx the parse tree + */ + exitKeyValueStructureLine?: (ctx: KeyValueStructureLineContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.keyValueStructureValue`. + * @param ctx the parse tree + */ + enterKeyValueStructureValue?: (ctx: KeyValueStructureValueContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.keyValueStructureValue`. + * @param ctx the parse tree + */ + exitKeyValueStructureValue?: (ctx: KeyValueStructureValueContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.objectStructureLine`. + * @param ctx the parse tree + */ + enterObjectStructureLine?: (ctx: ObjectStructureLineContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.objectStructureLine`. + * @param ctx the parse tree + */ + exitObjectStructureLine?: (ctx: ObjectStructureLineContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.structuredBodyEndLine`. + * @param ctx the parse tree + */ + enterStructuredBodyEndLine?: (ctx: StructuredBodyEndLineContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.structuredBodyEndLine`. + * @param ctx the parse tree + */ + exitStructuredBodyEndLine?: (ctx: StructuredBodyEndLineContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.normalTemplateBody`. + * @param ctx the parse tree + */ + enterNormalTemplateBody?: (ctx: NormalTemplateBodyContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.normalTemplateBody`. + * @param ctx the parse tree + */ + exitNormalTemplateBody?: (ctx: NormalTemplateBodyContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.templateString`. + * @param ctx the parse tree + */ + enterTemplateString?: (ctx: TemplateStringContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.templateString`. + * @param ctx the parse tree + */ + exitTemplateString?: (ctx: TemplateStringContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.normalTemplateString`. + * @param ctx the parse tree + */ + enterNormalTemplateString?: (ctx: NormalTemplateStringContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.normalTemplateString`. + * @param ctx the parse tree + */ + exitNormalTemplateString?: (ctx: NormalTemplateStringContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.errorTemplateString`. + * @param ctx the parse tree + */ + enterErrorTemplateString?: (ctx: ErrorTemplateStringContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.errorTemplateString`. + * @param ctx the parse tree + */ + exitErrorTemplateString?: (ctx: ErrorTemplateStringContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.ifElseTemplateBody`. + * @param ctx the parse tree + */ + enterIfElseTemplateBody?: (ctx: IfElseTemplateBodyContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.ifElseTemplateBody`. + * @param ctx the parse tree + */ + exitIfElseTemplateBody?: (ctx: IfElseTemplateBodyContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.ifConditionRule`. + * @param ctx the parse tree + */ + enterIfConditionRule?: (ctx: IfConditionRuleContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.ifConditionRule`. + * @param ctx the parse tree + */ + exitIfConditionRule?: (ctx: IfConditionRuleContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.ifCondition`. + * @param ctx the parse tree + */ + enterIfCondition?: (ctx: IfConditionContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.ifCondition`. + * @param ctx the parse tree + */ + exitIfCondition?: (ctx: IfConditionContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.switchCaseTemplateBody`. + * @param ctx the parse tree + */ + enterSwitchCaseTemplateBody?: (ctx: SwitchCaseTemplateBodyContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.switchCaseTemplateBody`. + * @param ctx the parse tree + */ + exitSwitchCaseTemplateBody?: (ctx: SwitchCaseTemplateBodyContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.switchCaseRule`. + * @param ctx the parse tree + */ + enterSwitchCaseRule?: (ctx: SwitchCaseRuleContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.switchCaseRule`. + * @param ctx the parse tree + */ + exitSwitchCaseRule?: (ctx: SwitchCaseRuleContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.switchCaseStat`. + * @param ctx the parse tree + */ + enterSwitchCaseStat?: (ctx: SwitchCaseStatContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.switchCaseStat`. + * @param ctx the parse tree + */ + exitSwitchCaseStat?: (ctx: SwitchCaseStatContext) => void; + + /** + * Enter a parse tree produced by `LGFileParser.importDefinition`. + * @param ctx the parse tree + */ + enterImportDefinition?: (ctx: ImportDefinitionContext) => void; + /** + * Exit a parse tree produced by `LGFileParser.importDefinition`. + * @param ctx the parse tree + */ + exitImportDefinition?: (ctx: ImportDefinitionContext) => void; +} + diff --git a/libraries/botbuilder-lg/src/generated/LGFileParserVisitor.ts b/libraries/botbuilder-lg/src/generated/LGFileParserVisitor.ts index fb310b3d8b..b469198cdf 100644 --- a/libraries/botbuilder-lg/src/generated/LGFileParserVisitor.ts +++ b/libraries/botbuilder-lg/src/generated/LGFileParserVisitor.ts @@ -1,284 +1,284 @@ -// Generated from ../LGFileParser.g4 by ANTLR 4.6-SNAPSHOT - - -import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; - -import { SwitchCaseBodyContext } from "./LGFileParser"; -import { NormalBodyContext } from "./LGFileParser"; -import { StructuredBodyContext } from "./LGFileParser"; -import { IfElseBodyContext } from "./LGFileParser"; -import { FileContext } from "./LGFileParser"; -import { ParagraphContext } from "./LGFileParser"; -import { ErrorTemplateContext } from "./LGFileParser"; -import { TemplateDefinitionContext } from "./LGFileParser"; -import { TemplateNameLineContext } from "./LGFileParser"; -import { ErrorTemplateNameContext } from "./LGFileParser"; -import { TemplateNameContext } from "./LGFileParser"; -import { ParametersContext } from "./LGFileParser"; -import { TemplateBodyContext } from "./LGFileParser"; -import { StructuredTemplateBodyContext } from "./LGFileParser"; -import { StructuredBodyNameLineContext } from "./LGFileParser"; -import { ErrorStructuredNameContext } from "./LGFileParser"; -import { StructuredBodyContentLineContext } from "./LGFileParser"; -import { ErrorStructureLineContext } from "./LGFileParser"; -import { KeyValueStructureLineContext } from "./LGFileParser"; -import { KeyValueStructureValueContext } from "./LGFileParser"; -import { ObjectStructureLineContext } from "./LGFileParser"; -import { StructuredBodyEndLineContext } from "./LGFileParser"; -import { NormalTemplateBodyContext } from "./LGFileParser"; -import { TemplateStringContext } from "./LGFileParser"; -import { NormalTemplateStringContext } from "./LGFileParser"; -import { ErrorTemplateStringContext } from "./LGFileParser"; -import { IfElseTemplateBodyContext } from "./LGFileParser"; -import { IfConditionRuleContext } from "./LGFileParser"; -import { IfConditionContext } from "./LGFileParser"; -import { SwitchCaseTemplateBodyContext } from "./LGFileParser"; -import { SwitchCaseRuleContext } from "./LGFileParser"; -import { SwitchCaseStatContext } from "./LGFileParser"; -import { ImportDefinitionContext } from "./LGFileParser"; - - -/** - * This interface defines a complete generic visitor for a parse tree produced - * by `LGFileParser`. - * - * @param The return type of the visit operation. Use `void` for - * operations with no return type. - */ -export interface LGFileParserVisitor extends ParseTreeVisitor { - /** - * Visit a parse tree produced by the `switchCaseBody` - * labeled alternative in `LGFileParser.templateBody`. - * @param ctx the parse tree - * @return the visitor result - */ - visitSwitchCaseBody?: (ctx: SwitchCaseBodyContext) => Result; - - /** - * Visit a parse tree produced by the `normalBody` - * labeled alternative in `LGFileParser.templateBody`. - * @param ctx the parse tree - * @return the visitor result - */ - visitNormalBody?: (ctx: NormalBodyContext) => Result; - - /** - * Visit a parse tree produced by the `structuredBody` - * labeled alternative in `LGFileParser.templateBody`. - * @param ctx the parse tree - * @return the visitor result - */ - visitStructuredBody?: (ctx: StructuredBodyContext) => Result; - - /** - * Visit a parse tree produced by the `ifElseBody` - * labeled alternative in `LGFileParser.templateBody`. - * @param ctx the parse tree - * @return the visitor result - */ - visitIfElseBody?: (ctx: IfElseBodyContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.file`. - * @param ctx the parse tree - * @return the visitor result - */ - visitFile?: (ctx: FileContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.paragraph`. - * @param ctx the parse tree - * @return the visitor result - */ - visitParagraph?: (ctx: ParagraphContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.errorTemplate`. - * @param ctx the parse tree - * @return the visitor result - */ - visitErrorTemplate?: (ctx: ErrorTemplateContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.templateDefinition`. - * @param ctx the parse tree - * @return the visitor result - */ - visitTemplateDefinition?: (ctx: TemplateDefinitionContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.templateNameLine`. - * @param ctx the parse tree - * @return the visitor result - */ - visitTemplateNameLine?: (ctx: TemplateNameLineContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.errorTemplateName`. - * @param ctx the parse tree - * @return the visitor result - */ - visitErrorTemplateName?: (ctx: ErrorTemplateNameContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.templateName`. - * @param ctx the parse tree - * @return the visitor result - */ - visitTemplateName?: (ctx: TemplateNameContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.parameters`. - * @param ctx the parse tree - * @return the visitor result - */ - visitParameters?: (ctx: ParametersContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.templateBody`. - * @param ctx the parse tree - * @return the visitor result - */ - visitTemplateBody?: (ctx: TemplateBodyContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.structuredTemplateBody`. - * @param ctx the parse tree - * @return the visitor result - */ - visitStructuredTemplateBody?: (ctx: StructuredTemplateBodyContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.structuredBodyNameLine`. - * @param ctx the parse tree - * @return the visitor result - */ - visitStructuredBodyNameLine?: (ctx: StructuredBodyNameLineContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.errorStructuredName`. - * @param ctx the parse tree - * @return the visitor result - */ - visitErrorStructuredName?: (ctx: ErrorStructuredNameContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.structuredBodyContentLine`. - * @param ctx the parse tree - * @return the visitor result - */ - visitStructuredBodyContentLine?: (ctx: StructuredBodyContentLineContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.errorStructureLine`. - * @param ctx the parse tree - * @return the visitor result - */ - visitErrorStructureLine?: (ctx: ErrorStructureLineContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.keyValueStructureLine`. - * @param ctx the parse tree - * @return the visitor result - */ - visitKeyValueStructureLine?: (ctx: KeyValueStructureLineContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.keyValueStructureValue`. - * @param ctx the parse tree - * @return the visitor result - */ - visitKeyValueStructureValue?: (ctx: KeyValueStructureValueContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.objectStructureLine`. - * @param ctx the parse tree - * @return the visitor result - */ - visitObjectStructureLine?: (ctx: ObjectStructureLineContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.structuredBodyEndLine`. - * @param ctx the parse tree - * @return the visitor result - */ - visitStructuredBodyEndLine?: (ctx: StructuredBodyEndLineContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.normalTemplateBody`. - * @param ctx the parse tree - * @return the visitor result - */ - visitNormalTemplateBody?: (ctx: NormalTemplateBodyContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.templateString`. - * @param ctx the parse tree - * @return the visitor result - */ - visitTemplateString?: (ctx: TemplateStringContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.normalTemplateString`. - * @param ctx the parse tree - * @return the visitor result - */ - visitNormalTemplateString?: (ctx: NormalTemplateStringContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.errorTemplateString`. - * @param ctx the parse tree - * @return the visitor result - */ - visitErrorTemplateString?: (ctx: ErrorTemplateStringContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.ifElseTemplateBody`. - * @param ctx the parse tree - * @return the visitor result - */ - visitIfElseTemplateBody?: (ctx: IfElseTemplateBodyContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.ifConditionRule`. - * @param ctx the parse tree - * @return the visitor result - */ - visitIfConditionRule?: (ctx: IfConditionRuleContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.ifCondition`. - * @param ctx the parse tree - * @return the visitor result - */ - visitIfCondition?: (ctx: IfConditionContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.switchCaseTemplateBody`. - * @param ctx the parse tree - * @return the visitor result - */ - visitSwitchCaseTemplateBody?: (ctx: SwitchCaseTemplateBodyContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.switchCaseRule`. - * @param ctx the parse tree - * @return the visitor result - */ - visitSwitchCaseRule?: (ctx: SwitchCaseRuleContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.switchCaseStat`. - * @param ctx the parse tree - * @return the visitor result - */ - visitSwitchCaseStat?: (ctx: SwitchCaseStatContext) => Result; - - /** - * Visit a parse tree produced by `LGFileParser.importDefinition`. - * @param ctx the parse tree - * @return the visitor result - */ - visitImportDefinition?: (ctx: ImportDefinitionContext) => Result; -} - +// Generated from ../LGFileParser.g4 by ANTLR 4.6-SNAPSHOT + + +import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; + +import { SwitchCaseBodyContext } from "./LGFileParser"; +import { NormalBodyContext } from "./LGFileParser"; +import { StructuredBodyContext } from "./LGFileParser"; +import { IfElseBodyContext } from "./LGFileParser"; +import { FileContext } from "./LGFileParser"; +import { ParagraphContext } from "./LGFileParser"; +import { ErrorTemplateContext } from "./LGFileParser"; +import { TemplateDefinitionContext } from "./LGFileParser"; +import { TemplateNameLineContext } from "./LGFileParser"; +import { ErrorTemplateNameContext } from "./LGFileParser"; +import { TemplateNameContext } from "./LGFileParser"; +import { ParametersContext } from "./LGFileParser"; +import { TemplateBodyContext } from "./LGFileParser"; +import { StructuredTemplateBodyContext } from "./LGFileParser"; +import { StructuredBodyNameLineContext } from "./LGFileParser"; +import { ErrorStructuredNameContext } from "./LGFileParser"; +import { StructuredBodyContentLineContext } from "./LGFileParser"; +import { ErrorStructureLineContext } from "./LGFileParser"; +import { KeyValueStructureLineContext } from "./LGFileParser"; +import { KeyValueStructureValueContext } from "./LGFileParser"; +import { ObjectStructureLineContext } from "./LGFileParser"; +import { StructuredBodyEndLineContext } from "./LGFileParser"; +import { NormalTemplateBodyContext } from "./LGFileParser"; +import { TemplateStringContext } from "./LGFileParser"; +import { NormalTemplateStringContext } from "./LGFileParser"; +import { ErrorTemplateStringContext } from "./LGFileParser"; +import { IfElseTemplateBodyContext } from "./LGFileParser"; +import { IfConditionRuleContext } from "./LGFileParser"; +import { IfConditionContext } from "./LGFileParser"; +import { SwitchCaseTemplateBodyContext } from "./LGFileParser"; +import { SwitchCaseRuleContext } from "./LGFileParser"; +import { SwitchCaseStatContext } from "./LGFileParser"; +import { ImportDefinitionContext } from "./LGFileParser"; + + +/** + * This interface defines a complete generic visitor for a parse tree produced + * by `LGFileParser`. + * + * @param The return type of the visit operation. Use `void` for + * operations with no return type. + */ +export interface LGFileParserVisitor extends ParseTreeVisitor { + /** + * Visit a parse tree produced by the `switchCaseBody` + * labeled alternative in `LGFileParser.templateBody`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSwitchCaseBody?: (ctx: SwitchCaseBodyContext) => Result; + + /** + * Visit a parse tree produced by the `normalBody` + * labeled alternative in `LGFileParser.templateBody`. + * @param ctx the parse tree + * @return the visitor result + */ + visitNormalBody?: (ctx: NormalBodyContext) => Result; + + /** + * Visit a parse tree produced by the `structuredBody` + * labeled alternative in `LGFileParser.templateBody`. + * @param ctx the parse tree + * @return the visitor result + */ + visitStructuredBody?: (ctx: StructuredBodyContext) => Result; + + /** + * Visit a parse tree produced by the `ifElseBody` + * labeled alternative in `LGFileParser.templateBody`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIfElseBody?: (ctx: IfElseBodyContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.file`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFile?: (ctx: FileContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.paragraph`. + * @param ctx the parse tree + * @return the visitor result + */ + visitParagraph?: (ctx: ParagraphContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.errorTemplate`. + * @param ctx the parse tree + * @return the visitor result + */ + visitErrorTemplate?: (ctx: ErrorTemplateContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.templateDefinition`. + * @param ctx the parse tree + * @return the visitor result + */ + visitTemplateDefinition?: (ctx: TemplateDefinitionContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.templateNameLine`. + * @param ctx the parse tree + * @return the visitor result + */ + visitTemplateNameLine?: (ctx: TemplateNameLineContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.errorTemplateName`. + * @param ctx the parse tree + * @return the visitor result + */ + visitErrorTemplateName?: (ctx: ErrorTemplateNameContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.templateName`. + * @param ctx the parse tree + * @return the visitor result + */ + visitTemplateName?: (ctx: TemplateNameContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.parameters`. + * @param ctx the parse tree + * @return the visitor result + */ + visitParameters?: (ctx: ParametersContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.templateBody`. + * @param ctx the parse tree + * @return the visitor result + */ + visitTemplateBody?: (ctx: TemplateBodyContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.structuredTemplateBody`. + * @param ctx the parse tree + * @return the visitor result + */ + visitStructuredTemplateBody?: (ctx: StructuredTemplateBodyContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.structuredBodyNameLine`. + * @param ctx the parse tree + * @return the visitor result + */ + visitStructuredBodyNameLine?: (ctx: StructuredBodyNameLineContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.errorStructuredName`. + * @param ctx the parse tree + * @return the visitor result + */ + visitErrorStructuredName?: (ctx: ErrorStructuredNameContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.structuredBodyContentLine`. + * @param ctx the parse tree + * @return the visitor result + */ + visitStructuredBodyContentLine?: (ctx: StructuredBodyContentLineContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.errorStructureLine`. + * @param ctx the parse tree + * @return the visitor result + */ + visitErrorStructureLine?: (ctx: ErrorStructureLineContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.keyValueStructureLine`. + * @param ctx the parse tree + * @return the visitor result + */ + visitKeyValueStructureLine?: (ctx: KeyValueStructureLineContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.keyValueStructureValue`. + * @param ctx the parse tree + * @return the visitor result + */ + visitKeyValueStructureValue?: (ctx: KeyValueStructureValueContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.objectStructureLine`. + * @param ctx the parse tree + * @return the visitor result + */ + visitObjectStructureLine?: (ctx: ObjectStructureLineContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.structuredBodyEndLine`. + * @param ctx the parse tree + * @return the visitor result + */ + visitStructuredBodyEndLine?: (ctx: StructuredBodyEndLineContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.normalTemplateBody`. + * @param ctx the parse tree + * @return the visitor result + */ + visitNormalTemplateBody?: (ctx: NormalTemplateBodyContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.templateString`. + * @param ctx the parse tree + * @return the visitor result + */ + visitTemplateString?: (ctx: TemplateStringContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.normalTemplateString`. + * @param ctx the parse tree + * @return the visitor result + */ + visitNormalTemplateString?: (ctx: NormalTemplateStringContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.errorTemplateString`. + * @param ctx the parse tree + * @return the visitor result + */ + visitErrorTemplateString?: (ctx: ErrorTemplateStringContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.ifElseTemplateBody`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIfElseTemplateBody?: (ctx: IfElseTemplateBodyContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.ifConditionRule`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIfConditionRule?: (ctx: IfConditionRuleContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.ifCondition`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIfCondition?: (ctx: IfConditionContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.switchCaseTemplateBody`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSwitchCaseTemplateBody?: (ctx: SwitchCaseTemplateBodyContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.switchCaseRule`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSwitchCaseRule?: (ctx: SwitchCaseRuleContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.switchCaseStat`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSwitchCaseStat?: (ctx: SwitchCaseStatContext) => Result; + + /** + * Visit a parse tree produced by `LGFileParser.importDefinition`. + * @param ctx the parse tree + * @return the visitor result + */ + visitImportDefinition?: (ctx: ImportDefinitionContext) => Result; +} + diff --git a/libraries/botbuilder-lg/src/index.ts b/libraries/botbuilder-lg/src/index.ts index 5f5d55da94..e77331e448 100644 --- a/libraries/botbuilder-lg/src/index.ts +++ b/libraries/botbuilder-lg/src/index.ts @@ -24,3 +24,4 @@ export * from './position'; export * from './evaluationTarget'; export * from './activityFactory'; export * from './activityChecker'; +export * from './lgExtensions'; diff --git a/libraries/botbuilder-lg/src/lgExtensions.ts b/libraries/botbuilder-lg/src/lgExtensions.ts new file mode 100644 index 0000000000..af9fdaf821 --- /dev/null +++ b/libraries/botbuilder-lg/src/lgExtensions.ts @@ -0,0 +1,24 @@ +/** + * @module botbuilder-lg + */ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + +export class LGExtensions { + public static trimExpression(expression: string): string { + let result = expression.trim(); + if (result.startsWith('$')) { + result = result.substr(1); + } + + result = result.trim(); + + if (result.startsWith('{') && result.endsWith('}')) { + result = result.substr(1, result.length - 2); + } + + return result.trim(); + } +} \ No newline at end of file diff --git a/libraries/botbuilder-lg/src/staticChecker.ts b/libraries/botbuilder-lg/src/staticChecker.ts index 5f2eb5d6db..d6d54e2e14 100644 --- a/libraries/botbuilder-lg/src/staticChecker.ts +++ b/libraries/botbuilder-lg/src/staticChecker.ts @@ -23,6 +23,7 @@ import { LGResource } from './lgResource'; import { LGTemplate } from './lgTemplate'; import { Position } from './position'; import { Range } from './range'; +import { LGExtensions } from './lgExtensions'; // tslint:disable-next-line: completed-docs @@ -372,10 +373,7 @@ class StaticCheckerInner extends AbstractParseTreeVisitor implemen private checkExpression(exp: string, context: ParserRuleContext): Diagnostic[] { const result: Diagnostic[] = []; - exp = exp.replace(/(^\$*)/g, '') - .replace(/(^{*)/g, '') - .replace(/(}*$)/g, '') - .trim(); + exp = LGExtensions.trimExpression(exp); try { this.expressionParser.parse(exp); diff --git a/libraries/botbuilder-lg/tests/lg.test.js b/libraries/botbuilder-lg/tests/lg.test.js index c659777de9..6261ebd01c 100644 --- a/libraries/botbuilder-lg/tests/lg.test.js +++ b/libraries/botbuilder-lg/tests/lg.test.js @@ -762,4 +762,28 @@ describe('LG', function() { assert.strictEqual(evaled2, espectedResult); assert.strictEqual(evaled3, espectedResult); }); + + it('TestEmptyArratAndObject', function() { + var engine = new TemplateEngine().addFile(GetExampleFilePath('EmptyArrayAndObject.lg')); + + var evaled = engine.evaluateTemplate('template', {list:[], obj: {}}); + assert.strictEqual(evaled, 'list and obj are both empty'); + + var evaled = engine.evaluateTemplate('template', {list:[], obj:new Map()}); + assert.strictEqual(evaled, 'list and obj are both empty'); + + var evaled = engine.evaluateTemplate('template', {list:['hi'], obj: {}}); + assert.strictEqual(evaled, 'obj is empty'); + + var evaled = engine.evaluateTemplate('template', {list:[], obj: {a: 'a'}}); + assert.strictEqual(evaled, 'list is empty'); + + const map = new Map(); + map.set('a', 'a'); + var evaled = engine.evaluateTemplate('template', {list:[], obj: map}); + assert.strictEqual(evaled, 'list is empty'); + + var evaled = engine.evaluateTemplate('template', {list:[{}], obj : {a : 'a'}}); + assert.strictEqual(evaled, 'list and obj are both not empty.'); + }); }); diff --git a/libraries/botbuilder-lg/tests/testData/examples/EmptyArrayAndObject.lg b/libraries/botbuilder-lg/tests/testData/examples/EmptyArrayAndObject.lg new file mode 100644 index 0000000000..fccc1518de --- /dev/null +++ b/libraries/botbuilder-lg/tests/testData/examples/EmptyArrayAndObject.lg @@ -0,0 +1,9 @@ +# template(list, obj) +- IF: ${list == [ ] && obj == { }} +- list and obj are both empty +- ELSEIF: ${list == [ ] && obj != { }} +- list is empty +- ELSEIF: ${list != [] && obj == {}} +- obj is empty +- ELSE: +- list and obj are both not empty. \ No newline at end of file