diff --git a/src/main/java/org/programsnail/truffle_lama/parser/Lama.g4 b/src/main/java/org/programsnail/truffle_lama/parser/Lama.g4 index ea6a454..8a73bab 100644 --- a/src/main/java/org/programsnail/truffle_lama/parser/Lama.g4 +++ b/src/main/java/org/programsnail/truffle_lama/parser/Lama.g4 @@ -52,13 +52,14 @@ grammar Lama; import java.util.Optional; import java.util.ArrayList; import java.util.List; -import java.util.Map; +import java.util.Objects; -import com.oracle.truffle.api.RootCallTarget; import com.oracle.truffle.api.source.Source; import com.oracle.truffle.api.strings.TruffleString; import org.programsnail.truffle_lama.LamaLanguage; import org.programsnail.truffle_lama.nodes.LamaExpressionNode; +import org.programsnail.truffle_lama.nodes.LamaRootNode; +import org.programsnail.truffle_lama.nodes.pattern.LamaPattern; } @lexer::header @@ -94,7 +95,7 @@ private static void throwParseError(Source source, int line, int charPositionInL throw new LamaParseError(source, line, col, length, String.format("Error(s) parsing script:%n" + location + message)); } -public static LamaExpressionNode parseLama(LamaLanguage language, Source source) { +public static LamaRootNode parseLama(LamaLanguage language, Source source) { LamaLexer lexer = new LamaLexer(CharStreams.fromString(source.getCharacters().toString())); LamaParser parser = new LamaParser(new CommonTokenStream(lexer)); lexer.removeErrorListeners(); @@ -113,26 +114,28 @@ public static LamaExpressionNode parseLama(LamaLanguage language, Source source) lama returns [LamaExpressionNode result]: /* (import_expression)* */ - scope_expression { $result = $scope_expression.result; } + scope_expression[false] { $result = $scope_expression.result; factory.setRootExpr($result); } EOF; //import_expression : 'import' UIDENT ';'; -scope_expression returns [LamaExpressionNode result]: - definition { $result = $expression.result; } +scope_expression[boolean do_scope] returns [LamaExpressionNode result] + : { if (do_scope) { factory.enterScope(); } } + (definition { $result = $expression.result; } ( definition { $result = factory.createSeqNode($result, $expression.result); } )* ( expression { $result = factory.createSeqNode($result, $expression.result); } )? - | expression { $result = $expression.result; } + | expression { $result = $expression.result; }) + { if (do_scope) { factory.exitScope(); } } ; definition returns [LamaExpressionNode result]: variable_definition { $result = $variable_definition.result; } | function_definition { $result = $function_definition.result; } -; -// | infix_definition; + ; +// | infix_definition { $result = $infix_definition.result; }; // @@ -144,32 +147,42 @@ variable_definition returns [LamaExpressionNode result] variable_definition_sequence[is_public] { $result = $variable_definition_sequence.result; } ; variable_definition_sequence[boolean is_public] returns [LamaExpressionNode result]: - variable_definition_item { $result = factory.createVarNode($variable_definition_item.name, $variable_definition_item.expr); } + variable_definition_item { $result = factory.createAssignVarNode($variable_definition_item.name, $variable_definition_item.expr); } (',' - variable_definition_item { $result = factory.createSeqNode($result, factory.createVarNode($variable_definition_item.name, $variable_definition_item.expr)); } + variable_definition_item { $result = factory.createSeqNode($result, factory.createAssignVarNode($variable_definition_item.name, $variable_definition_item.expr)); } )* ';'; -variable_definition_item returns [TruffleString name, Optional expr] - : { $expr = Optional.empty(); } +variable_definition_item returns [Token name, LamaExpressionNode expr] + : { $expr = null; } LIDENT { $name = $LIDENT; } ('=' - basic_expression { $expr = Optional.of($basic_expression.result); } + basic_expression { $expr = $basic_expression.result; } )?; -function_definition returns [LamaExpressionNode result] // TODO: scopes - : { boolean is_public = false; } +function_definition returns [LamaExpressionNode result] + : { + boolean is_public = false; + List args = new ArrayList(); + factory.enterScope(LamaNodeFactory.LexicalScope.Kind.FUNCTION); + } ( 'public' { is_public = true; } - )? 'fun' LIDENT '(' (function_arguments)? ')' function_body - { $result = factory.defineFunction($LIDENT, $function_arguments.args, $function_body.result); } + )? 'fun' LIDENT '(' ( + function_arguments { args = $function_arguments.args; factory.addFunctionArguments(args); } + )? ')' function_body + { + $result = factory.createClosureNode($LIDENT, $function_body.result, args.size()); // create lambda for the function + factory.exitScope(); // TODO: create exit node to create vars ?? + $result = factory.createAssignVarNode($LIDENT, $result); // create global function: out of the created scope + } ; -function_arguments returns [List args] - : { $args = new ArrayList(); } +function_arguments returns [List args] + : { $args = new ArrayList(); } LIDENT { $args.addLast($LIDENT); } (',' LIDENT { $args.addLast($LIDENT); } )*; function_body returns [LamaExpressionNode result]: '{' - scope_expression { $result = $scope_expression.result; } + scope_expression[true] { $result = $scope_expression.result; } '}'; // @@ -185,14 +198,14 @@ expression returns [LamaExpressionNode result]: basic_expression { $result = $basic_expression.result; } (';' expression { $result = factory.createSeqNode($result, $expression.result); } - )?; // TODO: additional things, exit scope ?? + )?; basic_expression returns [LamaExpressionNode result]: binary_expression { $result = $binary_expression.result; }; binary_expression returns [LamaExpressionNode result]: postfix_expression { $result = $postfix_expression.result; } ( any_infix postfix_expression { $result = factory.createBinopNode($any_infix.result, $result, $postfix_expression.result); } - )*; + )*; // TODO: replace with custom sequence parser (with infixity) postfix_expression returns [LamaExpressionNode result] : { boolean with_minus = false; } ( @@ -202,14 +215,24 @@ postfix_expression returns [LamaExpressionNode result] ( postfix { if ($postfix.access_index.isPresent()) { - $result = factory.createElemNode($result, ($postfix.access_index.get())); // TODO: or RefElem node + $result = factory.createElemValueNode($result, $postfix.access_index.get()); + // TODO: choose between elem and ref } else { $result = factory.createCallNode($result, $postfix.args); } } - )*; // TODO: elem or elem ref for access node ?? + )* + { + if (with_minus) { + $result = factory.createBinopNode( + $MINUS, + factory.createValueConstNode($MINUS, 0), + $result); + } + } +; postfix returns [List args, Optional access_index] - : { $args = new ArrayList(); $access_index = Option.empty(); } + : { $args = new ArrayList(); $access_index = Optional.empty(); } '(' expression { $args.addLast($expression.result); } (',' @@ -218,7 +241,7 @@ postfix returns [List args, Optional acc ')' | '(' ')' | '[' - expression { $access_index = Option.of($expression.result); } + expression { $access_index = Optional.of($expression.result); } ']' ; @@ -226,14 +249,25 @@ primary returns [LamaExpressionNode result]: DECIMAL_LITERAL { $result = factory.createConstNode($DECIMAL_LITERAL); } // minus - inside decimal literal definition | STRING_LITERAL { $result = factory.createStringNode($STRING_LITERAL); } | CHAR_LITERAL { $result = factory.createCharConstNode($CHAR_LITERAL); } - | LIDENT { $result = factory.createRefNode($LIDENT); } + | LIDENT { $result = factory.createValueNode($LIDENT); } // TODO: choose between value and ref | tok='true' { $result = factory.createValueConstNode($tok, 1); } | tok='false' { $result = factory.createValueConstNode($tok, 0); } - | 'infix' any_infix { $result = factory.createRefNode($any_infix.result); } - | 'fun' '(' function_arguments ')' function_body - { $result = factory.createClosureNode($function_arguments.args, $function_body.result); } // TODO: scopes - | 'skip' { $result = factory.createSkipNode(); } - | '(' scope_expression ')' { $result = $scope_expression.result; } // add some scope for correct attribution ?? + | 'infix' any_infix { $result = factory.createValueNode($any_infix.result); } + | tok='fun' '(' + { + List args = new ArrayList(); + factory.enterScope(LamaNodeFactory.LexicalScope.Kind.INNER_CLOSURE); + } + function_arguments { args = $function_arguments.args; factory.addFunctionArguments(args); } + // TODO: make optional ?? + ')' + function_body + { + $result = factory.createClosureNode($tok, $function_body.result, args.size()); + factory.exitScope(); // TODO: create exit node to create vars ?? + } + | tok='skip' { $result = factory.createSkipNode($tok); } + | '(' scope_expression[true] ')' { $result = $scope_expression.result; } // TODO: check | list_expression { $result = $list_expression.result; } | array_expression { $result = $array_expression.result; } | s_expression { $result = $s_expression.result; } @@ -282,27 +316,31 @@ s_expression returns [LamaExpressionNode result] if_expression returns [LamaExpressionNode result] : { LamaExpressionNode do_else = null; } - 'if' expression 'then' scope_expression ( + 'if' expression 'then' scope_expression[true] + ( else_part { do_else = $else_part.result; } )? 'fi' { $result = factory.createIfNode($expression.result, $scope_expression.result, do_else); } ; else_part returns [LamaExpressionNode result]: - 'elif' { LamaExpressionNode do_else = null; } expression 'then' scope_expression ( + 'elif' { LamaExpressionNode do_else = null; } expression 'then' scope_expression[true] ( else_part { do_else = $else_part.result; } )? { $result = factory.createIfNode($expression.result, $scope_expression.result, do_else); } - | 'else' scope_expression { $result = $scope_expression.result; }; + | 'else' scope_expression[true] { $result = $scope_expression.result; }; // -while_do_expression returns [LamaExpressionNode result]: 'while' expression 'do' scope_expression 'od' +while_do_expression returns [LamaExpressionNode result]: 'while' expression 'do' scope_expression[true] 'od' { $result = factory.createWhileNode($expression.result, $scope_expression.result); }; -do_while_expression returns [LamaExpressionNode result]: 'do' scope_expression 'while' expression 'od' +do_while_expression returns [LamaExpressionNode result]: 'do' scope_expression[true] 'while' expression 'od' { $result = factory.createDoWhileNode($expression.result, $scope_expression.result); }; for_expression returns [LamaExpressionNode result]: - 'for' init=scope_expression ',' cond=expression ',' inc=expression 'do' expr=scope_expression 'od' - // TODO: add scope, etc. - { $result = factory.createSeqNode($init.result, factory.createWhileNode($cond.result, factory.createSeqNode($expr.result, $inc.result))); } + 'for' { factory.enterScope(); } + init=scope_expression[false] ',' cond=expression ',' inc=expression 'do' expr=scope_expression[true] 'od' + { + $result = factory.createSeqNode($init.result, factory.createWhileNode($cond.result, factory.createSeqNode($expr.result, $inc.result))); + factory.exitScope(); + } ; // @@ -311,7 +349,7 @@ pattern returns [LamaPattern result]: cons_pattern { $result = $cons_pattern.result; } | simple_pattern { $result = $simple_pattern.result; } ; -cons_pattern returns [LamaPattern result]: simple_pattern ':' pattern { $result = factory.createSexpPattern("cons", {$simple_pattern.result, $pattern.result}); }; +cons_pattern returns [LamaPattern result]: simple_pattern ':' pattern { $result = factory.createSexpConsPattern($simple_pattern.result, $pattern.result); }; simple_pattern returns [LamaPattern result]: wildcard_pattern { $result = $wildcard_pattern.result; } | s_expr_pattern { $result = $s_expr_pattern.result; } @@ -322,16 +360,16 @@ simple_pattern returns [LamaPattern result]: ('@' pattern { pat = $pattern.result; } )? - { $result = factory.createNamedPattern($LIDENT, Objects.requireNonNullElse(pat, factory.createWildcardPattern()); } + { $result = factory.createNamedPattern($LIDENT, Objects.requireNonNullElse(pat, factory.createWildcardPattern())); } | { boolean is_negative = false; } ( MINUS { is_negative = true; } )? DECIMAL_LITERAL { $result = is_negative ? factory.createNegativeConstPattern($DECIMAL_LITERAL) : factory.createConstPattern($DECIMAL_LITERAL); } - | STRING_LITERAL { $result = factory.createStringPattern(LamaStrings.convertStringLiteral($STRING_LITERAL)); } - | CHAR_LITERAL { $result = factory.createConstPattern(LamaStrings.convertCharLiteral($CHAR_LITERAL)); } - | 'true' { $result = factory.createConstPattern(1); } - | 'false' { $result = factory.createConstPattern(0); } + | STRING_LITERAL { $result = factory.createStringPattern($STRING_LITERAL); } + | CHAR_LITERAL { $result = factory.createConstPattern($CHAR_LITERAL); } + | tok='true' { $result = factory.createValueConstPattern($tok, 1); } + | tok='false' { $result = factory.createValueConstPattern($tok, 0); } | '#' 'box' { $result = factory.createBoxedPattern(); } | '#' 'val' { $result = factory.createUnBoxedPattern(); } | '#' 'str' { $result = factory.createStringTagPattern(); } @@ -368,7 +406,7 @@ list_pattern returns [LamaPattern result] '{' ( pattern { elems.addLast($pattern.result); } (',' - pattern { elems.addLast($pattern.result); } //FIXME: wrong order + pattern { elems.addLast($pattern.result); } )*)? '}' { $result = factory.createListSexpPattern(elems); } @@ -380,18 +418,20 @@ case_expression returns [LamaExpressionNode result]: 'case' expression 'of' case_branches 'esac' { $result = factory.createCaseNode($expression.result, $case_branches.pats, $case_branches.exprs); } ; case_branches returns [List pats, List exprs] - : { $pats = new ArrayList(); $exprs = new ArrayList exprs; } + : { $pats = new ArrayList(); $exprs = new ArrayList(); } case_branch { $pats.addLast($case_branch.pat); $exprs.addLast($case_branch.expr); } ('|' case_branch { $pats.addLast($case_branch.pat); $exprs.addLast($case_branch.expr); } )*; -case_branch returns [LamaPattern pat, LamaExpressionNode expr]: +case_branch returns [LamaPattern pat, LamaExpressionNode expr] + : { factory.enterScope(); } pattern { $pat = $pattern.result; } '->' - scope_expression { $expr = $scope_expression.result; } + scope_expression[false] { $expr = $scope_expression.result; } + { factory.exitScope(); } ; -any_infix returns [String result]: +any_infix returns [Token result]: INFIX { $result = $INFIX; } | MINUS { $result = $MINUS; } ; diff --git a/src/main/java/org/programsnail/truffle_lama/parser/Lama.interp b/src/main/java/org/programsnail/truffle_lama/parser/Lama.interp index 49adfe1..55bc57a 100644 --- a/src/main/java/org/programsnail/truffle_lama/parser/Lama.interp +++ b/src/main/java/org/programsnail/truffle_lama/parser/Lama.interp @@ -142,4 +142,4 @@ any_infix atn: -[4, 1, 50, 558, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 78, 8, 1, 10, 1, 12, 1, 81, 9, 1, 1, 1, 1, 1, 1, 1, 3, 1, 86, 8, 1, 1, 1, 1, 1, 1, 1, 3, 1, 91, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 99, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 105, 8, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 116, 8, 4, 10, 4, 12, 4, 119, 9, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 130, 8, 5, 1, 6, 1, 6, 1, 6, 3, 6, 135, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 141, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 153, 8, 7, 10, 7, 12, 7, 156, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 169, 8, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 180, 8, 11, 10, 11, 12, 11, 183, 9, 11, 1, 12, 1, 12, 1, 12, 3, 12, 188, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 195, 8, 12, 10, 12, 12, 12, 198, 9, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 208, 8, 13, 10, 13, 12, 13, 211, 9, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 222, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 278, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 288, 8, 15, 10, 15, 12, 15, 291, 9, 15, 3, 15, 293, 8, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 306, 8, 16, 10, 16, 12, 16, 309, 9, 16, 3, 16, 311, 8, 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, 5, 17, 325, 8, 17, 10, 17, 12, 17, 328, 9, 17, 3, 17, 330, 8, 17, 1, 17, 3, 17, 333, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 345, 8, 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, 358, 8, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 366, 8, 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, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 399, 8, 23, 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, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 424, 8, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 430, 8, 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, 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, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 465, 8, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 5, 27, 479, 8, 27, 10, 27, 12, 27, 482, 9, 27, 3, 27, 484, 8, 27, 1, 27, 3, 27, 487, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 5, 28, 499, 8, 28, 10, 28, 12, 28, 502, 9, 28, 3, 28, 504, 8, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 5, 29, 517, 8, 29, 10, 29, 12, 29, 520, 9, 29, 3, 29, 522, 8, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 541, 8, 31, 10, 31, 12, 31, 544, 9, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 3, 33, 556, 8, 33, 1, 33, 0, 0, 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, 0, 595, 0, 68, 1, 0, 0, 0, 2, 90, 1, 0, 0, 0, 4, 98, 1, 0, 0, 0, 6, 100, 1, 0, 0, 0, 8, 109, 1, 0, 0, 0, 10, 122, 1, 0, 0, 0, 12, 131, 1, 0, 0, 0, 14, 146, 1, 0, 0, 0, 16, 157, 1, 0, 0, 0, 18, 162, 1, 0, 0, 0, 20, 170, 1, 0, 0, 0, 22, 173, 1, 0, 0, 0, 24, 184, 1, 0, 0, 0, 26, 221, 1, 0, 0, 0, 28, 277, 1, 0, 0, 0, 30, 279, 1, 0, 0, 0, 32, 297, 1, 0, 0, 0, 34, 315, 1, 0, 0, 0, 36, 336, 1, 0, 0, 0, 38, 365, 1, 0, 0, 0, 40, 367, 1, 0, 0, 0, 42, 374, 1, 0, 0, 0, 44, 381, 1, 0, 0, 0, 46, 398, 1, 0, 0, 0, 48, 400, 1, 0, 0, 0, 50, 464, 1, 0, 0, 0, 52, 466, 1, 0, 0, 0, 54, 469, 1, 0, 0, 0, 56, 490, 1, 0, 0, 0, 58, 508, 1, 0, 0, 0, 60, 526, 1, 0, 0, 0, 62, 533, 1, 0, 0, 0, 64, 545, 1, 0, 0, 0, 66, 555, 1, 0, 0, 0, 68, 69, 3, 2, 1, 0, 69, 70, 6, 0, -1, 0, 70, 71, 5, 0, 0, 1, 71, 1, 1, 0, 0, 0, 72, 73, 3, 4, 2, 0, 73, 79, 6, 1, -1, 0, 74, 75, 3, 4, 2, 0, 75, 76, 6, 1, -1, 0, 76, 78, 1, 0, 0, 0, 77, 74, 1, 0, 0, 0, 78, 81, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 85, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 82, 83, 3, 18, 9, 0, 83, 84, 6, 1, -1, 0, 84, 86, 1, 0, 0, 0, 85, 82, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 91, 1, 0, 0, 0, 87, 88, 3, 18, 9, 0, 88, 89, 6, 1, -1, 0, 89, 91, 1, 0, 0, 0, 90, 72, 1, 0, 0, 0, 90, 87, 1, 0, 0, 0, 91, 3, 1, 0, 0, 0, 92, 93, 3, 6, 3, 0, 93, 94, 6, 2, -1, 0, 94, 99, 1, 0, 0, 0, 95, 96, 3, 12, 6, 0, 96, 97, 6, 2, -1, 0, 97, 99, 1, 0, 0, 0, 98, 92, 1, 0, 0, 0, 98, 95, 1, 0, 0, 0, 99, 5, 1, 0, 0, 0, 100, 104, 6, 3, -1, 0, 101, 105, 5, 1, 0, 0, 102, 103, 5, 2, 0, 0, 103, 105, 6, 3, -1, 0, 104, 101, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 107, 3, 8, 4, 0, 107, 108, 6, 3, -1, 0, 108, 7, 1, 0, 0, 0, 109, 110, 3, 10, 5, 0, 110, 117, 6, 4, -1, 0, 111, 112, 5, 3, 0, 0, 112, 113, 3, 10, 5, 0, 113, 114, 6, 4, -1, 0, 114, 116, 1, 0, 0, 0, 115, 111, 1, 0, 0, 0, 116, 119, 1, 0, 0, 0, 117, 115, 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 120, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 120, 121, 5, 4, 0, 0, 121, 9, 1, 0, 0, 0, 122, 123, 6, 5, -1, 0, 123, 124, 5, 46, 0, 0, 124, 129, 6, 5, -1, 0, 125, 126, 5, 5, 0, 0, 126, 127, 3, 20, 10, 0, 127, 128, 6, 5, -1, 0, 128, 130, 1, 0, 0, 0, 129, 125, 1, 0, 0, 0, 129, 130, 1, 0, 0, 0, 130, 11, 1, 0, 0, 0, 131, 134, 6, 6, -1, 0, 132, 133, 5, 2, 0, 0, 133, 135, 6, 6, -1, 0, 134, 132, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 137, 5, 6, 0, 0, 137, 138, 5, 46, 0, 0, 138, 140, 5, 7, 0, 0, 139, 141, 3, 14, 7, 0, 140, 139, 1, 0, 0, 0, 140, 141, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 143, 5, 8, 0, 0, 143, 144, 3, 16, 8, 0, 144, 145, 6, 6, -1, 0, 145, 13, 1, 0, 0, 0, 146, 147, 6, 7, -1, 0, 147, 148, 5, 46, 0, 0, 148, 154, 6, 7, -1, 0, 149, 150, 5, 3, 0, 0, 150, 151, 5, 46, 0, 0, 151, 153, 6, 7, -1, 0, 152, 149, 1, 0, 0, 0, 153, 156, 1, 0, 0, 0, 154, 152, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 15, 1, 0, 0, 0, 156, 154, 1, 0, 0, 0, 157, 158, 5, 9, 0, 0, 158, 159, 3, 2, 1, 0, 159, 160, 6, 8, -1, 0, 160, 161, 5, 10, 0, 0, 161, 17, 1, 0, 0, 0, 162, 163, 3, 20, 10, 0, 163, 168, 6, 9, -1, 0, 164, 165, 5, 4, 0, 0, 165, 166, 3, 18, 9, 0, 166, 167, 6, 9, -1, 0, 167, 169, 1, 0, 0, 0, 168, 164, 1, 0, 0, 0, 168, 169, 1, 0, 0, 0, 169, 19, 1, 0, 0, 0, 170, 171, 3, 22, 11, 0, 171, 172, 6, 10, -1, 0, 172, 21, 1, 0, 0, 0, 173, 174, 3, 24, 12, 0, 174, 181, 6, 11, -1, 0, 175, 176, 3, 66, 33, 0, 176, 177, 3, 24, 12, 0, 177, 178, 6, 11, -1, 0, 178, 180, 1, 0, 0, 0, 179, 175, 1, 0, 0, 0, 180, 183, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 23, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 184, 187, 6, 12, -1, 0, 185, 186, 5, 43, 0, 0, 186, 188, 6, 12, -1, 0, 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 190, 3, 28, 14, 0, 190, 196, 6, 12, -1, 0, 191, 192, 3, 26, 13, 0, 192, 193, 6, 12, -1, 0, 193, 195, 1, 0, 0, 0, 194, 191, 1, 0, 0, 0, 195, 198, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 25, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 199, 200, 6, 13, -1, 0, 200, 201, 5, 7, 0, 0, 201, 202, 3, 18, 9, 0, 202, 209, 6, 13, -1, 0, 203, 204, 5, 3, 0, 0, 204, 205, 3, 18, 9, 0, 205, 206, 6, 13, -1, 0, 206, 208, 1, 0, 0, 0, 207, 203, 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 212, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 212, 213, 5, 8, 0, 0, 213, 222, 1, 0, 0, 0, 214, 215, 5, 7, 0, 0, 215, 222, 5, 8, 0, 0, 216, 217, 5, 11, 0, 0, 217, 218, 3, 18, 9, 0, 218, 219, 6, 13, -1, 0, 219, 220, 5, 12, 0, 0, 220, 222, 1, 0, 0, 0, 221, 199, 1, 0, 0, 0, 221, 214, 1, 0, 0, 0, 221, 216, 1, 0, 0, 0, 222, 27, 1, 0, 0, 0, 223, 224, 5, 49, 0, 0, 224, 278, 6, 14, -1, 0, 225, 226, 5, 48, 0, 0, 226, 278, 6, 14, -1, 0, 227, 228, 5, 47, 0, 0, 228, 278, 6, 14, -1, 0, 229, 230, 5, 46, 0, 0, 230, 278, 6, 14, -1, 0, 231, 232, 5, 13, 0, 0, 232, 278, 6, 14, -1, 0, 233, 234, 5, 14, 0, 0, 234, 278, 6, 14, -1, 0, 235, 236, 5, 15, 0, 0, 236, 237, 3, 66, 33, 0, 237, 238, 6, 14, -1, 0, 238, 278, 1, 0, 0, 0, 239, 240, 5, 6, 0, 0, 240, 241, 5, 7, 0, 0, 241, 242, 3, 14, 7, 0, 242, 243, 5, 8, 0, 0, 243, 244, 3, 16, 8, 0, 244, 245, 6, 14, -1, 0, 245, 278, 1, 0, 0, 0, 246, 247, 5, 16, 0, 0, 247, 278, 6, 14, -1, 0, 248, 249, 5, 7, 0, 0, 249, 250, 3, 2, 1, 0, 250, 251, 5, 8, 0, 0, 251, 252, 6, 14, -1, 0, 252, 278, 1, 0, 0, 0, 253, 254, 3, 32, 16, 0, 254, 255, 6, 14, -1, 0, 255, 278, 1, 0, 0, 0, 256, 257, 3, 30, 15, 0, 257, 258, 6, 14, -1, 0, 258, 278, 1, 0, 0, 0, 259, 260, 3, 34, 17, 0, 260, 261, 6, 14, -1, 0, 261, 278, 1, 0, 0, 0, 262, 263, 3, 36, 18, 0, 263, 264, 6, 14, -1, 0, 264, 278, 1, 0, 0, 0, 265, 266, 3, 40, 20, 0, 266, 267, 6, 14, -1, 0, 267, 278, 1, 0, 0, 0, 268, 269, 3, 42, 21, 0, 269, 270, 6, 14, -1, 0, 270, 278, 1, 0, 0, 0, 271, 272, 3, 44, 22, 0, 272, 273, 6, 14, -1, 0, 273, 278, 1, 0, 0, 0, 274, 275, 3, 60, 30, 0, 275, 276, 6, 14, -1, 0, 276, 278, 1, 0, 0, 0, 277, 223, 1, 0, 0, 0, 277, 225, 1, 0, 0, 0, 277, 227, 1, 0, 0, 0, 277, 229, 1, 0, 0, 0, 277, 231, 1, 0, 0, 0, 277, 233, 1, 0, 0, 0, 277, 235, 1, 0, 0, 0, 277, 239, 1, 0, 0, 0, 277, 246, 1, 0, 0, 0, 277, 248, 1, 0, 0, 0, 277, 253, 1, 0, 0, 0, 277, 256, 1, 0, 0, 0, 277, 259, 1, 0, 0, 0, 277, 262, 1, 0, 0, 0, 277, 265, 1, 0, 0, 0, 277, 268, 1, 0, 0, 0, 277, 271, 1, 0, 0, 0, 277, 274, 1, 0, 0, 0, 278, 29, 1, 0, 0, 0, 279, 280, 6, 15, -1, 0, 280, 292, 5, 11, 0, 0, 281, 282, 3, 18, 9, 0, 282, 289, 6, 15, -1, 0, 283, 284, 5, 3, 0, 0, 284, 285, 3, 18, 9, 0, 285, 286, 6, 15, -1, 0, 286, 288, 1, 0, 0, 0, 287, 283, 1, 0, 0, 0, 288, 291, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 293, 1, 0, 0, 0, 291, 289, 1, 0, 0, 0, 292, 281, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 295, 5, 12, 0, 0, 295, 296, 6, 15, -1, 0, 296, 31, 1, 0, 0, 0, 297, 298, 6, 16, -1, 0, 298, 310, 5, 9, 0, 0, 299, 300, 3, 18, 9, 0, 300, 307, 6, 16, -1, 0, 301, 302, 5, 3, 0, 0, 302, 303, 3, 18, 9, 0, 303, 304, 6, 16, -1, 0, 304, 306, 1, 0, 0, 0, 305, 301, 1, 0, 0, 0, 306, 309, 1, 0, 0, 0, 307, 305, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 311, 1, 0, 0, 0, 309, 307, 1, 0, 0, 0, 310, 299, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 313, 5, 10, 0, 0, 313, 314, 6, 16, -1, 0, 314, 33, 1, 0, 0, 0, 315, 316, 6, 17, -1, 0, 316, 332, 5, 45, 0, 0, 317, 329, 5, 7, 0, 0, 318, 319, 3, 18, 9, 0, 319, 326, 6, 17, -1, 0, 320, 321, 5, 3, 0, 0, 321, 322, 3, 18, 9, 0, 322, 323, 6, 17, -1, 0, 323, 325, 1, 0, 0, 0, 324, 320, 1, 0, 0, 0, 325, 328, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 330, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 329, 318, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 333, 5, 8, 0, 0, 332, 317, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 335, 6, 17, -1, 0, 335, 35, 1, 0, 0, 0, 336, 337, 6, 18, -1, 0, 337, 338, 5, 17, 0, 0, 338, 339, 3, 18, 9, 0, 339, 340, 5, 18, 0, 0, 340, 344, 3, 2, 1, 0, 341, 342, 3, 38, 19, 0, 342, 343, 6, 18, -1, 0, 343, 345, 1, 0, 0, 0, 344, 341, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 346, 1, 0, 0, 0, 346, 347, 5, 19, 0, 0, 347, 348, 6, 18, -1, 0, 348, 37, 1, 0, 0, 0, 349, 350, 5, 20, 0, 0, 350, 351, 6, 19, -1, 0, 351, 352, 3, 18, 9, 0, 352, 353, 5, 18, 0, 0, 353, 357, 3, 2, 1, 0, 354, 355, 3, 38, 19, 0, 355, 356, 6, 19, -1, 0, 356, 358, 1, 0, 0, 0, 357, 354, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 359, 1, 0, 0, 0, 359, 360, 6, 19, -1, 0, 360, 366, 1, 0, 0, 0, 361, 362, 5, 21, 0, 0, 362, 363, 3, 2, 1, 0, 363, 364, 6, 19, -1, 0, 364, 366, 1, 0, 0, 0, 365, 349, 1, 0, 0, 0, 365, 361, 1, 0, 0, 0, 366, 39, 1, 0, 0, 0, 367, 368, 5, 22, 0, 0, 368, 369, 3, 18, 9, 0, 369, 370, 5, 23, 0, 0, 370, 371, 3, 2, 1, 0, 371, 372, 5, 24, 0, 0, 372, 373, 6, 20, -1, 0, 373, 41, 1, 0, 0, 0, 374, 375, 5, 23, 0, 0, 375, 376, 3, 2, 1, 0, 376, 377, 5, 22, 0, 0, 377, 378, 3, 18, 9, 0, 378, 379, 5, 24, 0, 0, 379, 380, 6, 21, -1, 0, 380, 43, 1, 0, 0, 0, 381, 382, 5, 25, 0, 0, 382, 383, 3, 2, 1, 0, 383, 384, 5, 3, 0, 0, 384, 385, 3, 18, 9, 0, 385, 386, 5, 3, 0, 0, 386, 387, 3, 18, 9, 0, 387, 388, 5, 23, 0, 0, 388, 389, 3, 2, 1, 0, 389, 390, 5, 24, 0, 0, 390, 391, 6, 22, -1, 0, 391, 45, 1, 0, 0, 0, 392, 393, 3, 48, 24, 0, 393, 394, 6, 23, -1, 0, 394, 399, 1, 0, 0, 0, 395, 396, 3, 50, 25, 0, 396, 397, 6, 23, -1, 0, 397, 399, 1, 0, 0, 0, 398, 392, 1, 0, 0, 0, 398, 395, 1, 0, 0, 0, 399, 47, 1, 0, 0, 0, 400, 401, 3, 50, 25, 0, 401, 402, 5, 26, 0, 0, 402, 403, 3, 46, 23, 0, 403, 404, 6, 24, -1, 0, 404, 49, 1, 0, 0, 0, 405, 406, 3, 52, 26, 0, 406, 407, 6, 25, -1, 0, 407, 465, 1, 0, 0, 0, 408, 409, 3, 54, 27, 0, 409, 410, 6, 25, -1, 0, 410, 465, 1, 0, 0, 0, 411, 412, 3, 56, 28, 0, 412, 413, 6, 25, -1, 0, 413, 465, 1, 0, 0, 0, 414, 415, 3, 58, 29, 0, 415, 416, 6, 25, -1, 0, 416, 465, 1, 0, 0, 0, 417, 418, 5, 46, 0, 0, 418, 423, 6, 25, -1, 0, 419, 420, 5, 27, 0, 0, 420, 421, 3, 46, 23, 0, 421, 422, 6, 25, -1, 0, 422, 424, 1, 0, 0, 0, 423, 419, 1, 0, 0, 0, 423, 424, 1, 0, 0, 0, 424, 425, 1, 0, 0, 0, 425, 465, 6, 25, -1, 0, 426, 429, 6, 25, -1, 0, 427, 428, 5, 43, 0, 0, 428, 430, 6, 25, -1, 0, 429, 427, 1, 0, 0, 0, 429, 430, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 431, 432, 5, 49, 0, 0, 432, 465, 6, 25, -1, 0, 433, 434, 5, 48, 0, 0, 434, 465, 6, 25, -1, 0, 435, 436, 5, 47, 0, 0, 436, 465, 6, 25, -1, 0, 437, 438, 5, 13, 0, 0, 438, 465, 6, 25, -1, 0, 439, 440, 5, 14, 0, 0, 440, 465, 6, 25, -1, 0, 441, 442, 5, 28, 0, 0, 442, 443, 5, 29, 0, 0, 443, 465, 6, 25, -1, 0, 444, 445, 5, 28, 0, 0, 445, 446, 5, 30, 0, 0, 446, 465, 6, 25, -1, 0, 447, 448, 5, 28, 0, 0, 448, 449, 5, 31, 0, 0, 449, 465, 6, 25, -1, 0, 450, 451, 5, 28, 0, 0, 451, 452, 5, 32, 0, 0, 452, 465, 6, 25, -1, 0, 453, 454, 5, 28, 0, 0, 454, 455, 5, 33, 0, 0, 455, 465, 6, 25, -1, 0, 456, 457, 5, 28, 0, 0, 457, 458, 5, 6, 0, 0, 458, 465, 6, 25, -1, 0, 459, 460, 5, 7, 0, 0, 460, 461, 3, 46, 23, 0, 461, 462, 5, 8, 0, 0, 462, 463, 6, 25, -1, 0, 463, 465, 1, 0, 0, 0, 464, 405, 1, 0, 0, 0, 464, 408, 1, 0, 0, 0, 464, 411, 1, 0, 0, 0, 464, 414, 1, 0, 0, 0, 464, 417, 1, 0, 0, 0, 464, 426, 1, 0, 0, 0, 464, 433, 1, 0, 0, 0, 464, 435, 1, 0, 0, 0, 464, 437, 1, 0, 0, 0, 464, 439, 1, 0, 0, 0, 464, 441, 1, 0, 0, 0, 464, 444, 1, 0, 0, 0, 464, 447, 1, 0, 0, 0, 464, 450, 1, 0, 0, 0, 464, 453, 1, 0, 0, 0, 464, 456, 1, 0, 0, 0, 464, 459, 1, 0, 0, 0, 465, 51, 1, 0, 0, 0, 466, 467, 5, 34, 0, 0, 467, 468, 6, 26, -1, 0, 468, 53, 1, 0, 0, 0, 469, 470, 6, 27, -1, 0, 470, 486, 5, 45, 0, 0, 471, 483, 5, 7, 0, 0, 472, 473, 3, 46, 23, 0, 473, 480, 6, 27, -1, 0, 474, 475, 5, 3, 0, 0, 475, 476, 3, 46, 23, 0, 476, 477, 6, 27, -1, 0, 477, 479, 1, 0, 0, 0, 478, 474, 1, 0, 0, 0, 479, 482, 1, 0, 0, 0, 480, 478, 1, 0, 0, 0, 480, 481, 1, 0, 0, 0, 481, 484, 1, 0, 0, 0, 482, 480, 1, 0, 0, 0, 483, 472, 1, 0, 0, 0, 483, 484, 1, 0, 0, 0, 484, 485, 1, 0, 0, 0, 485, 487, 5, 8, 0, 0, 486, 471, 1, 0, 0, 0, 486, 487, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 489, 6, 27, -1, 0, 489, 55, 1, 0, 0, 0, 490, 491, 6, 28, -1, 0, 491, 503, 5, 11, 0, 0, 492, 493, 3, 46, 23, 0, 493, 500, 6, 28, -1, 0, 494, 495, 5, 3, 0, 0, 495, 496, 3, 46, 23, 0, 496, 497, 6, 28, -1, 0, 497, 499, 1, 0, 0, 0, 498, 494, 1, 0, 0, 0, 499, 502, 1, 0, 0, 0, 500, 498, 1, 0, 0, 0, 500, 501, 1, 0, 0, 0, 501, 504, 1, 0, 0, 0, 502, 500, 1, 0, 0, 0, 503, 492, 1, 0, 0, 0, 503, 504, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 506, 5, 12, 0, 0, 506, 507, 6, 28, -1, 0, 507, 57, 1, 0, 0, 0, 508, 509, 6, 29, -1, 0, 509, 521, 5, 9, 0, 0, 510, 511, 3, 46, 23, 0, 511, 518, 6, 29, -1, 0, 512, 513, 5, 3, 0, 0, 513, 514, 3, 46, 23, 0, 514, 515, 6, 29, -1, 0, 515, 517, 1, 0, 0, 0, 516, 512, 1, 0, 0, 0, 517, 520, 1, 0, 0, 0, 518, 516, 1, 0, 0, 0, 518, 519, 1, 0, 0, 0, 519, 522, 1, 0, 0, 0, 520, 518, 1, 0, 0, 0, 521, 510, 1, 0, 0, 0, 521, 522, 1, 0, 0, 0, 522, 523, 1, 0, 0, 0, 523, 524, 5, 10, 0, 0, 524, 525, 6, 29, -1, 0, 525, 59, 1, 0, 0, 0, 526, 527, 5, 35, 0, 0, 527, 528, 3, 18, 9, 0, 528, 529, 5, 36, 0, 0, 529, 530, 3, 62, 31, 0, 530, 531, 5, 37, 0, 0, 531, 532, 6, 30, -1, 0, 532, 61, 1, 0, 0, 0, 533, 534, 6, 31, -1, 0, 534, 535, 3, 64, 32, 0, 535, 542, 6, 31, -1, 0, 536, 537, 5, 38, 0, 0, 537, 538, 3, 64, 32, 0, 538, 539, 6, 31, -1, 0, 539, 541, 1, 0, 0, 0, 540, 536, 1, 0, 0, 0, 541, 544, 1, 0, 0, 0, 542, 540, 1, 0, 0, 0, 542, 543, 1, 0, 0, 0, 543, 63, 1, 0, 0, 0, 544, 542, 1, 0, 0, 0, 545, 546, 3, 46, 23, 0, 546, 547, 6, 32, -1, 0, 547, 548, 5, 39, 0, 0, 548, 549, 3, 2, 1, 0, 549, 550, 6, 32, -1, 0, 550, 65, 1, 0, 0, 0, 551, 552, 5, 44, 0, 0, 552, 556, 6, 33, -1, 0, 553, 554, 5, 43, 0, 0, 554, 556, 6, 33, -1, 0, 555, 551, 1, 0, 0, 0, 555, 553, 1, 0, 0, 0, 556, 67, 1, 0, 0, 0, 40, 79, 85, 90, 98, 104, 117, 129, 134, 140, 154, 168, 181, 187, 196, 209, 221, 277, 289, 292, 307, 310, 326, 329, 332, 344, 357, 365, 398, 423, 429, 464, 480, 483, 486, 500, 503, 518, 521, 542, 555] \ No newline at end of file +[4, 1, 50, 570, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 79, 8, 1, 10, 1, 12, 1, 82, 9, 1, 1, 1, 1, 1, 1, 1, 3, 1, 87, 8, 1, 1, 1, 1, 1, 1, 1, 3, 1, 92, 8, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 102, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 108, 8, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 119, 8, 4, 10, 4, 12, 4, 122, 9, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 133, 8, 5, 1, 6, 1, 6, 1, 6, 3, 6, 138, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 146, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 158, 8, 7, 10, 7, 12, 7, 161, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 174, 8, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 185, 8, 11, 10, 11, 12, 11, 188, 9, 11, 1, 12, 1, 12, 1, 12, 3, 12, 193, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 200, 8, 12, 10, 12, 12, 12, 203, 9, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 215, 8, 13, 10, 13, 12, 13, 218, 9, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 229, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 287, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 297, 8, 15, 10, 15, 12, 15, 300, 9, 15, 3, 15, 302, 8, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 315, 8, 16, 10, 16, 12, 16, 318, 9, 16, 3, 16, 320, 8, 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, 5, 17, 334, 8, 17, 10, 17, 12, 17, 337, 9, 17, 3, 17, 339, 8, 17, 1, 17, 3, 17, 342, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 354, 8, 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, 367, 8, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 375, 8, 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, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 409, 8, 23, 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, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 434, 8, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 440, 8, 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, 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, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 475, 8, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 5, 27, 489, 8, 27, 10, 27, 12, 27, 492, 9, 27, 3, 27, 494, 8, 27, 1, 27, 3, 27, 497, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 5, 28, 509, 8, 28, 10, 28, 12, 28, 512, 9, 28, 3, 28, 514, 8, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 5, 29, 527, 8, 29, 10, 29, 12, 29, 530, 9, 29, 3, 29, 532, 8, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 551, 8, 31, 10, 31, 12, 31, 554, 9, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 3, 33, 568, 8, 33, 1, 33, 0, 0, 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, 0, 607, 0, 68, 1, 0, 0, 0, 2, 72, 1, 0, 0, 0, 4, 101, 1, 0, 0, 0, 6, 103, 1, 0, 0, 0, 8, 112, 1, 0, 0, 0, 10, 125, 1, 0, 0, 0, 12, 134, 1, 0, 0, 0, 14, 151, 1, 0, 0, 0, 16, 162, 1, 0, 0, 0, 18, 167, 1, 0, 0, 0, 20, 175, 1, 0, 0, 0, 22, 178, 1, 0, 0, 0, 24, 189, 1, 0, 0, 0, 26, 228, 1, 0, 0, 0, 28, 286, 1, 0, 0, 0, 30, 288, 1, 0, 0, 0, 32, 306, 1, 0, 0, 0, 34, 324, 1, 0, 0, 0, 36, 345, 1, 0, 0, 0, 38, 374, 1, 0, 0, 0, 40, 376, 1, 0, 0, 0, 42, 383, 1, 0, 0, 0, 44, 390, 1, 0, 0, 0, 46, 408, 1, 0, 0, 0, 48, 410, 1, 0, 0, 0, 50, 474, 1, 0, 0, 0, 52, 476, 1, 0, 0, 0, 54, 479, 1, 0, 0, 0, 56, 500, 1, 0, 0, 0, 58, 518, 1, 0, 0, 0, 60, 536, 1, 0, 0, 0, 62, 543, 1, 0, 0, 0, 64, 555, 1, 0, 0, 0, 66, 567, 1, 0, 0, 0, 68, 69, 3, 2, 1, 0, 69, 70, 6, 0, -1, 0, 70, 71, 5, 0, 0, 1, 71, 1, 1, 0, 0, 0, 72, 91, 6, 1, -1, 0, 73, 74, 3, 4, 2, 0, 74, 80, 6, 1, -1, 0, 75, 76, 3, 4, 2, 0, 76, 77, 6, 1, -1, 0, 77, 79, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 86, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 3, 18, 9, 0, 84, 85, 6, 1, -1, 0, 85, 87, 1, 0, 0, 0, 86, 83, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 92, 1, 0, 0, 0, 88, 89, 3, 18, 9, 0, 89, 90, 6, 1, -1, 0, 90, 92, 1, 0, 0, 0, 91, 73, 1, 0, 0, 0, 91, 88, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 6, 1, -1, 0, 94, 3, 1, 0, 0, 0, 95, 96, 3, 6, 3, 0, 96, 97, 6, 2, -1, 0, 97, 102, 1, 0, 0, 0, 98, 99, 3, 12, 6, 0, 99, 100, 6, 2, -1, 0, 100, 102, 1, 0, 0, 0, 101, 95, 1, 0, 0, 0, 101, 98, 1, 0, 0, 0, 102, 5, 1, 0, 0, 0, 103, 107, 6, 3, -1, 0, 104, 108, 5, 1, 0, 0, 105, 106, 5, 2, 0, 0, 106, 108, 6, 3, -1, 0, 107, 104, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 110, 3, 8, 4, 0, 110, 111, 6, 3, -1, 0, 111, 7, 1, 0, 0, 0, 112, 113, 3, 10, 5, 0, 113, 120, 6, 4, -1, 0, 114, 115, 5, 3, 0, 0, 115, 116, 3, 10, 5, 0, 116, 117, 6, 4, -1, 0, 117, 119, 1, 0, 0, 0, 118, 114, 1, 0, 0, 0, 119, 122, 1, 0, 0, 0, 120, 118, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 123, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 123, 124, 5, 4, 0, 0, 124, 9, 1, 0, 0, 0, 125, 126, 6, 5, -1, 0, 126, 127, 5, 46, 0, 0, 127, 132, 6, 5, -1, 0, 128, 129, 5, 5, 0, 0, 129, 130, 3, 20, 10, 0, 130, 131, 6, 5, -1, 0, 131, 133, 1, 0, 0, 0, 132, 128, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 11, 1, 0, 0, 0, 134, 137, 6, 6, -1, 0, 135, 136, 5, 2, 0, 0, 136, 138, 6, 6, -1, 0, 137, 135, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 140, 5, 6, 0, 0, 140, 141, 5, 46, 0, 0, 141, 145, 5, 7, 0, 0, 142, 143, 3, 14, 7, 0, 143, 144, 6, 6, -1, 0, 144, 146, 1, 0, 0, 0, 145, 142, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 148, 5, 8, 0, 0, 148, 149, 3, 16, 8, 0, 149, 150, 6, 6, -1, 0, 150, 13, 1, 0, 0, 0, 151, 152, 6, 7, -1, 0, 152, 153, 5, 46, 0, 0, 153, 159, 6, 7, -1, 0, 154, 155, 5, 3, 0, 0, 155, 156, 5, 46, 0, 0, 156, 158, 6, 7, -1, 0, 157, 154, 1, 0, 0, 0, 158, 161, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 159, 160, 1, 0, 0, 0, 160, 15, 1, 0, 0, 0, 161, 159, 1, 0, 0, 0, 162, 163, 5, 9, 0, 0, 163, 164, 3, 2, 1, 0, 164, 165, 6, 8, -1, 0, 165, 166, 5, 10, 0, 0, 166, 17, 1, 0, 0, 0, 167, 168, 3, 20, 10, 0, 168, 173, 6, 9, -1, 0, 169, 170, 5, 4, 0, 0, 170, 171, 3, 18, 9, 0, 171, 172, 6, 9, -1, 0, 172, 174, 1, 0, 0, 0, 173, 169, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 19, 1, 0, 0, 0, 175, 176, 3, 22, 11, 0, 176, 177, 6, 10, -1, 0, 177, 21, 1, 0, 0, 0, 178, 179, 3, 24, 12, 0, 179, 186, 6, 11, -1, 0, 180, 181, 3, 66, 33, 0, 181, 182, 3, 24, 12, 0, 182, 183, 6, 11, -1, 0, 183, 185, 1, 0, 0, 0, 184, 180, 1, 0, 0, 0, 185, 188, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 186, 187, 1, 0, 0, 0, 187, 23, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 189, 192, 6, 12, -1, 0, 190, 191, 5, 43, 0, 0, 191, 193, 6, 12, -1, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 195, 3, 28, 14, 0, 195, 201, 6, 12, -1, 0, 196, 197, 3, 26, 13, 0, 197, 198, 6, 12, -1, 0, 198, 200, 1, 0, 0, 0, 199, 196, 1, 0, 0, 0, 200, 203, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 201, 202, 1, 0, 0, 0, 202, 204, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 204, 205, 6, 12, -1, 0, 205, 25, 1, 0, 0, 0, 206, 207, 6, 13, -1, 0, 207, 208, 5, 7, 0, 0, 208, 209, 3, 18, 9, 0, 209, 216, 6, 13, -1, 0, 210, 211, 5, 3, 0, 0, 211, 212, 3, 18, 9, 0, 212, 213, 6, 13, -1, 0, 213, 215, 1, 0, 0, 0, 214, 210, 1, 0, 0, 0, 215, 218, 1, 0, 0, 0, 216, 214, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 219, 1, 0, 0, 0, 218, 216, 1, 0, 0, 0, 219, 220, 5, 8, 0, 0, 220, 229, 1, 0, 0, 0, 221, 222, 5, 7, 0, 0, 222, 229, 5, 8, 0, 0, 223, 224, 5, 11, 0, 0, 224, 225, 3, 18, 9, 0, 225, 226, 6, 13, -1, 0, 226, 227, 5, 12, 0, 0, 227, 229, 1, 0, 0, 0, 228, 206, 1, 0, 0, 0, 228, 221, 1, 0, 0, 0, 228, 223, 1, 0, 0, 0, 229, 27, 1, 0, 0, 0, 230, 231, 5, 49, 0, 0, 231, 287, 6, 14, -1, 0, 232, 233, 5, 48, 0, 0, 233, 287, 6, 14, -1, 0, 234, 235, 5, 47, 0, 0, 235, 287, 6, 14, -1, 0, 236, 237, 5, 46, 0, 0, 237, 287, 6, 14, -1, 0, 238, 239, 5, 13, 0, 0, 239, 287, 6, 14, -1, 0, 240, 241, 5, 14, 0, 0, 241, 287, 6, 14, -1, 0, 242, 243, 5, 15, 0, 0, 243, 244, 3, 66, 33, 0, 244, 245, 6, 14, -1, 0, 245, 287, 1, 0, 0, 0, 246, 247, 5, 6, 0, 0, 247, 248, 5, 7, 0, 0, 248, 249, 6, 14, -1, 0, 249, 250, 3, 14, 7, 0, 250, 251, 6, 14, -1, 0, 251, 252, 5, 8, 0, 0, 252, 253, 3, 16, 8, 0, 253, 254, 6, 14, -1, 0, 254, 287, 1, 0, 0, 0, 255, 256, 5, 16, 0, 0, 256, 287, 6, 14, -1, 0, 257, 258, 5, 7, 0, 0, 258, 259, 3, 2, 1, 0, 259, 260, 5, 8, 0, 0, 260, 261, 6, 14, -1, 0, 261, 287, 1, 0, 0, 0, 262, 263, 3, 32, 16, 0, 263, 264, 6, 14, -1, 0, 264, 287, 1, 0, 0, 0, 265, 266, 3, 30, 15, 0, 266, 267, 6, 14, -1, 0, 267, 287, 1, 0, 0, 0, 268, 269, 3, 34, 17, 0, 269, 270, 6, 14, -1, 0, 270, 287, 1, 0, 0, 0, 271, 272, 3, 36, 18, 0, 272, 273, 6, 14, -1, 0, 273, 287, 1, 0, 0, 0, 274, 275, 3, 40, 20, 0, 275, 276, 6, 14, -1, 0, 276, 287, 1, 0, 0, 0, 277, 278, 3, 42, 21, 0, 278, 279, 6, 14, -1, 0, 279, 287, 1, 0, 0, 0, 280, 281, 3, 44, 22, 0, 281, 282, 6, 14, -1, 0, 282, 287, 1, 0, 0, 0, 283, 284, 3, 60, 30, 0, 284, 285, 6, 14, -1, 0, 285, 287, 1, 0, 0, 0, 286, 230, 1, 0, 0, 0, 286, 232, 1, 0, 0, 0, 286, 234, 1, 0, 0, 0, 286, 236, 1, 0, 0, 0, 286, 238, 1, 0, 0, 0, 286, 240, 1, 0, 0, 0, 286, 242, 1, 0, 0, 0, 286, 246, 1, 0, 0, 0, 286, 255, 1, 0, 0, 0, 286, 257, 1, 0, 0, 0, 286, 262, 1, 0, 0, 0, 286, 265, 1, 0, 0, 0, 286, 268, 1, 0, 0, 0, 286, 271, 1, 0, 0, 0, 286, 274, 1, 0, 0, 0, 286, 277, 1, 0, 0, 0, 286, 280, 1, 0, 0, 0, 286, 283, 1, 0, 0, 0, 287, 29, 1, 0, 0, 0, 288, 289, 6, 15, -1, 0, 289, 301, 5, 11, 0, 0, 290, 291, 3, 18, 9, 0, 291, 298, 6, 15, -1, 0, 292, 293, 5, 3, 0, 0, 293, 294, 3, 18, 9, 0, 294, 295, 6, 15, -1, 0, 295, 297, 1, 0, 0, 0, 296, 292, 1, 0, 0, 0, 297, 300, 1, 0, 0, 0, 298, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 301, 290, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 5, 12, 0, 0, 304, 305, 6, 15, -1, 0, 305, 31, 1, 0, 0, 0, 306, 307, 6, 16, -1, 0, 307, 319, 5, 9, 0, 0, 308, 309, 3, 18, 9, 0, 309, 316, 6, 16, -1, 0, 310, 311, 5, 3, 0, 0, 311, 312, 3, 18, 9, 0, 312, 313, 6, 16, -1, 0, 313, 315, 1, 0, 0, 0, 314, 310, 1, 0, 0, 0, 315, 318, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 320, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 319, 308, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, 5, 10, 0, 0, 322, 323, 6, 16, -1, 0, 323, 33, 1, 0, 0, 0, 324, 325, 6, 17, -1, 0, 325, 341, 5, 45, 0, 0, 326, 338, 5, 7, 0, 0, 327, 328, 3, 18, 9, 0, 328, 335, 6, 17, -1, 0, 329, 330, 5, 3, 0, 0, 330, 331, 3, 18, 9, 0, 331, 332, 6, 17, -1, 0, 332, 334, 1, 0, 0, 0, 333, 329, 1, 0, 0, 0, 334, 337, 1, 0, 0, 0, 335, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 339, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 338, 327, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 342, 5, 8, 0, 0, 341, 326, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 344, 6, 17, -1, 0, 344, 35, 1, 0, 0, 0, 345, 346, 6, 18, -1, 0, 346, 347, 5, 17, 0, 0, 347, 348, 3, 18, 9, 0, 348, 349, 5, 18, 0, 0, 349, 353, 3, 2, 1, 0, 350, 351, 3, 38, 19, 0, 351, 352, 6, 18, -1, 0, 352, 354, 1, 0, 0, 0, 353, 350, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 356, 5, 19, 0, 0, 356, 357, 6, 18, -1, 0, 357, 37, 1, 0, 0, 0, 358, 359, 5, 20, 0, 0, 359, 360, 6, 19, -1, 0, 360, 361, 3, 18, 9, 0, 361, 362, 5, 18, 0, 0, 362, 366, 3, 2, 1, 0, 363, 364, 3, 38, 19, 0, 364, 365, 6, 19, -1, 0, 365, 367, 1, 0, 0, 0, 366, 363, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 369, 6, 19, -1, 0, 369, 375, 1, 0, 0, 0, 370, 371, 5, 21, 0, 0, 371, 372, 3, 2, 1, 0, 372, 373, 6, 19, -1, 0, 373, 375, 1, 0, 0, 0, 374, 358, 1, 0, 0, 0, 374, 370, 1, 0, 0, 0, 375, 39, 1, 0, 0, 0, 376, 377, 5, 22, 0, 0, 377, 378, 3, 18, 9, 0, 378, 379, 5, 23, 0, 0, 379, 380, 3, 2, 1, 0, 380, 381, 5, 24, 0, 0, 381, 382, 6, 20, -1, 0, 382, 41, 1, 0, 0, 0, 383, 384, 5, 23, 0, 0, 384, 385, 3, 2, 1, 0, 385, 386, 5, 22, 0, 0, 386, 387, 3, 18, 9, 0, 387, 388, 5, 24, 0, 0, 388, 389, 6, 21, -1, 0, 389, 43, 1, 0, 0, 0, 390, 391, 5, 25, 0, 0, 391, 392, 6, 22, -1, 0, 392, 393, 3, 2, 1, 0, 393, 394, 5, 3, 0, 0, 394, 395, 3, 18, 9, 0, 395, 396, 5, 3, 0, 0, 396, 397, 3, 18, 9, 0, 397, 398, 5, 23, 0, 0, 398, 399, 3, 2, 1, 0, 399, 400, 5, 24, 0, 0, 400, 401, 6, 22, -1, 0, 401, 45, 1, 0, 0, 0, 402, 403, 3, 48, 24, 0, 403, 404, 6, 23, -1, 0, 404, 409, 1, 0, 0, 0, 405, 406, 3, 50, 25, 0, 406, 407, 6, 23, -1, 0, 407, 409, 1, 0, 0, 0, 408, 402, 1, 0, 0, 0, 408, 405, 1, 0, 0, 0, 409, 47, 1, 0, 0, 0, 410, 411, 3, 50, 25, 0, 411, 412, 5, 26, 0, 0, 412, 413, 3, 46, 23, 0, 413, 414, 6, 24, -1, 0, 414, 49, 1, 0, 0, 0, 415, 416, 3, 52, 26, 0, 416, 417, 6, 25, -1, 0, 417, 475, 1, 0, 0, 0, 418, 419, 3, 54, 27, 0, 419, 420, 6, 25, -1, 0, 420, 475, 1, 0, 0, 0, 421, 422, 3, 56, 28, 0, 422, 423, 6, 25, -1, 0, 423, 475, 1, 0, 0, 0, 424, 425, 3, 58, 29, 0, 425, 426, 6, 25, -1, 0, 426, 475, 1, 0, 0, 0, 427, 428, 5, 46, 0, 0, 428, 433, 6, 25, -1, 0, 429, 430, 5, 27, 0, 0, 430, 431, 3, 46, 23, 0, 431, 432, 6, 25, -1, 0, 432, 434, 1, 0, 0, 0, 433, 429, 1, 0, 0, 0, 433, 434, 1, 0, 0, 0, 434, 435, 1, 0, 0, 0, 435, 475, 6, 25, -1, 0, 436, 439, 6, 25, -1, 0, 437, 438, 5, 43, 0, 0, 438, 440, 6, 25, -1, 0, 439, 437, 1, 0, 0, 0, 439, 440, 1, 0, 0, 0, 440, 441, 1, 0, 0, 0, 441, 442, 5, 49, 0, 0, 442, 475, 6, 25, -1, 0, 443, 444, 5, 48, 0, 0, 444, 475, 6, 25, -1, 0, 445, 446, 5, 47, 0, 0, 446, 475, 6, 25, -1, 0, 447, 448, 5, 13, 0, 0, 448, 475, 6, 25, -1, 0, 449, 450, 5, 14, 0, 0, 450, 475, 6, 25, -1, 0, 451, 452, 5, 28, 0, 0, 452, 453, 5, 29, 0, 0, 453, 475, 6, 25, -1, 0, 454, 455, 5, 28, 0, 0, 455, 456, 5, 30, 0, 0, 456, 475, 6, 25, -1, 0, 457, 458, 5, 28, 0, 0, 458, 459, 5, 31, 0, 0, 459, 475, 6, 25, -1, 0, 460, 461, 5, 28, 0, 0, 461, 462, 5, 32, 0, 0, 462, 475, 6, 25, -1, 0, 463, 464, 5, 28, 0, 0, 464, 465, 5, 33, 0, 0, 465, 475, 6, 25, -1, 0, 466, 467, 5, 28, 0, 0, 467, 468, 5, 6, 0, 0, 468, 475, 6, 25, -1, 0, 469, 470, 5, 7, 0, 0, 470, 471, 3, 46, 23, 0, 471, 472, 5, 8, 0, 0, 472, 473, 6, 25, -1, 0, 473, 475, 1, 0, 0, 0, 474, 415, 1, 0, 0, 0, 474, 418, 1, 0, 0, 0, 474, 421, 1, 0, 0, 0, 474, 424, 1, 0, 0, 0, 474, 427, 1, 0, 0, 0, 474, 436, 1, 0, 0, 0, 474, 443, 1, 0, 0, 0, 474, 445, 1, 0, 0, 0, 474, 447, 1, 0, 0, 0, 474, 449, 1, 0, 0, 0, 474, 451, 1, 0, 0, 0, 474, 454, 1, 0, 0, 0, 474, 457, 1, 0, 0, 0, 474, 460, 1, 0, 0, 0, 474, 463, 1, 0, 0, 0, 474, 466, 1, 0, 0, 0, 474, 469, 1, 0, 0, 0, 475, 51, 1, 0, 0, 0, 476, 477, 5, 34, 0, 0, 477, 478, 6, 26, -1, 0, 478, 53, 1, 0, 0, 0, 479, 480, 6, 27, -1, 0, 480, 496, 5, 45, 0, 0, 481, 493, 5, 7, 0, 0, 482, 483, 3, 46, 23, 0, 483, 490, 6, 27, -1, 0, 484, 485, 5, 3, 0, 0, 485, 486, 3, 46, 23, 0, 486, 487, 6, 27, -1, 0, 487, 489, 1, 0, 0, 0, 488, 484, 1, 0, 0, 0, 489, 492, 1, 0, 0, 0, 490, 488, 1, 0, 0, 0, 490, 491, 1, 0, 0, 0, 491, 494, 1, 0, 0, 0, 492, 490, 1, 0, 0, 0, 493, 482, 1, 0, 0, 0, 493, 494, 1, 0, 0, 0, 494, 495, 1, 0, 0, 0, 495, 497, 5, 8, 0, 0, 496, 481, 1, 0, 0, 0, 496, 497, 1, 0, 0, 0, 497, 498, 1, 0, 0, 0, 498, 499, 6, 27, -1, 0, 499, 55, 1, 0, 0, 0, 500, 501, 6, 28, -1, 0, 501, 513, 5, 11, 0, 0, 502, 503, 3, 46, 23, 0, 503, 510, 6, 28, -1, 0, 504, 505, 5, 3, 0, 0, 505, 506, 3, 46, 23, 0, 506, 507, 6, 28, -1, 0, 507, 509, 1, 0, 0, 0, 508, 504, 1, 0, 0, 0, 509, 512, 1, 0, 0, 0, 510, 508, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 514, 1, 0, 0, 0, 512, 510, 1, 0, 0, 0, 513, 502, 1, 0, 0, 0, 513, 514, 1, 0, 0, 0, 514, 515, 1, 0, 0, 0, 515, 516, 5, 12, 0, 0, 516, 517, 6, 28, -1, 0, 517, 57, 1, 0, 0, 0, 518, 519, 6, 29, -1, 0, 519, 531, 5, 9, 0, 0, 520, 521, 3, 46, 23, 0, 521, 528, 6, 29, -1, 0, 522, 523, 5, 3, 0, 0, 523, 524, 3, 46, 23, 0, 524, 525, 6, 29, -1, 0, 525, 527, 1, 0, 0, 0, 526, 522, 1, 0, 0, 0, 527, 530, 1, 0, 0, 0, 528, 526, 1, 0, 0, 0, 528, 529, 1, 0, 0, 0, 529, 532, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 531, 520, 1, 0, 0, 0, 531, 532, 1, 0, 0, 0, 532, 533, 1, 0, 0, 0, 533, 534, 5, 10, 0, 0, 534, 535, 6, 29, -1, 0, 535, 59, 1, 0, 0, 0, 536, 537, 5, 35, 0, 0, 537, 538, 3, 18, 9, 0, 538, 539, 5, 36, 0, 0, 539, 540, 3, 62, 31, 0, 540, 541, 5, 37, 0, 0, 541, 542, 6, 30, -1, 0, 542, 61, 1, 0, 0, 0, 543, 544, 6, 31, -1, 0, 544, 545, 3, 64, 32, 0, 545, 552, 6, 31, -1, 0, 546, 547, 5, 38, 0, 0, 547, 548, 3, 64, 32, 0, 548, 549, 6, 31, -1, 0, 549, 551, 1, 0, 0, 0, 550, 546, 1, 0, 0, 0, 551, 554, 1, 0, 0, 0, 552, 550, 1, 0, 0, 0, 552, 553, 1, 0, 0, 0, 553, 63, 1, 0, 0, 0, 554, 552, 1, 0, 0, 0, 555, 556, 6, 32, -1, 0, 556, 557, 3, 46, 23, 0, 557, 558, 6, 32, -1, 0, 558, 559, 5, 39, 0, 0, 559, 560, 3, 2, 1, 0, 560, 561, 6, 32, -1, 0, 561, 562, 6, 32, -1, 0, 562, 65, 1, 0, 0, 0, 563, 564, 5, 44, 0, 0, 564, 568, 6, 33, -1, 0, 565, 566, 5, 43, 0, 0, 566, 568, 6, 33, -1, 0, 567, 563, 1, 0, 0, 0, 567, 565, 1, 0, 0, 0, 568, 67, 1, 0, 0, 0, 40, 80, 86, 91, 101, 107, 120, 132, 137, 145, 159, 173, 186, 192, 201, 216, 228, 286, 298, 301, 316, 319, 335, 338, 341, 353, 366, 374, 408, 433, 439, 474, 490, 493, 496, 510, 513, 528, 531, 552, 567] \ No newline at end of file diff --git a/src/main/java/org/programsnail/truffle_lama/parser/LamaNodeFactory.java b/src/main/java/org/programsnail/truffle_lama/parser/LamaNodeFactory.java index a4a9067..9058b07 100644 --- a/src/main/java/org/programsnail/truffle_lama/parser/LamaNodeFactory.java +++ b/src/main/java/org/programsnail/truffle_lama/parser/LamaNodeFactory.java @@ -1,6 +1,5 @@ package org.programsnail.truffle_lama.parser; -import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.api.frame.FrameDescriptor; import com.oracle.truffle.api.frame.FrameSlotKind; import com.oracle.truffle.api.source.Source; @@ -9,6 +8,7 @@ import org.antlr.v4.runtime.Token; import org.programsnail.truffle_lama.LamaLanguage; import org.programsnail.truffle_lama.LamaStrings; import org.programsnail.truffle_lama.nodes.LamaExpressionNode; +import org.programsnail.truffle_lama.nodes.LamaRootNode; import org.programsnail.truffle_lama.nodes.controlflow.LamaCaseNode; import org.programsnail.truffle_lama.nodes.controlflow.LamaDoWhileNode; import org.programsnail.truffle_lama.nodes.controlflow.LamaIfNode; @@ -132,7 +132,7 @@ public class LamaNodeFactory { // --- public boolean isGlobal() { - return outer == null; + return top == null; } public boolean isFramed() { @@ -261,31 +261,102 @@ public class LamaNodeFactory { private final Source source; private final TruffleString sourceString; - /* State while parsing an expr. */ private LexicalScope lexicalScope; private final LamaLanguage language; + private LamaExpressionNode rootExpr; + + private enum InfixKind { + LEFT, + RIGHT, + NONE, + } + + private Map infixPriorities; + private Map infixKinds; public LamaNodeFactory(LamaLanguage language, Source source) { this.language = language; this.source = source; this.sourceString = LamaStrings.fromJavaString(source.getCharacters().toString()); - lexicalScope = new LexicalScope(null, LexicalScope.Kind.FUNCTION); // same to top level + this.lexicalScope = new LexicalScope(null, LexicalScope.Kind.FUNCTION); // same to top level + + infixPriorities = new HashMap<>(); + infixKinds = new HashMap<>(); } // --- + public void enterScope() { + enterScope(LexicalScope.Kind.INNER_SCOPE); + } + public void enterScope(LexicalScope.Kind kind) { lexicalScope = new LexicalScope(lexicalScope, kind); } public void exitScope() { + // TODO: save vars to clear them & create corresponding scope node ?? lexicalScope = lexicalScope.getOuter(); } // --- + // TODO: custom infixes: non-0integer indices (at, before, after) + // NOTE: very slow implementation, can be optimized + LamaExpressionNode createInfixArrayRecursive(List oprs, List exprs) { + assert oprs.size() == exprs.size() - 1; + + if (exprs.size() == 1) { + return exprs.getFirst(); + } + + if (exprs.size() == 2) { + return createAnyBinopNode(oprs.getFirst(), exprs.getFirst(), exprs.getLast()); + } + + int splitIndex = 0; + { + String splitOpr = null; + int splitPriority = 0; + InfixKind splitKind = null; + for (int i = 0; i < oprs.size(); ++i) { + String currentSplitOpr = oprs.get(i).getText(); + if (Objects.equals(splitOpr, currentSplitOpr)) { + if (splitKind == InfixKind.RIGHT) { // TODO: check left or right + splitIndex = i; + continue; + } + if (splitKind == InfixKind.NONE) { + throw new LamaException("Operator '" + splitOpr + "' can't be chained"); + } + } + + Integer currentSplitPriority = infixPriorities.get(currentSplitOpr); + if (currentSplitPriority == null) { + throw new LamaException("Unknown operator '" + splitOpr + "' (split priority)"); + } + + if (splitOpr == null || currentSplitPriority > splitPriority) { // TODO: check < or > + splitOpr = currentSplitOpr; + splitPriority = currentSplitPriority; + splitKind = infixKinds.get(splitOpr); + if (splitKind == null) { + throw new LamaException("Unknown operator '" + splitOpr + "' (split kind)"); + } + } + } + } + + LamaExpressionNode leftExpr = createInfixArrayRecursive(oprs.subList(0, splitIndex), exprs.subList(0, splitIndex + 1)); + LamaExpressionNode rightExpr = createInfixArrayRecursive(oprs.subList(splitIndex + 1, oprs.size()), exprs.subList(splitIndex + 1, exprs.size())); + + return createAnyBinopNode(oprs.get(splitIndex), leftExpr, rightExpr); + } + + // --- + // TODO: add to parser - public void AddFunctionArguments(Token[] args) { + public void addFunctionArguments(List args) { for (Token arg : args) { lexicalScope.addArgument(arg.getText()); } @@ -327,7 +398,7 @@ public class LamaNodeFactory { public LamaExpressionNode createVarNode(Token token) { String name = token.getText(); - int slot = lexicalScope.add(name); // TODO: check if not arg ?? + int slot = lexicalScope.add(name); return addSrcFromToken(lexicalScope.isGlobal() /*global scope*/ ? new LamaGlobalVarNode(name) : new LamaLocalVarNode(slot), token); @@ -340,6 +411,10 @@ public class LamaNodeFactory { // TODO: fix assignment in parser public LamaExpressionNode createAssignVarNode(Token token, LamaExpressionNode value) { var definition = createVarNode(token); + if (value == null) { + return definition; + } + var reference = createRefNode(token); var assignment = createAssignNode(reference, value); return createSeqNode(definition, assignment); @@ -353,11 +428,14 @@ public class LamaNodeFactory { public LamaExpressionNode createAnyBinopNode(Token opToken, LamaExpressionNode left, LamaExpressionNode right) { String op = opToken.getText(); return switch (op) { + // case ":" -> // TODO: cons case ":=" -> createAssignNode(left, right); case "+", "-", "/", "%", "<", "<=", ">", ">=", "==", "!=", "&&", "!!" -> createBinopNode(opToken, left, right); - default -> createCallNode(createRefNode(opToken), new LamaExpressionNode[]{left, right}); + default -> createCallNode( + createRefNode(opToken), + List.of(new LamaExpressionNode[]{left, right})); }; } @@ -366,6 +444,11 @@ public class LamaNodeFactory { return addSrcFromNodes(LamaBinopNodeGen.create(left, right, op), left, right); } + public LamaExpressionNode createElemValueNode(LamaExpressionNode array, LamaExpressionNode index) { + // TODO: replace with separate node for more efficiency + return createElemRefOrValueNode(array, index, true); + } + public LamaExpressionNode createElemRefOrValueNode(LamaExpressionNode array, LamaExpressionNode index, boolean doUnref) { return addUnref(createElemRefNode(array, index), doUnref); } @@ -374,8 +457,16 @@ public class LamaNodeFactory { return addSrcFromNodes(LamaElemRefNodeGen.create(array, index), array, index); } - public LamaExpressionNode createCallNode(LamaExpressionNode func, LamaExpressionNode[] args) { - return addSrcFromNodes(new LamaCallNode(func, args), func, args.length > 0 ? args[args.length - 1] : func); + public LamaExpressionNode createCallNode(LamaExpressionNode func, List args) { + return addSrcFromNodes( + new LamaCallNode(func, args.toArray(new LamaExpressionNode[0])), + func, + args.isEmpty() ? func : args.getLast()); + } + + public LamaExpressionNode createValueNode(Token token) { + // TODO: replace with separate node for more efficiency + return createRefOrValueNode(token, true); } public LamaExpressionNode createRefOrValueNode(Token token, boolean doUnref) { @@ -407,27 +498,28 @@ public class LamaNodeFactory { return addSrcFromToken(new LamaSkipNode(), token); } - public LamaExpressionNode createArrayNode(LamaExpressionNode[] elems) { - LamaExpressionNode result = new LamaArrayNode(elems); - return elems.length > 0 ? addSrcFromNodes(result, elems[0], elems[elems.length - 1]) : result; + public LamaExpressionNode createArrayNode(List elems) { + LamaExpressionNode[] elemsArray = elems.toArray(new LamaExpressionNode[0]); + LamaExpressionNode result = new LamaArrayNode(elemsArray); + return elems.isEmpty() ? result : addSrcFromNodes(result, elems.getFirst(), elems.getLast()); } // sexps-pairs with tag 'cons' - public LamaExpressionNode createListSexpNode(LamaExpressionNode[] elems) { + public LamaExpressionNode createListSexpNode(List elems) { LamaExpressionNode result = new LamaConstNode(0); - for (int i = elems.length - 1; i >= 0; --i) { - result = new LamaSexpNode(LamaStrings.fromJavaString("cons"), new LamaExpressionNode[]{elems[i], result}); + for (int i = elems.size() - 1; i >= 0; --i) { + result = new LamaSexpNode(LamaStrings.fromJavaString("cons"), new LamaExpressionNode[]{elems.get(i), result}); } - return elems.length > 0 ? addSrcFromNodes(result, elems[0], elems[elems.length - 1]) : result; + return elems.isEmpty() ? result : addSrcFromNodes(result, elems.getFirst(), elems.getLast()); } - public LamaExpressionNode createSexpNode(Token tag, LamaExpressionNode[] elems) { - LamaExpressionNode result = new LamaSexpNode(LamaStrings.fromJavaString(tag.getText()), elems); - return elems.length > 0 ? addSrcFromNodes(result, elems[0]/*TODO: use tag instead*/, elems[elems.length - 1]) : addSrcFromToken(result, tag); + public LamaExpressionNode createSexpNode(Token tag, List elems) { + LamaExpressionNode result = new LamaSexpNode(LamaStrings.fromJavaString(tag.getText()), elems.toArray(new LamaExpressionNode[0])); + return elems.isEmpty() ? addSrcFromToken(result, tag) : addSrcFromTokenAndNode(result, tag, elems.getLast()); } public LamaExpressionNode createIfNode(LamaExpressionNode condition, LamaExpressionNode doThen, LamaExpressionNode doElse) { - return addSrcFromNodes(new LamaIfNode(condition, doThen, doElse), condition, doElse); + return addSrcFromNodes(new LamaIfNode(condition, doThen, doElse), condition, doElse == null ? doThen : doElse); } public LamaExpressionNode createWhileNode(LamaExpressionNode condition, LamaExpressionNode body) { @@ -438,10 +530,16 @@ public class LamaNodeFactory { return addSrcFromNodes(new LamaDoWhileNode(condition, body), condition, body); } - public LamaExpressionNode createCaseNode(LamaExpressionNode value, LamaPattern[] patterns, LamaExpressionNode[] exprs) { - assert patterns.length == exprs.length; - assert patterns.length > 0; - return addSrcFromNodes(new LamaCaseNode(value, patterns, exprs), value, exprs[exprs.length - 1]); + public LamaExpressionNode createCaseNode(LamaExpressionNode value, List patterns, List exprs) { + assert patterns.size() == exprs.size(); + assert !patterns.isEmpty(); + return addSrcFromNodes( + new LamaCaseNode( + value, + patterns.toArray(new LamaPattern[0]), + exprs.toArray(new LamaExpressionNode[0])), + value, + exprs.getLast()); } // --- @@ -450,19 +548,23 @@ public class LamaNodeFactory { return new LamaWildcardPattern(); } - public LamaPattern createSexpPattern(Token tag, LamaPattern[] elems) { - return new LamaSexpPattern(LamaStrings.fromJavaString(tag.getText()), elems); + public LamaPattern createSexpConsPattern(LamaPattern leftElem, LamaPattern rightElem) { + return new LamaSexpPattern(LamaStrings.fromJavaString("cons"), new LamaPattern[]{leftElem, rightElem}); } - public LamaPattern createArrayPattern(LamaPattern[] elems) { - return new LamaArrayPattern(elems); + public LamaPattern createSexpPattern(Token tag, List elems) { + return new LamaSexpPattern(LamaStrings.fromJavaString(tag.getText()), elems.toArray(new LamaPattern[0])); + } + + public LamaPattern createArrayPattern(List elems) { + return new LamaArrayPattern(elems.toArray(new LamaPattern[0])); } // sexps-pairs with tag 'cons' - public LamaPattern createListSexpPattern(LamaPattern[] elems) { + public LamaPattern createListSexpPattern(List elems) { LamaPattern result = new LamaConstPattern(0); - for (int i = elems.length - 1; i >= 0; --i) { - result = new LamaSexpPattern(LamaStrings.fromJavaString("cons"), new LamaPattern[]{elems[i], result}); + for (int i = elems.size() - 1; i >= 0; --i) { + result = new LamaSexpPattern(LamaStrings.fromJavaString("cons"), new LamaPattern[]{elems.get(i), result}); } return result; } @@ -473,6 +575,10 @@ public class LamaNodeFactory { return new LamaNamedPattern(frameSlot, pattern); } + public LamaPattern createValueConstPattern(Token token, long value) { + return new LamaConstPattern(value); + } + public LamaPattern createConstPattern(Token token) { return new LamaConstPattern(Long.parseLong(token.getText())); } @@ -547,9 +653,12 @@ public class LamaNodeFactory { // --- - public LamaExpressionNode getRootExpr() { - // TODO - return null; + public void setRootExpr(LamaExpressionNode expr) { + this.rootExpr = expr; + } + + public LamaRootNode getRootExpr() { + return new LamaRootNode(language, this.rootExpr); } diff --git a/src/main/java/org/programsnail/truffle_lama/parser/LamaParser.java b/src/main/java/org/programsnail/truffle_lama/parser/LamaParser.java index f6ee9c8..d1346eb 100644 --- a/src/main/java/org/programsnail/truffle_lama/parser/LamaParser.java +++ b/src/main/java/org/programsnail/truffle_lama/parser/LamaParser.java @@ -6,3387 +6,3814 @@ package org.programsnail.truffle_lama.parser; import java.util.Optional; import java.util.ArrayList; import java.util.List; -import java.util.Map; +import java.util.Objects; -import com.oracle.truffle.api.RootCallTarget; import com.oracle.truffle.api.source.Source; import com.oracle.truffle.api.strings.TruffleString; import org.programsnail.truffle_lama.LamaLanguage; import org.programsnail.truffle_lama.nodes.LamaExpressionNode; +import org.programsnail.truffle_lama.nodes.LamaRootNode; +import org.programsnail.truffle_lama.nodes.pattern.LamaPattern; import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.misc.*; import org.antlr.v4.runtime.tree.*; + import java.util.List; import java.util.Iterator; import java.util.ArrayList; @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue", "this-escape"}) public class LamaParser extends Parser { - static { RuntimeMetaData.checkVersion("4.13.2", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static final int - T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, - T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, - T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, - T__24=25, T__25=26, T__26=27, T__27=28, T__28=29, T__29=30, T__30=31, - T__31=32, T__32=33, T__33=34, T__34=35, T__35=36, T__36=37, T__37=38, - T__38=39, WS=40, COMMENT=41, LINE_COMMENT=42, MINUS=43, INFIX=44, UIDENT=45, - LIDENT=46, CHAR_LITERAL=47, STRING_LITERAL=48, DECIMAL_LITERAL=49, WORD=50; - public static final int - RULE_lama = 0, RULE_scope_expression = 1, RULE_definition = 2, RULE_variable_definition = 3, - RULE_variable_definition_sequence = 4, RULE_variable_definition_item = 5, - RULE_function_definition = 6, RULE_function_arguments = 7, RULE_function_body = 8, - RULE_expression = 9, RULE_basic_expression = 10, RULE_binary_expression = 11, - RULE_postfix_expression = 12, RULE_postfix = 13, RULE_primary = 14, RULE_array_expression = 15, - RULE_list_expression = 16, RULE_s_expression = 17, RULE_if_expression = 18, - RULE_else_part = 19, RULE_while_do_expression = 20, RULE_do_while_expression = 21, - RULE_for_expression = 22, RULE_pattern = 23, RULE_cons_pattern = 24, RULE_simple_pattern = 25, - RULE_wildcard_pattern = 26, RULE_s_expr_pattern = 27, RULE_array_pattern = 28, - RULE_list_pattern = 29, RULE_case_expression = 30, RULE_case_branches = 31, - RULE_case_branch = 32, RULE_any_infix = 33; - private static String[] makeRuleNames() { - return new String[] { - "lama", "scope_expression", "definition", "variable_definition", "variable_definition_sequence", - "variable_definition_item", "function_definition", "function_arguments", - "function_body", "expression", "basic_expression", "binary_expression", - "postfix_expression", "postfix", "primary", "array_expression", "list_expression", - "s_expression", "if_expression", "else_part", "while_do_expression", - "do_while_expression", "for_expression", "pattern", "cons_pattern", "simple_pattern", - "wildcard_pattern", "s_expr_pattern", "array_pattern", "list_pattern", - "case_expression", "case_branches", "case_branch", "any_infix" - }; - } - public static final String[] ruleNames = makeRuleNames(); - - private static String[] makeLiteralNames() { - return new String[] { - null, "'var'", "'public'", "','", "';'", "'='", "'fun'", "'('", "')'", - "'{'", "'}'", "'['", "']'", "'true'", "'false'", "'infix'", "'skip'", - "'if'", "'then'", "'fi'", "'elif'", "'else'", "'while'", "'do'", "'od'", - "'for'", "':'", "'@'", "'#'", "'box'", "'val'", "'str'", "'array'", "'sexp'", - "'_'", "'case'", "'of'", "'esac'", "'|'", "'->'", null, null, null, "'-'" - }; - } - private static final String[] _LITERAL_NAMES = makeLiteralNames(); - private static String[] makeSymbolicNames() { - return new String[] { - null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, "WS", "COMMENT", "LINE_COMMENT", "MINUS", "INFIX", - "UIDENT", "LIDENT", "CHAR_LITERAL", "STRING_LITERAL", "DECIMAL_LITERAL", - "WORD" - }; - } - private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); - public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); - - /** - * @deprecated Use {@link #VOCABULARY} instead. - */ - @Deprecated - public static final String[] tokenNames; - static { - tokenNames = new String[_SYMBOLIC_NAMES.length]; - for (int i = 0; i < tokenNames.length; i++) { - tokenNames[i] = VOCABULARY.getLiteralName(i); - if (tokenNames[i] == null) { - tokenNames[i] = VOCABULARY.getSymbolicName(i); - } - - if (tokenNames[i] == null) { - tokenNames[i] = ""; - } - } - } - - @Override - @Deprecated - public String[] getTokenNames() { - return tokenNames; - } - - @Override - - public Vocabulary getVocabulary() { - return VOCABULARY; - } - - @Override - public String getGrammarFileName() { return "Lama.g4"; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public ATN getATN() { return _ATN; } - - - private LamaNodeFactory factory; - private Source source; - - private static final class BailoutErrorListener extends BaseErrorListener { - private final Source source; - BailoutErrorListener(Source source) { - this.source = source; - } - @Override - public void syntaxError(Recognizer recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) { - throwParseError(source, line, charPositionInLine, (Token) offendingSymbol, msg); - } - } - - public void SemErr(Token token, String message) { - assert token != null; - throwParseError(source, token.getLine(), token.getCharPositionInLine(), token, message); - } - - private static void throwParseError(Source source, int line, int charPositionInLine, Token token, String message) { - int col = charPositionInLine + 1; - String location = "-- line " + line + " col " + col + ": "; - int length = token == null ? 1 : Math.max(token.getStopIndex() - token.getStartIndex(), 0); - throw new LamaParseError(source, line, col, length, String.format("Error(s) parsing script:%n" + location + message)); - } - - public static LamaExpressionNode parseLama(LamaLanguage language, Source source) { - LamaLexer lexer = new LamaLexer(CharStreams.fromString(source.getCharacters().toString())); - LamaParser parser = new LamaParser(new CommonTokenStream(lexer)); - lexer.removeErrorListeners(); - parser.removeErrorListeners(); - BailoutErrorListener listener = new BailoutErrorListener(source); - lexer.addErrorListener(listener); - parser.addErrorListener(listener); - parser.factory = new LamaNodeFactory(language, source); - parser.source = source; - parser.lama(); - return parser.factory.getRootExpr(); - } - - public LamaParser(TokenStream input) { - super(input); - _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - - @SuppressWarnings("CheckReturnValue") - public static class LamaContext extends ParserRuleContext { - public LamaExpressionNode result; - public Scope_expressionContext scope_expression; - public Scope_expressionContext scope_expression() { - return getRuleContext(Scope_expressionContext.class,0); - } - public TerminalNode EOF() { return getToken(LamaParser.EOF, 0); } - public LamaContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_lama; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterLama(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitLama(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitLama(this); - else return visitor.visitChildren(this); - } - } - - public final LamaContext lama() throws RecognitionException { - LamaContext _localctx = new LamaContext(_ctx, getState()); - enterRule(_localctx, 0, RULE_lama); - try { - enterOuterAlt(_localctx, 1); - { - setState(68); - ((LamaContext)_localctx).scope_expression = scope_expression(); - ((LamaContext)_localctx).result = ((LamaContext)_localctx).scope_expression.result; - setState(70); - match(EOF); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Scope_expressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public ExpressionContext expression; - public List definition() { - return getRuleContexts(DefinitionContext.class); - } - public DefinitionContext definition(int i) { - return getRuleContext(DefinitionContext.class,i); - } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public Scope_expressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_scope_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterScope_expression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitScope_expression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitScope_expression(this); - else return visitor.visitChildren(this); - } - } - - public final Scope_expressionContext scope_expression() throws RecognitionException { - Scope_expressionContext _localctx = new Scope_expressionContext(_ctx, getState()); - enterRule(_localctx, 2, RULE_scope_expression); - try { - int _alt; - setState(90); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(72); - definition(); - ((Scope_expressionContext)_localctx).result = ((Scope_expressionContext)_localctx).expression.result; - setState(79); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,0,_ctx); - while ( _alt!=2 && _alt!= ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(74); - definition(); - ((Scope_expressionContext)_localctx).result = factory.createSeqNode(_localctx.result, ((Scope_expressionContext)_localctx).expression.result); - } - } - } - setState(81); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,0,_ctx); - } - setState(85); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) { - case 1: - { - setState(82); - ((Scope_expressionContext)_localctx).expression = expression(); - ((Scope_expressionContext)_localctx).result = factory.createSeqNode(_localctx.result, ((Scope_expressionContext)_localctx).expression.result); - } - break; - } - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(87); - ((Scope_expressionContext)_localctx).expression = expression(); - ((Scope_expressionContext)_localctx).result = ((Scope_expressionContext)_localctx).expression.result; - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class DefinitionContext extends ParserRuleContext { - public LamaExpressionNode result; - public Variable_definitionContext variable_definition; - public Function_definitionContext function_definition; - public Variable_definitionContext variable_definition() { - return getRuleContext(Variable_definitionContext.class,0); - } - public Function_definitionContext function_definition() { - return getRuleContext(Function_definitionContext.class,0); - } - public DefinitionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_definition; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterDefinition(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitDefinition(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitDefinition(this); - else return visitor.visitChildren(this); - } - } - - public final DefinitionContext definition() throws RecognitionException { - DefinitionContext _localctx = new DefinitionContext(_ctx, getState()); - enterRule(_localctx, 4, RULE_definition); - try { - setState(98); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(92); - ((DefinitionContext)_localctx).variable_definition = variable_definition(); - ((DefinitionContext)_localctx).result = ((DefinitionContext)_localctx).variable_definition.result; - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(95); - ((DefinitionContext)_localctx).function_definition = function_definition(); - ((DefinitionContext)_localctx).result = ((DefinitionContext)_localctx).function_definition.result; - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Variable_definitionContext extends ParserRuleContext { - public LamaExpressionNode result; - public Variable_definition_sequenceContext variable_definition_sequence; - public Variable_definition_sequenceContext variable_definition_sequence() { - return getRuleContext(Variable_definition_sequenceContext.class,0); - } - public Variable_definitionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_variable_definition; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterVariable_definition(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitVariable_definition(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitVariable_definition(this); - else return visitor.visitChildren(this); - } - } - - public final Variable_definitionContext variable_definition() throws RecognitionException { - Variable_definitionContext _localctx = new Variable_definitionContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_variable_definition); - try { - enterOuterAlt(_localctx, 1); - { - boolean is_public = false; - setState(104); - _errHandler.sync(this); - switch (_input.LA(1)) { - case T__0: - { - setState(101); - match(T__0); - } - break; - case T__1: - { - setState(102); - match(T__1); - is_public = true; - } - break; - default: - throw new NoViableAltException(this); - } - setState(106); - ((Variable_definitionContext)_localctx).variable_definition_sequence = variable_definition_sequence(is_public); - ((Variable_definitionContext)_localctx).result = ((Variable_definitionContext)_localctx).variable_definition_sequence.result; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Variable_definition_sequenceContext extends ParserRuleContext { - public boolean is_public; - public LamaExpressionNode result; - public Variable_definition_itemContext variable_definition_item; - public List variable_definition_item() { - return getRuleContexts(Variable_definition_itemContext.class); - } - public Variable_definition_itemContext variable_definition_item(int i) { - return getRuleContext(Variable_definition_itemContext.class,i); - } - public Variable_definition_sequenceContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } - public Variable_definition_sequenceContext(ParserRuleContext parent, int invokingState, boolean is_public) { - super(parent, invokingState); - this.is_public = is_public; - } - @Override public int getRuleIndex() { return RULE_variable_definition_sequence; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterVariable_definition_sequence(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitVariable_definition_sequence(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitVariable_definition_sequence(this); - else return visitor.visitChildren(this); - } - } - - public final Variable_definition_sequenceContext variable_definition_sequence(boolean is_public) throws RecognitionException { - Variable_definition_sequenceContext _localctx = new Variable_definition_sequenceContext(_ctx, getState(), is_public); - enterRule(_localctx, 8, RULE_variable_definition_sequence); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(109); - ((Variable_definition_sequenceContext)_localctx).variable_definition_item = variable_definition_item(); - ((Variable_definition_sequenceContext)_localctx).result = factory.createVarNode(((Variable_definition_sequenceContext)_localctx).variable_definition_item.name, ((Variable_definition_sequenceContext)_localctx).variable_definition_item.expr); - setState(117); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__2) { - { - { - setState(111); - match(T__2); - setState(112); - ((Variable_definition_sequenceContext)_localctx).variable_definition_item = variable_definition_item(); - ((Variable_definition_sequenceContext)_localctx).result = factory.createSeqNode(_localctx.result, factory.createVarNode(((Variable_definition_sequenceContext)_localctx).variable_definition_item.name, ((Variable_definition_sequenceContext)_localctx).variable_definition_item.expr)); - } - } - setState(119); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(120); - match(T__3); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Variable_definition_itemContext extends ParserRuleContext { - public TruffleString name; - public Optional expr; - public Token LIDENT; - public Basic_expressionContext basic_expression; - public TerminalNode LIDENT() { return getToken(LamaParser.LIDENT, 0); } - public Basic_expressionContext basic_expression() { - return getRuleContext(Basic_expressionContext.class,0); - } - public Variable_definition_itemContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_variable_definition_item; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterVariable_definition_item(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitVariable_definition_item(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitVariable_definition_item(this); - else return visitor.visitChildren(this); - } - } - - public final Variable_definition_itemContext variable_definition_item() throws RecognitionException { - Variable_definition_itemContext _localctx = new Variable_definition_itemContext(_ctx, getState()); - enterRule(_localctx, 10, RULE_variable_definition_item); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - ((Variable_definition_itemContext)_localctx).expr = Optional.empty(); - setState(123); - ((Variable_definition_itemContext)_localctx).LIDENT = match(LIDENT); - ((Variable_definition_itemContext)_localctx).name = ((Variable_definition_itemContext)_localctx).LIDENT; - setState(129); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__4) { - { - setState(125); - match(T__4); - setState(126); - ((Variable_definition_itemContext)_localctx).basic_expression = basic_expression(); - ((Variable_definition_itemContext)_localctx).expr = Optional.of(((Variable_definition_itemContext)_localctx).basic_expression.result); - } - } - - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Function_definitionContext extends ParserRuleContext { - public LamaExpressionNode result; - public Token LIDENT; - public Function_argumentsContext function_arguments; - public Function_bodyContext function_body; - public TerminalNode LIDENT() { return getToken(LamaParser.LIDENT, 0); } - public Function_bodyContext function_body() { - return getRuleContext(Function_bodyContext.class,0); - } - public Function_argumentsContext function_arguments() { - return getRuleContext(Function_argumentsContext.class,0); - } - public Function_definitionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_function_definition; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterFunction_definition(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitFunction_definition(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitFunction_definition(this); - else return visitor.visitChildren(this); - } - } - - public final Function_definitionContext function_definition() throws RecognitionException { - Function_definitionContext _localctx = new Function_definitionContext(_ctx, getState()); - enterRule(_localctx, 12, RULE_function_definition); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - boolean is_public = false; - setState(134); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__1) { - { - setState(132); - match(T__1); - is_public = true; - } - } - - setState(136); - match(T__5); - setState(137); - ((Function_definitionContext)_localctx).LIDENT = match(LIDENT); - setState(138); - match(T__6); - setState(140); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==LIDENT) { - { - setState(139); - ((Function_definitionContext)_localctx).function_arguments = function_arguments(); - } - } - - setState(142); - match(T__7); - setState(143); - ((Function_definitionContext)_localctx).function_body = function_body(); - ((Function_definitionContext)_localctx).result = factory.defineFunction(((Function_definitionContext)_localctx).LIDENT, ((Function_definitionContext)_localctx).function_arguments.args, ((Function_definitionContext)_localctx).function_body.result); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Function_argumentsContext extends ParserRuleContext { - public List args; - public Token LIDENT; - public List LIDENT() { return getTokens(LamaParser.LIDENT); } - public TerminalNode LIDENT(int i) { - return getToken(LamaParser.LIDENT, i); - } - public Function_argumentsContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_function_arguments; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterFunction_arguments(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitFunction_arguments(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitFunction_arguments(this); - else return visitor.visitChildren(this); - } - } - - public final Function_argumentsContext function_arguments() throws RecognitionException { - Function_argumentsContext _localctx = new Function_argumentsContext(_ctx, getState()); - enterRule(_localctx, 14, RULE_function_arguments); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - ((Function_argumentsContext)_localctx).args = new ArrayList(); - setState(147); - ((Function_argumentsContext)_localctx).LIDENT = match(LIDENT); - _localctx.args.addLast(((Function_argumentsContext)_localctx).LIDENT); - setState(154); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__2) { - { - { - setState(149); - match(T__2); - setState(150); - ((Function_argumentsContext)_localctx).LIDENT = match(LIDENT); - _localctx.args.addLast(((Function_argumentsContext)_localctx).LIDENT); - } - } - setState(156); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Function_bodyContext extends ParserRuleContext { - public LamaExpressionNode result; - public Scope_expressionContext scope_expression; - public Scope_expressionContext scope_expression() { - return getRuleContext(Scope_expressionContext.class,0); - } - public Function_bodyContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_function_body; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterFunction_body(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitFunction_body(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitFunction_body(this); - else return visitor.visitChildren(this); - } - } - - public final Function_bodyContext function_body() throws RecognitionException { - Function_bodyContext _localctx = new Function_bodyContext(_ctx, getState()); - enterRule(_localctx, 16, RULE_function_body); - try { - enterOuterAlt(_localctx, 1); - { - setState(157); - match(T__8); - setState(158); - ((Function_bodyContext)_localctx).scope_expression = scope_expression(); - ((Function_bodyContext)_localctx).result = ((Function_bodyContext)_localctx).scope_expression.result; - setState(160); - match(T__9); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ExpressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public Basic_expressionContext basic_expression; - public ExpressionContext expression; - public Basic_expressionContext basic_expression() { - return getRuleContext(Basic_expressionContext.class,0); - } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public ExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitExpression(this); - else return visitor.visitChildren(this); - } - } - - public final ExpressionContext expression() throws RecognitionException { - ExpressionContext _localctx = new ExpressionContext(_ctx, getState()); - enterRule(_localctx, 18, RULE_expression); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(162); - ((ExpressionContext)_localctx).basic_expression = basic_expression(); - ((ExpressionContext)_localctx).result = ((ExpressionContext)_localctx).basic_expression.result; - setState(168); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__3) { - { - setState(164); - match(T__3); - setState(165); - ((ExpressionContext)_localctx).expression = expression(); - ((ExpressionContext)_localctx).result = factory.createSeqNode(_localctx.result, ((ExpressionContext)_localctx).expression.result); - } - } - - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Basic_expressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public Binary_expressionContext binary_expression; - public Binary_expressionContext binary_expression() { - return getRuleContext(Binary_expressionContext.class,0); - } - public Basic_expressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_basic_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterBasic_expression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitBasic_expression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitBasic_expression(this); - else return visitor.visitChildren(this); - } - } - - public final Basic_expressionContext basic_expression() throws RecognitionException { - Basic_expressionContext _localctx = new Basic_expressionContext(_ctx, getState()); - enterRule(_localctx, 20, RULE_basic_expression); - try { - enterOuterAlt(_localctx, 1); - { - setState(170); - ((Basic_expressionContext)_localctx).binary_expression = binary_expression(); - ((Basic_expressionContext)_localctx).result = ((Basic_expressionContext)_localctx).binary_expression.result; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Binary_expressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public Postfix_expressionContext postfix_expression; - public Any_infixContext any_infix; - public List postfix_expression() { - return getRuleContexts(Postfix_expressionContext.class); - } - public Postfix_expressionContext postfix_expression(int i) { - return getRuleContext(Postfix_expressionContext.class,i); - } - public List any_infix() { - return getRuleContexts(Any_infixContext.class); - } - public Any_infixContext any_infix(int i) { - return getRuleContext(Any_infixContext.class,i); - } - public Binary_expressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_binary_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterBinary_expression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitBinary_expression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitBinary_expression(this); - else return visitor.visitChildren(this); - } - } - - public final Binary_expressionContext binary_expression() throws RecognitionException { - Binary_expressionContext _localctx = new Binary_expressionContext(_ctx, getState()); - enterRule(_localctx, 22, RULE_binary_expression); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(173); - ((Binary_expressionContext)_localctx).postfix_expression = postfix_expression(); - ((Binary_expressionContext)_localctx).result = ((Binary_expressionContext)_localctx).postfix_expression.result; - setState(181); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==MINUS || _la==INFIX) { - { - { - setState(175); - ((Binary_expressionContext)_localctx).any_infix = any_infix(); - setState(176); - ((Binary_expressionContext)_localctx).postfix_expression = postfix_expression(); - ((Binary_expressionContext)_localctx).result = factory.createBinopNode(((Binary_expressionContext)_localctx).any_infix.result, _localctx.result, ((Binary_expressionContext)_localctx).postfix_expression.result); - } - } - setState(183); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Postfix_expressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public PrimaryContext primary; - public PostfixContext postfix; - public PrimaryContext primary() { - return getRuleContext(PrimaryContext.class,0); - } - public TerminalNode MINUS() { return getToken(LamaParser.MINUS, 0); } - public List postfix() { - return getRuleContexts(PostfixContext.class); - } - public PostfixContext postfix(int i) { - return getRuleContext(PostfixContext.class,i); - } - public Postfix_expressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_postfix_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterPostfix_expression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitPostfix_expression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitPostfix_expression(this); - else return visitor.visitChildren(this); - } - } - - public final Postfix_expressionContext postfix_expression() throws RecognitionException { - Postfix_expressionContext _localctx = new Postfix_expressionContext(_ctx, getState()); - enterRule(_localctx, 24, RULE_postfix_expression); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - boolean with_minus = false; - setState(187); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==MINUS) { - { - setState(185); - match(MINUS); - with_minus = true; - } - } - - setState(189); - ((Postfix_expressionContext)_localctx).primary = primary(); - ((Postfix_expressionContext)_localctx).result = ((Postfix_expressionContext)_localctx).primary.result; - setState(196); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__6 || _la==T__10) { - { - { - setState(191); - ((Postfix_expressionContext)_localctx).postfix = postfix(); - - if (((Postfix_expressionContext)_localctx).postfix.access_index.isPresent()) { - ((Postfix_expressionContext)_localctx).result = factory.createElemNode(_localctx.result, (((Postfix_expressionContext)_localctx).postfix.access_index.get())); // TODO: or RefElem node - } else { - ((Postfix_expressionContext)_localctx).result = factory.createCallNode(_localctx.result, ((Postfix_expressionContext)_localctx).postfix.args); - } - - } - } - setState(198); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class PostfixContext extends ParserRuleContext { - public List args; - public Optional access_index; - public ExpressionContext expression; - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public PostfixContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_postfix; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterPostfix(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitPostfix(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitPostfix(this); - else return visitor.visitChildren(this); - } - } - - public final PostfixContext postfix() throws RecognitionException { - PostfixContext _localctx = new PostfixContext(_ctx, getState()); - enterRule(_localctx, 26, RULE_postfix); - int _la; - try { - setState(221); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - ((PostfixContext)_localctx).args = new ArrayList(); ((PostfixContext)_localctx).access_index = Option.empty(); - setState(200); - match(T__6); - setState(201); - ((PostfixContext)_localctx).expression = expression(); - _localctx.args.addLast(((PostfixContext)_localctx).expression.result); - setState(209); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__2) { - { - { - setState(203); - match(T__2); - setState(204); - ((PostfixContext)_localctx).expression = expression(); - _localctx.args.addLast(((PostfixContext)_localctx).expression.result); - } - } - setState(211); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(212); - match(T__7); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(214); - match(T__6); - setState(215); - match(T__7); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(216); - match(T__10); - setState(217); - ((PostfixContext)_localctx).expression = expression(); - ((PostfixContext)_localctx).access_index = Option.of(((PostfixContext)_localctx).expression.result); - setState(219); - match(T__11); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class PrimaryContext extends ParserRuleContext { - public LamaExpressionNode result; - public Token DECIMAL_LITERAL; - public Token STRING_LITERAL; - public Token CHAR_LITERAL; - public Token LIDENT; - public Any_infixContext any_infix; - public Function_argumentsContext function_arguments; - public Function_bodyContext function_body; - public Scope_expressionContext scope_expression; - public List_expressionContext list_expression; - public Array_expressionContext array_expression; - public S_expressionContext s_expression; - public If_expressionContext if_expression; - public While_do_expressionContext while_do_expression; - public Do_while_expressionContext do_while_expression; - public For_expressionContext for_expression; - public Case_expressionContext case_expression; - public TerminalNode DECIMAL_LITERAL() { return getToken(LamaParser.DECIMAL_LITERAL, 0); } - public TerminalNode STRING_LITERAL() { return getToken(LamaParser.STRING_LITERAL, 0); } - public TerminalNode CHAR_LITERAL() { return getToken(LamaParser.CHAR_LITERAL, 0); } - public TerminalNode LIDENT() { return getToken(LamaParser.LIDENT, 0); } - public Any_infixContext any_infix() { - return getRuleContext(Any_infixContext.class,0); - } - public Function_argumentsContext function_arguments() { - return getRuleContext(Function_argumentsContext.class,0); - } - public Function_bodyContext function_body() { - return getRuleContext(Function_bodyContext.class,0); - } - public Scope_expressionContext scope_expression() { - return getRuleContext(Scope_expressionContext.class,0); - } - public List_expressionContext list_expression() { - return getRuleContext(List_expressionContext.class,0); - } - public Array_expressionContext array_expression() { - return getRuleContext(Array_expressionContext.class,0); - } - public S_expressionContext s_expression() { - return getRuleContext(S_expressionContext.class,0); - } - public If_expressionContext if_expression() { - return getRuleContext(If_expressionContext.class,0); - } - public While_do_expressionContext while_do_expression() { - return getRuleContext(While_do_expressionContext.class,0); - } - public Do_while_expressionContext do_while_expression() { - return getRuleContext(Do_while_expressionContext.class,0); - } - public For_expressionContext for_expression() { - return getRuleContext(For_expressionContext.class,0); - } - public Case_expressionContext case_expression() { - return getRuleContext(Case_expressionContext.class,0); - } - public PrimaryContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_primary; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterPrimary(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitPrimary(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitPrimary(this); - else return visitor.visitChildren(this); - } - } - - public final PrimaryContext primary() throws RecognitionException { - PrimaryContext _localctx = new PrimaryContext(_ctx, getState()); - enterRule(_localctx, 28, RULE_primary); - try { - setState(277); - _errHandler.sync(this); - switch (_input.LA(1)) { - case DECIMAL_LITERAL: - enterOuterAlt(_localctx, 1); - { - setState(223); - ((PrimaryContext)_localctx).DECIMAL_LITERAL = match(DECIMAL_LITERAL); - ((PrimaryContext)_localctx).result = factory.createConstNode(((PrimaryContext)_localctx).DECIMAL_LITERAL); - } - break; - case STRING_LITERAL: - enterOuterAlt(_localctx, 2); - { - setState(225); - ((PrimaryContext)_localctx).STRING_LITERAL = match(STRING_LITERAL); - ((PrimaryContext)_localctx).result = factory.createStringNode(LamaStrings.convertStringLiteral(((PrimaryContext)_localctx).STRING_LITERAL)); - } - break; - case CHAR_LITERAL: - enterOuterAlt(_localctx, 3); - { - setState(227); - ((PrimaryContext)_localctx).CHAR_LITERAL = match(CHAR_LITERAL); - ((PrimaryContext)_localctx).result = factory.createConstNode(LamaStrings.convertCharLiteral(((PrimaryContext)_localctx).CHAR_LITERAL)); - } - break; - case LIDENT: - enterOuterAlt(_localctx, 4); - { - setState(229); - ((PrimaryContext)_localctx).LIDENT = match(LIDENT); - ((PrimaryContext)_localctx).result = factory.createRefNode(((PrimaryContext)_localctx).LIDENT); - } - break; - case T__12: - enterOuterAlt(_localctx, 5); - { - setState(231); - match(T__12); - ((PrimaryContext)_localctx).result = factory.createConstNode(1); - } - break; - case T__13: - enterOuterAlt(_localctx, 6); - { - setState(233); - match(T__13); - ((PrimaryContext)_localctx).result = factory.createConstNode(0); - } - break; - case T__14: - enterOuterAlt(_localctx, 7); - { - setState(235); - match(T__14); - setState(236); - ((PrimaryContext)_localctx).any_infix = any_infix(); - ((PrimaryContext)_localctx).result = factory.createRefNode(((PrimaryContext)_localctx).any_infix.result); - } - break; - case T__5: - enterOuterAlt(_localctx, 8); - { - setState(239); - match(T__5); - setState(240); - match(T__6); - setState(241); - ((PrimaryContext)_localctx).function_arguments = function_arguments(); - setState(242); - match(T__7); - setState(243); - ((PrimaryContext)_localctx).function_body = function_body(); - ((PrimaryContext)_localctx).result = factory.createClosureNode(((PrimaryContext)_localctx).function_arguments.args, ((PrimaryContext)_localctx).function_body.result); - } - break; - case T__15: - enterOuterAlt(_localctx, 9); - { - setState(246); - match(T__15); - ((PrimaryContext)_localctx).result = factory.createSkipNode(); - } - break; - case T__6: - enterOuterAlt(_localctx, 10); - { - setState(248); - match(T__6); - setState(249); - ((PrimaryContext)_localctx).scope_expression = scope_expression(); - setState(250); - match(T__7); - ((PrimaryContext)_localctx).result = ((PrimaryContext)_localctx).scope_expression.result; - } - break; - case T__8: - enterOuterAlt(_localctx, 11); - { - setState(253); - ((PrimaryContext)_localctx).list_expression = list_expression(); - ((PrimaryContext)_localctx).result = ((PrimaryContext)_localctx).list_expression.result; - } - break; - case T__10: - enterOuterAlt(_localctx, 12); - { - setState(256); - ((PrimaryContext)_localctx).array_expression = array_expression(); - ((PrimaryContext)_localctx).result = ((PrimaryContext)_localctx).array_expression.result; - } - break; - case UIDENT: - enterOuterAlt(_localctx, 13); - { - setState(259); - ((PrimaryContext)_localctx).s_expression = s_expression(); - ((PrimaryContext)_localctx).result = ((PrimaryContext)_localctx).s_expression.result; - } - break; - case T__16: - enterOuterAlt(_localctx, 14); - { - setState(262); - ((PrimaryContext)_localctx).if_expression = if_expression(); - ((PrimaryContext)_localctx).result = ((PrimaryContext)_localctx).if_expression.result; - } - break; - case T__21: - enterOuterAlt(_localctx, 15); - { - setState(265); - ((PrimaryContext)_localctx).while_do_expression = while_do_expression(); - ((PrimaryContext)_localctx).result = ((PrimaryContext)_localctx).while_do_expression.result; - } - break; - case T__22: - enterOuterAlt(_localctx, 16); - { - setState(268); - ((PrimaryContext)_localctx).do_while_expression = do_while_expression(); - ((PrimaryContext)_localctx).result = ((PrimaryContext)_localctx).do_while_expression.result; - } - break; - case T__24: - enterOuterAlt(_localctx, 17); - { - setState(271); - ((PrimaryContext)_localctx).for_expression = for_expression(); - ((PrimaryContext)_localctx).result = ((PrimaryContext)_localctx).for_expression.result; - } - break; - case T__34: - enterOuterAlt(_localctx, 18); - { - setState(274); - ((PrimaryContext)_localctx).case_expression = case_expression(); - ((PrimaryContext)_localctx).result = ((PrimaryContext)_localctx).case_expression.result; - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Array_expressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public ExpressionContext expression; - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public Array_expressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_array_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterArray_expression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitArray_expression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitArray_expression(this); - else return visitor.visitChildren(this); - } - } - - public final Array_expressionContext array_expression() throws RecognitionException { - Array_expressionContext _localctx = new Array_expressionContext(_ctx, getState()); - enterRule(_localctx, 30, RULE_array_expression); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - List elems = new ArrayList(); - setState(280); - match(T__10); - setState(292); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1099546033908416L) != 0)) { - { - setState(281); - ((Array_expressionContext)_localctx).expression = expression(); - elems.addLast(((Array_expressionContext)_localctx).expression.result); - setState(289); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__2) { - { - { - setState(283); - match(T__2); - setState(284); - ((Array_expressionContext)_localctx).expression = expression(); - elems.addLast(((Array_expressionContext)_localctx).expression.result); - } - } - setState(291); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - - setState(294); - match(T__11); - ((Array_expressionContext)_localctx).result = factory.createArrayNode(elems); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class List_expressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public ExpressionContext expression; - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public List_expressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_list_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterList_expression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitList_expression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitList_expression(this); - else return visitor.visitChildren(this); - } - } - - public final List_expressionContext list_expression() throws RecognitionException { - List_expressionContext _localctx = new List_expressionContext(_ctx, getState()); - enterRule(_localctx, 32, RULE_list_expression); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - List elems = new ArrayList(); - setState(298); - match(T__8); - setState(310); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1099546033908416L) != 0)) { - { - setState(299); - ((List_expressionContext)_localctx).expression = expression(); - elems.addLast(((List_expressionContext)_localctx).expression.result); - setState(307); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__2) { - { - { - setState(301); - match(T__2); - setState(302); - ((List_expressionContext)_localctx).expression = expression(); - elems.addLast(((List_expressionContext)_localctx).expression.result); - } - } - setState(309); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - - setState(312); - match(T__9); - ((List_expressionContext)_localctx).result = factory.createListSexpNode(elems); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class S_expressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public Token UIDENT; - public ExpressionContext expression; - public TerminalNode UIDENT() { return getToken(LamaParser.UIDENT, 0); } - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public S_expressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_s_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterS_expression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitS_expression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitS_expression(this); - else return visitor.visitChildren(this); - } - } - - public final S_expressionContext s_expression() throws RecognitionException { - S_expressionContext _localctx = new S_expressionContext(_ctx, getState()); - enterRule(_localctx, 34, RULE_s_expression); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - List elems = new ArrayList(); - setState(316); - ((S_expressionContext)_localctx).UIDENT = match(UIDENT); - setState(332); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) { - case 1: - { - setState(317); - match(T__6); - setState(329); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1099546033908416L) != 0)) { - { - setState(318); - ((S_expressionContext)_localctx).expression = expression(); - elems.addLast(((S_expressionContext)_localctx).expression.result); - setState(326); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__2) { - { - { - setState(320); - match(T__2); - setState(321); - ((S_expressionContext)_localctx).expression = expression(); - elems.addLast(((S_expressionContext)_localctx).expression.result); - } - } - setState(328); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - - setState(331); - match(T__7); - } - break; - } - ((S_expressionContext)_localctx).result = factory.createSexpNode(((S_expressionContext)_localctx).UIDENT, elems); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class If_expressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public ExpressionContext expression; - public Scope_expressionContext scope_expression; - public Else_partContext else_part; - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public Scope_expressionContext scope_expression() { - return getRuleContext(Scope_expressionContext.class,0); - } - public Else_partContext else_part() { - return getRuleContext(Else_partContext.class,0); - } - public If_expressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_if_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterIf_expression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitIf_expression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitIf_expression(this); - else return visitor.visitChildren(this); - } - } - - public final If_expressionContext if_expression() throws RecognitionException { - If_expressionContext _localctx = new If_expressionContext(_ctx, getState()); - enterRule(_localctx, 36, RULE_if_expression); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - LamaExpressionNode do_else = null; - setState(337); - match(T__16); - setState(338); - ((If_expressionContext)_localctx).expression = expression(); - setState(339); - match(T__17); - setState(340); - ((If_expressionContext)_localctx).scope_expression = scope_expression(); - setState(344); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__19 || _la==T__20) { - { - setState(341); - ((If_expressionContext)_localctx).else_part = else_part(); - do_else = ((If_expressionContext)_localctx).else_part.result; - } - } - - setState(346); - match(T__18); - ((If_expressionContext)_localctx).result = factory.createIfNode(((If_expressionContext)_localctx).expression.result, ((If_expressionContext)_localctx).scope_expression.result, do_else); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Else_partContext extends ParserRuleContext { - public LamaExpressionNode result; - public ExpressionContext expression; - public Scope_expressionContext scope_expression; - public Else_partContext else_part; - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public Scope_expressionContext scope_expression() { - return getRuleContext(Scope_expressionContext.class,0); - } - public Else_partContext else_part() { - return getRuleContext(Else_partContext.class,0); - } - public Else_partContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_else_part; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterElse_part(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitElse_part(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitElse_part(this); - else return visitor.visitChildren(this); - } - } - - public final Else_partContext else_part() throws RecognitionException { - Else_partContext _localctx = new Else_partContext(_ctx, getState()); - enterRule(_localctx, 38, RULE_else_part); - int _la; - try { - setState(365); - _errHandler.sync(this); - switch (_input.LA(1)) { - case T__19: - enterOuterAlt(_localctx, 1); - { - setState(349); - match(T__19); - LamaExpressionNode do_else = null; - setState(351); - ((Else_partContext)_localctx).expression = expression(); - setState(352); - match(T__17); - setState(353); - ((Else_partContext)_localctx).scope_expression = scope_expression(); - setState(357); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__19 || _la==T__20) { - { - setState(354); - ((Else_partContext)_localctx).else_part = else_part(); - do_else = ((Else_partContext)_localctx).else_part.result; - } - } - - ((Else_partContext)_localctx).result = factory.createIfNode(((Else_partContext)_localctx).expression.result, ((Else_partContext)_localctx).scope_expression.result, do_else); - } - break; - case T__20: - enterOuterAlt(_localctx, 2); - { - setState(361); - match(T__20); - setState(362); - ((Else_partContext)_localctx).scope_expression = scope_expression(); - ((Else_partContext)_localctx).result = ((Else_partContext)_localctx).scope_expression.result; - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class While_do_expressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public ExpressionContext expression; - public Scope_expressionContext scope_expression; - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public Scope_expressionContext scope_expression() { - return getRuleContext(Scope_expressionContext.class,0); - } - public While_do_expressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_while_do_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterWhile_do_expression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitWhile_do_expression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitWhile_do_expression(this); - else return visitor.visitChildren(this); - } - } - - public final While_do_expressionContext while_do_expression() throws RecognitionException { - While_do_expressionContext _localctx = new While_do_expressionContext(_ctx, getState()); - enterRule(_localctx, 40, RULE_while_do_expression); - try { - enterOuterAlt(_localctx, 1); - { - setState(367); - match(T__21); - setState(368); - ((While_do_expressionContext)_localctx).expression = expression(); - setState(369); - match(T__22); - setState(370); - ((While_do_expressionContext)_localctx).scope_expression = scope_expression(); - setState(371); - match(T__23); - ((While_do_expressionContext)_localctx).result = factory.createWhileNode(((While_do_expressionContext)_localctx).expression.result, ((While_do_expressionContext)_localctx).scope_expression.result); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Do_while_expressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public Scope_expressionContext scope_expression; - public ExpressionContext expression; - public Scope_expressionContext scope_expression() { - return getRuleContext(Scope_expressionContext.class,0); - } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public Do_while_expressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_do_while_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterDo_while_expression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitDo_while_expression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitDo_while_expression(this); - else return visitor.visitChildren(this); - } - } - - public final Do_while_expressionContext do_while_expression() throws RecognitionException { - Do_while_expressionContext _localctx = new Do_while_expressionContext(_ctx, getState()); - enterRule(_localctx, 42, RULE_do_while_expression); - try { - enterOuterAlt(_localctx, 1); - { - setState(374); - match(T__22); - setState(375); - ((Do_while_expressionContext)_localctx).scope_expression = scope_expression(); - setState(376); - match(T__21); - setState(377); - ((Do_while_expressionContext)_localctx).expression = expression(); - setState(378); - match(T__23); - ((Do_while_expressionContext)_localctx).result = factory.createDoWhileNode(((Do_while_expressionContext)_localctx).expression.result, ((Do_while_expressionContext)_localctx).scope_expression.result); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class For_expressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public Scope_expressionContext init; - public ExpressionContext cond; - public ExpressionContext inc; - public Scope_expressionContext expr; - public List scope_expression() { - return getRuleContexts(Scope_expressionContext.class); - } - public Scope_expressionContext scope_expression(int i) { - return getRuleContext(Scope_expressionContext.class,i); - } - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public For_expressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_for_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterFor_expression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitFor_expression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitFor_expression(this); - else return visitor.visitChildren(this); - } - } - - public final For_expressionContext for_expression() throws RecognitionException { - For_expressionContext _localctx = new For_expressionContext(_ctx, getState()); - enterRule(_localctx, 44, RULE_for_expression); - try { - enterOuterAlt(_localctx, 1); - { - setState(381); - match(T__24); - setState(382); - ((For_expressionContext)_localctx).init = scope_expression(); - setState(383); - match(T__2); - setState(384); - ((For_expressionContext)_localctx).cond = expression(); - setState(385); - match(T__2); - setState(386); - ((For_expressionContext)_localctx).inc = expression(); - setState(387); - match(T__22); - setState(388); - ((For_expressionContext)_localctx).expr = scope_expression(); - setState(389); - match(T__23); - ((For_expressionContext)_localctx).result = factory.createSeqNode(((For_expressionContext)_localctx).init.result, factory.createWhileNode(((For_expressionContext)_localctx).cond.result, factory.createSeqNode(((For_expressionContext)_localctx).expr.result, ((For_expressionContext)_localctx).inc.result))); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class PatternContext extends ParserRuleContext { - public LamaPattern result; - public Cons_patternContext cons_pattern; - public Simple_patternContext simple_pattern; - public Cons_patternContext cons_pattern() { - return getRuleContext(Cons_patternContext.class,0); - } - public Simple_patternContext simple_pattern() { - return getRuleContext(Simple_patternContext.class,0); - } - public PatternContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_pattern; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterPattern(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitPattern(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitPattern(this); - else return visitor.visitChildren(this); - } - } - - public final PatternContext pattern() throws RecognitionException { - PatternContext _localctx = new PatternContext(_ctx, getState()); - enterRule(_localctx, 46, RULE_pattern); - try { - setState(398); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(392); - ((PatternContext)_localctx).cons_pattern = cons_pattern(); - ((PatternContext)_localctx).result = ((PatternContext)_localctx).cons_pattern.result; - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(395); - ((PatternContext)_localctx).simple_pattern = simple_pattern(); - ((PatternContext)_localctx).result = ((PatternContext)_localctx).simple_pattern.result; - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Cons_patternContext extends ParserRuleContext { - public LamaPattern result; - public Simple_patternContext simple_pattern; - public PatternContext pattern; - public Simple_patternContext simple_pattern() { - return getRuleContext(Simple_patternContext.class,0); - } - public PatternContext pattern() { - return getRuleContext(PatternContext.class,0); - } - public Cons_patternContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_cons_pattern; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterCons_pattern(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitCons_pattern(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitCons_pattern(this); - else return visitor.visitChildren(this); - } - } - - public final Cons_patternContext cons_pattern() throws RecognitionException { - Cons_patternContext _localctx = new Cons_patternContext(_ctx, getState()); - enterRule(_localctx, 48, RULE_cons_pattern); - try { - enterOuterAlt(_localctx, 1); - { - setState(400); - ((Cons_patternContext)_localctx).simple_pattern = simple_pattern(); - setState(401); - match(T__25); - setState(402); - ((Cons_patternContext)_localctx).pattern = pattern(); - ((Cons_patternContext)_localctx).result = factory.createSexpPattern("cons", {((Cons_patternContext)_localctx).simple_pattern.result, ((Cons_patternContext)_localctx).pattern.result}); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Simple_patternContext extends ParserRuleContext { - public LamaPattern result; - public Wildcard_patternContext wildcard_pattern; - public S_expr_patternContext s_expr_pattern; - public Array_patternContext array_pattern; - public List_patternContext list_pattern; - public Token LIDENT; - public PatternContext pattern; - public Token DECIMAL_LITERAL; - public Token STRING_LITERAL; - public Token CHAR_LITERAL; - public Wildcard_patternContext wildcard_pattern() { - return getRuleContext(Wildcard_patternContext.class,0); - } - public S_expr_patternContext s_expr_pattern() { - return getRuleContext(S_expr_patternContext.class,0); - } - public Array_patternContext array_pattern() { - return getRuleContext(Array_patternContext.class,0); - } - public List_patternContext list_pattern() { - return getRuleContext(List_patternContext.class,0); - } - public TerminalNode LIDENT() { return getToken(LamaParser.LIDENT, 0); } - public PatternContext pattern() { - return getRuleContext(PatternContext.class,0); - } - public TerminalNode DECIMAL_LITERAL() { return getToken(LamaParser.DECIMAL_LITERAL, 0); } - public TerminalNode MINUS() { return getToken(LamaParser.MINUS, 0); } - public TerminalNode STRING_LITERAL() { return getToken(LamaParser.STRING_LITERAL, 0); } - public TerminalNode CHAR_LITERAL() { return getToken(LamaParser.CHAR_LITERAL, 0); } - public Simple_patternContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_simple_pattern; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterSimple_pattern(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitSimple_pattern(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitSimple_pattern(this); - else return visitor.visitChildren(this); - } - } - - public final Simple_patternContext simple_pattern() throws RecognitionException { - Simple_patternContext _localctx = new Simple_patternContext(_ctx, getState()); - enterRule(_localctx, 50, RULE_simple_pattern); - int _la; - try { - setState(464); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,30,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(405); - ((Simple_patternContext)_localctx).wildcard_pattern = wildcard_pattern(); - ((Simple_patternContext)_localctx).result = ((Simple_patternContext)_localctx).wildcard_pattern.result; - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(408); - ((Simple_patternContext)_localctx).s_expr_pattern = s_expr_pattern(); - ((Simple_patternContext)_localctx).result = ((Simple_patternContext)_localctx).s_expr_pattern.result; - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(411); - ((Simple_patternContext)_localctx).array_pattern = array_pattern(); - ((Simple_patternContext)_localctx).result = ((Simple_patternContext)_localctx).array_pattern.result; - } - break; - case 4: - enterOuterAlt(_localctx, 4); - { - setState(414); - ((Simple_patternContext)_localctx).list_pattern = list_pattern(); - ((Simple_patternContext)_localctx).result = ((Simple_patternContext)_localctx).list_pattern.result; - } - break; - case 5: - enterOuterAlt(_localctx, 5); - { - setState(417); - ((Simple_patternContext)_localctx).LIDENT = match(LIDENT); - LamaPattern pat = null; - setState(423); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__26) { - { - setState(419); - match(T__26); - setState(420); - ((Simple_patternContext)_localctx).pattern = pattern(); - pat = ((Simple_patternContext)_localctx).pattern.result; - } - } - - ((Simple_patternContext)_localctx).result = factory.createNamedPattern(((Simple_patternContext)_localctx).LIDENT, Objects.requireNonNullElse(pat, factory.createWildcardPattern()); - } - break; - case 6: - enterOuterAlt(_localctx, 6); - { - boolean is_negative = false; - setState(429); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==MINUS) { - { - setState(427); - match(MINUS); - is_negative = true; - } - } - - setState(431); - ((Simple_patternContext)_localctx).DECIMAL_LITERAL = match(DECIMAL_LITERAL); - ((Simple_patternContext)_localctx).result = is_negative ? factory.createNegativeConstPattern(((Simple_patternContext)_localctx).DECIMAL_LITERAL) : factory.createConstPattern(((Simple_patternContext)_localctx).DECIMAL_LITERAL); - } - break; - case 7: - enterOuterAlt(_localctx, 7); - { - setState(433); - ((Simple_patternContext)_localctx).STRING_LITERAL = match(STRING_LITERAL); - ((Simple_patternContext)_localctx).result = factory.createStringPattern(LamaStrings.convertStringLiteral(((Simple_patternContext)_localctx).STRING_LITERAL)); - } - break; - case 8: - enterOuterAlt(_localctx, 8); - { - setState(435); - ((Simple_patternContext)_localctx).CHAR_LITERAL = match(CHAR_LITERAL); - ((Simple_patternContext)_localctx).result = factory.createConstPattern(LamaStrings.convertCharLiteral(((Simple_patternContext)_localctx).CHAR_LITERAL)); - } - break; - case 9: - enterOuterAlt(_localctx, 9); - { - setState(437); - match(T__12); - ((Simple_patternContext)_localctx).result = factory.createConstPattern(1); - } - break; - case 10: - enterOuterAlt(_localctx, 10); - { - setState(439); - match(T__13); - ((Simple_patternContext)_localctx).result = factory.createConstPattern(0); - } - break; - case 11: - enterOuterAlt(_localctx, 11); - { - setState(441); - match(T__27); - setState(442); - match(T__28); - ((Simple_patternContext)_localctx).result = factory.createBoxedPattern(); - } - break; - case 12: - enterOuterAlt(_localctx, 12); - { - setState(444); - match(T__27); - setState(445); - match(T__29); - ((Simple_patternContext)_localctx).result = factory.createUnBoxedPattern(); - } - break; - case 13: - enterOuterAlt(_localctx, 13); - { - setState(447); - match(T__27); - setState(448); - match(T__30); - ((Simple_patternContext)_localctx).result = factory.createStringTagPattern(); - } - break; - case 14: - enterOuterAlt(_localctx, 14); - { - setState(450); - match(T__27); - setState(451); - match(T__31); - ((Simple_patternContext)_localctx).result = factory.createArrayTagPattern(); - } - break; - case 15: - enterOuterAlt(_localctx, 15); - { - setState(453); - match(T__27); - setState(454); - match(T__32); - ((Simple_patternContext)_localctx).result = factory.createSexpTagPattern(); - } - break; - case 16: - enterOuterAlt(_localctx, 16); - { - setState(456); - match(T__27); - setState(457); - match(T__5); - ((Simple_patternContext)_localctx).result = factory.createClosureTagPattern(); - } - break; - case 17: - enterOuterAlt(_localctx, 17); - { - setState(459); - match(T__6); - setState(460); - ((Simple_patternContext)_localctx).pattern = pattern(); - setState(461); - match(T__7); - ((Simple_patternContext)_localctx).result = ((Simple_patternContext)_localctx).pattern.result; - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Wildcard_patternContext extends ParserRuleContext { - public LamaPattern result; - public Wildcard_patternContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_wildcard_pattern; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterWildcard_pattern(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitWildcard_pattern(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitWildcard_pattern(this); - else return visitor.visitChildren(this); - } - } - - public final Wildcard_patternContext wildcard_pattern() throws RecognitionException { - Wildcard_patternContext _localctx = new Wildcard_patternContext(_ctx, getState()); - enterRule(_localctx, 52, RULE_wildcard_pattern); - try { - enterOuterAlt(_localctx, 1); - { - setState(466); - match(T__33); - ((Wildcard_patternContext)_localctx).result = factory.createWildcardPattern(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class S_expr_patternContext extends ParserRuleContext { - public LamaPattern result; - public Token UIDENT; - public PatternContext pattern; - public TerminalNode UIDENT() { return getToken(LamaParser.UIDENT, 0); } - public List pattern() { - return getRuleContexts(PatternContext.class); - } - public PatternContext pattern(int i) { - return getRuleContext(PatternContext.class,i); - } - public S_expr_patternContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_s_expr_pattern; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterS_expr_pattern(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitS_expr_pattern(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitS_expr_pattern(this); - else return visitor.visitChildren(this); - } - } - - public final S_expr_patternContext s_expr_pattern() throws RecognitionException { - S_expr_patternContext _localctx = new S_expr_patternContext(_ctx, getState()); - enterRule(_localctx, 54, RULE_s_expr_pattern); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - List elems = new ArrayList(); - setState(470); - ((S_expr_patternContext)_localctx).UIDENT = match(UIDENT); - setState(486); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__6) { - { - setState(471); - match(T__6); - setState(483); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1099529076107904L) != 0)) { - { - setState(472); - ((S_expr_patternContext)_localctx).pattern = pattern(); - elems.addLast(((S_expr_patternContext)_localctx).pattern.result); - setState(480); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__2) { - { - { - setState(474); - match(T__2); - setState(475); - ((S_expr_patternContext)_localctx).pattern = pattern(); - elems.addLast(((S_expr_patternContext)_localctx).pattern.result); - } - } - setState(482); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - - setState(485); - match(T__7); - } - } - - ((S_expr_patternContext)_localctx).result = factory.createSexpPattern(((S_expr_patternContext)_localctx).UIDENT, elems); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Array_patternContext extends ParserRuleContext { - public LamaPattern result; - public PatternContext pattern; - public List pattern() { - return getRuleContexts(PatternContext.class); - } - public PatternContext pattern(int i) { - return getRuleContext(PatternContext.class,i); - } - public Array_patternContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_array_pattern; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterArray_pattern(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitArray_pattern(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitArray_pattern(this); - else return visitor.visitChildren(this); - } - } - - public final Array_patternContext array_pattern() throws RecognitionException { - Array_patternContext _localctx = new Array_patternContext(_ctx, getState()); - enterRule(_localctx, 56, RULE_array_pattern); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - List elems = new ArrayList(); - setState(491); - match(T__10); - setState(503); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1099529076107904L) != 0)) { - { - setState(492); - ((Array_patternContext)_localctx).pattern = pattern(); - elems.addLast(((Array_patternContext)_localctx).pattern.result); - setState(500); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__2) { - { - { - setState(494); - match(T__2); - setState(495); - ((Array_patternContext)_localctx).pattern = pattern(); - elems.addLast(((Array_patternContext)_localctx).pattern.result); - } - } - setState(502); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - - setState(505); - match(T__11); - ((Array_patternContext)_localctx).result = factory.createArrayPattern(elems); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class List_patternContext extends ParserRuleContext { - public LamaPattern result; - public PatternContext pattern; - public List pattern() { - return getRuleContexts(PatternContext.class); - } - public PatternContext pattern(int i) { - return getRuleContext(PatternContext.class,i); - } - public List_patternContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_list_pattern; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterList_pattern(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitList_pattern(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitList_pattern(this); - else return visitor.visitChildren(this); - } - } - - public final List_patternContext list_pattern() throws RecognitionException { - List_patternContext _localctx = new List_patternContext(_ctx, getState()); - enterRule(_localctx, 58, RULE_list_pattern); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - List elems = new ArrayList(); - setState(509); - match(T__8); - setState(521); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1099529076107904L) != 0)) { - { - setState(510); - ((List_patternContext)_localctx).pattern = pattern(); - elems.addLast(((List_patternContext)_localctx).pattern.result); - setState(518); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__2) { - { - { - setState(512); - match(T__2); - setState(513); - ((List_patternContext)_localctx).pattern = pattern(); - elems.addLast(((List_patternContext)_localctx).pattern.result); - } - } - setState(520); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - - setState(523); - match(T__9); - ((List_patternContext)_localctx).result = factory.createListSexpPattern(elems); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Case_expressionContext extends ParserRuleContext { - public LamaExpressionNode result; - public ExpressionContext expression; - public Case_branchesContext case_branches; - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public Case_branchesContext case_branches() { - return getRuleContext(Case_branchesContext.class,0); - } - public Case_expressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_case_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterCase_expression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitCase_expression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitCase_expression(this); - else return visitor.visitChildren(this); - } - } - - public final Case_expressionContext case_expression() throws RecognitionException { - Case_expressionContext _localctx = new Case_expressionContext(_ctx, getState()); - enterRule(_localctx, 60, RULE_case_expression); - try { - enterOuterAlt(_localctx, 1); - { - setState(526); - match(T__34); - setState(527); - ((Case_expressionContext)_localctx).expression = expression(); - setState(528); - match(T__35); - setState(529); - ((Case_expressionContext)_localctx).case_branches = case_branches(); - setState(530); - match(T__36); - ((Case_expressionContext)_localctx).result = factory.createCaseNode(((Case_expressionContext)_localctx).expression.result, ((Case_expressionContext)_localctx).case_branches.pats, ((Case_expressionContext)_localctx).case_branches.exprs); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Case_branchesContext extends ParserRuleContext { - public List pats; - public List exprs; - public Case_branchContext case_branch; - public List case_branch() { - return getRuleContexts(Case_branchContext.class); - } - public Case_branchContext case_branch(int i) { - return getRuleContext(Case_branchContext.class,i); - } - public Case_branchesContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_case_branches; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterCase_branches(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitCase_branches(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitCase_branches(this); - else return visitor.visitChildren(this); - } - } - - public final Case_branchesContext case_branches() throws RecognitionException { - Case_branchesContext _localctx = new Case_branchesContext(_ctx, getState()); - enterRule(_localctx, 62, RULE_case_branches); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - ((Case_branchesContext)_localctx).pats = new ArrayList(); ((Case_branchesContext)_localctx).exprs = new ArrayList exprs; - setState(534); - ((Case_branchesContext)_localctx).case_branch = case_branch(); - _localctx.pats.addLast(((Case_branchesContext)_localctx).case_branch.pat); _localctx.exprs.addLast(((Case_branchesContext)_localctx).case_branch.expr); - setState(542); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__37) { - { - { - setState(536); - match(T__37); - setState(537); - ((Case_branchesContext)_localctx).case_branch = case_branch(); - _localctx.pats.addLast(((Case_branchesContext)_localctx).case_branch.pat); _localctx.exprs.addLast(((Case_branchesContext)_localctx).case_branch.expr); - } - } - setState(544); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Case_branchContext extends ParserRuleContext { - public LamaPattern pat; - public LamaExpressionNode expr; - public PatternContext pattern; - public Scope_expressionContext scope_expression; - public PatternContext pattern() { - return getRuleContext(PatternContext.class,0); - } - public Scope_expressionContext scope_expression() { - return getRuleContext(Scope_expressionContext.class,0); - } - public Case_branchContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_case_branch; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterCase_branch(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitCase_branch(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitCase_branch(this); - else return visitor.visitChildren(this); - } - } - - public final Case_branchContext case_branch() throws RecognitionException { - Case_branchContext _localctx = new Case_branchContext(_ctx, getState()); - enterRule(_localctx, 64, RULE_case_branch); - try { - enterOuterAlt(_localctx, 1); - { - setState(545); - ((Case_branchContext)_localctx).pattern = pattern(); - ((Case_branchContext)_localctx).pat = ((Case_branchContext)_localctx).pattern.result; - setState(547); - match(T__38); - setState(548); - ((Case_branchContext)_localctx).scope_expression = scope_expression(); - ((Case_branchContext)_localctx).expr = ((Case_branchContext)_localctx).scope_expression.result; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Any_infixContext extends ParserRuleContext { - public String result; - public Token INFIX; - public Token MINUS; - public TerminalNode INFIX() { return getToken(LamaParser.INFIX, 0); } - public TerminalNode MINUS() { return getToken(LamaParser.MINUS, 0); } - public Any_infixContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_any_infix; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).enterAny_infix(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof LamaListener ) ((LamaListener)listener).exitAny_infix(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof LamaVisitor ) return ((LamaVisitor)visitor).visitAny_infix(this); - else return visitor.visitChildren(this); - } - } - - public final Any_infixContext any_infix() throws RecognitionException { - Any_infixContext _localctx = new Any_infixContext(_ctx, getState()); - enterRule(_localctx, 66, RULE_any_infix); - try { - setState(555); - _errHandler.sync(this); - switch (_input.LA(1)) { - case INFIX: - enterOuterAlt(_localctx, 1); - { - setState(551); - ((Any_infixContext)_localctx).INFIX = match(INFIX); - ((Any_infixContext)_localctx).result = ((Any_infixContext)_localctx).INFIX; - } - break; - case MINUS: - enterOuterAlt(_localctx, 2); - { - setState(553); - ((Any_infixContext)_localctx).MINUS = match(MINUS); - ((Any_infixContext)_localctx).result = ((Any_infixContext)_localctx).MINUS; - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static final String _serializedATN = - "\u0004\u00012\u022e\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ - "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ - "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ - "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ - "\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002\u000f\u0007\u000f"+ - "\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002\u0012\u0007\u0012"+ - "\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0002\u0015\u0007\u0015"+ - "\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017\u0002\u0018\u0007\u0018"+ - "\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a\u0002\u001b\u0007\u001b"+ - "\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d\u0002\u001e\u0007\u001e"+ - "\u0002\u001f\u0007\u001f\u0002 \u0007 \u0002!\u0007!\u0001\u0000\u0001"+ - "\u0000\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+ - "\u0001\u0001\u0001\u0005\u0001N\b\u0001\n\u0001\f\u0001Q\t\u0001\u0001"+ - "\u0001\u0001\u0001\u0001\u0001\u0003\u0001V\b\u0001\u0001\u0001\u0001"+ - "\u0001\u0001\u0001\u0003\u0001[\b\u0001\u0001\u0002\u0001\u0002\u0001"+ - "\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0003\u0002c\b\u0002\u0001"+ - "\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0003\u0003i\b\u0003\u0001"+ - "\u0003\u0001\u0003\u0001\u0003\u0001\u0004\u0001\u0004\u0001\u0004\u0001"+ - "\u0004\u0001\u0004\u0001\u0004\u0005\u0004t\b\u0004\n\u0004\f\u0004w\t"+ - "\u0004\u0001\u0004\u0001\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001"+ - "\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0003\u0005\u0082\b\u0005\u0001"+ - "\u0006\u0001\u0006\u0001\u0006\u0003\u0006\u0087\b\u0006\u0001\u0006\u0001"+ - "\u0006\u0001\u0006\u0001\u0006\u0003\u0006\u008d\b\u0006\u0001\u0006\u0001"+ - "\u0006\u0001\u0006\u0001\u0006\u0001\u0007\u0001\u0007\u0001\u0007\u0001"+ - "\u0007\u0001\u0007\u0001\u0007\u0005\u0007\u0099\b\u0007\n\u0007\f\u0007"+ - "\u009c\t\u0007\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\t\u0001\t"+ - "\u0001\t\u0001\t\u0001\t\u0001\t\u0003\t\u00a9\b\t\u0001\n\u0001\n\u0001"+ - "\n\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b"+ - "\u0005\u000b\u00b4\b\u000b\n\u000b\f\u000b\u00b7\t\u000b\u0001\f\u0001"+ - "\f\u0001\f\u0003\f\u00bc\b\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001\f\u0005"+ - "\f\u00c3\b\f\n\f\f\f\u00c6\t\f\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r"+ - "\u0001\r\u0001\r\u0001\r\u0005\r\u00d0\b\r\n\r\f\r\u00d3\t\r\u0001\r\u0001"+ - "\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0003\r\u00de"+ - "\b\r\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001"+ - "\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001"+ - "\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001"+ - "\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001"+ - "\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001"+ - "\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001"+ - "\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001"+ - "\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001"+ - "\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001"+ - "\u000e\u0003\u000e\u0116\b\u000e\u0001\u000f\u0001\u000f\u0001\u000f\u0001"+ - "\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0005\u000f\u0120"+ - "\b\u000f\n\u000f\f\u000f\u0123\t\u000f\u0003\u000f\u0125\b\u000f\u0001"+ - "\u000f\u0001\u000f\u0001\u000f\u0001\u0010\u0001\u0010\u0001\u0010\u0001"+ - "\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0005\u0010\u0132"+ - "\b\u0010\n\u0010\f\u0010\u0135\t\u0010\u0003\u0010\u0137\b\u0010\u0001"+ - "\u0010\u0001\u0010\u0001\u0010\u0001\u0011\u0001\u0011\u0001\u0011\u0001"+ - "\u0011\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011\u0005"+ - "\u0011\u0145\b\u0011\n\u0011\f\u0011\u0148\t\u0011\u0003\u0011\u014a\b"+ - "\u0011\u0001\u0011\u0003\u0011\u014d\b\u0011\u0001\u0011\u0001\u0011\u0001"+ - "\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001"+ - "\u0012\u0001\u0012\u0003\u0012\u0159\b\u0012\u0001\u0012\u0001\u0012\u0001"+ - "\u0012\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001"+ - "\u0013\u0001\u0013\u0001\u0013\u0003\u0013\u0166\b\u0013\u0001\u0013\u0001"+ - "\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0003\u0013\u016e"+ - "\b\u0013\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001"+ - "\u0014\u0001\u0014\u0001\u0015\u0001\u0015\u0001\u0015\u0001\u0015\u0001"+ - "\u0015\u0001\u0015\u0001\u0015\u0001\u0016\u0001\u0016\u0001\u0016\u0001"+ - "\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001"+ - "\u0016\u0001\u0016\u0001\u0017\u0001\u0017\u0001\u0017\u0001\u0017\u0001"+ - "\u0017\u0001\u0017\u0003\u0017\u018f\b\u0017\u0001\u0018\u0001\u0018\u0001"+ - "\u0018\u0001\u0018\u0001\u0018\u0001\u0019\u0001\u0019\u0001\u0019\u0001"+ - "\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001"+ - "\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001"+ - "\u0019\u0001\u0019\u0001\u0019\u0003\u0019\u01a8\b\u0019\u0001\u0019\u0001"+ - "\u0019\u0001\u0019\u0001\u0019\u0003\u0019\u01ae\b\u0019\u0001\u0019\u0001"+ - "\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001"+ - "\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001"+ - "\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001"+ - "\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001"+ - "\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001"+ - "\u0019\u0001\u0019\u0003\u0019\u01d1\b\u0019\u0001\u001a\u0001\u001a\u0001"+ - "\u001a\u0001\u001b\u0001\u001b\u0001\u001b\u0001\u001b\u0001\u001b\u0001"+ - "\u001b\u0001\u001b\u0001\u001b\u0001\u001b\u0005\u001b\u01df\b\u001b\n"+ - "\u001b\f\u001b\u01e2\t\u001b\u0003\u001b\u01e4\b\u001b\u0001\u001b\u0003"+ - "\u001b\u01e7\b\u001b\u0001\u001b\u0001\u001b\u0001\u001c\u0001\u001c\u0001"+ - "\u001c\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001c\u0005"+ - "\u001c\u01f3\b\u001c\n\u001c\f\u001c\u01f6\t\u001c\u0003\u001c\u01f8\b"+ - "\u001c\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001d\u0001\u001d\u0001"+ - "\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0005"+ - "\u001d\u0205\b\u001d\n\u001d\f\u001d\u0208\t\u001d\u0003\u001d\u020a\b"+ - "\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001e\u0001\u001e\u0001"+ - "\u001e\u0001\u001e\u0001\u001e\u0001\u001e\u0001\u001e\u0001\u001f\u0001"+ - "\u001f\u0001\u001f\u0001\u001f\u0001\u001f\u0001\u001f\u0001\u001f\u0005"+ - "\u001f\u021d\b\u001f\n\u001f\f\u001f\u0220\t\u001f\u0001 \u0001 \u0001"+ - " \u0001 \u0001 \u0001 \u0001!\u0001!\u0001!\u0001!\u0003!\u022c\b!\u0001"+ - "!\u0000\u0000\"\u0000\u0002\u0004\u0006\b\n\f\u000e\u0010\u0012\u0014"+ - "\u0016\u0018\u001a\u001c\u001e \"$&(*,.02468:<>@B\u0000\u0000\u0253\u0000"+ - "D\u0001\u0000\u0000\u0000\u0002Z\u0001\u0000\u0000\u0000\u0004b\u0001"+ - "\u0000\u0000\u0000\u0006d\u0001\u0000\u0000\u0000\bm\u0001\u0000\u0000"+ - "\u0000\nz\u0001\u0000\u0000\u0000\f\u0083\u0001\u0000\u0000\u0000\u000e"+ - "\u0092\u0001\u0000\u0000\u0000\u0010\u009d\u0001\u0000\u0000\u0000\u0012"+ - "\u00a2\u0001\u0000\u0000\u0000\u0014\u00aa\u0001\u0000\u0000\u0000\u0016"+ - "\u00ad\u0001\u0000\u0000\u0000\u0018\u00b8\u0001\u0000\u0000\u0000\u001a"+ - "\u00dd\u0001\u0000\u0000\u0000\u001c\u0115\u0001\u0000\u0000\u0000\u001e"+ - "\u0117\u0001\u0000\u0000\u0000 \u0129\u0001\u0000\u0000\u0000\"\u013b"+ - "\u0001\u0000\u0000\u0000$\u0150\u0001\u0000\u0000\u0000&\u016d\u0001\u0000"+ - "\u0000\u0000(\u016f\u0001\u0000\u0000\u0000*\u0176\u0001\u0000\u0000\u0000"+ - ",\u017d\u0001\u0000\u0000\u0000.\u018e\u0001\u0000\u0000\u00000\u0190"+ - "\u0001\u0000\u0000\u00002\u01d0\u0001\u0000\u0000\u00004\u01d2\u0001\u0000"+ - "\u0000\u00006\u01d5\u0001\u0000\u0000\u00008\u01ea\u0001\u0000\u0000\u0000"+ - ":\u01fc\u0001\u0000\u0000\u0000<\u020e\u0001\u0000\u0000\u0000>\u0215"+ - "\u0001\u0000\u0000\u0000@\u0221\u0001\u0000\u0000\u0000B\u022b\u0001\u0000"+ - "\u0000\u0000DE\u0003\u0002\u0001\u0000EF\u0006\u0000\uffff\uffff\u0000"+ - "FG\u0005\u0000\u0000\u0001G\u0001\u0001\u0000\u0000\u0000HI\u0003\u0004"+ - "\u0002\u0000IO\u0006\u0001\uffff\uffff\u0000JK\u0003\u0004\u0002\u0000"+ - "KL\u0006\u0001\uffff\uffff\u0000LN\u0001\u0000\u0000\u0000MJ\u0001\u0000"+ - "\u0000\u0000NQ\u0001\u0000\u0000\u0000OM\u0001\u0000\u0000\u0000OP\u0001"+ - "\u0000\u0000\u0000PU\u0001\u0000\u0000\u0000QO\u0001\u0000\u0000\u0000"+ - "RS\u0003\u0012\t\u0000ST\u0006\u0001\uffff\uffff\u0000TV\u0001\u0000\u0000"+ - "\u0000UR\u0001\u0000\u0000\u0000UV\u0001\u0000\u0000\u0000V[\u0001\u0000"+ - "\u0000\u0000WX\u0003\u0012\t\u0000XY\u0006\u0001\uffff\uffff\u0000Y[\u0001"+ - "\u0000\u0000\u0000ZH\u0001\u0000\u0000\u0000ZW\u0001\u0000\u0000\u0000"+ - "[\u0003\u0001\u0000\u0000\u0000\\]\u0003\u0006\u0003\u0000]^\u0006\u0002"+ - "\uffff\uffff\u0000^c\u0001\u0000\u0000\u0000_`\u0003\f\u0006\u0000`a\u0006"+ - "\u0002\uffff\uffff\u0000ac\u0001\u0000\u0000\u0000b\\\u0001\u0000\u0000"+ - "\u0000b_\u0001\u0000\u0000\u0000c\u0005\u0001\u0000\u0000\u0000dh\u0006"+ - "\u0003\uffff\uffff\u0000ei\u0005\u0001\u0000\u0000fg\u0005\u0002\u0000"+ - "\u0000gi\u0006\u0003\uffff\uffff\u0000he\u0001\u0000\u0000\u0000hf\u0001"+ - "\u0000\u0000\u0000ij\u0001\u0000\u0000\u0000jk\u0003\b\u0004\u0000kl\u0006"+ - "\u0003\uffff\uffff\u0000l\u0007\u0001\u0000\u0000\u0000mn\u0003\n\u0005"+ - "\u0000nu\u0006\u0004\uffff\uffff\u0000op\u0005\u0003\u0000\u0000pq\u0003"+ - "\n\u0005\u0000qr\u0006\u0004\uffff\uffff\u0000rt\u0001\u0000\u0000\u0000"+ - "so\u0001\u0000\u0000\u0000tw\u0001\u0000\u0000\u0000us\u0001\u0000\u0000"+ - "\u0000uv\u0001\u0000\u0000\u0000vx\u0001\u0000\u0000\u0000wu\u0001\u0000"+ - "\u0000\u0000xy\u0005\u0004\u0000\u0000y\t\u0001\u0000\u0000\u0000z{\u0006"+ - "\u0005\uffff\uffff\u0000{|\u0005.\u0000\u0000|\u0081\u0006\u0005\uffff"+ - "\uffff\u0000}~\u0005\u0005\u0000\u0000~\u007f\u0003\u0014\n\u0000\u007f"+ - "\u0080\u0006\u0005\uffff\uffff\u0000\u0080\u0082\u0001\u0000\u0000\u0000"+ - "\u0081}\u0001\u0000\u0000\u0000\u0081\u0082\u0001\u0000\u0000\u0000\u0082"+ - "\u000b\u0001\u0000\u0000\u0000\u0083\u0086\u0006\u0006\uffff\uffff\u0000"+ - "\u0084\u0085\u0005\u0002\u0000\u0000\u0085\u0087\u0006\u0006\uffff\uffff"+ - "\u0000\u0086\u0084\u0001\u0000\u0000\u0000\u0086\u0087\u0001\u0000\u0000"+ - "\u0000\u0087\u0088\u0001\u0000\u0000\u0000\u0088\u0089\u0005\u0006\u0000"+ - "\u0000\u0089\u008a\u0005.\u0000\u0000\u008a\u008c\u0005\u0007\u0000\u0000"+ - "\u008b\u008d\u0003\u000e\u0007\u0000\u008c\u008b\u0001\u0000\u0000\u0000"+ - "\u008c\u008d\u0001\u0000\u0000\u0000\u008d\u008e\u0001\u0000\u0000\u0000"+ - "\u008e\u008f\u0005\b\u0000\u0000\u008f\u0090\u0003\u0010\b\u0000\u0090"+ - "\u0091\u0006\u0006\uffff\uffff\u0000\u0091\r\u0001\u0000\u0000\u0000\u0092"+ - "\u0093\u0006\u0007\uffff\uffff\u0000\u0093\u0094\u0005.\u0000\u0000\u0094"+ - "\u009a\u0006\u0007\uffff\uffff\u0000\u0095\u0096\u0005\u0003\u0000\u0000"+ - "\u0096\u0097\u0005.\u0000\u0000\u0097\u0099\u0006\u0007\uffff\uffff\u0000"+ - "\u0098\u0095\u0001\u0000\u0000\u0000\u0099\u009c\u0001\u0000\u0000\u0000"+ - "\u009a\u0098\u0001\u0000\u0000\u0000\u009a\u009b\u0001\u0000\u0000\u0000"+ - "\u009b\u000f\u0001\u0000\u0000\u0000\u009c\u009a\u0001\u0000\u0000\u0000"+ - "\u009d\u009e\u0005\t\u0000\u0000\u009e\u009f\u0003\u0002\u0001\u0000\u009f"+ - "\u00a0\u0006\b\uffff\uffff\u0000\u00a0\u00a1\u0005\n\u0000\u0000\u00a1"+ - "\u0011\u0001\u0000\u0000\u0000\u00a2\u00a3\u0003\u0014\n\u0000\u00a3\u00a8"+ - "\u0006\t\uffff\uffff\u0000\u00a4\u00a5\u0005\u0004\u0000\u0000\u00a5\u00a6"+ - "\u0003\u0012\t\u0000\u00a6\u00a7\u0006\t\uffff\uffff\u0000\u00a7\u00a9"+ - "\u0001\u0000\u0000\u0000\u00a8\u00a4\u0001\u0000\u0000\u0000\u00a8\u00a9"+ - "\u0001\u0000\u0000\u0000\u00a9\u0013\u0001\u0000\u0000\u0000\u00aa\u00ab"+ - "\u0003\u0016\u000b\u0000\u00ab\u00ac\u0006\n\uffff\uffff\u0000\u00ac\u0015"+ - "\u0001\u0000\u0000\u0000\u00ad\u00ae\u0003\u0018\f\u0000\u00ae\u00b5\u0006"+ - "\u000b\uffff\uffff\u0000\u00af\u00b0\u0003B!\u0000\u00b0\u00b1\u0003\u0018"+ - "\f\u0000\u00b1\u00b2\u0006\u000b\uffff\uffff\u0000\u00b2\u00b4\u0001\u0000"+ - "\u0000\u0000\u00b3\u00af\u0001\u0000\u0000\u0000\u00b4\u00b7\u0001\u0000"+ - "\u0000\u0000\u00b5\u00b3\u0001\u0000\u0000\u0000\u00b5\u00b6\u0001\u0000"+ - "\u0000\u0000\u00b6\u0017\u0001\u0000\u0000\u0000\u00b7\u00b5\u0001\u0000"+ - "\u0000\u0000\u00b8\u00bb\u0006\f\uffff\uffff\u0000\u00b9\u00ba\u0005+"+ - "\u0000\u0000\u00ba\u00bc\u0006\f\uffff\uffff\u0000\u00bb\u00b9\u0001\u0000"+ - "\u0000\u0000\u00bb\u00bc\u0001\u0000\u0000\u0000\u00bc\u00bd\u0001\u0000"+ - "\u0000\u0000\u00bd\u00be\u0003\u001c\u000e\u0000\u00be\u00c4\u0006\f\uffff"+ - "\uffff\u0000\u00bf\u00c0\u0003\u001a\r\u0000\u00c0\u00c1\u0006\f\uffff"+ - "\uffff\u0000\u00c1\u00c3\u0001\u0000\u0000\u0000\u00c2\u00bf\u0001\u0000"+ - "\u0000\u0000\u00c3\u00c6\u0001\u0000\u0000\u0000\u00c4\u00c2\u0001\u0000"+ - "\u0000\u0000\u00c4\u00c5\u0001\u0000\u0000\u0000\u00c5\u0019\u0001\u0000"+ - "\u0000\u0000\u00c6\u00c4\u0001\u0000\u0000\u0000\u00c7\u00c8\u0006\r\uffff"+ - "\uffff\u0000\u00c8\u00c9\u0005\u0007\u0000\u0000\u00c9\u00ca\u0003\u0012"+ - "\t\u0000\u00ca\u00d1\u0006\r\uffff\uffff\u0000\u00cb\u00cc\u0005\u0003"+ - "\u0000\u0000\u00cc\u00cd\u0003\u0012\t\u0000\u00cd\u00ce\u0006\r\uffff"+ - "\uffff\u0000\u00ce\u00d0\u0001\u0000\u0000\u0000\u00cf\u00cb\u0001\u0000"+ - "\u0000\u0000\u00d0\u00d3\u0001\u0000\u0000\u0000\u00d1\u00cf\u0001\u0000"+ - "\u0000\u0000\u00d1\u00d2\u0001\u0000\u0000\u0000\u00d2\u00d4\u0001\u0000"+ - "\u0000\u0000\u00d3\u00d1\u0001\u0000\u0000\u0000\u00d4\u00d5\u0005\b\u0000"+ - "\u0000\u00d5\u00de\u0001\u0000\u0000\u0000\u00d6\u00d7\u0005\u0007\u0000"+ - "\u0000\u00d7\u00de\u0005\b\u0000\u0000\u00d8\u00d9\u0005\u000b\u0000\u0000"+ - "\u00d9\u00da\u0003\u0012\t\u0000\u00da\u00db\u0006\r\uffff\uffff\u0000"+ - "\u00db\u00dc\u0005\f\u0000\u0000\u00dc\u00de\u0001\u0000\u0000\u0000\u00dd"+ - "\u00c7\u0001\u0000\u0000\u0000\u00dd\u00d6\u0001\u0000\u0000\u0000\u00dd"+ - "\u00d8\u0001\u0000\u0000\u0000\u00de\u001b\u0001\u0000\u0000\u0000\u00df"+ - "\u00e0\u00051\u0000\u0000\u00e0\u0116\u0006\u000e\uffff\uffff\u0000\u00e1"+ - "\u00e2\u00050\u0000\u0000\u00e2\u0116\u0006\u000e\uffff\uffff\u0000\u00e3"+ - "\u00e4\u0005/\u0000\u0000\u00e4\u0116\u0006\u000e\uffff\uffff\u0000\u00e5"+ - "\u00e6\u0005.\u0000\u0000\u00e6\u0116\u0006\u000e\uffff\uffff\u0000\u00e7"+ - "\u00e8\u0005\r\u0000\u0000\u00e8\u0116\u0006\u000e\uffff\uffff\u0000\u00e9"+ - "\u00ea\u0005\u000e\u0000\u0000\u00ea\u0116\u0006\u000e\uffff\uffff\u0000"+ - "\u00eb\u00ec\u0005\u000f\u0000\u0000\u00ec\u00ed\u0003B!\u0000\u00ed\u00ee"+ - "\u0006\u000e\uffff\uffff\u0000\u00ee\u0116\u0001\u0000\u0000\u0000\u00ef"+ - "\u00f0\u0005\u0006\u0000\u0000\u00f0\u00f1\u0005\u0007\u0000\u0000\u00f1"+ - "\u00f2\u0003\u000e\u0007\u0000\u00f2\u00f3\u0005\b\u0000\u0000\u00f3\u00f4"+ - "\u0003\u0010\b\u0000\u00f4\u00f5\u0006\u000e\uffff\uffff\u0000\u00f5\u0116"+ - "\u0001\u0000\u0000\u0000\u00f6\u00f7\u0005\u0010\u0000\u0000\u00f7\u0116"+ - "\u0006\u000e\uffff\uffff\u0000\u00f8\u00f9\u0005\u0007\u0000\u0000\u00f9"+ - "\u00fa\u0003\u0002\u0001\u0000\u00fa\u00fb\u0005\b\u0000\u0000\u00fb\u00fc"+ - "\u0006\u000e\uffff\uffff\u0000\u00fc\u0116\u0001\u0000\u0000\u0000\u00fd"+ - "\u00fe\u0003 \u0010\u0000\u00fe\u00ff\u0006\u000e\uffff\uffff\u0000\u00ff"+ - "\u0116\u0001\u0000\u0000\u0000\u0100\u0101\u0003\u001e\u000f\u0000\u0101"+ - "\u0102\u0006\u000e\uffff\uffff\u0000\u0102\u0116\u0001\u0000\u0000\u0000"+ - "\u0103\u0104\u0003\"\u0011\u0000\u0104\u0105\u0006\u000e\uffff\uffff\u0000"+ - "\u0105\u0116\u0001\u0000\u0000\u0000\u0106\u0107\u0003$\u0012\u0000\u0107"+ - "\u0108\u0006\u000e\uffff\uffff\u0000\u0108\u0116\u0001\u0000\u0000\u0000"+ - "\u0109\u010a\u0003(\u0014\u0000\u010a\u010b\u0006\u000e\uffff\uffff\u0000"+ - "\u010b\u0116\u0001\u0000\u0000\u0000\u010c\u010d\u0003*\u0015\u0000\u010d"+ - "\u010e\u0006\u000e\uffff\uffff\u0000\u010e\u0116\u0001\u0000\u0000\u0000"+ - "\u010f\u0110\u0003,\u0016\u0000\u0110\u0111\u0006\u000e\uffff\uffff\u0000"+ - "\u0111\u0116\u0001\u0000\u0000\u0000\u0112\u0113\u0003<\u001e\u0000\u0113"+ - "\u0114\u0006\u000e\uffff\uffff\u0000\u0114\u0116\u0001\u0000\u0000\u0000"+ - "\u0115\u00df\u0001\u0000\u0000\u0000\u0115\u00e1\u0001\u0000\u0000\u0000"+ - "\u0115\u00e3\u0001\u0000\u0000\u0000\u0115\u00e5\u0001\u0000\u0000\u0000"+ - "\u0115\u00e7\u0001\u0000\u0000\u0000\u0115\u00e9\u0001\u0000\u0000\u0000"+ - "\u0115\u00eb\u0001\u0000\u0000\u0000\u0115\u00ef\u0001\u0000\u0000\u0000"+ - "\u0115\u00f6\u0001\u0000\u0000\u0000\u0115\u00f8\u0001\u0000\u0000\u0000"+ - "\u0115\u00fd\u0001\u0000\u0000\u0000\u0115\u0100\u0001\u0000\u0000\u0000"+ - "\u0115\u0103\u0001\u0000\u0000\u0000\u0115\u0106\u0001\u0000\u0000\u0000"+ - "\u0115\u0109\u0001\u0000\u0000\u0000\u0115\u010c\u0001\u0000\u0000\u0000"+ - "\u0115\u010f\u0001\u0000\u0000\u0000\u0115\u0112\u0001\u0000\u0000\u0000"+ - "\u0116\u001d\u0001\u0000\u0000\u0000\u0117\u0118\u0006\u000f\uffff\uffff"+ - "\u0000\u0118\u0124\u0005\u000b\u0000\u0000\u0119\u011a\u0003\u0012\t\u0000"+ - "\u011a\u0121\u0006\u000f\uffff\uffff\u0000\u011b\u011c\u0005\u0003\u0000"+ - "\u0000\u011c\u011d\u0003\u0012\t\u0000\u011d\u011e\u0006\u000f\uffff\uffff"+ - "\u0000\u011e\u0120\u0001\u0000\u0000\u0000\u011f\u011b\u0001\u0000\u0000"+ - "\u0000\u0120\u0123\u0001\u0000\u0000\u0000\u0121\u011f\u0001\u0000\u0000"+ - "\u0000\u0121\u0122\u0001\u0000\u0000\u0000\u0122\u0125\u0001\u0000\u0000"+ - "\u0000\u0123\u0121\u0001\u0000\u0000\u0000\u0124\u0119\u0001\u0000\u0000"+ - "\u0000\u0124\u0125\u0001\u0000\u0000\u0000\u0125\u0126\u0001\u0000\u0000"+ - "\u0000\u0126\u0127\u0005\f\u0000\u0000\u0127\u0128\u0006\u000f\uffff\uffff"+ - "\u0000\u0128\u001f\u0001\u0000\u0000\u0000\u0129\u012a\u0006\u0010\uffff"+ - "\uffff\u0000\u012a\u0136\u0005\t\u0000\u0000\u012b\u012c\u0003\u0012\t"+ - "\u0000\u012c\u0133\u0006\u0010\uffff\uffff\u0000\u012d\u012e\u0005\u0003"+ - "\u0000\u0000\u012e\u012f\u0003\u0012\t\u0000\u012f\u0130\u0006\u0010\uffff"+ - "\uffff\u0000\u0130\u0132\u0001\u0000\u0000\u0000\u0131\u012d\u0001\u0000"+ - "\u0000\u0000\u0132\u0135\u0001\u0000\u0000\u0000\u0133\u0131\u0001\u0000"+ - "\u0000\u0000\u0133\u0134\u0001\u0000\u0000\u0000\u0134\u0137\u0001\u0000"+ - "\u0000\u0000\u0135\u0133\u0001\u0000\u0000\u0000\u0136\u012b\u0001\u0000"+ - "\u0000\u0000\u0136\u0137\u0001\u0000\u0000\u0000\u0137\u0138\u0001\u0000"+ - "\u0000\u0000\u0138\u0139\u0005\n\u0000\u0000\u0139\u013a\u0006\u0010\uffff"+ - "\uffff\u0000\u013a!\u0001\u0000\u0000\u0000\u013b\u013c\u0006\u0011\uffff"+ - "\uffff\u0000\u013c\u014c\u0005-\u0000\u0000\u013d\u0149\u0005\u0007\u0000"+ - "\u0000\u013e\u013f\u0003\u0012\t\u0000\u013f\u0146\u0006\u0011\uffff\uffff"+ - "\u0000\u0140\u0141\u0005\u0003\u0000\u0000\u0141\u0142\u0003\u0012\t\u0000"+ - "\u0142\u0143\u0006\u0011\uffff\uffff\u0000\u0143\u0145\u0001\u0000\u0000"+ - "\u0000\u0144\u0140\u0001\u0000\u0000\u0000\u0145\u0148\u0001\u0000\u0000"+ - "\u0000\u0146\u0144\u0001\u0000\u0000\u0000\u0146\u0147\u0001\u0000\u0000"+ - "\u0000\u0147\u014a\u0001\u0000\u0000\u0000\u0148\u0146\u0001\u0000\u0000"+ - "\u0000\u0149\u013e\u0001\u0000\u0000\u0000\u0149\u014a\u0001\u0000\u0000"+ - "\u0000\u014a\u014b\u0001\u0000\u0000\u0000\u014b\u014d\u0005\b\u0000\u0000"+ - "\u014c\u013d\u0001\u0000\u0000\u0000\u014c\u014d\u0001\u0000\u0000\u0000"+ - "\u014d\u014e\u0001\u0000\u0000\u0000\u014e\u014f\u0006\u0011\uffff\uffff"+ - "\u0000\u014f#\u0001\u0000\u0000\u0000\u0150\u0151\u0006\u0012\uffff\uffff"+ - "\u0000\u0151\u0152\u0005\u0011\u0000\u0000\u0152\u0153\u0003\u0012\t\u0000"+ - "\u0153\u0154\u0005\u0012\u0000\u0000\u0154\u0158\u0003\u0002\u0001\u0000"+ - "\u0155\u0156\u0003&\u0013\u0000\u0156\u0157\u0006\u0012\uffff\uffff\u0000"+ - "\u0157\u0159\u0001\u0000\u0000\u0000\u0158\u0155\u0001\u0000\u0000\u0000"+ - "\u0158\u0159\u0001\u0000\u0000\u0000\u0159\u015a\u0001\u0000\u0000\u0000"+ - "\u015a\u015b\u0005\u0013\u0000\u0000\u015b\u015c\u0006\u0012\uffff\uffff"+ - "\u0000\u015c%\u0001\u0000\u0000\u0000\u015d\u015e\u0005\u0014\u0000\u0000"+ - "\u015e\u015f\u0006\u0013\uffff\uffff\u0000\u015f\u0160\u0003\u0012\t\u0000"+ - "\u0160\u0161\u0005\u0012\u0000\u0000\u0161\u0165\u0003\u0002\u0001\u0000"+ - "\u0162\u0163\u0003&\u0013\u0000\u0163\u0164\u0006\u0013\uffff\uffff\u0000"+ - "\u0164\u0166\u0001\u0000\u0000\u0000\u0165\u0162\u0001\u0000\u0000\u0000"+ - "\u0165\u0166\u0001\u0000\u0000\u0000\u0166\u0167\u0001\u0000\u0000\u0000"+ - "\u0167\u0168\u0006\u0013\uffff\uffff\u0000\u0168\u016e\u0001\u0000\u0000"+ - "\u0000\u0169\u016a\u0005\u0015\u0000\u0000\u016a\u016b\u0003\u0002\u0001"+ - "\u0000\u016b\u016c\u0006\u0013\uffff\uffff\u0000\u016c\u016e\u0001\u0000"+ - "\u0000\u0000\u016d\u015d\u0001\u0000\u0000\u0000\u016d\u0169\u0001\u0000"+ - "\u0000\u0000\u016e\'\u0001\u0000\u0000\u0000\u016f\u0170\u0005\u0016\u0000"+ - "\u0000\u0170\u0171\u0003\u0012\t\u0000\u0171\u0172\u0005\u0017\u0000\u0000"+ - "\u0172\u0173\u0003\u0002\u0001\u0000\u0173\u0174\u0005\u0018\u0000\u0000"+ - "\u0174\u0175\u0006\u0014\uffff\uffff\u0000\u0175)\u0001\u0000\u0000\u0000"+ - "\u0176\u0177\u0005\u0017\u0000\u0000\u0177\u0178\u0003\u0002\u0001\u0000"+ - "\u0178\u0179\u0005\u0016\u0000\u0000\u0179\u017a\u0003\u0012\t\u0000\u017a"+ - "\u017b\u0005\u0018\u0000\u0000\u017b\u017c\u0006\u0015\uffff\uffff\u0000"+ - "\u017c+\u0001\u0000\u0000\u0000\u017d\u017e\u0005\u0019\u0000\u0000\u017e"+ - "\u017f\u0003\u0002\u0001\u0000\u017f\u0180\u0005\u0003\u0000\u0000\u0180"+ - "\u0181\u0003\u0012\t\u0000\u0181\u0182\u0005\u0003\u0000\u0000\u0182\u0183"+ - "\u0003\u0012\t\u0000\u0183\u0184\u0005\u0017\u0000\u0000\u0184\u0185\u0003"+ - "\u0002\u0001\u0000\u0185\u0186\u0005\u0018\u0000\u0000\u0186\u0187\u0006"+ - "\u0016\uffff\uffff\u0000\u0187-\u0001\u0000\u0000\u0000\u0188\u0189\u0003"+ - "0\u0018\u0000\u0189\u018a\u0006\u0017\uffff\uffff\u0000\u018a\u018f\u0001"+ - "\u0000\u0000\u0000\u018b\u018c\u00032\u0019\u0000\u018c\u018d\u0006\u0017"+ - "\uffff\uffff\u0000\u018d\u018f\u0001\u0000\u0000\u0000\u018e\u0188\u0001"+ - "\u0000\u0000\u0000\u018e\u018b\u0001\u0000\u0000\u0000\u018f/\u0001\u0000"+ - "\u0000\u0000\u0190\u0191\u00032\u0019\u0000\u0191\u0192\u0005\u001a\u0000"+ - "\u0000\u0192\u0193\u0003.\u0017\u0000\u0193\u0194\u0006\u0018\uffff\uffff"+ - "\u0000\u01941\u0001\u0000\u0000\u0000\u0195\u0196\u00034\u001a\u0000\u0196"+ - "\u0197\u0006\u0019\uffff\uffff\u0000\u0197\u01d1\u0001\u0000\u0000\u0000"+ - "\u0198\u0199\u00036\u001b\u0000\u0199\u019a\u0006\u0019\uffff\uffff\u0000"+ - "\u019a\u01d1\u0001\u0000\u0000\u0000\u019b\u019c\u00038\u001c\u0000\u019c"+ - "\u019d\u0006\u0019\uffff\uffff\u0000\u019d\u01d1\u0001\u0000\u0000\u0000"+ - "\u019e\u019f\u0003:\u001d\u0000\u019f\u01a0\u0006\u0019\uffff\uffff\u0000"+ - "\u01a0\u01d1\u0001\u0000\u0000\u0000\u01a1\u01a2\u0005.\u0000\u0000\u01a2"+ - "\u01a7\u0006\u0019\uffff\uffff\u0000\u01a3\u01a4\u0005\u001b\u0000\u0000"+ - "\u01a4\u01a5\u0003.\u0017\u0000\u01a5\u01a6\u0006\u0019\uffff\uffff\u0000"+ - "\u01a6\u01a8\u0001\u0000\u0000\u0000\u01a7\u01a3\u0001\u0000\u0000\u0000"+ - "\u01a7\u01a8\u0001\u0000\u0000\u0000\u01a8\u01a9\u0001\u0000\u0000\u0000"+ - "\u01a9\u01d1\u0006\u0019\uffff\uffff\u0000\u01aa\u01ad\u0006\u0019\uffff"+ - "\uffff\u0000\u01ab\u01ac\u0005+\u0000\u0000\u01ac\u01ae\u0006\u0019\uffff"+ - "\uffff\u0000\u01ad\u01ab\u0001\u0000\u0000\u0000\u01ad\u01ae\u0001\u0000"+ - "\u0000\u0000\u01ae\u01af\u0001\u0000\u0000\u0000\u01af\u01b0\u00051\u0000"+ - "\u0000\u01b0\u01d1\u0006\u0019\uffff\uffff\u0000\u01b1\u01b2\u00050\u0000"+ - "\u0000\u01b2\u01d1\u0006\u0019\uffff\uffff\u0000\u01b3\u01b4\u0005/\u0000"+ - "\u0000\u01b4\u01d1\u0006\u0019\uffff\uffff\u0000\u01b5\u01b6\u0005\r\u0000"+ - "\u0000\u01b6\u01d1\u0006\u0019\uffff\uffff\u0000\u01b7\u01b8\u0005\u000e"+ - "\u0000\u0000\u01b8\u01d1\u0006\u0019\uffff\uffff\u0000\u01b9\u01ba\u0005"+ - "\u001c\u0000\u0000\u01ba\u01bb\u0005\u001d\u0000\u0000\u01bb\u01d1\u0006"+ - "\u0019\uffff\uffff\u0000\u01bc\u01bd\u0005\u001c\u0000\u0000\u01bd\u01be"+ - "\u0005\u001e\u0000\u0000\u01be\u01d1\u0006\u0019\uffff\uffff\u0000\u01bf"+ - "\u01c0\u0005\u001c\u0000\u0000\u01c0\u01c1\u0005\u001f\u0000\u0000\u01c1"+ - "\u01d1\u0006\u0019\uffff\uffff\u0000\u01c2\u01c3\u0005\u001c\u0000\u0000"+ - "\u01c3\u01c4\u0005 \u0000\u0000\u01c4\u01d1\u0006\u0019\uffff\uffff\u0000"+ - "\u01c5\u01c6\u0005\u001c\u0000\u0000\u01c6\u01c7\u0005!\u0000\u0000\u01c7"+ - "\u01d1\u0006\u0019\uffff\uffff\u0000\u01c8\u01c9\u0005\u001c\u0000\u0000"+ - "\u01c9\u01ca\u0005\u0006\u0000\u0000\u01ca\u01d1\u0006\u0019\uffff\uffff"+ - "\u0000\u01cb\u01cc\u0005\u0007\u0000\u0000\u01cc\u01cd\u0003.\u0017\u0000"+ - "\u01cd\u01ce\u0005\b\u0000\u0000\u01ce\u01cf\u0006\u0019\uffff\uffff\u0000"+ - "\u01cf\u01d1\u0001\u0000\u0000\u0000\u01d0\u0195\u0001\u0000\u0000\u0000"+ - "\u01d0\u0198\u0001\u0000\u0000\u0000\u01d0\u019b\u0001\u0000\u0000\u0000"+ - "\u01d0\u019e\u0001\u0000\u0000\u0000\u01d0\u01a1\u0001\u0000\u0000\u0000"+ - "\u01d0\u01aa\u0001\u0000\u0000\u0000\u01d0\u01b1\u0001\u0000\u0000\u0000"+ - "\u01d0\u01b3\u0001\u0000\u0000\u0000\u01d0\u01b5\u0001\u0000\u0000\u0000"+ - "\u01d0\u01b7\u0001\u0000\u0000\u0000\u01d0\u01b9\u0001\u0000\u0000\u0000"+ - "\u01d0\u01bc\u0001\u0000\u0000\u0000\u01d0\u01bf\u0001\u0000\u0000\u0000"+ - "\u01d0\u01c2\u0001\u0000\u0000\u0000\u01d0\u01c5\u0001\u0000\u0000\u0000"+ - "\u01d0\u01c8\u0001\u0000\u0000\u0000\u01d0\u01cb\u0001\u0000\u0000\u0000"+ - "\u01d13\u0001\u0000\u0000\u0000\u01d2\u01d3\u0005\"\u0000\u0000\u01d3"+ - "\u01d4\u0006\u001a\uffff\uffff\u0000\u01d45\u0001\u0000\u0000\u0000\u01d5"+ - "\u01d6\u0006\u001b\uffff\uffff\u0000\u01d6\u01e6\u0005-\u0000\u0000\u01d7"+ - "\u01e3\u0005\u0007\u0000\u0000\u01d8\u01d9\u0003.\u0017\u0000\u01d9\u01e0"+ - "\u0006\u001b\uffff\uffff\u0000\u01da\u01db\u0005\u0003\u0000\u0000\u01db"+ - "\u01dc\u0003.\u0017\u0000\u01dc\u01dd\u0006\u001b\uffff\uffff\u0000\u01dd"+ - "\u01df\u0001\u0000\u0000\u0000\u01de\u01da\u0001\u0000\u0000\u0000\u01df"+ - "\u01e2\u0001\u0000\u0000\u0000\u01e0\u01de\u0001\u0000\u0000\u0000\u01e0"+ - "\u01e1\u0001\u0000\u0000\u0000\u01e1\u01e4\u0001\u0000\u0000\u0000\u01e2"+ - "\u01e0\u0001\u0000\u0000\u0000\u01e3\u01d8\u0001\u0000\u0000\u0000\u01e3"+ - "\u01e4\u0001\u0000\u0000\u0000\u01e4\u01e5\u0001\u0000\u0000\u0000\u01e5"+ - "\u01e7\u0005\b\u0000\u0000\u01e6\u01d7\u0001\u0000\u0000\u0000\u01e6\u01e7"+ - "\u0001\u0000\u0000\u0000\u01e7\u01e8\u0001\u0000\u0000\u0000\u01e8\u01e9"+ - "\u0006\u001b\uffff\uffff\u0000\u01e97\u0001\u0000\u0000\u0000\u01ea\u01eb"+ - "\u0006\u001c\uffff\uffff\u0000\u01eb\u01f7\u0005\u000b\u0000\u0000\u01ec"+ - "\u01ed\u0003.\u0017\u0000\u01ed\u01f4\u0006\u001c\uffff\uffff\u0000\u01ee"+ - "\u01ef\u0005\u0003\u0000\u0000\u01ef\u01f0\u0003.\u0017\u0000\u01f0\u01f1"+ - "\u0006\u001c\uffff\uffff\u0000\u01f1\u01f3\u0001\u0000\u0000\u0000\u01f2"+ - "\u01ee\u0001\u0000\u0000\u0000\u01f3\u01f6\u0001\u0000\u0000\u0000\u01f4"+ - "\u01f2\u0001\u0000\u0000\u0000\u01f4\u01f5\u0001\u0000\u0000\u0000\u01f5"+ - "\u01f8\u0001\u0000\u0000\u0000\u01f6\u01f4\u0001\u0000\u0000\u0000\u01f7"+ - "\u01ec\u0001\u0000\u0000\u0000\u01f7\u01f8\u0001\u0000\u0000\u0000\u01f8"+ - "\u01f9\u0001\u0000\u0000\u0000\u01f9\u01fa\u0005\f\u0000\u0000\u01fa\u01fb"+ - "\u0006\u001c\uffff\uffff\u0000\u01fb9\u0001\u0000\u0000\u0000\u01fc\u01fd"+ - "\u0006\u001d\uffff\uffff\u0000\u01fd\u0209\u0005\t\u0000\u0000\u01fe\u01ff"+ - "\u0003.\u0017\u0000\u01ff\u0206\u0006\u001d\uffff\uffff\u0000\u0200\u0201"+ - "\u0005\u0003\u0000\u0000\u0201\u0202\u0003.\u0017\u0000\u0202\u0203\u0006"+ - "\u001d\uffff\uffff\u0000\u0203\u0205\u0001\u0000\u0000\u0000\u0204\u0200"+ - "\u0001\u0000\u0000\u0000\u0205\u0208\u0001\u0000\u0000\u0000\u0206\u0204"+ - "\u0001\u0000\u0000\u0000\u0206\u0207\u0001\u0000\u0000\u0000\u0207\u020a"+ - "\u0001\u0000\u0000\u0000\u0208\u0206\u0001\u0000\u0000\u0000\u0209\u01fe"+ - "\u0001\u0000\u0000\u0000\u0209\u020a\u0001\u0000\u0000\u0000\u020a\u020b"+ - "\u0001\u0000\u0000\u0000\u020b\u020c\u0005\n\u0000\u0000\u020c\u020d\u0006"+ - "\u001d\uffff\uffff\u0000\u020d;\u0001\u0000\u0000\u0000\u020e\u020f\u0005"+ - "#\u0000\u0000\u020f\u0210\u0003\u0012\t\u0000\u0210\u0211\u0005$\u0000"+ - "\u0000\u0211\u0212\u0003>\u001f\u0000\u0212\u0213\u0005%\u0000\u0000\u0213"+ - "\u0214\u0006\u001e\uffff\uffff\u0000\u0214=\u0001\u0000\u0000\u0000\u0215"+ - "\u0216\u0006\u001f\uffff\uffff\u0000\u0216\u0217\u0003@ \u0000\u0217\u021e"+ - "\u0006\u001f\uffff\uffff\u0000\u0218\u0219\u0005&\u0000\u0000\u0219\u021a"+ - "\u0003@ \u0000\u021a\u021b\u0006\u001f\uffff\uffff\u0000\u021b\u021d\u0001"+ - "\u0000\u0000\u0000\u021c\u0218\u0001\u0000\u0000\u0000\u021d\u0220\u0001"+ - "\u0000\u0000\u0000\u021e\u021c\u0001\u0000\u0000\u0000\u021e\u021f\u0001"+ - "\u0000\u0000\u0000\u021f?\u0001\u0000\u0000\u0000\u0220\u021e\u0001\u0000"+ - "\u0000\u0000\u0221\u0222\u0003.\u0017\u0000\u0222\u0223\u0006 \uffff\uffff"+ - "\u0000\u0223\u0224\u0005\'\u0000\u0000\u0224\u0225\u0003\u0002\u0001\u0000"+ - "\u0225\u0226\u0006 \uffff\uffff\u0000\u0226A\u0001\u0000\u0000\u0000\u0227"+ - "\u0228\u0005,\u0000\u0000\u0228\u022c\u0006!\uffff\uffff\u0000\u0229\u022a"+ - "\u0005+\u0000\u0000\u022a\u022c\u0006!\uffff\uffff\u0000\u022b\u0227\u0001"+ - "\u0000\u0000\u0000\u022b\u0229\u0001\u0000\u0000\u0000\u022cC\u0001\u0000"+ - "\u0000\u0000(OUZbhu\u0081\u0086\u008c\u009a\u00a8\u00b5\u00bb\u00c4\u00d1"+ - "\u00dd\u0115\u0121\u0124\u0133\u0136\u0146\u0149\u014c\u0158\u0165\u016d"+ - "\u018e\u01a7\u01ad\u01d0\u01e0\u01e3\u01e6\u01f4\u01f7\u0206\u0209\u021e"+ - "\u022b"; - public static final ATN _ATN = - new ATNDeserializer().deserialize(_serializedATN.toCharArray()); - static { - _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; - for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { - _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); - } - } + static { + RuntimeMetaData.checkVersion("4.13.2", RuntimeMetaData.VERSION); + } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + T__0 = 1, T__1 = 2, T__2 = 3, T__3 = 4, T__4 = 5, T__5 = 6, T__6 = 7, T__7 = 8, T__8 = 9, + T__9 = 10, T__10 = 11, T__11 = 12, T__12 = 13, T__13 = 14, T__14 = 15, T__15 = 16, T__16 = 17, + T__17 = 18, T__18 = 19, T__19 = 20, T__20 = 21, T__21 = 22, T__22 = 23, T__23 = 24, + T__24 = 25, T__25 = 26, T__26 = 27, T__27 = 28, T__28 = 29, T__29 = 30, T__30 = 31, + T__31 = 32, T__32 = 33, T__33 = 34, T__34 = 35, T__35 = 36, T__36 = 37, T__37 = 38, + T__38 = 39, WS = 40, COMMENT = 41, LINE_COMMENT = 42, MINUS = 43, INFIX = 44, UIDENT = 45, + LIDENT = 46, CHAR_LITERAL = 47, STRING_LITERAL = 48, DECIMAL_LITERAL = 49, WORD = 50; + public static final int + RULE_lama = 0, RULE_scope_expression = 1, RULE_definition = 2, RULE_variable_definition = 3, + RULE_variable_definition_sequence = 4, RULE_variable_definition_item = 5, + RULE_function_definition = 6, RULE_function_arguments = 7, RULE_function_body = 8, + RULE_expression = 9, RULE_basic_expression = 10, RULE_binary_expression = 11, + RULE_postfix_expression = 12, RULE_postfix = 13, RULE_primary = 14, RULE_array_expression = 15, + RULE_list_expression = 16, RULE_s_expression = 17, RULE_if_expression = 18, + RULE_else_part = 19, RULE_while_do_expression = 20, RULE_do_while_expression = 21, + RULE_for_expression = 22, RULE_pattern = 23, RULE_cons_pattern = 24, RULE_simple_pattern = 25, + RULE_wildcard_pattern = 26, RULE_s_expr_pattern = 27, RULE_array_pattern = 28, + RULE_list_pattern = 29, RULE_case_expression = 30, RULE_case_branches = 31, + RULE_case_branch = 32, RULE_any_infix = 33; + + private static String[] makeRuleNames() { + return new String[]{ + "lama", "scope_expression", "definition", "variable_definition", "variable_definition_sequence", + "variable_definition_item", "function_definition", "function_arguments", + "function_body", "expression", "basic_expression", "binary_expression", + "postfix_expression", "postfix", "primary", "array_expression", "list_expression", + "s_expression", "if_expression", "else_part", "while_do_expression", + "do_while_expression", "for_expression", "pattern", "cons_pattern", "simple_pattern", + "wildcard_pattern", "s_expr_pattern", "array_pattern", "list_pattern", + "case_expression", "case_branches", "case_branch", "any_infix" + }; + } + + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[]{ + null, "'var'", "'public'", "','", "';'", "'='", "'fun'", "'('", "')'", + "'{'", "'}'", "'['", "']'", "'true'", "'false'", "'infix'", "'skip'", + "'if'", "'then'", "'fi'", "'elif'", "'else'", "'while'", "'do'", "'od'", + "'for'", "':'", "'@'", "'#'", "'box'", "'val'", "'str'", "'array'", "'sexp'", + "'_'", "'case'", "'of'", "'esac'", "'|'", "'->'", null, null, null, "'-'" + }; + } + + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + + private static String[] makeSymbolicNames() { + return new String[]{ + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, "WS", "COMMENT", "LINE_COMMENT", "MINUS", "INFIX", + "UIDENT", "LIDENT", "CHAR_LITERAL", "STRING_LITERAL", "DECIMAL_LITERAL", + "WORD" + }; + } + + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + @Override + public String getGrammarFileName() { + return "Lama.g4"; + } + + @Override + public String[] getRuleNames() { + return ruleNames; + } + + @Override + public String getSerializedATN() { + return _serializedATN; + } + + @Override + public ATN getATN() { + return _ATN; + } + + + private LamaNodeFactory factory; + private Source source; + + private static final class BailoutErrorListener extends BaseErrorListener { + private final Source source; + + BailoutErrorListener(Source source) { + this.source = source; + } + + @Override + public void syntaxError(Recognizer recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) { + throwParseError(source, line, charPositionInLine, (Token) offendingSymbol, msg); + } + } + + public void SemErr(Token token, String message) { + assert token != null; + throwParseError(source, token.getLine(), token.getCharPositionInLine(), token, message); + } + + private static void throwParseError(Source source, int line, int charPositionInLine, Token token, String message) { + int col = charPositionInLine + 1; + String location = "-- line " + line + " col " + col + ": "; + int length = token == null ? 1 : Math.max(token.getStopIndex() - token.getStartIndex(), 0); + throw new LamaParseError(source, line, col, length, String.format("Error(s) parsing script:%n" + location + message)); + } + + public static LamaRootNode parseLama(LamaLanguage language, Source source) { + LamaLexer lexer = new LamaLexer(CharStreams.fromString(source.getCharacters().toString())); + LamaParser parser = new LamaParser(new CommonTokenStream(lexer)); + lexer.removeErrorListeners(); + parser.removeErrorListeners(); + BailoutErrorListener listener = new BailoutErrorListener(source); + lexer.addErrorListener(listener); + parser.addErrorListener(listener); + parser.factory = new LamaNodeFactory(language, source); + parser.source = source; + parser.lama(); + return parser.factory.getRootExpr(); + } + + public LamaParser(TokenStream input) { + super(input); + _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); + } + + @SuppressWarnings("CheckReturnValue") + public static class LamaContext extends ParserRuleContext { + public LamaExpressionNode result; + public Scope_expressionContext scope_expression; + + public Scope_expressionContext scope_expression() { + return getRuleContext(Scope_expressionContext.class, 0); + } + + public TerminalNode EOF() { + return getToken(LamaParser.EOF, 0); + } + + public LamaContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_lama; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterLama(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitLama(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitLama(this); + else return visitor.visitChildren(this); + } + } + + public final LamaContext lama() throws RecognitionException { + LamaContext _localctx = new LamaContext(_ctx, getState()); + enterRule(_localctx, 0, RULE_lama); + try { + enterOuterAlt(_localctx, 1); + { + setState(68); + ((LamaContext) _localctx).scope_expression = scope_expression(false); + ((LamaContext) _localctx).result = ((LamaContext) _localctx).scope_expression.result; + factory.setRootExpr(_localctx.result); + setState(70); + match(EOF); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Scope_expressionContext extends ParserRuleContext { + public boolean do_scope; + public LamaExpressionNode result; + public ExpressionContext expression; + + public List definition() { + return getRuleContexts(DefinitionContext.class); + } + + public DefinitionContext definition(int i) { + return getRuleContext(DefinitionContext.class, i); + } + + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class, 0); + } + + public Scope_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + public Scope_expressionContext(ParserRuleContext parent, int invokingState, boolean do_scope) { + super(parent, invokingState); + this.do_scope = do_scope; + } + + @Override + public int getRuleIndex() { + return RULE_scope_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterScope_expression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitScope_expression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitScope_expression(this); + else return visitor.visitChildren(this); + } + } + + public final Scope_expressionContext scope_expression(boolean do_scope) throws RecognitionException { + Scope_expressionContext _localctx = new Scope_expressionContext(_ctx, getState(), do_scope); + enterRule(_localctx, 2, RULE_scope_expression); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + if (do_scope) { + factory.enterScope(); + } + setState(91); + _errHandler.sync(this); + switch (getInterpreter().adaptivePredict(_input, 2, _ctx)) { + case 1: { + setState(73); + definition(); + ((Scope_expressionContext) _localctx).result = ((Scope_expressionContext) _localctx).expression.result; + setState(80); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input, 0, _ctx); + while (_alt != 2 && _alt != ATN.INVALID_ALT_NUMBER) { + if (_alt == 1) { + { + { + setState(75); + definition(); + ((Scope_expressionContext) _localctx).result = factory.createSeqNode(_localctx.result, ((Scope_expressionContext) _localctx).expression.result); + } + } + } + setState(82); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input, 0, _ctx); + } + setState(86); + _errHandler.sync(this); + switch (getInterpreter().adaptivePredict(_input, 1, _ctx)) { + case 1: { + setState(83); + ((Scope_expressionContext) _localctx).expression = expression(); + ((Scope_expressionContext) _localctx).result = factory.createSeqNode(_localctx.result, ((Scope_expressionContext) _localctx).expression.result); + } + break; + } + } + break; + case 2: { + setState(88); + ((Scope_expressionContext) _localctx).expression = expression(); + ((Scope_expressionContext) _localctx).result = ((Scope_expressionContext) _localctx).expression.result; + } + break; + } + if (do_scope) { + factory.exitScope(); + } + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class DefinitionContext extends ParserRuleContext { + public LamaExpressionNode result; + public Variable_definitionContext variable_definition; + public Function_definitionContext function_definition; + + public Variable_definitionContext variable_definition() { + return getRuleContext(Variable_definitionContext.class, 0); + } + + public Function_definitionContext function_definition() { + return getRuleContext(Function_definitionContext.class, 0); + } + + public DefinitionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_definition; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterDefinition(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitDefinition(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitDefinition(this); + else return visitor.visitChildren(this); + } + } + + public final DefinitionContext definition() throws RecognitionException { + DefinitionContext _localctx = new DefinitionContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_definition); + try { + setState(101); + _errHandler.sync(this); + switch (getInterpreter().adaptivePredict(_input, 3, _ctx)) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(95); + ((DefinitionContext) _localctx).variable_definition = variable_definition(); + ((DefinitionContext) _localctx).result = ((DefinitionContext) _localctx).variable_definition.result; + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(98); + ((DefinitionContext) _localctx).function_definition = function_definition(); + ((DefinitionContext) _localctx).result = ((DefinitionContext) _localctx).function_definition.result; + } + break; + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Variable_definitionContext extends ParserRuleContext { + public LamaExpressionNode result; + public Variable_definition_sequenceContext variable_definition_sequence; + + public Variable_definition_sequenceContext variable_definition_sequence() { + return getRuleContext(Variable_definition_sequenceContext.class, 0); + } + + public Variable_definitionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_variable_definition; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterVariable_definition(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitVariable_definition(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) + return ((LamaVisitor) visitor).visitVariable_definition(this); + else return visitor.visitChildren(this); + } + } + + public final Variable_definitionContext variable_definition() throws RecognitionException { + Variable_definitionContext _localctx = new Variable_definitionContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_variable_definition); + try { + enterOuterAlt(_localctx, 1); + { + boolean is_public = false; + setState(107); + _errHandler.sync(this); + switch (_input.LA(1)) { + case T__0: { + setState(104); + match(T__0); + } + break; + case T__1: { + setState(105); + match(T__1); + is_public = true; + } + break; + default: + throw new NoViableAltException(this); + } + setState(109); + ((Variable_definitionContext) _localctx).variable_definition_sequence = variable_definition_sequence(is_public); + ((Variable_definitionContext) _localctx).result = ((Variable_definitionContext) _localctx).variable_definition_sequence.result; + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Variable_definition_sequenceContext extends ParserRuleContext { + public boolean is_public; + public LamaExpressionNode result; + public Variable_definition_itemContext variable_definition_item; + + public List variable_definition_item() { + return getRuleContexts(Variable_definition_itemContext.class); + } + + public Variable_definition_itemContext variable_definition_item(int i) { + return getRuleContext(Variable_definition_itemContext.class, i); + } + + public Variable_definition_sequenceContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + public Variable_definition_sequenceContext(ParserRuleContext parent, int invokingState, boolean is_public) { + super(parent, invokingState); + this.is_public = is_public; + } + + @Override + public int getRuleIndex() { + return RULE_variable_definition_sequence; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterVariable_definition_sequence(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitVariable_definition_sequence(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) + return ((LamaVisitor) visitor).visitVariable_definition_sequence(this); + else return visitor.visitChildren(this); + } + } + + public final Variable_definition_sequenceContext variable_definition_sequence(boolean is_public) throws RecognitionException { + Variable_definition_sequenceContext _localctx = new Variable_definition_sequenceContext(_ctx, getState(), is_public); + enterRule(_localctx, 8, RULE_variable_definition_sequence); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(112); + ((Variable_definition_sequenceContext) _localctx).variable_definition_item = variable_definition_item(); + ((Variable_definition_sequenceContext) _localctx).result = factory.createAssignVarNode(((Variable_definition_sequenceContext) _localctx).variable_definition_item.name, ((Variable_definition_sequenceContext) _localctx).variable_definition_item.expr); + setState(120); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la == T__2) { + { + { + setState(114); + match(T__2); + setState(115); + ((Variable_definition_sequenceContext) _localctx).variable_definition_item = variable_definition_item(); + ((Variable_definition_sequenceContext) _localctx).result = factory.createSeqNode(_localctx.result, factory.createAssignVarNode(((Variable_definition_sequenceContext) _localctx).variable_definition_item.name, ((Variable_definition_sequenceContext) _localctx).variable_definition_item.expr)); + } + } + setState(122); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(123); + match(T__3); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Variable_definition_itemContext extends ParserRuleContext { + public Token name; + public LamaExpressionNode expr; + public Token LIDENT; + public Basic_expressionContext basic_expression; + + public TerminalNode LIDENT() { + return getToken(LamaParser.LIDENT, 0); + } + + public Basic_expressionContext basic_expression() { + return getRuleContext(Basic_expressionContext.class, 0); + } + + public Variable_definition_itemContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_variable_definition_item; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterVariable_definition_item(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitVariable_definition_item(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) + return ((LamaVisitor) visitor).visitVariable_definition_item(this); + else return visitor.visitChildren(this); + } + } + + public final Variable_definition_itemContext variable_definition_item() throws RecognitionException { + Variable_definition_itemContext _localctx = new Variable_definition_itemContext(_ctx, getState()); + enterRule(_localctx, 10, RULE_variable_definition_item); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + ((Variable_definition_itemContext) _localctx).expr = null; + setState(126); + ((Variable_definition_itemContext) _localctx).LIDENT = match(LIDENT); + ((Variable_definition_itemContext) _localctx).name = ((Variable_definition_itemContext) _localctx).LIDENT; + setState(132); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la == T__4) { + { + setState(128); + match(T__4); + setState(129); + ((Variable_definition_itemContext) _localctx).basic_expression = basic_expression(); + ((Variable_definition_itemContext) _localctx).expr = ((Variable_definition_itemContext) _localctx).basic_expression.result; + } + } + + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Function_definitionContext extends ParserRuleContext { + public LamaExpressionNode result; + public Token LIDENT; + public Function_argumentsContext function_arguments; + public Function_bodyContext function_body; + + public TerminalNode LIDENT() { + return getToken(LamaParser.LIDENT, 0); + } + + public Function_bodyContext function_body() { + return getRuleContext(Function_bodyContext.class, 0); + } + + public Function_argumentsContext function_arguments() { + return getRuleContext(Function_argumentsContext.class, 0); + } + + public Function_definitionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_function_definition; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterFunction_definition(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitFunction_definition(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) + return ((LamaVisitor) visitor).visitFunction_definition(this); + else return visitor.visitChildren(this); + } + } + + public final Function_definitionContext function_definition() throws RecognitionException { + Function_definitionContext _localctx = new Function_definitionContext(_ctx, getState()); + enterRule(_localctx, 12, RULE_function_definition); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + + boolean is_public = false; + List args = new ArrayList(); + factory.enterScope(LamaNodeFactory.LexicalScope.Kind.FUNCTION); + + setState(137); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la == T__1) { + { + setState(135); + match(T__1); + is_public = true; + } + } + + setState(139); + match(T__5); + setState(140); + ((Function_definitionContext) _localctx).LIDENT = match(LIDENT); + setState(141); + match(T__6); + setState(145); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la == LIDENT) { + { + setState(142); + ((Function_definitionContext) _localctx).function_arguments = function_arguments(); + args = ((Function_definitionContext) _localctx).function_arguments.args; + factory.addFunctionArguments(args); + } + } + + setState(147); + match(T__7); + setState(148); + ((Function_definitionContext) _localctx).function_body = function_body(); + + ((Function_definitionContext) _localctx).result = factory.createClosureNode(((Function_definitionContext) _localctx).LIDENT, ((Function_definitionContext) _localctx).function_body.result, args.size()); // create lambda for the function + factory.exitScope(); // TODO: create exit node to create vars ?? + ((Function_definitionContext) _localctx).result = factory.createAssignVarNode(((Function_definitionContext) _localctx).LIDENT, _localctx.result); // create global function: out of the created scope + + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Function_argumentsContext extends ParserRuleContext { + public List args; + public Token LIDENT; + + public List LIDENT() { + return getTokens(LamaParser.LIDENT); + } + + public TerminalNode LIDENT(int i) { + return getToken(LamaParser.LIDENT, i); + } + + public Function_argumentsContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_function_arguments; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterFunction_arguments(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitFunction_arguments(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) + return ((LamaVisitor) visitor).visitFunction_arguments(this); + else return visitor.visitChildren(this); + } + } + + public final Function_argumentsContext function_arguments() throws RecognitionException { + Function_argumentsContext _localctx = new Function_argumentsContext(_ctx, getState()); + enterRule(_localctx, 14, RULE_function_arguments); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + ((Function_argumentsContext) _localctx).args = new ArrayList(); + setState(152); + ((Function_argumentsContext) _localctx).LIDENT = match(LIDENT); + _localctx.args.addLast(((Function_argumentsContext) _localctx).LIDENT); + setState(159); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la == T__2) { + { + { + setState(154); + match(T__2); + setState(155); + ((Function_argumentsContext) _localctx).LIDENT = match(LIDENT); + _localctx.args.addLast(((Function_argumentsContext) _localctx).LIDENT); + } + } + setState(161); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Function_bodyContext extends ParserRuleContext { + public LamaExpressionNode result; + public Scope_expressionContext scope_expression; + + public Scope_expressionContext scope_expression() { + return getRuleContext(Scope_expressionContext.class, 0); + } + + public Function_bodyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_function_body; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterFunction_body(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitFunction_body(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitFunction_body(this); + else return visitor.visitChildren(this); + } + } + + public final Function_bodyContext function_body() throws RecognitionException { + Function_bodyContext _localctx = new Function_bodyContext(_ctx, getState()); + enterRule(_localctx, 16, RULE_function_body); + try { + enterOuterAlt(_localctx, 1); + { + setState(162); + match(T__8); + setState(163); + ((Function_bodyContext) _localctx).scope_expression = scope_expression(true); + ((Function_bodyContext) _localctx).result = ((Function_bodyContext) _localctx).scope_expression.result; + setState(165); + match(T__9); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ExpressionContext extends ParserRuleContext { + public LamaExpressionNode result; + public Basic_expressionContext basic_expression; + public ExpressionContext expression; + + public Basic_expressionContext basic_expression() { + return getRuleContext(Basic_expressionContext.class, 0); + } + + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class, 0); + } + + public ExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterExpression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitExpression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitExpression(this); + else return visitor.visitChildren(this); + } + } + + public final ExpressionContext expression() throws RecognitionException { + ExpressionContext _localctx = new ExpressionContext(_ctx, getState()); + enterRule(_localctx, 18, RULE_expression); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(167); + ((ExpressionContext) _localctx).basic_expression = basic_expression(); + ((ExpressionContext) _localctx).result = ((ExpressionContext) _localctx).basic_expression.result; + setState(173); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la == T__3) { + { + setState(169); + match(T__3); + setState(170); + ((ExpressionContext) _localctx).expression = expression(); + ((ExpressionContext) _localctx).result = factory.createSeqNode(_localctx.result, ((ExpressionContext) _localctx).expression.result); + } + } + + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Basic_expressionContext extends ParserRuleContext { + public LamaExpressionNode result; + public Binary_expressionContext binary_expression; + + public Binary_expressionContext binary_expression() { + return getRuleContext(Binary_expressionContext.class, 0); + } + + public Basic_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_basic_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterBasic_expression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitBasic_expression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitBasic_expression(this); + else return visitor.visitChildren(this); + } + } + + public final Basic_expressionContext basic_expression() throws RecognitionException { + Basic_expressionContext _localctx = new Basic_expressionContext(_ctx, getState()); + enterRule(_localctx, 20, RULE_basic_expression); + try { + enterOuterAlt(_localctx, 1); + { + setState(175); + ((Basic_expressionContext) _localctx).binary_expression = binary_expression(); + ((Basic_expressionContext) _localctx).result = ((Basic_expressionContext) _localctx).binary_expression.result; + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Binary_expressionContext extends ParserRuleContext { + public LamaExpressionNode result; + public Postfix_expressionContext postfix_expression; + public Any_infixContext any_infix; + + public List postfix_expression() { + return getRuleContexts(Postfix_expressionContext.class); + } + + public Postfix_expressionContext postfix_expression(int i) { + return getRuleContext(Postfix_expressionContext.class, i); + } + + public List any_infix() { + return getRuleContexts(Any_infixContext.class); + } + + public Any_infixContext any_infix(int i) { + return getRuleContext(Any_infixContext.class, i); + } + + public Binary_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_binary_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterBinary_expression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitBinary_expression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) + return ((LamaVisitor) visitor).visitBinary_expression(this); + else return visitor.visitChildren(this); + } + } + + public final Binary_expressionContext binary_expression() throws RecognitionException { + Binary_expressionContext _localctx = new Binary_expressionContext(_ctx, getState()); + enterRule(_localctx, 22, RULE_binary_expression); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(178); + ((Binary_expressionContext) _localctx).postfix_expression = postfix_expression(); + ((Binary_expressionContext) _localctx).result = ((Binary_expressionContext) _localctx).postfix_expression.result; + setState(186); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la == MINUS || _la == INFIX) { + { + { + setState(180); + ((Binary_expressionContext) _localctx).any_infix = any_infix(); + setState(181); + ((Binary_expressionContext) _localctx).postfix_expression = postfix_expression(); + ((Binary_expressionContext) _localctx).result = factory.createBinopNode(((Binary_expressionContext) _localctx).any_infix.result, _localctx.result, ((Binary_expressionContext) _localctx).postfix_expression.result); + } + } + setState(188); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Postfix_expressionContext extends ParserRuleContext { + public LamaExpressionNode result; + public Token MINUS; + public PrimaryContext primary; + public PostfixContext postfix; + + public PrimaryContext primary() { + return getRuleContext(PrimaryContext.class, 0); + } + + public TerminalNode MINUS() { + return getToken(LamaParser.MINUS, 0); + } + + public List postfix() { + return getRuleContexts(PostfixContext.class); + } + + public PostfixContext postfix(int i) { + return getRuleContext(PostfixContext.class, i); + } + + public Postfix_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_postfix_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterPostfix_expression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitPostfix_expression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) + return ((LamaVisitor) visitor).visitPostfix_expression(this); + else return visitor.visitChildren(this); + } + } + + public final Postfix_expressionContext postfix_expression() throws RecognitionException { + Postfix_expressionContext _localctx = new Postfix_expressionContext(_ctx, getState()); + enterRule(_localctx, 24, RULE_postfix_expression); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + boolean with_minus = false; + setState(192); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la == MINUS) { + { + setState(190); + ((Postfix_expressionContext) _localctx).MINUS = match(MINUS); + with_minus = true; + } + } + + setState(194); + ((Postfix_expressionContext) _localctx).primary = primary(); + ((Postfix_expressionContext) _localctx).result = ((Postfix_expressionContext) _localctx).primary.result; + setState(201); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la == T__6 || _la == T__10) { + { + { + setState(196); + ((Postfix_expressionContext) _localctx).postfix = postfix(); + + if (((Postfix_expressionContext) _localctx).postfix.access_index.isPresent()) { + ((Postfix_expressionContext) _localctx).result = factory.createElemValueNode(_localctx.result, ((Postfix_expressionContext) _localctx).postfix.access_index.get()); + // TODO: choose between elem and ref + } else { + ((Postfix_expressionContext) _localctx).result = factory.createCallNode(_localctx.result, ((Postfix_expressionContext) _localctx).postfix.args); + } + + } + } + setState(203); + _errHandler.sync(this); + _la = _input.LA(1); + } + + if (with_minus) { + ((Postfix_expressionContext) _localctx).result = factory.createBinopNode( + ((Postfix_expressionContext) _localctx).MINUS, + factory.createValueConstNode(((Postfix_expressionContext) _localctx).MINUS, 0), + _localctx.result); + } + + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class PostfixContext extends ParserRuleContext { + public List args; + public Optional access_index; + public ExpressionContext expression; + + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class, i); + } + + public PostfixContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_postfix; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterPostfix(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitPostfix(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitPostfix(this); + else return visitor.visitChildren(this); + } + } + + public final PostfixContext postfix() throws RecognitionException { + PostfixContext _localctx = new PostfixContext(_ctx, getState()); + enterRule(_localctx, 26, RULE_postfix); + int _la; + try { + setState(228); + _errHandler.sync(this); + switch (getInterpreter().adaptivePredict(_input, 15, _ctx)) { + case 1: + enterOuterAlt(_localctx, 1); + { + ((PostfixContext) _localctx).args = new ArrayList(); + ((PostfixContext) _localctx).access_index = Optional.empty(); + setState(207); + match(T__6); + setState(208); + ((PostfixContext) _localctx).expression = expression(); + _localctx.args.addLast(((PostfixContext) _localctx).expression.result); + setState(216); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la == T__2) { + { + { + setState(210); + match(T__2); + setState(211); + ((PostfixContext) _localctx).expression = expression(); + _localctx.args.addLast(((PostfixContext) _localctx).expression.result); + } + } + setState(218); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(219); + match(T__7); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(221); + match(T__6); + setState(222); + match(T__7); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(223); + match(T__10); + setState(224); + ((PostfixContext) _localctx).expression = expression(); + ((PostfixContext) _localctx).access_index = Optional.of(((PostfixContext) _localctx).expression.result); + setState(226); + match(T__11); + } + break; + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class PrimaryContext extends ParserRuleContext { + public LamaExpressionNode result; + public Token DECIMAL_LITERAL; + public Token STRING_LITERAL; + public Token CHAR_LITERAL; + public Token LIDENT; + public Token tok; + public Any_infixContext any_infix; + public Function_argumentsContext function_arguments; + public Function_bodyContext function_body; + public Scope_expressionContext scope_expression; + public List_expressionContext list_expression; + public Array_expressionContext array_expression; + public S_expressionContext s_expression; + public If_expressionContext if_expression; + public While_do_expressionContext while_do_expression; + public Do_while_expressionContext do_while_expression; + public For_expressionContext for_expression; + public Case_expressionContext case_expression; + + public TerminalNode DECIMAL_LITERAL() { + return getToken(LamaParser.DECIMAL_LITERAL, 0); + } + + public TerminalNode STRING_LITERAL() { + return getToken(LamaParser.STRING_LITERAL, 0); + } + + public TerminalNode CHAR_LITERAL() { + return getToken(LamaParser.CHAR_LITERAL, 0); + } + + public TerminalNode LIDENT() { + return getToken(LamaParser.LIDENT, 0); + } + + public Any_infixContext any_infix() { + return getRuleContext(Any_infixContext.class, 0); + } + + public Function_argumentsContext function_arguments() { + return getRuleContext(Function_argumentsContext.class, 0); + } + + public Function_bodyContext function_body() { + return getRuleContext(Function_bodyContext.class, 0); + } + + public Scope_expressionContext scope_expression() { + return getRuleContext(Scope_expressionContext.class, 0); + } + + public List_expressionContext list_expression() { + return getRuleContext(List_expressionContext.class, 0); + } + + public Array_expressionContext array_expression() { + return getRuleContext(Array_expressionContext.class, 0); + } + + public S_expressionContext s_expression() { + return getRuleContext(S_expressionContext.class, 0); + } + + public If_expressionContext if_expression() { + return getRuleContext(If_expressionContext.class, 0); + } + + public While_do_expressionContext while_do_expression() { + return getRuleContext(While_do_expressionContext.class, 0); + } + + public Do_while_expressionContext do_while_expression() { + return getRuleContext(Do_while_expressionContext.class, 0); + } + + public For_expressionContext for_expression() { + return getRuleContext(For_expressionContext.class, 0); + } + + public Case_expressionContext case_expression() { + return getRuleContext(Case_expressionContext.class, 0); + } + + public PrimaryContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_primary; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterPrimary(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitPrimary(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitPrimary(this); + else return visitor.visitChildren(this); + } + } + + public final PrimaryContext primary() throws RecognitionException { + PrimaryContext _localctx = new PrimaryContext(_ctx, getState()); + enterRule(_localctx, 28, RULE_primary); + try { + setState(286); + _errHandler.sync(this); + switch (_input.LA(1)) { + case DECIMAL_LITERAL: + enterOuterAlt(_localctx, 1); + { + setState(230); + ((PrimaryContext) _localctx).DECIMAL_LITERAL = match(DECIMAL_LITERAL); + ((PrimaryContext) _localctx).result = factory.createConstNode(((PrimaryContext) _localctx).DECIMAL_LITERAL); + } + break; + case STRING_LITERAL: + enterOuterAlt(_localctx, 2); + { + setState(232); + ((PrimaryContext) _localctx).STRING_LITERAL = match(STRING_LITERAL); + ((PrimaryContext) _localctx).result = factory.createStringNode(((PrimaryContext) _localctx).STRING_LITERAL); + } + break; + case CHAR_LITERAL: + enterOuterAlt(_localctx, 3); + { + setState(234); + ((PrimaryContext) _localctx).CHAR_LITERAL = match(CHAR_LITERAL); + ((PrimaryContext) _localctx).result = factory.createCharConstNode(((PrimaryContext) _localctx).CHAR_LITERAL); + } + break; + case LIDENT: + enterOuterAlt(_localctx, 4); + { + setState(236); + ((PrimaryContext) _localctx).LIDENT = match(LIDENT); + ((PrimaryContext) _localctx).result = factory.createValueNode(((PrimaryContext) _localctx).LIDENT); + } + break; + case T__12: + enterOuterAlt(_localctx, 5); + { + setState(238); + ((PrimaryContext) _localctx).tok = match(T__12); + ((PrimaryContext) _localctx).result = factory.createValueConstNode(((PrimaryContext) _localctx).tok, 1); + } + break; + case T__13: + enterOuterAlt(_localctx, 6); + { + setState(240); + ((PrimaryContext) _localctx).tok = match(T__13); + ((PrimaryContext) _localctx).result = factory.createValueConstNode(((PrimaryContext) _localctx).tok, 0); + } + break; + case T__14: + enterOuterAlt(_localctx, 7); + { + setState(242); + match(T__14); + setState(243); + ((PrimaryContext) _localctx).any_infix = any_infix(); + ((PrimaryContext) _localctx).result = factory.createValueNode(((PrimaryContext) _localctx).any_infix.result); + } + break; + case T__5: + enterOuterAlt(_localctx, 8); + { + setState(246); + ((PrimaryContext) _localctx).tok = match(T__5); + setState(247); + match(T__6); + + List args = new ArrayList(); + factory.enterScope(LamaNodeFactory.LexicalScope.Kind.INNER_CLOSURE); + + setState(249); + ((PrimaryContext) _localctx).function_arguments = function_arguments(); + args = ((PrimaryContext) _localctx).function_arguments.args; + factory.addFunctionArguments(args); + setState(251); + match(T__7); + setState(252); + ((PrimaryContext) _localctx).function_body = function_body(); + + ((PrimaryContext) _localctx).result = factory.createClosureNode(((PrimaryContext) _localctx).tok, ((PrimaryContext) _localctx).function_body.result, args.size()); + factory.exitScope(); // TODO: create exit node to create vars ?? + + } + break; + case T__15: + enterOuterAlt(_localctx, 9); + { + setState(255); + ((PrimaryContext) _localctx).tok = match(T__15); + ((PrimaryContext) _localctx).result = factory.createSkipNode(((PrimaryContext) _localctx).tok); + } + break; + case T__6: + enterOuterAlt(_localctx, 10); + { + setState(257); + match(T__6); + setState(258); + ((PrimaryContext) _localctx).scope_expression = scope_expression(true); + setState(259); + match(T__7); + ((PrimaryContext) _localctx).result = ((PrimaryContext) _localctx).scope_expression.result; + } + break; + case T__8: + enterOuterAlt(_localctx, 11); + { + setState(262); + ((PrimaryContext) _localctx).list_expression = list_expression(); + ((PrimaryContext) _localctx).result = ((PrimaryContext) _localctx).list_expression.result; + } + break; + case T__10: + enterOuterAlt(_localctx, 12); + { + setState(265); + ((PrimaryContext) _localctx).array_expression = array_expression(); + ((PrimaryContext) _localctx).result = ((PrimaryContext) _localctx).array_expression.result; + } + break; + case UIDENT: + enterOuterAlt(_localctx, 13); + { + setState(268); + ((PrimaryContext) _localctx).s_expression = s_expression(); + ((PrimaryContext) _localctx).result = ((PrimaryContext) _localctx).s_expression.result; + } + break; + case T__16: + enterOuterAlt(_localctx, 14); + { + setState(271); + ((PrimaryContext) _localctx).if_expression = if_expression(); + ((PrimaryContext) _localctx).result = ((PrimaryContext) _localctx).if_expression.result; + } + break; + case T__21: + enterOuterAlt(_localctx, 15); + { + setState(274); + ((PrimaryContext) _localctx).while_do_expression = while_do_expression(); + ((PrimaryContext) _localctx).result = ((PrimaryContext) _localctx).while_do_expression.result; + } + break; + case T__22: + enterOuterAlt(_localctx, 16); + { + setState(277); + ((PrimaryContext) _localctx).do_while_expression = do_while_expression(); + ((PrimaryContext) _localctx).result = ((PrimaryContext) _localctx).do_while_expression.result; + } + break; + case T__24: + enterOuterAlt(_localctx, 17); + { + setState(280); + ((PrimaryContext) _localctx).for_expression = for_expression(); + ((PrimaryContext) _localctx).result = ((PrimaryContext) _localctx).for_expression.result; + } + break; + case T__34: + enterOuterAlt(_localctx, 18); + { + setState(283); + ((PrimaryContext) _localctx).case_expression = case_expression(); + ((PrimaryContext) _localctx).result = ((PrimaryContext) _localctx).case_expression.result; + } + break; + default: + throw new NoViableAltException(this); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Array_expressionContext extends ParserRuleContext { + public LamaExpressionNode result; + public ExpressionContext expression; + + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class, i); + } + + public Array_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_array_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterArray_expression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitArray_expression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitArray_expression(this); + else return visitor.visitChildren(this); + } + } + + public final Array_expressionContext array_expression() throws RecognitionException { + Array_expressionContext _localctx = new Array_expressionContext(_ctx, getState()); + enterRule(_localctx, 30, RULE_array_expression); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + List elems = new ArrayList(); + setState(289); + match(T__10); + setState(301); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1099546033908416L) != 0)) { + { + setState(290); + ((Array_expressionContext) _localctx).expression = expression(); + elems.addLast(((Array_expressionContext) _localctx).expression.result); + setState(298); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la == T__2) { + { + { + setState(292); + match(T__2); + setState(293); + ((Array_expressionContext) _localctx).expression = expression(); + elems.addLast(((Array_expressionContext) _localctx).expression.result); + } + } + setState(300); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + + setState(303); + match(T__11); + ((Array_expressionContext) _localctx).result = factory.createArrayNode(elems); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class List_expressionContext extends ParserRuleContext { + public LamaExpressionNode result; + public ExpressionContext expression; + + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class, i); + } + + public List_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_list_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterList_expression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitList_expression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitList_expression(this); + else return visitor.visitChildren(this); + } + } + + public final List_expressionContext list_expression() throws RecognitionException { + List_expressionContext _localctx = new List_expressionContext(_ctx, getState()); + enterRule(_localctx, 32, RULE_list_expression); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + List elems = new ArrayList(); + setState(307); + match(T__8); + setState(319); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1099546033908416L) != 0)) { + { + setState(308); + ((List_expressionContext) _localctx).expression = expression(); + elems.addLast(((List_expressionContext) _localctx).expression.result); + setState(316); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la == T__2) { + { + { + setState(310); + match(T__2); + setState(311); + ((List_expressionContext) _localctx).expression = expression(); + elems.addLast(((List_expressionContext) _localctx).expression.result); + } + } + setState(318); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + + setState(321); + match(T__9); + ((List_expressionContext) _localctx).result = factory.createListSexpNode(elems); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class S_expressionContext extends ParserRuleContext { + public LamaExpressionNode result; + public Token UIDENT; + public ExpressionContext expression; + + public TerminalNode UIDENT() { + return getToken(LamaParser.UIDENT, 0); + } + + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class, i); + } + + public S_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_s_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterS_expression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitS_expression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitS_expression(this); + else return visitor.visitChildren(this); + } + } + + public final S_expressionContext s_expression() throws RecognitionException { + S_expressionContext _localctx = new S_expressionContext(_ctx, getState()); + enterRule(_localctx, 34, RULE_s_expression); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + List elems = new ArrayList(); + setState(325); + ((S_expressionContext) _localctx).UIDENT = match(UIDENT); + setState(341); + _errHandler.sync(this); + switch (getInterpreter().adaptivePredict(_input, 23, _ctx)) { + case 1: { + setState(326); + match(T__6); + setState(338); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1099546033908416L) != 0)) { + { + setState(327); + ((S_expressionContext) _localctx).expression = expression(); + elems.addLast(((S_expressionContext) _localctx).expression.result); + setState(335); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la == T__2) { + { + { + setState(329); + match(T__2); + setState(330); + ((S_expressionContext) _localctx).expression = expression(); + elems.addLast(((S_expressionContext) _localctx).expression.result); + } + } + setState(337); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + + setState(340); + match(T__7); + } + break; + } + ((S_expressionContext) _localctx).result = factory.createSexpNode(((S_expressionContext) _localctx).UIDENT, elems); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class If_expressionContext extends ParserRuleContext { + public LamaExpressionNode result; + public ExpressionContext expression; + public Scope_expressionContext scope_expression; + public Else_partContext else_part; + + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class, 0); + } + + public Scope_expressionContext scope_expression() { + return getRuleContext(Scope_expressionContext.class, 0); + } + + public Else_partContext else_part() { + return getRuleContext(Else_partContext.class, 0); + } + + public If_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_if_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterIf_expression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitIf_expression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitIf_expression(this); + else return visitor.visitChildren(this); + } + } + + public final If_expressionContext if_expression() throws RecognitionException { + If_expressionContext _localctx = new If_expressionContext(_ctx, getState()); + enterRule(_localctx, 36, RULE_if_expression); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + LamaExpressionNode do_else = null; + setState(346); + match(T__16); + setState(347); + ((If_expressionContext) _localctx).expression = expression(); + setState(348); + match(T__17); + setState(349); + ((If_expressionContext) _localctx).scope_expression = scope_expression(true); + setState(353); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la == T__19 || _la == T__20) { + { + setState(350); + ((If_expressionContext) _localctx).else_part = else_part(); + do_else = ((If_expressionContext) _localctx).else_part.result; + } + } + + setState(355); + match(T__18); + ((If_expressionContext) _localctx).result = factory.createIfNode(((If_expressionContext) _localctx).expression.result, ((If_expressionContext) _localctx).scope_expression.result, do_else); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Else_partContext extends ParserRuleContext { + public LamaExpressionNode result; + public ExpressionContext expression; + public Scope_expressionContext scope_expression; + public Else_partContext else_part; + + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class, 0); + } + + public Scope_expressionContext scope_expression() { + return getRuleContext(Scope_expressionContext.class, 0); + } + + public Else_partContext else_part() { + return getRuleContext(Else_partContext.class, 0); + } + + public Else_partContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_else_part; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterElse_part(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitElse_part(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitElse_part(this); + else return visitor.visitChildren(this); + } + } + + public final Else_partContext else_part() throws RecognitionException { + Else_partContext _localctx = new Else_partContext(_ctx, getState()); + enterRule(_localctx, 38, RULE_else_part); + int _la; + try { + setState(374); + _errHandler.sync(this); + switch (_input.LA(1)) { + case T__19: + enterOuterAlt(_localctx, 1); + { + setState(358); + match(T__19); + LamaExpressionNode do_else = null; + setState(360); + ((Else_partContext) _localctx).expression = expression(); + setState(361); + match(T__17); + setState(362); + ((Else_partContext) _localctx).scope_expression = scope_expression(true); + setState(366); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la == T__19 || _la == T__20) { + { + setState(363); + ((Else_partContext) _localctx).else_part = else_part(); + do_else = ((Else_partContext) _localctx).else_part.result; + } + } + + ((Else_partContext) _localctx).result = factory.createIfNode(((Else_partContext) _localctx).expression.result, ((Else_partContext) _localctx).scope_expression.result, do_else); + } + break; + case T__20: + enterOuterAlt(_localctx, 2); + { + setState(370); + match(T__20); + setState(371); + ((Else_partContext) _localctx).scope_expression = scope_expression(true); + ((Else_partContext) _localctx).result = ((Else_partContext) _localctx).scope_expression.result; + } + break; + default: + throw new NoViableAltException(this); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class While_do_expressionContext extends ParserRuleContext { + public LamaExpressionNode result; + public ExpressionContext expression; + public Scope_expressionContext scope_expression; + + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class, 0); + } + + public Scope_expressionContext scope_expression() { + return getRuleContext(Scope_expressionContext.class, 0); + } + + public While_do_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_while_do_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterWhile_do_expression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitWhile_do_expression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) + return ((LamaVisitor) visitor).visitWhile_do_expression(this); + else return visitor.visitChildren(this); + } + } + + public final While_do_expressionContext while_do_expression() throws RecognitionException { + While_do_expressionContext _localctx = new While_do_expressionContext(_ctx, getState()); + enterRule(_localctx, 40, RULE_while_do_expression); + try { + enterOuterAlt(_localctx, 1); + { + setState(376); + match(T__21); + setState(377); + ((While_do_expressionContext) _localctx).expression = expression(); + setState(378); + match(T__22); + setState(379); + ((While_do_expressionContext) _localctx).scope_expression = scope_expression(true); + setState(380); + match(T__23); + ((While_do_expressionContext) _localctx).result = factory.createWhileNode(((While_do_expressionContext) _localctx).expression.result, ((While_do_expressionContext) _localctx).scope_expression.result); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Do_while_expressionContext extends ParserRuleContext { + public LamaExpressionNode result; + public Scope_expressionContext scope_expression; + public ExpressionContext expression; + + public Scope_expressionContext scope_expression() { + return getRuleContext(Scope_expressionContext.class, 0); + } + + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class, 0); + } + + public Do_while_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_do_while_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterDo_while_expression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitDo_while_expression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) + return ((LamaVisitor) visitor).visitDo_while_expression(this); + else return visitor.visitChildren(this); + } + } + + public final Do_while_expressionContext do_while_expression() throws RecognitionException { + Do_while_expressionContext _localctx = new Do_while_expressionContext(_ctx, getState()); + enterRule(_localctx, 42, RULE_do_while_expression); + try { + enterOuterAlt(_localctx, 1); + { + setState(383); + match(T__22); + setState(384); + ((Do_while_expressionContext) _localctx).scope_expression = scope_expression(true); + setState(385); + match(T__21); + setState(386); + ((Do_while_expressionContext) _localctx).expression = expression(); + setState(387); + match(T__23); + ((Do_while_expressionContext) _localctx).result = factory.createDoWhileNode(((Do_while_expressionContext) _localctx).expression.result, ((Do_while_expressionContext) _localctx).scope_expression.result); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class For_expressionContext extends ParserRuleContext { + public LamaExpressionNode result; + public Scope_expressionContext init; + public ExpressionContext cond; + public ExpressionContext inc; + public Scope_expressionContext expr; + + public List scope_expression() { + return getRuleContexts(Scope_expressionContext.class); + } + + public Scope_expressionContext scope_expression(int i) { + return getRuleContext(Scope_expressionContext.class, i); + } + + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class, i); + } + + public For_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_for_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterFor_expression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitFor_expression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitFor_expression(this); + else return visitor.visitChildren(this); + } + } + + public final For_expressionContext for_expression() throws RecognitionException { + For_expressionContext _localctx = new For_expressionContext(_ctx, getState()); + enterRule(_localctx, 44, RULE_for_expression); + try { + enterOuterAlt(_localctx, 1); + { + setState(390); + match(T__24); + factory.enterScope(); + setState(392); + ((For_expressionContext) _localctx).init = scope_expression(false); + setState(393); + match(T__2); + setState(394); + ((For_expressionContext) _localctx).cond = expression(); + setState(395); + match(T__2); + setState(396); + ((For_expressionContext) _localctx).inc = expression(); + setState(397); + match(T__22); + setState(398); + ((For_expressionContext) _localctx).expr = scope_expression(true); + setState(399); + match(T__23); + + ((For_expressionContext) _localctx).result = factory.createSeqNode(((For_expressionContext) _localctx).init.result, factory.createWhileNode(((For_expressionContext) _localctx).cond.result, factory.createSeqNode(((For_expressionContext) _localctx).expr.result, ((For_expressionContext) _localctx).inc.result))); + factory.exitScope(); + + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class PatternContext extends ParserRuleContext { + public LamaPattern result; + public Cons_patternContext cons_pattern; + public Simple_patternContext simple_pattern; + + public Cons_patternContext cons_pattern() { + return getRuleContext(Cons_patternContext.class, 0); + } + + public Simple_patternContext simple_pattern() { + return getRuleContext(Simple_patternContext.class, 0); + } + + public PatternContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_pattern; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterPattern(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitPattern(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitPattern(this); + else return visitor.visitChildren(this); + } + } + + public final PatternContext pattern() throws RecognitionException { + PatternContext _localctx = new PatternContext(_ctx, getState()); + enterRule(_localctx, 46, RULE_pattern); + try { + setState(408); + _errHandler.sync(this); + switch (getInterpreter().adaptivePredict(_input, 27, _ctx)) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(402); + ((PatternContext) _localctx).cons_pattern = cons_pattern(); + ((PatternContext) _localctx).result = ((PatternContext) _localctx).cons_pattern.result; + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(405); + ((PatternContext) _localctx).simple_pattern = simple_pattern(); + ((PatternContext) _localctx).result = ((PatternContext) _localctx).simple_pattern.result; + } + break; + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Cons_patternContext extends ParserRuleContext { + public LamaPattern result; + public Simple_patternContext simple_pattern; + public PatternContext pattern; + + public Simple_patternContext simple_pattern() { + return getRuleContext(Simple_patternContext.class, 0); + } + + public PatternContext pattern() { + return getRuleContext(PatternContext.class, 0); + } + + public Cons_patternContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_cons_pattern; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterCons_pattern(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitCons_pattern(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitCons_pattern(this); + else return visitor.visitChildren(this); + } + } + + public final Cons_patternContext cons_pattern() throws RecognitionException { + Cons_patternContext _localctx = new Cons_patternContext(_ctx, getState()); + enterRule(_localctx, 48, RULE_cons_pattern); + try { + enterOuterAlt(_localctx, 1); + { + setState(410); + ((Cons_patternContext) _localctx).simple_pattern = simple_pattern(); + setState(411); + match(T__25); + setState(412); + ((Cons_patternContext) _localctx).pattern = pattern(); + ((Cons_patternContext) _localctx).result = factory.createSexpConsPattern(((Cons_patternContext) _localctx).simple_pattern.result, ((Cons_patternContext) _localctx).pattern.result); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Simple_patternContext extends ParserRuleContext { + public LamaPattern result; + public Wildcard_patternContext wildcard_pattern; + public S_expr_patternContext s_expr_pattern; + public Array_patternContext array_pattern; + public List_patternContext list_pattern; + public Token LIDENT; + public PatternContext pattern; + public Token DECIMAL_LITERAL; + public Token STRING_LITERAL; + public Token CHAR_LITERAL; + public Token tok; + + public Wildcard_patternContext wildcard_pattern() { + return getRuleContext(Wildcard_patternContext.class, 0); + } + + public S_expr_patternContext s_expr_pattern() { + return getRuleContext(S_expr_patternContext.class, 0); + } + + public Array_patternContext array_pattern() { + return getRuleContext(Array_patternContext.class, 0); + } + + public List_patternContext list_pattern() { + return getRuleContext(List_patternContext.class, 0); + } + + public TerminalNode LIDENT() { + return getToken(LamaParser.LIDENT, 0); + } + + public PatternContext pattern() { + return getRuleContext(PatternContext.class, 0); + } + + public TerminalNode DECIMAL_LITERAL() { + return getToken(LamaParser.DECIMAL_LITERAL, 0); + } + + public TerminalNode MINUS() { + return getToken(LamaParser.MINUS, 0); + } + + public TerminalNode STRING_LITERAL() { + return getToken(LamaParser.STRING_LITERAL, 0); + } + + public TerminalNode CHAR_LITERAL() { + return getToken(LamaParser.CHAR_LITERAL, 0); + } + + public Simple_patternContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_simple_pattern; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterSimple_pattern(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitSimple_pattern(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitSimple_pattern(this); + else return visitor.visitChildren(this); + } + } + + public final Simple_patternContext simple_pattern() throws RecognitionException { + Simple_patternContext _localctx = new Simple_patternContext(_ctx, getState()); + enterRule(_localctx, 50, RULE_simple_pattern); + int _la; + try { + setState(474); + _errHandler.sync(this); + switch (getInterpreter().adaptivePredict(_input, 30, _ctx)) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(415); + ((Simple_patternContext) _localctx).wildcard_pattern = wildcard_pattern(); + ((Simple_patternContext) _localctx).result = ((Simple_patternContext) _localctx).wildcard_pattern.result; + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(418); + ((Simple_patternContext) _localctx).s_expr_pattern = s_expr_pattern(); + ((Simple_patternContext) _localctx).result = ((Simple_patternContext) _localctx).s_expr_pattern.result; + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(421); + ((Simple_patternContext) _localctx).array_pattern = array_pattern(); + ((Simple_patternContext) _localctx).result = ((Simple_patternContext) _localctx).array_pattern.result; + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(424); + ((Simple_patternContext) _localctx).list_pattern = list_pattern(); + ((Simple_patternContext) _localctx).result = ((Simple_patternContext) _localctx).list_pattern.result; + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(427); + ((Simple_patternContext) _localctx).LIDENT = match(LIDENT); + LamaPattern pat = null; + setState(433); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la == T__26) { + { + setState(429); + match(T__26); + setState(430); + ((Simple_patternContext) _localctx).pattern = pattern(); + pat = ((Simple_patternContext) _localctx).pattern.result; + } + } + + ((Simple_patternContext) _localctx).result = factory.createNamedPattern(((Simple_patternContext) _localctx).LIDENT, Objects.requireNonNullElse(pat, factory.createWildcardPattern())); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + boolean is_negative = false; + setState(439); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la == MINUS) { + { + setState(437); + match(MINUS); + is_negative = true; + } + } + + setState(441); + ((Simple_patternContext) _localctx).DECIMAL_LITERAL = match(DECIMAL_LITERAL); + ((Simple_patternContext) _localctx).result = is_negative ? factory.createNegativeConstPattern(((Simple_patternContext) _localctx).DECIMAL_LITERAL) : factory.createConstPattern(((Simple_patternContext) _localctx).DECIMAL_LITERAL); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(443); + ((Simple_patternContext) _localctx).STRING_LITERAL = match(STRING_LITERAL); + ((Simple_patternContext) _localctx).result = factory.createStringPattern(((Simple_patternContext) _localctx).STRING_LITERAL); + } + break; + case 8: + enterOuterAlt(_localctx, 8); + { + setState(445); + ((Simple_patternContext) _localctx).CHAR_LITERAL = match(CHAR_LITERAL); + ((Simple_patternContext) _localctx).result = factory.createConstPattern(((Simple_patternContext) _localctx).CHAR_LITERAL); + } + break; + case 9: + enterOuterAlt(_localctx, 9); + { + setState(447); + ((Simple_patternContext) _localctx).tok = match(T__12); + ((Simple_patternContext) _localctx).result = factory.createValueConstPattern(((Simple_patternContext) _localctx).tok, 1); + } + break; + case 10: + enterOuterAlt(_localctx, 10); + { + setState(449); + ((Simple_patternContext) _localctx).tok = match(T__13); + ((Simple_patternContext) _localctx).result = factory.createValueConstPattern(((Simple_patternContext) _localctx).tok, 0); + } + break; + case 11: + enterOuterAlt(_localctx, 11); + { + setState(451); + match(T__27); + setState(452); + match(T__28); + ((Simple_patternContext) _localctx).result = factory.createBoxedPattern(); + } + break; + case 12: + enterOuterAlt(_localctx, 12); + { + setState(454); + match(T__27); + setState(455); + match(T__29); + ((Simple_patternContext) _localctx).result = factory.createUnBoxedPattern(); + } + break; + case 13: + enterOuterAlt(_localctx, 13); + { + setState(457); + match(T__27); + setState(458); + match(T__30); + ((Simple_patternContext) _localctx).result = factory.createStringTagPattern(); + } + break; + case 14: + enterOuterAlt(_localctx, 14); + { + setState(460); + match(T__27); + setState(461); + match(T__31); + ((Simple_patternContext) _localctx).result = factory.createArrayTagPattern(); + } + break; + case 15: + enterOuterAlt(_localctx, 15); + { + setState(463); + match(T__27); + setState(464); + match(T__32); + ((Simple_patternContext) _localctx).result = factory.createSexpTagPattern(); + } + break; + case 16: + enterOuterAlt(_localctx, 16); + { + setState(466); + match(T__27); + setState(467); + match(T__5); + ((Simple_patternContext) _localctx).result = factory.createClosureTagPattern(); + } + break; + case 17: + enterOuterAlt(_localctx, 17); + { + setState(469); + match(T__6); + setState(470); + ((Simple_patternContext) _localctx).pattern = pattern(); + setState(471); + match(T__7); + ((Simple_patternContext) _localctx).result = ((Simple_patternContext) _localctx).pattern.result; + } + break; + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Wildcard_patternContext extends ParserRuleContext { + public LamaPattern result; + + public Wildcard_patternContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_wildcard_pattern; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterWildcard_pattern(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitWildcard_pattern(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitWildcard_pattern(this); + else return visitor.visitChildren(this); + } + } + + public final Wildcard_patternContext wildcard_pattern() throws RecognitionException { + Wildcard_patternContext _localctx = new Wildcard_patternContext(_ctx, getState()); + enterRule(_localctx, 52, RULE_wildcard_pattern); + try { + enterOuterAlt(_localctx, 1); + { + setState(476); + match(T__33); + ((Wildcard_patternContext) _localctx).result = factory.createWildcardPattern(); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class S_expr_patternContext extends ParserRuleContext { + public LamaPattern result; + public Token UIDENT; + public PatternContext pattern; + + public TerminalNode UIDENT() { + return getToken(LamaParser.UIDENT, 0); + } + + public List pattern() { + return getRuleContexts(PatternContext.class); + } + + public PatternContext pattern(int i) { + return getRuleContext(PatternContext.class, i); + } + + public S_expr_patternContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_s_expr_pattern; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterS_expr_pattern(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitS_expr_pattern(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitS_expr_pattern(this); + else return visitor.visitChildren(this); + } + } + + public final S_expr_patternContext s_expr_pattern() throws RecognitionException { + S_expr_patternContext _localctx = new S_expr_patternContext(_ctx, getState()); + enterRule(_localctx, 54, RULE_s_expr_pattern); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + List elems = new ArrayList(); + setState(480); + ((S_expr_patternContext) _localctx).UIDENT = match(UIDENT); + setState(496); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la == T__6) { + { + setState(481); + match(T__6); + setState(493); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1099529076107904L) != 0)) { + { + setState(482); + ((S_expr_patternContext) _localctx).pattern = pattern(); + elems.addLast(((S_expr_patternContext) _localctx).pattern.result); + setState(490); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la == T__2) { + { + { + setState(484); + match(T__2); + setState(485); + ((S_expr_patternContext) _localctx).pattern = pattern(); + elems.addLast(((S_expr_patternContext) _localctx).pattern.result); + } + } + setState(492); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + + setState(495); + match(T__7); + } + } + + ((S_expr_patternContext) _localctx).result = factory.createSexpPattern(((S_expr_patternContext) _localctx).UIDENT, elems); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Array_patternContext extends ParserRuleContext { + public LamaPattern result; + public PatternContext pattern; + + public List pattern() { + return getRuleContexts(PatternContext.class); + } + + public PatternContext pattern(int i) { + return getRuleContext(PatternContext.class, i); + } + + public Array_patternContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_array_pattern; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterArray_pattern(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitArray_pattern(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitArray_pattern(this); + else return visitor.visitChildren(this); + } + } + + public final Array_patternContext array_pattern() throws RecognitionException { + Array_patternContext _localctx = new Array_patternContext(_ctx, getState()); + enterRule(_localctx, 56, RULE_array_pattern); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + List elems = new ArrayList(); + setState(501); + match(T__10); + setState(513); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1099529076107904L) != 0)) { + { + setState(502); + ((Array_patternContext) _localctx).pattern = pattern(); + elems.addLast(((Array_patternContext) _localctx).pattern.result); + setState(510); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la == T__2) { + { + { + setState(504); + match(T__2); + setState(505); + ((Array_patternContext) _localctx).pattern = pattern(); + elems.addLast(((Array_patternContext) _localctx).pattern.result); + } + } + setState(512); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + + setState(515); + match(T__11); + ((Array_patternContext) _localctx).result = factory.createArrayPattern(elems); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class List_patternContext extends ParserRuleContext { + public LamaPattern result; + public PatternContext pattern; + + public List pattern() { + return getRuleContexts(PatternContext.class); + } + + public PatternContext pattern(int i) { + return getRuleContext(PatternContext.class, i); + } + + public List_patternContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_list_pattern; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterList_pattern(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitList_pattern(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitList_pattern(this); + else return visitor.visitChildren(this); + } + } + + public final List_patternContext list_pattern() throws RecognitionException { + List_patternContext _localctx = new List_patternContext(_ctx, getState()); + enterRule(_localctx, 58, RULE_list_pattern); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + List elems = new ArrayList(); + setState(519); + match(T__8); + setState(531); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1099529076107904L) != 0)) { + { + setState(520); + ((List_patternContext) _localctx).pattern = pattern(); + elems.addLast(((List_patternContext) _localctx).pattern.result); + setState(528); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la == T__2) { + { + { + setState(522); + match(T__2); + setState(523); + ((List_patternContext) _localctx).pattern = pattern(); + elems.addLast(((List_patternContext) _localctx).pattern.result); + } + } + setState(530); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + + setState(533); + match(T__9); + ((List_patternContext) _localctx).result = factory.createListSexpPattern(elems); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Case_expressionContext extends ParserRuleContext { + public LamaExpressionNode result; + public ExpressionContext expression; + public Case_branchesContext case_branches; + + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class, 0); + } + + public Case_branchesContext case_branches() { + return getRuleContext(Case_branchesContext.class, 0); + } + + public Case_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_case_expression; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterCase_expression(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitCase_expression(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitCase_expression(this); + else return visitor.visitChildren(this); + } + } + + public final Case_expressionContext case_expression() throws RecognitionException { + Case_expressionContext _localctx = new Case_expressionContext(_ctx, getState()); + enterRule(_localctx, 60, RULE_case_expression); + try { + enterOuterAlt(_localctx, 1); + { + setState(536); + match(T__34); + setState(537); + ((Case_expressionContext) _localctx).expression = expression(); + setState(538); + match(T__35); + setState(539); + ((Case_expressionContext) _localctx).case_branches = case_branches(); + setState(540); + match(T__36); + ((Case_expressionContext) _localctx).result = factory.createCaseNode(((Case_expressionContext) _localctx).expression.result, ((Case_expressionContext) _localctx).case_branches.pats, ((Case_expressionContext) _localctx).case_branches.exprs); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Case_branchesContext extends ParserRuleContext { + public List pats; + public List exprs; + public Case_branchContext case_branch; + + public List case_branch() { + return getRuleContexts(Case_branchContext.class); + } + + public Case_branchContext case_branch(int i) { + return getRuleContext(Case_branchContext.class, i); + } + + public Case_branchesContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_case_branches; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterCase_branches(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitCase_branches(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitCase_branches(this); + else return visitor.visitChildren(this); + } + } + + public final Case_branchesContext case_branches() throws RecognitionException { + Case_branchesContext _localctx = new Case_branchesContext(_ctx, getState()); + enterRule(_localctx, 62, RULE_case_branches); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + ((Case_branchesContext) _localctx).pats = new ArrayList(); + ((Case_branchesContext) _localctx).exprs = new ArrayList(); + setState(544); + ((Case_branchesContext) _localctx).case_branch = case_branch(); + _localctx.pats.addLast(((Case_branchesContext) _localctx).case_branch.pat); + _localctx.exprs.addLast(((Case_branchesContext) _localctx).case_branch.expr); + setState(552); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la == T__37) { + { + { + setState(546); + match(T__37); + setState(547); + ((Case_branchesContext) _localctx).case_branch = case_branch(); + _localctx.pats.addLast(((Case_branchesContext) _localctx).case_branch.pat); + _localctx.exprs.addLast(((Case_branchesContext) _localctx).case_branch.expr); + } + } + setState(554); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Case_branchContext extends ParserRuleContext { + public LamaPattern pat; + public LamaExpressionNode expr; + public PatternContext pattern; + public Scope_expressionContext scope_expression; + + public PatternContext pattern() { + return getRuleContext(PatternContext.class, 0); + } + + public Scope_expressionContext scope_expression() { + return getRuleContext(Scope_expressionContext.class, 0); + } + + public Case_branchContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_case_branch; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterCase_branch(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitCase_branch(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitCase_branch(this); + else return visitor.visitChildren(this); + } + } + + public final Case_branchContext case_branch() throws RecognitionException { + Case_branchContext _localctx = new Case_branchContext(_ctx, getState()); + enterRule(_localctx, 64, RULE_case_branch); + try { + enterOuterAlt(_localctx, 1); + { + factory.enterScope(); + setState(556); + ((Case_branchContext) _localctx).pattern = pattern(); + ((Case_branchContext) _localctx).pat = ((Case_branchContext) _localctx).pattern.result; + setState(558); + match(T__38); + setState(559); + ((Case_branchContext) _localctx).scope_expression = scope_expression(false); + ((Case_branchContext) _localctx).expr = ((Case_branchContext) _localctx).scope_expression.result; + factory.exitScope(); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Any_infixContext extends ParserRuleContext { + public Token result; + public Token INFIX; + public Token MINUS; + + public TerminalNode INFIX() { + return getToken(LamaParser.INFIX, 0); + } + + public TerminalNode MINUS() { + return getToken(LamaParser.MINUS, 0); + } + + public Any_infixContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + + @Override + public int getRuleIndex() { + return RULE_any_infix; + } + + @Override + public void enterRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).enterAny_infix(this); + } + + @Override + public void exitRule(ParseTreeListener listener) { + if (listener instanceof LamaListener) ((LamaListener) listener).exitAny_infix(this); + } + + @Override + public T accept(ParseTreeVisitor visitor) { + if (visitor instanceof LamaVisitor) return ((LamaVisitor) visitor).visitAny_infix(this); + else return visitor.visitChildren(this); + } + } + + public final Any_infixContext any_infix() throws RecognitionException { + Any_infixContext _localctx = new Any_infixContext(_ctx, getState()); + enterRule(_localctx, 66, RULE_any_infix); + try { + setState(567); + _errHandler.sync(this); + switch (_input.LA(1)) { + case INFIX: + enterOuterAlt(_localctx, 1); + { + setState(563); + ((Any_infixContext) _localctx).INFIX = match(INFIX); + ((Any_infixContext) _localctx).result = ((Any_infixContext) _localctx).INFIX; + } + break; + case MINUS: + enterOuterAlt(_localctx, 2); + { + setState(565); + ((Any_infixContext) _localctx).MINUS = match(MINUS); + ((Any_infixContext) _localctx).result = ((Any_infixContext) _localctx).MINUS; + } + break; + default: + throw new NoViableAltException(this); + } + } catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } finally { + exitRule(); + } + return _localctx; + } + + public static final String _serializedATN = + "\u0004\u00012\u023a\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002" + + "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002" + + "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002" + + "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002" + + "\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002\u000f\u0007\u000f" + + "\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002\u0012\u0007\u0012" + + "\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0002\u0015\u0007\u0015" + + "\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017\u0002\u0018\u0007\u0018" + + "\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a\u0002\u001b\u0007\u001b" + + "\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d\u0002\u001e\u0007\u001e" + + "\u0002\u001f\u0007\u001f\u0002 \u0007 \u0002!\u0007!\u0001\u0000\u0001" + + "\u0000\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0001" + + "\u0001\u0001\u0001\u0001\u0001\u0005\u0001O\b\u0001\n\u0001\f\u0001R\t" + + "\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0003\u0001W\b\u0001\u0001" + + "\u0001\u0001\u0001\u0001\u0001\u0003\u0001\\\b\u0001\u0001\u0001\u0001" + + "\u0001\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001" + + "\u0002\u0003\u0002f\b\u0002\u0001\u0003\u0001\u0003\u0001\u0003\u0001" + + "\u0003\u0003\u0003l\b\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001" + + "\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0005" + + "\u0004w\b\u0004\n\u0004\f\u0004z\t\u0004\u0001\u0004\u0001\u0004\u0001" + + "\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001" + + "\u0005\u0003\u0005\u0085\b\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0003" + + "\u0006\u008a\b\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001" + + "\u0006\u0001\u0006\u0003\u0006\u0092\b\u0006\u0001\u0006\u0001\u0006\u0001" + + "\u0006\u0001\u0006\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001" + + "\u0007\u0001\u0007\u0005\u0007\u009e\b\u0007\n\u0007\f\u0007\u00a1\t\u0007" + + "\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\t\u0001\t\u0001\t\u0001" + + "\t\u0001\t\u0001\t\u0003\t\u00ae\b\t\u0001\n\u0001\n\u0001\n\u0001\u000b" + + "\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0005\u000b" + + "\u00b9\b\u000b\n\u000b\f\u000b\u00bc\t\u000b\u0001\f\u0001\f\u0001\f\u0003" + + "\f\u00c1\b\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001\f\u0005\f\u00c8\b\f" + + "\n\f\f\f\u00cb\t\f\u0001\f\u0001\f\u0001\r\u0001\r\u0001\r\u0001\r\u0001" + + "\r\u0001\r\u0001\r\u0001\r\u0005\r\u00d7\b\r\n\r\f\r\u00da\t\r\u0001\r" + + "\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0003" + + "\r\u00e5\b\r\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e" + + "\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e" + + "\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e" + + "\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e" + + "\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e" + + "\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e" + + "\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e" + + "\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e" + + "\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e" + + "\u0001\u000e\u0001\u000e\u0001\u000e\u0003\u000e\u011f\b\u000e\u0001\u000f" + + "\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f" + + "\u0001\u000f\u0005\u000f\u0129\b\u000f\n\u000f\f\u000f\u012c\t\u000f\u0003" + + "\u000f\u012e\b\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u0010\u0001" + + "\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001" + + "\u0010\u0005\u0010\u013b\b\u0010\n\u0010\f\u0010\u013e\t\u0010\u0003\u0010" + + "\u0140\b\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0011\u0001\u0011" + + "\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011" + + "\u0001\u0011\u0005\u0011\u014e\b\u0011\n\u0011\f\u0011\u0151\t\u0011\u0003" + + "\u0011\u0153\b\u0011\u0001\u0011\u0003\u0011\u0156\b\u0011\u0001\u0011" + + "\u0001\u0011\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012" + + "\u0001\u0012\u0001\u0012\u0001\u0012\u0003\u0012\u0162\b\u0012\u0001\u0012" + + "\u0001\u0012\u0001\u0012\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013" + + "\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0003\u0013\u016f\b\u0013" + + "\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013" + + "\u0003\u0013\u0177\b\u0013\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014" + + "\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0015\u0001\u0015\u0001\u0015" + + "\u0001\u0015\u0001\u0015\u0001\u0015\u0001\u0015\u0001\u0016\u0001\u0016" + + "\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016" + + "\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0017\u0001\u0017" + + "\u0001\u0017\u0001\u0017\u0001\u0017\u0001\u0017\u0003\u0017\u0199\b\u0017" + + "\u0001\u0018\u0001\u0018\u0001\u0018\u0001\u0018\u0001\u0018\u0001\u0019" + + "\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019" + + "\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019" + + "\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0003\u0019" + + "\u01b2\b\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0003\u0019" + + "\u01b8\b\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019" + + "\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019" + + "\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019" + + "\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019" + + "\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019" + + "\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0003\u0019\u01db\b\u0019" + + "\u0001\u001a\u0001\u001a\u0001\u001a\u0001\u001b\u0001\u001b\u0001\u001b" + + "\u0001\u001b\u0001\u001b\u0001\u001b\u0001\u001b\u0001\u001b\u0001\u001b" + + "\u0005\u001b\u01e9\b\u001b\n\u001b\f\u001b\u01ec\t\u001b\u0003\u001b\u01ee" + + "\b\u001b\u0001\u001b\u0003\u001b\u01f1\b\u001b\u0001\u001b\u0001\u001b" + + "\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001c" + + "\u0001\u001c\u0001\u001c\u0005\u001c\u01fd\b\u001c\n\u001c\f\u001c\u0200" + + "\t\u001c\u0003\u001c\u0202\b\u001c\u0001\u001c\u0001\u001c\u0001\u001c" + + "\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d" + + "\u0001\u001d\u0001\u001d\u0005\u001d\u020f\b\u001d\n\u001d\f\u001d\u0212" + + "\t\u001d\u0003\u001d\u0214\b\u001d\u0001\u001d\u0001\u001d\u0001\u001d" + + "\u0001\u001e\u0001\u001e\u0001\u001e\u0001\u001e\u0001\u001e\u0001\u001e" + + "\u0001\u001e\u0001\u001f\u0001\u001f\u0001\u001f\u0001\u001f\u0001\u001f" + + "\u0001\u001f\u0001\u001f\u0005\u001f\u0227\b\u001f\n\u001f\f\u001f\u022a" + + "\t\u001f\u0001 \u0001 \u0001 \u0001 \u0001 \u0001 \u0001 \u0001 \u0001" + + "!\u0001!\u0001!\u0001!\u0003!\u0238\b!\u0001!\u0000\u0000\"\u0000\u0002" + + "\u0004\u0006\b\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u001c\u001e" + + " \"$&(*,.02468:<>@B\u0000\u0000\u025f\u0000D\u0001\u0000\u0000\u0000\u0002" + + "H\u0001\u0000\u0000\u0000\u0004e\u0001\u0000\u0000\u0000\u0006g\u0001" + + "\u0000\u0000\u0000\bp\u0001\u0000\u0000\u0000\n}\u0001\u0000\u0000\u0000" + + "\f\u0086\u0001\u0000\u0000\u0000\u000e\u0097\u0001\u0000\u0000\u0000\u0010" + + "\u00a2\u0001\u0000\u0000\u0000\u0012\u00a7\u0001\u0000\u0000\u0000\u0014" + + "\u00af\u0001\u0000\u0000\u0000\u0016\u00b2\u0001\u0000\u0000\u0000\u0018" + + "\u00bd\u0001\u0000\u0000\u0000\u001a\u00e4\u0001\u0000\u0000\u0000\u001c" + + "\u011e\u0001\u0000\u0000\u0000\u001e\u0120\u0001\u0000\u0000\u0000 \u0132" + + "\u0001\u0000\u0000\u0000\"\u0144\u0001\u0000\u0000\u0000$\u0159\u0001" + + "\u0000\u0000\u0000&\u0176\u0001\u0000\u0000\u0000(\u0178\u0001\u0000\u0000" + + "\u0000*\u017f\u0001\u0000\u0000\u0000,\u0186\u0001\u0000\u0000\u0000." + + "\u0198\u0001\u0000\u0000\u00000\u019a\u0001\u0000\u0000\u00002\u01da\u0001" + + "\u0000\u0000\u00004\u01dc\u0001\u0000\u0000\u00006\u01df\u0001\u0000\u0000" + + "\u00008\u01f4\u0001\u0000\u0000\u0000:\u0206\u0001\u0000\u0000\u0000<" + + "\u0218\u0001\u0000\u0000\u0000>\u021f\u0001\u0000\u0000\u0000@\u022b\u0001" + + "\u0000\u0000\u0000B\u0237\u0001\u0000\u0000\u0000DE\u0003\u0002\u0001" + + "\u0000EF\u0006\u0000\uffff\uffff\u0000FG\u0005\u0000\u0000\u0001G\u0001" + + "\u0001\u0000\u0000\u0000H[\u0006\u0001\uffff\uffff\u0000IJ\u0003\u0004" + + "\u0002\u0000JP\u0006\u0001\uffff\uffff\u0000KL\u0003\u0004\u0002\u0000" + + "LM\u0006\u0001\uffff\uffff\u0000MO\u0001\u0000\u0000\u0000NK\u0001\u0000" + + "\u0000\u0000OR\u0001\u0000\u0000\u0000PN\u0001\u0000\u0000\u0000PQ\u0001" + + "\u0000\u0000\u0000QV\u0001\u0000\u0000\u0000RP\u0001\u0000\u0000\u0000" + + "ST\u0003\u0012\t\u0000TU\u0006\u0001\uffff\uffff\u0000UW\u0001\u0000\u0000" + + "\u0000VS\u0001\u0000\u0000\u0000VW\u0001\u0000\u0000\u0000W\\\u0001\u0000" + + "\u0000\u0000XY\u0003\u0012\t\u0000YZ\u0006\u0001\uffff\uffff\u0000Z\\" + + "\u0001\u0000\u0000\u0000[I\u0001\u0000\u0000\u0000[X\u0001\u0000\u0000" + + "\u0000\\]\u0001\u0000\u0000\u0000]^\u0006\u0001\uffff\uffff\u0000^\u0003" + + "\u0001\u0000\u0000\u0000_`\u0003\u0006\u0003\u0000`a\u0006\u0002\uffff" + + "\uffff\u0000af\u0001\u0000\u0000\u0000bc\u0003\f\u0006\u0000cd\u0006\u0002" + + "\uffff\uffff\u0000df\u0001\u0000\u0000\u0000e_\u0001\u0000\u0000\u0000" + + "eb\u0001\u0000\u0000\u0000f\u0005\u0001\u0000\u0000\u0000gk\u0006\u0003" + + "\uffff\uffff\u0000hl\u0005\u0001\u0000\u0000ij\u0005\u0002\u0000\u0000" + + "jl\u0006\u0003\uffff\uffff\u0000kh\u0001\u0000\u0000\u0000ki\u0001\u0000" + + "\u0000\u0000lm\u0001\u0000\u0000\u0000mn\u0003\b\u0004\u0000no\u0006\u0003" + + "\uffff\uffff\u0000o\u0007\u0001\u0000\u0000\u0000pq\u0003\n\u0005\u0000" + + "qx\u0006\u0004\uffff\uffff\u0000rs\u0005\u0003\u0000\u0000st\u0003\n\u0005" + + "\u0000tu\u0006\u0004\uffff\uffff\u0000uw\u0001\u0000\u0000\u0000vr\u0001" + + "\u0000\u0000\u0000wz\u0001\u0000\u0000\u0000xv\u0001\u0000\u0000\u0000" + + "xy\u0001\u0000\u0000\u0000y{\u0001\u0000\u0000\u0000zx\u0001\u0000\u0000" + + "\u0000{|\u0005\u0004\u0000\u0000|\t\u0001\u0000\u0000\u0000}~\u0006\u0005" + + "\uffff\uffff\u0000~\u007f\u0005.\u0000\u0000\u007f\u0084\u0006\u0005\uffff" + + "\uffff\u0000\u0080\u0081\u0005\u0005\u0000\u0000\u0081\u0082\u0003\u0014" + + "\n\u0000\u0082\u0083\u0006\u0005\uffff\uffff\u0000\u0083\u0085\u0001\u0000" + + "\u0000\u0000\u0084\u0080\u0001\u0000\u0000\u0000\u0084\u0085\u0001\u0000" + + "\u0000\u0000\u0085\u000b\u0001\u0000\u0000\u0000\u0086\u0089\u0006\u0006" + + "\uffff\uffff\u0000\u0087\u0088\u0005\u0002\u0000\u0000\u0088\u008a\u0006" + + "\u0006\uffff\uffff\u0000\u0089\u0087\u0001\u0000\u0000\u0000\u0089\u008a" + + "\u0001\u0000\u0000\u0000\u008a\u008b\u0001\u0000\u0000\u0000\u008b\u008c" + + "\u0005\u0006\u0000\u0000\u008c\u008d\u0005.\u0000\u0000\u008d\u0091\u0005" + + "\u0007\u0000\u0000\u008e\u008f\u0003\u000e\u0007\u0000\u008f\u0090\u0006" + + "\u0006\uffff\uffff\u0000\u0090\u0092\u0001\u0000\u0000\u0000\u0091\u008e" + + "\u0001\u0000\u0000\u0000\u0091\u0092\u0001\u0000\u0000\u0000\u0092\u0093" + + "\u0001\u0000\u0000\u0000\u0093\u0094\u0005\b\u0000\u0000\u0094\u0095\u0003" + + "\u0010\b\u0000\u0095\u0096\u0006\u0006\uffff\uffff\u0000\u0096\r\u0001" + + "\u0000\u0000\u0000\u0097\u0098\u0006\u0007\uffff\uffff\u0000\u0098\u0099" + + "\u0005.\u0000\u0000\u0099\u009f\u0006\u0007\uffff\uffff\u0000\u009a\u009b" + + "\u0005\u0003\u0000\u0000\u009b\u009c\u0005.\u0000\u0000\u009c\u009e\u0006" + + "\u0007\uffff\uffff\u0000\u009d\u009a\u0001\u0000\u0000\u0000\u009e\u00a1" + + "\u0001\u0000\u0000\u0000\u009f\u009d\u0001\u0000\u0000\u0000\u009f\u00a0" + + "\u0001\u0000\u0000\u0000\u00a0\u000f\u0001\u0000\u0000\u0000\u00a1\u009f" + + "\u0001\u0000\u0000\u0000\u00a2\u00a3\u0005\t\u0000\u0000\u00a3\u00a4\u0003" + + "\u0002\u0001\u0000\u00a4\u00a5\u0006\b\uffff\uffff\u0000\u00a5\u00a6\u0005" + + "\n\u0000\u0000\u00a6\u0011\u0001\u0000\u0000\u0000\u00a7\u00a8\u0003\u0014" + + "\n\u0000\u00a8\u00ad\u0006\t\uffff\uffff\u0000\u00a9\u00aa\u0005\u0004" + + "\u0000\u0000\u00aa\u00ab\u0003\u0012\t\u0000\u00ab\u00ac\u0006\t\uffff" + + "\uffff\u0000\u00ac\u00ae\u0001\u0000\u0000\u0000\u00ad\u00a9\u0001\u0000" + + "\u0000\u0000\u00ad\u00ae\u0001\u0000\u0000\u0000\u00ae\u0013\u0001\u0000" + + "\u0000\u0000\u00af\u00b0\u0003\u0016\u000b\u0000\u00b0\u00b1\u0006\n\uffff" + + "\uffff\u0000\u00b1\u0015\u0001\u0000\u0000\u0000\u00b2\u00b3\u0003\u0018" + + "\f\u0000\u00b3\u00ba\u0006\u000b\uffff\uffff\u0000\u00b4\u00b5\u0003B" + + "!\u0000\u00b5\u00b6\u0003\u0018\f\u0000\u00b6\u00b7\u0006\u000b\uffff" + + "\uffff\u0000\u00b7\u00b9\u0001\u0000\u0000\u0000\u00b8\u00b4\u0001\u0000" + + "\u0000\u0000\u00b9\u00bc\u0001\u0000\u0000\u0000\u00ba\u00b8\u0001\u0000" + + "\u0000\u0000\u00ba\u00bb\u0001\u0000\u0000\u0000\u00bb\u0017\u0001\u0000" + + "\u0000\u0000\u00bc\u00ba\u0001\u0000\u0000\u0000\u00bd\u00c0\u0006\f\uffff" + + "\uffff\u0000\u00be\u00bf\u0005+\u0000\u0000\u00bf\u00c1\u0006\f\uffff" + + "\uffff\u0000\u00c0\u00be\u0001\u0000\u0000\u0000\u00c0\u00c1\u0001\u0000" + + "\u0000\u0000\u00c1\u00c2\u0001\u0000\u0000\u0000\u00c2\u00c3\u0003\u001c" + + "\u000e\u0000\u00c3\u00c9\u0006\f\uffff\uffff\u0000\u00c4\u00c5\u0003\u001a" + + "\r\u0000\u00c5\u00c6\u0006\f\uffff\uffff\u0000\u00c6\u00c8\u0001\u0000" + + "\u0000\u0000\u00c7\u00c4\u0001\u0000\u0000\u0000\u00c8\u00cb\u0001\u0000" + + "\u0000\u0000\u00c9\u00c7\u0001\u0000\u0000\u0000\u00c9\u00ca\u0001\u0000" + + "\u0000\u0000\u00ca\u00cc\u0001\u0000\u0000\u0000\u00cb\u00c9\u0001\u0000" + + "\u0000\u0000\u00cc\u00cd\u0006\f\uffff\uffff\u0000\u00cd\u0019\u0001\u0000" + + "\u0000\u0000\u00ce\u00cf\u0006\r\uffff\uffff\u0000\u00cf\u00d0\u0005\u0007" + + "\u0000\u0000\u00d0\u00d1\u0003\u0012\t\u0000\u00d1\u00d8\u0006\r\uffff" + + "\uffff\u0000\u00d2\u00d3\u0005\u0003\u0000\u0000\u00d3\u00d4\u0003\u0012" + + "\t\u0000\u00d4\u00d5\u0006\r\uffff\uffff\u0000\u00d5\u00d7\u0001\u0000" + + "\u0000\u0000\u00d6\u00d2\u0001\u0000\u0000\u0000\u00d7\u00da\u0001\u0000" + + "\u0000\u0000\u00d8\u00d6\u0001\u0000\u0000\u0000\u00d8\u00d9\u0001\u0000" + + "\u0000\u0000\u00d9\u00db\u0001\u0000\u0000\u0000\u00da\u00d8\u0001\u0000" + + "\u0000\u0000\u00db\u00dc\u0005\b\u0000\u0000\u00dc\u00e5\u0001\u0000\u0000" + + "\u0000\u00dd\u00de\u0005\u0007\u0000\u0000\u00de\u00e5\u0005\b\u0000\u0000" + + "\u00df\u00e0\u0005\u000b\u0000\u0000\u00e0\u00e1\u0003\u0012\t\u0000\u00e1" + + "\u00e2\u0006\r\uffff\uffff\u0000\u00e2\u00e3\u0005\f\u0000\u0000\u00e3" + + "\u00e5\u0001\u0000\u0000\u0000\u00e4\u00ce\u0001\u0000\u0000\u0000\u00e4" + + "\u00dd\u0001\u0000\u0000\u0000\u00e4\u00df\u0001\u0000\u0000\u0000\u00e5" + + "\u001b\u0001\u0000\u0000\u0000\u00e6\u00e7\u00051\u0000\u0000\u00e7\u011f" + + "\u0006\u000e\uffff\uffff\u0000\u00e8\u00e9\u00050\u0000\u0000\u00e9\u011f" + + "\u0006\u000e\uffff\uffff\u0000\u00ea\u00eb\u0005/\u0000\u0000\u00eb\u011f" + + "\u0006\u000e\uffff\uffff\u0000\u00ec\u00ed\u0005.\u0000\u0000\u00ed\u011f" + + "\u0006\u000e\uffff\uffff\u0000\u00ee\u00ef\u0005\r\u0000\u0000\u00ef\u011f" + + "\u0006\u000e\uffff\uffff\u0000\u00f0\u00f1\u0005\u000e\u0000\u0000\u00f1" + + "\u011f\u0006\u000e\uffff\uffff\u0000\u00f2\u00f3\u0005\u000f\u0000\u0000" + + "\u00f3\u00f4\u0003B!\u0000\u00f4\u00f5\u0006\u000e\uffff\uffff\u0000\u00f5" + + "\u011f\u0001\u0000\u0000\u0000\u00f6\u00f7\u0005\u0006\u0000\u0000\u00f7" + + "\u00f8\u0005\u0007\u0000\u0000\u00f8\u00f9\u0006\u000e\uffff\uffff\u0000" + + "\u00f9\u00fa\u0003\u000e\u0007\u0000\u00fa\u00fb\u0006\u000e\uffff\uffff" + + "\u0000\u00fb\u00fc\u0005\b\u0000\u0000\u00fc\u00fd\u0003\u0010\b\u0000" + + "\u00fd\u00fe\u0006\u000e\uffff\uffff\u0000\u00fe\u011f\u0001\u0000\u0000" + + "\u0000\u00ff\u0100\u0005\u0010\u0000\u0000\u0100\u011f\u0006\u000e\uffff" + + "\uffff\u0000\u0101\u0102\u0005\u0007\u0000\u0000\u0102\u0103\u0003\u0002" + + "\u0001\u0000\u0103\u0104\u0005\b\u0000\u0000\u0104\u0105\u0006\u000e\uffff" + + "\uffff\u0000\u0105\u011f\u0001\u0000\u0000\u0000\u0106\u0107\u0003 \u0010" + + "\u0000\u0107\u0108\u0006\u000e\uffff\uffff\u0000\u0108\u011f\u0001\u0000" + + "\u0000\u0000\u0109\u010a\u0003\u001e\u000f\u0000\u010a\u010b\u0006\u000e" + + "\uffff\uffff\u0000\u010b\u011f\u0001\u0000\u0000\u0000\u010c\u010d\u0003" + + "\"\u0011\u0000\u010d\u010e\u0006\u000e\uffff\uffff\u0000\u010e\u011f\u0001" + + "\u0000\u0000\u0000\u010f\u0110\u0003$\u0012\u0000\u0110\u0111\u0006\u000e" + + "\uffff\uffff\u0000\u0111\u011f\u0001\u0000\u0000\u0000\u0112\u0113\u0003" + + "(\u0014\u0000\u0113\u0114\u0006\u000e\uffff\uffff\u0000\u0114\u011f\u0001" + + "\u0000\u0000\u0000\u0115\u0116\u0003*\u0015\u0000\u0116\u0117\u0006\u000e" + + "\uffff\uffff\u0000\u0117\u011f\u0001\u0000\u0000\u0000\u0118\u0119\u0003" + + ",\u0016\u0000\u0119\u011a\u0006\u000e\uffff\uffff\u0000\u011a\u011f\u0001" + + "\u0000\u0000\u0000\u011b\u011c\u0003<\u001e\u0000\u011c\u011d\u0006\u000e" + + "\uffff\uffff\u0000\u011d\u011f\u0001\u0000\u0000\u0000\u011e\u00e6\u0001" + + "\u0000\u0000\u0000\u011e\u00e8\u0001\u0000\u0000\u0000\u011e\u00ea\u0001" + + "\u0000\u0000\u0000\u011e\u00ec\u0001\u0000\u0000\u0000\u011e\u00ee\u0001" + + "\u0000\u0000\u0000\u011e\u00f0\u0001\u0000\u0000\u0000\u011e\u00f2\u0001" + + "\u0000\u0000\u0000\u011e\u00f6\u0001\u0000\u0000\u0000\u011e\u00ff\u0001" + + "\u0000\u0000\u0000\u011e\u0101\u0001\u0000\u0000\u0000\u011e\u0106\u0001" + + "\u0000\u0000\u0000\u011e\u0109\u0001\u0000\u0000\u0000\u011e\u010c\u0001" + + "\u0000\u0000\u0000\u011e\u010f\u0001\u0000\u0000\u0000\u011e\u0112\u0001" + + "\u0000\u0000\u0000\u011e\u0115\u0001\u0000\u0000\u0000\u011e\u0118\u0001" + + "\u0000\u0000\u0000\u011e\u011b\u0001\u0000\u0000\u0000\u011f\u001d\u0001" + + "\u0000\u0000\u0000\u0120\u0121\u0006\u000f\uffff\uffff\u0000\u0121\u012d" + + "\u0005\u000b\u0000\u0000\u0122\u0123\u0003\u0012\t\u0000\u0123\u012a\u0006" + + "\u000f\uffff\uffff\u0000\u0124\u0125\u0005\u0003\u0000\u0000\u0125\u0126" + + "\u0003\u0012\t\u0000\u0126\u0127\u0006\u000f\uffff\uffff\u0000\u0127\u0129" + + "\u0001\u0000\u0000\u0000\u0128\u0124\u0001\u0000\u0000\u0000\u0129\u012c" + + "\u0001\u0000\u0000\u0000\u012a\u0128\u0001\u0000\u0000\u0000\u012a\u012b" + + "\u0001\u0000\u0000\u0000\u012b\u012e\u0001\u0000\u0000\u0000\u012c\u012a" + + "\u0001\u0000\u0000\u0000\u012d\u0122\u0001\u0000\u0000\u0000\u012d\u012e" + + "\u0001\u0000\u0000\u0000\u012e\u012f\u0001\u0000\u0000\u0000\u012f\u0130" + + "\u0005\f\u0000\u0000\u0130\u0131\u0006\u000f\uffff\uffff\u0000\u0131\u001f" + + "\u0001\u0000\u0000\u0000\u0132\u0133\u0006\u0010\uffff\uffff\u0000\u0133" + + "\u013f\u0005\t\u0000\u0000\u0134\u0135\u0003\u0012\t\u0000\u0135\u013c" + + "\u0006\u0010\uffff\uffff\u0000\u0136\u0137\u0005\u0003\u0000\u0000\u0137" + + "\u0138\u0003\u0012\t\u0000\u0138\u0139\u0006\u0010\uffff\uffff\u0000\u0139" + + "\u013b\u0001\u0000\u0000\u0000\u013a\u0136\u0001\u0000\u0000\u0000\u013b" + + "\u013e\u0001\u0000\u0000\u0000\u013c\u013a\u0001\u0000\u0000\u0000\u013c" + + "\u013d\u0001\u0000\u0000\u0000\u013d\u0140\u0001\u0000\u0000\u0000\u013e" + + "\u013c\u0001\u0000\u0000\u0000\u013f\u0134\u0001\u0000\u0000\u0000\u013f" + + "\u0140\u0001\u0000\u0000\u0000\u0140\u0141\u0001\u0000\u0000\u0000\u0141" + + "\u0142\u0005\n\u0000\u0000\u0142\u0143\u0006\u0010\uffff\uffff\u0000\u0143" + + "!\u0001\u0000\u0000\u0000\u0144\u0145\u0006\u0011\uffff\uffff\u0000\u0145" + + "\u0155\u0005-\u0000\u0000\u0146\u0152\u0005\u0007\u0000\u0000\u0147\u0148" + + "\u0003\u0012\t\u0000\u0148\u014f\u0006\u0011\uffff\uffff\u0000\u0149\u014a" + + "\u0005\u0003\u0000\u0000\u014a\u014b\u0003\u0012\t\u0000\u014b\u014c\u0006" + + "\u0011\uffff\uffff\u0000\u014c\u014e\u0001\u0000\u0000\u0000\u014d\u0149" + + "\u0001\u0000\u0000\u0000\u014e\u0151\u0001\u0000\u0000\u0000\u014f\u014d" + + "\u0001\u0000\u0000\u0000\u014f\u0150\u0001\u0000\u0000\u0000\u0150\u0153" + + "\u0001\u0000\u0000\u0000\u0151\u014f\u0001\u0000\u0000\u0000\u0152\u0147" + + "\u0001\u0000\u0000\u0000\u0152\u0153\u0001\u0000\u0000\u0000\u0153\u0154" + + "\u0001\u0000\u0000\u0000\u0154\u0156\u0005\b\u0000\u0000\u0155\u0146\u0001" + + "\u0000\u0000\u0000\u0155\u0156\u0001\u0000\u0000\u0000\u0156\u0157\u0001" + + "\u0000\u0000\u0000\u0157\u0158\u0006\u0011\uffff\uffff\u0000\u0158#\u0001" + + "\u0000\u0000\u0000\u0159\u015a\u0006\u0012\uffff\uffff\u0000\u015a\u015b" + + "\u0005\u0011\u0000\u0000\u015b\u015c\u0003\u0012\t\u0000\u015c\u015d\u0005" + + "\u0012\u0000\u0000\u015d\u0161\u0003\u0002\u0001\u0000\u015e\u015f\u0003" + + "&\u0013\u0000\u015f\u0160\u0006\u0012\uffff\uffff\u0000\u0160\u0162\u0001" + + "\u0000\u0000\u0000\u0161\u015e\u0001\u0000\u0000\u0000\u0161\u0162\u0001" + + "\u0000\u0000\u0000\u0162\u0163\u0001\u0000\u0000\u0000\u0163\u0164\u0005" + + "\u0013\u0000\u0000\u0164\u0165\u0006\u0012\uffff\uffff\u0000\u0165%\u0001" + + "\u0000\u0000\u0000\u0166\u0167\u0005\u0014\u0000\u0000\u0167\u0168\u0006" + + "\u0013\uffff\uffff\u0000\u0168\u0169\u0003\u0012\t\u0000\u0169\u016a\u0005" + + "\u0012\u0000\u0000\u016a\u016e\u0003\u0002\u0001\u0000\u016b\u016c\u0003" + + "&\u0013\u0000\u016c\u016d\u0006\u0013\uffff\uffff\u0000\u016d\u016f\u0001" + + "\u0000\u0000\u0000\u016e\u016b\u0001\u0000\u0000\u0000\u016e\u016f\u0001" + + "\u0000\u0000\u0000\u016f\u0170\u0001\u0000\u0000\u0000\u0170\u0171\u0006" + + "\u0013\uffff\uffff\u0000\u0171\u0177\u0001\u0000\u0000\u0000\u0172\u0173" + + "\u0005\u0015\u0000\u0000\u0173\u0174\u0003\u0002\u0001\u0000\u0174\u0175" + + "\u0006\u0013\uffff\uffff\u0000\u0175\u0177\u0001\u0000\u0000\u0000\u0176" + + "\u0166\u0001\u0000\u0000\u0000\u0176\u0172\u0001\u0000\u0000\u0000\u0177" + + "\'\u0001\u0000\u0000\u0000\u0178\u0179\u0005\u0016\u0000\u0000\u0179\u017a" + + "\u0003\u0012\t\u0000\u017a\u017b\u0005\u0017\u0000\u0000\u017b\u017c\u0003" + + "\u0002\u0001\u0000\u017c\u017d\u0005\u0018\u0000\u0000\u017d\u017e\u0006" + + "\u0014\uffff\uffff\u0000\u017e)\u0001\u0000\u0000\u0000\u017f\u0180\u0005" + + "\u0017\u0000\u0000\u0180\u0181\u0003\u0002\u0001\u0000\u0181\u0182\u0005" + + "\u0016\u0000\u0000\u0182\u0183\u0003\u0012\t\u0000\u0183\u0184\u0005\u0018" + + "\u0000\u0000\u0184\u0185\u0006\u0015\uffff\uffff\u0000\u0185+\u0001\u0000" + + "\u0000\u0000\u0186\u0187\u0005\u0019\u0000\u0000\u0187\u0188\u0006\u0016" + + "\uffff\uffff\u0000\u0188\u0189\u0003\u0002\u0001\u0000\u0189\u018a\u0005" + + "\u0003\u0000\u0000\u018a\u018b\u0003\u0012\t\u0000\u018b\u018c\u0005\u0003" + + "\u0000\u0000\u018c\u018d\u0003\u0012\t\u0000\u018d\u018e\u0005\u0017\u0000" + + "\u0000\u018e\u018f\u0003\u0002\u0001\u0000\u018f\u0190\u0005\u0018\u0000" + + "\u0000\u0190\u0191\u0006\u0016\uffff\uffff\u0000\u0191-\u0001\u0000\u0000" + + "\u0000\u0192\u0193\u00030\u0018\u0000\u0193\u0194\u0006\u0017\uffff\uffff" + + "\u0000\u0194\u0199\u0001\u0000\u0000\u0000\u0195\u0196\u00032\u0019\u0000" + + "\u0196\u0197\u0006\u0017\uffff\uffff\u0000\u0197\u0199\u0001\u0000\u0000" + + "\u0000\u0198\u0192\u0001\u0000\u0000\u0000\u0198\u0195\u0001\u0000\u0000" + + "\u0000\u0199/\u0001\u0000\u0000\u0000\u019a\u019b\u00032\u0019\u0000\u019b" + + "\u019c\u0005\u001a\u0000\u0000\u019c\u019d\u0003.\u0017\u0000\u019d\u019e" + + "\u0006\u0018\uffff\uffff\u0000\u019e1\u0001\u0000\u0000\u0000\u019f\u01a0" + + "\u00034\u001a\u0000\u01a0\u01a1\u0006\u0019\uffff\uffff\u0000\u01a1\u01db" + + "\u0001\u0000\u0000\u0000\u01a2\u01a3\u00036\u001b\u0000\u01a3\u01a4\u0006" + + "\u0019\uffff\uffff\u0000\u01a4\u01db\u0001\u0000\u0000\u0000\u01a5\u01a6" + + "\u00038\u001c\u0000\u01a6\u01a7\u0006\u0019\uffff\uffff\u0000\u01a7\u01db" + + "\u0001\u0000\u0000\u0000\u01a8\u01a9\u0003:\u001d\u0000\u01a9\u01aa\u0006" + + "\u0019\uffff\uffff\u0000\u01aa\u01db\u0001\u0000\u0000\u0000\u01ab\u01ac" + + "\u0005.\u0000\u0000\u01ac\u01b1\u0006\u0019\uffff\uffff\u0000\u01ad\u01ae" + + "\u0005\u001b\u0000\u0000\u01ae\u01af\u0003.\u0017\u0000\u01af\u01b0\u0006" + + "\u0019\uffff\uffff\u0000\u01b0\u01b2\u0001\u0000\u0000\u0000\u01b1\u01ad" + + "\u0001\u0000\u0000\u0000\u01b1\u01b2\u0001\u0000\u0000\u0000\u01b2\u01b3" + + "\u0001\u0000\u0000\u0000\u01b3\u01db\u0006\u0019\uffff\uffff\u0000\u01b4" + + "\u01b7\u0006\u0019\uffff\uffff\u0000\u01b5\u01b6\u0005+\u0000\u0000\u01b6" + + "\u01b8\u0006\u0019\uffff\uffff\u0000\u01b7\u01b5\u0001\u0000\u0000\u0000" + + "\u01b7\u01b8\u0001\u0000\u0000\u0000\u01b8\u01b9\u0001\u0000\u0000\u0000" + + "\u01b9\u01ba\u00051\u0000\u0000\u01ba\u01db\u0006\u0019\uffff\uffff\u0000" + + "\u01bb\u01bc\u00050\u0000\u0000\u01bc\u01db\u0006\u0019\uffff\uffff\u0000" + + "\u01bd\u01be\u0005/\u0000\u0000\u01be\u01db\u0006\u0019\uffff\uffff\u0000" + + "\u01bf\u01c0\u0005\r\u0000\u0000\u01c0\u01db\u0006\u0019\uffff\uffff\u0000" + + "\u01c1\u01c2\u0005\u000e\u0000\u0000\u01c2\u01db\u0006\u0019\uffff\uffff" + + "\u0000\u01c3\u01c4\u0005\u001c\u0000\u0000\u01c4\u01c5\u0005\u001d\u0000" + + "\u0000\u01c5\u01db\u0006\u0019\uffff\uffff\u0000\u01c6\u01c7\u0005\u001c" + + "\u0000\u0000\u01c7\u01c8\u0005\u001e\u0000\u0000\u01c8\u01db\u0006\u0019" + + "\uffff\uffff\u0000\u01c9\u01ca\u0005\u001c\u0000\u0000\u01ca\u01cb\u0005" + + "\u001f\u0000\u0000\u01cb\u01db\u0006\u0019\uffff\uffff\u0000\u01cc\u01cd" + + "\u0005\u001c\u0000\u0000\u01cd\u01ce\u0005 \u0000\u0000\u01ce\u01db\u0006" + + "\u0019\uffff\uffff\u0000\u01cf\u01d0\u0005\u001c\u0000\u0000\u01d0\u01d1" + + "\u0005!\u0000\u0000\u01d1\u01db\u0006\u0019\uffff\uffff\u0000\u01d2\u01d3" + + "\u0005\u001c\u0000\u0000\u01d3\u01d4\u0005\u0006\u0000\u0000\u01d4\u01db" + + "\u0006\u0019\uffff\uffff\u0000\u01d5\u01d6\u0005\u0007\u0000\u0000\u01d6" + + "\u01d7\u0003.\u0017\u0000\u01d7\u01d8\u0005\b\u0000\u0000\u01d8\u01d9" + + "\u0006\u0019\uffff\uffff\u0000\u01d9\u01db\u0001\u0000\u0000\u0000\u01da" + + "\u019f\u0001\u0000\u0000\u0000\u01da\u01a2\u0001\u0000\u0000\u0000\u01da" + + "\u01a5\u0001\u0000\u0000\u0000\u01da\u01a8\u0001\u0000\u0000\u0000\u01da" + + "\u01ab\u0001\u0000\u0000\u0000\u01da\u01b4\u0001\u0000\u0000\u0000\u01da" + + "\u01bb\u0001\u0000\u0000\u0000\u01da\u01bd\u0001\u0000\u0000\u0000\u01da" + + "\u01bf\u0001\u0000\u0000\u0000\u01da\u01c1\u0001\u0000\u0000\u0000\u01da" + + "\u01c3\u0001\u0000\u0000\u0000\u01da\u01c6\u0001\u0000\u0000\u0000\u01da" + + "\u01c9\u0001\u0000\u0000\u0000\u01da\u01cc\u0001\u0000\u0000\u0000\u01da" + + "\u01cf\u0001\u0000\u0000\u0000\u01da\u01d2\u0001\u0000\u0000\u0000\u01da" + + "\u01d5\u0001\u0000\u0000\u0000\u01db3\u0001\u0000\u0000\u0000\u01dc\u01dd" + + "\u0005\"\u0000\u0000\u01dd\u01de\u0006\u001a\uffff\uffff\u0000\u01de5" + + "\u0001\u0000\u0000\u0000\u01df\u01e0\u0006\u001b\uffff\uffff\u0000\u01e0" + + "\u01f0\u0005-\u0000\u0000\u01e1\u01ed\u0005\u0007\u0000\u0000\u01e2\u01e3" + + "\u0003.\u0017\u0000\u01e3\u01ea\u0006\u001b\uffff\uffff\u0000\u01e4\u01e5" + + "\u0005\u0003\u0000\u0000\u01e5\u01e6\u0003.\u0017\u0000\u01e6\u01e7\u0006" + + "\u001b\uffff\uffff\u0000\u01e7\u01e9\u0001\u0000\u0000\u0000\u01e8\u01e4" + + "\u0001\u0000\u0000\u0000\u01e9\u01ec\u0001\u0000\u0000\u0000\u01ea\u01e8" + + "\u0001\u0000\u0000\u0000\u01ea\u01eb\u0001\u0000\u0000\u0000\u01eb\u01ee" + + "\u0001\u0000\u0000\u0000\u01ec\u01ea\u0001\u0000\u0000\u0000\u01ed\u01e2" + + "\u0001\u0000\u0000\u0000\u01ed\u01ee\u0001\u0000\u0000\u0000\u01ee\u01ef" + + "\u0001\u0000\u0000\u0000\u01ef\u01f1\u0005\b\u0000\u0000\u01f0\u01e1\u0001" + + "\u0000\u0000\u0000\u01f0\u01f1\u0001\u0000\u0000\u0000\u01f1\u01f2\u0001" + + "\u0000\u0000\u0000\u01f2\u01f3\u0006\u001b\uffff\uffff\u0000\u01f37\u0001" + + "\u0000\u0000\u0000\u01f4\u01f5\u0006\u001c\uffff\uffff\u0000\u01f5\u0201" + + "\u0005\u000b\u0000\u0000\u01f6\u01f7\u0003.\u0017\u0000\u01f7\u01fe\u0006" + + "\u001c\uffff\uffff\u0000\u01f8\u01f9\u0005\u0003\u0000\u0000\u01f9\u01fa" + + "\u0003.\u0017\u0000\u01fa\u01fb\u0006\u001c\uffff\uffff\u0000\u01fb\u01fd" + + "\u0001\u0000\u0000\u0000\u01fc\u01f8\u0001\u0000\u0000\u0000\u01fd\u0200" + + "\u0001\u0000\u0000\u0000\u01fe\u01fc\u0001\u0000\u0000\u0000\u01fe\u01ff" + + "\u0001\u0000\u0000\u0000\u01ff\u0202\u0001\u0000\u0000\u0000\u0200\u01fe" + + "\u0001\u0000\u0000\u0000\u0201\u01f6\u0001\u0000\u0000\u0000\u0201\u0202" + + "\u0001\u0000\u0000\u0000\u0202\u0203\u0001\u0000\u0000\u0000\u0203\u0204" + + "\u0005\f\u0000\u0000\u0204\u0205\u0006\u001c\uffff\uffff\u0000\u02059" + + "\u0001\u0000\u0000\u0000\u0206\u0207\u0006\u001d\uffff\uffff\u0000\u0207" + + "\u0213\u0005\t\u0000\u0000\u0208\u0209\u0003.\u0017\u0000\u0209\u0210" + + "\u0006\u001d\uffff\uffff\u0000\u020a\u020b\u0005\u0003\u0000\u0000\u020b" + + "\u020c\u0003.\u0017\u0000\u020c\u020d\u0006\u001d\uffff\uffff\u0000\u020d" + + "\u020f\u0001\u0000\u0000\u0000\u020e\u020a\u0001\u0000\u0000\u0000\u020f" + + "\u0212\u0001\u0000\u0000\u0000\u0210\u020e\u0001\u0000\u0000\u0000\u0210" + + "\u0211\u0001\u0000\u0000\u0000\u0211\u0214\u0001\u0000\u0000\u0000\u0212" + + "\u0210\u0001\u0000\u0000\u0000\u0213\u0208\u0001\u0000\u0000\u0000\u0213" + + "\u0214\u0001\u0000\u0000\u0000\u0214\u0215\u0001\u0000\u0000\u0000\u0215" + + "\u0216\u0005\n\u0000\u0000\u0216\u0217\u0006\u001d\uffff\uffff\u0000\u0217" + + ";\u0001\u0000\u0000\u0000\u0218\u0219\u0005#\u0000\u0000\u0219\u021a\u0003" + + "\u0012\t\u0000\u021a\u021b\u0005$\u0000\u0000\u021b\u021c\u0003>\u001f" + + "\u0000\u021c\u021d\u0005%\u0000\u0000\u021d\u021e\u0006\u001e\uffff\uffff" + + "\u0000\u021e=\u0001\u0000\u0000\u0000\u021f\u0220\u0006\u001f\uffff\uffff" + + "\u0000\u0220\u0221\u0003@ \u0000\u0221\u0228\u0006\u001f\uffff\uffff\u0000" + + "\u0222\u0223\u0005&\u0000\u0000\u0223\u0224\u0003@ \u0000\u0224\u0225" + + "\u0006\u001f\uffff\uffff\u0000\u0225\u0227\u0001\u0000\u0000\u0000\u0226" + + "\u0222\u0001\u0000\u0000\u0000\u0227\u022a\u0001\u0000\u0000\u0000\u0228" + + "\u0226\u0001\u0000\u0000\u0000\u0228\u0229\u0001\u0000\u0000\u0000\u0229" + + "?\u0001\u0000\u0000\u0000\u022a\u0228\u0001\u0000\u0000\u0000\u022b\u022c" + + "\u0006 \uffff\uffff\u0000\u022c\u022d\u0003.\u0017\u0000\u022d\u022e\u0006" + + " \uffff\uffff\u0000\u022e\u022f\u0005\'\u0000\u0000\u022f\u0230\u0003" + + "\u0002\u0001\u0000\u0230\u0231\u0006 \uffff\uffff\u0000\u0231\u0232\u0006" + + " \uffff\uffff\u0000\u0232A\u0001\u0000\u0000\u0000\u0233\u0234\u0005," + + "\u0000\u0000\u0234\u0238\u0006!\uffff\uffff\u0000\u0235\u0236\u0005+\u0000" + + "\u0000\u0236\u0238\u0006!\uffff\uffff\u0000\u0237\u0233\u0001\u0000\u0000" + + "\u0000\u0237\u0235\u0001\u0000\u0000\u0000\u0238C\u0001\u0000\u0000\u0000" + + "(PV[ekx\u0084\u0089\u0091\u009f\u00ad\u00ba\u00c0\u00c9\u00d8\u00e4\u011e" + + "\u012a\u012d\u013c\u013f\u014f\u0152\u0155\u0161\u016e\u0176\u0198\u01b1" + + "\u01b7\u01da\u01ea\u01ed\u01f0\u01fe\u0201\u0210\u0213\u0228\u0237"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } } \ No newline at end of file