diff --git a/public/dimensional_analysis.py b/public/dimensional_analysis.py index a5eac9b3..5396a201 100644 --- a/public/dimensional_analysis.py +++ b/public/dimensional_analysis.py @@ -63,7 +63,8 @@ ceiling, sign, sqrt, - factorial + factorial, + summation ) class ExprWithAssumptions(Expr): @@ -1124,32 +1125,19 @@ def UniversalInverse(expression: Expr) -> Expr: def IndexMatrix(expression: Expr, i: Expr, j: Expr) -> Expr: for subscript in cast(list[ExprWithAssumptions], (i,j)): - if not (subscript.is_real and subscript.is_finite and subscript.is_integer and cast(int, subscript) > 0): - raise Exception("Matrix indices must evaluate to a finite real integer and be greater than 0") + if subscript.is_real and cast(int, subscript) <= 0: + raise Exception("Matrix indices must be greater than 0") return expression[i-1, j-1] # type: ignore -class CustomFactorial(Function): - is_real = True - @staticmethod - def _imp_(arg1: float): - if arg1.is_integer() and arg1 >= 0.0: - return math.factorial(int(arg1)) - else: - raise ValueError("The factorial function can only be evaluated on a nonnegative integer") - - def _eval_evalf(self, prec): - if self.args[0].is_number: - if not (self.args[0].is_real and - cast(ExprWithAssumptions, self.args[0]).is_finite and - cast(ExprWithAssumptions, self.args[0]).is_integer and - cast(int, self.args[0]) >= 0): - raise ValueError("The factorial function can only be evaluated on a nonnegative integer") - return factorial(self.args[0])._eval_evalf(prec) # type: ignore +def _factorial_imp_(arg1: float): + if arg1.is_integer() and arg1 >= 0.0: + return math.factorial(int(arg1)) + else: + raise ValueError("The factorial function can only be evaluated on a nonnegative integer") - def _latex(self, printer): - return rf"\left({printer._print(self.args[0])}\right)!" +factorial._imp_ = staticmethod(_factorial_imp_) # type: ignore def custom_norm(expression: Matrix): return expression.norm() @@ -1185,6 +1173,8 @@ def custom_integral_dims(local_expr: Expr, global_expr: Expr, dummy_integral_var else: return global_expr * integral_var # type: ignore +def custom_summation(operand: Expr, dummy_var: Symbol, start: Expr, end: Expr): + return summation(operand, (dummy_var, start, end)) CP = None @@ -1493,7 +1483,8 @@ def get_next_id(self): cast(Function, Function('_Derivative')) : {"dim_func": custom_derivative_dims, "sympy_func": custom_derivative}, cast(Function, Function('_Integral')) : {"dim_func": custom_integral_dims, "sympy_func": custom_integral}, cast(Function, Function('_range')) : {"dim_func": custom_range, "sympy_func": custom_range}, - cast(Function, Function('_factorial')) : {"dim_func": factorial, "sympy_func": CustomFactorial}, + cast(Function, Function('_factorial')) : {"dim_func": factorial, "sympy_func": factorial}, + cast(Function, Function('_summation')) : {"dim_func": custom_summation, "sympy_func": custom_summation}, } global_placeholder_set = set(global_placeholder_map.keys()) diff --git a/src/constants.ts b/src/constants.ts index ed8898fc..183ca20d 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -6,6 +6,8 @@ export const INLINE_SHORTCUTS = { '~': '\\approx', 'sqrt': '\\sqrt{#?}', '$int': '\\int _{#?}^{#?}\\left(#?\\right)\\mathrm{d}\\left(#?\\right)', + '$inf': '\\infty', + '$sum': '\\sum_{#?=#?}^{#?}\\left(#?\\right)', '$prime': '\\frac{\\mathrm{d}}{\\mathrm{d}\\left(#?\\right)}\\left(#?\\right)', '$doubleprime': '\\frac{\\mathrm{d}^{2}}{\\mathrm{d}\\left(#?\\right)^{2}}\\left(#?\\right)', '$tripleprime': '\\frac{\\mathrm{d}^{3}}{\\mathrm{d}\\left(#?\\right)^{3}}\\left(#?\\right)', diff --git a/src/parser/LatexLexer.g4 b/src/parser/LatexLexer.g4 index 35f91306..a7cd66da 100644 --- a/src/parser/LatexLexer.g4 +++ b/src/parser/LatexLexer.g4 @@ -16,14 +16,24 @@ DOUBLE_VBAR: '||' | '\\Vert' ; UNDERSCORE: '_' ; +fragment +UNDERSCORE_SINGLE_CHAR_NUMBER: '_' [0-9]; + +fragment +UNDERSCORE_SINGLE_CHAR_ID: '_' [a-zA-Z]; + EXCLAMATION: '!' ; PI: '\\pi' ; +INFINITY: '\\infty' ; + CMD_INT: '\\int' ; CMD_INT_UNDERSCORE: '\\int' [ ]* '_' ; -CMD_INT_UNDERSCORE_SINGLE_CHAR_NUMBER: '\\int' [ ]* '_' [0-9]; -CMD_INT_UNDERSCORE_SINGLE_CHAR_ID: '\\int' [ ]* '_' [a-zA-Z] ; +CMD_INT_UNDERSCORE_SINGLE_CHAR_NUMBER: '\\int' [ ]* UNDERSCORE_SINGLE_CHAR_NUMBER ; +CMD_INT_UNDERSCORE_SINGLE_CHAR_ID: '\\int' [ ]* UNDERSCORE_SINGLE_CHAR_ID ; + +CMD_SUM_UNDERSCORE: '\\sum' [ ]* '_' ; CMD_MATHRM: '\\mathrm' ; @@ -62,8 +72,8 @@ CMD_COTH: 'coth' ; CMD_LN: 'ln' ; CMD_LOG: 'log' ; CMD_SLASH_LOG_UNDERSCORE: '\\log' [ ]* '_' ; -CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_NUMBER: '\\log' [ ]* '_' [0-9] ; -CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_ID: '\\log' [ ]* '_' [a-zA-Z] ; +CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_NUMBER: '\\log' [ ]* UNDERSCORE_SINGLE_CHAR_NUMBER ; +CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_ID: '\\log' [ ]* UNDERSCORE_SINGLE_CHAR_ID ; COMMENT: '\\text{' .*? '}' -> skip ; @@ -116,7 +126,7 @@ AMPERSAND: '&'; DOUBLE_BACKSLASH: '\\\\'; -UNDERSCORE_SUBSCRIPT: (([ ]* '_{' [a-zA-Z0-9]+ '}') | ([ ]* '_' [a-zA-Z0-9])); +UNDERSCORE_SUBSCRIPT: (([ ]* '_{' [a-zA-Z0-9]+ '}') | ([ ]* (UNDERSCORE_SINGLE_CHAR_ID | UNDERSCORE_SINGLE_CHAR_NUMBER) )); CARET_SINGLE_CHAR_ID_UNDERSCORE_SUBSCRIPT: '^'[a-zA-Z] UNDERSCORE_SUBSCRIPT; diff --git a/src/parser/LatexLexer.ts b/src/parser/LatexLexer.ts index c077a7fd..2478f044 100644 --- a/src/parser/LatexLexer.ts +++ b/src/parser/LatexLexer.ts @@ -24,93 +24,95 @@ export default class LatexLexer extends Lexer { public static readonly UNDERSCORE = 10; public static readonly EXCLAMATION = 11; public static readonly PI = 12; - public static readonly CMD_INT = 13; - public static readonly CMD_INT_UNDERSCORE = 14; - public static readonly CMD_INT_UNDERSCORE_SINGLE_CHAR_NUMBER = 15; - public static readonly CMD_INT_UNDERSCORE_SINGLE_CHAR_ID = 16; - public static readonly CMD_MATHRM = 17; - public static readonly CMD_FRAC = 18; - public static readonly CMD_FRAC_INTS = 19; - public static readonly CMD_CDOT = 20; - public static readonly CMD_TIMES = 21; - public static readonly CMD_SQRT = 22; - public static readonly CMD_SQRT_INT = 23; - public static readonly CMD_SIM = 24; - public static readonly CMD_APPROX = 25; - public static readonly CMD_PLACEHOLDER = 26; - public static readonly TRANSPOSE = 27; - public static readonly BACKSLASH = 28; - public static readonly AS_LINES = 29; - public static readonly CMD_SIN = 30; - public static readonly CMD_COS = 31; - public static readonly CMD_TAN = 32; - public static readonly CMD_COT = 33; - public static readonly CMD_SEC = 34; - public static readonly CMD_CSC = 35; - public static readonly CMD_ARCSIN = 36; - public static readonly CMD_ARCCOS = 37; - public static readonly CMD_ARCTAN = 38; - public static readonly CMD_SINH = 39; - public static readonly CMD_COSH = 40; - public static readonly CMD_TANH = 41; - public static readonly CMD_COTH = 42; - public static readonly CMD_LN = 43; - public static readonly CMD_LOG = 44; - public static readonly CMD_SLASH_LOG_UNDERSCORE = 45; - public static readonly CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_NUMBER = 46; - public static readonly CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_ID = 47; - public static readonly COMMENT = 48; - public static readonly CMD_LEFT = 49; - public static readonly CMD_RIGHT = 50; - public static readonly DOUBLE_DOLLAR_SIGN = 51; - public static readonly ADD = 52; - public static readonly SUB = 53; - public static readonly CARET = 54; - public static readonly EQ = 55; - public static readonly LT = 56; - public static readonly GT = 57; - public static readonly LTE = 58; - public static readonly GTE = 59; - public static readonly COMMA = 60; - public static readonly DECIMAL_POINT = 61; - public static readonly CARET_SINGLE_CHAR_NUMBER = 62; - public static readonly CARET_SINGLE_CHAR_ID = 63; - public static readonly NUMBER = 64; - public static readonly BEGIN_MATRIX = 65; - public static readonly END_MATRIX = 66; - public static readonly AMPERSAND = 67; - public static readonly DOUBLE_BACKSLASH = 68; - public static readonly UNDERSCORE_SUBSCRIPT = 69; - public static readonly CARET_SINGLE_CHAR_ID_UNDERSCORE_SUBSCRIPT = 70; - public static readonly ID = 71; - public static readonly WS = 72; - public static readonly SLASH_SPACE = 73; - public static readonly SLASH_COLON = 74; - public static readonly NBSP = 75; - public static readonly ERROR_CHAR = 76; - public static readonly R_BRACKET = 77; - public static readonly ALT_R_BRACKET = 78; - public static readonly U_CMD_FRAC = 79; - public static readonly U_CMD_FRAC_INTS = 80; - public static readonly U_CMD_CDOT = 81; - public static readonly U_CMD_TIMES = 82; - public static readonly U_CMD_SQRT = 83; - public static readonly U_COMMA = 84; - public static readonly U_CARET = 85; - public static readonly U_NAME = 86; - public static readonly U_L_PAREN = 87; - public static readonly U_R_PAREN = 88; - public static readonly U_L_BRACE = 89; - public static readonly U_R_BRACE = 90; - public static readonly U_ONE = 91; - public static readonly U_NUMBER = 92; - public static readonly U_CMD_LEFT = 93; - public static readonly U_CMD_RIGHT = 94; - public static readonly U_WS = 95; - public static readonly U_SLASH_SPACE = 96; - public static readonly U_SLASH_COLON = 97; - public static readonly U_NBSP = 98; - public static readonly U_ERROR_CHAR = 99; + public static readonly INFINITY = 13; + public static readonly CMD_INT = 14; + public static readonly CMD_INT_UNDERSCORE = 15; + public static readonly CMD_INT_UNDERSCORE_SINGLE_CHAR_NUMBER = 16; + public static readonly CMD_INT_UNDERSCORE_SINGLE_CHAR_ID = 17; + public static readonly CMD_SUM_UNDERSCORE = 18; + public static readonly CMD_MATHRM = 19; + public static readonly CMD_FRAC = 20; + public static readonly CMD_FRAC_INTS = 21; + public static readonly CMD_CDOT = 22; + public static readonly CMD_TIMES = 23; + public static readonly CMD_SQRT = 24; + public static readonly CMD_SQRT_INT = 25; + public static readonly CMD_SIM = 26; + public static readonly CMD_APPROX = 27; + public static readonly CMD_PLACEHOLDER = 28; + public static readonly TRANSPOSE = 29; + public static readonly BACKSLASH = 30; + public static readonly AS_LINES = 31; + public static readonly CMD_SIN = 32; + public static readonly CMD_COS = 33; + public static readonly CMD_TAN = 34; + public static readonly CMD_COT = 35; + public static readonly CMD_SEC = 36; + public static readonly CMD_CSC = 37; + public static readonly CMD_ARCSIN = 38; + public static readonly CMD_ARCCOS = 39; + public static readonly CMD_ARCTAN = 40; + public static readonly CMD_SINH = 41; + public static readonly CMD_COSH = 42; + public static readonly CMD_TANH = 43; + public static readonly CMD_COTH = 44; + public static readonly CMD_LN = 45; + public static readonly CMD_LOG = 46; + public static readonly CMD_SLASH_LOG_UNDERSCORE = 47; + public static readonly CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_NUMBER = 48; + public static readonly CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_ID = 49; + public static readonly COMMENT = 50; + public static readonly CMD_LEFT = 51; + public static readonly CMD_RIGHT = 52; + public static readonly DOUBLE_DOLLAR_SIGN = 53; + public static readonly ADD = 54; + public static readonly SUB = 55; + public static readonly CARET = 56; + public static readonly EQ = 57; + public static readonly LT = 58; + public static readonly GT = 59; + public static readonly LTE = 60; + public static readonly GTE = 61; + public static readonly COMMA = 62; + public static readonly DECIMAL_POINT = 63; + public static readonly CARET_SINGLE_CHAR_NUMBER = 64; + public static readonly CARET_SINGLE_CHAR_ID = 65; + public static readonly NUMBER = 66; + public static readonly BEGIN_MATRIX = 67; + public static readonly END_MATRIX = 68; + public static readonly AMPERSAND = 69; + public static readonly DOUBLE_BACKSLASH = 70; + public static readonly UNDERSCORE_SUBSCRIPT = 71; + public static readonly CARET_SINGLE_CHAR_ID_UNDERSCORE_SUBSCRIPT = 72; + public static readonly ID = 73; + public static readonly WS = 74; + public static readonly SLASH_SPACE = 75; + public static readonly SLASH_COLON = 76; + public static readonly NBSP = 77; + public static readonly ERROR_CHAR = 78; + public static readonly R_BRACKET = 79; + public static readonly ALT_R_BRACKET = 80; + public static readonly U_CMD_FRAC = 81; + public static readonly U_CMD_FRAC_INTS = 82; + public static readonly U_CMD_CDOT = 83; + public static readonly U_CMD_TIMES = 84; + public static readonly U_CMD_SQRT = 85; + public static readonly U_COMMA = 86; + public static readonly U_CARET = 87; + public static readonly U_NAME = 88; + public static readonly U_L_PAREN = 89; + public static readonly U_R_PAREN = 90; + public static readonly U_L_BRACE = 91; + public static readonly U_R_BRACE = 92; + public static readonly U_ONE = 93; + public static readonly U_NUMBER = 94; + public static readonly U_CMD_LEFT = 95; + public static readonly U_CMD_RIGHT = 96; + public static readonly U_WS = 97; + public static readonly U_SLASH_SPACE = 98; + public static readonly U_SLASH_COLON = 99; + public static readonly U_NBSP = 100; + public static readonly U_ERROR_CHAR = 101; public static readonly EOF = Token.EOF; public static readonly UNITS = 1; @@ -118,8 +120,9 @@ export default class LatexLexer extends Lexer { public static readonly literalNames: string[] = [ null, "'['", "'\\lbrack'", "';'", null, null, null, null, "'|'", null, "'_'", - "'!'", "'\\pi'", "'\\int'", - null, null, null, "'\\mathrm'", + "'!'", "'\\pi'", "'\\infty'", + "'\\int'", null, null, + null, null, "'\\mathrm'", null, null, null, null, null, null, "'\\sim'", "'\\approx'", "'\\placeholder'", @@ -150,9 +153,11 @@ export default class LatexLexer extends Lexer { "R_BRACE", "L_PAREN", "R_PAREN", "VBAR", "DOUBLE_VBAR", "UNDERSCORE", "EXCLAMATION", - "PI", "CMD_INT", "CMD_INT_UNDERSCORE", + "PI", "INFINITY", "CMD_INT", + "CMD_INT_UNDERSCORE", "CMD_INT_UNDERSCORE_SINGLE_CHAR_NUMBER", "CMD_INT_UNDERSCORE_SINGLE_CHAR_ID", + "CMD_SUM_UNDERSCORE", "CMD_MATHRM", "CMD_FRAC", "CMD_FRAC_INTS", "CMD_CDOT", "CMD_TIMES", "CMD_SQRT", @@ -200,13 +205,14 @@ export default class LatexLexer extends Lexer { public static readonly ruleNames: string[] = [ "L_BRACKET", "ALT_L_BRACKET", "SEMICOLON", "L_BRACE", "R_BRACE", "L_PAREN", - "R_PAREN", "VBAR", "DOUBLE_VBAR", "UNDERSCORE", "EXCLAMATION", "PI", "CMD_INT", + "R_PAREN", "VBAR", "DOUBLE_VBAR", "UNDERSCORE", "UNDERSCORE_SINGLE_CHAR_NUMBER", + "UNDERSCORE_SINGLE_CHAR_ID", "EXCLAMATION", "PI", "INFINITY", "CMD_INT", "CMD_INT_UNDERSCORE", "CMD_INT_UNDERSCORE_SINGLE_CHAR_NUMBER", "CMD_INT_UNDERSCORE_SINGLE_CHAR_ID", - "CMD_MATHRM", "CMD_FRAC", "CMD_FRAC_INTS", "CMD_CDOT", "CMD_TIMES", "CMD_SQRT", - "CMD_SQRT_INT", "CMD_SIM", "CMD_APPROX", "CMD_PLACEHOLDER", "TRANSPOSE", - "BACKSLASH", "AS_LINES", "CMD_SIN", "CMD_COS", "CMD_TAN", "CMD_COT", "CMD_SEC", - "CMD_CSC", "CMD_ARCSIN", "CMD_ARCCOS", "CMD_ARCTAN", "CMD_SINH", "CMD_COSH", - "CMD_TANH", "CMD_COTH", "CMD_LN", "CMD_LOG", "CMD_SLASH_LOG_UNDERSCORE", + "CMD_SUM_UNDERSCORE", "CMD_MATHRM", "CMD_FRAC", "CMD_FRAC_INTS", "CMD_CDOT", + "CMD_TIMES", "CMD_SQRT", "CMD_SQRT_INT", "CMD_SIM", "CMD_APPROX", "CMD_PLACEHOLDER", + "TRANSPOSE", "BACKSLASH", "AS_LINES", "CMD_SIN", "CMD_COS", "CMD_TAN", + "CMD_COT", "CMD_SEC", "CMD_CSC", "CMD_ARCSIN", "CMD_ARCCOS", "CMD_ARCTAN", + "CMD_SINH", "CMD_COSH", "CMD_TANH", "CMD_COTH", "CMD_LN", "CMD_LOG", "CMD_SLASH_LOG_UNDERSCORE", "CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_NUMBER", "CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_ID", "COMMENT", "CMD_LEFT", "CMD_RIGHT", "DOUBLE_DOLLAR_SIGN", "ADD", "SUB", "CARET", "EQ", "LT", "GT", "LTE", "GTE", "COMMA", "DECIMAL_POINT", "CARET_SINGLE_CHAR_NUMBER", @@ -238,370 +244,382 @@ export default class LatexLexer extends Lexer { public get modeNames(): string[] { return LatexLexer.modeNames; } - public static readonly _serializedATN: number[] = [4,0,99,1084,6,-1,6,-1, - 2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8, - 2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16, - 7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7, - 23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30, - 2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2, - 38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45, - 7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7, - 52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,59,7,59, - 2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,2,65,7,65,2,66,7,66,2, - 67,7,67,2,68,7,68,2,69,7,69,2,70,7,70,2,71,7,71,2,72,7,72,2,73,7,73,2,74, - 7,74,2,75,7,75,2,76,7,76,2,77,7,77,2,78,7,78,2,79,7,79,2,80,7,80,2,81,7, - 81,2,82,7,82,2,83,7,83,2,84,7,84,2,85,7,85,2,86,7,86,2,87,7,87,2,88,7,88, - 2,89,7,89,2,90,7,90,2,91,7,91,2,92,7,92,2,93,7,93,2,94,7,94,2,95,7,95,2, - 96,7,96,2,97,7,97,2,98,7,98,2,99,7,99,2,100,7,100,2,101,7,101,2,102,7,102, - 2,103,7,103,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, - 1,2,1,3,1,3,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8, - 3,8,244,8,8,1,9,1,9,1,10,1,10,1,11,1,11,1,11,1,11,1,12,1,12,1,12,1,12,1, - 12,1,13,1,13,1,13,1,13,1,13,1,13,5,13,265,8,13,10,13,12,13,268,9,13,1,13, - 1,13,1,14,1,14,1,14,1,14,1,14,1,14,5,14,278,8,14,10,14,12,14,281,9,14,1, - 14,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,15,5,15,292,8,15,10,15,12,15,295, - 9,15,1,15,1,15,1,15,1,16,1,16,1,16,1,16,1,16,1,16,1,16,1,16,1,17,1,17,1, - 17,1,17,1,17,1,17,1,18,1,18,1,18,1,18,1,18,1,18,1,18,5,18,321,8,18,10,18, - 12,18,324,9,18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,19,1,20,1,20,1, - 20,1,20,1,20,1,20,1,20,1,21,1,21,1,21,1,21,1,21,1,21,1,22,1,22,1,22,1,22, - 1,22,1,22,1,22,5,22,355,8,22,10,22,12,22,358,9,22,1,22,1,22,1,23,1,23,1, - 23,1,23,1,23,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,25,1,25,1,25,1,25, - 1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,26,1, - 26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,27,1,27,1,28,1,28,1,28,1,28, - 1,28,1,28,4,28,410,8,28,11,28,12,28,411,1,28,1,28,1,28,1,28,1,28,1,28,3, - 28,420,8,28,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,31,1,31,1,31,1,31, - 1,32,1,32,1,32,1,32,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,34,1,35,1,35,1, - 35,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,37,1,37,1,37, - 1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,1,39,1,39,1,39,1,39,1,39,1, - 40,1,40,1,40,1,40,1,40,1,41,1,41,1,41,1,41,1,41,1,42,1,42,1,42,1,43,1,43, - 1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,44,5,44,500,8,44,10,44,12,44,503,9, - 44,1,44,1,44,1,45,1,45,1,45,1,45,1,45,1,45,5,45,513,8,45,10,45,12,45,516, - 9,45,1,45,1,45,1,45,1,46,1,46,1,46,1,46,1,46,1,46,5,46,527,8,46,10,46,12, - 46,530,9,46,1,46,1,46,1,46,1,47,1,47,1,47,1,47,1,47,1,47,1,47,1,47,5,47, - 543,8,47,10,47,12,47,546,9,47,1,47,1,47,1,47,1,47,1,48,1,48,1,48,1,48,1, - 48,1,48,1,48,3,48,559,8,48,1,48,1,48,1,49,1,49,1,49,1,49,1,49,1,49,1,49, - 1,49,3,49,571,8,49,1,49,1,49,1,50,1,50,1,50,1,50,1,50,1,51,1,51,1,52,1, - 52,1,53,1,53,1,54,1,54,1,55,1,55,1,56,1,56,1,57,1,57,1,57,1,57,1,58,1,58, - 1,58,1,58,1,59,1,59,1,60,1,60,1,61,1,61,1,61,1,62,1,62,1,62,1,63,4,63,611, - 8,63,11,63,12,63,612,1,63,1,63,5,63,617,8,63,10,63,12,63,620,9,63,1,63, - 3,63,623,8,63,1,63,1,63,4,63,627,8,63,11,63,12,63,628,1,63,3,63,632,8,63, - 1,63,4,63,635,8,63,11,63,12,63,636,1,63,3,63,640,8,63,3,63,642,8,63,1,64, - 1,64,1,65,1,65,5,65,648,8,65,10,65,12,65,651,9,65,1,66,1,66,3,66,655,8, - 66,1,66,4,66,658,8,66,11,66,12,66,659,1,66,5,66,663,8,66,10,66,12,66,666, - 9,66,1,66,1,66,3,66,670,8,66,1,66,5,66,673,8,66,10,66,12,66,676,9,66,1, - 66,1,66,1,66,1,66,1,66,1,66,1,66,3,66,685,8,66,1,66,4,66,688,8,66,11,66, - 12,66,689,1,66,1,66,3,66,694,8,66,3,66,696,8,66,1,67,1,67,1,67,1,67,1,67, - 1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1, - 67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67, - 1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1, - 67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67, - 1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1, - 67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67, - 1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1, - 67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67, - 1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1, - 67,1,67,1,67,1,67,1,67,3,67,838,8,67,1,68,1,68,1,68,1,68,1,68,1,68,1,68, - 1,68,1,68,1,68,1,68,1,68,1,68,1,68,1,68,1,68,1,69,1,69,1,69,1,69,1,69,1, - 69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,70,1,70,1,71,1,71,1,71,1,72, - 5,72,876,8,72,10,72,12,72,879,9,72,1,72,1,72,1,72,1,72,4,72,885,8,72,11, - 72,12,72,886,1,72,1,72,5,72,891,8,72,10,72,12,72,894,9,72,1,72,1,72,3,72, - 898,8,72,1,73,1,73,1,73,1,73,1,74,1,74,3,74,906,8,74,1,74,3,74,909,8,74, - 1,75,4,75,912,8,75,11,75,12,75,913,1,75,1,75,1,76,1,76,1,76,1,76,1,76,1, - 77,1,77,1,77,1,77,1,77,1,78,1,78,1,78,1,78,1,79,1,79,1,80,1,80,1,80,1,80, - 1,81,1,81,1,81,1,81,1,81,1,81,1,81,1,81,1,81,1,81,1,82,1,82,1,82,1,82,1, - 82,1,82,1,83,1,83,1,83,1,83,1,83,1,83,1,83,5,83,961,8,83,10,83,12,83,964, - 9,83,1,83,1,83,1,83,1,84,1,84,1,84,1,84,1,84,1,84,1,85,1,85,1,85,1,85,1, - 85,1,85,1,85,1,86,1,86,1,86,1,86,1,86,1,86,1,87,1,87,1,88,1,88,1,89,1,89, - 5,89,994,8,89,10,89,12,89,997,9,89,1,90,1,90,1,91,1,91,1,92,1,92,1,93,1, - 93,1,94,1,94,1,95,3,95,1010,8,95,1,95,4,95,1013,8,95,11,95,12,95,1014,1, - 95,1,95,5,95,1019,8,95,10,95,12,95,1022,9,95,1,95,3,95,1025,8,95,1,95,1, - 95,4,95,1029,8,95,11,95,12,95,1030,1,95,3,95,1034,8,95,1,95,4,95,1037,8, - 95,11,95,12,95,1038,3,95,1041,8,95,1,96,1,96,1,97,1,97,1,97,1,97,1,97,1, - 97,1,97,1,97,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,99,4,99,1063, - 8,99,11,99,12,99,1064,1,99,1,99,1,100,1,100,1,100,1,100,1,100,1,101,1,101, - 1,101,1,101,1,101,1,102,1,102,1,102,1,102,1,103,1,103,1,544,0,104,2,1,4, - 2,6,3,8,4,10,5,12,6,14,7,16,8,18,9,20,10,22,11,24,12,26,13,28,14,30,15, - 32,16,34,17,36,18,38,19,40,20,42,21,44,22,46,23,48,24,50,25,52,26,54,27, - 56,28,58,29,60,30,62,31,64,32,66,33,68,34,70,35,72,36,74,37,76,38,78,39, - 80,40,82,41,84,42,86,43,88,44,90,45,92,46,94,47,96,48,98,49,100,50,102, - 51,104,52,106,53,108,54,110,55,112,56,114,57,116,58,118,59,120,60,122,61, - 124,62,126,63,128,64,130,0,132,0,134,0,136,0,138,65,140,66,142,67,144,68, - 146,69,148,70,150,71,152,72,154,73,156,74,158,75,160,76,162,77,164,78,166, - 79,168,80,170,81,172,82,174,83,176,84,178,85,180,86,182,87,184,88,186,89, - 188,90,190,91,192,92,194,0,196,93,198,94,200,95,202,96,204,97,206,98,208, - 99,2,0,1,8,1,0,32,32,1,0,48,57,2,0,65,90,97,122,1,0,115,115,3,0,48,57,65, - 90,97,122,2,0,69,69,101,101,2,0,43,43,45,45,3,0,9,10,13,13,32,32,1162,0, - 2,1,0,0,0,0,4,1,0,0,0,0,6,1,0,0,0,0,8,1,0,0,0,0,10,1,0,0,0,0,12,1,0,0,0, - 0,14,1,0,0,0,0,16,1,0,0,0,0,18,1,0,0,0,0,20,1,0,0,0,0,22,1,0,0,0,0,24,1, - 0,0,0,0,26,1,0,0,0,0,28,1,0,0,0,0,30,1,0,0,0,0,32,1,0,0,0,0,34,1,0,0,0, - 0,36,1,0,0,0,0,38,1,0,0,0,0,40,1,0,0,0,0,42,1,0,0,0,0,44,1,0,0,0,0,46,1, - 0,0,0,0,48,1,0,0,0,0,50,1,0,0,0,0,52,1,0,0,0,0,54,1,0,0,0,0,56,1,0,0,0, - 0,58,1,0,0,0,0,60,1,0,0,0,0,62,1,0,0,0,0,64,1,0,0,0,0,66,1,0,0,0,0,68,1, - 0,0,0,0,70,1,0,0,0,0,72,1,0,0,0,0,74,1,0,0,0,0,76,1,0,0,0,0,78,1,0,0,0, - 0,80,1,0,0,0,0,82,1,0,0,0,0,84,1,0,0,0,0,86,1,0,0,0,0,88,1,0,0,0,0,90,1, - 0,0,0,0,92,1,0,0,0,0,94,1,0,0,0,0,96,1,0,0,0,0,98,1,0,0,0,0,100,1,0,0,0, - 0,102,1,0,0,0,0,104,1,0,0,0,0,106,1,0,0,0,0,108,1,0,0,0,0,110,1,0,0,0,0, - 112,1,0,0,0,0,114,1,0,0,0,0,116,1,0,0,0,0,118,1,0,0,0,0,120,1,0,0,0,0,122, - 1,0,0,0,0,124,1,0,0,0,0,126,1,0,0,0,0,128,1,0,0,0,0,138,1,0,0,0,0,140,1, - 0,0,0,0,142,1,0,0,0,0,144,1,0,0,0,0,146,1,0,0,0,0,148,1,0,0,0,0,150,1,0, - 0,0,0,152,1,0,0,0,0,154,1,0,0,0,0,156,1,0,0,0,0,158,1,0,0,0,0,160,1,0,0, - 0,1,162,1,0,0,0,1,164,1,0,0,0,1,166,1,0,0,0,1,168,1,0,0,0,1,170,1,0,0,0, - 1,172,1,0,0,0,1,174,1,0,0,0,1,176,1,0,0,0,1,178,1,0,0,0,1,180,1,0,0,0,1, - 182,1,0,0,0,1,184,1,0,0,0,1,186,1,0,0,0,1,188,1,0,0,0,1,190,1,0,0,0,1,192, - 1,0,0,0,1,196,1,0,0,0,1,198,1,0,0,0,1,200,1,0,0,0,1,202,1,0,0,0,1,204,1, - 0,0,0,1,206,1,0,0,0,1,208,1,0,0,0,2,210,1,0,0,0,4,214,1,0,0,0,6,224,1,0, - 0,0,8,226,1,0,0,0,10,228,1,0,0,0,12,230,1,0,0,0,14,232,1,0,0,0,16,234,1, - 0,0,0,18,243,1,0,0,0,20,245,1,0,0,0,22,247,1,0,0,0,24,249,1,0,0,0,26,253, - 1,0,0,0,28,258,1,0,0,0,30,271,1,0,0,0,32,285,1,0,0,0,34,299,1,0,0,0,36, - 307,1,0,0,0,38,313,1,0,0,0,40,328,1,0,0,0,42,334,1,0,0,0,44,341,1,0,0,0, - 46,347,1,0,0,0,48,361,1,0,0,0,50,366,1,0,0,0,52,374,1,0,0,0,54,387,1,0, - 0,0,56,401,1,0,0,0,58,403,1,0,0,0,60,421,1,0,0,0,62,425,1,0,0,0,64,429, - 1,0,0,0,66,433,1,0,0,0,68,437,1,0,0,0,70,441,1,0,0,0,72,445,1,0,0,0,74, - 452,1,0,0,0,76,459,1,0,0,0,78,466,1,0,0,0,80,471,1,0,0,0,82,476,1,0,0,0, - 84,481,1,0,0,0,86,486,1,0,0,0,88,489,1,0,0,0,90,493,1,0,0,0,92,506,1,0, - 0,0,94,520,1,0,0,0,96,534,1,0,0,0,98,551,1,0,0,0,100,562,1,0,0,0,102,574, - 1,0,0,0,104,579,1,0,0,0,106,581,1,0,0,0,108,583,1,0,0,0,110,585,1,0,0,0, - 112,587,1,0,0,0,114,589,1,0,0,0,116,591,1,0,0,0,118,595,1,0,0,0,120,599, - 1,0,0,0,122,601,1,0,0,0,124,603,1,0,0,0,126,606,1,0,0,0,128,641,1,0,0,0, - 130,643,1,0,0,0,132,645,1,0,0,0,134,695,1,0,0,0,136,697,1,0,0,0,138,839, - 1,0,0,0,140,855,1,0,0,0,142,869,1,0,0,0,144,871,1,0,0,0,146,897,1,0,0,0, - 148,899,1,0,0,0,150,905,1,0,0,0,152,911,1,0,0,0,154,917,1,0,0,0,156,922, - 1,0,0,0,158,927,1,0,0,0,160,931,1,0,0,0,162,933,1,0,0,0,164,937,1,0,0,0, - 166,947,1,0,0,0,168,953,1,0,0,0,170,968,1,0,0,0,172,974,1,0,0,0,174,981, - 1,0,0,0,176,987,1,0,0,0,178,989,1,0,0,0,180,991,1,0,0,0,182,998,1,0,0,0, - 184,1000,1,0,0,0,186,1002,1,0,0,0,188,1004,1,0,0,0,190,1006,1,0,0,0,192, - 1040,1,0,0,0,194,1042,1,0,0,0,196,1044,1,0,0,0,198,1052,1,0,0,0,200,1062, - 1,0,0,0,202,1068,1,0,0,0,204,1073,1,0,0,0,206,1078,1,0,0,0,208,1082,1,0, - 0,0,210,211,5,91,0,0,211,212,1,0,0,0,212,213,6,0,0,0,213,3,1,0,0,0,214, - 215,5,92,0,0,215,216,5,108,0,0,216,217,5,98,0,0,217,218,5,114,0,0,218,219, - 5,97,0,0,219,220,5,99,0,0,220,221,5,107,0,0,221,222,1,0,0,0,222,223,6,1, - 0,0,223,5,1,0,0,0,224,225,5,59,0,0,225,7,1,0,0,0,226,227,5,123,0,0,227, - 9,1,0,0,0,228,229,5,125,0,0,229,11,1,0,0,0,230,231,5,40,0,0,231,13,1,0, - 0,0,232,233,5,41,0,0,233,15,1,0,0,0,234,235,5,124,0,0,235,17,1,0,0,0,236, - 237,5,124,0,0,237,244,5,124,0,0,238,239,5,92,0,0,239,240,5,86,0,0,240,241, - 5,101,0,0,241,242,5,114,0,0,242,244,5,116,0,0,243,236,1,0,0,0,243,238,1, - 0,0,0,244,19,1,0,0,0,245,246,5,95,0,0,246,21,1,0,0,0,247,248,5,33,0,0,248, - 23,1,0,0,0,249,250,5,92,0,0,250,251,5,112,0,0,251,252,5,105,0,0,252,25, - 1,0,0,0,253,254,5,92,0,0,254,255,5,105,0,0,255,256,5,110,0,0,256,257,5, - 116,0,0,257,27,1,0,0,0,258,259,5,92,0,0,259,260,5,105,0,0,260,261,5,110, - 0,0,261,262,5,116,0,0,262,266,1,0,0,0,263,265,7,0,0,0,264,263,1,0,0,0,265, - 268,1,0,0,0,266,264,1,0,0,0,266,267,1,0,0,0,267,269,1,0,0,0,268,266,1,0, - 0,0,269,270,5,95,0,0,270,29,1,0,0,0,271,272,5,92,0,0,272,273,5,105,0,0, - 273,274,5,110,0,0,274,275,5,116,0,0,275,279,1,0,0,0,276,278,7,0,0,0,277, - 276,1,0,0,0,278,281,1,0,0,0,279,277,1,0,0,0,279,280,1,0,0,0,280,282,1,0, - 0,0,281,279,1,0,0,0,282,283,5,95,0,0,283,284,7,1,0,0,284,31,1,0,0,0,285, - 286,5,92,0,0,286,287,5,105,0,0,287,288,5,110,0,0,288,289,5,116,0,0,289, - 293,1,0,0,0,290,292,7,0,0,0,291,290,1,0,0,0,292,295,1,0,0,0,293,291,1,0, - 0,0,293,294,1,0,0,0,294,296,1,0,0,0,295,293,1,0,0,0,296,297,5,95,0,0,297, - 298,7,2,0,0,298,33,1,0,0,0,299,300,5,92,0,0,300,301,5,109,0,0,301,302,5, - 97,0,0,302,303,5,116,0,0,303,304,5,104,0,0,304,305,5,114,0,0,305,306,5, - 109,0,0,306,35,1,0,0,0,307,308,5,92,0,0,308,309,5,102,0,0,309,310,5,114, - 0,0,310,311,5,97,0,0,311,312,5,99,0,0,312,37,1,0,0,0,313,314,5,92,0,0,314, - 315,5,102,0,0,315,316,5,114,0,0,316,317,5,97,0,0,317,318,5,99,0,0,318,322, - 1,0,0,0,319,321,7,0,0,0,320,319,1,0,0,0,321,324,1,0,0,0,322,320,1,0,0,0, - 322,323,1,0,0,0,323,325,1,0,0,0,324,322,1,0,0,0,325,326,7,1,0,0,326,327, - 7,1,0,0,327,39,1,0,0,0,328,329,5,92,0,0,329,330,5,99,0,0,330,331,5,100, - 0,0,331,332,5,111,0,0,332,333,5,116,0,0,333,41,1,0,0,0,334,335,5,92,0,0, - 335,336,5,116,0,0,336,337,5,105,0,0,337,338,5,109,0,0,338,339,5,101,0,0, - 339,340,5,115,0,0,340,43,1,0,0,0,341,342,5,92,0,0,342,343,5,115,0,0,343, - 344,5,113,0,0,344,345,5,114,0,0,345,346,5,116,0,0,346,45,1,0,0,0,347,348, - 5,92,0,0,348,349,5,115,0,0,349,350,5,113,0,0,350,351,5,114,0,0,351,352, - 5,116,0,0,352,356,1,0,0,0,353,355,7,0,0,0,354,353,1,0,0,0,355,358,1,0,0, - 0,356,354,1,0,0,0,356,357,1,0,0,0,357,359,1,0,0,0,358,356,1,0,0,0,359,360, - 7,1,0,0,360,47,1,0,0,0,361,362,5,92,0,0,362,363,5,115,0,0,363,364,5,105, - 0,0,364,365,5,109,0,0,365,49,1,0,0,0,366,367,5,92,0,0,367,368,5,97,0,0, - 368,369,5,112,0,0,369,370,5,112,0,0,370,371,5,114,0,0,371,372,5,111,0,0, - 372,373,5,120,0,0,373,51,1,0,0,0,374,375,5,92,0,0,375,376,5,112,0,0,376, - 377,5,108,0,0,377,378,5,97,0,0,378,379,5,99,0,0,379,380,5,101,0,0,380,381, - 5,104,0,0,381,382,5,111,0,0,382,383,5,108,0,0,383,384,5,100,0,0,384,385, - 5,101,0,0,385,386,5,114,0,0,386,53,1,0,0,0,387,388,5,94,0,0,388,389,5,123, - 0,0,389,390,5,92,0,0,390,391,5,109,0,0,391,392,5,97,0,0,392,393,5,116,0, - 0,393,394,5,104,0,0,394,395,5,114,0,0,395,396,5,109,0,0,396,397,5,123,0, - 0,397,398,5,84,0,0,398,399,5,125,0,0,399,400,5,125,0,0,400,55,1,0,0,0,401, - 402,5,92,0,0,402,57,1,0,0,0,403,404,5,97,0,0,404,405,5,115,0,0,405,409, - 1,0,0,0,406,410,5,32,0,0,407,408,5,92,0,0,408,410,5,58,0,0,409,406,1,0, - 0,0,409,407,1,0,0,0,410,411,1,0,0,0,411,409,1,0,0,0,411,412,1,0,0,0,412, - 413,1,0,0,0,413,414,5,108,0,0,414,415,5,105,0,0,415,416,5,110,0,0,416,417, - 5,101,0,0,417,419,1,0,0,0,418,420,7,3,0,0,419,418,1,0,0,0,419,420,1,0,0, - 0,420,59,1,0,0,0,421,422,5,115,0,0,422,423,5,105,0,0,423,424,5,110,0,0, - 424,61,1,0,0,0,425,426,5,99,0,0,426,427,5,111,0,0,427,428,5,115,0,0,428, - 63,1,0,0,0,429,430,5,116,0,0,430,431,5,97,0,0,431,432,5,110,0,0,432,65, - 1,0,0,0,433,434,5,99,0,0,434,435,5,111,0,0,435,436,5,116,0,0,436,67,1,0, - 0,0,437,438,5,115,0,0,438,439,5,101,0,0,439,440,5,99,0,0,440,69,1,0,0,0, - 441,442,5,99,0,0,442,443,5,115,0,0,443,444,5,99,0,0,444,71,1,0,0,0,445, - 446,5,97,0,0,446,447,5,114,0,0,447,448,5,99,0,0,448,449,5,115,0,0,449,450, - 5,105,0,0,450,451,5,110,0,0,451,73,1,0,0,0,452,453,5,97,0,0,453,454,5,114, - 0,0,454,455,5,99,0,0,455,456,5,99,0,0,456,457,5,111,0,0,457,458,5,115,0, - 0,458,75,1,0,0,0,459,460,5,97,0,0,460,461,5,114,0,0,461,462,5,99,0,0,462, - 463,5,116,0,0,463,464,5,97,0,0,464,465,5,110,0,0,465,77,1,0,0,0,466,467, - 5,115,0,0,467,468,5,105,0,0,468,469,5,110,0,0,469,470,5,104,0,0,470,79, - 1,0,0,0,471,472,5,99,0,0,472,473,5,111,0,0,473,474,5,115,0,0,474,475,5, - 104,0,0,475,81,1,0,0,0,476,477,5,116,0,0,477,478,5,97,0,0,478,479,5,110, - 0,0,479,480,5,104,0,0,480,83,1,0,0,0,481,482,5,99,0,0,482,483,5,111,0,0, - 483,484,5,116,0,0,484,485,5,104,0,0,485,85,1,0,0,0,486,487,5,108,0,0,487, - 488,5,110,0,0,488,87,1,0,0,0,489,490,5,108,0,0,490,491,5,111,0,0,491,492, - 5,103,0,0,492,89,1,0,0,0,493,494,5,92,0,0,494,495,5,108,0,0,495,496,5,111, - 0,0,496,497,5,103,0,0,497,501,1,0,0,0,498,500,7,0,0,0,499,498,1,0,0,0,500, - 503,1,0,0,0,501,499,1,0,0,0,501,502,1,0,0,0,502,504,1,0,0,0,503,501,1,0, - 0,0,504,505,5,95,0,0,505,91,1,0,0,0,506,507,5,92,0,0,507,508,5,108,0,0, - 508,509,5,111,0,0,509,510,5,103,0,0,510,514,1,0,0,0,511,513,7,0,0,0,512, - 511,1,0,0,0,513,516,1,0,0,0,514,512,1,0,0,0,514,515,1,0,0,0,515,517,1,0, - 0,0,516,514,1,0,0,0,517,518,5,95,0,0,518,519,7,1,0,0,519,93,1,0,0,0,520, - 521,5,92,0,0,521,522,5,108,0,0,522,523,5,111,0,0,523,524,5,103,0,0,524, - 528,1,0,0,0,525,527,7,0,0,0,526,525,1,0,0,0,527,530,1,0,0,0,528,526,1,0, - 0,0,528,529,1,0,0,0,529,531,1,0,0,0,530,528,1,0,0,0,531,532,5,95,0,0,532, - 533,7,2,0,0,533,95,1,0,0,0,534,535,5,92,0,0,535,536,5,116,0,0,536,537,5, - 101,0,0,537,538,5,120,0,0,538,539,5,116,0,0,539,540,5,123,0,0,540,544,1, - 0,0,0,541,543,9,0,0,0,542,541,1,0,0,0,543,546,1,0,0,0,544,545,1,0,0,0,544, - 542,1,0,0,0,545,547,1,0,0,0,546,544,1,0,0,0,547,548,5,125,0,0,548,549,1, - 0,0,0,549,550,6,47,1,0,550,97,1,0,0,0,551,552,5,92,0,0,552,553,5,108,0, - 0,553,554,5,101,0,0,554,555,5,102,0,0,555,556,5,116,0,0,556,558,1,0,0,0, - 557,559,5,46,0,0,558,557,1,0,0,0,558,559,1,0,0,0,559,560,1,0,0,0,560,561, - 6,48,1,0,561,99,1,0,0,0,562,563,5,92,0,0,563,564,5,114,0,0,564,565,5,105, - 0,0,565,566,5,103,0,0,566,567,5,104,0,0,567,568,5,116,0,0,568,570,1,0,0, - 0,569,571,5,46,0,0,570,569,1,0,0,0,570,571,1,0,0,0,571,572,1,0,0,0,572, - 573,6,49,1,0,573,101,1,0,0,0,574,575,5,36,0,0,575,576,5,36,0,0,576,577, - 1,0,0,0,577,578,6,50,1,0,578,103,1,0,0,0,579,580,5,43,0,0,580,105,1,0,0, - 0,581,582,5,45,0,0,582,107,1,0,0,0,583,584,5,94,0,0,584,109,1,0,0,0,585, - 586,5,61,0,0,586,111,1,0,0,0,587,588,5,60,0,0,588,113,1,0,0,0,589,590,5, - 62,0,0,590,115,1,0,0,0,591,592,5,92,0,0,592,593,5,108,0,0,593,594,5,101, - 0,0,594,117,1,0,0,0,595,596,5,92,0,0,596,597,5,103,0,0,597,598,5,101,0, - 0,598,119,1,0,0,0,599,600,5,44,0,0,600,121,1,0,0,0,601,602,5,46,0,0,602, - 123,1,0,0,0,603,604,5,94,0,0,604,605,7,1,0,0,605,125,1,0,0,0,606,607,5, - 94,0,0,607,608,7,2,0,0,608,127,1,0,0,0,609,611,3,130,64,0,610,609,1,0,0, - 0,611,612,1,0,0,0,612,610,1,0,0,0,612,613,1,0,0,0,613,614,1,0,0,0,614,618, - 5,46,0,0,615,617,3,130,64,0,616,615,1,0,0,0,617,620,1,0,0,0,618,616,1,0, - 0,0,618,619,1,0,0,0,619,622,1,0,0,0,620,618,1,0,0,0,621,623,3,134,66,0, - 622,621,1,0,0,0,622,623,1,0,0,0,623,642,1,0,0,0,624,626,5,46,0,0,625,627, - 3,130,64,0,626,625,1,0,0,0,627,628,1,0,0,0,628,626,1,0,0,0,628,629,1,0, - 0,0,629,631,1,0,0,0,630,632,3,134,66,0,631,630,1,0,0,0,631,632,1,0,0,0, - 632,642,1,0,0,0,633,635,3,130,64,0,634,633,1,0,0,0,635,636,1,0,0,0,636, - 634,1,0,0,0,636,637,1,0,0,0,637,639,1,0,0,0,638,640,3,134,66,0,639,638, - 1,0,0,0,639,640,1,0,0,0,640,642,1,0,0,0,641,610,1,0,0,0,641,624,1,0,0,0, - 641,634,1,0,0,0,642,129,1,0,0,0,643,644,7,1,0,0,644,131,1,0,0,0,645,649, - 7,2,0,0,646,648,7,4,0,0,647,646,1,0,0,0,648,651,1,0,0,0,649,647,1,0,0,0, - 649,650,1,0,0,0,650,133,1,0,0,0,651,649,1,0,0,0,652,654,7,5,0,0,653,655, - 7,6,0,0,654,653,1,0,0,0,654,655,1,0,0,0,655,657,1,0,0,0,656,658,3,130,64, - 0,657,656,1,0,0,0,658,659,1,0,0,0,659,657,1,0,0,0,659,660,1,0,0,0,660,696, - 1,0,0,0,661,663,5,32,0,0,662,661,1,0,0,0,663,666,1,0,0,0,664,662,1,0,0, - 0,664,665,1,0,0,0,665,669,1,0,0,0,666,664,1,0,0,0,667,670,3,40,19,0,668, - 670,3,42,20,0,669,667,1,0,0,0,669,668,1,0,0,0,670,674,1,0,0,0,671,673,5, - 32,0,0,672,671,1,0,0,0,673,676,1,0,0,0,674,672,1,0,0,0,674,675,1,0,0,0, - 675,677,1,0,0,0,676,674,1,0,0,0,677,678,5,49,0,0,678,679,5,48,0,0,679,680, - 1,0,0,0,680,693,3,108,53,0,681,694,3,130,64,0,682,684,3,8,3,0,683,685,7, - 6,0,0,684,683,1,0,0,0,684,685,1,0,0,0,685,687,1,0,0,0,686,688,3,130,64, - 0,687,686,1,0,0,0,688,689,1,0,0,0,689,687,1,0,0,0,689,690,1,0,0,0,690,691, - 1,0,0,0,691,692,3,10,4,0,692,694,1,0,0,0,693,681,1,0,0,0,693,682,1,0,0, - 0,694,696,1,0,0,0,695,652,1,0,0,0,695,664,1,0,0,0,696,135,1,0,0,0,697,837, - 5,92,0,0,698,699,5,97,0,0,699,700,5,108,0,0,700,701,5,112,0,0,701,702,5, - 104,0,0,702,838,5,97,0,0,703,704,5,98,0,0,704,705,5,101,0,0,705,706,5,116, - 0,0,706,838,5,97,0,0,707,708,5,103,0,0,708,709,5,97,0,0,709,710,5,109,0, - 0,710,711,5,109,0,0,711,838,5,97,0,0,712,713,5,100,0,0,713,714,5,101,0, - 0,714,715,5,108,0,0,715,716,5,116,0,0,716,838,5,97,0,0,717,718,5,101,0, - 0,718,719,5,112,0,0,719,720,5,115,0,0,720,721,5,105,0,0,721,722,5,108,0, - 0,722,723,5,111,0,0,723,838,5,110,0,0,724,725,5,122,0,0,725,726,5,101,0, - 0,726,727,5,116,0,0,727,838,5,97,0,0,728,729,5,101,0,0,729,730,5,116,0, - 0,730,838,5,97,0,0,731,732,5,116,0,0,732,733,5,104,0,0,733,734,5,101,0, - 0,734,735,5,116,0,0,735,838,5,97,0,0,736,737,5,105,0,0,737,738,5,111,0, - 0,738,739,5,116,0,0,739,838,5,97,0,0,740,741,5,107,0,0,741,742,5,97,0,0, - 742,743,5,112,0,0,743,744,5,112,0,0,744,838,5,97,0,0,745,746,5,108,0,0, - 746,747,5,97,0,0,747,748,5,109,0,0,748,749,5,98,0,0,749,750,5,100,0,0,750, - 838,5,97,0,0,751,752,5,109,0,0,752,838,5,117,0,0,753,754,5,110,0,0,754, - 838,5,117,0,0,755,756,5,120,0,0,756,838,5,105,0,0,757,758,5,114,0,0,758, - 759,5,104,0,0,759,838,5,111,0,0,760,761,5,115,0,0,761,762,5,105,0,0,762, - 763,5,103,0,0,763,764,5,109,0,0,764,838,5,97,0,0,765,766,5,116,0,0,766, - 767,5,97,0,0,767,838,5,117,0,0,768,769,5,117,0,0,769,770,5,112,0,0,770, - 771,5,115,0,0,771,772,5,105,0,0,772,773,5,108,0,0,773,774,5,111,0,0,774, - 838,5,110,0,0,775,776,5,112,0,0,776,777,5,104,0,0,777,838,5,105,0,0,778, - 779,5,99,0,0,779,780,5,104,0,0,780,838,5,105,0,0,781,782,5,112,0,0,782, - 783,5,115,0,0,783,838,5,105,0,0,784,785,5,111,0,0,785,786,5,109,0,0,786, - 787,5,101,0,0,787,788,5,103,0,0,788,838,5,97,0,0,789,790,5,71,0,0,790,791, - 5,97,0,0,791,792,5,109,0,0,792,793,5,109,0,0,793,838,5,97,0,0,794,795,5, - 68,0,0,795,796,5,101,0,0,796,797,5,108,0,0,797,798,5,116,0,0,798,838,5, - 97,0,0,799,800,5,84,0,0,800,801,5,104,0,0,801,802,5,101,0,0,802,803,5,116, - 0,0,803,838,5,97,0,0,804,805,5,76,0,0,805,806,5,97,0,0,806,807,5,109,0, - 0,807,808,5,98,0,0,808,809,5,100,0,0,809,838,5,97,0,0,810,811,5,88,0,0, - 811,838,5,105,0,0,812,813,5,80,0,0,813,838,5,105,0,0,814,815,5,83,0,0,815, - 816,5,105,0,0,816,817,5,103,0,0,817,818,5,109,0,0,818,838,5,97,0,0,819, - 820,5,85,0,0,820,821,5,112,0,0,821,822,5,115,0,0,822,823,5,105,0,0,823, - 824,5,108,0,0,824,825,5,111,0,0,825,838,5,110,0,0,826,827,5,80,0,0,827, - 828,5,104,0,0,828,838,5,105,0,0,829,830,5,80,0,0,830,831,5,115,0,0,831, - 838,5,105,0,0,832,833,5,79,0,0,833,834,5,109,0,0,834,835,5,101,0,0,835, - 836,5,103,0,0,836,838,5,97,0,0,837,698,1,0,0,0,837,703,1,0,0,0,837,707, - 1,0,0,0,837,712,1,0,0,0,837,717,1,0,0,0,837,724,1,0,0,0,837,728,1,0,0,0, - 837,731,1,0,0,0,837,736,1,0,0,0,837,740,1,0,0,0,837,745,1,0,0,0,837,751, - 1,0,0,0,837,753,1,0,0,0,837,755,1,0,0,0,837,757,1,0,0,0,837,760,1,0,0,0, - 837,765,1,0,0,0,837,768,1,0,0,0,837,775,1,0,0,0,837,778,1,0,0,0,837,781, - 1,0,0,0,837,784,1,0,0,0,837,789,1,0,0,0,837,794,1,0,0,0,837,799,1,0,0,0, - 837,804,1,0,0,0,837,810,1,0,0,0,837,812,1,0,0,0,837,814,1,0,0,0,837,819, - 1,0,0,0,837,826,1,0,0,0,837,829,1,0,0,0,837,832,1,0,0,0,838,137,1,0,0,0, - 839,840,5,92,0,0,840,841,5,98,0,0,841,842,5,101,0,0,842,843,5,103,0,0,843, - 844,5,105,0,0,844,845,5,110,0,0,845,846,5,123,0,0,846,847,5,98,0,0,847, - 848,5,109,0,0,848,849,5,97,0,0,849,850,5,116,0,0,850,851,5,114,0,0,851, - 852,5,105,0,0,852,853,5,120,0,0,853,854,5,125,0,0,854,139,1,0,0,0,855,856, - 5,92,0,0,856,857,5,101,0,0,857,858,5,110,0,0,858,859,5,100,0,0,859,860, - 5,123,0,0,860,861,5,98,0,0,861,862,5,109,0,0,862,863,5,97,0,0,863,864,5, - 116,0,0,864,865,5,114,0,0,865,866,5,105,0,0,866,867,5,120,0,0,867,868,5, - 125,0,0,868,141,1,0,0,0,869,870,5,38,0,0,870,143,1,0,0,0,871,872,5,92,0, - 0,872,873,5,92,0,0,873,145,1,0,0,0,874,876,7,0,0,0,875,874,1,0,0,0,876, - 879,1,0,0,0,877,875,1,0,0,0,877,878,1,0,0,0,878,880,1,0,0,0,879,877,1,0, - 0,0,880,881,5,95,0,0,881,882,5,123,0,0,882,884,1,0,0,0,883,885,7,4,0,0, - 884,883,1,0,0,0,885,886,1,0,0,0,886,884,1,0,0,0,886,887,1,0,0,0,887,888, - 1,0,0,0,888,898,5,125,0,0,889,891,7,0,0,0,890,889,1,0,0,0,891,894,1,0,0, - 0,892,890,1,0,0,0,892,893,1,0,0,0,893,895,1,0,0,0,894,892,1,0,0,0,895,896, - 5,95,0,0,896,898,7,4,0,0,897,877,1,0,0,0,897,892,1,0,0,0,898,147,1,0,0, - 0,899,900,5,94,0,0,900,901,7,2,0,0,901,902,3,146,72,0,902,149,1,0,0,0,903, - 906,3,132,65,0,904,906,3,136,67,0,905,903,1,0,0,0,905,904,1,0,0,0,906,908, - 1,0,0,0,907,909,3,146,72,0,908,907,1,0,0,0,908,909,1,0,0,0,909,151,1,0, - 0,0,910,912,7,7,0,0,911,910,1,0,0,0,912,913,1,0,0,0,913,911,1,0,0,0,913, - 914,1,0,0,0,914,915,1,0,0,0,915,916,6,75,1,0,916,153,1,0,0,0,917,918,5, - 92,0,0,918,919,5,32,0,0,919,920,1,0,0,0,920,921,6,76,1,0,921,155,1,0,0, - 0,922,923,5,92,0,0,923,924,5,58,0,0,924,925,1,0,0,0,925,926,6,77,1,0,926, - 157,1,0,0,0,927,928,5,160,0,0,928,929,1,0,0,0,929,930,6,78,1,0,930,159, - 1,0,0,0,931,932,9,0,0,0,932,161,1,0,0,0,933,934,5,93,0,0,934,935,1,0,0, - 0,935,936,6,80,2,0,936,163,1,0,0,0,937,938,5,92,0,0,938,939,5,114,0,0,939, - 940,5,98,0,0,940,941,5,114,0,0,941,942,5,97,0,0,942,943,5,99,0,0,943,944, - 5,107,0,0,944,945,1,0,0,0,945,946,6,81,2,0,946,165,1,0,0,0,947,948,5,92, - 0,0,948,949,5,102,0,0,949,950,5,114,0,0,950,951,5,97,0,0,951,952,5,99,0, - 0,952,167,1,0,0,0,953,954,5,92,0,0,954,955,5,102,0,0,955,956,5,114,0,0, - 956,957,5,97,0,0,957,958,5,99,0,0,958,962,1,0,0,0,959,961,7,0,0,0,960,959, - 1,0,0,0,961,964,1,0,0,0,962,960,1,0,0,0,962,963,1,0,0,0,963,965,1,0,0,0, - 964,962,1,0,0,0,965,966,7,1,0,0,966,967,7,1,0,0,967,169,1,0,0,0,968,969, - 5,92,0,0,969,970,5,99,0,0,970,971,5,100,0,0,971,972,5,111,0,0,972,973,5, - 116,0,0,973,171,1,0,0,0,974,975,5,92,0,0,975,976,5,116,0,0,976,977,5,105, - 0,0,977,978,5,109,0,0,978,979,5,101,0,0,979,980,5,115,0,0,980,173,1,0,0, - 0,981,982,5,92,0,0,982,983,5,115,0,0,983,984,5,113,0,0,984,985,5,114,0, - 0,985,986,5,116,0,0,986,175,1,0,0,0,987,988,5,44,0,0,988,177,1,0,0,0,989, - 990,5,94,0,0,990,179,1,0,0,0,991,995,7,2,0,0,992,994,7,4,0,0,993,992,1, - 0,0,0,994,997,1,0,0,0,995,993,1,0,0,0,995,996,1,0,0,0,996,181,1,0,0,0,997, - 995,1,0,0,0,998,999,5,40,0,0,999,183,1,0,0,0,1000,1001,5,41,0,0,1001,185, - 1,0,0,0,1002,1003,5,123,0,0,1003,187,1,0,0,0,1004,1005,5,125,0,0,1005,189, - 1,0,0,0,1006,1007,5,49,0,0,1007,191,1,0,0,0,1008,1010,5,45,0,0,1009,1008, - 1,0,0,0,1009,1010,1,0,0,0,1010,1012,1,0,0,0,1011,1013,3,194,96,0,1012,1011, - 1,0,0,0,1013,1014,1,0,0,0,1014,1012,1,0,0,0,1014,1015,1,0,0,0,1015,1016, - 1,0,0,0,1016,1020,5,46,0,0,1017,1019,3,194,96,0,1018,1017,1,0,0,0,1019, - 1022,1,0,0,0,1020,1018,1,0,0,0,1020,1021,1,0,0,0,1021,1041,1,0,0,0,1022, - 1020,1,0,0,0,1023,1025,5,45,0,0,1024,1023,1,0,0,0,1024,1025,1,0,0,0,1025, - 1026,1,0,0,0,1026,1028,5,46,0,0,1027,1029,3,194,96,0,1028,1027,1,0,0,0, - 1029,1030,1,0,0,0,1030,1028,1,0,0,0,1030,1031,1,0,0,0,1031,1041,1,0,0,0, - 1032,1034,5,45,0,0,1033,1032,1,0,0,0,1033,1034,1,0,0,0,1034,1036,1,0,0, - 0,1035,1037,3,194,96,0,1036,1035,1,0,0,0,1037,1038,1,0,0,0,1038,1036,1, - 0,0,0,1038,1039,1,0,0,0,1039,1041,1,0,0,0,1040,1009,1,0,0,0,1040,1024,1, - 0,0,0,1040,1033,1,0,0,0,1041,193,1,0,0,0,1042,1043,7,1,0,0,1043,195,1,0, - 0,0,1044,1045,5,92,0,0,1045,1046,5,108,0,0,1046,1047,5,101,0,0,1047,1048, - 5,102,0,0,1048,1049,5,116,0,0,1049,1050,1,0,0,0,1050,1051,6,97,1,0,1051, - 197,1,0,0,0,1052,1053,5,92,0,0,1053,1054,5,114,0,0,1054,1055,5,105,0,0, - 1055,1056,5,103,0,0,1056,1057,5,104,0,0,1057,1058,5,116,0,0,1058,1059,1, - 0,0,0,1059,1060,6,98,1,0,1060,199,1,0,0,0,1061,1063,7,7,0,0,1062,1061,1, - 0,0,0,1063,1064,1,0,0,0,1064,1062,1,0,0,0,1064,1065,1,0,0,0,1065,1066,1, - 0,0,0,1066,1067,6,99,1,0,1067,201,1,0,0,0,1068,1069,5,92,0,0,1069,1070, - 5,32,0,0,1070,1071,1,0,0,0,1071,1072,6,100,1,0,1072,203,1,0,0,0,1073,1074, - 5,92,0,0,1074,1075,5,58,0,0,1075,1076,1,0,0,0,1076,1077,6,101,1,0,1077, - 205,1,0,0,0,1078,1079,5,160,0,0,1079,1080,1,0,0,0,1080,1081,6,102,1,0,1081, - 207,1,0,0,0,1082,1083,9,0,0,0,1083,209,1,0,0,0,54,0,1,243,266,279,293,322, - 356,409,411,419,501,514,528,544,558,570,612,618,622,628,631,636,639,641, - 649,654,659,664,669,674,684,689,693,695,837,877,886,892,897,905,908,913, - 962,995,1009,1014,1020,1024,1030,1033,1038,1040,1064,3,2,1,0,6,0,0,2,0, - 0]; + public static readonly _serializedATN: number[] = [4,0,101,1116,6,-1,6, + -1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8, + 7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15, + 2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2, + 23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30, + 7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7, + 37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44, + 2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2, + 52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,59, + 7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,2,65,7,65,2,66,7, + 66,2,67,7,67,2,68,7,68,2,69,7,69,2,70,7,70,2,71,7,71,2,72,7,72,2,73,7,73, + 2,74,7,74,2,75,7,75,2,76,7,76,2,77,7,77,2,78,7,78,2,79,7,79,2,80,7,80,2, + 81,7,81,2,82,7,82,2,83,7,83,2,84,7,84,2,85,7,85,2,86,7,86,2,87,7,87,2,88, + 7,88,2,89,7,89,2,90,7,90,2,91,7,91,2,92,7,92,2,93,7,93,2,94,7,94,2,95,7, + 95,2,96,7,96,2,97,7,97,2,98,7,98,2,99,7,99,2,100,7,100,2,101,7,101,2,102, + 7,102,2,103,7,103,2,104,7,104,2,105,7,105,2,106,7,106,2,107,7,107,1,0,1, + 0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,3,1,3,1,4,1, + 4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8,3,8,252,8,8,1,9,1, + 9,1,10,1,10,1,10,1,11,1,11,1,11,1,12,1,12,1,13,1,13,1,13,1,13,1,14,1,14, + 1,14,1,14,1,14,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,16,1,16,1,16,1,16,1, + 16,1,16,5,16,286,8,16,10,16,12,16,289,9,16,1,16,1,16,1,17,1,17,1,17,1,17, + 1,17,1,17,5,17,299,8,17,10,17,12,17,302,9,17,1,17,1,17,1,18,1,18,1,18,1, + 18,1,18,1,18,5,18,312,8,18,10,18,12,18,315,9,18,1,18,1,18,1,19,1,19,1,19, + 1,19,1,19,1,19,5,19,325,8,19,10,19,12,19,328,9,19,1,19,1,19,1,20,1,20,1, + 20,1,20,1,20,1,20,1,20,1,20,1,21,1,21,1,21,1,21,1,21,1,21,1,22,1,22,1,22, + 1,22,1,22,1,22,1,22,5,22,353,8,22,10,22,12,22,356,9,22,1,22,1,22,1,22,1, + 23,1,23,1,23,1,23,1,23,1,23,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,25,1,25, + 1,25,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,26,1,26,1,26,5,26,387,8,26,10, + 26,12,26,390,9,26,1,26,1,26,1,27,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,28, + 1,28,1,28,1,28,1,28,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, + 29,1,29,1,29,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30, + 1,30,1,30,1,31,1,31,1,32,1,32,1,32,1,32,1,32,1,32,4,32,442,8,32,11,32,12, + 32,443,1,32,1,32,1,32,1,32,1,32,1,32,3,32,452,8,32,1,33,1,33,1,33,1,33, + 1,34,1,34,1,34,1,34,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,37,1,37,1, + 37,1,37,1,38,1,38,1,38,1,38,1,39,1,39,1,39,1,39,1,39,1,39,1,39,1,40,1,40, + 1,40,1,40,1,40,1,40,1,40,1,41,1,41,1,41,1,41,1,41,1,41,1,41,1,42,1,42,1, + 42,1,42,1,42,1,43,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,45,1,45, + 1,45,1,45,1,45,1,46,1,46,1,46,1,47,1,47,1,47,1,47,1,48,1,48,1,48,1,48,1, + 48,1,48,5,48,532,8,48,10,48,12,48,535,9,48,1,48,1,48,1,49,1,49,1,49,1,49, + 1,49,1,49,5,49,545,8,49,10,49,12,49,548,9,49,1,49,1,49,1,50,1,50,1,50,1, + 50,1,50,1,50,5,50,558,8,50,10,50,12,50,561,9,50,1,50,1,50,1,51,1,51,1,51, + 1,51,1,51,1,51,1,51,1,51,5,51,573,8,51,10,51,12,51,576,9,51,1,51,1,51,1, + 51,1,51,1,52,1,52,1,52,1,52,1,52,1,52,1,52,3,52,589,8,52,1,52,1,52,1,53, + 1,53,1,53,1,53,1,53,1,53,1,53,1,53,3,53,601,8,53,1,53,1,53,1,54,1,54,1, + 54,1,54,1,54,1,55,1,55,1,56,1,56,1,57,1,57,1,58,1,58,1,59,1,59,1,60,1,60, + 1,61,1,61,1,61,1,61,1,62,1,62,1,62,1,62,1,63,1,63,1,64,1,64,1,65,1,65,1, + 65,1,66,1,66,1,66,1,67,4,67,641,8,67,11,67,12,67,642,1,67,1,67,5,67,647, + 8,67,10,67,12,67,650,9,67,1,67,3,67,653,8,67,1,67,1,67,4,67,657,8,67,11, + 67,12,67,658,1,67,3,67,662,8,67,1,67,4,67,665,8,67,11,67,12,67,666,1,67, + 3,67,670,8,67,3,67,672,8,67,1,68,1,68,1,69,1,69,5,69,678,8,69,10,69,12, + 69,681,9,69,1,70,1,70,3,70,685,8,70,1,70,4,70,688,8,70,11,70,12,70,689, + 1,70,5,70,693,8,70,10,70,12,70,696,9,70,1,70,1,70,3,70,700,8,70,1,70,5, + 70,703,8,70,10,70,12,70,706,9,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,3,70, + 715,8,70,1,70,4,70,718,8,70,11,70,12,70,719,1,70,1,70,3,70,724,8,70,3,70, + 726,8,70,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1, + 71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71, + 1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1, + 71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71, + 1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1, + 71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71, + 1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1, + 71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71, + 1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1, + 71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,3,71,868,8,71, + 1,72,1,72,1,72,1,72,1,72,1,72,1,72,1,72,1,72,1,72,1,72,1,72,1,72,1,72,1, + 72,1,72,1,73,1,73,1,73,1,73,1,73,1,73,1,73,1,73,1,73,1,73,1,73,1,73,1,73, + 1,73,1,74,1,74,1,75,1,75,1,75,1,76,5,76,906,8,76,10,76,12,76,909,9,76,1, + 76,1,76,1,76,1,76,4,76,915,8,76,11,76,12,76,916,1,76,1,76,5,76,921,8,76, + 10,76,12,76,924,9,76,1,76,1,76,3,76,928,8,76,3,76,930,8,76,1,77,1,77,1, + 77,1,77,1,78,1,78,3,78,938,8,78,1,78,3,78,941,8,78,1,79,4,79,944,8,79,11, + 79,12,79,945,1,79,1,79,1,80,1,80,1,80,1,80,1,80,1,81,1,81,1,81,1,81,1,81, + 1,82,1,82,1,82,1,82,1,83,1,83,1,84,1,84,1,84,1,84,1,85,1,85,1,85,1,85,1, + 85,1,85,1,85,1,85,1,85,1,85,1,86,1,86,1,86,1,86,1,86,1,86,1,87,1,87,1,87, + 1,87,1,87,1,87,1,87,5,87,993,8,87,10,87,12,87,996,9,87,1,87,1,87,1,87,1, + 88,1,88,1,88,1,88,1,88,1,88,1,89,1,89,1,89,1,89,1,89,1,89,1,89,1,90,1,90, + 1,90,1,90,1,90,1,90,1,91,1,91,1,92,1,92,1,93,1,93,5,93,1026,8,93,10,93, + 12,93,1029,9,93,1,94,1,94,1,95,1,95,1,96,1,96,1,97,1,97,1,98,1,98,1,99, + 3,99,1042,8,99,1,99,4,99,1045,8,99,11,99,12,99,1046,1,99,1,99,5,99,1051, + 8,99,10,99,12,99,1054,9,99,1,99,3,99,1057,8,99,1,99,1,99,4,99,1061,8,99, + 11,99,12,99,1062,1,99,3,99,1066,8,99,1,99,4,99,1069,8,99,11,99,12,99,1070, + 3,99,1073,8,99,1,100,1,100,1,101,1,101,1,101,1,101,1,101,1,101,1,101,1, + 101,1,102,1,102,1,102,1,102,1,102,1,102,1,102,1,102,1,102,1,103,4,103,1095, + 8,103,11,103,12,103,1096,1,103,1,103,1,104,1,104,1,104,1,104,1,104,1,105, + 1,105,1,105,1,105,1,105,1,106,1,106,1,106,1,106,1,107,1,107,1,574,0,108, + 2,1,4,2,6,3,8,4,10,5,12,6,14,7,16,8,18,9,20,10,22,0,24,0,26,11,28,12,30, + 13,32,14,34,15,36,16,38,17,40,18,42,19,44,20,46,21,48,22,50,23,52,24,54, + 25,56,26,58,27,60,28,62,29,64,30,66,31,68,32,70,33,72,34,74,35,76,36,78, + 37,80,38,82,39,84,40,86,41,88,42,90,43,92,44,94,45,96,46,98,47,100,48,102, + 49,104,50,106,51,108,52,110,53,112,54,114,55,116,56,118,57,120,58,122,59, + 124,60,126,61,128,62,130,63,132,64,134,65,136,66,138,0,140,0,142,0,144, + 0,146,67,148,68,150,69,152,70,154,71,156,72,158,73,160,74,162,75,164,76, + 166,77,168,78,170,79,172,80,174,81,176,82,178,83,180,84,182,85,184,86,186, + 87,188,88,190,89,192,90,194,91,196,92,198,93,200,94,202,0,204,95,206,96, + 208,97,210,98,212,99,214,100,216,101,2,0,1,8,1,0,48,57,2,0,65,90,97,122, + 1,0,32,32,1,0,115,115,3,0,48,57,65,90,97,122,2,0,69,69,101,101,2,0,43,43, + 45,45,3,0,9,10,13,13,32,32,1194,0,2,1,0,0,0,0,4,1,0,0,0,0,6,1,0,0,0,0,8, + 1,0,0,0,0,10,1,0,0,0,0,12,1,0,0,0,0,14,1,0,0,0,0,16,1,0,0,0,0,18,1,0,0, + 0,0,20,1,0,0,0,0,26,1,0,0,0,0,28,1,0,0,0,0,30,1,0,0,0,0,32,1,0,0,0,0,34, + 1,0,0,0,0,36,1,0,0,0,0,38,1,0,0,0,0,40,1,0,0,0,0,42,1,0,0,0,0,44,1,0,0, + 0,0,46,1,0,0,0,0,48,1,0,0,0,0,50,1,0,0,0,0,52,1,0,0,0,0,54,1,0,0,0,0,56, + 1,0,0,0,0,58,1,0,0,0,0,60,1,0,0,0,0,62,1,0,0,0,0,64,1,0,0,0,0,66,1,0,0, + 0,0,68,1,0,0,0,0,70,1,0,0,0,0,72,1,0,0,0,0,74,1,0,0,0,0,76,1,0,0,0,0,78, + 1,0,0,0,0,80,1,0,0,0,0,82,1,0,0,0,0,84,1,0,0,0,0,86,1,0,0,0,0,88,1,0,0, + 0,0,90,1,0,0,0,0,92,1,0,0,0,0,94,1,0,0,0,0,96,1,0,0,0,0,98,1,0,0,0,0,100, + 1,0,0,0,0,102,1,0,0,0,0,104,1,0,0,0,0,106,1,0,0,0,0,108,1,0,0,0,0,110,1, + 0,0,0,0,112,1,0,0,0,0,114,1,0,0,0,0,116,1,0,0,0,0,118,1,0,0,0,0,120,1,0, + 0,0,0,122,1,0,0,0,0,124,1,0,0,0,0,126,1,0,0,0,0,128,1,0,0,0,0,130,1,0,0, + 0,0,132,1,0,0,0,0,134,1,0,0,0,0,136,1,0,0,0,0,146,1,0,0,0,0,148,1,0,0,0, + 0,150,1,0,0,0,0,152,1,0,0,0,0,154,1,0,0,0,0,156,1,0,0,0,0,158,1,0,0,0,0, + 160,1,0,0,0,0,162,1,0,0,0,0,164,1,0,0,0,0,166,1,0,0,0,0,168,1,0,0,0,1,170, + 1,0,0,0,1,172,1,0,0,0,1,174,1,0,0,0,1,176,1,0,0,0,1,178,1,0,0,0,1,180,1, + 0,0,0,1,182,1,0,0,0,1,184,1,0,0,0,1,186,1,0,0,0,1,188,1,0,0,0,1,190,1,0, + 0,0,1,192,1,0,0,0,1,194,1,0,0,0,1,196,1,0,0,0,1,198,1,0,0,0,1,200,1,0,0, + 0,1,204,1,0,0,0,1,206,1,0,0,0,1,208,1,0,0,0,1,210,1,0,0,0,1,212,1,0,0,0, + 1,214,1,0,0,0,1,216,1,0,0,0,2,218,1,0,0,0,4,222,1,0,0,0,6,232,1,0,0,0,8, + 234,1,0,0,0,10,236,1,0,0,0,12,238,1,0,0,0,14,240,1,0,0,0,16,242,1,0,0,0, + 18,251,1,0,0,0,20,253,1,0,0,0,22,255,1,0,0,0,24,258,1,0,0,0,26,261,1,0, + 0,0,28,263,1,0,0,0,30,267,1,0,0,0,32,274,1,0,0,0,34,279,1,0,0,0,36,292, + 1,0,0,0,38,305,1,0,0,0,40,318,1,0,0,0,42,331,1,0,0,0,44,339,1,0,0,0,46, + 345,1,0,0,0,48,360,1,0,0,0,50,366,1,0,0,0,52,373,1,0,0,0,54,379,1,0,0,0, + 56,393,1,0,0,0,58,398,1,0,0,0,60,406,1,0,0,0,62,419,1,0,0,0,64,433,1,0, + 0,0,66,435,1,0,0,0,68,453,1,0,0,0,70,457,1,0,0,0,72,461,1,0,0,0,74,465, + 1,0,0,0,76,469,1,0,0,0,78,473,1,0,0,0,80,477,1,0,0,0,82,484,1,0,0,0,84, + 491,1,0,0,0,86,498,1,0,0,0,88,503,1,0,0,0,90,508,1,0,0,0,92,513,1,0,0,0, + 94,518,1,0,0,0,96,521,1,0,0,0,98,525,1,0,0,0,100,538,1,0,0,0,102,551,1, + 0,0,0,104,564,1,0,0,0,106,581,1,0,0,0,108,592,1,0,0,0,110,604,1,0,0,0,112, + 609,1,0,0,0,114,611,1,0,0,0,116,613,1,0,0,0,118,615,1,0,0,0,120,617,1,0, + 0,0,122,619,1,0,0,0,124,621,1,0,0,0,126,625,1,0,0,0,128,629,1,0,0,0,130, + 631,1,0,0,0,132,633,1,0,0,0,134,636,1,0,0,0,136,671,1,0,0,0,138,673,1,0, + 0,0,140,675,1,0,0,0,142,725,1,0,0,0,144,727,1,0,0,0,146,869,1,0,0,0,148, + 885,1,0,0,0,150,899,1,0,0,0,152,901,1,0,0,0,154,929,1,0,0,0,156,931,1,0, + 0,0,158,937,1,0,0,0,160,943,1,0,0,0,162,949,1,0,0,0,164,954,1,0,0,0,166, + 959,1,0,0,0,168,963,1,0,0,0,170,965,1,0,0,0,172,969,1,0,0,0,174,979,1,0, + 0,0,176,985,1,0,0,0,178,1000,1,0,0,0,180,1006,1,0,0,0,182,1013,1,0,0,0, + 184,1019,1,0,0,0,186,1021,1,0,0,0,188,1023,1,0,0,0,190,1030,1,0,0,0,192, + 1032,1,0,0,0,194,1034,1,0,0,0,196,1036,1,0,0,0,198,1038,1,0,0,0,200,1072, + 1,0,0,0,202,1074,1,0,0,0,204,1076,1,0,0,0,206,1084,1,0,0,0,208,1094,1,0, + 0,0,210,1100,1,0,0,0,212,1105,1,0,0,0,214,1110,1,0,0,0,216,1114,1,0,0,0, + 218,219,5,91,0,0,219,220,1,0,0,0,220,221,6,0,0,0,221,3,1,0,0,0,222,223, + 5,92,0,0,223,224,5,108,0,0,224,225,5,98,0,0,225,226,5,114,0,0,226,227,5, + 97,0,0,227,228,5,99,0,0,228,229,5,107,0,0,229,230,1,0,0,0,230,231,6,1,0, + 0,231,5,1,0,0,0,232,233,5,59,0,0,233,7,1,0,0,0,234,235,5,123,0,0,235,9, + 1,0,0,0,236,237,5,125,0,0,237,11,1,0,0,0,238,239,5,40,0,0,239,13,1,0,0, + 0,240,241,5,41,0,0,241,15,1,0,0,0,242,243,5,124,0,0,243,17,1,0,0,0,244, + 245,5,124,0,0,245,252,5,124,0,0,246,247,5,92,0,0,247,248,5,86,0,0,248,249, + 5,101,0,0,249,250,5,114,0,0,250,252,5,116,0,0,251,244,1,0,0,0,251,246,1, + 0,0,0,252,19,1,0,0,0,253,254,5,95,0,0,254,21,1,0,0,0,255,256,5,95,0,0,256, + 257,7,0,0,0,257,23,1,0,0,0,258,259,5,95,0,0,259,260,7,1,0,0,260,25,1,0, + 0,0,261,262,5,33,0,0,262,27,1,0,0,0,263,264,5,92,0,0,264,265,5,112,0,0, + 265,266,5,105,0,0,266,29,1,0,0,0,267,268,5,92,0,0,268,269,5,105,0,0,269, + 270,5,110,0,0,270,271,5,102,0,0,271,272,5,116,0,0,272,273,5,121,0,0,273, + 31,1,0,0,0,274,275,5,92,0,0,275,276,5,105,0,0,276,277,5,110,0,0,277,278, + 5,116,0,0,278,33,1,0,0,0,279,280,5,92,0,0,280,281,5,105,0,0,281,282,5,110, + 0,0,282,283,5,116,0,0,283,287,1,0,0,0,284,286,7,2,0,0,285,284,1,0,0,0,286, + 289,1,0,0,0,287,285,1,0,0,0,287,288,1,0,0,0,288,290,1,0,0,0,289,287,1,0, + 0,0,290,291,5,95,0,0,291,35,1,0,0,0,292,293,5,92,0,0,293,294,5,105,0,0, + 294,295,5,110,0,0,295,296,5,116,0,0,296,300,1,0,0,0,297,299,7,2,0,0,298, + 297,1,0,0,0,299,302,1,0,0,0,300,298,1,0,0,0,300,301,1,0,0,0,301,303,1,0, + 0,0,302,300,1,0,0,0,303,304,3,22,10,0,304,37,1,0,0,0,305,306,5,92,0,0,306, + 307,5,105,0,0,307,308,5,110,0,0,308,309,5,116,0,0,309,313,1,0,0,0,310,312, + 7,2,0,0,311,310,1,0,0,0,312,315,1,0,0,0,313,311,1,0,0,0,313,314,1,0,0,0, + 314,316,1,0,0,0,315,313,1,0,0,0,316,317,3,24,11,0,317,39,1,0,0,0,318,319, + 5,92,0,0,319,320,5,115,0,0,320,321,5,117,0,0,321,322,5,109,0,0,322,326, + 1,0,0,0,323,325,7,2,0,0,324,323,1,0,0,0,325,328,1,0,0,0,326,324,1,0,0,0, + 326,327,1,0,0,0,327,329,1,0,0,0,328,326,1,0,0,0,329,330,5,95,0,0,330,41, + 1,0,0,0,331,332,5,92,0,0,332,333,5,109,0,0,333,334,5,97,0,0,334,335,5,116, + 0,0,335,336,5,104,0,0,336,337,5,114,0,0,337,338,5,109,0,0,338,43,1,0,0, + 0,339,340,5,92,0,0,340,341,5,102,0,0,341,342,5,114,0,0,342,343,5,97,0,0, + 343,344,5,99,0,0,344,45,1,0,0,0,345,346,5,92,0,0,346,347,5,102,0,0,347, + 348,5,114,0,0,348,349,5,97,0,0,349,350,5,99,0,0,350,354,1,0,0,0,351,353, + 7,2,0,0,352,351,1,0,0,0,353,356,1,0,0,0,354,352,1,0,0,0,354,355,1,0,0,0, + 355,357,1,0,0,0,356,354,1,0,0,0,357,358,7,0,0,0,358,359,7,0,0,0,359,47, + 1,0,0,0,360,361,5,92,0,0,361,362,5,99,0,0,362,363,5,100,0,0,363,364,5,111, + 0,0,364,365,5,116,0,0,365,49,1,0,0,0,366,367,5,92,0,0,367,368,5,116,0,0, + 368,369,5,105,0,0,369,370,5,109,0,0,370,371,5,101,0,0,371,372,5,115,0,0, + 372,51,1,0,0,0,373,374,5,92,0,0,374,375,5,115,0,0,375,376,5,113,0,0,376, + 377,5,114,0,0,377,378,5,116,0,0,378,53,1,0,0,0,379,380,5,92,0,0,380,381, + 5,115,0,0,381,382,5,113,0,0,382,383,5,114,0,0,383,384,5,116,0,0,384,388, + 1,0,0,0,385,387,7,2,0,0,386,385,1,0,0,0,387,390,1,0,0,0,388,386,1,0,0,0, + 388,389,1,0,0,0,389,391,1,0,0,0,390,388,1,0,0,0,391,392,7,0,0,0,392,55, + 1,0,0,0,393,394,5,92,0,0,394,395,5,115,0,0,395,396,5,105,0,0,396,397,5, + 109,0,0,397,57,1,0,0,0,398,399,5,92,0,0,399,400,5,97,0,0,400,401,5,112, + 0,0,401,402,5,112,0,0,402,403,5,114,0,0,403,404,5,111,0,0,404,405,5,120, + 0,0,405,59,1,0,0,0,406,407,5,92,0,0,407,408,5,112,0,0,408,409,5,108,0,0, + 409,410,5,97,0,0,410,411,5,99,0,0,411,412,5,101,0,0,412,413,5,104,0,0,413, + 414,5,111,0,0,414,415,5,108,0,0,415,416,5,100,0,0,416,417,5,101,0,0,417, + 418,5,114,0,0,418,61,1,0,0,0,419,420,5,94,0,0,420,421,5,123,0,0,421,422, + 5,92,0,0,422,423,5,109,0,0,423,424,5,97,0,0,424,425,5,116,0,0,425,426,5, + 104,0,0,426,427,5,114,0,0,427,428,5,109,0,0,428,429,5,123,0,0,429,430,5, + 84,0,0,430,431,5,125,0,0,431,432,5,125,0,0,432,63,1,0,0,0,433,434,5,92, + 0,0,434,65,1,0,0,0,435,436,5,97,0,0,436,437,5,115,0,0,437,441,1,0,0,0,438, + 442,5,32,0,0,439,440,5,92,0,0,440,442,5,58,0,0,441,438,1,0,0,0,441,439, + 1,0,0,0,442,443,1,0,0,0,443,441,1,0,0,0,443,444,1,0,0,0,444,445,1,0,0,0, + 445,446,5,108,0,0,446,447,5,105,0,0,447,448,5,110,0,0,448,449,5,101,0,0, + 449,451,1,0,0,0,450,452,7,3,0,0,451,450,1,0,0,0,451,452,1,0,0,0,452,67, + 1,0,0,0,453,454,5,115,0,0,454,455,5,105,0,0,455,456,5,110,0,0,456,69,1, + 0,0,0,457,458,5,99,0,0,458,459,5,111,0,0,459,460,5,115,0,0,460,71,1,0,0, + 0,461,462,5,116,0,0,462,463,5,97,0,0,463,464,5,110,0,0,464,73,1,0,0,0,465, + 466,5,99,0,0,466,467,5,111,0,0,467,468,5,116,0,0,468,75,1,0,0,0,469,470, + 5,115,0,0,470,471,5,101,0,0,471,472,5,99,0,0,472,77,1,0,0,0,473,474,5,99, + 0,0,474,475,5,115,0,0,475,476,5,99,0,0,476,79,1,0,0,0,477,478,5,97,0,0, + 478,479,5,114,0,0,479,480,5,99,0,0,480,481,5,115,0,0,481,482,5,105,0,0, + 482,483,5,110,0,0,483,81,1,0,0,0,484,485,5,97,0,0,485,486,5,114,0,0,486, + 487,5,99,0,0,487,488,5,99,0,0,488,489,5,111,0,0,489,490,5,115,0,0,490,83, + 1,0,0,0,491,492,5,97,0,0,492,493,5,114,0,0,493,494,5,99,0,0,494,495,5,116, + 0,0,495,496,5,97,0,0,496,497,5,110,0,0,497,85,1,0,0,0,498,499,5,115,0,0, + 499,500,5,105,0,0,500,501,5,110,0,0,501,502,5,104,0,0,502,87,1,0,0,0,503, + 504,5,99,0,0,504,505,5,111,0,0,505,506,5,115,0,0,506,507,5,104,0,0,507, + 89,1,0,0,0,508,509,5,116,0,0,509,510,5,97,0,0,510,511,5,110,0,0,511,512, + 5,104,0,0,512,91,1,0,0,0,513,514,5,99,0,0,514,515,5,111,0,0,515,516,5,116, + 0,0,516,517,5,104,0,0,517,93,1,0,0,0,518,519,5,108,0,0,519,520,5,110,0, + 0,520,95,1,0,0,0,521,522,5,108,0,0,522,523,5,111,0,0,523,524,5,103,0,0, + 524,97,1,0,0,0,525,526,5,92,0,0,526,527,5,108,0,0,527,528,5,111,0,0,528, + 529,5,103,0,0,529,533,1,0,0,0,530,532,7,2,0,0,531,530,1,0,0,0,532,535,1, + 0,0,0,533,531,1,0,0,0,533,534,1,0,0,0,534,536,1,0,0,0,535,533,1,0,0,0,536, + 537,5,95,0,0,537,99,1,0,0,0,538,539,5,92,0,0,539,540,5,108,0,0,540,541, + 5,111,0,0,541,542,5,103,0,0,542,546,1,0,0,0,543,545,7,2,0,0,544,543,1,0, + 0,0,545,548,1,0,0,0,546,544,1,0,0,0,546,547,1,0,0,0,547,549,1,0,0,0,548, + 546,1,0,0,0,549,550,3,22,10,0,550,101,1,0,0,0,551,552,5,92,0,0,552,553, + 5,108,0,0,553,554,5,111,0,0,554,555,5,103,0,0,555,559,1,0,0,0,556,558,7, + 2,0,0,557,556,1,0,0,0,558,561,1,0,0,0,559,557,1,0,0,0,559,560,1,0,0,0,560, + 562,1,0,0,0,561,559,1,0,0,0,562,563,3,24,11,0,563,103,1,0,0,0,564,565,5, + 92,0,0,565,566,5,116,0,0,566,567,5,101,0,0,567,568,5,120,0,0,568,569,5, + 116,0,0,569,570,5,123,0,0,570,574,1,0,0,0,571,573,9,0,0,0,572,571,1,0,0, + 0,573,576,1,0,0,0,574,575,1,0,0,0,574,572,1,0,0,0,575,577,1,0,0,0,576,574, + 1,0,0,0,577,578,5,125,0,0,578,579,1,0,0,0,579,580,6,51,1,0,580,105,1,0, + 0,0,581,582,5,92,0,0,582,583,5,108,0,0,583,584,5,101,0,0,584,585,5,102, + 0,0,585,586,5,116,0,0,586,588,1,0,0,0,587,589,5,46,0,0,588,587,1,0,0,0, + 588,589,1,0,0,0,589,590,1,0,0,0,590,591,6,52,1,0,591,107,1,0,0,0,592,593, + 5,92,0,0,593,594,5,114,0,0,594,595,5,105,0,0,595,596,5,103,0,0,596,597, + 5,104,0,0,597,598,5,116,0,0,598,600,1,0,0,0,599,601,5,46,0,0,600,599,1, + 0,0,0,600,601,1,0,0,0,601,602,1,0,0,0,602,603,6,53,1,0,603,109,1,0,0,0, + 604,605,5,36,0,0,605,606,5,36,0,0,606,607,1,0,0,0,607,608,6,54,1,0,608, + 111,1,0,0,0,609,610,5,43,0,0,610,113,1,0,0,0,611,612,5,45,0,0,612,115,1, + 0,0,0,613,614,5,94,0,0,614,117,1,0,0,0,615,616,5,61,0,0,616,119,1,0,0,0, + 617,618,5,60,0,0,618,121,1,0,0,0,619,620,5,62,0,0,620,123,1,0,0,0,621,622, + 5,92,0,0,622,623,5,108,0,0,623,624,5,101,0,0,624,125,1,0,0,0,625,626,5, + 92,0,0,626,627,5,103,0,0,627,628,5,101,0,0,628,127,1,0,0,0,629,630,5,44, + 0,0,630,129,1,0,0,0,631,632,5,46,0,0,632,131,1,0,0,0,633,634,5,94,0,0,634, + 635,7,0,0,0,635,133,1,0,0,0,636,637,5,94,0,0,637,638,7,1,0,0,638,135,1, + 0,0,0,639,641,3,138,68,0,640,639,1,0,0,0,641,642,1,0,0,0,642,640,1,0,0, + 0,642,643,1,0,0,0,643,644,1,0,0,0,644,648,5,46,0,0,645,647,3,138,68,0,646, + 645,1,0,0,0,647,650,1,0,0,0,648,646,1,0,0,0,648,649,1,0,0,0,649,652,1,0, + 0,0,650,648,1,0,0,0,651,653,3,142,70,0,652,651,1,0,0,0,652,653,1,0,0,0, + 653,672,1,0,0,0,654,656,5,46,0,0,655,657,3,138,68,0,656,655,1,0,0,0,657, + 658,1,0,0,0,658,656,1,0,0,0,658,659,1,0,0,0,659,661,1,0,0,0,660,662,3,142, + 70,0,661,660,1,0,0,0,661,662,1,0,0,0,662,672,1,0,0,0,663,665,3,138,68,0, + 664,663,1,0,0,0,665,666,1,0,0,0,666,664,1,0,0,0,666,667,1,0,0,0,667,669, + 1,0,0,0,668,670,3,142,70,0,669,668,1,0,0,0,669,670,1,0,0,0,670,672,1,0, + 0,0,671,640,1,0,0,0,671,654,1,0,0,0,671,664,1,0,0,0,672,137,1,0,0,0,673, + 674,7,0,0,0,674,139,1,0,0,0,675,679,7,1,0,0,676,678,7,4,0,0,677,676,1,0, + 0,0,678,681,1,0,0,0,679,677,1,0,0,0,679,680,1,0,0,0,680,141,1,0,0,0,681, + 679,1,0,0,0,682,684,7,5,0,0,683,685,7,6,0,0,684,683,1,0,0,0,684,685,1,0, + 0,0,685,687,1,0,0,0,686,688,3,138,68,0,687,686,1,0,0,0,688,689,1,0,0,0, + 689,687,1,0,0,0,689,690,1,0,0,0,690,726,1,0,0,0,691,693,5,32,0,0,692,691, + 1,0,0,0,693,696,1,0,0,0,694,692,1,0,0,0,694,695,1,0,0,0,695,699,1,0,0,0, + 696,694,1,0,0,0,697,700,3,48,23,0,698,700,3,50,24,0,699,697,1,0,0,0,699, + 698,1,0,0,0,700,704,1,0,0,0,701,703,5,32,0,0,702,701,1,0,0,0,703,706,1, + 0,0,0,704,702,1,0,0,0,704,705,1,0,0,0,705,707,1,0,0,0,706,704,1,0,0,0,707, + 708,5,49,0,0,708,709,5,48,0,0,709,710,1,0,0,0,710,723,3,116,57,0,711,724, + 3,138,68,0,712,714,3,8,3,0,713,715,7,6,0,0,714,713,1,0,0,0,714,715,1,0, + 0,0,715,717,1,0,0,0,716,718,3,138,68,0,717,716,1,0,0,0,718,719,1,0,0,0, + 719,717,1,0,0,0,719,720,1,0,0,0,720,721,1,0,0,0,721,722,3,10,4,0,722,724, + 1,0,0,0,723,711,1,0,0,0,723,712,1,0,0,0,724,726,1,0,0,0,725,682,1,0,0,0, + 725,694,1,0,0,0,726,143,1,0,0,0,727,867,5,92,0,0,728,729,5,97,0,0,729,730, + 5,108,0,0,730,731,5,112,0,0,731,732,5,104,0,0,732,868,5,97,0,0,733,734, + 5,98,0,0,734,735,5,101,0,0,735,736,5,116,0,0,736,868,5,97,0,0,737,738,5, + 103,0,0,738,739,5,97,0,0,739,740,5,109,0,0,740,741,5,109,0,0,741,868,5, + 97,0,0,742,743,5,100,0,0,743,744,5,101,0,0,744,745,5,108,0,0,745,746,5, + 116,0,0,746,868,5,97,0,0,747,748,5,101,0,0,748,749,5,112,0,0,749,750,5, + 115,0,0,750,751,5,105,0,0,751,752,5,108,0,0,752,753,5,111,0,0,753,868,5, + 110,0,0,754,755,5,122,0,0,755,756,5,101,0,0,756,757,5,116,0,0,757,868,5, + 97,0,0,758,759,5,101,0,0,759,760,5,116,0,0,760,868,5,97,0,0,761,762,5,116, + 0,0,762,763,5,104,0,0,763,764,5,101,0,0,764,765,5,116,0,0,765,868,5,97, + 0,0,766,767,5,105,0,0,767,768,5,111,0,0,768,769,5,116,0,0,769,868,5,97, + 0,0,770,771,5,107,0,0,771,772,5,97,0,0,772,773,5,112,0,0,773,774,5,112, + 0,0,774,868,5,97,0,0,775,776,5,108,0,0,776,777,5,97,0,0,777,778,5,109,0, + 0,778,779,5,98,0,0,779,780,5,100,0,0,780,868,5,97,0,0,781,782,5,109,0,0, + 782,868,5,117,0,0,783,784,5,110,0,0,784,868,5,117,0,0,785,786,5,120,0,0, + 786,868,5,105,0,0,787,788,5,114,0,0,788,789,5,104,0,0,789,868,5,111,0,0, + 790,791,5,115,0,0,791,792,5,105,0,0,792,793,5,103,0,0,793,794,5,109,0,0, + 794,868,5,97,0,0,795,796,5,116,0,0,796,797,5,97,0,0,797,868,5,117,0,0,798, + 799,5,117,0,0,799,800,5,112,0,0,800,801,5,115,0,0,801,802,5,105,0,0,802, + 803,5,108,0,0,803,804,5,111,0,0,804,868,5,110,0,0,805,806,5,112,0,0,806, + 807,5,104,0,0,807,868,5,105,0,0,808,809,5,99,0,0,809,810,5,104,0,0,810, + 868,5,105,0,0,811,812,5,112,0,0,812,813,5,115,0,0,813,868,5,105,0,0,814, + 815,5,111,0,0,815,816,5,109,0,0,816,817,5,101,0,0,817,818,5,103,0,0,818, + 868,5,97,0,0,819,820,5,71,0,0,820,821,5,97,0,0,821,822,5,109,0,0,822,823, + 5,109,0,0,823,868,5,97,0,0,824,825,5,68,0,0,825,826,5,101,0,0,826,827,5, + 108,0,0,827,828,5,116,0,0,828,868,5,97,0,0,829,830,5,84,0,0,830,831,5,104, + 0,0,831,832,5,101,0,0,832,833,5,116,0,0,833,868,5,97,0,0,834,835,5,76,0, + 0,835,836,5,97,0,0,836,837,5,109,0,0,837,838,5,98,0,0,838,839,5,100,0,0, + 839,868,5,97,0,0,840,841,5,88,0,0,841,868,5,105,0,0,842,843,5,80,0,0,843, + 868,5,105,0,0,844,845,5,83,0,0,845,846,5,105,0,0,846,847,5,103,0,0,847, + 848,5,109,0,0,848,868,5,97,0,0,849,850,5,85,0,0,850,851,5,112,0,0,851,852, + 5,115,0,0,852,853,5,105,0,0,853,854,5,108,0,0,854,855,5,111,0,0,855,868, + 5,110,0,0,856,857,5,80,0,0,857,858,5,104,0,0,858,868,5,105,0,0,859,860, + 5,80,0,0,860,861,5,115,0,0,861,868,5,105,0,0,862,863,5,79,0,0,863,864,5, + 109,0,0,864,865,5,101,0,0,865,866,5,103,0,0,866,868,5,97,0,0,867,728,1, + 0,0,0,867,733,1,0,0,0,867,737,1,0,0,0,867,742,1,0,0,0,867,747,1,0,0,0,867, + 754,1,0,0,0,867,758,1,0,0,0,867,761,1,0,0,0,867,766,1,0,0,0,867,770,1,0, + 0,0,867,775,1,0,0,0,867,781,1,0,0,0,867,783,1,0,0,0,867,785,1,0,0,0,867, + 787,1,0,0,0,867,790,1,0,0,0,867,795,1,0,0,0,867,798,1,0,0,0,867,805,1,0, + 0,0,867,808,1,0,0,0,867,811,1,0,0,0,867,814,1,0,0,0,867,819,1,0,0,0,867, + 824,1,0,0,0,867,829,1,0,0,0,867,834,1,0,0,0,867,840,1,0,0,0,867,842,1,0, + 0,0,867,844,1,0,0,0,867,849,1,0,0,0,867,856,1,0,0,0,867,859,1,0,0,0,867, + 862,1,0,0,0,868,145,1,0,0,0,869,870,5,92,0,0,870,871,5,98,0,0,871,872,5, + 101,0,0,872,873,5,103,0,0,873,874,5,105,0,0,874,875,5,110,0,0,875,876,5, + 123,0,0,876,877,5,98,0,0,877,878,5,109,0,0,878,879,5,97,0,0,879,880,5,116, + 0,0,880,881,5,114,0,0,881,882,5,105,0,0,882,883,5,120,0,0,883,884,5,125, + 0,0,884,147,1,0,0,0,885,886,5,92,0,0,886,887,5,101,0,0,887,888,5,110,0, + 0,888,889,5,100,0,0,889,890,5,123,0,0,890,891,5,98,0,0,891,892,5,109,0, + 0,892,893,5,97,0,0,893,894,5,116,0,0,894,895,5,114,0,0,895,896,5,105,0, + 0,896,897,5,120,0,0,897,898,5,125,0,0,898,149,1,0,0,0,899,900,5,38,0,0, + 900,151,1,0,0,0,901,902,5,92,0,0,902,903,5,92,0,0,903,153,1,0,0,0,904,906, + 7,2,0,0,905,904,1,0,0,0,906,909,1,0,0,0,907,905,1,0,0,0,907,908,1,0,0,0, + 908,910,1,0,0,0,909,907,1,0,0,0,910,911,5,95,0,0,911,912,5,123,0,0,912, + 914,1,0,0,0,913,915,7,4,0,0,914,913,1,0,0,0,915,916,1,0,0,0,916,914,1,0, + 0,0,916,917,1,0,0,0,917,918,1,0,0,0,918,930,5,125,0,0,919,921,7,2,0,0,920, + 919,1,0,0,0,921,924,1,0,0,0,922,920,1,0,0,0,922,923,1,0,0,0,923,927,1,0, + 0,0,924,922,1,0,0,0,925,928,3,24,11,0,926,928,3,22,10,0,927,925,1,0,0,0, + 927,926,1,0,0,0,928,930,1,0,0,0,929,907,1,0,0,0,929,922,1,0,0,0,930,155, + 1,0,0,0,931,932,5,94,0,0,932,933,7,1,0,0,933,934,3,154,76,0,934,157,1,0, + 0,0,935,938,3,140,69,0,936,938,3,144,71,0,937,935,1,0,0,0,937,936,1,0,0, + 0,938,940,1,0,0,0,939,941,3,154,76,0,940,939,1,0,0,0,940,941,1,0,0,0,941, + 159,1,0,0,0,942,944,7,7,0,0,943,942,1,0,0,0,944,945,1,0,0,0,945,943,1,0, + 0,0,945,946,1,0,0,0,946,947,1,0,0,0,947,948,6,79,1,0,948,161,1,0,0,0,949, + 950,5,92,0,0,950,951,5,32,0,0,951,952,1,0,0,0,952,953,6,80,1,0,953,163, + 1,0,0,0,954,955,5,92,0,0,955,956,5,58,0,0,956,957,1,0,0,0,957,958,6,81, + 1,0,958,165,1,0,0,0,959,960,5,160,0,0,960,961,1,0,0,0,961,962,6,82,1,0, + 962,167,1,0,0,0,963,964,9,0,0,0,964,169,1,0,0,0,965,966,5,93,0,0,966,967, + 1,0,0,0,967,968,6,84,2,0,968,171,1,0,0,0,969,970,5,92,0,0,970,971,5,114, + 0,0,971,972,5,98,0,0,972,973,5,114,0,0,973,974,5,97,0,0,974,975,5,99,0, + 0,975,976,5,107,0,0,976,977,1,0,0,0,977,978,6,85,2,0,978,173,1,0,0,0,979, + 980,5,92,0,0,980,981,5,102,0,0,981,982,5,114,0,0,982,983,5,97,0,0,983,984, + 5,99,0,0,984,175,1,0,0,0,985,986,5,92,0,0,986,987,5,102,0,0,987,988,5,114, + 0,0,988,989,5,97,0,0,989,990,5,99,0,0,990,994,1,0,0,0,991,993,7,2,0,0,992, + 991,1,0,0,0,993,996,1,0,0,0,994,992,1,0,0,0,994,995,1,0,0,0,995,997,1,0, + 0,0,996,994,1,0,0,0,997,998,7,0,0,0,998,999,7,0,0,0,999,177,1,0,0,0,1000, + 1001,5,92,0,0,1001,1002,5,99,0,0,1002,1003,5,100,0,0,1003,1004,5,111,0, + 0,1004,1005,5,116,0,0,1005,179,1,0,0,0,1006,1007,5,92,0,0,1007,1008,5,116, + 0,0,1008,1009,5,105,0,0,1009,1010,5,109,0,0,1010,1011,5,101,0,0,1011,1012, + 5,115,0,0,1012,181,1,0,0,0,1013,1014,5,92,0,0,1014,1015,5,115,0,0,1015, + 1016,5,113,0,0,1016,1017,5,114,0,0,1017,1018,5,116,0,0,1018,183,1,0,0,0, + 1019,1020,5,44,0,0,1020,185,1,0,0,0,1021,1022,5,94,0,0,1022,187,1,0,0,0, + 1023,1027,7,1,0,0,1024,1026,7,4,0,0,1025,1024,1,0,0,0,1026,1029,1,0,0,0, + 1027,1025,1,0,0,0,1027,1028,1,0,0,0,1028,189,1,0,0,0,1029,1027,1,0,0,0, + 1030,1031,5,40,0,0,1031,191,1,0,0,0,1032,1033,5,41,0,0,1033,193,1,0,0,0, + 1034,1035,5,123,0,0,1035,195,1,0,0,0,1036,1037,5,125,0,0,1037,197,1,0,0, + 0,1038,1039,5,49,0,0,1039,199,1,0,0,0,1040,1042,5,45,0,0,1041,1040,1,0, + 0,0,1041,1042,1,0,0,0,1042,1044,1,0,0,0,1043,1045,3,202,100,0,1044,1043, + 1,0,0,0,1045,1046,1,0,0,0,1046,1044,1,0,0,0,1046,1047,1,0,0,0,1047,1048, + 1,0,0,0,1048,1052,5,46,0,0,1049,1051,3,202,100,0,1050,1049,1,0,0,0,1051, + 1054,1,0,0,0,1052,1050,1,0,0,0,1052,1053,1,0,0,0,1053,1073,1,0,0,0,1054, + 1052,1,0,0,0,1055,1057,5,45,0,0,1056,1055,1,0,0,0,1056,1057,1,0,0,0,1057, + 1058,1,0,0,0,1058,1060,5,46,0,0,1059,1061,3,202,100,0,1060,1059,1,0,0,0, + 1061,1062,1,0,0,0,1062,1060,1,0,0,0,1062,1063,1,0,0,0,1063,1073,1,0,0,0, + 1064,1066,5,45,0,0,1065,1064,1,0,0,0,1065,1066,1,0,0,0,1066,1068,1,0,0, + 0,1067,1069,3,202,100,0,1068,1067,1,0,0,0,1069,1070,1,0,0,0,1070,1068,1, + 0,0,0,1070,1071,1,0,0,0,1071,1073,1,0,0,0,1072,1041,1,0,0,0,1072,1056,1, + 0,0,0,1072,1065,1,0,0,0,1073,201,1,0,0,0,1074,1075,7,0,0,0,1075,203,1,0, + 0,0,1076,1077,5,92,0,0,1077,1078,5,108,0,0,1078,1079,5,101,0,0,1079,1080, + 5,102,0,0,1080,1081,5,116,0,0,1081,1082,1,0,0,0,1082,1083,6,101,1,0,1083, + 205,1,0,0,0,1084,1085,5,92,0,0,1085,1086,5,114,0,0,1086,1087,5,105,0,0, + 1087,1088,5,103,0,0,1088,1089,5,104,0,0,1089,1090,5,116,0,0,1090,1091,1, + 0,0,0,1091,1092,6,102,1,0,1092,207,1,0,0,0,1093,1095,7,7,0,0,1094,1093, + 1,0,0,0,1095,1096,1,0,0,0,1096,1094,1,0,0,0,1096,1097,1,0,0,0,1097,1098, + 1,0,0,0,1098,1099,6,103,1,0,1099,209,1,0,0,0,1100,1101,5,92,0,0,1101,1102, + 5,32,0,0,1102,1103,1,0,0,0,1103,1104,6,104,1,0,1104,211,1,0,0,0,1105,1106, + 5,92,0,0,1106,1107,5,58,0,0,1107,1108,1,0,0,0,1108,1109,6,105,1,0,1109, + 213,1,0,0,0,1110,1111,5,160,0,0,1111,1112,1,0,0,0,1112,1113,6,106,1,0,1113, + 215,1,0,0,0,1114,1115,9,0,0,0,1115,217,1,0,0,0,56,0,1,251,287,300,313,326, + 354,388,441,443,451,533,546,559,574,588,600,642,648,652,658,661,666,669, + 671,679,684,689,694,699,704,714,719,723,725,867,907,916,922,927,929,937, + 940,945,994,1027,1041,1046,1052,1056,1062,1065,1070,1072,1096,3,2,1,0,6, + 0,0,2,0,0]; private static __ATN: ATN; public static get _ATN(): ATN { diff --git a/src/parser/LatexParser.g4 b/src/parser/LatexParser.g4 index 2a5c6fb8..912ccdc7 100644 --- a/src/parser/LatexParser.g4 +++ b/src/parser/LatexParser.g4 @@ -47,6 +47,10 @@ integral_cmd: ((CMD_INT_UNDERSCORE L_BRACE lower_lim_expr=expr R_BRACE) | L_PAREN integrand_expr=expr R_PAREN (CMD_MATHRM L_BRACE id R_BRACE | id) L_PAREN id R_PAREN ; +summation_cmd: (CMD_SUM_UNDERSCORE L_BRACE id EQ start_expr=expr R_BRACE) + ((CARET L_BRACE end_expr=expr R_BRACE) | (CARET_SINGLE_CHAR_ID | CARET_SINGLE_CHAR_NUMBER)) + L_PAREN operand_expr=expr R_PAREN ; + derivative_cmd: CMD_FRAC L_BRACE (MATHRM_0=CMD_MATHRM L_BRACE id R_BRACE | id) R_BRACE L_BRACE (MATHRM_1=CMD_MATHRM L_BRACE id R_BRACE | id) L_PAREN id R_PAREN R_BRACE L_PAREN expr R_PAREN; @@ -90,6 +94,7 @@ expr: id CARET_SINGLE_CHAR_ID_UNDERSCORE_SUBSCRIPT #exp | integral_cmd #integral | derivative_cmd #derivative | n_derivative_cmd #nDerivative + | summation_cmd #summation | BACKSLASH? CMD_LN L_PAREN expr R_PAREN #ln | BACKSLASH? CMD_LOG L_PAREN expr R_PAREN #log | CMD_SLASH_LOG_UNDERSCORE L_BRACE expr R_BRACE L_PAREN expr R_PAREN #baseLog @@ -109,6 +114,7 @@ expr: id CARET_SINGLE_CHAR_ID_UNDERSCORE_SUBSCRIPT #exp | user_function #userFunction | builtin_function #builtinFunction | PI #piExpr + | INFINITY #infinityExpr | L_PAREN expr R_PAREN #subExpr | expr UNDERSCORE L_BRACE R_BRACE #emptySubscript | expr CARET L_BRACE R_BRACE #emptySuperscript diff --git a/src/parser/LatexParser.ts b/src/parser/LatexParser.ts index 91bccda2..878a993d 100644 --- a/src/parser/LatexParser.ts +++ b/src/parser/LatexParser.ts @@ -31,93 +31,95 @@ export default class LatexParser extends Parser { public static readonly UNDERSCORE = 10; public static readonly EXCLAMATION = 11; public static readonly PI = 12; - public static readonly CMD_INT = 13; - public static readonly CMD_INT_UNDERSCORE = 14; - public static readonly CMD_INT_UNDERSCORE_SINGLE_CHAR_NUMBER = 15; - public static readonly CMD_INT_UNDERSCORE_SINGLE_CHAR_ID = 16; - public static readonly CMD_MATHRM = 17; - public static readonly CMD_FRAC = 18; - public static readonly CMD_FRAC_INTS = 19; - public static readonly CMD_CDOT = 20; - public static readonly CMD_TIMES = 21; - public static readonly CMD_SQRT = 22; - public static readonly CMD_SQRT_INT = 23; - public static readonly CMD_SIM = 24; - public static readonly CMD_APPROX = 25; - public static readonly CMD_PLACEHOLDER = 26; - public static readonly TRANSPOSE = 27; - public static readonly BACKSLASH = 28; - public static readonly AS_LINES = 29; - public static readonly CMD_SIN = 30; - public static readonly CMD_COS = 31; - public static readonly CMD_TAN = 32; - public static readonly CMD_COT = 33; - public static readonly CMD_SEC = 34; - public static readonly CMD_CSC = 35; - public static readonly CMD_ARCSIN = 36; - public static readonly CMD_ARCCOS = 37; - public static readonly CMD_ARCTAN = 38; - public static readonly CMD_SINH = 39; - public static readonly CMD_COSH = 40; - public static readonly CMD_TANH = 41; - public static readonly CMD_COTH = 42; - public static readonly CMD_LN = 43; - public static readonly CMD_LOG = 44; - public static readonly CMD_SLASH_LOG_UNDERSCORE = 45; - public static readonly CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_NUMBER = 46; - public static readonly CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_ID = 47; - public static readonly COMMENT = 48; - public static readonly CMD_LEFT = 49; - public static readonly CMD_RIGHT = 50; - public static readonly DOUBLE_DOLLAR_SIGN = 51; - public static readonly ADD = 52; - public static readonly SUB = 53; - public static readonly CARET = 54; - public static readonly EQ = 55; - public static readonly LT = 56; - public static readonly GT = 57; - public static readonly LTE = 58; - public static readonly GTE = 59; - public static readonly COMMA = 60; - public static readonly DECIMAL_POINT = 61; - public static readonly CARET_SINGLE_CHAR_NUMBER = 62; - public static readonly CARET_SINGLE_CHAR_ID = 63; - public static readonly NUMBER = 64; - public static readonly BEGIN_MATRIX = 65; - public static readonly END_MATRIX = 66; - public static readonly AMPERSAND = 67; - public static readonly DOUBLE_BACKSLASH = 68; - public static readonly UNDERSCORE_SUBSCRIPT = 69; - public static readonly CARET_SINGLE_CHAR_ID_UNDERSCORE_SUBSCRIPT = 70; - public static readonly ID = 71; - public static readonly WS = 72; - public static readonly SLASH_SPACE = 73; - public static readonly SLASH_COLON = 74; - public static readonly NBSP = 75; - public static readonly ERROR_CHAR = 76; - public static readonly R_BRACKET = 77; - public static readonly ALT_R_BRACKET = 78; - public static readonly U_CMD_FRAC = 79; - public static readonly U_CMD_FRAC_INTS = 80; - public static readonly U_CMD_CDOT = 81; - public static readonly U_CMD_TIMES = 82; - public static readonly U_CMD_SQRT = 83; - public static readonly U_COMMA = 84; - public static readonly U_CARET = 85; - public static readonly U_NAME = 86; - public static readonly U_L_PAREN = 87; - public static readonly U_R_PAREN = 88; - public static readonly U_L_BRACE = 89; - public static readonly U_R_BRACE = 90; - public static readonly U_ONE = 91; - public static readonly U_NUMBER = 92; - public static readonly U_CMD_LEFT = 93; - public static readonly U_CMD_RIGHT = 94; - public static readonly U_WS = 95; - public static readonly U_SLASH_SPACE = 96; - public static readonly U_SLASH_COLON = 97; - public static readonly U_NBSP = 98; - public static readonly U_ERROR_CHAR = 99; + public static readonly INFINITY = 13; + public static readonly CMD_INT = 14; + public static readonly CMD_INT_UNDERSCORE = 15; + public static readonly CMD_INT_UNDERSCORE_SINGLE_CHAR_NUMBER = 16; + public static readonly CMD_INT_UNDERSCORE_SINGLE_CHAR_ID = 17; + public static readonly CMD_SUM_UNDERSCORE = 18; + public static readonly CMD_MATHRM = 19; + public static readonly CMD_FRAC = 20; + public static readonly CMD_FRAC_INTS = 21; + public static readonly CMD_CDOT = 22; + public static readonly CMD_TIMES = 23; + public static readonly CMD_SQRT = 24; + public static readonly CMD_SQRT_INT = 25; + public static readonly CMD_SIM = 26; + public static readonly CMD_APPROX = 27; + public static readonly CMD_PLACEHOLDER = 28; + public static readonly TRANSPOSE = 29; + public static readonly BACKSLASH = 30; + public static readonly AS_LINES = 31; + public static readonly CMD_SIN = 32; + public static readonly CMD_COS = 33; + public static readonly CMD_TAN = 34; + public static readonly CMD_COT = 35; + public static readonly CMD_SEC = 36; + public static readonly CMD_CSC = 37; + public static readonly CMD_ARCSIN = 38; + public static readonly CMD_ARCCOS = 39; + public static readonly CMD_ARCTAN = 40; + public static readonly CMD_SINH = 41; + public static readonly CMD_COSH = 42; + public static readonly CMD_TANH = 43; + public static readonly CMD_COTH = 44; + public static readonly CMD_LN = 45; + public static readonly CMD_LOG = 46; + public static readonly CMD_SLASH_LOG_UNDERSCORE = 47; + public static readonly CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_NUMBER = 48; + public static readonly CMD_SLASH_LOG_UNDERSCORE_SINGLE_CHAR_ID = 49; + public static readonly COMMENT = 50; + public static readonly CMD_LEFT = 51; + public static readonly CMD_RIGHT = 52; + public static readonly DOUBLE_DOLLAR_SIGN = 53; + public static readonly ADD = 54; + public static readonly SUB = 55; + public static readonly CARET = 56; + public static readonly EQ = 57; + public static readonly LT = 58; + public static readonly GT = 59; + public static readonly LTE = 60; + public static readonly GTE = 61; + public static readonly COMMA = 62; + public static readonly DECIMAL_POINT = 63; + public static readonly CARET_SINGLE_CHAR_NUMBER = 64; + public static readonly CARET_SINGLE_CHAR_ID = 65; + public static readonly NUMBER = 66; + public static readonly BEGIN_MATRIX = 67; + public static readonly END_MATRIX = 68; + public static readonly AMPERSAND = 69; + public static readonly DOUBLE_BACKSLASH = 70; + public static readonly UNDERSCORE_SUBSCRIPT = 71; + public static readonly CARET_SINGLE_CHAR_ID_UNDERSCORE_SUBSCRIPT = 72; + public static readonly ID = 73; + public static readonly WS = 74; + public static readonly SLASH_SPACE = 75; + public static readonly SLASH_COLON = 76; + public static readonly NBSP = 77; + public static readonly ERROR_CHAR = 78; + public static readonly R_BRACKET = 79; + public static readonly ALT_R_BRACKET = 80; + public static readonly U_CMD_FRAC = 81; + public static readonly U_CMD_FRAC_INTS = 82; + public static readonly U_CMD_CDOT = 83; + public static readonly U_CMD_TIMES = 84; + public static readonly U_CMD_SQRT = 85; + public static readonly U_COMMA = 86; + public static readonly U_CARET = 87; + public static readonly U_NAME = 88; + public static readonly U_L_PAREN = 89; + public static readonly U_R_PAREN = 90; + public static readonly U_L_BRACE = 91; + public static readonly U_R_BRACE = 92; + public static readonly U_ONE = 93; + public static readonly U_NUMBER = 94; + public static readonly U_CMD_LEFT = 95; + public static readonly U_CMD_RIGHT = 96; + public static readonly U_WS = 97; + public static readonly U_SLASH_SPACE = 98; + public static readonly U_SLASH_COLON = 99; + public static readonly U_NBSP = 100; + public static readonly U_ERROR_CHAR = 101; public static readonly EOF = Token.EOF; public static readonly RULE_statement = 0; public static readonly RULE_scatter_plot_query = 1; @@ -136,23 +138,24 @@ export default class LatexParser extends Parser { public static readonly RULE_trig_function = 14; public static readonly RULE_indefinite_integral_cmd = 15; public static readonly RULE_integral_cmd = 16; - public static readonly RULE_derivative_cmd = 17; - public static readonly RULE_n_derivative_cmd = 18; - public static readonly RULE_argument = 19; - public static readonly RULE_condition = 20; - public static readonly RULE_id_list = 21; - public static readonly RULE_guess = 22; - public static readonly RULE_guess_list = 23; - public static readonly RULE_condition_single = 24; - public static readonly RULE_condition_chain = 25; - public static readonly RULE_matrix_row = 26; - public static readonly RULE_user_function = 27; - public static readonly RULE_builtin_function = 28; - public static readonly RULE_expr = 29; - public static readonly RULE_u_block = 30; - public static readonly RULE_u_insert_matrix = 31; - public static readonly RULE_u_fraction = 32; - public static readonly RULE_u_expr = 33; + public static readonly RULE_summation_cmd = 17; + public static readonly RULE_derivative_cmd = 18; + public static readonly RULE_n_derivative_cmd = 19; + public static readonly RULE_argument = 20; + public static readonly RULE_condition = 21; + public static readonly RULE_id_list = 22; + public static readonly RULE_guess = 23; + public static readonly RULE_guess_list = 24; + public static readonly RULE_condition_single = 25; + public static readonly RULE_condition_chain = 26; + public static readonly RULE_matrix_row = 27; + public static readonly RULE_user_function = 28; + public static readonly RULE_builtin_function = 29; + public static readonly RULE_expr = 30; + public static readonly RULE_u_block = 31; + public static readonly RULE_u_insert_matrix = 32; + public static readonly RULE_u_fraction = 33; + public static readonly RULE_u_expr = 34; public static readonly literalNames: (string | null)[] = [ null, "'['", "'\\lbrack'", "';'", null, @@ -160,9 +163,10 @@ export default class LatexParser extends Parser { null, "'|'", null, "'_'", "'!'", "'\\pi'", + "'\\infty'", "'\\int'", null, null, null, - "'\\mathrm'", + null, "'\\mathrm'", null, null, null, null, null, null, @@ -216,10 +220,12 @@ export default class LatexParser extends Parser { "VBAR", "DOUBLE_VBAR", "UNDERSCORE", "EXCLAMATION", - "PI", "CMD_INT", + "PI", "INFINITY", + "CMD_INT", "CMD_INT_UNDERSCORE", "CMD_INT_UNDERSCORE_SINGLE_CHAR_NUMBER", "CMD_INT_UNDERSCORE_SINGLE_CHAR_ID", + "CMD_SUM_UNDERSCORE", "CMD_MATHRM", "CMD_FRAC", "CMD_FRAC_INTS", @@ -295,10 +301,11 @@ export default class LatexParser extends Parser { "statement", "scatter_plot_query", "parametric_plot_query", "insert_matrix", "id", "number", "number_with_units", "assign", "assign_list", "assign_plus_query", "query", "equality", "piecewise_assign", "piecewise_arg", "trig_function", - "indefinite_integral_cmd", "integral_cmd", "derivative_cmd", "n_derivative_cmd", - "argument", "condition", "id_list", "guess", "guess_list", "condition_single", - "condition_chain", "matrix_row", "user_function", "builtin_function", - "expr", "u_block", "u_insert_matrix", "u_fraction", "u_expr", + "indefinite_integral_cmd", "integral_cmd", "summation_cmd", "derivative_cmd", + "n_derivative_cmd", "argument", "condition", "id_list", "guess", "guess_list", + "condition_single", "condition_chain", "matrix_row", "user_function", + "builtin_function", "expr", "u_block", "u_insert_matrix", "u_fraction", + "u_expr", ]; public get grammarFileName(): string { return "LatexParser.g4"; } public get literalNames(): (string | null)[] { return LatexParser.literalNames; } @@ -321,113 +328,113 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 85; + this.state = 87; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 0, this._ctx) ) { case 1: { - this.state = 68; + this.state = 70; this.assign(); } break; case 2: { - this.state = 69; + this.state = 71; this.assign_list(); } break; case 3: { - this.state = 70; + this.state = 72; this.assign_plus_query(); } break; case 4: { - this.state = 71; + this.state = 73; this.query(); } break; case 5: { - this.state = 72; + this.state = 74; this.equality(); } break; case 6: { - this.state = 73; + this.state = 75; this.u_block(); } break; case 7: { - this.state = 74; + this.state = 76; this.number_(); } break; case 8: { - this.state = 75; + this.state = 77; this.id(); } break; case 9: { - this.state = 76; + this.state = 78; this.id_list(); } break; case 10: { - this.state = 77; + this.state = 79; this.guess(); } break; case 11: { - this.state = 78; + this.state = 80; this.guess_list(); } break; case 12: { - this.state = 79; + this.state = 81; this.expr(0); } break; case 13: { - this.state = 80; + this.state = 82; this.condition(); } break; case 14: { - this.state = 81; + this.state = 83; this.piecewise_assign(); } break; case 15: { - this.state = 82; + this.state = 84; this.insert_matrix(); } break; case 16: { - this.state = 83; + this.state = 85; this.scatter_plot_query(); } break; case 17: { - this.state = 84; + this.state = 86; this.parametric_plot_query(); } break; } - this.state = 87; + this.state = 89; this.match(LatexParser.EOF); } } @@ -453,21 +460,21 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 99; + this.state = 101; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 1, this._ctx) ) { case 1: { { - this.state = 89; - this.match(LatexParser.L_PAREN); - this.state = 90; - this.expr(0); this.state = 91; - this.match(LatexParser.COMMA); + this.match(LatexParser.L_PAREN); this.state = 92; this.expr(0); this.state = 93; + this.match(LatexParser.COMMA); + this.state = 94; + this.expr(0); + this.state = 95; this.match(LatexParser.R_PAREN); } } @@ -475,43 +482,43 @@ export default class LatexParser extends Parser { case 2: { { - this.state = 95; + this.state = 97; this.expr(0); - this.state = 96; + this.state = 98; this.match(LatexParser.COMMA); - this.state = 97; + this.state = 99; this.expr(0); } } break; } - this.state = 102; + this.state = 104; this._errHandler.sync(this); _la = this._input.LA(1); - if (_la===29) { + if (_la===31) { { - this.state = 101; + this.state = 103; this.match(LatexParser.AS_LINES); } } - this.state = 104; + this.state = 106; this.match(LatexParser.EQ); - this.state = 115; + this.state = 117; this._errHandler.sync(this); switch (this._input.LA(1)) { case 6: { { - this.state = 105; - this.match(LatexParser.L_PAREN); - this.state = 106; - this.u_block(); this.state = 107; - this.match(LatexParser.COMMA); + this.match(LatexParser.L_PAREN); this.state = 108; this.u_block(); this.state = 109; + this.match(LatexParser.COMMA); + this.state = 110; + this.u_block(); + this.state = 111; this.match(LatexParser.R_PAREN); } } @@ -520,11 +527,11 @@ export default class LatexParser extends Parser { case 2: { { - this.state = 111; + this.state = 113; this.u_block(); - this.state = 112; + this.state = 114; this.match(LatexParser.COMMA); - this.state = 113; + this.state = 115; this.u_block(); } } @@ -559,56 +566,56 @@ export default class LatexParser extends Parser { this.enterOuterAlt(localctx, 1); { { - this.state = 117; - this.match(LatexParser.L_PAREN); - this.state = 118; - this.expr(0); this.state = 119; - this.match(LatexParser.COMMA); + this.match(LatexParser.L_PAREN); this.state = 120; this.expr(0); this.state = 121; + this.match(LatexParser.COMMA); + this.state = 122; + this.expr(0); + this.state = 123; this.match(LatexParser.R_PAREN); } - this.state = 123; + this.state = 125; localctx._for_id = this.match(LatexParser.ID); - this.state = 124; + this.state = 126; this.match(LatexParser.L_PAREN); - this.state = 125; + this.state = 127; this.argument(); - this.state = 126; + this.state = 128; this.match(LatexParser.R_PAREN); - this.state = 131; + this.state = 133; this._errHandler.sync(this); _la = this._input.LA(1); - if (_la===71) { + if (_la===73) { { - this.state = 127; + this.state = 129; localctx._points_id_0 = this.match(LatexParser.ID); - this.state = 128; + this.state = 130; localctx._num_points = this.number_(); - this.state = 129; + this.state = 131; localctx._points_id_1 = this.match(LatexParser.ID); } } - this.state = 133; + this.state = 135; this.match(LatexParser.EQ); - this.state = 144; + this.state = 146; this._errHandler.sync(this); switch (this._input.LA(1)) { case 6: { { - this.state = 134; - this.match(LatexParser.L_PAREN); - this.state = 135; - this.u_block(); this.state = 136; - this.match(LatexParser.COMMA); + this.match(LatexParser.L_PAREN); this.state = 137; this.u_block(); this.state = 138; + this.match(LatexParser.COMMA); + this.state = 139; + this.u_block(); + this.state = 140; this.match(LatexParser.R_PAREN); } } @@ -617,11 +624,11 @@ export default class LatexParser extends Parser { case 2: { { - this.state = 140; + this.state = 142; this.u_block(); - this.state = 141; + this.state = 143; this.match(LatexParser.COMMA); - this.state = 142; + this.state = 144; this.u_block(); } } @@ -656,49 +663,49 @@ export default class LatexParser extends Parser { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 149; + this.state = 151; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 6, this._ctx); while (_alt !== 1 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1 + 1) { { { - this.state = 146; + this.state = 148; this.matchWildcard(); } } } - this.state = 151; + this.state = 153; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 6, this._ctx); } - this.state = 159; + this.state = 161; this._errHandler.sync(this); _la = this._input.LA(1); do { { { - this.state = 152; + this.state = 154; this.u_insert_matrix(); - this.state = 156; + this.state = 158; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 7, this._ctx); while (_alt !== 1 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1 + 1) { { { - this.state = 153; + this.state = 155; this.matchWildcard(); } } } - this.state = 158; + this.state = 160; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 7, this._ctx); } } } - this.state = 161; + this.state = 163; this._errHandler.sync(this); _la = this._input.LA(1); } while (_la===1 || _la===2); @@ -725,7 +732,7 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 163; + this.state = 165; this.match(LatexParser.ID); } } @@ -751,17 +758,17 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 166; + this.state = 168; this._errHandler.sync(this); _la = this._input.LA(1); - if (_la===53) { + if (_la===55) { { - this.state = 165; + this.state = 167; this.match(LatexParser.SUB); } } - this.state = 168; + this.state = 170; this.match(LatexParser.NUMBER); } } @@ -786,32 +793,32 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 173; + this.state = 175; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 53: - case 64: + case 55: + case 66: { - this.state = 170; + this.state = 172; this.number_(); } break; case 12: { - this.state = 171; + this.state = 173; this.match(LatexParser.PI); } break; - case 71: + case 73: { - this.state = 172; + this.state = 174; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 175; + this.state = 177; this.u_block(); } } @@ -836,27 +843,27 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 179; + this.state = 181; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 71: + case 73: { - this.state = 177; + this.state = 179; this.id(); } break; case 12: { - this.state = 178; + this.state = 180; this.match(LatexParser.PI); } break; default: throw new NoViableAltException(this); } - this.state = 181; + this.state = 183; this.match(LatexParser.EQ); - this.state = 182; + this.state = 184; this.expr(0); } } @@ -882,24 +889,24 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 184; + this.state = 186; this.assign(); - this.state = 187; + this.state = 189; this._errHandler.sync(this); _la = this._input.LA(1); do { { { - this.state = 185; + this.state = 187; this.match(LatexParser.COMMA); - this.state = 186; + this.state = 188; this.assign(); } } - this.state = 189; + this.state = 191; this._errHandler.sync(this); _la = this._input.LA(1); - } while (_la===60); + } while (_la===62); } } catch (re) { @@ -924,16 +931,16 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 191; + this.state = 193; this.assign(); - this.state = 192; - this.match(LatexParser.EQ); this.state = 194; + this.match(LatexParser.EQ); + this.state = 196; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===1 || _la===2) { { - this.state = 193; + this.state = 195; this.u_block(); } } @@ -962,16 +969,16 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 196; + this.state = 198; this.expr(0); - this.state = 197; - this.match(LatexParser.EQ); this.state = 199; + this.match(LatexParser.EQ); + this.state = 201; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===1 || _la===2) { { - this.state = 198; + this.state = 200; this.u_block(); } } @@ -999,11 +1006,11 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 201; + this.state = 203; this.expr(0); - this.state = 202; + this.state = 204; this.match(LatexParser.EQ); - this.state = 203; + this.state = 205; this.expr(0); } } @@ -1029,51 +1036,51 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 207; + this.state = 209; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 71: + case 73: { - this.state = 205; + this.state = 207; this.id(); } break; case 12: { - this.state = 206; + this.state = 208; this.match(LatexParser.PI); } break; default: throw new NoViableAltException(this); } - this.state = 209; + this.state = 211; this.match(LatexParser.EQ); - this.state = 210; + this.state = 212; this.id(); - this.state = 211; + this.state = 213; this.match(LatexParser.L_PAREN); { - this.state = 212; + this.state = 214; this.piecewise_arg(); - this.state = 217; + this.state = 219; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la===60) { + while (_la===62) { { { - this.state = 213; + this.state = 215; this.match(LatexParser.COMMA); - this.state = 214; + this.state = 216; this.piecewise_arg(); } } - this.state = 219; + this.state = 221; this._errHandler.sync(this); _la = this._input.LA(1); } } - this.state = 220; + this.state = 222; this.match(LatexParser.R_PAREN); } } @@ -1098,15 +1105,15 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 222; + this.state = 224; this.match(LatexParser.L_PAREN); - this.state = 223; + this.state = 225; this.expr(0); - this.state = 224; + this.state = 226; this.match(LatexParser.COMMA); - this.state = 225; + this.state = 227; this.condition(); - this.state = 226; + this.state = 228; this.match(LatexParser.R_PAREN); } } @@ -1132,30 +1139,30 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 229; + this.state = 231; this._errHandler.sync(this); _la = this._input.LA(1); - if (_la===28) { + if (_la===30) { { - this.state = 228; + this.state = 230; this.match(LatexParser.BACKSLASH); } } - this.state = 231; + this.state = 233; _la = this._input.LA(1); - if(!(((((_la - 30)) & ~0x1F) === 0 && ((1 << (_la - 30)) & 8191) !== 0))) { + if(!(((((_la - 32)) & ~0x1F) === 0 && ((1 << (_la - 32)) & 8191) !== 0))) { this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 232; + this.state = 234; this.match(LatexParser.L_PAREN); - this.state = 233; + this.state = 235; this.expr(0); - this.state = 234; + this.state = 236; this.match(LatexParser.R_PAREN); } } @@ -1180,29 +1187,29 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 243; + this.state = 245; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 13: + case 14: { - this.state = 236; + this.state = 238; this.match(LatexParser.CMD_INT); } break; - case 14: + case 15: { { - this.state = 237; + this.state = 239; this.match(LatexParser.CMD_INT_UNDERSCORE); - this.state = 238; + this.state = 240; this.match(LatexParser.L_BRACE); - this.state = 239; + this.state = 241; this.match(LatexParser.R_BRACE); - this.state = 240; + this.state = 242; this.match(LatexParser.CARET); - this.state = 241; + this.state = 243; this.match(LatexParser.L_BRACE); - this.state = 242; + this.state = 244; this.match(LatexParser.R_BRACE); } } @@ -1210,41 +1217,41 @@ export default class LatexParser extends Parser { default: throw new NoViableAltException(this); } - this.state = 245; + this.state = 247; this.match(LatexParser.L_PAREN); - this.state = 246; + this.state = 248; this.expr(0); - this.state = 247; + this.state = 249; this.match(LatexParser.R_PAREN); - this.state = 254; + this.state = 256; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 17: + case 19: { - this.state = 248; + this.state = 250; this.match(LatexParser.CMD_MATHRM); - this.state = 249; + this.state = 251; this.match(LatexParser.L_BRACE); - this.state = 250; + this.state = 252; this.id(); - this.state = 251; + this.state = 253; this.match(LatexParser.R_BRACE); } break; - case 71: + case 73: { - this.state = 253; + this.state = 255; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 256; + this.state = 258; this.match(LatexParser.L_PAREN); - this.state = 257; + this.state = 259; this.id(); - this.state = 258; + this.state = 260; this.match(LatexParser.R_PAREN); } } @@ -1270,29 +1277,29 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 266; + this.state = 268; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 14: + case 15: { { - this.state = 260; + this.state = 262; this.match(LatexParser.CMD_INT_UNDERSCORE); - this.state = 261; + this.state = 263; this.match(LatexParser.L_BRACE); - this.state = 262; + this.state = 264; localctx._lower_lim_expr = this.expr(0); - this.state = 263; + this.state = 265; this.match(LatexParser.R_BRACE); } } break; - case 15: case 16: + case 17: { - this.state = 265; + this.state = 267; _la = this._input.LA(1); - if(!(_la===15 || _la===16)) { + if(!(_la===16 || _la===17)) { this._errHandler.recoverInline(this); } else { @@ -1304,29 +1311,29 @@ export default class LatexParser extends Parser { default: throw new NoViableAltException(this); } - this.state = 274; + this.state = 276; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 54: + case 56: { { - this.state = 268; + this.state = 270; this.match(LatexParser.CARET); - this.state = 269; + this.state = 271; this.match(LatexParser.L_BRACE); - this.state = 270; + this.state = 272; localctx._upper_lim_expr = this.expr(0); - this.state = 271; + this.state = 273; this.match(LatexParser.R_BRACE); } } break; - case 62: - case 63: + case 64: + case 65: { - this.state = 273; + this.state = 275; _la = this._input.LA(1); - if(!(_la===62 || _la===63)) { + if(!(_la===64 || _la===65)) { this._errHandler.recoverInline(this); } else { @@ -1338,41 +1345,119 @@ export default class LatexParser extends Parser { default: throw new NoViableAltException(this); } - this.state = 276; + this.state = 278; this.match(LatexParser.L_PAREN); - this.state = 277; + this.state = 279; localctx._integrand_expr = this.expr(0); - this.state = 278; + this.state = 280; this.match(LatexParser.R_PAREN); - this.state = 285; + this.state = 287; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 17: + case 19: { - this.state = 279; + this.state = 281; this.match(LatexParser.CMD_MATHRM); - this.state = 280; + this.state = 282; this.match(LatexParser.L_BRACE); - this.state = 281; + this.state = 283; this.id(); - this.state = 282; + this.state = 284; this.match(LatexParser.R_BRACE); } break; - case 71: + case 73: { - this.state = 284; + this.state = 286; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 287; + this.state = 289; this.match(LatexParser.L_PAREN); - this.state = 288; + this.state = 290; this.id(); - this.state = 289; + this.state = 291; + this.match(LatexParser.R_PAREN); + } + } + 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 summation_cmd(): Summation_cmdContext { + let localctx: Summation_cmdContext = new Summation_cmdContext(this, this._ctx, this.state); + this.enterRule(localctx, 34, LatexParser.RULE_summation_cmd); + let _la: number; + try { + this.enterOuterAlt(localctx, 1); + { + { + this.state = 293; + this.match(LatexParser.CMD_SUM_UNDERSCORE); + this.state = 294; + this.match(LatexParser.L_BRACE); + this.state = 295; + this.id(); + this.state = 296; + this.match(LatexParser.EQ); + this.state = 297; + localctx._start_expr = this.expr(0); + this.state = 298; + this.match(LatexParser.R_BRACE); + } + this.state = 306; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case 56: + { + { + this.state = 300; + this.match(LatexParser.CARET); + this.state = 301; + this.match(LatexParser.L_BRACE); + this.state = 302; + localctx._end_expr = this.expr(0); + this.state = 303; + this.match(LatexParser.R_BRACE); + } + } + break; + case 64: + case 65: + { + this.state = 305; + _la = this._input.LA(1); + if(!(_la===64 || _la===65)) { + this._errHandler.recoverInline(this); + } + else { + this._errHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 308; + this.match(LatexParser.L_PAREN); + this.state = 309; + localctx._operand_expr = this.expr(0); + this.state = 310; this.match(LatexParser.R_PAREN); } } @@ -1393,79 +1478,79 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public derivative_cmd(): Derivative_cmdContext { let localctx: Derivative_cmdContext = new Derivative_cmdContext(this, this._ctx, this.state); - this.enterRule(localctx, 34, LatexParser.RULE_derivative_cmd); + this.enterRule(localctx, 36, LatexParser.RULE_derivative_cmd); try { this.enterOuterAlt(localctx, 1); { - this.state = 291; + this.state = 312; this.match(LatexParser.CMD_FRAC); - this.state = 292; + this.state = 313; this.match(LatexParser.L_BRACE); - this.state = 299; + this.state = 320; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 17: + case 19: { - this.state = 293; + this.state = 314; localctx._MATHRM_0 = this.match(LatexParser.CMD_MATHRM); - this.state = 294; + this.state = 315; this.match(LatexParser.L_BRACE); - this.state = 295; + this.state = 316; this.id(); - this.state = 296; + this.state = 317; this.match(LatexParser.R_BRACE); } break; - case 71: + case 73: { - this.state = 298; + this.state = 319; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 301; + this.state = 322; this.match(LatexParser.R_BRACE); - this.state = 302; + this.state = 323; this.match(LatexParser.L_BRACE); - this.state = 309; + this.state = 330; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 17: + case 19: { - this.state = 303; + this.state = 324; localctx._MATHRM_1 = this.match(LatexParser.CMD_MATHRM); - this.state = 304; + this.state = 325; this.match(LatexParser.L_BRACE); - this.state = 305; + this.state = 326; this.id(); - this.state = 306; + this.state = 327; this.match(LatexParser.R_BRACE); } break; - case 71: + case 73: { - this.state = 308; + this.state = 329; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 311; + this.state = 332; this.match(LatexParser.L_PAREN); - this.state = 312; + this.state = 333; this.id(); - this.state = 313; + this.state = 334; this.match(LatexParser.R_PAREN); - this.state = 314; + this.state = 335; this.match(LatexParser.R_BRACE); - this.state = 315; + this.state = 336; this.match(LatexParser.L_PAREN); - this.state = 316; + this.state = 337; this.expr(0); - this.state = 317; + this.state = 338; this.match(LatexParser.R_PAREN); } } @@ -1486,131 +1571,131 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public n_derivative_cmd(): N_derivative_cmdContext { let localctx: N_derivative_cmdContext = new N_derivative_cmdContext(this, this._ctx, this.state); - this.enterRule(localctx, 36, LatexParser.RULE_n_derivative_cmd); + this.enterRule(localctx, 38, LatexParser.RULE_n_derivative_cmd); try { this.enterOuterAlt(localctx, 1); { - this.state = 319; + this.state = 340; this.match(LatexParser.CMD_FRAC); - this.state = 320; + this.state = 341; this.match(LatexParser.L_BRACE); - this.state = 327; + this.state = 348; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 17: + case 19: { - this.state = 321; + this.state = 342; localctx._MATHRM_0 = this.match(LatexParser.CMD_MATHRM); - this.state = 322; + this.state = 343; this.match(LatexParser.L_BRACE); - this.state = 323; + this.state = 344; this.id(); - this.state = 324; + this.state = 345; this.match(LatexParser.R_BRACE); } break; - case 71: + case 73: { - this.state = 326; + this.state = 347; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 335; + this.state = 356; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 54: + case 56: { { - this.state = 329; + this.state = 350; this.match(LatexParser.CARET); - this.state = 330; + this.state = 351; this.match(LatexParser.L_BRACE); - this.state = 331; + this.state = 352; this.number_(); - this.state = 332; + this.state = 353; this.match(LatexParser.R_BRACE); } } break; - case 62: + case 64: { - this.state = 334; + this.state = 355; localctx._single_char_exp1 = this.match(LatexParser.CARET_SINGLE_CHAR_NUMBER); } break; default: throw new NoViableAltException(this); } - this.state = 337; + this.state = 358; this.match(LatexParser.R_BRACE); - this.state = 338; + this.state = 359; this.match(LatexParser.L_BRACE); - this.state = 345; + this.state = 366; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 17: + case 19: { - this.state = 339; + this.state = 360; localctx._MATHRM_1 = this.match(LatexParser.CMD_MATHRM); - this.state = 340; + this.state = 361; this.match(LatexParser.L_BRACE); - this.state = 341; + this.state = 362; this.id(); - this.state = 342; + this.state = 363; this.match(LatexParser.R_BRACE); } break; - case 71: + case 73: { - this.state = 344; + this.state = 365; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 347; + this.state = 368; this.match(LatexParser.L_PAREN); - this.state = 348; + this.state = 369; this.id(); - this.state = 349; + this.state = 370; this.match(LatexParser.R_PAREN); - this.state = 356; + this.state = 377; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 54: + case 56: { { - this.state = 350; + this.state = 371; this.match(LatexParser.CARET); - this.state = 351; + this.state = 372; this.match(LatexParser.L_BRACE); - this.state = 352; + this.state = 373; this.number_(); - this.state = 353; + this.state = 374; this.match(LatexParser.R_BRACE); } } break; - case 62: + case 64: { - this.state = 355; + this.state = 376; localctx._single_char_exp2 = this.match(LatexParser.CARET_SINGLE_CHAR_NUMBER); } break; default: throw new NoViableAltException(this); } - this.state = 358; + this.state = 379; this.match(LatexParser.R_BRACE); - this.state = 359; + this.state = 380; this.match(LatexParser.L_PAREN); - this.state = 360; + this.state = 381; this.expr(0); - this.state = 361; + this.state = 382; this.match(LatexParser.R_PAREN); } } @@ -1631,21 +1716,21 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public argument(): ArgumentContext { let localctx: ArgumentContext = new ArgumentContext(this, this._ctx, this.state); - this.enterRule(localctx, 38, LatexParser.RULE_argument); + this.enterRule(localctx, 40, LatexParser.RULE_argument); let _la: number; try { - this.state = 373; + this.state = 394; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 29, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 30, this._ctx) ) { case 1: this.enterOuterAlt(localctx, 1); { { - this.state = 363; + this.state = 384; this.id(); - this.state = 364; + this.state = 385; this.match(LatexParser.EQ); - this.state = 365; + this.state = 386; this.expr(0); } } @@ -1654,31 +1739,31 @@ export default class LatexParser extends Parser { this.enterOuterAlt(localctx, 2); { { - this.state = 367; + this.state = 388; this.expr(0); - this.state = 368; + this.state = 389; localctx._lower = this._input.LT(1); _la = this._input.LA(1); - if(!(_la===56 || _la===58)) { + if(!(_la===58 || _la===60)) { localctx._lower = this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 369; + this.state = 390; this.id(); - this.state = 370; + this.state = 391; localctx._upper = this._input.LT(1); _la = this._input.LA(1); - if(!(_la===56 || _la===58)) { + if(!(_la===58 || _la===60)) { localctx._upper = this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 371; + this.state = 392; this.expr(0); } } @@ -1702,22 +1787,22 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public condition(): ConditionContext { let localctx: ConditionContext = new ConditionContext(this, this._ctx, this.state); - this.enterRule(localctx, 40, LatexParser.RULE_condition); + this.enterRule(localctx, 42, LatexParser.RULE_condition); try { - this.state = 377; + this.state = 398; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 30, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 31, this._ctx) ) { case 1: this.enterOuterAlt(localctx, 1); { - this.state = 375; + this.state = 396; this.condition_single(); } break; case 2: this.enterOuterAlt(localctx, 2); { - this.state = 376; + this.state = 397; this.condition_chain(); } break; @@ -1740,29 +1825,29 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public id_list(): Id_listContext { let localctx: Id_listContext = new Id_listContext(this, this._ctx, this.state); - this.enterRule(localctx, 42, LatexParser.RULE_id_list); + this.enterRule(localctx, 44, LatexParser.RULE_id_list); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 379; + this.state = 400; this.id(); - this.state = 382; + this.state = 403; this._errHandler.sync(this); _la = this._input.LA(1); do { { { - this.state = 380; + this.state = 401; this.match(LatexParser.COMMA); - this.state = 381; + this.state = 402; this.id(); } } - this.state = 384; + this.state = 405; this._errHandler.sync(this); _la = this._input.LA(1); - } while (_la===60); + } while (_la===62); } } catch (re) { @@ -1782,34 +1867,34 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public guess(): GuessContext { let localctx: GuessContext = new GuessContext(this, this._ctx, this.state); - this.enterRule(localctx, 44, LatexParser.RULE_guess); + this.enterRule(localctx, 46, LatexParser.RULE_guess); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 386; + this.state = 407; this.id(); - this.state = 387; + this.state = 408; _la = this._input.LA(1); - if(!(_la===24 || _la===25)) { + if(!(_la===26 || _la===27)) { this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 390; + this.state = 411; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 32, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 33, this._ctx) ) { case 1: { - this.state = 388; + this.state = 409; this.number_(); } break; case 2: { - this.state = 389; + this.state = 410; this.number_with_units(); } break; @@ -1833,29 +1918,29 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public guess_list(): Guess_listContext { let localctx: Guess_listContext = new Guess_listContext(this, this._ctx, this.state); - this.enterRule(localctx, 46, LatexParser.RULE_guess_list); + this.enterRule(localctx, 48, LatexParser.RULE_guess_list); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 392; + this.state = 413; this.guess(); - this.state = 395; + this.state = 416; this._errHandler.sync(this); _la = this._input.LA(1); do { { { - this.state = 393; + this.state = 414; this.match(LatexParser.COMMA); - this.state = 394; + this.state = 415; this.guess(); } } - this.state = 397; + this.state = 418; this._errHandler.sync(this); _la = this._input.LA(1); - } while (_la===60); + } while (_la===62); } } catch (re) { @@ -1875,24 +1960,24 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public condition_single(): Condition_singleContext { let localctx: Condition_singleContext = new Condition_singleContext(this, this._ctx, this.state); - this.enterRule(localctx, 48, LatexParser.RULE_condition_single); + this.enterRule(localctx, 50, LatexParser.RULE_condition_single); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 399; + this.state = 420; this.expr(0); - this.state = 400; + this.state = 421; localctx._operator = this._input.LT(1); _la = this._input.LA(1); - if(!(((((_la - 56)) & ~0x1F) === 0 && ((1 << (_la - 56)) & 15) !== 0))) { + if(!(((((_la - 58)) & ~0x1F) === 0 && ((1 << (_la - 58)) & 15) !== 0))) { localctx._operator = this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 401; + this.state = 422; this.expr(0); } } @@ -1913,36 +1998,36 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public condition_chain(): Condition_chainContext { let localctx: Condition_chainContext = new Condition_chainContext(this, this._ctx, this.state); - this.enterRule(localctx, 50, LatexParser.RULE_condition_chain); + this.enterRule(localctx, 52, LatexParser.RULE_condition_chain); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 403; + this.state = 424; this.expr(0); - this.state = 404; + this.state = 425; localctx._lower = this._input.LT(1); _la = this._input.LA(1); - if(!(((((_la - 56)) & ~0x1F) === 0 && ((1 << (_la - 56)) & 15) !== 0))) { + if(!(((((_la - 58)) & ~0x1F) === 0 && ((1 << (_la - 58)) & 15) !== 0))) { localctx._lower = this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 405; + this.state = 426; this.expr(0); - this.state = 406; + this.state = 427; localctx._upper = this._input.LT(1); _la = this._input.LA(1); - if(!(((((_la - 56)) & ~0x1F) === 0 && ((1 << (_la - 56)) & 15) !== 0))) { + if(!(((((_la - 58)) & ~0x1F) === 0 && ((1 << (_la - 58)) & 15) !== 0))) { localctx._upper = this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 407; + this.state = 428; this.expr(0); } } @@ -1963,26 +2048,26 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public matrix_row(): Matrix_rowContext { let localctx: Matrix_rowContext = new Matrix_rowContext(this, this._ctx, this.state); - this.enterRule(localctx, 52, LatexParser.RULE_matrix_row); + this.enterRule(localctx, 54, LatexParser.RULE_matrix_row); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 409; + this.state = 430; this.expr(0); - this.state = 414; + this.state = 435; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la===67) { + while (_la===69) { { { - this.state = 410; + this.state = 431; this.match(LatexParser.AMPERSAND); - this.state = 411; + this.state = 432; this.expr(0); } } - this.state = 416; + this.state = 437; this._errHandler.sync(this); _la = this._input.LA(1); } @@ -2005,47 +2090,47 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public user_function(): User_functionContext { let localctx: User_functionContext = new User_functionContext(this, this._ctx, this.state); - this.enterRule(localctx, 54, LatexParser.RULE_user_function); + this.enterRule(localctx, 56, LatexParser.RULE_user_function); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 417; + this.state = 438; this.id(); - this.state = 418; + this.state = 439; this.match(LatexParser.L_PAREN); { - this.state = 419; + this.state = 440; this.argument(); - this.state = 424; + this.state = 445; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la===60) { + while (_la===62) { { { - this.state = 420; + this.state = 441; this.match(LatexParser.COMMA); - this.state = 421; + this.state = 442; this.argument(); } } - this.state = 426; + this.state = 447; this._errHandler.sync(this); _la = this._input.LA(1); } } - this.state = 427; + this.state = 448; this.match(LatexParser.R_PAREN); - this.state = 432; + this.state = 453; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 36, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 37, this._ctx) ) { case 1: { - this.state = 428; + this.state = 449; localctx._points_id_0 = this.match(LatexParser.ID); - this.state = 429; + this.state = 450; localctx._num_points = this.number_(); - this.state = 430; + this.state = 451; localctx._points_id_1 = this.match(LatexParser.ID); } break; @@ -2069,58 +2154,58 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public builtin_function(): Builtin_functionContext { let localctx: Builtin_functionContext = new Builtin_functionContext(this, this._ctx, this.state); - this.enterRule(localctx, 56, LatexParser.RULE_builtin_function); + this.enterRule(localctx, 58, LatexParser.RULE_builtin_function); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 440; + this.state = 461; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 17: + case 19: { - this.state = 434; + this.state = 455; this.match(LatexParser.CMD_MATHRM); - this.state = 435; + this.state = 456; this.match(LatexParser.L_BRACE); - this.state = 436; + this.state = 457; this.id(); - this.state = 437; + this.state = 458; this.match(LatexParser.R_BRACE); } break; - case 71: + case 73: { - this.state = 439; + this.state = 460; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 442; + this.state = 463; this.match(LatexParser.L_PAREN); { - this.state = 443; + this.state = 464; this.expr(0); - this.state = 448; + this.state = 469; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la===60) { + while (_la===62) { { { - this.state = 444; + this.state = 465; this.match(LatexParser.COMMA); - this.state = 445; + this.state = 466; this.expr(0); } } - this.state = 450; + this.state = 471; this._errHandler.sync(this); _la = this._input.LA(1); } } - this.state = 451; + this.state = 472; this.match(LatexParser.R_PAREN); } } @@ -2151,25 +2236,25 @@ export default class LatexParser extends Parser { let _parentState: number = this.state; let localctx: ExprContext = new ExprContext(this, this._ctx, _parentState); let _prevctx: ExprContext = localctx; - let _startState: number = 58; - this.enterRecursionRule(localctx, 58, LatexParser.RULE_expr, _p); + let _startState: number = 60; + this.enterRecursionRule(localctx, 60, LatexParser.RULE_expr, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 582; + this.state = 605; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 46, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 47, this._ctx) ) { case 1: { localctx = new ExponentContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 454; + this.state = 475; this.id(); - this.state = 455; + this.state = 476; this.match(LatexParser.CARET_SINGLE_CHAR_ID_UNDERSCORE_SUBSCRIPT); } break; @@ -2178,18 +2263,18 @@ export default class LatexParser extends Parser { localctx = new ExponentContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 457; + this.state = 478; this.id(); - this.state = 458; + this.state = 479; _la = this._input.LA(1); - if(!(_la===62 || _la===63)) { + if(!(_la===64 || _la===65)) { this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 459; + this.state = 480; this.match(LatexParser.UNDERSCORE_SUBSCRIPT); } break; @@ -2198,17 +2283,17 @@ export default class LatexParser extends Parser { localctx = new ExponentContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 461; + this.state = 482; this.id(); - this.state = 462; + this.state = 483; this.match(LatexParser.CARET); - this.state = 463; + this.state = 484; this.match(LatexParser.L_BRACE); - this.state = 464; + this.state = 485; this.expr(0); - this.state = 465; + this.state = 486; this.match(LatexParser.R_BRACE); - this.state = 466; + this.state = 487; this.match(LatexParser.UNDERSCORE_SUBSCRIPT); } break; @@ -2217,7 +2302,7 @@ export default class LatexParser extends Parser { localctx = new SingleIntSqrtContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 468; + this.state = 489; this.match(LatexParser.CMD_SQRT_INT); } break; @@ -2226,13 +2311,13 @@ export default class LatexParser extends Parser { localctx = new SqrtContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 469; + this.state = 490; this.match(LatexParser.CMD_SQRT); - this.state = 470; + this.state = 491; this.match(LatexParser.L_BRACE); - this.state = 471; + this.state = 492; this.expr(0); - this.state = 472; + this.state = 493; this.match(LatexParser.R_BRACE); } break; @@ -2241,27 +2326,27 @@ export default class LatexParser extends Parser { localctx = new MatrixContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 474; + this.state = 495; this.match(LatexParser.BEGIN_MATRIX); - this.state = 475; + this.state = 496; this.matrix_row(); - this.state = 480; + this.state = 501; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la===68) { + while (_la===70) { { { - this.state = 476; + this.state = 497; this.match(LatexParser.DOUBLE_BACKSLASH); - this.state = 477; + this.state = 498; this.matrix_row(); } } - this.state = 482; + this.state = 503; this._errHandler.sync(this); _la = this._input.LA(1); } - this.state = 483; + this.state = 504; this.match(LatexParser.END_MATRIX); } break; @@ -2270,7 +2355,7 @@ export default class LatexParser extends Parser { localctx = new TrigFunctionContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 485; + this.state = 506; this.trig_function(); } break; @@ -2279,7 +2364,7 @@ export default class LatexParser extends Parser { localctx = new IndefiniteIntegralContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 486; + this.state = 507; this.indefinite_integral_cmd(); } break; @@ -2288,7 +2373,7 @@ export default class LatexParser extends Parser { localctx = new IntegralContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 487; + this.state = 508; this.integral_cmd(); } break; @@ -2297,7 +2382,7 @@ export default class LatexParser extends Parser { localctx = new DerivativeContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 488; + this.state = 509; this.derivative_cmd(); } break; @@ -2306,365 +2391,383 @@ export default class LatexParser extends Parser { localctx = new NDerivativeContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 489; + this.state = 510; this.n_derivative_cmd(); } break; case 12: + { + localctx = new SummationContext(this, localctx); + this._ctx = localctx; + _prevctx = localctx; + this.state = 511; + this.summation_cmd(); + } + break; + case 13: { localctx = new LnContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 491; + this.state = 513; this._errHandler.sync(this); _la = this._input.LA(1); - if (_la===28) { + if (_la===30) { { - this.state = 490; + this.state = 512; this.match(LatexParser.BACKSLASH); } } - this.state = 493; + this.state = 515; this.match(LatexParser.CMD_LN); - this.state = 494; + this.state = 516; this.match(LatexParser.L_PAREN); - this.state = 495; + this.state = 517; this.expr(0); - this.state = 496; + this.state = 518; this.match(LatexParser.R_PAREN); } break; - case 13: + case 14: { localctx = new LogContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 499; + this.state = 521; this._errHandler.sync(this); _la = this._input.LA(1); - if (_la===28) { + if (_la===30) { { - this.state = 498; + this.state = 520; this.match(LatexParser.BACKSLASH); } } - this.state = 501; + this.state = 523; this.match(LatexParser.CMD_LOG); - this.state = 502; + this.state = 524; this.match(LatexParser.L_PAREN); - this.state = 503; + this.state = 525; this.expr(0); - this.state = 504; + this.state = 526; this.match(LatexParser.R_PAREN); } break; - case 14: + case 15: { localctx = new BaseLogContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 506; + this.state = 528; this.match(LatexParser.CMD_SLASH_LOG_UNDERSCORE); - this.state = 507; + this.state = 529; this.match(LatexParser.L_BRACE); - this.state = 508; + this.state = 530; this.expr(0); - this.state = 509; + this.state = 531; this.match(LatexParser.R_BRACE); - this.state = 510; + this.state = 532; this.match(LatexParser.L_PAREN); - this.state = 511; + this.state = 533; this.expr(0); - this.state = 512; + this.state = 534; this.match(LatexParser.R_PAREN); } break; - case 15: + case 16: { localctx = new BaseLogSingleCharContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 514; + this.state = 536; _la = this._input.LA(1); - if(!(_la===46 || _la===47)) { + if(!(_la===48 || _la===49)) { this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 515; + this.state = 537; this.match(LatexParser.L_PAREN); - this.state = 516; + this.state = 538; this.expr(0); - this.state = 517; + this.state = 539; this.match(LatexParser.R_PAREN); } break; - case 16: + case 17: { localctx = new NormContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 519; + this.state = 541; this.match(LatexParser.DOUBLE_VBAR); - this.state = 520; + this.state = 542; this.expr(0); - this.state = 521; + this.state = 543; this.match(LatexParser.DOUBLE_VBAR); } break; - case 17: + case 18: { localctx = new AbsContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 523; + this.state = 545; this.match(LatexParser.VBAR); - this.state = 524; + this.state = 546; this.expr(0); - this.state = 525; + this.state = 547; this.match(LatexParser.VBAR); } break; - case 18: + case 19: { localctx = new NumberWithUnitsExprContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 527; + this.state = 549; this.number_with_units(); } break; - case 19: + case 20: { localctx = new NumberExprContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 528; + this.state = 550; this.number_(); } break; - case 20: + case 21: { localctx = new UnaryMinusContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 529; + this.state = 551; this.match(LatexParser.SUB); - this.state = 530; - this.expr(30); + this.state = 552; + this.expr(31); } break; - case 21: + case 22: { localctx = new DivideContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 531; + this.state = 553; this.match(LatexParser.CMD_FRAC); - this.state = 532; + this.state = 554; this.match(LatexParser.L_BRACE); - this.state = 533; + this.state = 555; this.expr(0); - this.state = 534; + this.state = 556; this.match(LatexParser.R_BRACE); - this.state = 535; + this.state = 557; this.match(LatexParser.L_BRACE); - this.state = 536; + this.state = 558; this.expr(0); - this.state = 537; + this.state = 559; this.match(LatexParser.R_BRACE); } break; - case 22: + case 23: { localctx = new DivideIntsContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 539; + this.state = 561; this.match(LatexParser.CMD_FRAC_INTS); } break; - case 23: + case 24: { localctx = new VariableContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 540; + this.state = 562; this.id(); } break; - case 24: + case 25: { localctx = new UserFunctionContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 541; + this.state = 563; this.user_function(); } break; - case 25: + case 26: { localctx = new BuiltinFunctionContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 542; + this.state = 564; this.builtin_function(); } break; - case 26: + case 27: { localctx = new PiExprContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 543; + this.state = 565; this.match(LatexParser.PI); } break; - case 27: + case 28: + { + localctx = new InfinityExprContext(this, localctx); + this._ctx = localctx; + _prevctx = localctx; + this.state = 566; + this.match(LatexParser.INFINITY); + } + break; + case 29: { localctx = new SubExprContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 544; + this.state = 567; this.match(LatexParser.L_PAREN); - this.state = 545; + this.state = 568; this.expr(0); - this.state = 546; + this.state = 569; this.match(LatexParser.R_PAREN); } break; - case 28: + case 30: { localctx = new MissingMultiplicationContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 548; + this.state = 571; this.number_(); - this.state = 549; + this.state = 572; this.expr(12); } break; - case 29: + case 31: { localctx = new MissingMultiplicationContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 551; + this.state = 574; this.number_with_units(); - this.state = 552; + this.state = 575; this.expr(11); } break; - case 30: + case 32: { localctx = new MissingMultiplicationContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 554; + this.state = 577; this.match(LatexParser.PI); - this.state = 555; + this.state = 578; this.expr(10); } break; - case 31: + case 33: { localctx = new EmptyPlaceholderContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 556; + this.state = 579; this.match(LatexParser.CMD_PLACEHOLDER); - this.state = 559; + this.state = 582; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 42, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 43, this._ctx) ) { case 1: { - this.state = 557; + this.state = 580; this.match(LatexParser.L_BRACE); - this.state = 558; + this.state = 581; this.match(LatexParser.R_BRACE); } break; } } break; - case 32: + case 34: { localctx = new RemoveOperatorFontContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 566; + this.state = 589; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 43, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 44, this._ctx) ) { case 1: { - this.state = 561; + this.state = 584; this.match(LatexParser.CMD_MATHRM); - this.state = 562; + this.state = 585; this.match(LatexParser.L_BRACE); - this.state = 563; + this.state = 586; this.expr(0); - this.state = 564; + this.state = 587; this.match(LatexParser.R_BRACE); } break; } - this.state = 571; + this.state = 594; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 61: + case 63: { - this.state = 568; + this.state = 591; this.match(LatexParser.DECIMAL_POINT); } break; - case 53: - case 64: + case 55: + case 66: { - this.state = 569; + this.state = 592; this.number_(); } break; - case 55: + case 57: { - this.state = 570; + this.state = 593; this.match(LatexParser.EQ); } break; - case 17: + case 19: break; default: break; } - this.state = 573; + this.state = 596; this.match(LatexParser.CMD_MATHRM); - this.state = 574; + this.state = 597; this.match(LatexParser.L_BRACE); - this.state = 575; + this.state = 598; this.expr(0); - this.state = 576; + this.state = 599; this.match(LatexParser.R_BRACE); - this.state = 580; + this.state = 603; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 45, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 46, this._ctx) ) { case 1: { - this.state = 577; + this.state = 600; this.match(LatexParser.DECIMAL_POINT); } break; case 2: { - this.state = 578; + this.state = 601; this.number_(); } break; case 3: { - this.state = 579; + this.state = 602; this.match(LatexParser.EQ); } break; @@ -2673,9 +2776,9 @@ export default class LatexParser extends Parser { break; } this._ctx.stop = this._input.LT(-1); - this.state = 648; + this.state = 671; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 48, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 49, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { if (this._parseListeners != null) { @@ -2683,76 +2786,76 @@ export default class LatexParser extends Parser { } _prevctx = localctx; { - this.state = 646; + this.state = 669; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 47, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 48, this._ctx) ) { case 1: { localctx = new MatrixMultiplyContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 584; - if (!(this.precpred(this._ctx, 29))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 29)"); + this.state = 607; + if (!(this.precpred(this._ctx, 30))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 30)"); } - this.state = 585; + this.state = 608; this.match(LatexParser.CMD_TIMES); - this.state = 586; - this.expr(30); + this.state = 609; + this.expr(31); } break; case 2: { localctx = new MultiplyContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 587; - if (!(this.precpred(this._ctx, 28))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 28)"); + this.state = 610; + if (!(this.precpred(this._ctx, 29))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 29)"); } - this.state = 588; + this.state = 611; this.match(LatexParser.CMD_CDOT); - this.state = 589; - this.expr(29); + this.state = 612; + this.expr(30); } break; case 3: { localctx = new SubtractContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 590; - if (!(this.precpred(this._ctx, 25))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 25)"); + this.state = 613; + if (!(this.precpred(this._ctx, 26))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 26)"); } - this.state = 591; + this.state = 614; this.match(LatexParser.SUB); - this.state = 592; - this.expr(26); + this.state = 615; + this.expr(27); } break; case 4: { localctx = new AddContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 593; - if (!(this.precpred(this._ctx, 24))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 24)"); + this.state = 616; + if (!(this.precpred(this._ctx, 25))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 25)"); } - this.state = 594; + this.state = 617; this.match(LatexParser.ADD); - this.state = 595; - this.expr(25); + this.state = 618; + this.expr(26); } break; case 5: { localctx = new ExponentContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 596; - if (!(this.precpred(this._ctx, 51))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 51)"); + this.state = 619; + if (!(this.precpred(this._ctx, 53))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 53)"); } - this.state = 597; + this.state = 620; _la = this._input.LA(1); - if(!(_la===62 || _la===63)) { + if(!(_la===64 || _la===65)) { this._errHandler.recoverInline(this); } else { @@ -2765,17 +2868,17 @@ export default class LatexParser extends Parser { { localctx = new ExponentContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 598; - if (!(this.precpred(this._ctx, 50))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 50)"); + this.state = 621; + if (!(this.precpred(this._ctx, 52))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 52)"); } - this.state = 599; + this.state = 622; this.match(LatexParser.CARET); - this.state = 600; + this.state = 623; this.match(LatexParser.L_BRACE); - this.state = 601; + this.state = 624; this.expr(0); - this.state = 602; + this.state = 625; this.match(LatexParser.R_BRACE); } break; @@ -2783,21 +2886,21 @@ export default class LatexParser extends Parser { { localctx = new IndexContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 604; - if (!(this.precpred(this._ctx, 49))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 49)"); + this.state = 627; + if (!(this.precpred(this._ctx, 51))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 51)"); } - this.state = 605; + this.state = 628; this.match(LatexParser.UNDERSCORE); - this.state = 606; + this.state = 629; this.match(LatexParser.L_BRACE); - this.state = 607; + this.state = 630; this.expr(0); - this.state = 608; + this.state = 631; this.match(LatexParser.COMMA); - this.state = 609; + this.state = 632; this.expr(0); - this.state = 610; + this.state = 633; this.match(LatexParser.R_BRACE); } break; @@ -2805,11 +2908,11 @@ export default class LatexParser extends Parser { { localctx = new TransposeContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 612; - if (!(this.precpred(this._ctx, 48))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 48)"); + this.state = 635; + if (!(this.precpred(this._ctx, 50))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 50)"); } - this.state = 613; + this.state = 636; this.match(LatexParser.TRANSPOSE); } break; @@ -2817,11 +2920,11 @@ export default class LatexParser extends Parser { { localctx = new FactorialContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 614; - if (!(this.precpred(this._ctx, 47))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 47)"); + this.state = 637; + if (!(this.precpred(this._ctx, 49))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 49)"); } - this.state = 615; + this.state = 638; this.match(LatexParser.EXCLAMATION); } break; @@ -2829,15 +2932,15 @@ export default class LatexParser extends Parser { { localctx = new EmptySubscriptContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 616; + this.state = 639; if (!(this.precpred(this._ctx, 18))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 18)"); } - this.state = 617; + this.state = 640; this.match(LatexParser.UNDERSCORE); - this.state = 618; + this.state = 641; this.match(LatexParser.L_BRACE); - this.state = 619; + this.state = 642; this.match(LatexParser.R_BRACE); } break; @@ -2845,15 +2948,15 @@ export default class LatexParser extends Parser { { localctx = new EmptySuperscriptContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 620; + this.state = 643; if (!(this.precpred(this._ctx, 17))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 17)"); } - this.state = 621; + this.state = 644; this.match(LatexParser.CARET); - this.state = 622; + this.state = 645; this.match(LatexParser.L_BRACE); - this.state = 623; + this.state = 646; this.match(LatexParser.R_BRACE); } break; @@ -2861,11 +2964,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 624; + this.state = 647; if (!(this.precpred(this._ctx, 16))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 16)"); } - this.state = 625; + this.state = 648; this.id(); } break; @@ -2873,11 +2976,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 626; + this.state = 649; if (!(this.precpred(this._ctx, 15))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 15)"); } - this.state = 627; + this.state = 650; this.number_(); } break; @@ -2885,11 +2988,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 628; + this.state = 651; if (!(this.precpred(this._ctx, 14))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 14)"); } - this.state = 629; + this.state = 652; this.number_with_units(); } break; @@ -2897,11 +3000,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 630; + this.state = 653; if (!(this.precpred(this._ctx, 13))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 13)"); } - this.state = 631; + this.state = 654; this.match(LatexParser.PI); } break; @@ -2909,11 +3012,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 632; + this.state = 655; if (!(this.precpred(this._ctx, 9))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 9)"); } - this.state = 633; + this.state = 656; this.user_function(); } break; @@ -2921,11 +3024,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 634; + this.state = 657; if (!(this.precpred(this._ctx, 8))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 8)"); } - this.state = 635; + this.state = 658; this.builtin_function(); } break; @@ -2933,11 +3036,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 636; + this.state = 659; if (!(this.precpred(this._ctx, 7))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 7)"); } - this.state = 637; + this.state = 660; this.trig_function(); } break; @@ -2945,11 +3048,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 638; + this.state = 661; if (!(this.precpred(this._ctx, 6))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 6)"); } - this.state = 639; + this.state = 662; this.indefinite_integral_cmd(); } break; @@ -2957,11 +3060,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 640; + this.state = 663; if (!(this.precpred(this._ctx, 5))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); } - this.state = 641; + this.state = 664; this.integral_cmd(); } break; @@ -2969,11 +3072,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 642; + this.state = 665; if (!(this.precpred(this._ctx, 4))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 4)"); } - this.state = 643; + this.state = 666; this.derivative_cmd(); } break; @@ -2981,20 +3084,20 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 644; + this.state = 667; if (!(this.precpred(this._ctx, 3))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); } - this.state = 645; + this.state = 668; this.n_derivative_cmd(); } break; } } } - this.state = 650; + this.state = 673; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 48, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 49, this._ctx); } } } @@ -3015,12 +3118,12 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public u_block(): U_blockContext { let localctx: U_blockContext = new U_blockContext(this, this._ctx, this.state); - this.enterRule(localctx, 60, LatexParser.RULE_u_block); + this.enterRule(localctx, 62, LatexParser.RULE_u_block); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 651; + this.state = 674; _la = this._input.LA(1); if(!(_la===1 || _la===2)) { this._errHandler.recoverInline(this); @@ -3029,11 +3132,11 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 652; + this.state = 675; this.u_expr(0); - this.state = 653; + this.state = 676; _la = this._input.LA(1); - if(!(_la===77 || _la===78)) { + if(!(_la===79 || _la===80)) { this._errHandler.recoverInline(this); } else { @@ -3059,12 +3162,12 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public u_insert_matrix(): U_insert_matrixContext { let localctx: U_insert_matrixContext = new U_insert_matrixContext(this, this._ctx, this.state); - this.enterRule(localctx, 62, LatexParser.RULE_u_insert_matrix); + this.enterRule(localctx, 64, LatexParser.RULE_u_insert_matrix); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 655; + this.state = 678; _la = this._input.LA(1); if(!(_la===1 || _la===2)) { this._errHandler.recoverInline(this); @@ -3073,38 +3176,38 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 656; + this.state = 679; localctx._numRows = this._input.LT(1); _la = this._input.LA(1); - if(!(_la===91 || _la===92)) { + if(!(_la===93 || _la===94)) { localctx._numRows = this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 657; + this.state = 680; _la = this._input.LA(1); - if(!(_la===82 || _la===84)) { + if(!(_la===84 || _la===86)) { this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 658; + this.state = 681; localctx._numColumns = this._input.LT(1); _la = this._input.LA(1); - if(!(_la===91 || _la===92)) { + if(!(_la===93 || _la===94)) { localctx._numColumns = this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 659; + this.state = 682; _la = this._input.LA(1); - if(!(_la===77 || _la===78)) { + if(!(_la===79 || _la===80)) { this._errHandler.recoverInline(this); } else { @@ -3130,42 +3233,42 @@ export default class LatexParser extends Parser { // @RuleVersion(0) public u_fraction(): U_fractionContext { let localctx: U_fractionContext = new U_fractionContext(this, this._ctx, this.state); - this.enterRule(localctx, 64, LatexParser.RULE_u_fraction); + this.enterRule(localctx, 66, LatexParser.RULE_u_fraction); let _la: number; try { - this.state = 669; + this.state = 692; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 79: + case 81: this.enterOuterAlt(localctx, 1); { - this.state = 661; + this.state = 684; this.match(LatexParser.U_CMD_FRAC); - this.state = 662; + this.state = 685; this.match(LatexParser.U_L_BRACE); - this.state = 663; + this.state = 686; _la = this._input.LA(1); - if(!(_la===91 || _la===92)) { + if(!(_la===93 || _la===94)) { this._errHandler.recoverInline(this); } else { this._errHandler.reportMatch(this); this.consume(); } - this.state = 664; + this.state = 687; this.match(LatexParser.U_R_BRACE); - this.state = 665; + this.state = 688; this.match(LatexParser.U_L_BRACE); - this.state = 666; + this.state = 689; this.match(LatexParser.U_NUMBER); - this.state = 667; + this.state = 690; this.match(LatexParser.U_R_BRACE); } break; - case 80: + case 82: this.enterOuterAlt(localctx, 2); { - this.state = 668; + this.state = 691; this.match(LatexParser.U_CMD_FRAC_INTS); } break; @@ -3200,90 +3303,90 @@ export default class LatexParser extends Parser { let _parentState: number = this.state; let localctx: U_exprContext = new U_exprContext(this, this._ctx, _parentState); let _prevctx: U_exprContext = localctx; - let _startState: number = 66; - this.enterRecursionRule(localctx, 66, LatexParser.RULE_u_expr, _p); + let _startState: number = 68; + this.enterRecursionRule(localctx, 68, LatexParser.RULE_u_expr, _p); try { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 693; + this.state = 716; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 83: + case 85: { localctx = new UnitSqrtContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 672; + this.state = 695; this.match(LatexParser.U_CMD_SQRT); - this.state = 673; + this.state = 696; this.match(LatexParser.U_L_BRACE); - this.state = 674; + this.state = 697; this.expr(0); - this.state = 675; + this.state = 698; this.match(LatexParser.U_R_BRACE); } break; - case 79: + case 81: { localctx = new UnitDivideContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 677; + this.state = 700; this.match(LatexParser.U_CMD_FRAC); - this.state = 678; + this.state = 701; this.match(LatexParser.U_L_BRACE); - this.state = 681; + this.state = 704; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 79: - case 83: - case 86: - case 87: + case 81: + case 85: + case 88: + case 89: { - this.state = 679; + this.state = 702; this.u_expr(0); } break; - case 91: + case 93: { - this.state = 680; + this.state = 703; this.match(LatexParser.U_ONE); } break; default: throw new NoViableAltException(this); } - this.state = 683; + this.state = 706; this.match(LatexParser.U_R_BRACE); - this.state = 684; + this.state = 707; this.match(LatexParser.U_L_BRACE); - this.state = 685; + this.state = 708; this.u_expr(0); - this.state = 686; + this.state = 709; this.match(LatexParser.U_R_BRACE); } break; - case 86: + case 88: { localctx = new UnitNameContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 688; + this.state = 711; this.match(LatexParser.U_NAME); } break; - case 87: + case 89: { localctx = new UnitSubExprContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 689; + this.state = 712; this.match(LatexParser.U_L_PAREN); - this.state = 690; + this.state = 713; this.u_expr(0); - this.state = 691; + this.state = 714; this.match(LatexParser.U_R_PAREN); } break; @@ -3291,9 +3394,9 @@ export default class LatexParser extends Parser { throw new NoViableAltException(this); } this._ctx.stop = this._input.LT(-1); - this.state = 717; + this.state = 740; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 53, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 54, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { if (this._parseListeners != null) { @@ -3301,20 +3404,20 @@ export default class LatexParser extends Parser { } _prevctx = localctx; { - this.state = 715; + this.state = 738; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 52, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 53, this._ctx) ) { case 1: { localctx = new UnitMultiplyContext(this, new U_exprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_u_expr); - this.state = 695; + this.state = 718; if (!(this.precpred(this._ctx, 4))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 4)"); } - this.state = 696; + this.state = 719; this.match(LatexParser.U_CMD_CDOT); - this.state = 697; + this.state = 720; this.u_expr(5); } break; @@ -3322,13 +3425,13 @@ export default class LatexParser extends Parser { { localctx = new UnitExponentContext(this, new U_exprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_u_expr); - this.state = 698; + this.state = 721; if (!(this.precpred(this._ctx, 9))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 9)"); } - this.state = 699; + this.state = 722; this.match(LatexParser.U_CARET); - this.state = 700; + this.state = 723; this.match(LatexParser.U_NUMBER); } break; @@ -3336,17 +3439,17 @@ export default class LatexParser extends Parser { { localctx = new UnitExponentContext(this, new U_exprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_u_expr); - this.state = 701; + this.state = 724; if (!(this.precpred(this._ctx, 8))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 8)"); } - this.state = 702; + this.state = 725; this.match(LatexParser.U_CARET); - this.state = 703; + this.state = 726; this.match(LatexParser.U_L_BRACE); - this.state = 704; + this.state = 727; this.match(LatexParser.U_NUMBER); - this.state = 705; + this.state = 728; this.match(LatexParser.U_R_BRACE); } break; @@ -3354,13 +3457,13 @@ export default class LatexParser extends Parser { { localctx = new UnitFractionalExponentContext(this, new U_exprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_u_expr); - this.state = 706; + this.state = 729; if (!(this.precpred(this._ctx, 7))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 7)"); } - this.state = 707; + this.state = 730; this.match(LatexParser.U_CARET); - this.state = 708; + this.state = 731; this.u_fraction(); } break; @@ -3368,26 +3471,26 @@ export default class LatexParser extends Parser { { localctx = new UnitFractionalExponentContext(this, new U_exprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_u_expr); - this.state = 709; + this.state = 732; if (!(this.precpred(this._ctx, 6))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 6)"); } - this.state = 710; + this.state = 733; this.match(LatexParser.U_CARET); - this.state = 711; + this.state = 734; this.match(LatexParser.U_L_BRACE); - this.state = 712; + this.state = 735; this.u_fraction(); - this.state = 713; + this.state = 736; this.match(LatexParser.U_R_BRACE); } break; } } } - this.state = 719; + this.state = 742; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 53, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 54, this._ctx); } } } @@ -3408,9 +3511,9 @@ export default class LatexParser extends Parser { public sempred(localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 29: + case 30: return this.expr_sempred(localctx as ExprContext, predIndex); - case 33: + case 34: return this.u_expr_sempred(localctx as U_exprContext, predIndex); } return true; @@ -3418,23 +3521,23 @@ export default class LatexParser extends Parser { private expr_sempred(localctx: ExprContext, predIndex: number): boolean { switch (predIndex) { case 0: - return this.precpred(this._ctx, 29); + return this.precpred(this._ctx, 30); case 1: - return this.precpred(this._ctx, 28); + return this.precpred(this._ctx, 29); case 2: - return this.precpred(this._ctx, 25); + return this.precpred(this._ctx, 26); case 3: - return this.precpred(this._ctx, 24); + return this.precpred(this._ctx, 25); case 4: - return this.precpred(this._ctx, 51); + return this.precpred(this._ctx, 53); case 5: - return this.precpred(this._ctx, 50); + return this.precpred(this._ctx, 52); case 6: - return this.precpred(this._ctx, 49); + return this.precpred(this._ctx, 51); case 7: - return this.precpred(this._ctx, 48); + return this.precpred(this._ctx, 50); case 8: - return this.precpred(this._ctx, 47); + return this.precpred(this._ctx, 49); case 9: return this.precpred(this._ctx, 18); case 10: @@ -3480,251 +3583,258 @@ export default class LatexParser extends Parser { return true; } - public static readonly _serializedATN: number[] = [4,1,99,721,2,0,7,0,2, - 1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2, - 10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17, - 7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7, - 24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31, - 2,32,7,32,2,33,7,33,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, - 1,0,1,0,1,0,1,0,3,0,86,8,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,3,1,100,8,1,1,1,3,1,103,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,3,1,116,8,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, - 3,2,132,8,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,3,2,145,8,2,1,3, - 5,3,148,8,3,10,3,12,3,151,9,3,1,3,1,3,5,3,155,8,3,10,3,12,3,158,9,3,4,3, - 160,8,3,11,3,12,3,161,1,4,1,4,1,5,3,5,167,8,5,1,5,1,5,1,6,1,6,1,6,3,6,174, - 8,6,1,6,1,6,1,7,1,7,3,7,180,8,7,1,7,1,7,1,7,1,8,1,8,1,8,4,8,188,8,8,11, - 8,12,8,189,1,9,1,9,1,9,3,9,195,8,9,1,10,1,10,1,10,3,10,200,8,10,1,11,1, - 11,1,11,1,11,1,12,1,12,3,12,208,8,12,1,12,1,12,1,12,1,12,1,12,1,12,5,12, - 216,8,12,10,12,12,12,219,9,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,1, - 14,3,14,230,8,14,1,14,1,14,1,14,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,15, - 1,15,3,15,244,8,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,3,15,255, - 8,15,1,15,1,15,1,15,1,15,1,16,1,16,1,16,1,16,1,16,1,16,3,16,267,8,16,1, - 16,1,16,1,16,1,16,1,16,1,16,3,16,275,8,16,1,16,1,16,1,16,1,16,1,16,1,16, - 1,16,1,16,1,16,3,16,286,8,16,1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17,1, - 17,1,17,1,17,1,17,3,17,300,8,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17, - 3,17,310,8,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,18,1,18,1,18,1, - 18,1,18,1,18,1,18,1,18,3,18,328,8,18,1,18,1,18,1,18,1,18,1,18,1,18,3,18, - 336,8,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,3,18,346,8,18,1,18,1,18, - 1,18,1,18,1,18,1,18,1,18,1,18,1,18,3,18,357,8,18,1,18,1,18,1,18,1,18,1, - 18,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,3,19,374,8,19,1,20, - 1,20,3,20,378,8,20,1,21,1,21,1,21,4,21,383,8,21,11,21,12,21,384,1,22,1, - 22,1,22,1,22,3,22,391,8,22,1,23,1,23,1,23,4,23,396,8,23,11,23,12,23,397, - 1,24,1,24,1,24,1,24,1,25,1,25,1,25,1,25,1,25,1,25,1,26,1,26,1,26,5,26,413, - 8,26,10,26,12,26,416,9,26,1,27,1,27,1,27,1,27,1,27,5,27,423,8,27,10,27, - 12,27,426,9,27,1,27,1,27,1,27,1,27,1,27,3,27,433,8,27,1,28,1,28,1,28,1, - 28,1,28,1,28,3,28,441,8,28,1,28,1,28,1,28,1,28,5,28,447,8,28,10,28,12,28, - 450,9,28,1,28,1,28,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, - 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29, - 5,29,479,8,29,10,29,12,29,482,9,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, - 29,3,29,492,8,29,1,29,1,29,1,29,1,29,1,29,1,29,3,29,500,8,29,1,29,1,29, - 1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, - 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29, - 1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, - 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,3,29,560, - 8,29,1,29,1,29,1,29,1,29,1,29,3,29,567,8,29,1,29,1,29,1,29,3,29,572,8,29, - 1,29,1,29,1,29,1,29,1,29,1,29,1,29,3,29,581,8,29,3,29,583,8,29,1,29,1,29, - 1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, - 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29, - 1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, - 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29, - 1,29,1,29,5,29,647,8,29,10,29,12,29,650,9,29,1,30,1,30,1,30,1,30,1,31,1, - 31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,3,32,670, - 8,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,3,33,682,8,33,1, - 33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,3,33,694,8,33,1,33,1,33, - 1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1, - 33,1,33,1,33,1,33,5,33,716,8,33,10,33,12,33,719,9,33,1,33,2,149,156,2,58, - 66,34,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46, - 48,50,52,54,56,58,60,62,64,66,0,11,1,0,30,42,1,0,15,16,1,0,62,63,2,0,56, - 56,58,58,1,0,24,25,1,0,56,59,1,0,46,47,1,0,1,2,1,0,77,78,1,0,91,92,2,0, - 82,82,84,84,818,0,85,1,0,0,0,2,99,1,0,0,0,4,117,1,0,0,0,6,149,1,0,0,0,8, - 163,1,0,0,0,10,166,1,0,0,0,12,173,1,0,0,0,14,179,1,0,0,0,16,184,1,0,0,0, - 18,191,1,0,0,0,20,196,1,0,0,0,22,201,1,0,0,0,24,207,1,0,0,0,26,222,1,0, - 0,0,28,229,1,0,0,0,30,243,1,0,0,0,32,266,1,0,0,0,34,291,1,0,0,0,36,319, - 1,0,0,0,38,373,1,0,0,0,40,377,1,0,0,0,42,379,1,0,0,0,44,386,1,0,0,0,46, - 392,1,0,0,0,48,399,1,0,0,0,50,403,1,0,0,0,52,409,1,0,0,0,54,417,1,0,0,0, - 56,440,1,0,0,0,58,582,1,0,0,0,60,651,1,0,0,0,62,655,1,0,0,0,64,669,1,0, - 0,0,66,693,1,0,0,0,68,86,3,14,7,0,69,86,3,16,8,0,70,86,3,18,9,0,71,86,3, - 20,10,0,72,86,3,22,11,0,73,86,3,60,30,0,74,86,3,10,5,0,75,86,3,8,4,0,76, - 86,3,42,21,0,77,86,3,44,22,0,78,86,3,46,23,0,79,86,3,58,29,0,80,86,3,40, - 20,0,81,86,3,24,12,0,82,86,3,6,3,0,83,86,3,2,1,0,84,86,3,4,2,0,85,68,1, - 0,0,0,85,69,1,0,0,0,85,70,1,0,0,0,85,71,1,0,0,0,85,72,1,0,0,0,85,73,1,0, - 0,0,85,74,1,0,0,0,85,75,1,0,0,0,85,76,1,0,0,0,85,77,1,0,0,0,85,78,1,0,0, - 0,85,79,1,0,0,0,85,80,1,0,0,0,85,81,1,0,0,0,85,82,1,0,0,0,85,83,1,0,0,0, - 85,84,1,0,0,0,85,86,1,0,0,0,86,87,1,0,0,0,87,88,5,0,0,1,88,1,1,0,0,0,89, - 90,5,6,0,0,90,91,3,58,29,0,91,92,5,60,0,0,92,93,3,58,29,0,93,94,5,7,0,0, - 94,100,1,0,0,0,95,96,3,58,29,0,96,97,5,60,0,0,97,98,3,58,29,0,98,100,1, - 0,0,0,99,89,1,0,0,0,99,95,1,0,0,0,100,102,1,0,0,0,101,103,5,29,0,0,102, - 101,1,0,0,0,102,103,1,0,0,0,103,104,1,0,0,0,104,115,5,55,0,0,105,106,5, - 6,0,0,106,107,3,60,30,0,107,108,5,60,0,0,108,109,3,60,30,0,109,110,5,7, - 0,0,110,116,1,0,0,0,111,112,3,60,30,0,112,113,5,60,0,0,113,114,3,60,30, - 0,114,116,1,0,0,0,115,105,1,0,0,0,115,111,1,0,0,0,115,116,1,0,0,0,116,3, - 1,0,0,0,117,118,5,6,0,0,118,119,3,58,29,0,119,120,5,60,0,0,120,121,3,58, - 29,0,121,122,5,7,0,0,122,123,1,0,0,0,123,124,5,71,0,0,124,125,5,6,0,0,125, - 126,3,38,19,0,126,131,5,7,0,0,127,128,5,71,0,0,128,129,3,10,5,0,129,130, - 5,71,0,0,130,132,1,0,0,0,131,127,1,0,0,0,131,132,1,0,0,0,132,133,1,0,0, - 0,133,144,5,55,0,0,134,135,5,6,0,0,135,136,3,60,30,0,136,137,5,60,0,0,137, - 138,3,60,30,0,138,139,5,7,0,0,139,145,1,0,0,0,140,141,3,60,30,0,141,142, - 5,60,0,0,142,143,3,60,30,0,143,145,1,0,0,0,144,134,1,0,0,0,144,140,1,0, - 0,0,144,145,1,0,0,0,145,5,1,0,0,0,146,148,9,0,0,0,147,146,1,0,0,0,148,151, - 1,0,0,0,149,150,1,0,0,0,149,147,1,0,0,0,150,159,1,0,0,0,151,149,1,0,0,0, - 152,156,3,62,31,0,153,155,9,0,0,0,154,153,1,0,0,0,155,158,1,0,0,0,156,157, - 1,0,0,0,156,154,1,0,0,0,157,160,1,0,0,0,158,156,1,0,0,0,159,152,1,0,0,0, - 160,161,1,0,0,0,161,159,1,0,0,0,161,162,1,0,0,0,162,7,1,0,0,0,163,164,5, - 71,0,0,164,9,1,0,0,0,165,167,5,53,0,0,166,165,1,0,0,0,166,167,1,0,0,0,167, - 168,1,0,0,0,168,169,5,64,0,0,169,11,1,0,0,0,170,174,3,10,5,0,171,174,5, - 12,0,0,172,174,3,8,4,0,173,170,1,0,0,0,173,171,1,0,0,0,173,172,1,0,0,0, - 174,175,1,0,0,0,175,176,3,60,30,0,176,13,1,0,0,0,177,180,3,8,4,0,178,180, - 5,12,0,0,179,177,1,0,0,0,179,178,1,0,0,0,180,181,1,0,0,0,181,182,5,55,0, - 0,182,183,3,58,29,0,183,15,1,0,0,0,184,187,3,14,7,0,185,186,5,60,0,0,186, - 188,3,14,7,0,187,185,1,0,0,0,188,189,1,0,0,0,189,187,1,0,0,0,189,190,1, - 0,0,0,190,17,1,0,0,0,191,192,3,14,7,0,192,194,5,55,0,0,193,195,3,60,30, - 0,194,193,1,0,0,0,194,195,1,0,0,0,195,19,1,0,0,0,196,197,3,58,29,0,197, - 199,5,55,0,0,198,200,3,60,30,0,199,198,1,0,0,0,199,200,1,0,0,0,200,21,1, - 0,0,0,201,202,3,58,29,0,202,203,5,55,0,0,203,204,3,58,29,0,204,23,1,0,0, - 0,205,208,3,8,4,0,206,208,5,12,0,0,207,205,1,0,0,0,207,206,1,0,0,0,208, - 209,1,0,0,0,209,210,5,55,0,0,210,211,3,8,4,0,211,212,5,6,0,0,212,217,3, - 26,13,0,213,214,5,60,0,0,214,216,3,26,13,0,215,213,1,0,0,0,216,219,1,0, - 0,0,217,215,1,0,0,0,217,218,1,0,0,0,218,220,1,0,0,0,219,217,1,0,0,0,220, - 221,5,7,0,0,221,25,1,0,0,0,222,223,5,6,0,0,223,224,3,58,29,0,224,225,5, - 60,0,0,225,226,3,40,20,0,226,227,5,7,0,0,227,27,1,0,0,0,228,230,5,28,0, - 0,229,228,1,0,0,0,229,230,1,0,0,0,230,231,1,0,0,0,231,232,7,0,0,0,232,233, - 5,6,0,0,233,234,3,58,29,0,234,235,5,7,0,0,235,29,1,0,0,0,236,244,5,13,0, - 0,237,238,5,14,0,0,238,239,5,4,0,0,239,240,5,5,0,0,240,241,5,54,0,0,241, - 242,5,4,0,0,242,244,5,5,0,0,243,236,1,0,0,0,243,237,1,0,0,0,244,245,1,0, - 0,0,245,246,5,6,0,0,246,247,3,58,29,0,247,254,5,7,0,0,248,249,5,17,0,0, - 249,250,5,4,0,0,250,251,3,8,4,0,251,252,5,5,0,0,252,255,1,0,0,0,253,255, - 3,8,4,0,254,248,1,0,0,0,254,253,1,0,0,0,255,256,1,0,0,0,256,257,5,6,0,0, - 257,258,3,8,4,0,258,259,5,7,0,0,259,31,1,0,0,0,260,261,5,14,0,0,261,262, - 5,4,0,0,262,263,3,58,29,0,263,264,5,5,0,0,264,267,1,0,0,0,265,267,7,1,0, - 0,266,260,1,0,0,0,266,265,1,0,0,0,267,274,1,0,0,0,268,269,5,54,0,0,269, - 270,5,4,0,0,270,271,3,58,29,0,271,272,5,5,0,0,272,275,1,0,0,0,273,275,7, - 2,0,0,274,268,1,0,0,0,274,273,1,0,0,0,275,276,1,0,0,0,276,277,5,6,0,0,277, - 278,3,58,29,0,278,285,5,7,0,0,279,280,5,17,0,0,280,281,5,4,0,0,281,282, - 3,8,4,0,282,283,5,5,0,0,283,286,1,0,0,0,284,286,3,8,4,0,285,279,1,0,0,0, - 285,284,1,0,0,0,286,287,1,0,0,0,287,288,5,6,0,0,288,289,3,8,4,0,289,290, - 5,7,0,0,290,33,1,0,0,0,291,292,5,18,0,0,292,299,5,4,0,0,293,294,5,17,0, - 0,294,295,5,4,0,0,295,296,3,8,4,0,296,297,5,5,0,0,297,300,1,0,0,0,298,300, - 3,8,4,0,299,293,1,0,0,0,299,298,1,0,0,0,300,301,1,0,0,0,301,302,5,5,0,0, - 302,309,5,4,0,0,303,304,5,17,0,0,304,305,5,4,0,0,305,306,3,8,4,0,306,307, - 5,5,0,0,307,310,1,0,0,0,308,310,3,8,4,0,309,303,1,0,0,0,309,308,1,0,0,0, - 310,311,1,0,0,0,311,312,5,6,0,0,312,313,3,8,4,0,313,314,5,7,0,0,314,315, - 5,5,0,0,315,316,5,6,0,0,316,317,3,58,29,0,317,318,5,7,0,0,318,35,1,0,0, - 0,319,320,5,18,0,0,320,327,5,4,0,0,321,322,5,17,0,0,322,323,5,4,0,0,323, - 324,3,8,4,0,324,325,5,5,0,0,325,328,1,0,0,0,326,328,3,8,4,0,327,321,1,0, - 0,0,327,326,1,0,0,0,328,335,1,0,0,0,329,330,5,54,0,0,330,331,5,4,0,0,331, - 332,3,10,5,0,332,333,5,5,0,0,333,336,1,0,0,0,334,336,5,62,0,0,335,329,1, - 0,0,0,335,334,1,0,0,0,336,337,1,0,0,0,337,338,5,5,0,0,338,345,5,4,0,0,339, - 340,5,17,0,0,340,341,5,4,0,0,341,342,3,8,4,0,342,343,5,5,0,0,343,346,1, - 0,0,0,344,346,3,8,4,0,345,339,1,0,0,0,345,344,1,0,0,0,346,347,1,0,0,0,347, - 348,5,6,0,0,348,349,3,8,4,0,349,356,5,7,0,0,350,351,5,54,0,0,351,352,5, - 4,0,0,352,353,3,10,5,0,353,354,5,5,0,0,354,357,1,0,0,0,355,357,5,62,0,0, - 356,350,1,0,0,0,356,355,1,0,0,0,357,358,1,0,0,0,358,359,5,5,0,0,359,360, - 5,6,0,0,360,361,3,58,29,0,361,362,5,7,0,0,362,37,1,0,0,0,363,364,3,8,4, - 0,364,365,5,55,0,0,365,366,3,58,29,0,366,374,1,0,0,0,367,368,3,58,29,0, - 368,369,7,3,0,0,369,370,3,8,4,0,370,371,7,3,0,0,371,372,3,58,29,0,372,374, - 1,0,0,0,373,363,1,0,0,0,373,367,1,0,0,0,374,39,1,0,0,0,375,378,3,48,24, - 0,376,378,3,50,25,0,377,375,1,0,0,0,377,376,1,0,0,0,378,41,1,0,0,0,379, - 382,3,8,4,0,380,381,5,60,0,0,381,383,3,8,4,0,382,380,1,0,0,0,383,384,1, - 0,0,0,384,382,1,0,0,0,384,385,1,0,0,0,385,43,1,0,0,0,386,387,3,8,4,0,387, - 390,7,4,0,0,388,391,3,10,5,0,389,391,3,12,6,0,390,388,1,0,0,0,390,389,1, - 0,0,0,391,45,1,0,0,0,392,395,3,44,22,0,393,394,5,60,0,0,394,396,3,44,22, - 0,395,393,1,0,0,0,396,397,1,0,0,0,397,395,1,0,0,0,397,398,1,0,0,0,398,47, - 1,0,0,0,399,400,3,58,29,0,400,401,7,5,0,0,401,402,3,58,29,0,402,49,1,0, - 0,0,403,404,3,58,29,0,404,405,7,5,0,0,405,406,3,58,29,0,406,407,7,5,0,0, - 407,408,3,58,29,0,408,51,1,0,0,0,409,414,3,58,29,0,410,411,5,67,0,0,411, - 413,3,58,29,0,412,410,1,0,0,0,413,416,1,0,0,0,414,412,1,0,0,0,414,415,1, - 0,0,0,415,53,1,0,0,0,416,414,1,0,0,0,417,418,3,8,4,0,418,419,5,6,0,0,419, - 424,3,38,19,0,420,421,5,60,0,0,421,423,3,38,19,0,422,420,1,0,0,0,423,426, - 1,0,0,0,424,422,1,0,0,0,424,425,1,0,0,0,425,427,1,0,0,0,426,424,1,0,0,0, - 427,432,5,7,0,0,428,429,5,71,0,0,429,430,3,10,5,0,430,431,5,71,0,0,431, - 433,1,0,0,0,432,428,1,0,0,0,432,433,1,0,0,0,433,55,1,0,0,0,434,435,5,17, - 0,0,435,436,5,4,0,0,436,437,3,8,4,0,437,438,5,5,0,0,438,441,1,0,0,0,439, - 441,3,8,4,0,440,434,1,0,0,0,440,439,1,0,0,0,441,442,1,0,0,0,442,443,5,6, - 0,0,443,448,3,58,29,0,444,445,5,60,0,0,445,447,3,58,29,0,446,444,1,0,0, - 0,447,450,1,0,0,0,448,446,1,0,0,0,448,449,1,0,0,0,449,451,1,0,0,0,450,448, - 1,0,0,0,451,452,5,7,0,0,452,57,1,0,0,0,453,454,6,29,-1,0,454,455,3,8,4, - 0,455,456,5,70,0,0,456,583,1,0,0,0,457,458,3,8,4,0,458,459,7,2,0,0,459, - 460,5,69,0,0,460,583,1,0,0,0,461,462,3,8,4,0,462,463,5,54,0,0,463,464,5, - 4,0,0,464,465,3,58,29,0,465,466,5,5,0,0,466,467,5,69,0,0,467,583,1,0,0, - 0,468,583,5,23,0,0,469,470,5,22,0,0,470,471,5,4,0,0,471,472,3,58,29,0,472, - 473,5,5,0,0,473,583,1,0,0,0,474,475,5,65,0,0,475,480,3,52,26,0,476,477, - 5,68,0,0,477,479,3,52,26,0,478,476,1,0,0,0,479,482,1,0,0,0,480,478,1,0, - 0,0,480,481,1,0,0,0,481,483,1,0,0,0,482,480,1,0,0,0,483,484,5,66,0,0,484, - 583,1,0,0,0,485,583,3,28,14,0,486,583,3,30,15,0,487,583,3,32,16,0,488,583, - 3,34,17,0,489,583,3,36,18,0,490,492,5,28,0,0,491,490,1,0,0,0,491,492,1, - 0,0,0,492,493,1,0,0,0,493,494,5,43,0,0,494,495,5,6,0,0,495,496,3,58,29, - 0,496,497,5,7,0,0,497,583,1,0,0,0,498,500,5,28,0,0,499,498,1,0,0,0,499, - 500,1,0,0,0,500,501,1,0,0,0,501,502,5,44,0,0,502,503,5,6,0,0,503,504,3, - 58,29,0,504,505,5,7,0,0,505,583,1,0,0,0,506,507,5,45,0,0,507,508,5,4,0, - 0,508,509,3,58,29,0,509,510,5,5,0,0,510,511,5,6,0,0,511,512,3,58,29,0,512, - 513,5,7,0,0,513,583,1,0,0,0,514,515,7,6,0,0,515,516,5,6,0,0,516,517,3,58, - 29,0,517,518,5,7,0,0,518,583,1,0,0,0,519,520,5,9,0,0,520,521,3,58,29,0, - 521,522,5,9,0,0,522,583,1,0,0,0,523,524,5,8,0,0,524,525,3,58,29,0,525,526, - 5,8,0,0,526,583,1,0,0,0,527,583,3,12,6,0,528,583,3,10,5,0,529,530,5,53, - 0,0,530,583,3,58,29,30,531,532,5,18,0,0,532,533,5,4,0,0,533,534,3,58,29, - 0,534,535,5,5,0,0,535,536,5,4,0,0,536,537,3,58,29,0,537,538,5,5,0,0,538, - 583,1,0,0,0,539,583,5,19,0,0,540,583,3,8,4,0,541,583,3,54,27,0,542,583, - 3,56,28,0,543,583,5,12,0,0,544,545,5,6,0,0,545,546,3,58,29,0,546,547,5, - 7,0,0,547,583,1,0,0,0,548,549,3,10,5,0,549,550,3,58,29,12,550,583,1,0,0, - 0,551,552,3,12,6,0,552,553,3,58,29,11,553,583,1,0,0,0,554,555,5,12,0,0, - 555,583,3,58,29,10,556,559,5,26,0,0,557,558,5,4,0,0,558,560,5,5,0,0,559, - 557,1,0,0,0,559,560,1,0,0,0,560,583,1,0,0,0,561,562,5,17,0,0,562,563,5, - 4,0,0,563,564,3,58,29,0,564,565,5,5,0,0,565,567,1,0,0,0,566,561,1,0,0,0, - 566,567,1,0,0,0,567,571,1,0,0,0,568,572,5,61,0,0,569,572,3,10,5,0,570,572, - 5,55,0,0,571,568,1,0,0,0,571,569,1,0,0,0,571,570,1,0,0,0,571,572,1,0,0, - 0,572,573,1,0,0,0,573,574,5,17,0,0,574,575,5,4,0,0,575,576,3,58,29,0,576, - 580,5,5,0,0,577,581,5,61,0,0,578,581,3,10,5,0,579,581,5,55,0,0,580,577, - 1,0,0,0,580,578,1,0,0,0,580,579,1,0,0,0,580,581,1,0,0,0,581,583,1,0,0,0, - 582,453,1,0,0,0,582,457,1,0,0,0,582,461,1,0,0,0,582,468,1,0,0,0,582,469, - 1,0,0,0,582,474,1,0,0,0,582,485,1,0,0,0,582,486,1,0,0,0,582,487,1,0,0,0, - 582,488,1,0,0,0,582,489,1,0,0,0,582,491,1,0,0,0,582,499,1,0,0,0,582,506, - 1,0,0,0,582,514,1,0,0,0,582,519,1,0,0,0,582,523,1,0,0,0,582,527,1,0,0,0, - 582,528,1,0,0,0,582,529,1,0,0,0,582,531,1,0,0,0,582,539,1,0,0,0,582,540, - 1,0,0,0,582,541,1,0,0,0,582,542,1,0,0,0,582,543,1,0,0,0,582,544,1,0,0,0, - 582,548,1,0,0,0,582,551,1,0,0,0,582,554,1,0,0,0,582,556,1,0,0,0,582,566, - 1,0,0,0,583,648,1,0,0,0,584,585,10,29,0,0,585,586,5,21,0,0,586,647,3,58, - 29,30,587,588,10,28,0,0,588,589,5,20,0,0,589,647,3,58,29,29,590,591,10, - 25,0,0,591,592,5,53,0,0,592,647,3,58,29,26,593,594,10,24,0,0,594,595,5, - 52,0,0,595,647,3,58,29,25,596,597,10,51,0,0,597,647,7,2,0,0,598,599,10, - 50,0,0,599,600,5,54,0,0,600,601,5,4,0,0,601,602,3,58,29,0,602,603,5,5,0, - 0,603,647,1,0,0,0,604,605,10,49,0,0,605,606,5,10,0,0,606,607,5,4,0,0,607, - 608,3,58,29,0,608,609,5,60,0,0,609,610,3,58,29,0,610,611,5,5,0,0,611,647, - 1,0,0,0,612,613,10,48,0,0,613,647,5,27,0,0,614,615,10,47,0,0,615,647,5, - 11,0,0,616,617,10,18,0,0,617,618,5,10,0,0,618,619,5,4,0,0,619,647,5,5,0, - 0,620,621,10,17,0,0,621,622,5,54,0,0,622,623,5,4,0,0,623,647,5,5,0,0,624, - 625,10,16,0,0,625,647,3,8,4,0,626,627,10,15,0,0,627,647,3,10,5,0,628,629, - 10,14,0,0,629,647,3,12,6,0,630,631,10,13,0,0,631,647,5,12,0,0,632,633,10, - 9,0,0,633,647,3,54,27,0,634,635,10,8,0,0,635,647,3,56,28,0,636,637,10,7, - 0,0,637,647,3,28,14,0,638,639,10,6,0,0,639,647,3,30,15,0,640,641,10,5,0, - 0,641,647,3,32,16,0,642,643,10,4,0,0,643,647,3,34,17,0,644,645,10,3,0,0, - 645,647,3,36,18,0,646,584,1,0,0,0,646,587,1,0,0,0,646,590,1,0,0,0,646,593, - 1,0,0,0,646,596,1,0,0,0,646,598,1,0,0,0,646,604,1,0,0,0,646,612,1,0,0,0, - 646,614,1,0,0,0,646,616,1,0,0,0,646,620,1,0,0,0,646,624,1,0,0,0,646,626, - 1,0,0,0,646,628,1,0,0,0,646,630,1,0,0,0,646,632,1,0,0,0,646,634,1,0,0,0, - 646,636,1,0,0,0,646,638,1,0,0,0,646,640,1,0,0,0,646,642,1,0,0,0,646,644, - 1,0,0,0,647,650,1,0,0,0,648,646,1,0,0,0,648,649,1,0,0,0,649,59,1,0,0,0, - 650,648,1,0,0,0,651,652,7,7,0,0,652,653,3,66,33,0,653,654,7,8,0,0,654,61, - 1,0,0,0,655,656,7,7,0,0,656,657,7,9,0,0,657,658,7,10,0,0,658,659,7,9,0, - 0,659,660,7,8,0,0,660,63,1,0,0,0,661,662,5,79,0,0,662,663,5,89,0,0,663, - 664,7,9,0,0,664,665,5,90,0,0,665,666,5,89,0,0,666,667,5,92,0,0,667,670, - 5,90,0,0,668,670,5,80,0,0,669,661,1,0,0,0,669,668,1,0,0,0,670,65,1,0,0, - 0,671,672,6,33,-1,0,672,673,5,83,0,0,673,674,5,89,0,0,674,675,3,58,29,0, - 675,676,5,90,0,0,676,694,1,0,0,0,677,678,5,79,0,0,678,681,5,89,0,0,679, - 682,3,66,33,0,680,682,5,91,0,0,681,679,1,0,0,0,681,680,1,0,0,0,682,683, - 1,0,0,0,683,684,5,90,0,0,684,685,5,89,0,0,685,686,3,66,33,0,686,687,5,90, - 0,0,687,694,1,0,0,0,688,694,5,86,0,0,689,690,5,87,0,0,690,691,3,66,33,0, - 691,692,5,88,0,0,692,694,1,0,0,0,693,671,1,0,0,0,693,677,1,0,0,0,693,688, - 1,0,0,0,693,689,1,0,0,0,694,717,1,0,0,0,695,696,10,4,0,0,696,697,5,81,0, - 0,697,716,3,66,33,5,698,699,10,9,0,0,699,700,5,85,0,0,700,716,5,92,0,0, - 701,702,10,8,0,0,702,703,5,85,0,0,703,704,5,89,0,0,704,705,5,92,0,0,705, - 716,5,90,0,0,706,707,10,7,0,0,707,708,5,85,0,0,708,716,3,64,32,0,709,710, - 10,6,0,0,710,711,5,85,0,0,711,712,5,89,0,0,712,713,3,64,32,0,713,714,5, - 90,0,0,714,716,1,0,0,0,715,695,1,0,0,0,715,698,1,0,0,0,715,701,1,0,0,0, - 715,706,1,0,0,0,715,709,1,0,0,0,716,719,1,0,0,0,717,715,1,0,0,0,717,718, - 1,0,0,0,718,67,1,0,0,0,719,717,1,0,0,0,54,85,99,102,115,131,144,149,156, - 161,166,173,179,189,194,199,207,217,229,243,254,266,274,285,299,309,327, - 335,345,356,373,377,384,390,397,414,424,432,440,448,480,491,499,559,566, - 571,580,582,646,648,669,681,693,715,717]; + public static readonly _serializedATN: number[] = [4,1,101,744,2,0,7,0, + 2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9, + 2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2, + 17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24, + 7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7, + 31,2,32,7,32,2,33,7,33,2,34,7,34,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, + 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,3,0,88,8,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,3,1,102,8,1,1,1,3,1,105,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,3,1,118,8,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1, + 2,1,2,1,2,1,2,3,2,134,8,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,3, + 2,147,8,2,1,3,5,3,150,8,3,10,3,12,3,153,9,3,1,3,1,3,5,3,157,8,3,10,3,12, + 3,160,9,3,4,3,162,8,3,11,3,12,3,163,1,4,1,4,1,5,3,5,169,8,5,1,5,1,5,1,6, + 1,6,1,6,3,6,176,8,6,1,6,1,6,1,7,1,7,3,7,182,8,7,1,7,1,7,1,7,1,8,1,8,1,8, + 4,8,190,8,8,11,8,12,8,191,1,9,1,9,1,9,3,9,197,8,9,1,10,1,10,1,10,3,10,202, + 8,10,1,11,1,11,1,11,1,11,1,12,1,12,3,12,210,8,12,1,12,1,12,1,12,1,12,1, + 12,1,12,5,12,218,8,12,10,12,12,12,221,9,12,1,12,1,12,1,13,1,13,1,13,1,13, + 1,13,1,13,1,14,3,14,232,8,14,1,14,1,14,1,14,1,14,1,14,1,15,1,15,1,15,1, + 15,1,15,1,15,1,15,3,15,246,8,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15, + 1,15,3,15,257,8,15,1,15,1,15,1,15,1,15,1,16,1,16,1,16,1,16,1,16,1,16,3, + 16,269,8,16,1,16,1,16,1,16,1,16,1,16,1,16,3,16,277,8,16,1,16,1,16,1,16, + 1,16,1,16,1,16,1,16,1,16,1,16,3,16,288,8,16,1,16,1,16,1,16,1,16,1,17,1, + 17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,3,17,307,8,17, + 1,17,1,17,1,17,1,17,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,3,18,321,8, + 18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,3,18,331,8,18,1,18,1,18,1,18, + 1,18,1,18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,3,19,349, + 8,19,1,19,1,19,1,19,1,19,1,19,1,19,3,19,357,8,19,1,19,1,19,1,19,1,19,1, + 19,1,19,1,19,1,19,3,19,367,8,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19, + 1,19,3,19,378,8,19,1,19,1,19,1,19,1,19,1,19,1,20,1,20,1,20,1,20,1,20,1, + 20,1,20,1,20,1,20,1,20,3,20,395,8,20,1,21,1,21,3,21,399,8,21,1,22,1,22, + 1,22,4,22,404,8,22,11,22,12,22,405,1,23,1,23,1,23,1,23,3,23,412,8,23,1, + 24,1,24,1,24,4,24,417,8,24,11,24,12,24,418,1,25,1,25,1,25,1,25,1,26,1,26, + 1,26,1,26,1,26,1,26,1,27,1,27,1,27,5,27,434,8,27,10,27,12,27,437,9,27,1, + 28,1,28,1,28,1,28,1,28,5,28,444,8,28,10,28,12,28,447,9,28,1,28,1,28,1,28, + 1,28,1,28,3,28,454,8,28,1,29,1,29,1,29,1,29,1,29,1,29,3,29,462,8,29,1,29, + 1,29,1,29,1,29,5,29,468,8,29,10,29,12,29,471,9,29,1,29,1,29,1,30,1,30,1, + 30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30, + 1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,5,30,500,8,30,10,30,12,30,503,9, + 30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,3,30,514,8,30,1,30,1,30, + 1,30,1,30,1,30,1,30,3,30,522,8,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1, + 30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30, + 1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1, + 30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30, + 1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,3,30,583,8,30,1,30,1,30,1,30,1, + 30,1,30,3,30,590,8,30,1,30,1,30,1,30,3,30,595,8,30,1,30,1,30,1,30,1,30, + 1,30,1,30,1,30,3,30,604,8,30,3,30,606,8,30,1,30,1,30,1,30,1,30,1,30,1,30, + 1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1, + 30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30, + 1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1, + 30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,5,30,670, + 8,30,10,30,12,30,673,9,30,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,32, + 1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,3,33,693,8,33,1,34,1,34,1, + 34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,3,34,705,8,34,1,34,1,34,1,34,1,34, + 1,34,1,34,1,34,1,34,1,34,1,34,3,34,717,8,34,1,34,1,34,1,34,1,34,1,34,1, + 34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34, + 5,34,739,8,34,10,34,12,34,742,9,34,1,34,2,151,158,2,60,68,35,0,2,4,6,8, + 10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56, + 58,60,62,64,66,68,0,11,1,0,32,44,1,0,16,17,1,0,64,65,2,0,58,58,60,60,1, + 0,26,27,1,0,58,61,1,0,48,49,1,0,1,2,1,0,79,80,1,0,93,94,2,0,84,84,86,86, + 843,0,87,1,0,0,0,2,101,1,0,0,0,4,119,1,0,0,0,6,151,1,0,0,0,8,165,1,0,0, + 0,10,168,1,0,0,0,12,175,1,0,0,0,14,181,1,0,0,0,16,186,1,0,0,0,18,193,1, + 0,0,0,20,198,1,0,0,0,22,203,1,0,0,0,24,209,1,0,0,0,26,224,1,0,0,0,28,231, + 1,0,0,0,30,245,1,0,0,0,32,268,1,0,0,0,34,293,1,0,0,0,36,312,1,0,0,0,38, + 340,1,0,0,0,40,394,1,0,0,0,42,398,1,0,0,0,44,400,1,0,0,0,46,407,1,0,0,0, + 48,413,1,0,0,0,50,420,1,0,0,0,52,424,1,0,0,0,54,430,1,0,0,0,56,438,1,0, + 0,0,58,461,1,0,0,0,60,605,1,0,0,0,62,674,1,0,0,0,64,678,1,0,0,0,66,692, + 1,0,0,0,68,716,1,0,0,0,70,88,3,14,7,0,71,88,3,16,8,0,72,88,3,18,9,0,73, + 88,3,20,10,0,74,88,3,22,11,0,75,88,3,62,31,0,76,88,3,10,5,0,77,88,3,8,4, + 0,78,88,3,44,22,0,79,88,3,46,23,0,80,88,3,48,24,0,81,88,3,60,30,0,82,88, + 3,42,21,0,83,88,3,24,12,0,84,88,3,6,3,0,85,88,3,2,1,0,86,88,3,4,2,0,87, + 70,1,0,0,0,87,71,1,0,0,0,87,72,1,0,0,0,87,73,1,0,0,0,87,74,1,0,0,0,87,75, + 1,0,0,0,87,76,1,0,0,0,87,77,1,0,0,0,87,78,1,0,0,0,87,79,1,0,0,0,87,80,1, + 0,0,0,87,81,1,0,0,0,87,82,1,0,0,0,87,83,1,0,0,0,87,84,1,0,0,0,87,85,1,0, + 0,0,87,86,1,0,0,0,87,88,1,0,0,0,88,89,1,0,0,0,89,90,5,0,0,1,90,1,1,0,0, + 0,91,92,5,6,0,0,92,93,3,60,30,0,93,94,5,62,0,0,94,95,3,60,30,0,95,96,5, + 7,0,0,96,102,1,0,0,0,97,98,3,60,30,0,98,99,5,62,0,0,99,100,3,60,30,0,100, + 102,1,0,0,0,101,91,1,0,0,0,101,97,1,0,0,0,102,104,1,0,0,0,103,105,5,31, + 0,0,104,103,1,0,0,0,104,105,1,0,0,0,105,106,1,0,0,0,106,117,5,57,0,0,107, + 108,5,6,0,0,108,109,3,62,31,0,109,110,5,62,0,0,110,111,3,62,31,0,111,112, + 5,7,0,0,112,118,1,0,0,0,113,114,3,62,31,0,114,115,5,62,0,0,115,116,3,62, + 31,0,116,118,1,0,0,0,117,107,1,0,0,0,117,113,1,0,0,0,117,118,1,0,0,0,118, + 3,1,0,0,0,119,120,5,6,0,0,120,121,3,60,30,0,121,122,5,62,0,0,122,123,3, + 60,30,0,123,124,5,7,0,0,124,125,1,0,0,0,125,126,5,73,0,0,126,127,5,6,0, + 0,127,128,3,40,20,0,128,133,5,7,0,0,129,130,5,73,0,0,130,131,3,10,5,0,131, + 132,5,73,0,0,132,134,1,0,0,0,133,129,1,0,0,0,133,134,1,0,0,0,134,135,1, + 0,0,0,135,146,5,57,0,0,136,137,5,6,0,0,137,138,3,62,31,0,138,139,5,62,0, + 0,139,140,3,62,31,0,140,141,5,7,0,0,141,147,1,0,0,0,142,143,3,62,31,0,143, + 144,5,62,0,0,144,145,3,62,31,0,145,147,1,0,0,0,146,136,1,0,0,0,146,142, + 1,0,0,0,146,147,1,0,0,0,147,5,1,0,0,0,148,150,9,0,0,0,149,148,1,0,0,0,150, + 153,1,0,0,0,151,152,1,0,0,0,151,149,1,0,0,0,152,161,1,0,0,0,153,151,1,0, + 0,0,154,158,3,64,32,0,155,157,9,0,0,0,156,155,1,0,0,0,157,160,1,0,0,0,158, + 159,1,0,0,0,158,156,1,0,0,0,159,162,1,0,0,0,160,158,1,0,0,0,161,154,1,0, + 0,0,162,163,1,0,0,0,163,161,1,0,0,0,163,164,1,0,0,0,164,7,1,0,0,0,165,166, + 5,73,0,0,166,9,1,0,0,0,167,169,5,55,0,0,168,167,1,0,0,0,168,169,1,0,0,0, + 169,170,1,0,0,0,170,171,5,66,0,0,171,11,1,0,0,0,172,176,3,10,5,0,173,176, + 5,12,0,0,174,176,3,8,4,0,175,172,1,0,0,0,175,173,1,0,0,0,175,174,1,0,0, + 0,176,177,1,0,0,0,177,178,3,62,31,0,178,13,1,0,0,0,179,182,3,8,4,0,180, + 182,5,12,0,0,181,179,1,0,0,0,181,180,1,0,0,0,182,183,1,0,0,0,183,184,5, + 57,0,0,184,185,3,60,30,0,185,15,1,0,0,0,186,189,3,14,7,0,187,188,5,62,0, + 0,188,190,3,14,7,0,189,187,1,0,0,0,190,191,1,0,0,0,191,189,1,0,0,0,191, + 192,1,0,0,0,192,17,1,0,0,0,193,194,3,14,7,0,194,196,5,57,0,0,195,197,3, + 62,31,0,196,195,1,0,0,0,196,197,1,0,0,0,197,19,1,0,0,0,198,199,3,60,30, + 0,199,201,5,57,0,0,200,202,3,62,31,0,201,200,1,0,0,0,201,202,1,0,0,0,202, + 21,1,0,0,0,203,204,3,60,30,0,204,205,5,57,0,0,205,206,3,60,30,0,206,23, + 1,0,0,0,207,210,3,8,4,0,208,210,5,12,0,0,209,207,1,0,0,0,209,208,1,0,0, + 0,210,211,1,0,0,0,211,212,5,57,0,0,212,213,3,8,4,0,213,214,5,6,0,0,214, + 219,3,26,13,0,215,216,5,62,0,0,216,218,3,26,13,0,217,215,1,0,0,0,218,221, + 1,0,0,0,219,217,1,0,0,0,219,220,1,0,0,0,220,222,1,0,0,0,221,219,1,0,0,0, + 222,223,5,7,0,0,223,25,1,0,0,0,224,225,5,6,0,0,225,226,3,60,30,0,226,227, + 5,62,0,0,227,228,3,42,21,0,228,229,5,7,0,0,229,27,1,0,0,0,230,232,5,30, + 0,0,231,230,1,0,0,0,231,232,1,0,0,0,232,233,1,0,0,0,233,234,7,0,0,0,234, + 235,5,6,0,0,235,236,3,60,30,0,236,237,5,7,0,0,237,29,1,0,0,0,238,246,5, + 14,0,0,239,240,5,15,0,0,240,241,5,4,0,0,241,242,5,5,0,0,242,243,5,56,0, + 0,243,244,5,4,0,0,244,246,5,5,0,0,245,238,1,0,0,0,245,239,1,0,0,0,246,247, + 1,0,0,0,247,248,5,6,0,0,248,249,3,60,30,0,249,256,5,7,0,0,250,251,5,19, + 0,0,251,252,5,4,0,0,252,253,3,8,4,0,253,254,5,5,0,0,254,257,1,0,0,0,255, + 257,3,8,4,0,256,250,1,0,0,0,256,255,1,0,0,0,257,258,1,0,0,0,258,259,5,6, + 0,0,259,260,3,8,4,0,260,261,5,7,0,0,261,31,1,0,0,0,262,263,5,15,0,0,263, + 264,5,4,0,0,264,265,3,60,30,0,265,266,5,5,0,0,266,269,1,0,0,0,267,269,7, + 1,0,0,268,262,1,0,0,0,268,267,1,0,0,0,269,276,1,0,0,0,270,271,5,56,0,0, + 271,272,5,4,0,0,272,273,3,60,30,0,273,274,5,5,0,0,274,277,1,0,0,0,275,277, + 7,2,0,0,276,270,1,0,0,0,276,275,1,0,0,0,277,278,1,0,0,0,278,279,5,6,0,0, + 279,280,3,60,30,0,280,287,5,7,0,0,281,282,5,19,0,0,282,283,5,4,0,0,283, + 284,3,8,4,0,284,285,5,5,0,0,285,288,1,0,0,0,286,288,3,8,4,0,287,281,1,0, + 0,0,287,286,1,0,0,0,288,289,1,0,0,0,289,290,5,6,0,0,290,291,3,8,4,0,291, + 292,5,7,0,0,292,33,1,0,0,0,293,294,5,18,0,0,294,295,5,4,0,0,295,296,3,8, + 4,0,296,297,5,57,0,0,297,298,3,60,30,0,298,299,5,5,0,0,299,306,1,0,0,0, + 300,301,5,56,0,0,301,302,5,4,0,0,302,303,3,60,30,0,303,304,5,5,0,0,304, + 307,1,0,0,0,305,307,7,2,0,0,306,300,1,0,0,0,306,305,1,0,0,0,307,308,1,0, + 0,0,308,309,5,6,0,0,309,310,3,60,30,0,310,311,5,7,0,0,311,35,1,0,0,0,312, + 313,5,20,0,0,313,320,5,4,0,0,314,315,5,19,0,0,315,316,5,4,0,0,316,317,3, + 8,4,0,317,318,5,5,0,0,318,321,1,0,0,0,319,321,3,8,4,0,320,314,1,0,0,0,320, + 319,1,0,0,0,321,322,1,0,0,0,322,323,5,5,0,0,323,330,5,4,0,0,324,325,5,19, + 0,0,325,326,5,4,0,0,326,327,3,8,4,0,327,328,5,5,0,0,328,331,1,0,0,0,329, + 331,3,8,4,0,330,324,1,0,0,0,330,329,1,0,0,0,331,332,1,0,0,0,332,333,5,6, + 0,0,333,334,3,8,4,0,334,335,5,7,0,0,335,336,5,5,0,0,336,337,5,6,0,0,337, + 338,3,60,30,0,338,339,5,7,0,0,339,37,1,0,0,0,340,341,5,20,0,0,341,348,5, + 4,0,0,342,343,5,19,0,0,343,344,5,4,0,0,344,345,3,8,4,0,345,346,5,5,0,0, + 346,349,1,0,0,0,347,349,3,8,4,0,348,342,1,0,0,0,348,347,1,0,0,0,349,356, + 1,0,0,0,350,351,5,56,0,0,351,352,5,4,0,0,352,353,3,10,5,0,353,354,5,5,0, + 0,354,357,1,0,0,0,355,357,5,64,0,0,356,350,1,0,0,0,356,355,1,0,0,0,357, + 358,1,0,0,0,358,359,5,5,0,0,359,366,5,4,0,0,360,361,5,19,0,0,361,362,5, + 4,0,0,362,363,3,8,4,0,363,364,5,5,0,0,364,367,1,0,0,0,365,367,3,8,4,0,366, + 360,1,0,0,0,366,365,1,0,0,0,367,368,1,0,0,0,368,369,5,6,0,0,369,370,3,8, + 4,0,370,377,5,7,0,0,371,372,5,56,0,0,372,373,5,4,0,0,373,374,3,10,5,0,374, + 375,5,5,0,0,375,378,1,0,0,0,376,378,5,64,0,0,377,371,1,0,0,0,377,376,1, + 0,0,0,378,379,1,0,0,0,379,380,5,5,0,0,380,381,5,6,0,0,381,382,3,60,30,0, + 382,383,5,7,0,0,383,39,1,0,0,0,384,385,3,8,4,0,385,386,5,57,0,0,386,387, + 3,60,30,0,387,395,1,0,0,0,388,389,3,60,30,0,389,390,7,3,0,0,390,391,3,8, + 4,0,391,392,7,3,0,0,392,393,3,60,30,0,393,395,1,0,0,0,394,384,1,0,0,0,394, + 388,1,0,0,0,395,41,1,0,0,0,396,399,3,50,25,0,397,399,3,52,26,0,398,396, + 1,0,0,0,398,397,1,0,0,0,399,43,1,0,0,0,400,403,3,8,4,0,401,402,5,62,0,0, + 402,404,3,8,4,0,403,401,1,0,0,0,404,405,1,0,0,0,405,403,1,0,0,0,405,406, + 1,0,0,0,406,45,1,0,0,0,407,408,3,8,4,0,408,411,7,4,0,0,409,412,3,10,5,0, + 410,412,3,12,6,0,411,409,1,0,0,0,411,410,1,0,0,0,412,47,1,0,0,0,413,416, + 3,46,23,0,414,415,5,62,0,0,415,417,3,46,23,0,416,414,1,0,0,0,417,418,1, + 0,0,0,418,416,1,0,0,0,418,419,1,0,0,0,419,49,1,0,0,0,420,421,3,60,30,0, + 421,422,7,5,0,0,422,423,3,60,30,0,423,51,1,0,0,0,424,425,3,60,30,0,425, + 426,7,5,0,0,426,427,3,60,30,0,427,428,7,5,0,0,428,429,3,60,30,0,429,53, + 1,0,0,0,430,435,3,60,30,0,431,432,5,69,0,0,432,434,3,60,30,0,433,431,1, + 0,0,0,434,437,1,0,0,0,435,433,1,0,0,0,435,436,1,0,0,0,436,55,1,0,0,0,437, + 435,1,0,0,0,438,439,3,8,4,0,439,440,5,6,0,0,440,445,3,40,20,0,441,442,5, + 62,0,0,442,444,3,40,20,0,443,441,1,0,0,0,444,447,1,0,0,0,445,443,1,0,0, + 0,445,446,1,0,0,0,446,448,1,0,0,0,447,445,1,0,0,0,448,453,5,7,0,0,449,450, + 5,73,0,0,450,451,3,10,5,0,451,452,5,73,0,0,452,454,1,0,0,0,453,449,1,0, + 0,0,453,454,1,0,0,0,454,57,1,0,0,0,455,456,5,19,0,0,456,457,5,4,0,0,457, + 458,3,8,4,0,458,459,5,5,0,0,459,462,1,0,0,0,460,462,3,8,4,0,461,455,1,0, + 0,0,461,460,1,0,0,0,462,463,1,0,0,0,463,464,5,6,0,0,464,469,3,60,30,0,465, + 466,5,62,0,0,466,468,3,60,30,0,467,465,1,0,0,0,468,471,1,0,0,0,469,467, + 1,0,0,0,469,470,1,0,0,0,470,472,1,0,0,0,471,469,1,0,0,0,472,473,5,7,0,0, + 473,59,1,0,0,0,474,475,6,30,-1,0,475,476,3,8,4,0,476,477,5,72,0,0,477,606, + 1,0,0,0,478,479,3,8,4,0,479,480,7,2,0,0,480,481,5,71,0,0,481,606,1,0,0, + 0,482,483,3,8,4,0,483,484,5,56,0,0,484,485,5,4,0,0,485,486,3,60,30,0,486, + 487,5,5,0,0,487,488,5,71,0,0,488,606,1,0,0,0,489,606,5,25,0,0,490,491,5, + 24,0,0,491,492,5,4,0,0,492,493,3,60,30,0,493,494,5,5,0,0,494,606,1,0,0, + 0,495,496,5,67,0,0,496,501,3,54,27,0,497,498,5,70,0,0,498,500,3,54,27,0, + 499,497,1,0,0,0,500,503,1,0,0,0,501,499,1,0,0,0,501,502,1,0,0,0,502,504, + 1,0,0,0,503,501,1,0,0,0,504,505,5,68,0,0,505,606,1,0,0,0,506,606,3,28,14, + 0,507,606,3,30,15,0,508,606,3,32,16,0,509,606,3,36,18,0,510,606,3,38,19, + 0,511,606,3,34,17,0,512,514,5,30,0,0,513,512,1,0,0,0,513,514,1,0,0,0,514, + 515,1,0,0,0,515,516,5,45,0,0,516,517,5,6,0,0,517,518,3,60,30,0,518,519, + 5,7,0,0,519,606,1,0,0,0,520,522,5,30,0,0,521,520,1,0,0,0,521,522,1,0,0, + 0,522,523,1,0,0,0,523,524,5,46,0,0,524,525,5,6,0,0,525,526,3,60,30,0,526, + 527,5,7,0,0,527,606,1,0,0,0,528,529,5,47,0,0,529,530,5,4,0,0,530,531,3, + 60,30,0,531,532,5,5,0,0,532,533,5,6,0,0,533,534,3,60,30,0,534,535,5,7,0, + 0,535,606,1,0,0,0,536,537,7,6,0,0,537,538,5,6,0,0,538,539,3,60,30,0,539, + 540,5,7,0,0,540,606,1,0,0,0,541,542,5,9,0,0,542,543,3,60,30,0,543,544,5, + 9,0,0,544,606,1,0,0,0,545,546,5,8,0,0,546,547,3,60,30,0,547,548,5,8,0,0, + 548,606,1,0,0,0,549,606,3,12,6,0,550,606,3,10,5,0,551,552,5,55,0,0,552, + 606,3,60,30,31,553,554,5,20,0,0,554,555,5,4,0,0,555,556,3,60,30,0,556,557, + 5,5,0,0,557,558,5,4,0,0,558,559,3,60,30,0,559,560,5,5,0,0,560,606,1,0,0, + 0,561,606,5,21,0,0,562,606,3,8,4,0,563,606,3,56,28,0,564,606,3,58,29,0, + 565,606,5,12,0,0,566,606,5,13,0,0,567,568,5,6,0,0,568,569,3,60,30,0,569, + 570,5,7,0,0,570,606,1,0,0,0,571,572,3,10,5,0,572,573,3,60,30,12,573,606, + 1,0,0,0,574,575,3,12,6,0,575,576,3,60,30,11,576,606,1,0,0,0,577,578,5,12, + 0,0,578,606,3,60,30,10,579,582,5,28,0,0,580,581,5,4,0,0,581,583,5,5,0,0, + 582,580,1,0,0,0,582,583,1,0,0,0,583,606,1,0,0,0,584,585,5,19,0,0,585,586, + 5,4,0,0,586,587,3,60,30,0,587,588,5,5,0,0,588,590,1,0,0,0,589,584,1,0,0, + 0,589,590,1,0,0,0,590,594,1,0,0,0,591,595,5,63,0,0,592,595,3,10,5,0,593, + 595,5,57,0,0,594,591,1,0,0,0,594,592,1,0,0,0,594,593,1,0,0,0,594,595,1, + 0,0,0,595,596,1,0,0,0,596,597,5,19,0,0,597,598,5,4,0,0,598,599,3,60,30, + 0,599,603,5,5,0,0,600,604,5,63,0,0,601,604,3,10,5,0,602,604,5,57,0,0,603, + 600,1,0,0,0,603,601,1,0,0,0,603,602,1,0,0,0,603,604,1,0,0,0,604,606,1,0, + 0,0,605,474,1,0,0,0,605,478,1,0,0,0,605,482,1,0,0,0,605,489,1,0,0,0,605, + 490,1,0,0,0,605,495,1,0,0,0,605,506,1,0,0,0,605,507,1,0,0,0,605,508,1,0, + 0,0,605,509,1,0,0,0,605,510,1,0,0,0,605,511,1,0,0,0,605,513,1,0,0,0,605, + 521,1,0,0,0,605,528,1,0,0,0,605,536,1,0,0,0,605,541,1,0,0,0,605,545,1,0, + 0,0,605,549,1,0,0,0,605,550,1,0,0,0,605,551,1,0,0,0,605,553,1,0,0,0,605, + 561,1,0,0,0,605,562,1,0,0,0,605,563,1,0,0,0,605,564,1,0,0,0,605,565,1,0, + 0,0,605,566,1,0,0,0,605,567,1,0,0,0,605,571,1,0,0,0,605,574,1,0,0,0,605, + 577,1,0,0,0,605,579,1,0,0,0,605,589,1,0,0,0,606,671,1,0,0,0,607,608,10, + 30,0,0,608,609,5,23,0,0,609,670,3,60,30,31,610,611,10,29,0,0,611,612,5, + 22,0,0,612,670,3,60,30,30,613,614,10,26,0,0,614,615,5,55,0,0,615,670,3, + 60,30,27,616,617,10,25,0,0,617,618,5,54,0,0,618,670,3,60,30,26,619,620, + 10,53,0,0,620,670,7,2,0,0,621,622,10,52,0,0,622,623,5,56,0,0,623,624,5, + 4,0,0,624,625,3,60,30,0,625,626,5,5,0,0,626,670,1,0,0,0,627,628,10,51,0, + 0,628,629,5,10,0,0,629,630,5,4,0,0,630,631,3,60,30,0,631,632,5,62,0,0,632, + 633,3,60,30,0,633,634,5,5,0,0,634,670,1,0,0,0,635,636,10,50,0,0,636,670, + 5,29,0,0,637,638,10,49,0,0,638,670,5,11,0,0,639,640,10,18,0,0,640,641,5, + 10,0,0,641,642,5,4,0,0,642,670,5,5,0,0,643,644,10,17,0,0,644,645,5,56,0, + 0,645,646,5,4,0,0,646,670,5,5,0,0,647,648,10,16,0,0,648,670,3,8,4,0,649, + 650,10,15,0,0,650,670,3,10,5,0,651,652,10,14,0,0,652,670,3,12,6,0,653,654, + 10,13,0,0,654,670,5,12,0,0,655,656,10,9,0,0,656,670,3,56,28,0,657,658,10, + 8,0,0,658,670,3,58,29,0,659,660,10,7,0,0,660,670,3,28,14,0,661,662,10,6, + 0,0,662,670,3,30,15,0,663,664,10,5,0,0,664,670,3,32,16,0,665,666,10,4,0, + 0,666,670,3,36,18,0,667,668,10,3,0,0,668,670,3,38,19,0,669,607,1,0,0,0, + 669,610,1,0,0,0,669,613,1,0,0,0,669,616,1,0,0,0,669,619,1,0,0,0,669,621, + 1,0,0,0,669,627,1,0,0,0,669,635,1,0,0,0,669,637,1,0,0,0,669,639,1,0,0,0, + 669,643,1,0,0,0,669,647,1,0,0,0,669,649,1,0,0,0,669,651,1,0,0,0,669,653, + 1,0,0,0,669,655,1,0,0,0,669,657,1,0,0,0,669,659,1,0,0,0,669,661,1,0,0,0, + 669,663,1,0,0,0,669,665,1,0,0,0,669,667,1,0,0,0,670,673,1,0,0,0,671,669, + 1,0,0,0,671,672,1,0,0,0,672,61,1,0,0,0,673,671,1,0,0,0,674,675,7,7,0,0, + 675,676,3,68,34,0,676,677,7,8,0,0,677,63,1,0,0,0,678,679,7,7,0,0,679,680, + 7,9,0,0,680,681,7,10,0,0,681,682,7,9,0,0,682,683,7,8,0,0,683,65,1,0,0,0, + 684,685,5,81,0,0,685,686,5,91,0,0,686,687,7,9,0,0,687,688,5,92,0,0,688, + 689,5,91,0,0,689,690,5,94,0,0,690,693,5,92,0,0,691,693,5,82,0,0,692,684, + 1,0,0,0,692,691,1,0,0,0,693,67,1,0,0,0,694,695,6,34,-1,0,695,696,5,85,0, + 0,696,697,5,91,0,0,697,698,3,60,30,0,698,699,5,92,0,0,699,717,1,0,0,0,700, + 701,5,81,0,0,701,704,5,91,0,0,702,705,3,68,34,0,703,705,5,93,0,0,704,702, + 1,0,0,0,704,703,1,0,0,0,705,706,1,0,0,0,706,707,5,92,0,0,707,708,5,91,0, + 0,708,709,3,68,34,0,709,710,5,92,0,0,710,717,1,0,0,0,711,717,5,88,0,0,712, + 713,5,89,0,0,713,714,3,68,34,0,714,715,5,90,0,0,715,717,1,0,0,0,716,694, + 1,0,0,0,716,700,1,0,0,0,716,711,1,0,0,0,716,712,1,0,0,0,717,740,1,0,0,0, + 718,719,10,4,0,0,719,720,5,83,0,0,720,739,3,68,34,5,721,722,10,9,0,0,722, + 723,5,87,0,0,723,739,5,94,0,0,724,725,10,8,0,0,725,726,5,87,0,0,726,727, + 5,91,0,0,727,728,5,94,0,0,728,739,5,92,0,0,729,730,10,7,0,0,730,731,5,87, + 0,0,731,739,3,66,33,0,732,733,10,6,0,0,733,734,5,87,0,0,734,735,5,91,0, + 0,735,736,3,66,33,0,736,737,5,92,0,0,737,739,1,0,0,0,738,718,1,0,0,0,738, + 721,1,0,0,0,738,724,1,0,0,0,738,729,1,0,0,0,738,732,1,0,0,0,739,742,1,0, + 0,0,740,738,1,0,0,0,740,741,1,0,0,0,741,69,1,0,0,0,742,740,1,0,0,0,55,87, + 101,104,117,133,146,151,158,163,168,175,181,191,196,201,209,219,231,245, + 256,268,276,287,306,320,330,348,356,366,377,394,398,405,411,418,435,445, + 453,461,469,501,513,521,582,589,594,603,605,669,671,692,704,716,738,740]; private static __ATN: ATN; public static get _ATN(): ATN { @@ -4481,6 +4591,70 @@ export class Integral_cmdContext extends ParserRuleContext { } +export class Summation_cmdContext extends ParserRuleContext { + public _start_expr!: ExprContext; + public _end_expr!: ExprContext; + public _operand_expr!: ExprContext; + constructor(parser?: LatexParser, parent?: ParserRuleContext, invokingState?: number) { + super(parent, invokingState); + this.parser = parser; + } + public L_PAREN(): TerminalNode { + return this.getToken(LatexParser.L_PAREN, 0); + } + public R_PAREN(): TerminalNode { + return this.getToken(LatexParser.R_PAREN, 0); + } + public expr_list(): ExprContext[] { + return this.getTypedRuleContexts(ExprContext) as ExprContext[]; + } + public expr(i: number): ExprContext { + return this.getTypedRuleContext(ExprContext, i) as ExprContext; + } + public CMD_SUM_UNDERSCORE(): TerminalNode { + return this.getToken(LatexParser.CMD_SUM_UNDERSCORE, 0); + } + public L_BRACE_list(): TerminalNode[] { + return this.getTokens(LatexParser.L_BRACE); + } + public L_BRACE(i: number): TerminalNode { + return this.getToken(LatexParser.L_BRACE, i); + } + public id(): IdContext { + return this.getTypedRuleContext(IdContext, 0) as IdContext; + } + public EQ(): TerminalNode { + return this.getToken(LatexParser.EQ, 0); + } + public R_BRACE_list(): TerminalNode[] { + return this.getTokens(LatexParser.R_BRACE); + } + public R_BRACE(i: number): TerminalNode { + return this.getToken(LatexParser.R_BRACE, i); + } + public CARET_SINGLE_CHAR_ID(): TerminalNode { + return this.getToken(LatexParser.CARET_SINGLE_CHAR_ID, 0); + } + public CARET_SINGLE_CHAR_NUMBER(): TerminalNode { + return this.getToken(LatexParser.CARET_SINGLE_CHAR_NUMBER, 0); + } + public CARET(): TerminalNode { + return this.getToken(LatexParser.CARET, 0); + } + public get ruleIndex(): number { + return LatexParser.RULE_summation_cmd; + } + // @Override + public accept(visitor: LatexParserVisitor): Result { + if (visitor.visitSummation_cmd) { + return visitor.visitSummation_cmd(this); + } else { + return visitor.visitChildren(this); + } + } +} + + export class Derivative_cmdContext extends ParserRuleContext { public _MATHRM_0!: Token; public _MATHRM_1!: Token; @@ -5326,6 +5500,23 @@ export class SubExprContext extends ExprContext { } } } +export class SummationContext extends ExprContext { + constructor(parser: LatexParser, ctx: ExprContext) { + super(parser, ctx.parentCtx, ctx.invokingState); + super.copyFrom(ctx); + } + public summation_cmd(): Summation_cmdContext { + return this.getTypedRuleContext(Summation_cmdContext, 0) as Summation_cmdContext; + } + // @Override + public accept(visitor: LatexParserVisitor): Result { + if (visitor.visitSummation) { + return visitor.visitSummation(this); + } else { + return visitor.visitChildren(this); + } + } +} export class NormContext extends ExprContext { constructor(parser: LatexParser, ctx: ExprContext) { super(parser, ctx.parentCtx, ctx.invokingState); @@ -5665,6 +5856,23 @@ export class BaseLogContext extends ExprContext { } } } +export class InfinityExprContext extends ExprContext { + constructor(parser: LatexParser, ctx: ExprContext) { + super(parser, ctx.parentCtx, ctx.invokingState); + super.copyFrom(ctx); + } + public INFINITY(): TerminalNode { + return this.getToken(LatexParser.INFINITY, 0); + } + // @Override + public accept(visitor: LatexParserVisitor): Result { + if (visitor.visitInfinityExpr) { + return visitor.visitInfinityExpr(this); + } else { + return visitor.visitChildren(this); + } + } +} export class AddContext extends ExprContext { constructor(parser: LatexParser, ctx: ExprContext) { super(parser, ctx.parentCtx, ctx.invokingState); diff --git a/src/parser/LatexParserVisitor.ts b/src/parser/LatexParserVisitor.ts index 474ff628..35bb503f 100644 --- a/src/parser/LatexParserVisitor.ts +++ b/src/parser/LatexParserVisitor.ts @@ -21,6 +21,7 @@ import { Piecewise_argContext } from "./LatexParser"; import { Trig_functionContext } from "./LatexParser"; import { Indefinite_integral_cmdContext } from "./LatexParser"; import { Integral_cmdContext } from "./LatexParser"; +import { Summation_cmdContext } from "./LatexParser"; import { Derivative_cmdContext } from "./LatexParser"; import { N_derivative_cmdContext } from "./LatexParser"; import { ArgumentContext } from "./LatexParser"; @@ -45,6 +46,7 @@ import { DerivativeContext } from "./LatexParser"; import { UserFunctionContext } from "./LatexParser"; import { MatrixContext } from "./LatexParser"; import { SubExprContext } from "./LatexParser"; +import { SummationContext } from "./LatexParser"; import { NormContext } from "./LatexParser"; import { EmptyPlaceholderContext } from "./LatexParser"; import { SqrtContext } from "./LatexParser"; @@ -57,6 +59,7 @@ import { MultiplyContext } from "./LatexParser"; import { BaseLogSingleCharContext } from "./LatexParser"; import { ExponentContext } from "./LatexParser"; import { BaseLogContext } from "./LatexParser"; +import { InfinityExprContext } from "./LatexParser"; import { AddContext } from "./LatexParser"; import { SingleIntSqrtContext } from "./LatexParser"; import { SubtractContext } from "./LatexParser"; @@ -192,6 +195,12 @@ export default class LatexParserVisitor extends ParseTreeVisitor * @return the visitor result */ visitIntegral_cmd?: (ctx: Integral_cmdContext) => Result; + /** + * Visit a parse tree produced by `LatexParser.summation_cmd`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSummation_cmd?: (ctx: Summation_cmdContext) => Result; /** * Visit a parse tree produced by `LatexParser.derivative_cmd`. * @param ctx the parse tree @@ -348,6 +357,13 @@ export default class LatexParserVisitor extends ParseTreeVisitor * @return the visitor result */ visitSubExpr?: (ctx: SubExprContext) => Result; + /** + * Visit a parse tree produced by the `summation` + * labeled alternative in `LatexParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSummation?: (ctx: SummationContext) => Result; /** * Visit a parse tree produced by the `norm` * labeled alternative in `LatexParser.expr`. @@ -432,6 +448,13 @@ export default class LatexParserVisitor extends ParseTreeVisitor * @return the visitor result */ visitBaseLog?: (ctx: BaseLogContext) => Result; + /** + * Visit a parse tree produced by the `infinityExpr` + * labeled alternative in `LatexParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitInfinityExpr?: (ctx: InfinityExprContext) => Result; /** * Visit a parse tree produced by the `add` * labeled alternative in `LatexParser.expr`. diff --git a/src/parser/LatexToSympy.ts b/src/parser/LatexToSympy.ts index de31d231..d06cb4bd 100644 --- a/src/parser/LatexToSympy.ts +++ b/src/parser/LatexToSympy.ts @@ -33,6 +33,7 @@ import { type IndefiniteIntegralContext, type Indefinite_integral_cmdContext, type Integral_cmdContext, type IntegralContext, type DerivativeContext, type Derivative_cmdContext, type NDerivativeContext, type N_derivative_cmdContext, + type Summation_cmdContext, type SummationContext, type TrigFunctionContext, type UnitExponentContext, type UnitFractionalExponentContext, type SqrtContext, type LnContext, type LogContext, type AbsContext, type UnaryMinusContext, type BaseLogContext, type UnitSqrtContext, type MultiplyContext, Number_with_unitsContext, type UnitMultiplyContext, @@ -47,7 +48,8 @@ import { type MatrixContext, type IndexContext, type MatrixMultiplyContext, type TransposeContext, type NormContext, type EmptySubscriptContext, type EmptySuperscriptContext, type MissingMultiplicationContext, type BuiltinFunctionContext, type UserFunctionContext, type EmptyPlaceholderContext, type Scatter_plot_queryContext, - type Parametric_plot_queryContext, type RemoveOperatorFontContext, type FactorialContext + type Parametric_plot_queryContext, type RemoveOperatorFontContext, type FactorialContext, + type InfinityExprContext } from "./LatexParser"; import { getBlankMatrixLatex } from "../utility"; @@ -1086,6 +1088,10 @@ export class LatexToSympy extends LatexParserVisitor { + return "oo"; + } + visitExponent = (ctx: ExponentContext) => { const exponentVariableName = this.getNextUnitlessSubExpressionName(); @@ -1810,6 +1816,43 @@ export class LatexToSympy extends LatexParserVisitor { + const child = ctx.children[0] as Summation_cmdContext; + + const dummyVariable = this.visitId(child.id()); + + this.currentDummyVars.add(dummyVariable); + const operand: string = this.visit(child._operand_expr) as string; + this.currentDummyVars.delete(dummyVariable); + + const start = this.visit(child._start_expr) as string; + + let end: string; + + if (child._end_expr) { + end = this.visit(child._end_expr) as string; + } else if (child.CARET_SINGLE_CHAR_ID()) { + end = this.mapVariableNames(child.CARET_SINGLE_CHAR_ID().toString()[1]); + this.params.push(end); + + if (this.inQueryStatement && !this.currentDummyVars.has(end)) { + this.subQueryReplacements.push([end, + { + type: "replacement", + location: child.CARET_SINGLE_CHAR_ID().symbol.start+1, + deletionLength: 1, + text: `{${end}}` + }]); + + this.addSubQuery(end); + } + } else { + end = child.CARET_SINGLE_CHAR_NUMBER().toString()[1]; + } + + return `_summation(Subs(${operand}, ${dummyVariable}, ${dummyVariable}__dummy_var), ${dummyVariable}__dummy_var, ${start}, ${end})`; + } + visitTrigFunction = (ctx: TrigFunctionContext) => { let trigFunctionName; diff --git a/tests/test_basic.spec.mjs b/tests/test_basic.spec.mjs index 7057420e..ffe23256 100644 --- a/tests/test_basic.spec.mjs +++ b/tests/test_basic.spec.mjs @@ -1764,7 +1764,7 @@ test('Test factorial function', async () => { expect(content).toBe(''); content = await page.textContent('#result-value-6'); - expect(content).toBe(String.raw`\left(a\right)!`); + expect(content).toBe('a!'); content = await page.textContent('#result-units-6'); expect(content).toBe(''); @@ -1784,7 +1784,10 @@ test('Test factorial error check for non integer input', async () => { await page.waitForSelector('text=Updating...', {state: 'detached'}); - await expect(page.locator('text=The factorial function can only be evaluated on a nonnegative integer')).toBeVisible(); + let content = await page.textContent('#result-value-0'); + expect(parseLatexFloat(content)).toBeCloseTo(1.04648584685356, precision); + content = await page.textContent('#result-units-0'); + expect(content).toBe(''); }); test('Test factorial error check for negative input', async () => { @@ -1792,7 +1795,8 @@ test('Test factorial error check for negative input', async () => { await page.waitForSelector('text=Updating...', {state: 'detached'}); - await expect(page.locator('text=The factorial function can only be evaluated on a nonnegative integer')).toBeVisible(); + let content = await page.textContent('#result-value-0'); + expect(content).toBe(String.raw`\tilde{\infty}`); }); test('Test factorial error check for input with units', async () => { diff --git a/tests/test_matrix_indexing.spec.mjs b/tests/test_matrix_indexing.spec.mjs index 098cdc08..18aa6548 100644 --- a/tests/test_matrix_indexing.spec.mjs +++ b/tests/test_matrix_indexing.spec.mjs @@ -81,7 +81,7 @@ test('Zero index', async () => { await page.waitForSelector('text=Updating...', {state: 'detached'}); - await expect(page.locator("text=Matrix indices must evaluate to a finite real integer and be greater than 0")).toBeVisible(); + await expect(page.locator("text=Matrix indices must be greater than 0")).toBeVisible(); }); test('Negative index', async () => { @@ -89,7 +89,7 @@ test('Negative index', async () => { await page.waitForSelector('text=Updating...', {state: 'detached'}); - await expect(page.locator("text=Matrix indices must evaluate to a finite real integer and be greater than 0")).toBeVisible(); + await expect(page.locator("text=Matrix indices must be greater than 0")).toBeVisible(); }); test('Out of range index', async () => { @@ -105,7 +105,7 @@ test('Noninteger index', async () => { await page.waitForSelector('text=Updating...', {state: 'detached'}); - await expect(page.locator("text=Matrix indices must evaluate to a finite real integer and be greater than 0")).toBeVisible(); + await expect(page.locator("text=IndexError, Invalid index")).toBeVisible(); }); test('Nonnumeric index', async () => { @@ -113,7 +113,8 @@ test('Nonnumeric index', async () => { await page.waitForSelector('text=Updating...', {state: 'detached'}); - await expect(page.locator("text=Matrix indices must evaluate to a finite real integer and be greater than 0")).toBeVisible(); + let content = await page.textContent('#result-value-0'); + expect(content).toBe(String.raw`\left[\begin{matrix}a & b\\c & d\\e & f\end{matrix}\right]_{0, z - 1}`); }); test('Indexing with expression', async () => { diff --git a/tests/test_sum_and_prod.spec.mjs b/tests/test_sum_and_prod.spec.mjs new file mode 100644 index 00000000..93190713 --- /dev/null +++ b/tests/test_sum_and_prod.spec.mjs @@ -0,0 +1,139 @@ +import { test, expect } from '@playwright/test'; +import { cot, pi, sqrt, tan, cos, e} from 'mathjs'; + +import { precision, loadPyodide, newSheet, parseLatexFloat } from './utility.mjs'; + +let page; + +// loading pyodide takes a long time (especially in resource constrained CI environments) +// load page once and use for all tests in this file +test.beforeAll(async ({ browser }) => {page = await loadPyodide(browser, page);} ); + +// give each test a blank sheet to start with (this doesn't reload pyodide) +test.beforeEach(async () => newSheet(page)); + +test('Test finite sum with no units', async () => { + await page.setLatex(0, String.raw`\sum_{n=0}^4\left(n\cdot2\right)=`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + let content = await page.textContent('#result-value-0'); + expect(parseLatexFloat(content)).toBeCloseTo(20, precision); + content = await page.textContent('#result-units-0'); + expect(content).toBe(''); + }); + + test('Test finite sum with units', async () => { + await page.setLatex(0, String.raw`\sum_{n=1}^3\left(n\cdot2\left\lbrack m\right\rbrack\right)=`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + let content = await page.textContent('#result-value-0'); + expect(parseLatexFloat(content)).toBeCloseTo(12, precision); + content = await page.textContent('#result-units-0'); + expect(content).toBe('m'); + }); + + test('Test infinte sum with factorial', async () => { + await page.setLatex(0, String.raw`\sum_{n=0}^{\infty}\left(\frac{2}{n!}\right)=`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + let content = await page.textContent('#result-value-0'); + expect(parseLatexFloat(content)).toBeCloseTo(2*e, precision); + content = await page.textContent('#result-units-0'); + expect(content).toBe(''); + }); + + test('Test sum over vector without units', async () => { + await page.setLatex(0, String.raw`\sum_{n=1}^{\mathrm{count}\left(B\right)}\left(B_{n,1}\right)=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(1, String.raw`B=\begin{bmatrix}1\\ 2\\ 3\end{bmatrix}`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + let content = await page.textContent('#result-value-0'); + expect(parseLatexFloat(content)).toBeCloseTo(6, precision); + content = await page.textContent('#result-units-0'); + expect(content).toBe(''); + }); + + test('Test sum over vector with units', async () => { + await page.setLatex(0, String.raw`\sum_{n=1}^{\mathrm{count}\left(B\right)}\left(B_{n,1}\right)=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(1, String.raw`B=\begin{bmatrix}1\\ 2\\ 3\end{bmatrix}\cdot1\left\lbrack m\right\rbrack=`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + let content = await page.textContent('#result-value-0'); + expect(parseLatexFloat(content)).toBeCloseTo(6, precision); + content = await page.textContent('#result-units-0'); + expect(content).toBe('m'); + }); + + test('Test sum over vector with inconsistent units', async () => { + await page.setLatex(0, String.raw`\sum_{n=1}^3\left(A_{n,1}\right)=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(1, String.raw`A=\begin{bmatrix}1\left\lbrack m\right\rbrack\\ 2\left\lbrack s\right\rbrack\\ 3\left\lbrack kg\right\rbrack\end{bmatrix}`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + await expect(page.locator('#cell-0 >> text=Dimension Error')).toBeVisible(); + }); + + test('Test finite sum with consistent limit units', async () => { + await page.setLatex(0, String.raw`\sum_{n=1\left\lbrack m\right\rbrack}^{3\left\lbrack m\right\rbrack}\left(n^2\cdot1\left\lbrack m\right\rbrack\right)=`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + let content = await page.textContent('#result-value-0'); + expect(parseLatexFloat(content)).toBeCloseTo(14, precision); + content = await page.textContent('#result-units-0'); + expect(content).toBe('m^3'); + }); + + test('Test finite sum with inconsistent limit units', async () => { + await page.setLatex(0, String.raw`\sum_{n=1\left\lbrack m\right\rbrack}^{3\left\lbrack s\right\rbrack}\left(n^2\cdot1\left\lbrack m\right\rbrack\right)=`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + await expect(page.locator('#cell-0 >> text=Dimension Error')).toBeVisible(); + }); + + test('Test sum over vector with limit units', async () => { + await page.setLatex(0, String.raw`\sum_{n=1\left\lbrack m\right\rbrack}^{3\left\lbrack m\right\rbrack}\left(A_{n,1}\right)=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(1, String.raw`A=\begin{bmatrix}1\\ 2\\ 3\end{bmatrix}`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + await expect(page.locator('#cell-0 >> text=Dimension Error')).toBeVisible(); + }); + + test('Test finite sum with dummy variable in exponent', async () => { + await page.setLatex(0, String.raw`\sum_{n=1\left\lbrack m\right\rbrack}^{3\left\lbrack m\right\rbrack}\left(2^{n}\right)=`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + await expect(page.locator('#cell-0 >> text=Dimension Error')).toBeVisible(); + }); + + test('Test nested sum', async () => { + await page.setLatex(0, String.raw`\sum_{i=1}^{\mathrm{count}\left(A\right)}\left(\sum_{j=1}^{\mathrm{count}\left(B\right)}\left(A_{i,1}\cdot B_{1,j}\right)\right)=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(1, String.raw`A=\begin{bmatrix}a\\ b\end{bmatrix}`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(2, String.raw`B=\begin{bmatrix}c & d\end{bmatrix}`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + let content = await page.textContent('#result-value-0'); + expect(content).toBe(String.raw`a \cdot c + a \cdot d + b \cdot c + b \cdot d`); + }); +