diff --git a/libraries/adaptive-expressions/src/parser/ExpressionAntlrLexer.g4 b/libraries/adaptive-expressions/src/parser/ExpressionAntlrLexer.g4 index d694a60296..fbe2001372 100644 --- a/libraries/adaptive-expressions/src/parser/ExpressionAntlrLexer.g4 +++ b/libraries/adaptive-expressions/src/parser/ExpressionAntlrLexer.g4 @@ -65,7 +65,7 @@ NEWLINE : '\r'? '\n' -> skip; STRING : ('\'' (~'\'')* '\'') | ('"' (~'"')* '"'); -CONSTANT : ('[' WHITESPACE* ']') | ('{' WHITESPACE* '}'); +CONSTANT : ('{' WHITESPACE* '}'); INVALID_TOKEN_DEFAULT_MODE : . ; @@ -77,6 +77,4 @@ TEMPLATE : '$' '{' (STRING | ~[\r\n{}'"])*? '}'; ESCAPE_CHARACTER : '\\' ~[\r\n]?; -TEXT_CONTENT : '\\`' | ~[\r\n]; - - +TEXT_CONTENT : '\\`' | ~[\r\n]; \ No newline at end of file diff --git a/libraries/adaptive-expressions/src/parser/ExpressionAntlrParser.g4 b/libraries/adaptive-expressions/src/parser/ExpressionAntlrParser.g4 index 493560f919..3772df0202 100644 --- a/libraries/adaptive-expressions/src/parser/ExpressionAntlrParser.g4 +++ b/libraries/adaptive-expressions/src/parser/ExpressionAntlrParser.g4 @@ -19,13 +19,14 @@ expression primaryExpression : OPEN_BRACKET expression CLOSE_BRACKET #parenthesisExp + | OPEN_SQUARE_BRACKET argsList? CLOSE_SQUARE_BRACKET #arrayCreationExp | CONSTANT #constantAtom | NUMBER #numericAtom | STRING #stringAtom | IDENTIFIER #idAtom | stringInterpolation #stringInterpolationAtom | primaryExpression DOT IDENTIFIER #memberAccessExp - | primaryExpression NON? OPEN_BRACKET argsList? CLOSE_BRACKET #funcInvokeExp + | primaryExpression NON? OPEN_BRACKET argsList? CLOSE_BRACKET #funcInvokeExp | primaryExpression OPEN_SQUARE_BRACKET expression CLOSE_SQUARE_BRACKET #indexAccessExp ; diff --git a/libraries/adaptive-expressions/src/parser/expressionParser.ts b/libraries/adaptive-expressions/src/parser/expressionParser.ts index aab67406ee..8d70a631e4 100644 --- a/libraries/adaptive-expressions/src/parser/expressionParser.ts +++ b/libraries/adaptive-expressions/src/parser/expressionParser.ts @@ -111,6 +111,11 @@ export class ExpressionParser implements ExpressionParserInterface { public visitParenthesisExp = (context: ep.ParenthesisExpContext): Expression => this.visit(context.expression()); + public visitArrayCreationExp(context: ep.ArrayCreationExpContext): Expression { + const parameters: Expression[] = this.processArgsList(context.argsList()); + return this.makeExpression(ExpressionType.CreateArray, ...parameters); + } + public visitStringAtom(context: ep.StringAtomContext): Expression { const text: string = context.text; if (text.startsWith('\'')) { diff --git a/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrLexer.ts b/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrLexer.ts index 175c1bc101..d69db4d512 100644 --- a/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrLexer.ts +++ b/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrLexer.ts @@ -1,276 +1,272 @@ -// Generated from ../ExpressionAntlrLexer.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 ExpressionAntlrLexer extends Lexer { - public static readonly STRING_INTERPOLATION_START = 1; - public static readonly PLUS = 2; - public static readonly SUBSTRACT = 3; - public static readonly NON = 4; - public static readonly XOR = 5; - public static readonly ASTERISK = 6; - public static readonly SLASH = 7; - public static readonly PERCENT = 8; - public static readonly DOUBLE_EQUAL = 9; - public static readonly NOT_EQUAL = 10; - public static readonly SINGLE_AND = 11; - public static readonly DOUBLE_AND = 12; - public static readonly DOUBLE_VERTICAL_CYLINDER = 13; - public static readonly LESS_THAN = 14; - public static readonly MORE_THAN = 15; - public static readonly LESS_OR_EQUAl = 16; - public static readonly MORE_OR_EQUAL = 17; - public static readonly OPEN_BRACKET = 18; - public static readonly CLOSE_BRACKET = 19; - public static readonly DOT = 20; - public static readonly OPEN_SQUARE_BRACKET = 21; - public static readonly CLOSE_SQUARE_BRACKET = 22; - public static readonly COMMA = 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 TEMPLATE = 31; - public static readonly ESCAPE_CHARACTER = 32; - public static readonly TEXT_CONTENT = 33; - public static readonly STRING_INTERPOLATION_MODE = 1; - // tslint:disable:no-trailing-whitespace - public static readonly modeNames: string[] = [ - "DEFAULT_MODE", "STRING_INTERPOLATION_MODE", - ]; - - public static readonly ruleNames: string[] = [ - "LETTER", "DIGIT", "STRING_INTERPOLATION_START", "PLUS", "SUBSTRACT", - "NON", "XOR", "ASTERISK", "SLASH", "PERCENT", "DOUBLE_EQUAL", "NOT_EQUAL", - "SINGLE_AND", "DOUBLE_AND", "DOUBLE_VERTICAL_CYLINDER", "LESS_THAN", "MORE_THAN", - "LESS_OR_EQUAl", "MORE_OR_EQUAL", "OPEN_BRACKET", "CLOSE_BRACKET", "DOT", - "OPEN_SQUARE_BRACKET", "CLOSE_SQUARE_BRACKET", "COMMA", "NUMBER", "WHITESPACE", - "IDENTIFIER", "NEWLINE", "STRING", "CONSTANT", "INVALID_TOKEN_DEFAULT_MODE", - "STRING_INTERPOLATION_END", "TEMPLATE", "ESCAPE_CHARACTER", "TEXT_CONTENT", - ]; - - private static readonly _LITERAL_NAMES: Array = [ - undefined, undefined, "'+'", "'-'", "'!'", "'^'", "'*'", "'/'", "'%'", - "'=='", undefined, "'&'", "'&&'", "'||'", "'<'", "'>'", "'<='", "'>='", - "'('", "')'", "'.'", "'['", "']'", "','", - ]; - private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, "STRING_INTERPOLATION_START", "PLUS", "SUBSTRACT", "NON", "XOR", - "ASTERISK", "SLASH", "PERCENT", "DOUBLE_EQUAL", "NOT_EQUAL", "SINGLE_AND", - "DOUBLE_AND", "DOUBLE_VERTICAL_CYLINDER", "LESS_THAN", "MORE_THAN", "LESS_OR_EQUAl", - "MORE_OR_EQUAL", "OPEN_BRACKET", "CLOSE_BRACKET", "DOT", "OPEN_SQUARE_BRACKET", - "CLOSE_SQUARE_BRACKET", "COMMA", "NUMBER", "WHITESPACE", "IDENTIFIER", - "NEWLINE", "STRING", "CONSTANT", "INVALID_TOKEN_DEFAULT_MODE", "TEMPLATE", - "ESCAPE_CHARACTER", "TEXT_CONTENT", - ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(ExpressionAntlrLexer._LITERAL_NAMES, ExpressionAntlrLexer._SYMBOLIC_NAMES, []); - - // @Override - // @NotNull - public get vocabulary(): Vocabulary { - return ExpressionAntlrLexer.VOCABULARY; - } - // tslint:enable:no-trailing-whitespace - - - ignoreWS = true; // usually we ignore whitespace, but inside stringInterpolation, whitespace is significant - - - constructor(input: CharStream) { - super(input); - this._interp = new LexerATNSimulator(ExpressionAntlrLexer._ATN, this); - } - - // @Override - public get grammarFileName(): string { return "ExpressionAntlrLexer.g4"; } - - // @Override - public get ruleNames(): string[] { return ExpressionAntlrLexer.ruleNames; } - - // @Override - public get serializedATN(): string { return ExpressionAntlrLexer._serializedATN; } - - // @Override - public get modeNames(): string[] { return ExpressionAntlrLexer.modeNames; } - - // @Override - public action(_localctx: RuleContext, ruleIndex: number, actionIndex: number): void { - switch (ruleIndex) { - case 2: - this.STRING_INTERPOLATION_START_action(_localctx, actionIndex); - break; - - case 32: - this.STRING_INTERPOLATION_END_action(_localctx, actionIndex); - break; - } - } - private STRING_INTERPOLATION_START_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 0: - this.ignoreWS = false; - break; - } - } - private STRING_INTERPOLATION_END_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 1: - this.ignoreWS = true; - break; - } - } - // @Override - public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { - switch (ruleIndex) { - case 26: - return this.WHITESPACE_sempred(_localctx, predIndex); - } - return true; - } - private WHITESPACE_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 0: - return this.ignoreWS; - } - return true; - } - - public static readonly _serializedATN: string = - "\x03\uAF6F\u8320\u479D\uB75C\u4880\u1605\u191C\uAB37\x02#\xF2\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%\x03\x02\x03\x02\x03\x03\x03\x03\x03\x04\x03" + - "\x04\x03\x04\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\f" + - "\x03\r\x03\r\x03\r\x03\r\x05\rk\n\r\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03" + - "\x0F\x03\x10\x03\x10\x03\x10\x03\x11\x03\x11\x03\x12\x03\x12\x03\x13\x03" + - "\x13\x03\x13\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x16\x03\x16\x03" + - "\x17\x03\x17\x03\x18\x03\x18\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1B\x06" + - "\x1B\x8C\n\x1B\r\x1B\x0E\x1B\x8D\x03\x1B\x03\x1B\x06\x1B\x92\n\x1B\r\x1B" + - "\x0E\x1B\x93\x05\x1B\x96\n\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C" + - "\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x05\x1D\xA2\n\x1D\x03\x1D\x03" + - "\x1D\x03\x1D\x07\x1D\xA7\n\x1D\f\x1D\x0E\x1D\xAA\v\x1D\x03\x1E\x05\x1E" + - "\xAD\n\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x07\x1F\xB5" + - "\n\x1F\f\x1F\x0E\x1F\xB8\v\x1F\x03\x1F\x03\x1F\x03\x1F\x07\x1F\xBD\n\x1F" + - "\f\x1F\x0E\x1F\xC0\v\x1F\x03\x1F\x05\x1F\xC3\n\x1F\x03 \x03 \x07 \xC7" + - "\n \f \x0E \xCA\v \x03 \x03 \x03 \x07 \xCF\n \f \x0E \xD2\v \x03 \x05" + - " \xD5\n \x03!\x03!\x03\"\x03\"\x03\"\x03\"\x03\"\x03\"\x03#\x03#\x03#" + - "\x03#\x07#\xE3\n#\f#\x0E#\xE6\v#\x03#\x03#\x03$\x03$\x05$\xEC\n$\x03%" + - "\x03%\x03%\x05%\xF1\n%\x03\xE4\x02\x02&\x04\x02\x02\x06\x02\x02\b\x02" + - "\x03\n\x02\x04\f\x02\x05\x0E\x02\x06\x10\x02\x07\x12\x02\b\x14\x02\t\x16" + - "\x02\n\x18\x02\v\x1A\x02\f\x1C\x02\r\x1E\x02\x0E \x02\x0F\"\x02\x10$\x02" + - "\x11&\x02\x12(\x02\x13*\x02\x14,\x02\x15.\x02\x160\x02\x172\x02\x184\x02" + - "\x196\x02\x1A8\x02\x1B:\x02\x1C<\x02\x1D>\x02\x1E@\x02\x1FB\x02 D\x02" + - "\x02F\x02!H\x02\"J\x02#\x04\x02\x03\v\x04\x02C\\c|\x03\x022;\x06\x02\v" + - "\v\"\"\xA2\xA2\uFF01\uFF01\x05\x02%%BBaa\x04\x02//aa\x03\x02))\x03\x02" + - "$$\b\x02\f\f\x0F\x0F$$))}}\x7F\x7F\x04\x02\f\f\x0F\x0F\u0103\x02\b\x03" + - "\x02\x02\x02\x02\n\x03\x02\x02\x02\x02\f\x03\x02\x02\x02\x02\x0E\x03\x02" + - "\x02\x02\x02\x10\x03\x02\x02\x02\x02\x12\x03\x02\x02\x02\x02\x14\x03\x02" + - "\x02\x02\x02\x16\x03\x02\x02\x02\x02\x18\x03\x02\x02\x02\x02\x1A\x03\x02" + - "\x02\x02\x02\x1C\x03\x02\x02\x02\x02\x1E\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\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\x02>\x03\x02\x02\x02\x02@\x03\x02\x02\x02\x02B\x03\x02" + - "\x02\x02\x03D\x03\x02\x02\x02\x03F\x03\x02\x02\x02\x03H\x03\x02\x02\x02" + - "\x03J\x03\x02\x02\x02\x04L\x03\x02\x02\x02\x06N\x03\x02\x02\x02\bP\x03" + - "\x02\x02\x02\nU\x03\x02\x02\x02\fW\x03\x02\x02\x02\x0EY\x03\x02\x02\x02" + - "\x10[\x03\x02\x02\x02\x12]\x03\x02\x02\x02\x14_\x03\x02\x02\x02\x16a\x03" + - "\x02\x02\x02\x18c\x03\x02\x02\x02\x1Aj\x03\x02\x02\x02\x1Cl\x03\x02\x02" + - "\x02\x1En\x03\x02\x02\x02 q\x03\x02\x02\x02\"t\x03\x02\x02\x02$v\x03\x02" + - "\x02\x02&x\x03\x02\x02\x02({\x03\x02\x02\x02*~\x03\x02\x02\x02,\x80\x03" + - "\x02\x02\x02.\x82\x03\x02\x02\x020\x84\x03\x02\x02\x022\x86\x03\x02\x02" + - "\x024\x88\x03\x02\x02\x026\x8B\x03\x02\x02\x028\x97\x03\x02\x02\x02:\xA1" + - "\x03\x02\x02\x02<\xAC\x03\x02\x02\x02>\xC2\x03\x02\x02\x02@\xD4\x03\x02" + - "\x02\x02B\xD6\x03\x02\x02\x02D\xD8\x03\x02\x02\x02F\xDE\x03\x02\x02\x02" + - "H\xE9\x03\x02\x02\x02J\xF0\x03\x02\x02\x02LM\t\x02\x02\x02M\x05\x03\x02" + - "\x02\x02NO\t\x03\x02\x02O\x07\x03\x02\x02\x02PQ\x07b\x02\x02QR\b\x04\x02" + - "\x02RS\x03\x02\x02\x02ST\b\x04\x03\x02T\t\x03\x02\x02\x02UV\x07-\x02\x02" + - "V\v\x03\x02\x02\x02WX\x07/\x02\x02X\r\x03\x02\x02\x02YZ\x07#\x02\x02Z" + - "\x0F\x03\x02\x02\x02[\\\x07`\x02\x02\\\x11\x03\x02\x02\x02]^\x07,\x02" + - "\x02^\x13\x03\x02\x02\x02_`\x071\x02\x02`\x15\x03\x02\x02\x02ab\x07\'" + - "\x02\x02b\x17\x03\x02\x02\x02cd\x07?\x02\x02de\x07?\x02\x02e\x19\x03\x02" + - "\x02\x02fg\x07#\x02\x02gk\x07?\x02\x02hi\x07>\x02\x02ik\x07@\x02\x02j" + - "f\x03\x02\x02\x02jh\x03\x02\x02\x02k\x1B\x03\x02\x02\x02lm\x07(\x02\x02" + - "m\x1D\x03\x02\x02\x02no\x07(\x02\x02op\x07(\x02\x02p\x1F\x03\x02\x02\x02" + - "qr\x07~\x02\x02rs\x07~\x02\x02s!\x03\x02\x02\x02tu\x07>\x02\x02u#\x03" + - "\x02\x02\x02vw\x07@\x02\x02w%\x03\x02\x02\x02xy\x07>\x02\x02yz\x07?\x02" + - "\x02z\'\x03\x02\x02\x02{|\x07@\x02\x02|}\x07?\x02\x02})\x03\x02\x02\x02" + - "~\x7F\x07*\x02\x02\x7F+\x03\x02\x02\x02\x80\x81\x07+\x02\x02\x81-\x03" + - "\x02\x02\x02\x82\x83\x070\x02\x02\x83/\x03\x02\x02\x02\x84\x85\x07]\x02" + - "\x02\x851\x03\x02\x02\x02\x86\x87\x07_\x02\x02\x873\x03\x02\x02\x02\x88" + - "\x89\x07.\x02\x02\x895\x03\x02\x02\x02\x8A\x8C\x05\x06\x03\x02\x8B\x8A" + - "\x03\x02\x02\x02\x8C\x8D\x03\x02\x02\x02\x8D\x8B\x03\x02\x02\x02\x8D\x8E" + - "\x03\x02\x02\x02\x8E\x95\x03\x02\x02\x02\x8F\x91\x070\x02\x02\x90\x92" + - "\x05\x06\x03\x02\x91\x90\x03\x02\x02\x02\x92\x93\x03\x02\x02\x02\x93\x91" + - "\x03\x02\x02\x02\x93\x94\x03\x02\x02\x02\x94\x96\x03\x02\x02\x02\x95\x8F" + - "\x03\x02\x02\x02\x95\x96\x03\x02\x02\x02\x967\x03\x02\x02\x02\x97\x98" + - "\t\x04\x02\x02\x98\x99\x06\x1C\x02\x02\x99\x9A\x03\x02\x02\x02\x9A\x9B" + - "\b\x1C\x04\x02\x9B9\x03\x02\x02\x02\x9C\xA2\x05\x04\x02\x02\x9D\xA2\t" + - "\x05\x02\x02\x9E\x9F\x07B\x02\x02\x9F\xA2\x07B\x02\x02\xA0\xA2\x04&\'" + - "\x02\xA1\x9C\x03\x02\x02\x02\xA1\x9D\x03\x02\x02\x02\xA1\x9E\x03\x02\x02" + - "\x02\xA1\xA0\x03\x02\x02\x02\xA2\xA8\x03\x02\x02\x02\xA3\xA7\x05\x04\x02" + - "\x02\xA4\xA7\x05\x06\x03\x02\xA5\xA7\t\x06\x02\x02\xA6\xA3\x03\x02\x02" + - "\x02\xA6\xA4\x03\x02\x02\x02\xA6\xA5\x03\x02\x02\x02\xA7\xAA\x03\x02\x02" + - "\x02\xA8\xA6\x03\x02\x02\x02\xA8\xA9\x03\x02\x02\x02\xA9;\x03\x02\x02" + - "\x02\xAA\xA8\x03\x02\x02\x02\xAB\xAD\x07\x0F\x02\x02\xAC\xAB\x03\x02\x02" + - "\x02\xAC\xAD\x03\x02\x02\x02\xAD\xAE\x03\x02\x02\x02\xAE\xAF\x07\f\x02" + - "\x02\xAF\xB0\x03\x02\x02\x02\xB0\xB1\b\x1E\x04\x02\xB1=\x03\x02\x02\x02" + - "\xB2\xB6\x07)\x02\x02\xB3\xB5\n\x07\x02\x02\xB4\xB3\x03\x02\x02\x02\xB5" + - "\xB8\x03\x02\x02\x02\xB6\xB4\x03\x02\x02\x02\xB6\xB7\x03\x02\x02\x02\xB7" + - "\xB9\x03\x02\x02\x02\xB8\xB6\x03\x02\x02\x02\xB9\xC3\x07)\x02\x02\xBA" + - "\xBE\x07$\x02\x02\xBB\xBD\n\b\x02\x02\xBC\xBB\x03\x02\x02\x02\xBD\xC0" + - "\x03\x02\x02\x02\xBE\xBC\x03\x02\x02\x02\xBE\xBF\x03\x02\x02\x02\xBF\xC1" + - "\x03\x02\x02\x02\xC0\xBE\x03\x02\x02\x02\xC1\xC3\x07$\x02\x02\xC2\xB2" + - "\x03\x02\x02\x02\xC2\xBA\x03\x02\x02\x02\xC3?\x03\x02\x02\x02\xC4\xC8" + - "\x07]\x02\x02\xC5\xC7\x058\x1C\x02\xC6\xC5\x03\x02\x02\x02\xC7\xCA\x03" + - "\x02\x02\x02\xC8\xC6\x03\x02\x02\x02\xC8\xC9\x03\x02\x02\x02\xC9\xCB\x03" + - "\x02\x02\x02\xCA\xC8\x03\x02\x02\x02\xCB\xD5\x07_\x02\x02\xCC\xD0\x07" + - "}\x02\x02\xCD\xCF\x058\x1C\x02\xCE\xCD\x03\x02\x02\x02\xCF\xD2\x03\x02" + - "\x02\x02\xD0\xCE\x03\x02\x02\x02\xD0\xD1\x03\x02\x02\x02\xD1\xD3\x03\x02" + - "\x02\x02\xD2\xD0\x03\x02\x02\x02\xD3\xD5\x07\x7F\x02\x02\xD4\xC4\x03\x02" + - "\x02\x02\xD4\xCC\x03\x02\x02\x02\xD5A\x03\x02\x02\x02\xD6\xD7\v\x02\x02" + - "\x02\xD7C\x03\x02\x02\x02\xD8\xD9\x07b\x02\x02\xD9\xDA\b\"\x05\x02\xDA" + - "\xDB\x03\x02\x02\x02\xDB\xDC\b\"\x06\x02\xDC\xDD\b\"\x07\x02\xDDE\x03" + - "\x02\x02\x02\xDE\xDF\x07&\x02\x02\xDF\xE4\x07}\x02\x02\xE0\xE3\x05>\x1F" + - "\x02\xE1\xE3\n\t\x02\x02\xE2\xE0\x03\x02\x02\x02\xE2\xE1\x03\x02\x02\x02" + - "\xE3\xE6\x03\x02\x02\x02\xE4\xE5\x03\x02\x02\x02\xE4\xE2\x03\x02\x02\x02" + - "\xE5\xE7\x03\x02\x02\x02\xE6\xE4\x03\x02\x02\x02\xE7\xE8\x07\x7F\x02\x02" + - "\xE8G\x03\x02\x02\x02\xE9\xEB\x07^\x02\x02\xEA\xEC\n\n\x02\x02\xEB\xEA" + - "\x03\x02\x02\x02\xEB\xEC\x03\x02\x02\x02\xECI\x03\x02\x02\x02\xED\xEE" + - "\x07^\x02\x02\xEE\xF1\x07b\x02\x02\xEF\xF1\n\n\x02\x02\xF0\xED\x03\x02" + - "\x02\x02\xF0\xEF\x03\x02\x02\x02\xF1K\x03\x02\x02\x02\x16\x02\x03j\x8D" + - "\x93\x95\xA1\xA6\xA8\xAC\xB6\xBE\xC2\xC8\xD0\xD4\xE2\xE4\xEB\xF0\b\x03" + - "\x04\x02\x07\x03\x02\b\x02\x02\x03\"\x03\t\x03\x02\x06\x02\x02"; - public static __ATN: ATN; - public static get _ATN(): ATN { - if (!ExpressionAntlrLexer.__ATN) { - ExpressionAntlrLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(ExpressionAntlrLexer._serializedATN)); - } - - return ExpressionAntlrLexer.__ATN; - } - -} - +// Generated from ../ExpressionAntlrLexer.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 ExpressionAntlrLexer extends Lexer { + public static readonly STRING_INTERPOLATION_START = 1; + public static readonly PLUS = 2; + public static readonly SUBSTRACT = 3; + public static readonly NON = 4; + public static readonly XOR = 5; + public static readonly ASTERISK = 6; + public static readonly SLASH = 7; + public static readonly PERCENT = 8; + public static readonly DOUBLE_EQUAL = 9; + public static readonly NOT_EQUAL = 10; + public static readonly SINGLE_AND = 11; + public static readonly DOUBLE_AND = 12; + public static readonly DOUBLE_VERTICAL_CYLINDER = 13; + public static readonly LESS_THAN = 14; + public static readonly MORE_THAN = 15; + public static readonly LESS_OR_EQUAl = 16; + public static readonly MORE_OR_EQUAL = 17; + public static readonly OPEN_BRACKET = 18; + public static readonly CLOSE_BRACKET = 19; + public static readonly DOT = 20; + public static readonly OPEN_SQUARE_BRACKET = 21; + public static readonly CLOSE_SQUARE_BRACKET = 22; + public static readonly COMMA = 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 TEMPLATE = 31; + public static readonly ESCAPE_CHARACTER = 32; + public static readonly TEXT_CONTENT = 33; + public static readonly STRING_INTERPOLATION_MODE = 1; + // tslint:disable:no-trailing-whitespace + public static readonly modeNames: string[] = [ + "DEFAULT_MODE", "STRING_INTERPOLATION_MODE", + ]; + + public static readonly ruleNames: string[] = [ + "LETTER", "DIGIT", "STRING_INTERPOLATION_START", "PLUS", "SUBSTRACT", + "NON", "XOR", "ASTERISK", "SLASH", "PERCENT", "DOUBLE_EQUAL", "NOT_EQUAL", + "SINGLE_AND", "DOUBLE_AND", "DOUBLE_VERTICAL_CYLINDER", "LESS_THAN", "MORE_THAN", + "LESS_OR_EQUAl", "MORE_OR_EQUAL", "OPEN_BRACKET", "CLOSE_BRACKET", "DOT", + "OPEN_SQUARE_BRACKET", "CLOSE_SQUARE_BRACKET", "COMMA", "NUMBER", "WHITESPACE", + "IDENTIFIER", "NEWLINE", "STRING", "CONSTANT", "INVALID_TOKEN_DEFAULT_MODE", + "STRING_INTERPOLATION_END", "TEMPLATE", "ESCAPE_CHARACTER", "TEXT_CONTENT", + ]; + + private static readonly _LITERAL_NAMES: Array = [ + undefined, undefined, "'+'", "'-'", "'!'", "'^'", "'*'", "'/'", "'%'", + "'=='", undefined, "'&'", "'&&'", "'||'", "'<'", "'>'", "'<='", "'>='", + "'('", "')'", "'.'", "'['", "']'", "','", + ]; + private static readonly _SYMBOLIC_NAMES: Array = [ + undefined, "STRING_INTERPOLATION_START", "PLUS", "SUBSTRACT", "NON", "XOR", + "ASTERISK", "SLASH", "PERCENT", "DOUBLE_EQUAL", "NOT_EQUAL", "SINGLE_AND", + "DOUBLE_AND", "DOUBLE_VERTICAL_CYLINDER", "LESS_THAN", "MORE_THAN", "LESS_OR_EQUAl", + "MORE_OR_EQUAL", "OPEN_BRACKET", "CLOSE_BRACKET", "DOT", "OPEN_SQUARE_BRACKET", + "CLOSE_SQUARE_BRACKET", "COMMA", "NUMBER", "WHITESPACE", "IDENTIFIER", + "NEWLINE", "STRING", "CONSTANT", "INVALID_TOKEN_DEFAULT_MODE", "TEMPLATE", + "ESCAPE_CHARACTER", "TEXT_CONTENT", + ]; + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(ExpressionAntlrLexer._LITERAL_NAMES, ExpressionAntlrLexer._SYMBOLIC_NAMES, []); + + // @Override + // @NotNull + public get vocabulary(): Vocabulary { + return ExpressionAntlrLexer.VOCABULARY; + } + // tslint:enable:no-trailing-whitespace + + + ignoreWS = true; // usually we ignore whitespace, but inside stringInterpolation, whitespace is significant + + + constructor(input: CharStream) { + super(input); + this._interp = new LexerATNSimulator(ExpressionAntlrLexer._ATN, this); + } + + // @Override + public get grammarFileName(): string { return "ExpressionAntlrLexer.g4"; } + + // @Override + public get ruleNames(): string[] { return ExpressionAntlrLexer.ruleNames; } + + // @Override + public get serializedATN(): string { return ExpressionAntlrLexer._serializedATN; } + + // @Override + public get modeNames(): string[] { return ExpressionAntlrLexer.modeNames; } + + // @Override + public action(_localctx: RuleContext, ruleIndex: number, actionIndex: number): void { + switch (ruleIndex) { + case 2: + this.STRING_INTERPOLATION_START_action(_localctx, actionIndex); + break; + + case 32: + this.STRING_INTERPOLATION_END_action(_localctx, actionIndex); + break; + } + } + private STRING_INTERPOLATION_START_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 0: + this.ignoreWS = false; + break; + } + } + private STRING_INTERPOLATION_END_action(_localctx: RuleContext, actionIndex: number): void { + switch (actionIndex) { + case 1: + this.ignoreWS = true; + break; + } + } + // @Override + public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { + switch (ruleIndex) { + case 26: + return this.WHITESPACE_sempred(_localctx, predIndex); + } + return true; + } + private WHITESPACE_sempred(_localctx: RuleContext, predIndex: number): boolean { + switch (predIndex) { + case 0: + return this.ignoreWS; + } + return true; + } + + public static readonly _serializedATN: string = + "\x03\uAF6F\u8320\u479D\uB75C\u4880\u1605\u191C\uAB37\x02#\xE9\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%\x03\x02\x03\x02\x03\x03\x03\x03\x03\x04\x03" + + "\x04\x03\x04\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\f" + + "\x03\r\x03\r\x03\r\x03\r\x05\rk\n\r\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03" + + "\x0F\x03\x10\x03\x10\x03\x10\x03\x11\x03\x11\x03\x12\x03\x12\x03\x13\x03" + + "\x13\x03\x13\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x16\x03\x16\x03" + + "\x17\x03\x17\x03\x18\x03\x18\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1B\x06" + + "\x1B\x8C\n\x1B\r\x1B\x0E\x1B\x8D\x03\x1B\x03\x1B\x06\x1B\x92\n\x1B\r\x1B" + + "\x0E\x1B\x93\x05\x1B\x96\n\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C" + + "\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x05\x1D\xA2\n\x1D\x03\x1D\x03" + + "\x1D\x03\x1D\x07\x1D\xA7\n\x1D\f\x1D\x0E\x1D\xAA\v\x1D\x03\x1E\x05\x1E" + + "\xAD\n\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x07\x1F\xB5" + + "\n\x1F\f\x1F\x0E\x1F\xB8\v\x1F\x03\x1F\x03\x1F\x03\x1F\x07\x1F\xBD\n\x1F" + + "\f\x1F\x0E\x1F\xC0\v\x1F\x03\x1F\x05\x1F\xC3\n\x1F\x03 \x03 \x07 \xC7" + + "\n \f \x0E \xCA\v \x03 \x03 \x03!\x03!\x03\"\x03\"\x03\"\x03\"\x03\"\x03" + + "\"\x03#\x03#\x03#\x03#\x07#\xDA\n#\f#\x0E#\xDD\v#\x03#\x03#\x03$\x03$" + + "\x05$\xE3\n$\x03%\x03%\x03%\x05%\xE8\n%\x03\xDB\x02\x02&\x04\x02\x02\x06" + + "\x02\x02\b\x02\x03\n\x02\x04\f\x02\x05\x0E\x02\x06\x10\x02\x07\x12\x02" + + "\b\x14\x02\t\x16\x02\n\x18\x02\v\x1A\x02\f\x1C\x02\r\x1E\x02\x0E \x02" + + "\x0F\"\x02\x10$\x02\x11&\x02\x12(\x02\x13*\x02\x14,\x02\x15.\x02\x160" + + "\x02\x172\x02\x184\x02\x196\x02\x1A8\x02\x1B:\x02\x1C<\x02\x1D>\x02\x1E" + + "@\x02\x1FB\x02 D\x02\x02F\x02!H\x02\"J\x02#\x04\x02\x03\v\x04\x02C\\c" + + "|\x03\x022;\x06\x02\v\v\"\"\xA2\xA2\uFF01\uFF01\x05\x02%%BBaa\x04\x02" + + "//aa\x03\x02))\x03\x02$$\b\x02\f\f\x0F\x0F$$))}}\x7F\x7F\x04\x02\f\f\x0F" + + "\x0F\xF8\x02\b\x03\x02\x02\x02\x02\n\x03\x02\x02\x02\x02\f\x03\x02\x02" + + "\x02\x02\x0E\x03\x02\x02\x02\x02\x10\x03\x02\x02\x02\x02\x12\x03\x02\x02" + + "\x02\x02\x14\x03\x02\x02\x02\x02\x16\x03\x02\x02\x02\x02\x18\x03\x02\x02" + + "\x02\x02\x1A\x03\x02\x02\x02\x02\x1C\x03\x02\x02\x02\x02\x1E\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\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\x02>\x03\x02\x02\x02\x02@\x03\x02\x02" + + "\x02\x02B\x03\x02\x02\x02\x03D\x03\x02\x02\x02\x03F\x03\x02\x02\x02\x03" + + "H\x03\x02\x02\x02\x03J\x03\x02\x02\x02\x04L\x03\x02\x02\x02\x06N\x03\x02" + + "\x02\x02\bP\x03\x02\x02\x02\nU\x03\x02\x02\x02\fW\x03\x02\x02\x02\x0E" + + "Y\x03\x02\x02\x02\x10[\x03\x02\x02\x02\x12]\x03\x02\x02\x02\x14_\x03\x02" + + "\x02\x02\x16a\x03\x02\x02\x02\x18c\x03\x02\x02\x02\x1Aj\x03\x02\x02\x02" + + "\x1Cl\x03\x02\x02\x02\x1En\x03\x02\x02\x02 q\x03\x02\x02\x02\"t\x03\x02" + + "\x02\x02$v\x03\x02\x02\x02&x\x03\x02\x02\x02({\x03\x02\x02\x02*~\x03\x02" + + "\x02\x02,\x80\x03\x02\x02\x02.\x82\x03\x02\x02\x020\x84\x03\x02\x02\x02" + + "2\x86\x03\x02\x02\x024\x88\x03\x02\x02\x026\x8B\x03\x02\x02\x028\x97\x03" + + "\x02\x02\x02:\xA1\x03\x02\x02\x02<\xAC\x03\x02\x02\x02>\xC2\x03\x02\x02" + + "\x02@\xC4\x03\x02\x02\x02B\xCD\x03\x02\x02\x02D\xCF\x03\x02\x02\x02F\xD5" + + "\x03\x02\x02\x02H\xE0\x03\x02\x02\x02J\xE7\x03\x02\x02\x02LM\t\x02\x02" + + "\x02M\x05\x03\x02\x02\x02NO\t\x03\x02\x02O\x07\x03\x02\x02\x02PQ\x07b" + + "\x02\x02QR\b\x04\x02\x02RS\x03\x02\x02\x02ST\b\x04\x03\x02T\t\x03\x02" + + "\x02\x02UV\x07-\x02\x02V\v\x03\x02\x02\x02WX\x07/\x02\x02X\r\x03\x02\x02" + + "\x02YZ\x07#\x02\x02Z\x0F\x03\x02\x02\x02[\\\x07`\x02\x02\\\x11\x03\x02" + + "\x02\x02]^\x07,\x02\x02^\x13\x03\x02\x02\x02_`\x071\x02\x02`\x15\x03\x02" + + "\x02\x02ab\x07\'\x02\x02b\x17\x03\x02\x02\x02cd\x07?\x02\x02de\x07?\x02" + + "\x02e\x19\x03\x02\x02\x02fg\x07#\x02\x02gk\x07?\x02\x02hi\x07>\x02\x02" + + "ik\x07@\x02\x02jf\x03\x02\x02\x02jh\x03\x02\x02\x02k\x1B\x03\x02\x02\x02" + + "lm\x07(\x02\x02m\x1D\x03\x02\x02\x02no\x07(\x02\x02op\x07(\x02\x02p\x1F" + + "\x03\x02\x02\x02qr\x07~\x02\x02rs\x07~\x02\x02s!\x03\x02\x02\x02tu\x07" + + ">\x02\x02u#\x03\x02\x02\x02vw\x07@\x02\x02w%\x03\x02\x02\x02xy\x07>\x02" + + "\x02yz\x07?\x02\x02z\'\x03\x02\x02\x02{|\x07@\x02\x02|}\x07?\x02\x02}" + + ")\x03\x02\x02\x02~\x7F\x07*\x02\x02\x7F+\x03\x02\x02\x02\x80\x81\x07+" + + "\x02\x02\x81-\x03\x02\x02\x02\x82\x83\x070\x02\x02\x83/\x03\x02\x02\x02" + + "\x84\x85\x07]\x02\x02\x851\x03\x02\x02\x02\x86\x87\x07_\x02\x02\x873\x03" + + "\x02\x02\x02\x88\x89\x07.\x02\x02\x895\x03\x02\x02\x02\x8A\x8C\x05\x06" + + "\x03\x02\x8B\x8A\x03\x02\x02\x02\x8C\x8D\x03\x02\x02\x02\x8D\x8B\x03\x02" + + "\x02\x02\x8D\x8E\x03\x02\x02\x02\x8E\x95\x03\x02\x02\x02\x8F\x91\x070" + + "\x02\x02\x90\x92\x05\x06\x03\x02\x91\x90\x03\x02\x02\x02\x92\x93\x03\x02" + + "\x02\x02\x93\x91\x03\x02\x02\x02\x93\x94\x03\x02\x02\x02\x94\x96\x03\x02" + + "\x02\x02\x95\x8F\x03\x02\x02\x02\x95\x96\x03\x02\x02\x02\x967\x03\x02" + + "\x02\x02\x97\x98\t\x04\x02\x02\x98\x99\x06\x1C\x02\x02\x99\x9A\x03\x02" + + "\x02\x02\x9A\x9B\b\x1C\x04\x02\x9B9\x03\x02\x02\x02\x9C\xA2\x05\x04\x02" + + "\x02\x9D\xA2\t\x05\x02\x02\x9E\x9F\x07B\x02\x02\x9F\xA2\x07B\x02\x02\xA0" + + "\xA2\x04&\'\x02\xA1\x9C\x03\x02\x02\x02\xA1\x9D\x03\x02\x02\x02\xA1\x9E" + + "\x03\x02\x02\x02\xA1\xA0\x03\x02\x02\x02\xA2\xA8\x03\x02\x02\x02\xA3\xA7" + + "\x05\x04\x02\x02\xA4\xA7\x05\x06\x03\x02\xA5\xA7\t\x06\x02\x02\xA6\xA3" + + "\x03\x02\x02\x02\xA6\xA4\x03\x02\x02\x02\xA6\xA5\x03\x02\x02\x02\xA7\xAA" + + "\x03\x02\x02\x02\xA8\xA6\x03\x02\x02\x02\xA8\xA9\x03\x02\x02\x02\xA9;" + + "\x03\x02\x02\x02\xAA\xA8\x03\x02\x02\x02\xAB\xAD\x07\x0F\x02\x02\xAC\xAB" + + "\x03\x02\x02\x02\xAC\xAD\x03\x02\x02\x02\xAD\xAE\x03\x02\x02\x02\xAE\xAF" + + "\x07\f\x02\x02\xAF\xB0\x03\x02\x02\x02\xB0\xB1\b\x1E\x04\x02\xB1=\x03" + + "\x02\x02\x02\xB2\xB6\x07)\x02\x02\xB3\xB5\n\x07\x02\x02\xB4\xB3\x03\x02" + + "\x02\x02\xB5\xB8\x03\x02\x02\x02\xB6\xB4\x03\x02\x02\x02\xB6\xB7\x03\x02" + + "\x02\x02\xB7\xB9\x03\x02\x02\x02\xB8\xB6\x03\x02\x02\x02\xB9\xC3\x07)" + + "\x02\x02\xBA\xBE\x07$\x02\x02\xBB\xBD\n\b\x02\x02\xBC\xBB\x03\x02\x02" + + "\x02\xBD\xC0\x03\x02\x02\x02\xBE\xBC\x03\x02\x02\x02\xBE\xBF\x03\x02\x02" + + "\x02\xBF\xC1\x03\x02\x02\x02\xC0\xBE\x03\x02\x02\x02\xC1\xC3\x07$\x02" + + "\x02\xC2\xB2\x03\x02\x02\x02\xC2\xBA\x03\x02\x02\x02\xC3?\x03\x02\x02" + + "\x02\xC4\xC8\x07}\x02\x02\xC5\xC7\x058\x1C\x02\xC6\xC5\x03\x02\x02\x02" + + "\xC7\xCA\x03\x02\x02\x02\xC8\xC6\x03\x02\x02\x02\xC8\xC9\x03\x02\x02\x02" + + "\xC9\xCB\x03\x02\x02\x02\xCA\xC8\x03\x02\x02\x02\xCB\xCC\x07\x7F\x02\x02" + + "\xCCA\x03\x02\x02\x02\xCD\xCE\v\x02\x02\x02\xCEC\x03\x02\x02\x02\xCF\xD0" + + "\x07b\x02\x02\xD0\xD1\b\"\x05\x02\xD1\xD2\x03\x02\x02\x02\xD2\xD3\b\"" + + "\x06\x02\xD3\xD4\b\"\x07\x02\xD4E\x03\x02\x02\x02\xD5\xD6\x07&\x02\x02" + + "\xD6\xDB\x07}\x02\x02\xD7\xDA\x05>\x1F\x02\xD8\xDA\n\t\x02\x02\xD9\xD7" + + "\x03\x02\x02\x02\xD9\xD8\x03\x02\x02\x02\xDA\xDD\x03\x02\x02\x02\xDB\xDC" + + "\x03\x02\x02\x02\xDB\xD9\x03\x02\x02\x02\xDC\xDE\x03\x02\x02\x02\xDD\xDB" + + "\x03\x02\x02\x02\xDE\xDF\x07\x7F\x02\x02\xDFG\x03\x02\x02\x02\xE0\xE2" + + "\x07^\x02\x02\xE1\xE3\n\n\x02\x02\xE2\xE1\x03\x02\x02\x02\xE2\xE3\x03" + + "\x02\x02\x02\xE3I\x03\x02\x02\x02\xE4\xE5\x07^\x02\x02\xE5\xE8\x07b\x02" + + "\x02\xE6\xE8\n\n\x02\x02\xE7\xE4\x03\x02\x02\x02\xE7\xE6\x03\x02\x02\x02" + + "\xE8K\x03\x02\x02\x02\x14\x02\x03j\x8D\x93\x95\xA1\xA6\xA8\xAC\xB6\xBE" + + "\xC2\xC8\xD9\xDB\xE2\xE7\b\x03\x04\x02\x07\x03\x02\b\x02\x02\x03\"\x03" + + "\t\x03\x02\x06\x02\x02"; + public static __ATN: ATN; + public static get _ATN(): ATN { + if (!ExpressionAntlrLexer.__ATN) { + ExpressionAntlrLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(ExpressionAntlrLexer._serializedATN)); + } + + return ExpressionAntlrLexer.__ATN; + } + +} + diff --git a/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrParser.ts b/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrParser.ts index 8d9fd66267..20356e2df6 100644 --- a/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrParser.ts +++ b/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrParser.ts @@ -1,1435 +1,1491 @@ -// Generated from ../ExpressionAntlrParser.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 { ExpressionAntlrParserListener } from "./ExpressionAntlrParserListener"; -import { ExpressionAntlrParserVisitor } from "./ExpressionAntlrParserVisitor"; - - -export class ExpressionAntlrParser extends Parser { - public static readonly STRING_INTERPOLATION_START = 1; - public static readonly PLUS = 2; - public static readonly SUBSTRACT = 3; - public static readonly NON = 4; - public static readonly XOR = 5; - public static readonly ASTERISK = 6; - public static readonly SLASH = 7; - public static readonly PERCENT = 8; - public static readonly DOUBLE_EQUAL = 9; - public static readonly NOT_EQUAL = 10; - public static readonly SINGLE_AND = 11; - public static readonly DOUBLE_AND = 12; - public static readonly DOUBLE_VERTICAL_CYLINDER = 13; - public static readonly LESS_THAN = 14; - public static readonly MORE_THAN = 15; - public static readonly LESS_OR_EQUAl = 16; - public static readonly MORE_OR_EQUAL = 17; - public static readonly OPEN_BRACKET = 18; - public static readonly CLOSE_BRACKET = 19; - public static readonly DOT = 20; - public static readonly OPEN_SQUARE_BRACKET = 21; - public static readonly CLOSE_SQUARE_BRACKET = 22; - public static readonly COMMA = 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 TEMPLATE = 31; - public static readonly ESCAPE_CHARACTER = 32; - public static readonly TEXT_CONTENT = 33; - public static readonly RULE_file = 0; - public static readonly RULE_expression = 1; - public static readonly RULE_primaryExpression = 2; - public static readonly RULE_stringInterpolation = 3; - public static readonly RULE_textContent = 4; - public static readonly RULE_argsList = 5; - // tslint:disable:no-trailing-whitespace - public static readonly ruleNames: string[] = [ - "file", "expression", "primaryExpression", "stringInterpolation", "textContent", - "argsList", - ]; - - private static readonly _LITERAL_NAMES: Array = [ - undefined, undefined, "'+'", "'-'", "'!'", "'^'", "'*'", "'/'", "'%'", - "'=='", undefined, "'&'", "'&&'", "'||'", "'<'", "'>'", "'<='", "'>='", - "'('", "')'", "'.'", "'['", "']'", "','", - ]; - private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, "STRING_INTERPOLATION_START", "PLUS", "SUBSTRACT", "NON", "XOR", - "ASTERISK", "SLASH", "PERCENT", "DOUBLE_EQUAL", "NOT_EQUAL", "SINGLE_AND", - "DOUBLE_AND", "DOUBLE_VERTICAL_CYLINDER", "LESS_THAN", "MORE_THAN", "LESS_OR_EQUAl", - "MORE_OR_EQUAL", "OPEN_BRACKET", "CLOSE_BRACKET", "DOT", "OPEN_SQUARE_BRACKET", - "CLOSE_SQUARE_BRACKET", "COMMA", "NUMBER", "WHITESPACE", "IDENTIFIER", - "NEWLINE", "STRING", "CONSTANT", "INVALID_TOKEN_DEFAULT_MODE", "TEMPLATE", - "ESCAPE_CHARACTER", "TEXT_CONTENT", - ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(ExpressionAntlrParser._LITERAL_NAMES, ExpressionAntlrParser._SYMBOLIC_NAMES, []); - - // @Override - // @NotNull - public get vocabulary(): Vocabulary { - return ExpressionAntlrParser.VOCABULARY; - } - // tslint:enable:no-trailing-whitespace - - // @Override - public get grammarFileName(): string { return "ExpressionAntlrParser.g4"; } - - // @Override - public get ruleNames(): string[] { return ExpressionAntlrParser.ruleNames; } - - // @Override - public get serializedATN(): string { return ExpressionAntlrParser._serializedATN; } - - constructor(input: TokenStream) { - super(input); - this._interp = new ParserATNSimulator(ExpressionAntlrParser._ATN, this); - } - // @RuleVersion(0) - public file(): FileContext { - let _localctx: FileContext = new FileContext(this._ctx, this.state); - this.enterRule(_localctx, 0, ExpressionAntlrParser.RULE_file); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 12; - this.expression(0); - this.state = 13; - this.match(ExpressionAntlrParser.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, ExpressionAntlrParser.RULE_expression, _p); - let _la: number; - try { - let _alt: number; - this.enterOuterAlt(_localctx, 1); - { - this.state = 19; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case ExpressionAntlrParser.PLUS: - case ExpressionAntlrParser.SUBSTRACT: - case ExpressionAntlrParser.NON: - { - _localctx = new UnaryOpExpContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 16; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionAntlrParser.PLUS) | (1 << ExpressionAntlrParser.SUBSTRACT) | (1 << ExpressionAntlrParser.NON))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 17; - this.expression(10); - } - break; - case ExpressionAntlrParser.STRING_INTERPOLATION_START: - case ExpressionAntlrParser.OPEN_BRACKET: - case ExpressionAntlrParser.NUMBER: - case ExpressionAntlrParser.IDENTIFIER: - case ExpressionAntlrParser.STRING: - case ExpressionAntlrParser.CONSTANT: - { - _localctx = new PrimaryExpContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 18; - this.primaryExpression(0); - } - break; - default: - throw new NoViableAltException(this); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 47; - 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 = 45; - 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, ExpressionAntlrParser.RULE_expression); - this.state = 21; - if (!(this.precpred(this._ctx, 9))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 9)"); - } - this.state = 22; - this.match(ExpressionAntlrParser.XOR); - this.state = 23; - this.expression(9); - } - break; - - case 2: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); - this.state = 24; - if (!(this.precpred(this._ctx, 8))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 8)"); - } - this.state = 25; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionAntlrParser.ASTERISK) | (1 << ExpressionAntlrParser.SLASH) | (1 << ExpressionAntlrParser.PERCENT))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 26; - this.expression(9); - } - break; - - case 3: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); - this.state = 27; - if (!(this.precpred(this._ctx, 7))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 7)"); - } - this.state = 28; - _la = this._input.LA(1); - if (!(_la === ExpressionAntlrParser.PLUS || _la === ExpressionAntlrParser.SUBSTRACT)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 29; - this.expression(8); - } - break; - - case 4: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); - this.state = 30; - if (!(this.precpred(this._ctx, 6))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 6)"); - } - this.state = 31; - _la = this._input.LA(1); - if (!(_la === ExpressionAntlrParser.DOUBLE_EQUAL || _la === ExpressionAntlrParser.NOT_EQUAL)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 32; - this.expression(7); - } - break; - - case 5: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); - this.state = 33; - if (!(this.precpred(this._ctx, 5))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 5)"); - } - { - this.state = 34; - this.match(ExpressionAntlrParser.SINGLE_AND); - } - this.state = 35; - this.expression(6); - } - break; - - case 6: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); - this.state = 36; - if (!(this.precpred(this._ctx, 4))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 4)"); - } - this.state = 37; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionAntlrParser.LESS_THAN) | (1 << ExpressionAntlrParser.MORE_THAN) | (1 << ExpressionAntlrParser.LESS_OR_EQUAl) | (1 << ExpressionAntlrParser.MORE_OR_EQUAL))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 38; - this.expression(5); - } - break; - - case 7: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); - this.state = 39; - if (!(this.precpred(this._ctx, 3))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 3)"); - } - this.state = 40; - this.match(ExpressionAntlrParser.DOUBLE_AND); - this.state = 41; - this.expression(4); - } - break; - - case 8: - { - _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); - this.state = 42; - if (!(this.precpred(this._ctx, 2))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 2)"); - } - this.state = 43; - this.match(ExpressionAntlrParser.DOUBLE_VERTICAL_CYLINDER); - this.state = 44; - this.expression(3); - } - break; - } - } - } - this.state = 49; - 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, ExpressionAntlrParser.RULE_primaryExpression, _p); - let _la: number; - try { - let _alt: number; - this.enterOuterAlt(_localctx, 1); - { - this.state = 60; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case ExpressionAntlrParser.OPEN_BRACKET: - { - _localctx = new ParenthesisExpContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 51; - this.match(ExpressionAntlrParser.OPEN_BRACKET); - this.state = 52; - this.expression(0); - this.state = 53; - this.match(ExpressionAntlrParser.CLOSE_BRACKET); - } - break; - case ExpressionAntlrParser.CONSTANT: - { - _localctx = new ConstantAtomContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 55; - this.match(ExpressionAntlrParser.CONSTANT); - } - break; - case ExpressionAntlrParser.NUMBER: - { - _localctx = new NumericAtomContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 56; - this.match(ExpressionAntlrParser.NUMBER); - } - break; - case ExpressionAntlrParser.STRING: - { - _localctx = new StringAtomContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 57; - this.match(ExpressionAntlrParser.STRING); - } - break; - case ExpressionAntlrParser.IDENTIFIER: - { - _localctx = new IdAtomContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 58; - this.match(ExpressionAntlrParser.IDENTIFIER); - } - break; - case ExpressionAntlrParser.STRING_INTERPOLATION_START: - { - _localctx = new StringInterpolationAtomContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 59; - this.stringInterpolation(); - } - break; - default: - throw new NoViableAltException(this); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 81; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 7, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - this.state = 79; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 6, this._ctx) ) { - case 1: - { - _localctx = new MemberAccessExpContext(new PrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_primaryExpression); - this.state = 62; - if (!(this.precpred(this._ctx, 3))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 3)"); - } - this.state = 63; - this.match(ExpressionAntlrParser.DOT); - this.state = 64; - this.match(ExpressionAntlrParser.IDENTIFIER); - } - break; - - case 2: - { - _localctx = new FuncInvokeExpContext(new PrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_primaryExpression); - this.state = 65; - if (!(this.precpred(this._ctx, 2))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 2)"); - } - this.state = 67; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === ExpressionAntlrParser.NON) { - { - this.state = 66; - this.match(ExpressionAntlrParser.NON); - } - } - - this.state = 69; - this.match(ExpressionAntlrParser.OPEN_BRACKET); - this.state = 71; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionAntlrParser.STRING_INTERPOLATION_START) | (1 << ExpressionAntlrParser.PLUS) | (1 << ExpressionAntlrParser.SUBSTRACT) | (1 << ExpressionAntlrParser.NON) | (1 << ExpressionAntlrParser.OPEN_BRACKET) | (1 << ExpressionAntlrParser.NUMBER) | (1 << ExpressionAntlrParser.IDENTIFIER) | (1 << ExpressionAntlrParser.STRING) | (1 << ExpressionAntlrParser.CONSTANT))) !== 0)) { - { - this.state = 70; - this.argsList(); - } - } - - this.state = 73; - this.match(ExpressionAntlrParser.CLOSE_BRACKET); - } - break; - - case 3: - { - _localctx = new IndexAccessExpContext(new PrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_primaryExpression); - this.state = 74; - if (!(this.precpred(this._ctx, 1))) { - throw new FailedPredicateException(this, "this.precpred(this._ctx, 1)"); - } - this.state = 75; - this.match(ExpressionAntlrParser.OPEN_SQUARE_BRACKET); - this.state = 76; - this.expression(0); - this.state = 77; - this.match(ExpressionAntlrParser.CLOSE_SQUARE_BRACKET); - } - break; - } - } - } - this.state = 83; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 7, 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 stringInterpolation(): StringInterpolationContext { - let _localctx: StringInterpolationContext = new StringInterpolationContext(this._ctx, this.state); - this.enterRule(_localctx, 6, ExpressionAntlrParser.RULE_stringInterpolation); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 84; - this.match(ExpressionAntlrParser.STRING_INTERPOLATION_START); - this.state = 88; - this._errHandler.sync(this); - _la = this._input.LA(1); - do { - { - this.state = 88; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case ExpressionAntlrParser.ESCAPE_CHARACTER: - { - this.state = 85; - this.match(ExpressionAntlrParser.ESCAPE_CHARACTER); - } - break; - case ExpressionAntlrParser.TEMPLATE: - { - this.state = 86; - this.match(ExpressionAntlrParser.TEMPLATE); - } - break; - case ExpressionAntlrParser.TEXT_CONTENT: - { - this.state = 87; - this.textContent(); - } - break; - default: - throw new NoViableAltException(this); - } - } - this.state = 90; - this._errHandler.sync(this); - _la = this._input.LA(1); - } while (((((_la - 31)) & ~0x1F) === 0 && ((1 << (_la - 31)) & ((1 << (ExpressionAntlrParser.TEMPLATE - 31)) | (1 << (ExpressionAntlrParser.ESCAPE_CHARACTER - 31)) | (1 << (ExpressionAntlrParser.TEXT_CONTENT - 31)))) !== 0)); - this.state = 92; - this.match(ExpressionAntlrParser.STRING_INTERPOLATION_START); - } - } - 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 textContent(): TextContentContext { - let _localctx: TextContentContext = new TextContentContext(this._ctx, this.state); - this.enterRule(_localctx, 8, ExpressionAntlrParser.RULE_textContent); - try { - let _alt: number; - this.enterOuterAlt(_localctx, 1); - { - this.state = 95; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 94; - this.match(ExpressionAntlrParser.TEXT_CONTENT); - } - } - break; - default: - throw new NoViableAltException(this); - } - this.state = 97; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 10, 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 argsList(): ArgsListContext { - let _localctx: ArgsListContext = new ArgsListContext(this._ctx, this.state); - this.enterRule(_localctx, 10, ExpressionAntlrParser.RULE_argsList); - let _la: number; - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 99; - this.expression(0); - this.state = 104; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === ExpressionAntlrParser.COMMA) { - { - { - this.state = 100; - this.match(ExpressionAntlrParser.COMMA); - this.state = 101; - this.expression(0); - } - } - this.state = 106; - 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#n\x04\x02\t\x02" + - "\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07\t\x07" + - "\x03\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x05\x03\x16\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\x030\n\x03\f" + - "\x03\x0E\x033\v\x03\x03\x04\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\x05\x04F\n\x04\x03\x04\x03\x04\x05\x04J\n\x04\x03\x04\x03" + - "\x04\x03\x04\x03\x04\x03\x04\x03\x04\x07\x04R\n\x04\f\x04\x0E\x04U\v\x04" + - "\x03\x05\x03\x05\x03\x05\x03\x05\x06\x05[\n\x05\r\x05\x0E\x05\\\x03\x05" + - "\x03\x05\x03\x06\x06\x06b\n\x06\r\x06\x0E\x06c\x03\x07\x03\x07\x03\x07" + - "\x07\x07i\n\x07\f\x07\x0E\x07l\v\x07\x03\x07\x02\x02\x04\x04\x06\b\x02" + - "\x02\x04\x02\x06\x02\b\x02\n\x02\f\x02\x02\x07\x03\x02\x04\x06\x03\x02" + - "\b\n\x03\x02\x04\x05\x03\x02\v\f\x03\x02\x10\x13\x7F\x02\x0E\x03\x02\x02" + - "\x02\x04\x15\x03\x02\x02\x02\x06>\x03\x02\x02\x02\bV\x03\x02\x02\x02\n" + - "a\x03\x02\x02\x02\fe\x03\x02\x02\x02\x0E\x0F\x05\x04\x03\x02\x0F\x10\x07" + - "\x02\x02\x03\x10\x03\x03\x02\x02\x02\x11\x12\b\x03\x01\x02\x12\x13\t\x02" + - "\x02\x02\x13\x16\x05\x04\x03\f\x14\x16\x05\x06\x04\x02\x15\x11\x03\x02" + - "\x02\x02\x15\x14\x03\x02\x02\x02\x161\x03\x02\x02\x02\x17\x18\f\v\x02" + - "\x02\x18\x19\x07\x07\x02\x02\x190\x05\x04\x03\v\x1A\x1B\f\n\x02\x02\x1B" + - "\x1C\t\x03\x02\x02\x1C0\x05\x04\x03\v\x1D\x1E\f\t\x02\x02\x1E\x1F\t\x04" + - "\x02\x02\x1F0\x05\x04\x03\n !\f\b\x02\x02!\"\t\x05\x02\x02\"0\x05\x04" + - "\x03\t#$\f\x07\x02\x02$%\x07\r\x02\x02%0\x05\x04\x03\b&\'\f\x06\x02\x02" + - "\'(\t\x06\x02\x02(0\x05\x04\x03\x07)*\f\x05\x02\x02*+\x07\x0E\x02\x02" + - "+0\x05\x04\x03\x06,-\f\x04\x02\x02-.\x07\x0F\x02\x02.0\x05\x04\x03\x05" + - "/\x17\x03\x02\x02\x02/\x1A\x03\x02\x02\x02/\x1D\x03\x02\x02\x02/ \x03" + - "\x02\x02\x02/#\x03\x02\x02\x02/&\x03\x02\x02\x02/)\x03\x02\x02\x02/,\x03" + - "\x02\x02\x0203\x03\x02\x02\x021/\x03\x02\x02\x0212\x03\x02\x02\x022\x05" + - "\x03\x02\x02\x0231\x03\x02\x02\x0245\b\x04\x01\x0256\x07\x14\x02\x026" + - "7\x05\x04\x03\x0278\x07\x15\x02\x028?\x03\x02\x02\x029?\x07\x1F\x02\x02" + - ":?\x07\x1A\x02\x02;?\x07\x1E\x02\x024\x03\x02\x02\x02>9\x03\x02\x02\x02>:\x03\x02\x02\x02>;\x03\x02\x02\x02" + - "><\x03\x02\x02\x02>=\x03\x02\x02\x02?S\x03\x02\x02\x02@A\f\x05\x02\x02" + - "AB\x07\x16\x02\x02BR\x07\x1C\x02\x02CE\f\x04\x02\x02DF\x07\x06\x02\x02" + - "ED\x03\x02\x02\x02EF\x03\x02\x02\x02FG\x03\x02\x02\x02GI\x07\x14\x02\x02" + - "HJ\x05\f\x07\x02IH\x03\x02\x02\x02IJ\x03\x02\x02\x02JK\x03\x02\x02\x02" + - "KR\x07\x15\x02\x02LM\f\x03\x02\x02MN\x07\x17\x02\x02NO\x05\x04\x03\x02" + - "OP\x07\x18\x02\x02PR\x03\x02\x02\x02Q@\x03\x02\x02\x02QC\x03\x02\x02\x02" + - "QL\x03\x02\x02\x02RU\x03\x02\x02\x02SQ\x03\x02\x02\x02ST\x03\x02\x02\x02" + - "T\x07\x03\x02\x02\x02US\x03\x02\x02\x02VZ\x07\x03\x02\x02W[\x07\"\x02" + - "\x02X[\x07!\x02\x02Y[\x05\n\x06\x02ZW\x03\x02\x02\x02ZX\x03\x02\x02\x02" + - "ZY\x03\x02\x02\x02[\\\x03\x02\x02\x02\\Z\x03\x02\x02\x02\\]\x03\x02\x02" + - "\x02]^\x03\x02\x02\x02^_\x07\x03\x02\x02_\t\x03\x02\x02\x02`b\x07#\x02" + - "\x02a`\x03\x02\x02\x02bc\x03\x02\x02\x02ca\x03\x02\x02\x02cd\x03\x02\x02" + - "\x02d\v\x03\x02\x02\x02ej\x05\x04\x03\x02fg\x07\x19\x02\x02gi\x05\x04" + - "\x03\x02hf\x03\x02\x02\x02il\x03\x02\x02\x02jh\x03\x02\x02\x02jk\x03\x02" + - "\x02\x02k\r\x03\x02\x02\x02lj\x03\x02\x02\x02\x0E\x15/1>EIQSZ\\cj"; - public static __ATN: ATN; - public static get _ATN(): ATN { - if (!ExpressionAntlrParser.__ATN) { - ExpressionAntlrParser.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(ExpressionAntlrParser._serializedATN)); - } - - return ExpressionAntlrParser.__ATN; - } - -} - -export class FileContext extends ParserRuleContext { - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); - } - public EOF(): TerminalNode { return this.getToken(ExpressionAntlrParser.EOF, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return ExpressionAntlrParser.RULE_file; } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterFile) { - listener.enterFile(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitFile) { - listener.exitFile(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): 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 ExpressionAntlrParser.RULE_expression; } - public copyFrom(ctx: ExpressionContext): void { - super.copyFrom(ctx); - } -} -export class UnaryOpExpContext extends ExpressionContext { - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); - } - public NON(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.NON, 0); } - public SUBSTRACT(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.SUBSTRACT, 0); } - public PLUS(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.PLUS, 0); } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterUnaryOpExp) { - listener.enterUnaryOpExp(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitUnaryOpExp) { - listener.exitUnaryOpExp(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): 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); - } - } - public XOR(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.XOR, 0); } - public ASTERISK(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.ASTERISK, 0); } - public SLASH(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.SLASH, 0); } - public PERCENT(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.PERCENT, 0); } - public PLUS(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.PLUS, 0); } - public SUBSTRACT(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.SUBSTRACT, 0); } - public DOUBLE_EQUAL(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.DOUBLE_EQUAL, 0); } - public NOT_EQUAL(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.NOT_EQUAL, 0); } - public SINGLE_AND(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.SINGLE_AND, 0); } - public LESS_THAN(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.LESS_THAN, 0); } - public LESS_OR_EQUAl(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.LESS_OR_EQUAl, 0); } - public MORE_THAN(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.MORE_THAN, 0); } - public MORE_OR_EQUAL(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.MORE_OR_EQUAL, 0); } - public DOUBLE_AND(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.DOUBLE_AND, 0); } - public DOUBLE_VERTICAL_CYLINDER(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.DOUBLE_VERTICAL_CYLINDER, 0); } - constructor(ctx: ExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterBinaryOpExp) { - listener.enterBinaryOpExp(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitBinaryOpExp) { - listener.exitBinaryOpExp(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): 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: ExpressionAntlrParserListener): void { - if (listener.enterPrimaryExp) { - listener.enterPrimaryExp(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitPrimaryExp) { - listener.exitPrimaryExp(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): 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 ExpressionAntlrParser.RULE_primaryExpression; } - public copyFrom(ctx: PrimaryExpressionContext): void { - super.copyFrom(ctx); - } -} -export class FuncInvokeExpContext extends PrimaryExpressionContext { - public primaryExpression(): PrimaryExpressionContext { - return this.getRuleContext(0, PrimaryExpressionContext); - } - public OPEN_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.OPEN_BRACKET, 0); } - public CLOSE_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.CLOSE_BRACKET, 0); } - public NON(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.NON, 0); } - public argsList(): ArgsListContext | undefined { - return this.tryGetRuleContext(0, ArgsListContext); - } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterFuncInvokeExp) { - listener.enterFuncInvokeExp(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitFuncInvokeExp) { - listener.exitFuncInvokeExp(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): Result { - if (visitor.visitFuncInvokeExp) { - return visitor.visitFuncInvokeExp(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class ConstantAtomContext extends PrimaryExpressionContext { - public CONSTANT(): TerminalNode { return this.getToken(ExpressionAntlrParser.CONSTANT, 0); } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterConstantAtom) { - listener.enterConstantAtom(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitConstantAtom) { - listener.exitConstantAtom(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): Result { - if (visitor.visitConstantAtom) { - return visitor.visitConstantAtom(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class IdAtomContext extends PrimaryExpressionContext { - public IDENTIFIER(): TerminalNode { return this.getToken(ExpressionAntlrParser.IDENTIFIER, 0); } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterIdAtom) { - listener.enterIdAtom(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitIdAtom) { - listener.exitIdAtom(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): Result { - if (visitor.visitIdAtom) { - return visitor.visitIdAtom(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class StringAtomContext extends PrimaryExpressionContext { - public STRING(): TerminalNode { return this.getToken(ExpressionAntlrParser.STRING, 0); } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterStringAtom) { - listener.enterStringAtom(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitStringAtom) { - listener.exitStringAtom(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): 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 OPEN_SQUARE_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.OPEN_SQUARE_BRACKET, 0); } - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); - } - public CLOSE_SQUARE_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.CLOSE_SQUARE_BRACKET, 0); } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterIndexAccessExp) { - listener.enterIndexAccessExp(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitIndexAccessExp) { - listener.exitIndexAccessExp(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): Result { - if (visitor.visitIndexAccessExp) { - return visitor.visitIndexAccessExp(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class StringInterpolationAtomContext extends PrimaryExpressionContext { - public stringInterpolation(): StringInterpolationContext { - return this.getRuleContext(0, StringInterpolationContext); - } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterStringInterpolationAtom) { - listener.enterStringInterpolationAtom(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitStringInterpolationAtom) { - listener.exitStringInterpolationAtom(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): Result { - if (visitor.visitStringInterpolationAtom) { - return visitor.visitStringInterpolationAtom(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class MemberAccessExpContext extends PrimaryExpressionContext { - public primaryExpression(): PrimaryExpressionContext { - return this.getRuleContext(0, PrimaryExpressionContext); - } - public DOT(): TerminalNode { return this.getToken(ExpressionAntlrParser.DOT, 0); } - public IDENTIFIER(): TerminalNode { return this.getToken(ExpressionAntlrParser.IDENTIFIER, 0); } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterMemberAccessExp) { - listener.enterMemberAccessExp(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitMemberAccessExp) { - listener.exitMemberAccessExp(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): Result { - if (visitor.visitMemberAccessExp) { - return visitor.visitMemberAccessExp(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class ParenthesisExpContext extends PrimaryExpressionContext { - public OPEN_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.OPEN_BRACKET, 0); } - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); - } - public CLOSE_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.CLOSE_BRACKET, 0); } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterParenthesisExp) { - listener.enterParenthesisExp(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitParenthesisExp) { - listener.exitParenthesisExp(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): Result { - if (visitor.visitParenthesisExp) { - return visitor.visitParenthesisExp(this); - } else { - return visitor.visitChildren(this); - } - } -} -export class NumericAtomContext extends PrimaryExpressionContext { - public NUMBER(): TerminalNode { return this.getToken(ExpressionAntlrParser.NUMBER, 0); } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterNumericAtom) { - listener.enterNumericAtom(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitNumericAtom) { - listener.exitNumericAtom(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): Result { - if (visitor.visitNumericAtom) { - return visitor.visitNumericAtom(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class StringInterpolationContext extends ParserRuleContext { - public STRING_INTERPOLATION_START(): TerminalNode[]; - public STRING_INTERPOLATION_START(i: number): TerminalNode; - public STRING_INTERPOLATION_START(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(ExpressionAntlrParser.STRING_INTERPOLATION_START); - } else { - return this.getToken(ExpressionAntlrParser.STRING_INTERPOLATION_START, i); - } - } - public ESCAPE_CHARACTER(): TerminalNode[]; - public ESCAPE_CHARACTER(i: number): TerminalNode; - public ESCAPE_CHARACTER(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(ExpressionAntlrParser.ESCAPE_CHARACTER); - } else { - return this.getToken(ExpressionAntlrParser.ESCAPE_CHARACTER, i); - } - } - public TEMPLATE(): TerminalNode[]; - public TEMPLATE(i: number): TerminalNode; - public TEMPLATE(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(ExpressionAntlrParser.TEMPLATE); - } else { - return this.getToken(ExpressionAntlrParser.TEMPLATE, i); - } - } - public textContent(): TextContentContext[]; - public textContent(i: number): TextContentContext; - public textContent(i?: number): TextContentContext | TextContentContext[] { - if (i === undefined) { - return this.getRuleContexts(TextContentContext); - } else { - return this.getRuleContext(i, TextContentContext); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return ExpressionAntlrParser.RULE_stringInterpolation; } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterStringInterpolation) { - listener.enterStringInterpolation(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitStringInterpolation) { - listener.exitStringInterpolation(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): Result { - if (visitor.visitStringInterpolation) { - return visitor.visitStringInterpolation(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class TextContentContext extends ParserRuleContext { - public TEXT_CONTENT(): TerminalNode[]; - public TEXT_CONTENT(i: number): TerminalNode; - public TEXT_CONTENT(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(ExpressionAntlrParser.TEXT_CONTENT); - } else { - return this.getToken(ExpressionAntlrParser.TEXT_CONTENT, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return ExpressionAntlrParser.RULE_textContent; } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterTextContent) { - listener.enterTextContent(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitTextContent) { - listener.exitTextContent(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): Result { - if (visitor.visitTextContent) { - return visitor.visitTextContent(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); - } - } - public COMMA(): TerminalNode[]; - public COMMA(i: number): TerminalNode; - public COMMA(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(ExpressionAntlrParser.COMMA); - } else { - return this.getToken(ExpressionAntlrParser.COMMA, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return ExpressionAntlrParser.RULE_argsList; } - // @Override - public enterRule(listener: ExpressionAntlrParserListener): void { - if (listener.enterArgsList) { - listener.enterArgsList(this); - } - } - // @Override - public exitRule(listener: ExpressionAntlrParserListener): void { - if (listener.exitArgsList) { - listener.exitArgsList(this); - } - } - // @Override - public accept(visitor: ExpressionAntlrParserVisitor): Result { - if (visitor.visitArgsList) { - return visitor.visitArgsList(this); - } else { - return visitor.visitChildren(this); - } - } -} - - +// Generated from ../ExpressionAntlrParser.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 { ExpressionAntlrParserListener } from "./ExpressionAntlrParserListener"; +import { ExpressionAntlrParserVisitor } from "./ExpressionAntlrParserVisitor"; + + +export class ExpressionAntlrParser extends Parser { + public static readonly STRING_INTERPOLATION_START = 1; + public static readonly PLUS = 2; + public static readonly SUBSTRACT = 3; + public static readonly NON = 4; + public static readonly XOR = 5; + public static readonly ASTERISK = 6; + public static readonly SLASH = 7; + public static readonly PERCENT = 8; + public static readonly DOUBLE_EQUAL = 9; + public static readonly NOT_EQUAL = 10; + public static readonly SINGLE_AND = 11; + public static readonly DOUBLE_AND = 12; + public static readonly DOUBLE_VERTICAL_CYLINDER = 13; + public static readonly LESS_THAN = 14; + public static readonly MORE_THAN = 15; + public static readonly LESS_OR_EQUAl = 16; + public static readonly MORE_OR_EQUAL = 17; + public static readonly OPEN_BRACKET = 18; + public static readonly CLOSE_BRACKET = 19; + public static readonly DOT = 20; + public static readonly OPEN_SQUARE_BRACKET = 21; + public static readonly CLOSE_SQUARE_BRACKET = 22; + public static readonly COMMA = 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 TEMPLATE = 31; + public static readonly ESCAPE_CHARACTER = 32; + public static readonly TEXT_CONTENT = 33; + public static readonly RULE_file = 0; + public static readonly RULE_expression = 1; + public static readonly RULE_primaryExpression = 2; + public static readonly RULE_stringInterpolation = 3; + public static readonly RULE_textContent = 4; + public static readonly RULE_argsList = 5; + // tslint:disable:no-trailing-whitespace + public static readonly ruleNames: string[] = [ + "file", "expression", "primaryExpression", "stringInterpolation", "textContent", + "argsList", + ]; + + private static readonly _LITERAL_NAMES: Array = [ + undefined, undefined, "'+'", "'-'", "'!'", "'^'", "'*'", "'/'", "'%'", + "'=='", undefined, "'&'", "'&&'", "'||'", "'<'", "'>'", "'<='", "'>='", + "'('", "')'", "'.'", "'['", "']'", "','", + ]; + private static readonly _SYMBOLIC_NAMES: Array = [ + undefined, "STRING_INTERPOLATION_START", "PLUS", "SUBSTRACT", "NON", "XOR", + "ASTERISK", "SLASH", "PERCENT", "DOUBLE_EQUAL", "NOT_EQUAL", "SINGLE_AND", + "DOUBLE_AND", "DOUBLE_VERTICAL_CYLINDER", "LESS_THAN", "MORE_THAN", "LESS_OR_EQUAl", + "MORE_OR_EQUAL", "OPEN_BRACKET", "CLOSE_BRACKET", "DOT", "OPEN_SQUARE_BRACKET", + "CLOSE_SQUARE_BRACKET", "COMMA", "NUMBER", "WHITESPACE", "IDENTIFIER", + "NEWLINE", "STRING", "CONSTANT", "INVALID_TOKEN_DEFAULT_MODE", "TEMPLATE", + "ESCAPE_CHARACTER", "TEXT_CONTENT", + ]; + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(ExpressionAntlrParser._LITERAL_NAMES, ExpressionAntlrParser._SYMBOLIC_NAMES, []); + + // @Override + // @NotNull + public get vocabulary(): Vocabulary { + return ExpressionAntlrParser.VOCABULARY; + } + // tslint:enable:no-trailing-whitespace + + // @Override + public get grammarFileName(): string { return "ExpressionAntlrParser.g4"; } + + // @Override + public get ruleNames(): string[] { return ExpressionAntlrParser.ruleNames; } + + // @Override + public get serializedATN(): string { return ExpressionAntlrParser._serializedATN; } + + constructor(input: TokenStream) { + super(input); + this._interp = new ParserATNSimulator(ExpressionAntlrParser._ATN, this); + } + // @RuleVersion(0) + public file(): FileContext { + let _localctx: FileContext = new FileContext(this._ctx, this.state); + this.enterRule(_localctx, 0, ExpressionAntlrParser.RULE_file); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 12; + this.expression(0); + this.state = 13; + this.match(ExpressionAntlrParser.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, ExpressionAntlrParser.RULE_expression, _p); + let _la: number; + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 19; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case ExpressionAntlrParser.PLUS: + case ExpressionAntlrParser.SUBSTRACT: + case ExpressionAntlrParser.NON: + { + _localctx = new UnaryOpExpContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 16; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionAntlrParser.PLUS) | (1 << ExpressionAntlrParser.SUBSTRACT) | (1 << ExpressionAntlrParser.NON))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 17; + this.expression(10); + } + break; + case ExpressionAntlrParser.STRING_INTERPOLATION_START: + case ExpressionAntlrParser.OPEN_BRACKET: + case ExpressionAntlrParser.OPEN_SQUARE_BRACKET: + case ExpressionAntlrParser.NUMBER: + case ExpressionAntlrParser.IDENTIFIER: + case ExpressionAntlrParser.STRING: + case ExpressionAntlrParser.CONSTANT: + { + _localctx = new PrimaryExpContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 18; + this.primaryExpression(0); + } + break; + default: + throw new NoViableAltException(this); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 47; + 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 = 45; + 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, ExpressionAntlrParser.RULE_expression); + this.state = 21; + if (!(this.precpred(this._ctx, 9))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 9)"); + } + this.state = 22; + this.match(ExpressionAntlrParser.XOR); + this.state = 23; + this.expression(9); + } + break; + + case 2: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); + this.state = 24; + if (!(this.precpred(this._ctx, 8))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 8)"); + } + this.state = 25; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionAntlrParser.ASTERISK) | (1 << ExpressionAntlrParser.SLASH) | (1 << ExpressionAntlrParser.PERCENT))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 26; + this.expression(9); + } + break; + + case 3: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); + this.state = 27; + if (!(this.precpred(this._ctx, 7))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 7)"); + } + this.state = 28; + _la = this._input.LA(1); + if (!(_la === ExpressionAntlrParser.PLUS || _la === ExpressionAntlrParser.SUBSTRACT)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 29; + this.expression(8); + } + break; + + case 4: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); + this.state = 30; + if (!(this.precpred(this._ctx, 6))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 6)"); + } + this.state = 31; + _la = this._input.LA(1); + if (!(_la === ExpressionAntlrParser.DOUBLE_EQUAL || _la === ExpressionAntlrParser.NOT_EQUAL)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 32; + this.expression(7); + } + break; + + case 5: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); + this.state = 33; + if (!(this.precpred(this._ctx, 5))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 5)"); + } + { + this.state = 34; + this.match(ExpressionAntlrParser.SINGLE_AND); + } + this.state = 35; + this.expression(6); + } + break; + + case 6: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); + this.state = 36; + if (!(this.precpred(this._ctx, 4))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 4)"); + } + this.state = 37; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionAntlrParser.LESS_THAN) | (1 << ExpressionAntlrParser.MORE_THAN) | (1 << ExpressionAntlrParser.LESS_OR_EQUAl) | (1 << ExpressionAntlrParser.MORE_OR_EQUAL))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 38; + this.expression(5); + } + break; + + case 7: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); + this.state = 39; + if (!(this.precpred(this._ctx, 3))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 3)"); + } + this.state = 40; + this.match(ExpressionAntlrParser.DOUBLE_AND); + this.state = 41; + this.expression(4); + } + break; + + case 8: + { + _localctx = new BinaryOpExpContext(new ExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_expression); + this.state = 42; + if (!(this.precpred(this._ctx, 2))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 2)"); + } + this.state = 43; + this.match(ExpressionAntlrParser.DOUBLE_VERTICAL_CYLINDER); + this.state = 44; + this.expression(3); + } + break; + } + } + } + this.state = 49; + 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, ExpressionAntlrParser.RULE_primaryExpression, _p); + let _la: number; + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 65; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case ExpressionAntlrParser.OPEN_BRACKET: + { + _localctx = new ParenthesisExpContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 51; + this.match(ExpressionAntlrParser.OPEN_BRACKET); + this.state = 52; + this.expression(0); + this.state = 53; + this.match(ExpressionAntlrParser.CLOSE_BRACKET); + } + break; + case ExpressionAntlrParser.OPEN_SQUARE_BRACKET: + { + _localctx = new ArrayCreationExpContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 55; + this.match(ExpressionAntlrParser.OPEN_SQUARE_BRACKET); + this.state = 57; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionAntlrParser.STRING_INTERPOLATION_START) | (1 << ExpressionAntlrParser.PLUS) | (1 << ExpressionAntlrParser.SUBSTRACT) | (1 << ExpressionAntlrParser.NON) | (1 << ExpressionAntlrParser.OPEN_BRACKET) | (1 << ExpressionAntlrParser.OPEN_SQUARE_BRACKET) | (1 << ExpressionAntlrParser.NUMBER) | (1 << ExpressionAntlrParser.IDENTIFIER) | (1 << ExpressionAntlrParser.STRING) | (1 << ExpressionAntlrParser.CONSTANT))) !== 0)) { + { + this.state = 56; + this.argsList(); + } + } + + this.state = 59; + this.match(ExpressionAntlrParser.CLOSE_SQUARE_BRACKET); + } + break; + case ExpressionAntlrParser.CONSTANT: + { + _localctx = new ConstantAtomContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 60; + this.match(ExpressionAntlrParser.CONSTANT); + } + break; + case ExpressionAntlrParser.NUMBER: + { + _localctx = new NumericAtomContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 61; + this.match(ExpressionAntlrParser.NUMBER); + } + break; + case ExpressionAntlrParser.STRING: + { + _localctx = new StringAtomContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 62; + this.match(ExpressionAntlrParser.STRING); + } + break; + case ExpressionAntlrParser.IDENTIFIER: + { + _localctx = new IdAtomContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 63; + this.match(ExpressionAntlrParser.IDENTIFIER); + } + break; + case ExpressionAntlrParser.STRING_INTERPOLATION_START: + { + _localctx = new StringInterpolationAtomContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 64; + this.stringInterpolation(); + } + break; + default: + throw new NoViableAltException(this); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 86; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 8, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + this.state = 84; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 7, this._ctx) ) { + case 1: + { + _localctx = new MemberAccessExpContext(new PrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_primaryExpression); + this.state = 67; + if (!(this.precpred(this._ctx, 3))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 3)"); + } + this.state = 68; + this.match(ExpressionAntlrParser.DOT); + this.state = 69; + this.match(ExpressionAntlrParser.IDENTIFIER); + } + break; + + case 2: + { + _localctx = new FuncInvokeExpContext(new PrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_primaryExpression); + this.state = 70; + if (!(this.precpred(this._ctx, 2))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 2)"); + } + this.state = 72; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === ExpressionAntlrParser.NON) { + { + this.state = 71; + this.match(ExpressionAntlrParser.NON); + } + } + + this.state = 74; + this.match(ExpressionAntlrParser.OPEN_BRACKET); + this.state = 76; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ExpressionAntlrParser.STRING_INTERPOLATION_START) | (1 << ExpressionAntlrParser.PLUS) | (1 << ExpressionAntlrParser.SUBSTRACT) | (1 << ExpressionAntlrParser.NON) | (1 << ExpressionAntlrParser.OPEN_BRACKET) | (1 << ExpressionAntlrParser.OPEN_SQUARE_BRACKET) | (1 << ExpressionAntlrParser.NUMBER) | (1 << ExpressionAntlrParser.IDENTIFIER) | (1 << ExpressionAntlrParser.STRING) | (1 << ExpressionAntlrParser.CONSTANT))) !== 0)) { + { + this.state = 75; + this.argsList(); + } + } + + this.state = 78; + this.match(ExpressionAntlrParser.CLOSE_BRACKET); + } + break; + + case 3: + { + _localctx = new IndexAccessExpContext(new PrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, ExpressionAntlrParser.RULE_primaryExpression); + this.state = 79; + if (!(this.precpred(this._ctx, 1))) { + throw new FailedPredicateException(this, "this.precpred(this._ctx, 1)"); + } + this.state = 80; + this.match(ExpressionAntlrParser.OPEN_SQUARE_BRACKET); + this.state = 81; + this.expression(0); + this.state = 82; + this.match(ExpressionAntlrParser.CLOSE_SQUARE_BRACKET); + } + break; + } + } + } + this.state = 88; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 8, 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 stringInterpolation(): StringInterpolationContext { + let _localctx: StringInterpolationContext = new StringInterpolationContext(this._ctx, this.state); + this.enterRule(_localctx, 6, ExpressionAntlrParser.RULE_stringInterpolation); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 89; + this.match(ExpressionAntlrParser.STRING_INTERPOLATION_START); + this.state = 93; + this._errHandler.sync(this); + _la = this._input.LA(1); + do { + { + this.state = 93; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case ExpressionAntlrParser.ESCAPE_CHARACTER: + { + this.state = 90; + this.match(ExpressionAntlrParser.ESCAPE_CHARACTER); + } + break; + case ExpressionAntlrParser.TEMPLATE: + { + this.state = 91; + this.match(ExpressionAntlrParser.TEMPLATE); + } + break; + case ExpressionAntlrParser.TEXT_CONTENT: + { + this.state = 92; + this.textContent(); + } + break; + default: + throw new NoViableAltException(this); + } + } + this.state = 95; + this._errHandler.sync(this); + _la = this._input.LA(1); + } while (((((_la - 31)) & ~0x1F) === 0 && ((1 << (_la - 31)) & ((1 << (ExpressionAntlrParser.TEMPLATE - 31)) | (1 << (ExpressionAntlrParser.ESCAPE_CHARACTER - 31)) | (1 << (ExpressionAntlrParser.TEXT_CONTENT - 31)))) !== 0)); + this.state = 97; + this.match(ExpressionAntlrParser.STRING_INTERPOLATION_START); + } + } + 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 textContent(): TextContentContext { + let _localctx: TextContentContext = new TextContentContext(this._ctx, this.state); + this.enterRule(_localctx, 8, ExpressionAntlrParser.RULE_textContent); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 100; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 99; + this.match(ExpressionAntlrParser.TEXT_CONTENT); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 102; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 11, 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 argsList(): ArgsListContext { + let _localctx: ArgsListContext = new ArgsListContext(this._ctx, this.state); + this.enterRule(_localctx, 10, ExpressionAntlrParser.RULE_argsList); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 104; + this.expression(0); + this.state = 109; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === ExpressionAntlrParser.COMMA) { + { + { + this.state = 105; + this.match(ExpressionAntlrParser.COMMA); + this.state = 106; + this.expression(0); + } + } + this.state = 111; + 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#s\x04\x02\t\x02" + + "\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07\t\x07" + + "\x03\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x05\x03\x16\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\x030\n\x03\f" + + "\x03\x0E\x033\v\x03\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" + + "\x04D\n\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x05\x04K\n\x04\x03" + + "\x04\x03\x04\x05\x04O\n\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03" + + "\x04\x07\x04W\n\x04\f\x04\x0E\x04Z\v\x04\x03\x05\x03\x05\x03\x05\x03\x05" + + "\x06\x05`\n\x05\r\x05\x0E\x05a\x03\x05\x03\x05\x03\x06\x06\x06g\n\x06" + + "\r\x06\x0E\x06h\x03\x07\x03\x07\x03\x07\x07\x07n\n\x07\f\x07\x0E\x07q" + + "\v\x07\x03\x07\x02\x02\x04\x04\x06\b\x02\x02\x04\x02\x06\x02\b\x02\n\x02" + + "\f\x02\x02\x07\x03\x02\x04\x06\x03\x02\b\n\x03\x02\x04\x05\x03\x02\v\f" + + "\x03\x02\x10\x13\x86\x02\x0E\x03\x02\x02\x02\x04\x15\x03\x02\x02\x02\x06" + + "C\x03\x02\x02\x02\b[\x03\x02\x02\x02\nf\x03\x02\x02\x02\fj\x03\x02\x02" + + "\x02\x0E\x0F\x05\x04\x03\x02\x0F\x10\x07\x02\x02\x03\x10\x03\x03\x02\x02" + + "\x02\x11\x12\b\x03\x01\x02\x12\x13\t\x02\x02\x02\x13\x16\x05\x04\x03\f" + + "\x14\x16\x05\x06\x04\x02\x15\x11\x03\x02\x02\x02\x15\x14\x03\x02\x02\x02" + + "\x161\x03\x02\x02\x02\x17\x18\f\v\x02\x02\x18\x19\x07\x07\x02\x02\x19" + + "0\x05\x04\x03\v\x1A\x1B\f\n\x02\x02\x1B\x1C\t\x03\x02\x02\x1C0\x05\x04" + + "\x03\v\x1D\x1E\f\t\x02\x02\x1E\x1F\t\x04\x02\x02\x1F0\x05\x04\x03\n !" + + "\f\b\x02\x02!\"\t\x05\x02\x02\"0\x05\x04\x03\t#$\f\x07\x02\x02$%\x07\r" + + "\x02\x02%0\x05\x04\x03\b&\'\f\x06\x02\x02\'(\t\x06\x02\x02(0\x05\x04\x03" + + "\x07)*\f\x05\x02\x02*+\x07\x0E\x02\x02+0\x05\x04\x03\x06,-\f\x04\x02\x02" + + "-.\x07\x0F\x02\x02.0\x05\x04\x03\x05/\x17\x03\x02\x02\x02/\x1A\x03\x02" + + "\x02\x02/\x1D\x03\x02\x02\x02/ \x03\x02\x02\x02/#\x03\x02\x02\x02/&\x03" + + "\x02\x02\x02/)\x03\x02\x02\x02/,\x03\x02\x02\x0203\x03\x02\x02\x021/\x03" + + "\x02\x02\x0212\x03\x02\x02\x022\x05\x03\x02\x02\x0231\x03\x02\x02\x02" + + "45\b\x04\x01\x0256\x07\x14\x02\x0267\x05\x04\x03\x0278\x07\x15\x02\x02" + + "8D\x03\x02\x02\x029;\x07\x17\x02\x02:<\x05\f\x07\x02;:\x03\x02\x02\x02" + + ";<\x03\x02\x02\x02<=\x03\x02\x02\x02=D\x07\x18\x02\x02>D\x07\x1F\x02\x02" + + "?D\x07\x1A\x02\x02@D\x07\x1E\x02\x02AD\x07\x1C\x02\x02BD\x05\b\x05\x02" + + "C4\x03\x02\x02\x02C9\x03\x02\x02\x02C>\x03\x02\x02\x02C?\x03\x02\x02\x02" + + "C@\x03\x02\x02\x02CA\x03\x02\x02\x02CB\x03\x02\x02\x02DX\x03\x02\x02\x02" + + "EF\f\x05\x02\x02FG\x07\x16\x02\x02GW\x07\x1C\x02\x02HJ\f\x04\x02\x02I" + + "K\x07\x06\x02\x02JI\x03\x02\x02\x02JK\x03\x02\x02\x02KL\x03\x02\x02\x02" + + "LN\x07\x14\x02\x02MO\x05\f\x07\x02NM\x03\x02\x02\x02NO\x03\x02\x02\x02" + + "OP\x03\x02\x02\x02PW\x07\x15\x02\x02QR\f\x03\x02\x02RS\x07\x17\x02\x02" + + "ST\x05\x04\x03\x02TU\x07\x18\x02\x02UW\x03\x02\x02\x02VE\x03\x02\x02\x02" + + "VH\x03\x02\x02\x02VQ\x03\x02\x02\x02WZ\x03\x02\x02\x02XV\x03\x02\x02\x02" + + "XY\x03\x02\x02\x02Y\x07\x03\x02\x02\x02ZX\x03\x02\x02\x02[_\x07\x03\x02" + + "\x02\\`\x07\"\x02\x02]`\x07!\x02\x02^`\x05\n\x06\x02_\\\x03\x02\x02\x02" + + "_]\x03\x02\x02\x02_^\x03\x02\x02\x02`a\x03\x02\x02\x02a_\x03\x02\x02\x02" + + "ab\x03\x02\x02\x02bc\x03\x02\x02\x02cd\x07\x03\x02\x02d\t\x03\x02\x02" + + "\x02eg\x07#\x02\x02fe\x03\x02\x02\x02gh\x03\x02\x02\x02hf\x03\x02\x02" + + "\x02hi\x03\x02\x02\x02i\v\x03\x02\x02\x02jo\x05\x04\x03\x02kl\x07\x19" + + "\x02\x02ln\x05\x04\x03\x02mk\x03\x02\x02\x02nq\x03\x02\x02\x02om\x03\x02" + + "\x02\x02op\x03\x02\x02\x02p\r\x03\x02\x02\x02qo\x03\x02\x02\x02\x0F\x15" + + "/1;CJNVX_aho"; + public static __ATN: ATN; + public static get _ATN(): ATN { + if (!ExpressionAntlrParser.__ATN) { + ExpressionAntlrParser.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(ExpressionAntlrParser._serializedATN)); + } + + return ExpressionAntlrParser.__ATN; + } + +} + +export class FileContext extends ParserRuleContext { + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); + } + public EOF(): TerminalNode { return this.getToken(ExpressionAntlrParser.EOF, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return ExpressionAntlrParser.RULE_file; } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterFile) { + listener.enterFile(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitFile) { + listener.exitFile(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): 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 ExpressionAntlrParser.RULE_expression; } + public copyFrom(ctx: ExpressionContext): void { + super.copyFrom(ctx); + } +} +export class UnaryOpExpContext extends ExpressionContext { + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); + } + public NON(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.NON, 0); } + public SUBSTRACT(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.SUBSTRACT, 0); } + public PLUS(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.PLUS, 0); } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterUnaryOpExp) { + listener.enterUnaryOpExp(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitUnaryOpExp) { + listener.exitUnaryOpExp(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): 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); + } + } + public XOR(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.XOR, 0); } + public ASTERISK(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.ASTERISK, 0); } + public SLASH(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.SLASH, 0); } + public PERCENT(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.PERCENT, 0); } + public PLUS(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.PLUS, 0); } + public SUBSTRACT(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.SUBSTRACT, 0); } + public DOUBLE_EQUAL(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.DOUBLE_EQUAL, 0); } + public NOT_EQUAL(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.NOT_EQUAL, 0); } + public SINGLE_AND(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.SINGLE_AND, 0); } + public LESS_THAN(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.LESS_THAN, 0); } + public LESS_OR_EQUAl(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.LESS_OR_EQUAl, 0); } + public MORE_THAN(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.MORE_THAN, 0); } + public MORE_OR_EQUAL(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.MORE_OR_EQUAL, 0); } + public DOUBLE_AND(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.DOUBLE_AND, 0); } + public DOUBLE_VERTICAL_CYLINDER(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.DOUBLE_VERTICAL_CYLINDER, 0); } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterBinaryOpExp) { + listener.enterBinaryOpExp(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitBinaryOpExp) { + listener.exitBinaryOpExp(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): 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: ExpressionAntlrParserListener): void { + if (listener.enterPrimaryExp) { + listener.enterPrimaryExp(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitPrimaryExp) { + listener.exitPrimaryExp(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): 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 ExpressionAntlrParser.RULE_primaryExpression; } + public copyFrom(ctx: PrimaryExpressionContext): void { + super.copyFrom(ctx); + } +} +export class FuncInvokeExpContext extends PrimaryExpressionContext { + public primaryExpression(): PrimaryExpressionContext { + return this.getRuleContext(0, PrimaryExpressionContext); + } + public OPEN_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.OPEN_BRACKET, 0); } + public CLOSE_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.CLOSE_BRACKET, 0); } + public NON(): TerminalNode | undefined { return this.tryGetToken(ExpressionAntlrParser.NON, 0); } + public argsList(): ArgsListContext | undefined { + return this.tryGetRuleContext(0, ArgsListContext); + } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterFuncInvokeExp) { + listener.enterFuncInvokeExp(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitFuncInvokeExp) { + listener.exitFuncInvokeExp(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): Result { + if (visitor.visitFuncInvokeExp) { + return visitor.visitFuncInvokeExp(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class ConstantAtomContext extends PrimaryExpressionContext { + public CONSTANT(): TerminalNode { return this.getToken(ExpressionAntlrParser.CONSTANT, 0); } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterConstantAtom) { + listener.enterConstantAtom(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitConstantAtom) { + listener.exitConstantAtom(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): Result { + if (visitor.visitConstantAtom) { + return visitor.visitConstantAtom(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class IdAtomContext extends PrimaryExpressionContext { + public IDENTIFIER(): TerminalNode { return this.getToken(ExpressionAntlrParser.IDENTIFIER, 0); } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterIdAtom) { + listener.enterIdAtom(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitIdAtom) { + listener.exitIdAtom(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): Result { + if (visitor.visitIdAtom) { + return visitor.visitIdAtom(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class StringAtomContext extends PrimaryExpressionContext { + public STRING(): TerminalNode { return this.getToken(ExpressionAntlrParser.STRING, 0); } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterStringAtom) { + listener.enterStringAtom(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitStringAtom) { + listener.exitStringAtom(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): 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 OPEN_SQUARE_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.OPEN_SQUARE_BRACKET, 0); } + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); + } + public CLOSE_SQUARE_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.CLOSE_SQUARE_BRACKET, 0); } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterIndexAccessExp) { + listener.enterIndexAccessExp(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitIndexAccessExp) { + listener.exitIndexAccessExp(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): Result { + if (visitor.visitIndexAccessExp) { + return visitor.visitIndexAccessExp(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class StringInterpolationAtomContext extends PrimaryExpressionContext { + public stringInterpolation(): StringInterpolationContext { + return this.getRuleContext(0, StringInterpolationContext); + } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterStringInterpolationAtom) { + listener.enterStringInterpolationAtom(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitStringInterpolationAtom) { + listener.exitStringInterpolationAtom(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): Result { + if (visitor.visitStringInterpolationAtom) { + return visitor.visitStringInterpolationAtom(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class MemberAccessExpContext extends PrimaryExpressionContext { + public primaryExpression(): PrimaryExpressionContext { + return this.getRuleContext(0, PrimaryExpressionContext); + } + public DOT(): TerminalNode { return this.getToken(ExpressionAntlrParser.DOT, 0); } + public IDENTIFIER(): TerminalNode { return this.getToken(ExpressionAntlrParser.IDENTIFIER, 0); } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterMemberAccessExp) { + listener.enterMemberAccessExp(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitMemberAccessExp) { + listener.exitMemberAccessExp(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): Result { + if (visitor.visitMemberAccessExp) { + return visitor.visitMemberAccessExp(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class ParenthesisExpContext extends PrimaryExpressionContext { + public OPEN_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.OPEN_BRACKET, 0); } + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); + } + public CLOSE_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.CLOSE_BRACKET, 0); } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterParenthesisExp) { + listener.enterParenthesisExp(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitParenthesisExp) { + listener.exitParenthesisExp(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): Result { + if (visitor.visitParenthesisExp) { + return visitor.visitParenthesisExp(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class NumericAtomContext extends PrimaryExpressionContext { + public NUMBER(): TerminalNode { return this.getToken(ExpressionAntlrParser.NUMBER, 0); } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterNumericAtom) { + listener.enterNumericAtom(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitNumericAtom) { + listener.exitNumericAtom(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): Result { + if (visitor.visitNumericAtom) { + return visitor.visitNumericAtom(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class ArrayCreationExpContext extends PrimaryExpressionContext { + public OPEN_SQUARE_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.OPEN_SQUARE_BRACKET, 0); } + public CLOSE_SQUARE_BRACKET(): TerminalNode { return this.getToken(ExpressionAntlrParser.CLOSE_SQUARE_BRACKET, 0); } + public argsList(): ArgsListContext | undefined { + return this.tryGetRuleContext(0, ArgsListContext); + } + constructor(ctx: PrimaryExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterArrayCreationExp) { + listener.enterArrayCreationExp(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitArrayCreationExp) { + listener.exitArrayCreationExp(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): Result { + if (visitor.visitArrayCreationExp) { + return visitor.visitArrayCreationExp(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class StringInterpolationContext extends ParserRuleContext { + public STRING_INTERPOLATION_START(): TerminalNode[]; + public STRING_INTERPOLATION_START(i: number): TerminalNode; + public STRING_INTERPOLATION_START(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(ExpressionAntlrParser.STRING_INTERPOLATION_START); + } else { + return this.getToken(ExpressionAntlrParser.STRING_INTERPOLATION_START, i); + } + } + public ESCAPE_CHARACTER(): TerminalNode[]; + public ESCAPE_CHARACTER(i: number): TerminalNode; + public ESCAPE_CHARACTER(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(ExpressionAntlrParser.ESCAPE_CHARACTER); + } else { + return this.getToken(ExpressionAntlrParser.ESCAPE_CHARACTER, i); + } + } + public TEMPLATE(): TerminalNode[]; + public TEMPLATE(i: number): TerminalNode; + public TEMPLATE(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(ExpressionAntlrParser.TEMPLATE); + } else { + return this.getToken(ExpressionAntlrParser.TEMPLATE, i); + } + } + public textContent(): TextContentContext[]; + public textContent(i: number): TextContentContext; + public textContent(i?: number): TextContentContext | TextContentContext[] { + if (i === undefined) { + return this.getRuleContexts(TextContentContext); + } else { + return this.getRuleContext(i, TextContentContext); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return ExpressionAntlrParser.RULE_stringInterpolation; } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterStringInterpolation) { + listener.enterStringInterpolation(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitStringInterpolation) { + listener.exitStringInterpolation(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): Result { + if (visitor.visitStringInterpolation) { + return visitor.visitStringInterpolation(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class TextContentContext extends ParserRuleContext { + public TEXT_CONTENT(): TerminalNode[]; + public TEXT_CONTENT(i: number): TerminalNode; + public TEXT_CONTENT(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(ExpressionAntlrParser.TEXT_CONTENT); + } else { + return this.getToken(ExpressionAntlrParser.TEXT_CONTENT, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return ExpressionAntlrParser.RULE_textContent; } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterTextContent) { + listener.enterTextContent(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitTextContent) { + listener.exitTextContent(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): Result { + if (visitor.visitTextContent) { + return visitor.visitTextContent(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); + } + } + public COMMA(): TerminalNode[]; + public COMMA(i: number): TerminalNode; + public COMMA(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(ExpressionAntlrParser.COMMA); + } else { + return this.getToken(ExpressionAntlrParser.COMMA, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return ExpressionAntlrParser.RULE_argsList; } + // @Override + public enterRule(listener: ExpressionAntlrParserListener): void { + if (listener.enterArgsList) { + listener.enterArgsList(this); + } + } + // @Override + public exitRule(listener: ExpressionAntlrParserListener): void { + if (listener.exitArgsList) { + listener.exitArgsList(this); + } + } + // @Override + public accept(visitor: ExpressionAntlrParserVisitor): Result { + if (visitor.visitArgsList) { + return visitor.visitArgsList(this); + } else { + return visitor.visitChildren(this); + } + } +} + + diff --git a/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrParserListener.ts b/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrParserListener.ts index 7a33b457a5..24465318ae 100644 --- a/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrParserListener.ts +++ b/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrParserListener.ts @@ -1,253 +1,267 @@ -// Generated from ../ExpressionAntlrParser.g4 by ANTLR 4.6-SNAPSHOT - - -import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; - -import { FuncInvokeExpContext } from "./ExpressionAntlrParser"; -import { ConstantAtomContext } from "./ExpressionAntlrParser"; -import { IdAtomContext } from "./ExpressionAntlrParser"; -import { StringAtomContext } from "./ExpressionAntlrParser"; -import { IndexAccessExpContext } from "./ExpressionAntlrParser"; -import { StringInterpolationAtomContext } from "./ExpressionAntlrParser"; -import { MemberAccessExpContext } from "./ExpressionAntlrParser"; -import { ParenthesisExpContext } from "./ExpressionAntlrParser"; -import { NumericAtomContext } from "./ExpressionAntlrParser"; -import { UnaryOpExpContext } from "./ExpressionAntlrParser"; -import { BinaryOpExpContext } from "./ExpressionAntlrParser"; -import { PrimaryExpContext } from "./ExpressionAntlrParser"; -import { FileContext } from "./ExpressionAntlrParser"; -import { ExpressionContext } from "./ExpressionAntlrParser"; -import { PrimaryExpressionContext } from "./ExpressionAntlrParser"; -import { StringInterpolationContext } from "./ExpressionAntlrParser"; -import { TextContentContext } from "./ExpressionAntlrParser"; -import { ArgsListContext } from "./ExpressionAntlrParser"; - - -/** - * This interface defines a complete listener for a parse tree produced by - * `ExpressionAntlrParser`. - */ -export interface ExpressionAntlrParserListener extends ParseTreeListener { - /** - * Enter a parse tree produced by the `funcInvokeExp` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - enterFuncInvokeExp?: (ctx: FuncInvokeExpContext) => void; - /** - * Exit a parse tree produced by the `funcInvokeExp` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - exitFuncInvokeExp?: (ctx: FuncInvokeExpContext) => void; - - /** - * Enter a parse tree produced by the `constantAtom` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - enterConstantAtom?: (ctx: ConstantAtomContext) => void; - /** - * Exit a parse tree produced by the `constantAtom` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - exitConstantAtom?: (ctx: ConstantAtomContext) => void; - - /** - * Enter a parse tree produced by the `idAtom` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - enterIdAtom?: (ctx: IdAtomContext) => void; - /** - * Exit a parse tree produced by the `idAtom` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - exitIdAtom?: (ctx: IdAtomContext) => void; - - /** - * Enter a parse tree produced by the `stringAtom` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - enterStringAtom?: (ctx: StringAtomContext) => void; - /** - * Exit a parse tree produced by the `stringAtom` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - exitStringAtom?: (ctx: StringAtomContext) => void; - - /** - * Enter a parse tree produced by the `indexAccessExp` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - enterIndexAccessExp?: (ctx: IndexAccessExpContext) => void; - /** - * Exit a parse tree produced by the `indexAccessExp` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - exitIndexAccessExp?: (ctx: IndexAccessExpContext) => void; - - /** - * Enter a parse tree produced by the `stringInterpolationAtom` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - enterStringInterpolationAtom?: (ctx: StringInterpolationAtomContext) => void; - /** - * Exit a parse tree produced by the `stringInterpolationAtom` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - exitStringInterpolationAtom?: (ctx: StringInterpolationAtomContext) => void; - - /** - * Enter a parse tree produced by the `memberAccessExp` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - enterMemberAccessExp?: (ctx: MemberAccessExpContext) => void; - /** - * Exit a parse tree produced by the `memberAccessExp` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - exitMemberAccessExp?: (ctx: MemberAccessExpContext) => void; - - /** - * Enter a parse tree produced by the `parenthesisExp` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - enterParenthesisExp?: (ctx: ParenthesisExpContext) => void; - /** - * Exit a parse tree produced by the `parenthesisExp` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - exitParenthesisExp?: (ctx: ParenthesisExpContext) => void; - - /** - * Enter a parse tree produced by the `numericAtom` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - enterNumericAtom?: (ctx: NumericAtomContext) => void; - /** - * Exit a parse tree produced by the `numericAtom` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - exitNumericAtom?: (ctx: NumericAtomContext) => void; - - /** - * Enter a parse tree produced by the `unaryOpExp` - * labeled alternative in `ExpressionAntlrParser.expression`. - * @param ctx the parse tree - */ - enterUnaryOpExp?: (ctx: UnaryOpExpContext) => void; - /** - * Exit a parse tree produced by the `unaryOpExp` - * labeled alternative in `ExpressionAntlrParser.expression`. - * @param ctx the parse tree - */ - exitUnaryOpExp?: (ctx: UnaryOpExpContext) => void; - - /** - * Enter a parse tree produced by the `binaryOpExp` - * labeled alternative in `ExpressionAntlrParser.expression`. - * @param ctx the parse tree - */ - enterBinaryOpExp?: (ctx: BinaryOpExpContext) => void; - /** - * Exit a parse tree produced by the `binaryOpExp` - * labeled alternative in `ExpressionAntlrParser.expression`. - * @param ctx the parse tree - */ - exitBinaryOpExp?: (ctx: BinaryOpExpContext) => void; - - /** - * Enter a parse tree produced by the `primaryExp` - * labeled alternative in `ExpressionAntlrParser.expression`. - * @param ctx the parse tree - */ - enterPrimaryExp?: (ctx: PrimaryExpContext) => void; - /** - * Exit a parse tree produced by the `primaryExp` - * labeled alternative in `ExpressionAntlrParser.expression`. - * @param ctx the parse tree - */ - exitPrimaryExp?: (ctx: PrimaryExpContext) => void; - - /** - * Enter a parse tree produced by `ExpressionAntlrParser.file`. - * @param ctx the parse tree - */ - enterFile?: (ctx: FileContext) => void; - /** - * Exit a parse tree produced by `ExpressionAntlrParser.file`. - * @param ctx the parse tree - */ - exitFile?: (ctx: FileContext) => void; - - /** - * Enter a parse tree produced by `ExpressionAntlrParser.expression`. - * @param ctx the parse tree - */ - enterExpression?: (ctx: ExpressionContext) => void; - /** - * Exit a parse tree produced by `ExpressionAntlrParser.expression`. - * @param ctx the parse tree - */ - exitExpression?: (ctx: ExpressionContext) => void; - - /** - * Enter a parse tree produced by `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - enterPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; - /** - * Exit a parse tree produced by `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - */ - exitPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; - - /** - * Enter a parse tree produced by `ExpressionAntlrParser.stringInterpolation`. - * @param ctx the parse tree - */ - enterStringInterpolation?: (ctx: StringInterpolationContext) => void; - /** - * Exit a parse tree produced by `ExpressionAntlrParser.stringInterpolation`. - * @param ctx the parse tree - */ - exitStringInterpolation?: (ctx: StringInterpolationContext) => void; - - /** - * Enter a parse tree produced by `ExpressionAntlrParser.textContent`. - * @param ctx the parse tree - */ - enterTextContent?: (ctx: TextContentContext) => void; - /** - * Exit a parse tree produced by `ExpressionAntlrParser.textContent`. - * @param ctx the parse tree - */ - exitTextContent?: (ctx: TextContentContext) => void; - - /** - * Enter a parse tree produced by `ExpressionAntlrParser.argsList`. - * @param ctx the parse tree - */ - enterArgsList?: (ctx: ArgsListContext) => void; - /** - * Exit a parse tree produced by `ExpressionAntlrParser.argsList`. - * @param ctx the parse tree - */ - exitArgsList?: (ctx: ArgsListContext) => void; -} - +// Generated from ../ExpressionAntlrParser.g4 by ANTLR 4.6-SNAPSHOT + + +import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; + +import { FuncInvokeExpContext } from "./ExpressionAntlrParser"; +import { ConstantAtomContext } from "./ExpressionAntlrParser"; +import { IdAtomContext } from "./ExpressionAntlrParser"; +import { StringAtomContext } from "./ExpressionAntlrParser"; +import { IndexAccessExpContext } from "./ExpressionAntlrParser"; +import { StringInterpolationAtomContext } from "./ExpressionAntlrParser"; +import { MemberAccessExpContext } from "./ExpressionAntlrParser"; +import { ParenthesisExpContext } from "./ExpressionAntlrParser"; +import { NumericAtomContext } from "./ExpressionAntlrParser"; +import { ArrayCreationExpContext } from "./ExpressionAntlrParser"; +import { UnaryOpExpContext } from "./ExpressionAntlrParser"; +import { BinaryOpExpContext } from "./ExpressionAntlrParser"; +import { PrimaryExpContext } from "./ExpressionAntlrParser"; +import { FileContext } from "./ExpressionAntlrParser"; +import { ExpressionContext } from "./ExpressionAntlrParser"; +import { PrimaryExpressionContext } from "./ExpressionAntlrParser"; +import { StringInterpolationContext } from "./ExpressionAntlrParser"; +import { TextContentContext } from "./ExpressionAntlrParser"; +import { ArgsListContext } from "./ExpressionAntlrParser"; + + +/** + * This interface defines a complete listener for a parse tree produced by + * `ExpressionAntlrParser`. + */ +export interface ExpressionAntlrParserListener extends ParseTreeListener { + /** + * Enter a parse tree produced by the `funcInvokeExp` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + enterFuncInvokeExp?: (ctx: FuncInvokeExpContext) => void; + /** + * Exit a parse tree produced by the `funcInvokeExp` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + exitFuncInvokeExp?: (ctx: FuncInvokeExpContext) => void; + + /** + * Enter a parse tree produced by the `constantAtom` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + enterConstantAtom?: (ctx: ConstantAtomContext) => void; + /** + * Exit a parse tree produced by the `constantAtom` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + exitConstantAtom?: (ctx: ConstantAtomContext) => void; + + /** + * Enter a parse tree produced by the `idAtom` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + enterIdAtom?: (ctx: IdAtomContext) => void; + /** + * Exit a parse tree produced by the `idAtom` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + exitIdAtom?: (ctx: IdAtomContext) => void; + + /** + * Enter a parse tree produced by the `stringAtom` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + enterStringAtom?: (ctx: StringAtomContext) => void; + /** + * Exit a parse tree produced by the `stringAtom` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + exitStringAtom?: (ctx: StringAtomContext) => void; + + /** + * Enter a parse tree produced by the `indexAccessExp` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + enterIndexAccessExp?: (ctx: IndexAccessExpContext) => void; + /** + * Exit a parse tree produced by the `indexAccessExp` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + exitIndexAccessExp?: (ctx: IndexAccessExpContext) => void; + + /** + * Enter a parse tree produced by the `stringInterpolationAtom` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + enterStringInterpolationAtom?: (ctx: StringInterpolationAtomContext) => void; + /** + * Exit a parse tree produced by the `stringInterpolationAtom` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + exitStringInterpolationAtom?: (ctx: StringInterpolationAtomContext) => void; + + /** + * Enter a parse tree produced by the `memberAccessExp` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + enterMemberAccessExp?: (ctx: MemberAccessExpContext) => void; + /** + * Exit a parse tree produced by the `memberAccessExp` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + exitMemberAccessExp?: (ctx: MemberAccessExpContext) => void; + + /** + * Enter a parse tree produced by the `parenthesisExp` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + enterParenthesisExp?: (ctx: ParenthesisExpContext) => void; + /** + * Exit a parse tree produced by the `parenthesisExp` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + exitParenthesisExp?: (ctx: ParenthesisExpContext) => void; + + /** + * Enter a parse tree produced by the `numericAtom` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + enterNumericAtom?: (ctx: NumericAtomContext) => void; + /** + * Exit a parse tree produced by the `numericAtom` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + exitNumericAtom?: (ctx: NumericAtomContext) => void; + + /** + * Enter a parse tree produced by the `arrayCreationExp` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + enterArrayCreationExp?: (ctx: ArrayCreationExpContext) => void; + /** + * Exit a parse tree produced by the `arrayCreationExp` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + exitArrayCreationExp?: (ctx: ArrayCreationExpContext) => void; + + /** + * Enter a parse tree produced by the `unaryOpExp` + * labeled alternative in `ExpressionAntlrParser.expression`. + * @param ctx the parse tree + */ + enterUnaryOpExp?: (ctx: UnaryOpExpContext) => void; + /** + * Exit a parse tree produced by the `unaryOpExp` + * labeled alternative in `ExpressionAntlrParser.expression`. + * @param ctx the parse tree + */ + exitUnaryOpExp?: (ctx: UnaryOpExpContext) => void; + + /** + * Enter a parse tree produced by the `binaryOpExp` + * labeled alternative in `ExpressionAntlrParser.expression`. + * @param ctx the parse tree + */ + enterBinaryOpExp?: (ctx: BinaryOpExpContext) => void; + /** + * Exit a parse tree produced by the `binaryOpExp` + * labeled alternative in `ExpressionAntlrParser.expression`. + * @param ctx the parse tree + */ + exitBinaryOpExp?: (ctx: BinaryOpExpContext) => void; + + /** + * Enter a parse tree produced by the `primaryExp` + * labeled alternative in `ExpressionAntlrParser.expression`. + * @param ctx the parse tree + */ + enterPrimaryExp?: (ctx: PrimaryExpContext) => void; + /** + * Exit a parse tree produced by the `primaryExp` + * labeled alternative in `ExpressionAntlrParser.expression`. + * @param ctx the parse tree + */ + exitPrimaryExp?: (ctx: PrimaryExpContext) => void; + + /** + * Enter a parse tree produced by `ExpressionAntlrParser.file`. + * @param ctx the parse tree + */ + enterFile?: (ctx: FileContext) => void; + /** + * Exit a parse tree produced by `ExpressionAntlrParser.file`. + * @param ctx the parse tree + */ + exitFile?: (ctx: FileContext) => void; + + /** + * Enter a parse tree produced by `ExpressionAntlrParser.expression`. + * @param ctx the parse tree + */ + enterExpression?: (ctx: ExpressionContext) => void; + /** + * Exit a parse tree produced by `ExpressionAntlrParser.expression`. + * @param ctx the parse tree + */ + exitExpression?: (ctx: ExpressionContext) => void; + + /** + * Enter a parse tree produced by `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + enterPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; + /** + * Exit a parse tree produced by `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + */ + exitPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; + + /** + * Enter a parse tree produced by `ExpressionAntlrParser.stringInterpolation`. + * @param ctx the parse tree + */ + enterStringInterpolation?: (ctx: StringInterpolationContext) => void; + /** + * Exit a parse tree produced by `ExpressionAntlrParser.stringInterpolation`. + * @param ctx the parse tree + */ + exitStringInterpolation?: (ctx: StringInterpolationContext) => void; + + /** + * Enter a parse tree produced by `ExpressionAntlrParser.textContent`. + * @param ctx the parse tree + */ + enterTextContent?: (ctx: TextContentContext) => void; + /** + * Exit a parse tree produced by `ExpressionAntlrParser.textContent`. + * @param ctx the parse tree + */ + exitTextContent?: (ctx: TextContentContext) => void; + + /** + * Enter a parse tree produced by `ExpressionAntlrParser.argsList`. + * @param ctx the parse tree + */ + enterArgsList?: (ctx: ArgsListContext) => void; + /** + * Exit a parse tree produced by `ExpressionAntlrParser.argsList`. + * @param ctx the parse tree + */ + exitArgsList?: (ctx: ArgsListContext) => void; +} + diff --git a/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrParserVisitor.ts b/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrParserVisitor.ts index 8b683a4b7f..e88b8a3b4c 100644 --- a/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrParserVisitor.ts +++ b/libraries/adaptive-expressions/src/parser/generated/ExpressionAntlrParserVisitor.ts @@ -1,172 +1,181 @@ -// Generated from ../ExpressionAntlrParser.g4 by ANTLR 4.6-SNAPSHOT - - -import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; - -import { FuncInvokeExpContext } from "./ExpressionAntlrParser"; -import { ConstantAtomContext } from "./ExpressionAntlrParser"; -import { IdAtomContext } from "./ExpressionAntlrParser"; -import { StringAtomContext } from "./ExpressionAntlrParser"; -import { IndexAccessExpContext } from "./ExpressionAntlrParser"; -import { StringInterpolationAtomContext } from "./ExpressionAntlrParser"; -import { MemberAccessExpContext } from "./ExpressionAntlrParser"; -import { ParenthesisExpContext } from "./ExpressionAntlrParser"; -import { NumericAtomContext } from "./ExpressionAntlrParser"; -import { UnaryOpExpContext } from "./ExpressionAntlrParser"; -import { BinaryOpExpContext } from "./ExpressionAntlrParser"; -import { PrimaryExpContext } from "./ExpressionAntlrParser"; -import { FileContext } from "./ExpressionAntlrParser"; -import { ExpressionContext } from "./ExpressionAntlrParser"; -import { PrimaryExpressionContext } from "./ExpressionAntlrParser"; -import { StringInterpolationContext } from "./ExpressionAntlrParser"; -import { TextContentContext } from "./ExpressionAntlrParser"; -import { ArgsListContext } from "./ExpressionAntlrParser"; - - -/** - * This interface defines a complete generic visitor for a parse tree produced - * by `ExpressionAntlrParser`. - * - * @param The return type of the visit operation. Use `void` for - * operations with no return type. - */ -export interface ExpressionAntlrParserVisitor extends ParseTreeVisitor { - /** - * Visit a parse tree produced by the `funcInvokeExp` - * labeled alternative in `ExpressionAntlrParser.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 `ExpressionAntlrParser.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 `ExpressionAntlrParser.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 `ExpressionAntlrParser.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 `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitIndexAccessExp?: (ctx: IndexAccessExpContext) => Result; - - /** - * Visit a parse tree produced by the `stringInterpolationAtom` - * labeled alternative in `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitStringInterpolationAtom?: (ctx: StringInterpolationAtomContext) => Result; - - /** - * Visit a parse tree produced by the `memberAccessExp` - * labeled alternative in `ExpressionAntlrParser.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 `ExpressionAntlrParser.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 `ExpressionAntlrParser.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 `ExpressionAntlrParser.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 `ExpressionAntlrParser.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 `ExpressionAntlrParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitPrimaryExp?: (ctx: PrimaryExpContext) => Result; - - /** - * Visit a parse tree produced by `ExpressionAntlrParser.file`. - * @param ctx the parse tree - * @return the visitor result - */ - visitFile?: (ctx: FileContext) => Result; - - /** - * Visit a parse tree produced by `ExpressionAntlrParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitExpression?: (ctx: ExpressionContext) => Result; - - /** - * Visit a parse tree produced by `ExpressionAntlrParser.primaryExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitPrimaryExpression?: (ctx: PrimaryExpressionContext) => Result; - - /** - * Visit a parse tree produced by `ExpressionAntlrParser.stringInterpolation`. - * @param ctx the parse tree - * @return the visitor result - */ - visitStringInterpolation?: (ctx: StringInterpolationContext) => Result; - - /** - * Visit a parse tree produced by `ExpressionAntlrParser.textContent`. - * @param ctx the parse tree - * @return the visitor result - */ - visitTextContent?: (ctx: TextContentContext) => Result; - - /** - * Visit a parse tree produced by `ExpressionAntlrParser.argsList`. - * @param ctx the parse tree - * @return the visitor result - */ - visitArgsList?: (ctx: ArgsListContext) => Result; -} - +// Generated from ../ExpressionAntlrParser.g4 by ANTLR 4.6-SNAPSHOT + + +import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; + +import { FuncInvokeExpContext } from "./ExpressionAntlrParser"; +import { ConstantAtomContext } from "./ExpressionAntlrParser"; +import { IdAtomContext } from "./ExpressionAntlrParser"; +import { StringAtomContext } from "./ExpressionAntlrParser"; +import { IndexAccessExpContext } from "./ExpressionAntlrParser"; +import { StringInterpolationAtomContext } from "./ExpressionAntlrParser"; +import { MemberAccessExpContext } from "./ExpressionAntlrParser"; +import { ParenthesisExpContext } from "./ExpressionAntlrParser"; +import { NumericAtomContext } from "./ExpressionAntlrParser"; +import { ArrayCreationExpContext } from "./ExpressionAntlrParser"; +import { UnaryOpExpContext } from "./ExpressionAntlrParser"; +import { BinaryOpExpContext } from "./ExpressionAntlrParser"; +import { PrimaryExpContext } from "./ExpressionAntlrParser"; +import { FileContext } from "./ExpressionAntlrParser"; +import { ExpressionContext } from "./ExpressionAntlrParser"; +import { PrimaryExpressionContext } from "./ExpressionAntlrParser"; +import { StringInterpolationContext } from "./ExpressionAntlrParser"; +import { TextContentContext } from "./ExpressionAntlrParser"; +import { ArgsListContext } from "./ExpressionAntlrParser"; + + +/** + * This interface defines a complete generic visitor for a parse tree produced + * by `ExpressionAntlrParser`. + * + * @param The return type of the visit operation. Use `void` for + * operations with no return type. + */ +export interface ExpressionAntlrParserVisitor extends ParseTreeVisitor { + /** + * Visit a parse tree produced by the `funcInvokeExp` + * labeled alternative in `ExpressionAntlrParser.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 `ExpressionAntlrParser.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 `ExpressionAntlrParser.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 `ExpressionAntlrParser.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 `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIndexAccessExp?: (ctx: IndexAccessExpContext) => Result; + + /** + * Visit a parse tree produced by the `stringInterpolationAtom` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitStringInterpolationAtom?: (ctx: StringInterpolationAtomContext) => Result; + + /** + * Visit a parse tree produced by the `memberAccessExp` + * labeled alternative in `ExpressionAntlrParser.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 `ExpressionAntlrParser.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 `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitNumericAtom?: (ctx: NumericAtomContext) => Result; + + /** + * Visit a parse tree produced by the `arrayCreationExp` + * labeled alternative in `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitArrayCreationExp?: (ctx: ArrayCreationExpContext) => Result; + + /** + * Visit a parse tree produced by the `unaryOpExp` + * labeled alternative in `ExpressionAntlrParser.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 `ExpressionAntlrParser.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 `ExpressionAntlrParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPrimaryExp?: (ctx: PrimaryExpContext) => Result; + + /** + * Visit a parse tree produced by `ExpressionAntlrParser.file`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFile?: (ctx: FileContext) => Result; + + /** + * Visit a parse tree produced by `ExpressionAntlrParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitExpression?: (ctx: ExpressionContext) => Result; + + /** + * Visit a parse tree produced by `ExpressionAntlrParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPrimaryExpression?: (ctx: PrimaryExpressionContext) => Result; + + /** + * Visit a parse tree produced by `ExpressionAntlrParser.stringInterpolation`. + * @param ctx the parse tree + * @return the visitor result + */ + visitStringInterpolation?: (ctx: StringInterpolationContext) => Result; + + /** + * Visit a parse tree produced by `ExpressionAntlrParser.textContent`. + * @param ctx the parse tree + * @return the visitor result + */ + visitTextContent?: (ctx: TextContentContext) => Result; + + /** + * Visit a parse tree produced by `ExpressionAntlrParser.argsList`. + * @param ctx the parse tree + * @return the visitor result + */ + visitArgsList?: (ctx: ArgsListContext) => Result; +} + diff --git a/libraries/adaptive-expressions/tests/badExpression.test.js b/libraries/adaptive-expressions/tests/badExpression.test.js index 40480c8961..590ecd1450 100644 --- a/libraries/adaptive-expressions/tests/badExpression.test.js +++ b/libraries/adaptive-expressions/tests/badExpression.test.js @@ -349,7 +349,7 @@ const badExpressions = 'isString(hello, hello)', // should have one parameter 'isInteger(one, hello)', // should have one parameter 'isFloat(1.324, hello)', // should have one parameter - 'isArray(createArrat(1,2,3), hello)', // should have one parameter + 'isArray(createArray(1,2,3), hello)', // should have one parameter 'isBoolean(true, false)', // should have one parameter 'isDateTime("2018-03-15T13:00:00.111Z", hello)', // should have one parameter 'isObject({}, false)', // should have one parameter diff --git a/libraries/adaptive-expressions/tests/expressionParser.test.js b/libraries/adaptive-expressions/tests/expressionParser.test.js index 3e44de9f37..4b1978ae6a 100644 --- a/libraries/adaptive-expressions/tests/expressionParser.test.js +++ b/libraries/adaptive-expressions/tests/expressionParser.test.js @@ -23,9 +23,15 @@ const dataSource = [ ['`hello ${world}` != \'hello hello\'', true], ['`hello ${user.nickname}` == \'hello John\'', true], ['`hello ${user.nickname}` != \'hello Dong\'', true], + ['`hi\\`[1,2,3]`', 'hi`[1,2,3]'], + ['`hi ${[\'jack\\`\', \'queen\', \'king\']}`', 'hi jack`,queen,king'], + ['`abc ${concat("[", "]")}`', 'abc []'], + ['`[] ${concat("[]")}`', '[] []'], + ['`hi ${count(["a", "b", "c"])}`', `hi 3`], // Operators tests + ['1 + 2', 3], ['1 +\n 2', 3], ['1 \n+ 2', 3], @@ -132,6 +138,7 @@ const dataSource = [ ['length(nullObj)', 0], ['length("hello")', 5], ['length(concat(hello,world))', 10], + ['length(concat("[]", "abc"))', 5], ['length(hello + world)', 10], ['count(\'hello\')', 5], ['count("hello")', 5], @@ -199,6 +206,7 @@ const dataSource = [ ['indexOf(json(\'["a", "b"]\'), "a")', 0], ['indexOf(json(\'["a", "b"]\'), \'c\')', -1], ['indexOf(createArray(\'abc\', \'def\', \'ghi\'), \'def\')', 1], + ['indexOf([\'abc\', \'def\', \'ghi\'], \'def\')', 1], ['indexOf(createArray(\'abc\', \'def\', \'ghi\'), \'klm\')', -1], ['lastIndexOf(nullObj, \'-\')', -1], ['lastIndexOf(hello, nullObj)', 4], @@ -305,7 +313,17 @@ const dataSource = [ ['bool(hello * 5)', false], ['bool(\'false\')', true], // we make it true, because it is not empty ['bool(\'hi\')', true], + ['[1,2,3]', [1,2,3]], + ['[1,2,3, [4,5]]', [1,2,3, [4,5]]], + ['\"[1,2,3]\"', '[1,2,3]'], + ['[1, bool(0), string(bool(1)), float(\'10\')]', [1, true, 'true', 10.0]], + ['[\'a\', \'b[]\', \'c[][][]\'][1]', 'b[]'], + ['[\'a\', [\'b\', \'c\']][1][0]', 'b'], + ['union(["a", "b", "c"], ["d", ["e", "f"], "g"][1])', ['a', 'b', 'c', 'e', 'f']], + ['union(["a", "b", "c"], ["d", ["e", "f"], "g"][1])[1]', ['b']], ['createArray(\'h\', \'e\', \'l\', \'l\', \'o\')', ['h', 'e', 'l', 'l', 'o']], + ['createArray()', []], + ['[]', []], ['createArray(1, bool(0), string(bool(1)), float(\'10\'))', [1, true, 'true', 10.0]], ['binary(hello)', '0110100001100101011011000110110001101111'], ['dataUri(hello)', 'data:text/plain;charset=utf-8;base64,aGVsbG8='], diff --git a/libraries/botbuilder-lg/tests/testData/examples/TemplateAsFunction.lg b/libraries/botbuilder-lg/tests/testData/examples/TemplateAsFunction.lg index a1fca3f95f..62d0bf1a6d 100644 --- a/libraries/botbuilder-lg/tests/testData/examples/TemplateAsFunction.lg +++ b/libraries/botbuilder-lg/tests/testData/examples/TemplateAsFunction.lg @@ -2,7 +2,7 @@ - ${join(list, ' ')} # Test2 -- ${ShowList(createArray('hello', 'world'))} +- ${ShowList(['hello', 'world'])} # Test3 - ${ShowList(createArray('hello', 'world'))}