From d62d37b7f7bb27efba85348002c1168e6a920a8b Mon Sep 17 00:00:00 2001 From: luthanhar Date: Sun, 9 Feb 2025 21:00:17 +0530 Subject: [PATCH 01/47] Nesting instruction support, assignment in expressions, handling syntax error listners --- ChironCore/ChironAST/builder.py | 54 +- ChironCore/chiron.py | 3 +- ChironCore/example/kachuapur2.tl | 11 +- ChironCore/interpreter.py | 2 + ChironCore/irhandler.py | 2 +- ChironCore/turtparse/parseError.py | 60 ++- ChironCore/turtparse/tlang.g4 | 27 +- ChironCore/turtparse/tlang.interp | 8 +- ChironCore/turtparse/tlang.tokens | 16 +- ChironCore/turtparse/tlangLexer.interp | 4 +- ChironCore/turtparse/tlangLexer.py | 77 +-- ChironCore/turtparse/tlangLexer.tokens | 16 +- ChironCore/turtparse/tlangParser.py | 663 ++++++++++++++----------- ChironCore/turtparse/tlangVisitor.py | 43 +- 14 files changed, 575 insertions(+), 411 deletions(-) diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index b38265e..2a00b28 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -14,19 +14,22 @@ class astGenPass(tlangVisitor): + def __init__(self): self.repeatInstrCount = 0 # keeps count for no of 'repeat' instructions + self.stmtList=[] def visitStart(self, ctx:tlangParser.StartContext): stmtList = self.visit(ctx.instruction_list()) - return stmtList + self.stmtList.extend(stmtList) + return self.stmtList def visitInstruction_list(self, ctx:tlangParser.Instruction_listContext): instrList = [] for instr in ctx.instruction(): - instrList.extend(self.visit(instr)) + self.stmtList.extend(self.visit(instr)) - return instrList + return [] def visitStrict_ilist(self, ctx:tlangParser.Strict_ilistContext): # TODO: code refactoring. visitInstruction_list and visitStrict_ilist have same body @@ -38,10 +41,32 @@ def visitStrict_ilist(self, ctx:tlangParser.Strict_ilistContext): return instrList - def visitAssignment(self, ctx:tlangParser.AssignmentContext): +#computes list of recursive assign statements + def visitAssignment(self, ctx:tlangParser.AssignmentContext): + + print(ctx.VAR().getText(),ctx.expression().getText()) lval = ChironAST.Var(ctx.VAR().getText()) rval = self.visit(ctx.expression()) + if isinstance(rval, list): + print(rval[-1][0]) + rvaln = rval[-1][0].lvar # Get the last assigned variable as rval + return rval + [(ChironAST.AssignmentCommand(lval, rvaln), 1)] + + # Otherwise, just return a normal assignment return [(ChironAST.AssignmentCommand(lval, rval), 1)] + + def visitAssignExpr(self, ctx: tlangParser.AssignExprContext): + + print("Assignment Expr") + + list=self.visitAssignment(ctx) + self.stmtList.extend(list) + + return list[-1][0].lvar + + # return "("+ ChironAST.AssignmentCommand(lval, rval) + ")" + # return # Calls visitAssignment + def visitIfConditional(self, ctx:tlangParser.IfConditionalContext): @@ -64,6 +89,10 @@ def visitGotoCommand(self, ctx:tlangParser.GotoCommandContext): # Visit a parse tree produced by tlangParser#unaryExpr. def visitUnaryExpr(self, ctx:tlangParser.UnaryExprContext): expr1 = self.visit(ctx.expression()) + # if isinstance(expr1, list): + # print("Unary & assignlist",expr1[-1][0]) + # expr1 = expr1[-1][0].lvar # Get the last assigned variable as rval + if ctx.unaryArithOp().MINUS(): return ChironAST.UMinus(expr1) @@ -72,12 +101,25 @@ def visitUnaryExpr(self, ctx:tlangParser.UnaryExprContext): # Visit a parse tree produced by tlangParser#addExpr. def visitAddExpr(self, ctx:tlangParser.AddExprContext): + print("visiting add expr") + # left_list=[] + # right_list=[] left = self.visit(ctx.expression(0)) + # if isinstance(left, list): + # left_list=left + # print("add and assignlist",left_list[-1][0]) + # left = left_list[-1][0].lvar # Get the last assigned variable as rval + right = self.visit(ctx.expression(1)) + # if isinstance(right, list): + # right_list=right + # print("add and assignlist",right_list[-1][0]) + # right = right_list[-1][0].lvar # Get the last assigned variable as rval if ctx.additive().PLUS(): - return ChironAST.Sum(left, right) + ext= ChironAST.Sum(left, right) elif ctx.additive().MINUS(): - return ChironAST.Diff(left, right) + ext= ChironAST.Diff(left, right) + return ext # Visit a parse tree produced by tlangParser#mulExpr. diff --git a/ChironCore/chiron.py b/ChironCore/chiron.py index 2eca801..96f9997 100755 --- a/ChironCore/chiron.py +++ b/ChironCore/chiron.py @@ -210,7 +210,8 @@ def stopTurtle(): if args.bin: ir = irHandler.loadIR(args.progfl) else: - parseTree = getParseTree(args.progfl) + parseTree,parser = getParseTree(args.progfl) + print(parseTree.toStringTree(recog=parser)) astgen = astGenPass() ir = astgen.visitStart(parseTree) diff --git a/ChironCore/example/kachuapur2.tl b/ChironCore/example/kachuapur2.tl index 448f1d3..5bf268f 100644 --- a/ChironCore/example/kachuapur2.tl +++ b/ChironCore/example/kachuapur2.tl @@ -1,8 +1,3 @@ -:cnt = 0 -:i = 0 -repeat :steps [ - :i = :cnt + :i - :cnt = :cnt + 1 - forward(1 + :cnt) - right(:radius) -] +:b = 2 +:steps = (:c = :b) * (:d = 4) + diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index bb30bcb..7a66700 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -134,6 +134,8 @@ def initProgramContext(self, params): def handleAssignment(self, stmt, tgt): print(" Assignment Statement") lhs = str(stmt.lvar).replace(":","") + if isinstance(stmt.rexpr, ChironAST.AssignmentCommand): + print("this is nested") rhs = addContext(stmt.rexpr) exec("setattr(self.prg,\"%s\",%s)" % (lhs,rhs)) return 1 diff --git a/ChironCore/irhandler.py b/ChironCore/irhandler.py index 56e60de..a49c777 100644 --- a/ChironCore/irhandler.py +++ b/ChironCore/irhandler.py @@ -23,7 +23,7 @@ def getParseTree(progfl): print(e.__str__() + "\033[0m\n") exit(1) - return tree + return tree,tparser class IRHandler: diff --git a/ChironCore/turtparse/parseError.py b/ChironCore/turtparse/parseError.py index 48c62ec..ca88ac5 100644 --- a/ChironCore/turtparse/parseError.py +++ b/ChironCore/turtparse/parseError.py @@ -13,8 +13,62 @@ class SyntaxErrorListener(): def syntaxError(self, recognizer, offendingSymbol, line, column, msg, e): raise SyntaxException("Syntax Error", (line, column, msg)) - def reportAmbiguity(self): + def reportAmbiguity(self, recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs): + print("Ambiguity detected:") + print(f" Start index: {startIndex}") + print(f" Stop index: {stopIndex}") + print(f" Exact: {exact}") + print(f" Ambiguous alternatives: {ambigAlts}") raise ValueError("Ambiguity error.") - def reportContextSensitivity(self): - raise ValueError("Exit due to context sensitivity.") + + # # Print details about each alternative + # for alt in ambigAlts: + # print(f" Alternative {alt}:") + # for config in configs: + # if config.alt == alt: + # print(f" {self.getConfigDescription(recognizer, config)}") + + def reportAttemptingFullContext(self, recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs): + print("Full context attempt:") + print(f" Start index: {startIndex}") + print(f" Stop index: {stopIndex}") + print(f" Conflicting alternatives: {conflictingAlts}") + + # Print details about each alternative + for alt in conflictingAlts: + print(f" Alternative {alt}:") + for config in configs: + if config.alt == alt: + print(f" {self.getConfigDescription(recognizer, config)}") + + def getConfigDescription(self, recognizer, config): + return (f"(Rule: {recognizer.ruleNames[config.state.ruleIndex]}, " + f"State: {config.state.stateNumber}, " + ) + + + # Add any additional custom error handling or logging as needed + + + + def reportContextSensitivity(self, recognizer, dfa, startIndex, stopIndex, prediction, configs): + # Get the current token + current_token = recognizer.getCurrentToken() + + # Get the rule names + rule_names = recognizer.ruleNames + + # Print basic information + print(f"Context sensitivity detected at token '{current_token.text}' (line {current_token.line}, column {current_token.column})") + + # Print conflicting rules + print("Conflicting rules:") + for config in configs: + rule_index = config.state.ruleIndex + if rule_index >= 0 and rule_index < len(rule_names): + rule_name = rule_names[rule_index] + print(f" - {rule_name}") + + print(f"Predicted alternative: {prediction}") + # raise ValueError("Exit due to context sensitivity.") diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index ff3a2f6..e7b1ded 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -29,9 +29,6 @@ loop : 'repeat' value '[' strict_ilist ']' ; gotoCommand : 'goto' '(' expression ',' expression ')'; -assignment : VAR '=' expression - ; - moveCommand : moveOp expression ; moveOp : 'forward' | 'backward' | 'left' | 'right' ; @@ -39,13 +36,11 @@ penCommand : 'penup' | 'pendown' ; pauseCommand : 'pause' ; -expression : - unaryArithOp expression #unaryExpr - | expression multiplicative expression #mulExpr - | expression additive expression #addExpr - | value #valueExpr - | '(' expression ')' #parenExpr - ; + +assignment : + VAR '=' expression + ; + multiplicative : MUL | DIV; additive : PLUS | MINUS; @@ -58,6 +53,18 @@ MUL : '*' ; DIV : '/' ; +expression : + unaryArithOp expression #unaryExpr + | expression multiplicative expression #mulExpr + | expression additive expression #addExpr + | '(' expression ')' #parenExpr + | value #valueExpr + | VAR '=' expression #assignExpr + + ; + + + // TODO : // procedure_declaration : 'to' NAME (VAR)+ strict_ilist 'end' ; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index f3cba53..9f44688 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -9,7 +9,6 @@ null '(' ',' ')' -'=' 'forward' 'backward' 'left' @@ -17,6 +16,7 @@ null 'penup' 'pendown' 'pause' +'=' '+' '-' '*' @@ -84,15 +84,15 @@ ifConditional ifElseConditional loop gotoCommand -assignment moveCommand moveOp penCommand pauseCommand -expression +assignment multiplicative additive unaryArithOp +expression condition binCondOp logicOp @@ -100,4 +100,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 37, 175, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 51, 10, 3, 12, 3, 14, 3, 54, 11, 3, 3, 4, 6, 4, 57, 10, 4, 13, 4, 14, 4, 58, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 68, 10, 5, 3, 6, 3, 6, 5, 6, 72, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 5, 16, 125, 10, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 7, 16, 135, 10, 16, 12, 16, 14, 16, 138, 11, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 5, 20, 158, 10, 20, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 164, 10, 20, 12, 20, 14, 20, 167, 11, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 2, 4, 30, 38, 24, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 2, 9, 3, 2, 13, 16, 3, 2, 17, 18, 3, 2, 22, 23, 3, 2, 20, 21, 3, 2, 25, 30, 3, 2, 31, 32, 3, 2, 34, 35, 2, 169, 2, 46, 3, 2, 2, 2, 4, 52, 3, 2, 2, 2, 6, 56, 3, 2, 2, 2, 8, 67, 3, 2, 2, 2, 10, 71, 3, 2, 2, 2, 12, 73, 3, 2, 2, 2, 14, 79, 3, 2, 2, 2, 16, 89, 3, 2, 2, 2, 18, 95, 3, 2, 2, 2, 20, 102, 3, 2, 2, 2, 22, 106, 3, 2, 2, 2, 24, 109, 3, 2, 2, 2, 26, 111, 3, 2, 2, 2, 28, 113, 3, 2, 2, 2, 30, 124, 3, 2, 2, 2, 32, 139, 3, 2, 2, 2, 34, 141, 3, 2, 2, 2, 36, 143, 3, 2, 2, 2, 38, 157, 3, 2, 2, 2, 40, 168, 3, 2, 2, 2, 42, 170, 3, 2, 2, 2, 44, 172, 3, 2, 2, 2, 46, 47, 5, 4, 3, 2, 47, 48, 7, 2, 2, 3, 48, 3, 3, 2, 2, 2, 49, 51, 5, 8, 5, 2, 50, 49, 3, 2, 2, 2, 51, 54, 3, 2, 2, 2, 52, 50, 3, 2, 2, 2, 52, 53, 3, 2, 2, 2, 53, 5, 3, 2, 2, 2, 54, 52, 3, 2, 2, 2, 55, 57, 5, 8, 5, 2, 56, 55, 3, 2, 2, 2, 57, 58, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 7, 3, 2, 2, 2, 60, 68, 5, 20, 11, 2, 61, 68, 5, 10, 6, 2, 62, 68, 5, 16, 9, 2, 63, 68, 5, 22, 12, 2, 64, 68, 5, 26, 14, 2, 65, 68, 5, 18, 10, 2, 66, 68, 5, 28, 15, 2, 67, 60, 3, 2, 2, 2, 67, 61, 3, 2, 2, 2, 67, 62, 3, 2, 2, 2, 67, 63, 3, 2, 2, 2, 67, 64, 3, 2, 2, 2, 67, 65, 3, 2, 2, 2, 67, 66, 3, 2, 2, 2, 68, 9, 3, 2, 2, 2, 69, 72, 5, 12, 7, 2, 70, 72, 5, 14, 8, 2, 71, 69, 3, 2, 2, 2, 71, 70, 3, 2, 2, 2, 72, 11, 3, 2, 2, 2, 73, 74, 7, 3, 2, 2, 74, 75, 5, 38, 20, 2, 75, 76, 7, 4, 2, 2, 76, 77, 5, 6, 4, 2, 77, 78, 7, 5, 2, 2, 78, 13, 3, 2, 2, 2, 79, 80, 7, 3, 2, 2, 80, 81, 5, 38, 20, 2, 81, 82, 7, 4, 2, 2, 82, 83, 5, 6, 4, 2, 83, 84, 7, 5, 2, 2, 84, 85, 7, 6, 2, 2, 85, 86, 7, 4, 2, 2, 86, 87, 5, 6, 4, 2, 87, 88, 7, 5, 2, 2, 88, 15, 3, 2, 2, 2, 89, 90, 7, 7, 2, 2, 90, 91, 5, 44, 23, 2, 91, 92, 7, 4, 2, 2, 92, 93, 5, 6, 4, 2, 93, 94, 7, 5, 2, 2, 94, 17, 3, 2, 2, 2, 95, 96, 7, 8, 2, 2, 96, 97, 7, 9, 2, 2, 97, 98, 5, 30, 16, 2, 98, 99, 7, 10, 2, 2, 99, 100, 5, 30, 16, 2, 100, 101, 7, 11, 2, 2, 101, 19, 3, 2, 2, 2, 102, 103, 7, 35, 2, 2, 103, 104, 7, 12, 2, 2, 104, 105, 5, 30, 16, 2, 105, 21, 3, 2, 2, 2, 106, 107, 5, 24, 13, 2, 107, 108, 5, 30, 16, 2, 108, 23, 3, 2, 2, 2, 109, 110, 9, 2, 2, 2, 110, 25, 3, 2, 2, 2, 111, 112, 9, 3, 2, 2, 112, 27, 3, 2, 2, 2, 113, 114, 7, 19, 2, 2, 114, 29, 3, 2, 2, 2, 115, 116, 8, 16, 1, 2, 116, 117, 5, 36, 19, 2, 117, 118, 5, 30, 16, 7, 118, 125, 3, 2, 2, 2, 119, 125, 5, 44, 23, 2, 120, 121, 7, 9, 2, 2, 121, 122, 5, 30, 16, 2, 122, 123, 7, 11, 2, 2, 123, 125, 3, 2, 2, 2, 124, 115, 3, 2, 2, 2, 124, 119, 3, 2, 2, 2, 124, 120, 3, 2, 2, 2, 125, 136, 3, 2, 2, 2, 126, 127, 12, 6, 2, 2, 127, 128, 5, 32, 17, 2, 128, 129, 5, 30, 16, 7, 129, 135, 3, 2, 2, 2, 130, 131, 12, 5, 2, 2, 131, 132, 5, 34, 18, 2, 132, 133, 5, 30, 16, 6, 133, 135, 3, 2, 2, 2, 134, 126, 3, 2, 2, 2, 134, 130, 3, 2, 2, 2, 135, 138, 3, 2, 2, 2, 136, 134, 3, 2, 2, 2, 136, 137, 3, 2, 2, 2, 137, 31, 3, 2, 2, 2, 138, 136, 3, 2, 2, 2, 139, 140, 9, 4, 2, 2, 140, 33, 3, 2, 2, 2, 141, 142, 9, 5, 2, 2, 142, 35, 3, 2, 2, 2, 143, 144, 7, 21, 2, 2, 144, 37, 3, 2, 2, 2, 145, 146, 8, 20, 1, 2, 146, 147, 7, 33, 2, 2, 147, 158, 5, 38, 20, 7, 148, 149, 5, 30, 16, 2, 149, 150, 5, 40, 21, 2, 150, 151, 5, 30, 16, 2, 151, 158, 3, 2, 2, 2, 152, 158, 7, 24, 2, 2, 153, 154, 7, 9, 2, 2, 154, 155, 5, 38, 20, 2, 155, 156, 7, 11, 2, 2, 156, 158, 3, 2, 2, 2, 157, 145, 3, 2, 2, 2, 157, 148, 3, 2, 2, 2, 157, 152, 3, 2, 2, 2, 157, 153, 3, 2, 2, 2, 158, 165, 3, 2, 2, 2, 159, 160, 12, 5, 2, 2, 160, 161, 5, 42, 22, 2, 161, 162, 5, 38, 20, 6, 162, 164, 3, 2, 2, 2, 163, 159, 3, 2, 2, 2, 164, 167, 3, 2, 2, 2, 165, 163, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 39, 3, 2, 2, 2, 167, 165, 3, 2, 2, 2, 168, 169, 9, 6, 2, 2, 169, 41, 3, 2, 2, 2, 170, 171, 9, 7, 2, 2, 171, 43, 3, 2, 2, 2, 172, 173, 9, 8, 2, 2, 173, 45, 3, 2, 2, 2, 11, 52, 58, 67, 71, 124, 134, 136, 157, 165] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 37, 178, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 51, 10, 3, 12, 3, 14, 3, 54, 11, 3, 3, 4, 6, 4, 57, 10, 4, 13, 4, 14, 4, 58, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 68, 10, 5, 3, 6, 3, 6, 5, 6, 72, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 134, 10, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 7, 19, 144, 10, 19, 12, 19, 14, 19, 147, 11, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 5, 20, 161, 10, 20, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 167, 10, 20, 12, 20, 14, 20, 170, 11, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 2, 4, 36, 38, 24, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 2, 9, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 22, 23, 3, 2, 20, 21, 3, 2, 25, 30, 3, 2, 31, 32, 3, 2, 34, 35, 2, 173, 2, 46, 3, 2, 2, 2, 4, 52, 3, 2, 2, 2, 6, 56, 3, 2, 2, 2, 8, 67, 3, 2, 2, 2, 10, 71, 3, 2, 2, 2, 12, 73, 3, 2, 2, 2, 14, 79, 3, 2, 2, 2, 16, 89, 3, 2, 2, 2, 18, 95, 3, 2, 2, 2, 20, 102, 3, 2, 2, 2, 22, 105, 3, 2, 2, 2, 24, 107, 3, 2, 2, 2, 26, 109, 3, 2, 2, 2, 28, 111, 3, 2, 2, 2, 30, 115, 3, 2, 2, 2, 32, 117, 3, 2, 2, 2, 34, 119, 3, 2, 2, 2, 36, 133, 3, 2, 2, 2, 38, 160, 3, 2, 2, 2, 40, 171, 3, 2, 2, 2, 42, 173, 3, 2, 2, 2, 44, 175, 3, 2, 2, 2, 46, 47, 5, 4, 3, 2, 47, 48, 7, 2, 2, 3, 48, 3, 3, 2, 2, 2, 49, 51, 5, 8, 5, 2, 50, 49, 3, 2, 2, 2, 51, 54, 3, 2, 2, 2, 52, 50, 3, 2, 2, 2, 52, 53, 3, 2, 2, 2, 53, 5, 3, 2, 2, 2, 54, 52, 3, 2, 2, 2, 55, 57, 5, 8, 5, 2, 56, 55, 3, 2, 2, 2, 57, 58, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 7, 3, 2, 2, 2, 60, 68, 5, 28, 15, 2, 61, 68, 5, 10, 6, 2, 62, 68, 5, 16, 9, 2, 63, 68, 5, 20, 11, 2, 64, 68, 5, 24, 13, 2, 65, 68, 5, 18, 10, 2, 66, 68, 5, 26, 14, 2, 67, 60, 3, 2, 2, 2, 67, 61, 3, 2, 2, 2, 67, 62, 3, 2, 2, 2, 67, 63, 3, 2, 2, 2, 67, 64, 3, 2, 2, 2, 67, 65, 3, 2, 2, 2, 67, 66, 3, 2, 2, 2, 68, 9, 3, 2, 2, 2, 69, 72, 5, 12, 7, 2, 70, 72, 5, 14, 8, 2, 71, 69, 3, 2, 2, 2, 71, 70, 3, 2, 2, 2, 72, 11, 3, 2, 2, 2, 73, 74, 7, 3, 2, 2, 74, 75, 5, 38, 20, 2, 75, 76, 7, 4, 2, 2, 76, 77, 5, 6, 4, 2, 77, 78, 7, 5, 2, 2, 78, 13, 3, 2, 2, 2, 79, 80, 7, 3, 2, 2, 80, 81, 5, 38, 20, 2, 81, 82, 7, 4, 2, 2, 82, 83, 5, 6, 4, 2, 83, 84, 7, 5, 2, 2, 84, 85, 7, 6, 2, 2, 85, 86, 7, 4, 2, 2, 86, 87, 5, 6, 4, 2, 87, 88, 7, 5, 2, 2, 88, 15, 3, 2, 2, 2, 89, 90, 7, 7, 2, 2, 90, 91, 5, 44, 23, 2, 91, 92, 7, 4, 2, 2, 92, 93, 5, 6, 4, 2, 93, 94, 7, 5, 2, 2, 94, 17, 3, 2, 2, 2, 95, 96, 7, 8, 2, 2, 96, 97, 7, 9, 2, 2, 97, 98, 5, 36, 19, 2, 98, 99, 7, 10, 2, 2, 99, 100, 5, 36, 19, 2, 100, 101, 7, 11, 2, 2, 101, 19, 3, 2, 2, 2, 102, 103, 5, 22, 12, 2, 103, 104, 5, 36, 19, 2, 104, 21, 3, 2, 2, 2, 105, 106, 9, 2, 2, 2, 106, 23, 3, 2, 2, 2, 107, 108, 9, 3, 2, 2, 108, 25, 3, 2, 2, 2, 109, 110, 7, 18, 2, 2, 110, 27, 3, 2, 2, 2, 111, 112, 7, 35, 2, 2, 112, 113, 7, 19, 2, 2, 113, 114, 5, 36, 19, 2, 114, 29, 3, 2, 2, 2, 115, 116, 9, 4, 2, 2, 116, 31, 3, 2, 2, 2, 117, 118, 9, 5, 2, 2, 118, 33, 3, 2, 2, 2, 119, 120, 7, 21, 2, 2, 120, 35, 3, 2, 2, 2, 121, 122, 8, 19, 1, 2, 122, 123, 5, 34, 18, 2, 123, 124, 5, 36, 19, 8, 124, 134, 3, 2, 2, 2, 125, 126, 7, 9, 2, 2, 126, 127, 5, 36, 19, 2, 127, 128, 7, 11, 2, 2, 128, 134, 3, 2, 2, 2, 129, 134, 5, 44, 23, 2, 130, 131, 7, 35, 2, 2, 131, 132, 7, 19, 2, 2, 132, 134, 5, 36, 19, 3, 133, 121, 3, 2, 2, 2, 133, 125, 3, 2, 2, 2, 133, 129, 3, 2, 2, 2, 133, 130, 3, 2, 2, 2, 134, 145, 3, 2, 2, 2, 135, 136, 12, 7, 2, 2, 136, 137, 5, 30, 16, 2, 137, 138, 5, 36, 19, 8, 138, 144, 3, 2, 2, 2, 139, 140, 12, 6, 2, 2, 140, 141, 5, 32, 17, 2, 141, 142, 5, 36, 19, 7, 142, 144, 3, 2, 2, 2, 143, 135, 3, 2, 2, 2, 143, 139, 3, 2, 2, 2, 144, 147, 3, 2, 2, 2, 145, 143, 3, 2, 2, 2, 145, 146, 3, 2, 2, 2, 146, 37, 3, 2, 2, 2, 147, 145, 3, 2, 2, 2, 148, 149, 8, 20, 1, 2, 149, 150, 7, 33, 2, 2, 150, 161, 5, 38, 20, 7, 151, 152, 5, 36, 19, 2, 152, 153, 5, 40, 21, 2, 153, 154, 5, 36, 19, 2, 154, 161, 3, 2, 2, 2, 155, 161, 7, 24, 2, 2, 156, 157, 7, 9, 2, 2, 157, 158, 5, 38, 20, 2, 158, 159, 7, 11, 2, 2, 159, 161, 3, 2, 2, 2, 160, 148, 3, 2, 2, 2, 160, 151, 3, 2, 2, 2, 160, 155, 3, 2, 2, 2, 160, 156, 3, 2, 2, 2, 161, 168, 3, 2, 2, 2, 162, 163, 12, 5, 2, 2, 163, 164, 5, 42, 22, 2, 164, 165, 5, 38, 20, 6, 165, 167, 3, 2, 2, 2, 166, 162, 3, 2, 2, 2, 167, 170, 3, 2, 2, 2, 168, 166, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 39, 3, 2, 2, 2, 170, 168, 3, 2, 2, 2, 171, 172, 9, 6, 2, 2, 172, 41, 3, 2, 2, 2, 173, 174, 9, 7, 2, 2, 174, 43, 3, 2, 2, 2, 175, 176, 9, 8, 2, 2, 176, 45, 3, 2, 2, 2, 11, 52, 58, 67, 71, 133, 143, 145, 160, 168] \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.tokens b/ChironCore/turtparse/tlang.tokens index 78f9526..d50aa03 100644 --- a/ChironCore/turtparse/tlang.tokens +++ b/ChironCore/turtparse/tlang.tokens @@ -42,14 +42,14 @@ Whitespace=35 '('=7 ','=8 ')'=9 -'='=10 -'forward'=11 -'backward'=12 -'left'=13 -'right'=14 -'penup'=15 -'pendown'=16 -'pause'=17 +'forward'=10 +'backward'=11 +'left'=12 +'right'=13 +'penup'=14 +'pendown'=15 +'pause'=16 +'='=17 '+'=18 '-'=19 '*'=20 diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index 106eae4..296e2ab 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -9,7 +9,6 @@ null '(' ',' ')' -'=' 'forward' 'backward' 'left' @@ -17,6 +16,7 @@ null 'penup' 'pendown' 'pause' +'=' '+' '-' '*' @@ -119,4 +119,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 37, 219, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 6, 33, 196, 10, 33, 13, 33, 14, 33, 197, 3, 34, 3, 34, 3, 34, 7, 34, 203, 10, 34, 12, 34, 14, 34, 206, 11, 34, 3, 35, 6, 35, 209, 10, 35, 13, 35, 14, 35, 210, 3, 36, 6, 36, 214, 10, 36, 13, 36, 14, 36, 215, 3, 36, 3, 36, 2, 2, 37, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 222, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 3, 73, 3, 2, 2, 2, 5, 76, 3, 2, 2, 2, 7, 78, 3, 2, 2, 2, 9, 80, 3, 2, 2, 2, 11, 85, 3, 2, 2, 2, 13, 92, 3, 2, 2, 2, 15, 97, 3, 2, 2, 2, 17, 99, 3, 2, 2, 2, 19, 101, 3, 2, 2, 2, 21, 103, 3, 2, 2, 2, 23, 105, 3, 2, 2, 2, 25, 113, 3, 2, 2, 2, 27, 122, 3, 2, 2, 2, 29, 127, 3, 2, 2, 2, 31, 133, 3, 2, 2, 2, 33, 139, 3, 2, 2, 2, 35, 147, 3, 2, 2, 2, 37, 153, 3, 2, 2, 2, 39, 155, 3, 2, 2, 2, 41, 157, 3, 2, 2, 2, 43, 159, 3, 2, 2, 2, 45, 161, 3, 2, 2, 2, 47, 170, 3, 2, 2, 2, 49, 172, 3, 2, 2, 2, 51, 174, 3, 2, 2, 2, 53, 177, 3, 2, 2, 2, 55, 180, 3, 2, 2, 2, 57, 183, 3, 2, 2, 2, 59, 186, 3, 2, 2, 2, 61, 189, 3, 2, 2, 2, 63, 192, 3, 2, 2, 2, 65, 195, 3, 2, 2, 2, 67, 199, 3, 2, 2, 2, 69, 208, 3, 2, 2, 2, 71, 213, 3, 2, 2, 2, 73, 74, 7, 107, 2, 2, 74, 75, 7, 104, 2, 2, 75, 4, 3, 2, 2, 2, 76, 77, 7, 93, 2, 2, 77, 6, 3, 2, 2, 2, 78, 79, 7, 95, 2, 2, 79, 8, 3, 2, 2, 2, 80, 81, 7, 103, 2, 2, 81, 82, 7, 110, 2, 2, 82, 83, 7, 117, 2, 2, 83, 84, 7, 103, 2, 2, 84, 10, 3, 2, 2, 2, 85, 86, 7, 116, 2, 2, 86, 87, 7, 103, 2, 2, 87, 88, 7, 114, 2, 2, 88, 89, 7, 103, 2, 2, 89, 90, 7, 99, 2, 2, 90, 91, 7, 118, 2, 2, 91, 12, 3, 2, 2, 2, 92, 93, 7, 105, 2, 2, 93, 94, 7, 113, 2, 2, 94, 95, 7, 118, 2, 2, 95, 96, 7, 113, 2, 2, 96, 14, 3, 2, 2, 2, 97, 98, 7, 42, 2, 2, 98, 16, 3, 2, 2, 2, 99, 100, 7, 46, 2, 2, 100, 18, 3, 2, 2, 2, 101, 102, 7, 43, 2, 2, 102, 20, 3, 2, 2, 2, 103, 104, 7, 63, 2, 2, 104, 22, 3, 2, 2, 2, 105, 106, 7, 104, 2, 2, 106, 107, 7, 113, 2, 2, 107, 108, 7, 116, 2, 2, 108, 109, 7, 121, 2, 2, 109, 110, 7, 99, 2, 2, 110, 111, 7, 116, 2, 2, 111, 112, 7, 102, 2, 2, 112, 24, 3, 2, 2, 2, 113, 114, 7, 100, 2, 2, 114, 115, 7, 99, 2, 2, 115, 116, 7, 101, 2, 2, 116, 117, 7, 109, 2, 2, 117, 118, 7, 121, 2, 2, 118, 119, 7, 99, 2, 2, 119, 120, 7, 116, 2, 2, 120, 121, 7, 102, 2, 2, 121, 26, 3, 2, 2, 2, 122, 123, 7, 110, 2, 2, 123, 124, 7, 103, 2, 2, 124, 125, 7, 104, 2, 2, 125, 126, 7, 118, 2, 2, 126, 28, 3, 2, 2, 2, 127, 128, 7, 116, 2, 2, 128, 129, 7, 107, 2, 2, 129, 130, 7, 105, 2, 2, 130, 131, 7, 106, 2, 2, 131, 132, 7, 118, 2, 2, 132, 30, 3, 2, 2, 2, 133, 134, 7, 114, 2, 2, 134, 135, 7, 103, 2, 2, 135, 136, 7, 112, 2, 2, 136, 137, 7, 119, 2, 2, 137, 138, 7, 114, 2, 2, 138, 32, 3, 2, 2, 2, 139, 140, 7, 114, 2, 2, 140, 141, 7, 103, 2, 2, 141, 142, 7, 112, 2, 2, 142, 143, 7, 102, 2, 2, 143, 144, 7, 113, 2, 2, 144, 145, 7, 121, 2, 2, 145, 146, 7, 112, 2, 2, 146, 34, 3, 2, 2, 2, 147, 148, 7, 114, 2, 2, 148, 149, 7, 99, 2, 2, 149, 150, 7, 119, 2, 2, 150, 151, 7, 117, 2, 2, 151, 152, 7, 103, 2, 2, 152, 36, 3, 2, 2, 2, 153, 154, 7, 45, 2, 2, 154, 38, 3, 2, 2, 2, 155, 156, 7, 47, 2, 2, 156, 40, 3, 2, 2, 2, 157, 158, 7, 44, 2, 2, 158, 42, 3, 2, 2, 2, 159, 160, 7, 49, 2, 2, 160, 44, 3, 2, 2, 2, 161, 162, 7, 114, 2, 2, 162, 163, 7, 103, 2, 2, 163, 164, 7, 112, 2, 2, 164, 165, 7, 102, 2, 2, 165, 166, 7, 113, 2, 2, 166, 167, 7, 121, 2, 2, 167, 168, 7, 112, 2, 2, 168, 169, 7, 65, 2, 2, 169, 46, 3, 2, 2, 2, 170, 171, 7, 62, 2, 2, 171, 48, 3, 2, 2, 2, 172, 173, 7, 64, 2, 2, 173, 50, 3, 2, 2, 2, 174, 175, 7, 63, 2, 2, 175, 176, 7, 63, 2, 2, 176, 52, 3, 2, 2, 2, 177, 178, 7, 35, 2, 2, 178, 179, 7, 63, 2, 2, 179, 54, 3, 2, 2, 2, 180, 181, 7, 62, 2, 2, 181, 182, 7, 63, 2, 2, 182, 56, 3, 2, 2, 2, 183, 184, 7, 64, 2, 2, 184, 185, 7, 63, 2, 2, 185, 58, 3, 2, 2, 2, 186, 187, 7, 40, 2, 2, 187, 188, 7, 40, 2, 2, 188, 60, 3, 2, 2, 2, 189, 190, 7, 126, 2, 2, 190, 191, 7, 126, 2, 2, 191, 62, 3, 2, 2, 2, 192, 193, 7, 35, 2, 2, 193, 64, 3, 2, 2, 2, 194, 196, 9, 2, 2, 2, 195, 194, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 195, 3, 2, 2, 2, 197, 198, 3, 2, 2, 2, 198, 66, 3, 2, 2, 2, 199, 200, 7, 60, 2, 2, 200, 204, 9, 3, 2, 2, 201, 203, 9, 4, 2, 2, 202, 201, 3, 2, 2, 2, 203, 206, 3, 2, 2, 2, 204, 202, 3, 2, 2, 2, 204, 205, 3, 2, 2, 2, 205, 68, 3, 2, 2, 2, 206, 204, 3, 2, 2, 2, 207, 209, 9, 5, 2, 2, 208, 207, 3, 2, 2, 2, 209, 210, 3, 2, 2, 2, 210, 208, 3, 2, 2, 2, 210, 211, 3, 2, 2, 2, 211, 70, 3, 2, 2, 2, 212, 214, 9, 6, 2, 2, 213, 212, 3, 2, 2, 2, 214, 215, 3, 2, 2, 2, 215, 213, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 218, 8, 36, 2, 2, 218, 72, 3, 2, 2, 2, 7, 2, 197, 204, 210, 215, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 37, 219, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 6, 33, 196, 10, 33, 13, 33, 14, 33, 197, 3, 34, 3, 34, 3, 34, 7, 34, 203, 10, 34, 12, 34, 14, 34, 206, 11, 34, 3, 35, 6, 35, 209, 10, 35, 13, 35, 14, 35, 210, 3, 36, 6, 36, 214, 10, 36, 13, 36, 14, 36, 215, 3, 36, 3, 36, 2, 2, 37, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 222, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 3, 73, 3, 2, 2, 2, 5, 76, 3, 2, 2, 2, 7, 78, 3, 2, 2, 2, 9, 80, 3, 2, 2, 2, 11, 85, 3, 2, 2, 2, 13, 92, 3, 2, 2, 2, 15, 97, 3, 2, 2, 2, 17, 99, 3, 2, 2, 2, 19, 101, 3, 2, 2, 2, 21, 103, 3, 2, 2, 2, 23, 111, 3, 2, 2, 2, 25, 120, 3, 2, 2, 2, 27, 125, 3, 2, 2, 2, 29, 131, 3, 2, 2, 2, 31, 137, 3, 2, 2, 2, 33, 145, 3, 2, 2, 2, 35, 151, 3, 2, 2, 2, 37, 153, 3, 2, 2, 2, 39, 155, 3, 2, 2, 2, 41, 157, 3, 2, 2, 2, 43, 159, 3, 2, 2, 2, 45, 161, 3, 2, 2, 2, 47, 170, 3, 2, 2, 2, 49, 172, 3, 2, 2, 2, 51, 174, 3, 2, 2, 2, 53, 177, 3, 2, 2, 2, 55, 180, 3, 2, 2, 2, 57, 183, 3, 2, 2, 2, 59, 186, 3, 2, 2, 2, 61, 189, 3, 2, 2, 2, 63, 192, 3, 2, 2, 2, 65, 195, 3, 2, 2, 2, 67, 199, 3, 2, 2, 2, 69, 208, 3, 2, 2, 2, 71, 213, 3, 2, 2, 2, 73, 74, 7, 107, 2, 2, 74, 75, 7, 104, 2, 2, 75, 4, 3, 2, 2, 2, 76, 77, 7, 93, 2, 2, 77, 6, 3, 2, 2, 2, 78, 79, 7, 95, 2, 2, 79, 8, 3, 2, 2, 2, 80, 81, 7, 103, 2, 2, 81, 82, 7, 110, 2, 2, 82, 83, 7, 117, 2, 2, 83, 84, 7, 103, 2, 2, 84, 10, 3, 2, 2, 2, 85, 86, 7, 116, 2, 2, 86, 87, 7, 103, 2, 2, 87, 88, 7, 114, 2, 2, 88, 89, 7, 103, 2, 2, 89, 90, 7, 99, 2, 2, 90, 91, 7, 118, 2, 2, 91, 12, 3, 2, 2, 2, 92, 93, 7, 105, 2, 2, 93, 94, 7, 113, 2, 2, 94, 95, 7, 118, 2, 2, 95, 96, 7, 113, 2, 2, 96, 14, 3, 2, 2, 2, 97, 98, 7, 42, 2, 2, 98, 16, 3, 2, 2, 2, 99, 100, 7, 46, 2, 2, 100, 18, 3, 2, 2, 2, 101, 102, 7, 43, 2, 2, 102, 20, 3, 2, 2, 2, 103, 104, 7, 104, 2, 2, 104, 105, 7, 113, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 121, 2, 2, 107, 108, 7, 99, 2, 2, 108, 109, 7, 116, 2, 2, 109, 110, 7, 102, 2, 2, 110, 22, 3, 2, 2, 2, 111, 112, 7, 100, 2, 2, 112, 113, 7, 99, 2, 2, 113, 114, 7, 101, 2, 2, 114, 115, 7, 109, 2, 2, 115, 116, 7, 121, 2, 2, 116, 117, 7, 99, 2, 2, 117, 118, 7, 116, 2, 2, 118, 119, 7, 102, 2, 2, 119, 24, 3, 2, 2, 2, 120, 121, 7, 110, 2, 2, 121, 122, 7, 103, 2, 2, 122, 123, 7, 104, 2, 2, 123, 124, 7, 118, 2, 2, 124, 26, 3, 2, 2, 2, 125, 126, 7, 116, 2, 2, 126, 127, 7, 107, 2, 2, 127, 128, 7, 105, 2, 2, 128, 129, 7, 106, 2, 2, 129, 130, 7, 118, 2, 2, 130, 28, 3, 2, 2, 2, 131, 132, 7, 114, 2, 2, 132, 133, 7, 103, 2, 2, 133, 134, 7, 112, 2, 2, 134, 135, 7, 119, 2, 2, 135, 136, 7, 114, 2, 2, 136, 30, 3, 2, 2, 2, 137, 138, 7, 114, 2, 2, 138, 139, 7, 103, 2, 2, 139, 140, 7, 112, 2, 2, 140, 141, 7, 102, 2, 2, 141, 142, 7, 113, 2, 2, 142, 143, 7, 121, 2, 2, 143, 144, 7, 112, 2, 2, 144, 32, 3, 2, 2, 2, 145, 146, 7, 114, 2, 2, 146, 147, 7, 99, 2, 2, 147, 148, 7, 119, 2, 2, 148, 149, 7, 117, 2, 2, 149, 150, 7, 103, 2, 2, 150, 34, 3, 2, 2, 2, 151, 152, 7, 63, 2, 2, 152, 36, 3, 2, 2, 2, 153, 154, 7, 45, 2, 2, 154, 38, 3, 2, 2, 2, 155, 156, 7, 47, 2, 2, 156, 40, 3, 2, 2, 2, 157, 158, 7, 44, 2, 2, 158, 42, 3, 2, 2, 2, 159, 160, 7, 49, 2, 2, 160, 44, 3, 2, 2, 2, 161, 162, 7, 114, 2, 2, 162, 163, 7, 103, 2, 2, 163, 164, 7, 112, 2, 2, 164, 165, 7, 102, 2, 2, 165, 166, 7, 113, 2, 2, 166, 167, 7, 121, 2, 2, 167, 168, 7, 112, 2, 2, 168, 169, 7, 65, 2, 2, 169, 46, 3, 2, 2, 2, 170, 171, 7, 62, 2, 2, 171, 48, 3, 2, 2, 2, 172, 173, 7, 64, 2, 2, 173, 50, 3, 2, 2, 2, 174, 175, 7, 63, 2, 2, 175, 176, 7, 63, 2, 2, 176, 52, 3, 2, 2, 2, 177, 178, 7, 35, 2, 2, 178, 179, 7, 63, 2, 2, 179, 54, 3, 2, 2, 2, 180, 181, 7, 62, 2, 2, 181, 182, 7, 63, 2, 2, 182, 56, 3, 2, 2, 2, 183, 184, 7, 64, 2, 2, 184, 185, 7, 63, 2, 2, 185, 58, 3, 2, 2, 2, 186, 187, 7, 40, 2, 2, 187, 188, 7, 40, 2, 2, 188, 60, 3, 2, 2, 2, 189, 190, 7, 126, 2, 2, 190, 191, 7, 126, 2, 2, 191, 62, 3, 2, 2, 2, 192, 193, 7, 35, 2, 2, 193, 64, 3, 2, 2, 2, 194, 196, 9, 2, 2, 2, 195, 194, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 195, 3, 2, 2, 2, 197, 198, 3, 2, 2, 2, 198, 66, 3, 2, 2, 2, 199, 200, 7, 60, 2, 2, 200, 204, 9, 3, 2, 2, 201, 203, 9, 4, 2, 2, 202, 201, 3, 2, 2, 2, 203, 206, 3, 2, 2, 2, 204, 202, 3, 2, 2, 2, 204, 205, 3, 2, 2, 2, 205, 68, 3, 2, 2, 2, 206, 204, 3, 2, 2, 2, 207, 209, 9, 5, 2, 2, 208, 207, 3, 2, 2, 2, 209, 210, 3, 2, 2, 2, 210, 208, 3, 2, 2, 2, 210, 211, 3, 2, 2, 2, 211, 70, 3, 2, 2, 2, 212, 214, 9, 6, 2, 2, 213, 212, 3, 2, 2, 2, 214, 215, 3, 2, 2, 2, 215, 213, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 218, 8, 36, 2, 2, 218, 72, 3, 2, 2, 2, 7, 2, 197, 204, 210, 215, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index fc951de..82979e7 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -5,6 +5,7 @@ import sys + def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2%") @@ -16,15 +17,15 @@ def serializedATN(): buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\3\2\3") buf.write("\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6") buf.write("\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\t\3\t\3") - buf.write("\n\3\n\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3") - buf.write("\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16") - buf.write("\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20") - buf.write("\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22") - buf.write("\3\22\3\22\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\26") - buf.write("\3\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\30") - buf.write("\3\30\3\31\3\31\3\32\3\32\3\32\3\33\3\33\3\33\3\34\3\34") - buf.write("\3\34\3\35\3\35\3\35\3\36\3\36\3\36\3\37\3\37\3\37\3 ") - buf.write("\3 \3!\6!\u00c4\n!\r!\16!\u00c5\3\"\3\"\3\"\7\"\u00cb") + buf.write("\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f") + buf.write("\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\16") + buf.write("\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17") + buf.write("\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21") + buf.write("\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25") + buf.write("\3\26\3\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27") + buf.write("\3\30\3\30\3\31\3\31\3\32\3\32\3\32\3\33\3\33\3\33\3\34") + buf.write("\3\34\3\34\3\35\3\35\3\35\3\36\3\36\3\36\3\37\3\37\3\37") + buf.write("\3 \3 \3!\6!\u00c4\n!\r!\16!\u00c5\3\"\3\"\3\"\7\"\u00cb") buf.write("\n\"\f\"\16\"\u00ce\13\"\3#\6#\u00d1\n#\r#\16#\u00d2\3") buf.write("$\6$\u00d6\n$\r$\16$\u00d7\3$\3$\2\2%\3\3\5\4\7\5\t\6") buf.write("\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20") @@ -41,32 +42,32 @@ def serializedATN(): buf.write("A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\3I\3\2\2\2") buf.write("\5L\3\2\2\2\7N\3\2\2\2\tP\3\2\2\2\13U\3\2\2\2\r\\\3\2") buf.write("\2\2\17a\3\2\2\2\21c\3\2\2\2\23e\3\2\2\2\25g\3\2\2\2\27") - buf.write("i\3\2\2\2\31q\3\2\2\2\33z\3\2\2\2\35\177\3\2\2\2\37\u0085") - buf.write("\3\2\2\2!\u008b\3\2\2\2#\u0093\3\2\2\2%\u0099\3\2\2\2") - buf.write("\'\u009b\3\2\2\2)\u009d\3\2\2\2+\u009f\3\2\2\2-\u00a1") - buf.write("\3\2\2\2/\u00aa\3\2\2\2\61\u00ac\3\2\2\2\63\u00ae\3\2") - buf.write("\2\2\65\u00b1\3\2\2\2\67\u00b4\3\2\2\29\u00b7\3\2\2\2") - buf.write(";\u00ba\3\2\2\2=\u00bd\3\2\2\2?\u00c0\3\2\2\2A\u00c3\3") - buf.write("\2\2\2C\u00c7\3\2\2\2E\u00d0\3\2\2\2G\u00d5\3\2\2\2IJ") - buf.write("\7k\2\2JK\7h\2\2K\4\3\2\2\2LM\7]\2\2M\6\3\2\2\2NO\7_\2") - buf.write("\2O\b\3\2\2\2PQ\7g\2\2QR\7n\2\2RS\7u\2\2ST\7g\2\2T\n\3") - buf.write("\2\2\2UV\7t\2\2VW\7g\2\2WX\7r\2\2XY\7g\2\2YZ\7c\2\2Z[") - buf.write("\7v\2\2[\f\3\2\2\2\\]\7i\2\2]^\7q\2\2^_\7v\2\2_`\7q\2") - buf.write("\2`\16\3\2\2\2ab\7*\2\2b\20\3\2\2\2cd\7.\2\2d\22\3\2\2") - buf.write("\2ef\7+\2\2f\24\3\2\2\2gh\7?\2\2h\26\3\2\2\2ij\7h\2\2") - buf.write("jk\7q\2\2kl\7t\2\2lm\7y\2\2mn\7c\2\2no\7t\2\2op\7f\2\2") - buf.write("p\30\3\2\2\2qr\7d\2\2rs\7c\2\2st\7e\2\2tu\7m\2\2uv\7y") - buf.write("\2\2vw\7c\2\2wx\7t\2\2xy\7f\2\2y\32\3\2\2\2z{\7n\2\2{") - buf.write("|\7g\2\2|}\7h\2\2}~\7v\2\2~\34\3\2\2\2\177\u0080\7t\2") - buf.write("\2\u0080\u0081\7k\2\2\u0081\u0082\7i\2\2\u0082\u0083\7") - buf.write("j\2\2\u0083\u0084\7v\2\2\u0084\36\3\2\2\2\u0085\u0086") - buf.write("\7r\2\2\u0086\u0087\7g\2\2\u0087\u0088\7p\2\2\u0088\u0089") - buf.write("\7w\2\2\u0089\u008a\7r\2\2\u008a \3\2\2\2\u008b\u008c") - buf.write("\7r\2\2\u008c\u008d\7g\2\2\u008d\u008e\7p\2\2\u008e\u008f") - buf.write("\7f\2\2\u008f\u0090\7q\2\2\u0090\u0091\7y\2\2\u0091\u0092") - buf.write("\7p\2\2\u0092\"\3\2\2\2\u0093\u0094\7r\2\2\u0094\u0095") - buf.write("\7c\2\2\u0095\u0096\7w\2\2\u0096\u0097\7u\2\2\u0097\u0098") - buf.write("\7g\2\2\u0098$\3\2\2\2\u0099\u009a\7-\2\2\u009a&\3\2\2") + buf.write("o\3\2\2\2\31x\3\2\2\2\33}\3\2\2\2\35\u0083\3\2\2\2\37") + buf.write("\u0089\3\2\2\2!\u0091\3\2\2\2#\u0097\3\2\2\2%\u0099\3") + buf.write("\2\2\2\'\u009b\3\2\2\2)\u009d\3\2\2\2+\u009f\3\2\2\2-") + buf.write("\u00a1\3\2\2\2/\u00aa\3\2\2\2\61\u00ac\3\2\2\2\63\u00ae") + buf.write("\3\2\2\2\65\u00b1\3\2\2\2\67\u00b4\3\2\2\29\u00b7\3\2") + buf.write("\2\2;\u00ba\3\2\2\2=\u00bd\3\2\2\2?\u00c0\3\2\2\2A\u00c3") + buf.write("\3\2\2\2C\u00c7\3\2\2\2E\u00d0\3\2\2\2G\u00d5\3\2\2\2") + buf.write("IJ\7k\2\2JK\7h\2\2K\4\3\2\2\2LM\7]\2\2M\6\3\2\2\2NO\7") + buf.write("_\2\2O\b\3\2\2\2PQ\7g\2\2QR\7n\2\2RS\7u\2\2ST\7g\2\2T") + buf.write("\n\3\2\2\2UV\7t\2\2VW\7g\2\2WX\7r\2\2XY\7g\2\2YZ\7c\2") + buf.write("\2Z[\7v\2\2[\f\3\2\2\2\\]\7i\2\2]^\7q\2\2^_\7v\2\2_`\7") + buf.write("q\2\2`\16\3\2\2\2ab\7*\2\2b\20\3\2\2\2cd\7.\2\2d\22\3") + buf.write("\2\2\2ef\7+\2\2f\24\3\2\2\2gh\7h\2\2hi\7q\2\2ij\7t\2\2") + buf.write("jk\7y\2\2kl\7c\2\2lm\7t\2\2mn\7f\2\2n\26\3\2\2\2op\7d") + buf.write("\2\2pq\7c\2\2qr\7e\2\2rs\7m\2\2st\7y\2\2tu\7c\2\2uv\7") + buf.write("t\2\2vw\7f\2\2w\30\3\2\2\2xy\7n\2\2yz\7g\2\2z{\7h\2\2") + buf.write("{|\7v\2\2|\32\3\2\2\2}~\7t\2\2~\177\7k\2\2\177\u0080\7") + buf.write("i\2\2\u0080\u0081\7j\2\2\u0081\u0082\7v\2\2\u0082\34\3") + buf.write("\2\2\2\u0083\u0084\7r\2\2\u0084\u0085\7g\2\2\u0085\u0086") + buf.write("\7p\2\2\u0086\u0087\7w\2\2\u0087\u0088\7r\2\2\u0088\36") + buf.write("\3\2\2\2\u0089\u008a\7r\2\2\u008a\u008b\7g\2\2\u008b\u008c") + buf.write("\7p\2\2\u008c\u008d\7f\2\2\u008d\u008e\7q\2\2\u008e\u008f") + buf.write("\7y\2\2\u008f\u0090\7p\2\2\u0090 \3\2\2\2\u0091\u0092") + buf.write("\7r\2\2\u0092\u0093\7c\2\2\u0093\u0094\7w\2\2\u0094\u0095") + buf.write("\7u\2\2\u0095\u0096\7g\2\2\u0096\"\3\2\2\2\u0097\u0098") + buf.write("\7?\2\2\u0098$\3\2\2\2\u0099\u009a\7-\2\2\u009a&\3\2\2") buf.write("\2\u009b\u009c\7/\2\2\u009c(\3\2\2\2\u009d\u009e\7,\2") buf.write("\2\u009e*\3\2\2\2\u009f\u00a0\7\61\2\2\u00a0,\3\2\2\2") buf.write("\u00a1\u00a2\7r\2\2\u00a2\u00a3\7g\2\2\u00a3\u00a4\7p") @@ -143,9 +144,9 @@ class tlangLexer(Lexer): literalNames = [ "", "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", - "','", "')'", "'='", "'forward'", "'backward'", "'left'", "'right'", - "'penup'", "'pendown'", "'pause'", "'+'", "'-'", "'*'", "'/'", - "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", "'>='", + "','", "')'", "'forward'", "'backward'", "'left'", "'right'", + "'penup'", "'pendown'", "'pause'", "'='", "'+'", "'-'", "'*'", + "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", diff --git a/ChironCore/turtparse/tlangLexer.tokens b/ChironCore/turtparse/tlangLexer.tokens index 78f9526..d50aa03 100644 --- a/ChironCore/turtparse/tlangLexer.tokens +++ b/ChironCore/turtparse/tlangLexer.tokens @@ -42,14 +42,14 @@ Whitespace=35 '('=7 ','=8 ')'=9 -'='=10 -'forward'=11 -'backward'=12 -'left'=13 -'right'=14 -'penup'=15 -'pendown'=16 -'pause'=17 +'forward'=10 +'backward'=11 +'left'=12 +'right'=13 +'penup'=14 +'pendown'=15 +'pause'=16 +'='=17 '+'=18 '-'=19 '*'=20 diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index b02d4a2..bb006db 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -5,10 +5,11 @@ from typing.io import TextIO import sys + def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3%") - buf.write("\u00af\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\u00b2\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\3\2\3\2\3\2\3") @@ -16,60 +17,62 @@ def serializedATN(): buf.write("\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5D\n\5\3\6\3\6\5\6H\n\6") buf.write("\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3") buf.write("\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n") - buf.write("\3\n\3\n\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\r\3\r\3\16") - buf.write("\3\16\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20") - buf.write("\3\20\5\20}\n\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3") - buf.write("\20\7\20\u0087\n\20\f\20\16\20\u008a\13\20\3\21\3\21\3") - buf.write("\22\3\22\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24") - buf.write("\3\24\3\24\3\24\3\24\3\24\5\24\u009e\n\24\3\24\3\24\3") - buf.write("\24\3\24\7\24\u00a4\n\24\f\24\16\24\u00a7\13\24\3\25\3") - buf.write("\25\3\26\3\26\3\27\3\27\3\27\2\4\36&\30\2\4\6\b\n\f\16") - buf.write("\20\22\24\26\30\32\34\36 \"$&(*,\2\t\3\2\r\20\3\2\21\22") - buf.write("\3\2\26\27\3\2\24\25\3\2\31\36\3\2\37 \3\2\"#\2\u00a9") - buf.write("\2.\3\2\2\2\4\64\3\2\2\2\68\3\2\2\2\bC\3\2\2\2\nG\3\2") - buf.write("\2\2\fI\3\2\2\2\16O\3\2\2\2\20Y\3\2\2\2\22_\3\2\2\2\24") - buf.write("f\3\2\2\2\26j\3\2\2\2\30m\3\2\2\2\32o\3\2\2\2\34q\3\2") - buf.write("\2\2\36|\3\2\2\2 \u008b\3\2\2\2\"\u008d\3\2\2\2$\u008f") - buf.write("\3\2\2\2&\u009d\3\2\2\2(\u00a8\3\2\2\2*\u00aa\3\2\2\2") - buf.write(",\u00ac\3\2\2\2./\5\4\3\2/\60\7\2\2\3\60\3\3\2\2\2\61") + buf.write("\3\n\3\n\3\13\3\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17") + buf.write("\3\17\3\17\3\17\3\20\3\20\3\21\3\21\3\22\3\22\3\23\3\23") + buf.write("\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\5\23") + buf.write("\u0086\n\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\7") + buf.write("\23\u0090\n\23\f\23\16\23\u0093\13\23\3\24\3\24\3\24\3") + buf.write("\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\5\24\u00a1") + buf.write("\n\24\3\24\3\24\3\24\3\24\7\24\u00a7\n\24\f\24\16\24\u00aa") + buf.write("\13\24\3\25\3\25\3\26\3\26\3\27\3\27\3\27\2\4$&\30\2\4") + buf.write("\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,\2\t\3\2\f") + buf.write("\17\3\2\20\21\3\2\26\27\3\2\24\25\3\2\31\36\3\2\37 \3") + buf.write("\2\"#\2\u00ad\2.\3\2\2\2\4\64\3\2\2\2\68\3\2\2\2\bC\3") + buf.write("\2\2\2\nG\3\2\2\2\fI\3\2\2\2\16O\3\2\2\2\20Y\3\2\2\2\22") + buf.write("_\3\2\2\2\24f\3\2\2\2\26i\3\2\2\2\30k\3\2\2\2\32m\3\2") + buf.write("\2\2\34o\3\2\2\2\36s\3\2\2\2 u\3\2\2\2\"w\3\2\2\2$\u0085") + buf.write("\3\2\2\2&\u00a0\3\2\2\2(\u00ab\3\2\2\2*\u00ad\3\2\2\2") + buf.write(",\u00af\3\2\2\2./\5\4\3\2/\60\7\2\2\3\60\3\3\2\2\2\61") buf.write("\63\5\b\5\2\62\61\3\2\2\2\63\66\3\2\2\2\64\62\3\2\2\2") buf.write("\64\65\3\2\2\2\65\5\3\2\2\2\66\64\3\2\2\2\679\5\b\5\2") buf.write("8\67\3\2\2\29:\3\2\2\2:8\3\2\2\2:;\3\2\2\2;\7\3\2\2\2") - buf.write("D\5\20\t\2?D\5\26\f\2@D\5\32\16") - buf.write("\2AD\5\22\n\2BD\5\34\17\2C<\3\2\2\2C=\3\2\2\2C>\3\2\2") + buf.write("D\5\20\t\2?D\5\24\13\2@D\5\30\r") + buf.write("\2AD\5\22\n\2BD\5\32\16\2C<\3\2\2\2C=\3\2\2\2C>\3\2\2") buf.write("\2C?\3\2\2\2C@\3\2\2\2CA\3\2\2\2CB\3\2\2\2D\t\3\2\2\2") buf.write("EH\5\f\7\2FH\5\16\b\2GE\3\2\2\2GF\3\2\2\2H\13\3\2\2\2") buf.write("IJ\7\3\2\2JK\5&\24\2KL\7\4\2\2LM\5\6\4\2MN\7\5\2\2N\r") buf.write("\3\2\2\2OP\7\3\2\2PQ\5&\24\2QR\7\4\2\2RS\5\6\4\2ST\7\5") buf.write("\2\2TU\7\6\2\2UV\7\4\2\2VW\5\6\4\2WX\7\5\2\2X\17\3\2\2") buf.write("\2YZ\7\7\2\2Z[\5,\27\2[\\\7\4\2\2\\]\5\6\4\2]^\7\5\2\2") - buf.write("^\21\3\2\2\2_`\7\b\2\2`a\7\t\2\2ab\5\36\20\2bc\7\n\2\2") - buf.write("cd\5\36\20\2de\7\13\2\2e\23\3\2\2\2fg\7#\2\2gh\7\f\2\2") - buf.write("hi\5\36\20\2i\25\3\2\2\2jk\5\30\r\2kl\5\36\20\2l\27\3") - buf.write("\2\2\2mn\t\2\2\2n\31\3\2\2\2op\t\3\2\2p\33\3\2\2\2qr\7") - buf.write("\23\2\2r\35\3\2\2\2st\b\20\1\2tu\5$\23\2uv\5\36\20\7v") - buf.write("}\3\2\2\2w}\5,\27\2xy\7\t\2\2yz\5\36\20\2z{\7\13\2\2{") - buf.write("}\3\2\2\2|s\3\2\2\2|w\3\2\2\2|x\3\2\2\2}\u0088\3\2\2\2") - buf.write("~\177\f\6\2\2\177\u0080\5 \21\2\u0080\u0081\5\36\20\7") - buf.write("\u0081\u0087\3\2\2\2\u0082\u0083\f\5\2\2\u0083\u0084\5") - buf.write("\"\22\2\u0084\u0085\5\36\20\6\u0085\u0087\3\2\2\2\u0086") - buf.write("~\3\2\2\2\u0086\u0082\3\2\2\2\u0087\u008a\3\2\2\2\u0088") - buf.write("\u0086\3\2\2\2\u0088\u0089\3\2\2\2\u0089\37\3\2\2\2\u008a") - buf.write("\u0088\3\2\2\2\u008b\u008c\t\4\2\2\u008c!\3\2\2\2\u008d") - buf.write("\u008e\t\5\2\2\u008e#\3\2\2\2\u008f\u0090\7\25\2\2\u0090") - buf.write("%\3\2\2\2\u0091\u0092\b\24\1\2\u0092\u0093\7!\2\2\u0093") - buf.write("\u009e\5&\24\7\u0094\u0095\5\36\20\2\u0095\u0096\5(\25") - buf.write("\2\u0096\u0097\5\36\20\2\u0097\u009e\3\2\2\2\u0098\u009e") - buf.write("\7\30\2\2\u0099\u009a\7\t\2\2\u009a\u009b\5&\24\2\u009b") - buf.write("\u009c\7\13\2\2\u009c\u009e\3\2\2\2\u009d\u0091\3\2\2") - buf.write("\2\u009d\u0094\3\2\2\2\u009d\u0098\3\2\2\2\u009d\u0099") - buf.write("\3\2\2\2\u009e\u00a5\3\2\2\2\u009f\u00a0\f\5\2\2\u00a0") - buf.write("\u00a1\5*\26\2\u00a1\u00a2\5&\24\6\u00a2\u00a4\3\2\2\2") - buf.write("\u00a3\u009f\3\2\2\2\u00a4\u00a7\3\2\2\2\u00a5\u00a3\3") - buf.write("\2\2\2\u00a5\u00a6\3\2\2\2\u00a6\'\3\2\2\2\u00a7\u00a5") - buf.write("\3\2\2\2\u00a8\u00a9\t\6\2\2\u00a9)\3\2\2\2\u00aa\u00ab") - buf.write("\t\7\2\2\u00ab+\3\2\2\2\u00ac\u00ad\t\b\2\2\u00ad-\3\2") - buf.write("\2\2\13\64:CG|\u0086\u0088\u009d\u00a5") + buf.write("^\21\3\2\2\2_`\7\b\2\2`a\7\t\2\2ab\5$\23\2bc\7\n\2\2c") + buf.write("d\5$\23\2de\7\13\2\2e\23\3\2\2\2fg\5\26\f\2gh\5$\23\2") + buf.write("h\25\3\2\2\2ij\t\2\2\2j\27\3\2\2\2kl\t\3\2\2l\31\3\2\2") + buf.write("\2mn\7\22\2\2n\33\3\2\2\2op\7#\2\2pq\7\23\2\2qr\5$\23") + buf.write("\2r\35\3\2\2\2st\t\4\2\2t\37\3\2\2\2uv\t\5\2\2v!\3\2\2") + buf.write("\2wx\7\25\2\2x#\3\2\2\2yz\b\23\1\2z{\5\"\22\2{|\5$\23") + buf.write("\b|\u0086\3\2\2\2}~\7\t\2\2~\177\5$\23\2\177\u0080\7\13") + buf.write("\2\2\u0080\u0086\3\2\2\2\u0081\u0086\5,\27\2\u0082\u0083") + buf.write("\7#\2\2\u0083\u0084\7\23\2\2\u0084\u0086\5$\23\3\u0085") + buf.write("y\3\2\2\2\u0085}\3\2\2\2\u0085\u0081\3\2\2\2\u0085\u0082") + buf.write("\3\2\2\2\u0086\u0091\3\2\2\2\u0087\u0088\f\7\2\2\u0088") + buf.write("\u0089\5\36\20\2\u0089\u008a\5$\23\b\u008a\u0090\3\2\2") + buf.write("\2\u008b\u008c\f\6\2\2\u008c\u008d\5 \21\2\u008d\u008e") + buf.write("\5$\23\7\u008e\u0090\3\2\2\2\u008f\u0087\3\2\2\2\u008f") + buf.write("\u008b\3\2\2\2\u0090\u0093\3\2\2\2\u0091\u008f\3\2\2\2") + buf.write("\u0091\u0092\3\2\2\2\u0092%\3\2\2\2\u0093\u0091\3\2\2") + buf.write("\2\u0094\u0095\b\24\1\2\u0095\u0096\7!\2\2\u0096\u00a1") + buf.write("\5&\24\7\u0097\u0098\5$\23\2\u0098\u0099\5(\25\2\u0099") + buf.write("\u009a\5$\23\2\u009a\u00a1\3\2\2\2\u009b\u00a1\7\30\2") + buf.write("\2\u009c\u009d\7\t\2\2\u009d\u009e\5&\24\2\u009e\u009f") + buf.write("\7\13\2\2\u009f\u00a1\3\2\2\2\u00a0\u0094\3\2\2\2\u00a0") + buf.write("\u0097\3\2\2\2\u00a0\u009b\3\2\2\2\u00a0\u009c\3\2\2\2") + buf.write("\u00a1\u00a8\3\2\2\2\u00a2\u00a3\f\5\2\2\u00a3\u00a4\5") + buf.write("*\26\2\u00a4\u00a5\5&\24\6\u00a5\u00a7\3\2\2\2\u00a6\u00a2") + buf.write("\3\2\2\2\u00a7\u00aa\3\2\2\2\u00a8\u00a6\3\2\2\2\u00a8") + buf.write("\u00a9\3\2\2\2\u00a9\'\3\2\2\2\u00aa\u00a8\3\2\2\2\u00ab") + buf.write("\u00ac\t\6\2\2\u00ac)\3\2\2\2\u00ad\u00ae\t\7\2\2\u00ae") + buf.write("+\3\2\2\2\u00af\u00b0\t\b\2\2\u00b0-\3\2\2\2\13\64:CG") + buf.write("\u0085\u008f\u0091\u00a0\u00a8") return buf.getvalue() @@ -84,11 +87,11 @@ class tlangParser ( Parser ): sharedContextCache = PredictionContextCache() literalNames = [ "", "'if'", "'['", "']'", "'else'", "'repeat'", - "'goto'", "'('", "','", "')'", "'='", "'forward'", - "'backward'", "'left'", "'right'", "'penup'", "'pendown'", - "'pause'", "'+'", "'-'", "'*'", "'/'", "'pendown?'", - "'<'", "'>'", "'=='", "'!='", "'<='", "'>='", "'&&'", - "'||'", "'!'" ] + "'goto'", "'('", "','", "')'", "'forward'", "'backward'", + "'left'", "'right'", "'penup'", "'pendown'", "'pause'", + "'='", "'+'", "'-'", "'*'", "'/'", "'pendown?'", "'<'", + "'>'", "'=='", "'!='", "'<='", "'>='", "'&&'", "'||'", + "'!'" ] symbolicNames = [ "", "", "", "", "", "", "", "", @@ -107,15 +110,15 @@ class tlangParser ( Parser ): RULE_ifElseConditional = 6 RULE_loop = 7 RULE_gotoCommand = 8 - RULE_assignment = 9 - RULE_moveCommand = 10 - RULE_moveOp = 11 - RULE_penCommand = 12 - RULE_pauseCommand = 13 - RULE_expression = 14 - RULE_multiplicative = 15 - RULE_additive = 16 - RULE_unaryArithOp = 17 + RULE_moveCommand = 9 + RULE_moveOp = 10 + RULE_penCommand = 11 + RULE_pauseCommand = 12 + RULE_assignment = 13 + RULE_multiplicative = 14 + RULE_additive = 15 + RULE_unaryArithOp = 16 + RULE_expression = 17 RULE_condition = 18 RULE_binCondOp = 19 RULE_logicOp = 20 @@ -123,9 +126,9 @@ class tlangParser ( Parser ): ruleNames = [ "start", "instruction_list", "strict_ilist", "instruction", "conditional", "ifConditional", "ifElseConditional", - "loop", "gotoCommand", "assignment", "moveCommand", "moveOp", - "penCommand", "pauseCommand", "expression", "multiplicative", - "additive", "unaryArithOp", "condition", "binCondOp", + "loop", "gotoCommand", "moveCommand", "moveOp", "penCommand", + "pauseCommand", "assignment", "multiplicative", "additive", + "unaryArithOp", "expression", "condition", "binCondOp", "logicOp", "value" ] EOF = Token.EOF @@ -173,6 +176,7 @@ def __init__(self, input:TokenStream, output:TextIO = sys.stdout): + class StartContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -216,6 +220,7 @@ def start(self): self.exitRule() return localctx + class Instruction_listContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -251,7 +256,7 @@ def instruction_list(self): self.state = 50 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__16) | (1 << tlangParser.VAR))) != 0): + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.VAR))) != 0): self.state = 47 self.instruction() self.state = 52 @@ -266,6 +271,7 @@ def instruction_list(self): self.exitRule() return localctx + class Strict_ilistContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -307,7 +313,7 @@ def strict_ilist(self): self.state = 56 self._errHandler.sync(self) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__16) | (1 << tlangParser.VAR))) != 0)): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.VAR))) != 0)): break except RecognitionException as re: @@ -318,6 +324,7 @@ def strict_ilist(self): self.exitRule() return localctx + class InstructionContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -387,12 +394,12 @@ def instruction(self): self.state = 60 self.loop() pass - elif token in [tlangParser.T__10, tlangParser.T__11, tlangParser.T__12, tlangParser.T__13]: + elif token in [tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12]: self.enterOuterAlt(localctx, 4) self.state = 61 self.moveCommand() pass - elif token in [tlangParser.T__14, tlangParser.T__15]: + elif token in [tlangParser.T__13, tlangParser.T__14]: self.enterOuterAlt(localctx, 5) self.state = 62 self.penCommand() @@ -402,7 +409,7 @@ def instruction(self): self.state = 63 self.gotoCommand() pass - elif token in [tlangParser.T__16]: + elif token in [tlangParser.T__15]: self.enterOuterAlt(localctx, 7) self.state = 64 self.pauseCommand() @@ -418,6 +425,7 @@ def instruction(self): self.exitRule() return localctx + class ConditionalContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -473,6 +481,7 @@ def conditional(self): self.exitRule() return localctx + class IfConditionalContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -523,6 +532,7 @@ def ifConditional(self): self.exitRule() return localctx + class IfElseConditionalContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -584,6 +594,7 @@ def ifElseConditional(self): self.exitRule() return localctx + class LoopContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -634,6 +645,7 @@ def loop(self): self.exitRule() return localctx + class GotoCommandContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -685,42 +697,42 @@ def gotoCommand(self): self.exitRule() return localctx - class AssignmentContext(ParserRuleContext): + + class MoveCommandContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def VAR(self): - return self.getToken(tlangParser.VAR, 0) + def moveOp(self): + return self.getTypedRuleContext(tlangParser.MoveOpContext,0) + def expression(self): return self.getTypedRuleContext(tlangParser.ExpressionContext,0) def getRuleIndex(self): - return tlangParser.RULE_assignment + return tlangParser.RULE_moveCommand def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitAssignment" ): - return visitor.visitAssignment(self) + if hasattr( visitor, "visitMoveCommand" ): + return visitor.visitMoveCommand(self) else: return visitor.visitChildren(self) - def assignment(self): + def moveCommand(self): - localctx = tlangParser.AssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 18, self.RULE_assignment) + localctx = tlangParser.MoveCommandContext(self, self._ctx, self.state) + self.enterRule(localctx, 18, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) self.state = 100 - self.match(tlangParser.VAR) + self.moveOp() self.state = 101 - self.match(tlangParser.T__9) - self.state = 102 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -730,41 +742,163 @@ def assignment(self): self.exitRule() return localctx - class MoveCommandContext(ParserRuleContext): + + class MoveOpContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def moveOp(self): - return self.getTypedRuleContext(tlangParser.MoveOpContext,0) + def getRuleIndex(self): + return tlangParser.RULE_moveOp + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitMoveOp" ): + return visitor.visitMoveOp(self) + else: + return visitor.visitChildren(self) + + + + + def moveOp(self): + + localctx = tlangParser.MoveOpContext(self, self._ctx, self.state) + self.enterRule(localctx, 20, self.RULE_moveOp) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 103 + _la = self._input.LA(1) + if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): + self._errHandler.recoverInline(self) + else: + self._errHandler.reportMatch(self) + self.consume() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class PenCommandContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + + def getRuleIndex(self): + return tlangParser.RULE_penCommand + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitPenCommand" ): + return visitor.visitPenCommand(self) + else: + return visitor.visitChildren(self) + + + + + def penCommand(self): + + localctx = tlangParser.PenCommandContext(self, self._ctx, self.state) + self.enterRule(localctx, 22, self.RULE_penCommand) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 105 + _la = self._input.LA(1) + if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): + self._errHandler.recoverInline(self) + else: + self._errHandler.reportMatch(self) + self.consume() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class PauseCommandContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + + def getRuleIndex(self): + return tlangParser.RULE_pauseCommand + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitPauseCommand" ): + return visitor.visitPauseCommand(self) + else: + return visitor.visitChildren(self) + + + + + def pauseCommand(self): + + localctx = tlangParser.PauseCommandContext(self, self._ctx, self.state) + self.enterRule(localctx, 24, self.RULE_pauseCommand) + try: + self.enterOuterAlt(localctx, 1) + self.state = 107 + self.match(tlangParser.T__15) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class AssignmentContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def VAR(self): + return self.getToken(tlangParser.VAR, 0) def expression(self): return self.getTypedRuleContext(tlangParser.ExpressionContext,0) def getRuleIndex(self): - return tlangParser.RULE_moveCommand + return tlangParser.RULE_assignment def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitMoveCommand" ): - return visitor.visitMoveCommand(self) + if hasattr( visitor, "visitAssignment" ): + return visitor.visitAssignment(self) else: return visitor.visitChildren(self) - def moveCommand(self): + def assignment(self): - localctx = tlangParser.MoveCommandContext(self, self._ctx, self.state) - self.enterRule(localctx, 20, self.RULE_moveCommand) + localctx = tlangParser.AssignmentContext(self, self._ctx, self.state) + self.enterRule(localctx, 26, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 104 - self.moveOp() - self.state = 105 + self.state = 109 + self.match(tlangParser.VAR) + self.state = 110 + self.match(tlangParser.T__16) + self.state = 111 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -774,35 +908,41 @@ def moveCommand(self): self.exitRule() return localctx - class MoveOpContext(ParserRuleContext): + + class MultiplicativeContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + def MUL(self): + return self.getToken(tlangParser.MUL, 0) + + def DIV(self): + return self.getToken(tlangParser.DIV, 0) def getRuleIndex(self): - return tlangParser.RULE_moveOp + return tlangParser.RULE_multiplicative def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitMoveOp" ): - return visitor.visitMoveOp(self) + if hasattr( visitor, "visitMultiplicative" ): + return visitor.visitMultiplicative(self) else: return visitor.visitChildren(self) - def moveOp(self): + def multiplicative(self): - localctx = tlangParser.MoveOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 22, self.RULE_moveOp) + localctx = tlangParser.MultiplicativeContext(self, self._ctx, self.state) + self.enterRule(localctx, 28, self.RULE_multiplicative) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 107 + self.state = 113 _la = self._input.LA(1) - if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13))) != 0)): + if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) @@ -815,35 +955,41 @@ def moveOp(self): self.exitRule() return localctx - class PenCommandContext(ParserRuleContext): + + class AdditiveContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + def PLUS(self): + return self.getToken(tlangParser.PLUS, 0) + + def MINUS(self): + return self.getToken(tlangParser.MINUS, 0) def getRuleIndex(self): - return tlangParser.RULE_penCommand + return tlangParser.RULE_additive def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitPenCommand" ): - return visitor.visitPenCommand(self) + if hasattr( visitor, "visitAdditive" ): + return visitor.visitAdditive(self) else: return visitor.visitChildren(self) - def penCommand(self): + def additive(self): - localctx = tlangParser.PenCommandContext(self, self._ctx, self.state) - self.enterRule(localctx, 24, self.RULE_penCommand) + localctx = tlangParser.AdditiveContext(self, self._ctx, self.state) + self.enterRule(localctx, 30, self.RULE_additive) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 109 + self.state = 115 _la = self._input.LA(1) - if not(_la==tlangParser.T__14 or _la==tlangParser.T__15): + if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) @@ -856,33 +1002,36 @@ def penCommand(self): self.exitRule() return localctx - class PauseCommandContext(ParserRuleContext): + + class UnaryArithOpContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + def MINUS(self): + return self.getToken(tlangParser.MINUS, 0) def getRuleIndex(self): - return tlangParser.RULE_pauseCommand + return tlangParser.RULE_unaryArithOp def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitPauseCommand" ): - return visitor.visitPauseCommand(self) + if hasattr( visitor, "visitUnaryArithOp" ): + return visitor.visitUnaryArithOp(self) else: return visitor.visitChildren(self) - def pauseCommand(self): + def unaryArithOp(self): - localctx = tlangParser.PauseCommandContext(self, self._ctx, self.state) - self.enterRule(localctx, 26, self.RULE_pauseCommand) + localctx = tlangParser.UnaryArithOpContext(self, self._ctx, self.state) + self.enterRule(localctx, 32, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 111 - self.match(tlangParser.T__16) + self.state = 117 + self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -891,6 +1040,7 @@ def pauseCommand(self): self.exitRule() return localctx + class ExpressionContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -989,6 +1139,25 @@ def accept(self, visitor:ParseTreeVisitor): return visitor.visitChildren(self) + class AssignExprContext(ExpressionContext): + + def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext + super().__init__(parser) + self.copyFrom(ctx) + + def VAR(self): + return self.getToken(tlangParser.VAR, 0) + def expression(self): + return self.getTypedRuleContext(tlangParser.ExpressionContext,0) + + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitAssignExpr" ): + return visitor.visitAssignExpr(self) + else: + return visitor.visitChildren(self) + + class ParenExprContext(ExpressionContext): def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext @@ -1012,46 +1181,59 @@ def expression(self, _p:int=0): _parentState = self.state localctx = tlangParser.ExpressionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 28 - self.enterRecursionRule(localctx, 28, self.RULE_expression, _p) + _startState = 34 + self.enterRecursionRule(localctx, 34, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 122 + self.state = 131 self._errHandler.sync(self) - token = self._input.LA(1) - if token in [tlangParser.MINUS]: + la_ = self._interp.adaptivePredict(self._input,4,self._ctx) + if la_ == 1: localctx = tlangParser.UnaryExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 114 + self.state = 120 self.unaryArithOp() - self.state = 115 - self.expression(5) + self.state = 121 + self.expression(6) + pass + + elif la_ == 2: + localctx = tlangParser.ParenExprContext(self, localctx) + self._ctx = localctx + _prevctx = localctx + self.state = 123 + self.match(tlangParser.T__6) + self.state = 124 + self.expression(0) + self.state = 125 + self.match(tlangParser.T__8) pass - elif token in [tlangParser.NUM, tlangParser.VAR]: + + elif la_ == 3: localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 117 + self.state = 127 self.value() pass - elif token in [tlangParser.T__6]: - localctx = tlangParser.ParenExprContext(self, localctx) + + elif la_ == 4: + localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 118 - self.match(tlangParser.T__6) - self.state = 119 - self.expression(0) - self.state = 120 - self.match(tlangParser.T__8) + self.state = 128 + self.match(tlangParser.VAR) + self.state = 129 + self.match(tlangParser.T__16) + self.state = 130 + self.expression(1) pass - else: - raise NoViableAltException(self) + self._ctx.stop = self._input.LT(-1) - self.state = 134 + self.state = 143 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,6,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -1059,37 +1241,37 @@ def expression(self, _p:int=0): if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 132 + self.state = 141 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,5,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 124 - if not self.precpred(self._ctx, 4): + self.state = 133 + if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException - raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") - self.state = 125 + raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") + self.state = 134 self.multiplicative() - self.state = 126 - self.expression(5) + self.state = 135 + self.expression(6) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 128 - if not self.precpred(self._ctx, 3): + self.state = 137 + if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException - raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 129 + raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") + self.state = 138 self.additive() - self.state = 130 - self.expression(4) + self.state = 139 + self.expression(5) pass - self.state = 136 + self.state = 145 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,6,self._ctx) @@ -1101,134 +1283,6 @@ def expression(self, _p:int=0): self.unrollRecursionContexts(_parentctx) return localctx - class MultiplicativeContext(ParserRuleContext): - - def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): - super().__init__(parent, invokingState) - self.parser = parser - - def MUL(self): - return self.getToken(tlangParser.MUL, 0) - - def DIV(self): - return self.getToken(tlangParser.DIV, 0) - - def getRuleIndex(self): - return tlangParser.RULE_multiplicative - - def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitMultiplicative" ): - return visitor.visitMultiplicative(self) - else: - return visitor.visitChildren(self) - - - - - def multiplicative(self): - - localctx = tlangParser.MultiplicativeContext(self, self._ctx, self.state) - self.enterRule(localctx, 30, self.RULE_multiplicative) - self._la = 0 # Token type - try: - self.enterOuterAlt(localctx, 1) - self.state = 137 - _la = self._input.LA(1) - if not(_la==tlangParser.MUL or _la==tlangParser.DIV): - self._errHandler.recoverInline(self) - else: - self._errHandler.reportMatch(self) - self.consume() - except RecognitionException as re: - localctx.exception = re - self._errHandler.reportError(self, re) - self._errHandler.recover(self, re) - finally: - self.exitRule() - return localctx - - class AdditiveContext(ParserRuleContext): - - def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): - super().__init__(parent, invokingState) - self.parser = parser - - def PLUS(self): - return self.getToken(tlangParser.PLUS, 0) - - def MINUS(self): - return self.getToken(tlangParser.MINUS, 0) - - def getRuleIndex(self): - return tlangParser.RULE_additive - - def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitAdditive" ): - return visitor.visitAdditive(self) - else: - return visitor.visitChildren(self) - - - - - def additive(self): - - localctx = tlangParser.AdditiveContext(self, self._ctx, self.state) - self.enterRule(localctx, 32, self.RULE_additive) - self._la = 0 # Token type - try: - self.enterOuterAlt(localctx, 1) - self.state = 139 - _la = self._input.LA(1) - if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): - self._errHandler.recoverInline(self) - else: - self._errHandler.reportMatch(self) - self.consume() - except RecognitionException as re: - localctx.exception = re - self._errHandler.reportError(self, re) - self._errHandler.recover(self, re) - finally: - self.exitRule() - return localctx - - class UnaryArithOpContext(ParserRuleContext): - - def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): - super().__init__(parent, invokingState) - self.parser = parser - - def MINUS(self): - return self.getToken(tlangParser.MINUS, 0) - - def getRuleIndex(self): - return tlangParser.RULE_unaryArithOp - - def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitUnaryArithOp" ): - return visitor.visitUnaryArithOp(self) - else: - return visitor.visitChildren(self) - - - - - def unaryArithOp(self): - - localctx = tlangParser.UnaryArithOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 34, self.RULE_unaryArithOp) - try: - self.enterOuterAlt(localctx, 1) - self.state = 141 - self.match(tlangParser.MINUS) - except RecognitionException as re: - localctx.exception = re - self._errHandler.reportError(self, re) - self._errHandler.recover(self, re) - finally: - self.exitRule() - return localctx class ConditionContext(ParserRuleContext): @@ -1284,42 +1338,42 @@ def condition(self, _p:int=0): self.enterRecursionRule(localctx, 36, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 155 + self.state = 158 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,7,self._ctx) if la_ == 1: - self.state = 144 + self.state = 147 self.match(tlangParser.NOT) - self.state = 145 + self.state = 148 self.condition(5) pass elif la_ == 2: - self.state = 146 + self.state = 149 self.expression(0) - self.state = 147 + self.state = 150 self.binCondOp() - self.state = 148 + self.state = 151 self.expression(0) pass elif la_ == 3: - self.state = 150 + self.state = 153 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 151 + self.state = 154 self.match(tlangParser.T__6) - self.state = 152 + self.state = 155 self.condition(0) - self.state = 153 + self.state = 156 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 163 + self.state = 166 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,8,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -1329,15 +1383,15 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 157 + self.state = 160 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 158 + self.state = 161 self.logicOp() - self.state = 159 + self.state = 162 self.condition(4) - self.state = 165 + self.state = 168 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,8,self._ctx) @@ -1349,6 +1403,7 @@ def condition(self, _p:int=0): self.unrollRecursionContexts(_parentctx) return localctx + class BinCondOpContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -1392,7 +1447,7 @@ def binCondOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 166 + self.state = 169 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -1407,6 +1462,7 @@ def binCondOp(self): self.exitRule() return localctx + class LogicOpContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -1438,7 +1494,7 @@ def logicOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 168 + self.state = 171 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -1453,6 +1509,7 @@ def logicOp(self): self.exitRule() return localctx + class ValueContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -1484,7 +1541,7 @@ def value(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 170 + self.state = 173 _la = self._input.LA(1) if not(_la==tlangParser.NUM or _la==tlangParser.VAR): self._errHandler.recoverInline(self) @@ -1504,7 +1561,7 @@ def value(self): def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): if self._predicates == None: self._predicates = dict() - self._predicates[14] = self.expression_sempred + self._predicates[17] = self.expression_sempred self._predicates[18] = self.condition_sempred pred = self._predicates.get(ruleIndex, None) if pred is None: @@ -1514,11 +1571,11 @@ def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): def expression_sempred(self, localctx:ExpressionContext, predIndex:int): if predIndex == 0: - return self.precpred(self._ctx, 4) + return self.precpred(self._ctx, 5) if predIndex == 1: - return self.precpred(self._ctx, 3) + return self.precpred(self._ctx, 4) def condition_sempred(self, localctx:ConditionContext, predIndex:int): diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index 7ac289a..bd3a652 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -54,11 +54,6 @@ def visitGotoCommand(self, ctx:tlangParser.GotoCommandContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#assignment. - def visitAssignment(self, ctx:tlangParser.AssignmentContext): - return self.visitChildren(ctx) - - # Visit a parse tree produced by tlangParser#moveCommand. def visitMoveCommand(self, ctx:tlangParser.MoveCommandContext): return self.visitChildren(ctx) @@ -79,6 +74,26 @@ def visitPauseCommand(self, ctx:tlangParser.PauseCommandContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#assignment. + def visitAssignment(self, ctx:tlangParser.AssignmentContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by tlangParser#multiplicative. + def visitMultiplicative(self, ctx:tlangParser.MultiplicativeContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by tlangParser#additive. + def visitAdditive(self, ctx:tlangParser.AdditiveContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by tlangParser#unaryArithOp. + def visitUnaryArithOp(self, ctx:tlangParser.UnaryArithOpContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#unaryExpr. def visitUnaryExpr(self, ctx:tlangParser.UnaryExprContext): return self.visitChildren(ctx) @@ -99,23 +114,13 @@ def visitMulExpr(self, ctx:tlangParser.MulExprContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#parenExpr. - def visitParenExpr(self, ctx:tlangParser.ParenExprContext): - return self.visitChildren(ctx) - - - # Visit a parse tree produced by tlangParser#multiplicative. - def visitMultiplicative(self, ctx:tlangParser.MultiplicativeContext): - return self.visitChildren(ctx) - - - # Visit a parse tree produced by tlangParser#additive. - def visitAdditive(self, ctx:tlangParser.AdditiveContext): + # Visit a parse tree produced by tlangParser#assignExpr. + def visitAssignExpr(self, ctx:tlangParser.AssignExprContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#unaryArithOp. - def visitUnaryArithOp(self, ctx:tlangParser.UnaryArithOpContext): + # Visit a parse tree produced by tlangParser#parenExpr. + def visitParenExpr(self, ctx:tlangParser.ParenExprContext): return self.visitChildren(ctx) From 8f06dc91d0e2cbeb6b0627091f883422bf0b5c70 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Sun, 9 Feb 2025 22:14:15 +0530 Subject: [PATCH 02/47] Adding print command --- ChironCore/ChironAST/ChironAST.py | 6 + ChironCore/ChironAST/builder.py | 5 +- ChironCore/example/kachuapur2.tl | 7 +- ChironCore/interpreter.py | 10 + ChironCore/turtparse/tlang.g4 | 2 + ChironCore/turtparse/tlang.interp | 5 +- ChironCore/turtparse/tlang.tokens | 66 ++-- ChironCore/turtparse/tlangLexer.interp | 5 +- ChironCore/turtparse/tlangLexer.py | 214 +++++------ ChironCore/turtparse/tlangLexer.tokens | 66 ++-- ChironCore/turtparse/tlangParser.py | 481 ++++++++++++++----------- ChironCore/turtparse/tlangVisitor.py | 5 + 12 files changed, 488 insertions(+), 384 deletions(-) diff --git a/ChironCore/ChironAST/ChironAST.py b/ChironCore/ChironAST/ChironAST.py index f86c5da..4b368cb 100644 --- a/ChironCore/ChironAST/ChironAST.py +++ b/ChironCore/ChironAST/ChironAST.py @@ -11,6 +11,12 @@ class AST(object): class Instruction(AST): pass +class PrintCommand(Instruction): + def __init__(self, expr): + self.expr = expr + + def __str__(self): + return self.expr.__str__() class AssignmentCommand(Instruction): def __init__(self, leftvar, rexpr): diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 2a00b28..4294e6c 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -66,7 +66,10 @@ def visitAssignExpr(self, ctx: tlangParser.AssignExprContext): # return "("+ ChironAST.AssignmentCommand(lval, rval) + ")" # return # Calls visitAssignment - + + def visitPrintStatement(self, ctx: tlangParser.PrintStatementContext): + expr_value = self.visit(ctx.expression()) # Evaluate the expression + return [(ChironAST.PrintCommand(expr_value), 1)] # Return value in case it's used elsewhere def visitIfConditional(self, ctx:tlangParser.IfConditionalContext): diff --git a/ChironCore/example/kachuapur2.tl b/ChironCore/example/kachuapur2.tl index 5bf268f..67f7d0a 100644 --- a/ChironCore/example/kachuapur2.tl +++ b/ChironCore/example/kachuapur2.tl @@ -1,3 +1,6 @@ :b = 2 -:steps = (:c = :b) * (:d = 4) - +:e = 3 +:steps = (:c = :b) * (:d = 4) + :e * 5 +print(:steps = 3) +print(:steps ) +print(2*4+5+:b) diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 7a66700..f7d1a3e 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -97,6 +97,8 @@ def interpret(self): if isinstance(stmt, ChironAST.AssignmentCommand): ntgt = self.handleAssignment(stmt, tgt) + elif isinstance(stmt, ChironAST.PrintCommand): + ntgt = self.handlePrint(stmt, tgt) elif isinstance(stmt, ChironAST.ConditionCommand): ntgt = self.handleCondition(stmt, tgt) elif isinstance(stmt, ChironAST.MoveCommand): @@ -139,6 +141,12 @@ def handleAssignment(self, stmt, tgt): rhs = addContext(stmt.rexpr) exec("setattr(self.prg,\"%s\",%s)" % (lhs,rhs)) return 1 + + def handlePrint(self,stmt,tgt): + print( " PrintCommand") + expr = addContext(stmt.expr) + exec("print(%s)" % expr) + return 1 def handleCondition(self, stmt, tgt): print(" Branch Instruction") @@ -150,6 +158,8 @@ def handleMove(self, stmt, tgt): print(" MoveCommand") exec("self.trtl.%s(%s)" % (stmt.direction,addContext(stmt.expr))) return 1 + + def handleNoOpCommand(self, stmt, tgt): print(" No-Op Command") diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index e7b1ded..ce24946 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -11,6 +11,7 @@ strict_ilist : (instruction)+ ; instruction : assignment + | printStatement | conditional | loop | moveCommand @@ -41,6 +42,7 @@ assignment : VAR '=' expression ; +printStatement : 'print' '(' expression ')' ; multiplicative : MUL | DIV; additive : PLUS | MINUS; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index 9f44688..c038128 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -17,6 +17,7 @@ null 'pendown' 'pause' '=' +'print' '+' '-' '*' @@ -55,6 +56,7 @@ null null null null +null PLUS MINUS MUL @@ -89,6 +91,7 @@ moveOp penCommand pauseCommand assignment +printStatement multiplicative additive unaryArithOp @@ -100,4 +103,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 37, 178, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 51, 10, 3, 12, 3, 14, 3, 54, 11, 3, 3, 4, 6, 4, 57, 10, 4, 13, 4, 14, 4, 58, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 68, 10, 5, 3, 6, 3, 6, 5, 6, 72, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 134, 10, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 7, 19, 144, 10, 19, 12, 19, 14, 19, 147, 11, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 5, 20, 161, 10, 20, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 167, 10, 20, 12, 20, 14, 20, 170, 11, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 2, 4, 36, 38, 24, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 2, 9, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 22, 23, 3, 2, 20, 21, 3, 2, 25, 30, 3, 2, 31, 32, 3, 2, 34, 35, 2, 173, 2, 46, 3, 2, 2, 2, 4, 52, 3, 2, 2, 2, 6, 56, 3, 2, 2, 2, 8, 67, 3, 2, 2, 2, 10, 71, 3, 2, 2, 2, 12, 73, 3, 2, 2, 2, 14, 79, 3, 2, 2, 2, 16, 89, 3, 2, 2, 2, 18, 95, 3, 2, 2, 2, 20, 102, 3, 2, 2, 2, 22, 105, 3, 2, 2, 2, 24, 107, 3, 2, 2, 2, 26, 109, 3, 2, 2, 2, 28, 111, 3, 2, 2, 2, 30, 115, 3, 2, 2, 2, 32, 117, 3, 2, 2, 2, 34, 119, 3, 2, 2, 2, 36, 133, 3, 2, 2, 2, 38, 160, 3, 2, 2, 2, 40, 171, 3, 2, 2, 2, 42, 173, 3, 2, 2, 2, 44, 175, 3, 2, 2, 2, 46, 47, 5, 4, 3, 2, 47, 48, 7, 2, 2, 3, 48, 3, 3, 2, 2, 2, 49, 51, 5, 8, 5, 2, 50, 49, 3, 2, 2, 2, 51, 54, 3, 2, 2, 2, 52, 50, 3, 2, 2, 2, 52, 53, 3, 2, 2, 2, 53, 5, 3, 2, 2, 2, 54, 52, 3, 2, 2, 2, 55, 57, 5, 8, 5, 2, 56, 55, 3, 2, 2, 2, 57, 58, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 7, 3, 2, 2, 2, 60, 68, 5, 28, 15, 2, 61, 68, 5, 10, 6, 2, 62, 68, 5, 16, 9, 2, 63, 68, 5, 20, 11, 2, 64, 68, 5, 24, 13, 2, 65, 68, 5, 18, 10, 2, 66, 68, 5, 26, 14, 2, 67, 60, 3, 2, 2, 2, 67, 61, 3, 2, 2, 2, 67, 62, 3, 2, 2, 2, 67, 63, 3, 2, 2, 2, 67, 64, 3, 2, 2, 2, 67, 65, 3, 2, 2, 2, 67, 66, 3, 2, 2, 2, 68, 9, 3, 2, 2, 2, 69, 72, 5, 12, 7, 2, 70, 72, 5, 14, 8, 2, 71, 69, 3, 2, 2, 2, 71, 70, 3, 2, 2, 2, 72, 11, 3, 2, 2, 2, 73, 74, 7, 3, 2, 2, 74, 75, 5, 38, 20, 2, 75, 76, 7, 4, 2, 2, 76, 77, 5, 6, 4, 2, 77, 78, 7, 5, 2, 2, 78, 13, 3, 2, 2, 2, 79, 80, 7, 3, 2, 2, 80, 81, 5, 38, 20, 2, 81, 82, 7, 4, 2, 2, 82, 83, 5, 6, 4, 2, 83, 84, 7, 5, 2, 2, 84, 85, 7, 6, 2, 2, 85, 86, 7, 4, 2, 2, 86, 87, 5, 6, 4, 2, 87, 88, 7, 5, 2, 2, 88, 15, 3, 2, 2, 2, 89, 90, 7, 7, 2, 2, 90, 91, 5, 44, 23, 2, 91, 92, 7, 4, 2, 2, 92, 93, 5, 6, 4, 2, 93, 94, 7, 5, 2, 2, 94, 17, 3, 2, 2, 2, 95, 96, 7, 8, 2, 2, 96, 97, 7, 9, 2, 2, 97, 98, 5, 36, 19, 2, 98, 99, 7, 10, 2, 2, 99, 100, 5, 36, 19, 2, 100, 101, 7, 11, 2, 2, 101, 19, 3, 2, 2, 2, 102, 103, 5, 22, 12, 2, 103, 104, 5, 36, 19, 2, 104, 21, 3, 2, 2, 2, 105, 106, 9, 2, 2, 2, 106, 23, 3, 2, 2, 2, 107, 108, 9, 3, 2, 2, 108, 25, 3, 2, 2, 2, 109, 110, 7, 18, 2, 2, 110, 27, 3, 2, 2, 2, 111, 112, 7, 35, 2, 2, 112, 113, 7, 19, 2, 2, 113, 114, 5, 36, 19, 2, 114, 29, 3, 2, 2, 2, 115, 116, 9, 4, 2, 2, 116, 31, 3, 2, 2, 2, 117, 118, 9, 5, 2, 2, 118, 33, 3, 2, 2, 2, 119, 120, 7, 21, 2, 2, 120, 35, 3, 2, 2, 2, 121, 122, 8, 19, 1, 2, 122, 123, 5, 34, 18, 2, 123, 124, 5, 36, 19, 8, 124, 134, 3, 2, 2, 2, 125, 126, 7, 9, 2, 2, 126, 127, 5, 36, 19, 2, 127, 128, 7, 11, 2, 2, 128, 134, 3, 2, 2, 2, 129, 134, 5, 44, 23, 2, 130, 131, 7, 35, 2, 2, 131, 132, 7, 19, 2, 2, 132, 134, 5, 36, 19, 3, 133, 121, 3, 2, 2, 2, 133, 125, 3, 2, 2, 2, 133, 129, 3, 2, 2, 2, 133, 130, 3, 2, 2, 2, 134, 145, 3, 2, 2, 2, 135, 136, 12, 7, 2, 2, 136, 137, 5, 30, 16, 2, 137, 138, 5, 36, 19, 8, 138, 144, 3, 2, 2, 2, 139, 140, 12, 6, 2, 2, 140, 141, 5, 32, 17, 2, 141, 142, 5, 36, 19, 7, 142, 144, 3, 2, 2, 2, 143, 135, 3, 2, 2, 2, 143, 139, 3, 2, 2, 2, 144, 147, 3, 2, 2, 2, 145, 143, 3, 2, 2, 2, 145, 146, 3, 2, 2, 2, 146, 37, 3, 2, 2, 2, 147, 145, 3, 2, 2, 2, 148, 149, 8, 20, 1, 2, 149, 150, 7, 33, 2, 2, 150, 161, 5, 38, 20, 7, 151, 152, 5, 36, 19, 2, 152, 153, 5, 40, 21, 2, 153, 154, 5, 36, 19, 2, 154, 161, 3, 2, 2, 2, 155, 161, 7, 24, 2, 2, 156, 157, 7, 9, 2, 2, 157, 158, 5, 38, 20, 2, 158, 159, 7, 11, 2, 2, 159, 161, 3, 2, 2, 2, 160, 148, 3, 2, 2, 2, 160, 151, 3, 2, 2, 2, 160, 155, 3, 2, 2, 2, 160, 156, 3, 2, 2, 2, 161, 168, 3, 2, 2, 2, 162, 163, 12, 5, 2, 2, 163, 164, 5, 42, 22, 2, 164, 165, 5, 38, 20, 6, 165, 167, 3, 2, 2, 2, 166, 162, 3, 2, 2, 2, 167, 170, 3, 2, 2, 2, 168, 166, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 39, 3, 2, 2, 2, 170, 168, 3, 2, 2, 2, 171, 172, 9, 6, 2, 2, 172, 41, 3, 2, 2, 2, 173, 174, 9, 7, 2, 2, 174, 43, 3, 2, 2, 2, 175, 176, 9, 8, 2, 2, 176, 45, 3, 2, 2, 2, 11, 52, 58, 67, 71, 133, 143, 145, 160, 168] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 38, 186, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 53, 10, 3, 12, 3, 14, 3, 56, 11, 3, 3, 4, 6, 4, 59, 10, 4, 13, 4, 14, 4, 60, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 71, 10, 5, 3, 6, 3, 6, 5, 6, 75, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 5, 20, 142, 10, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 152, 10, 20, 12, 20, 14, 20, 155, 11, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 5, 21, 169, 10, 21, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 175, 10, 21, 12, 21, 14, 21, 178, 11, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 2, 4, 38, 40, 25, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 2, 9, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 23, 24, 3, 2, 21, 22, 3, 2, 26, 31, 3, 2, 32, 33, 3, 2, 35, 36, 2, 181, 2, 48, 3, 2, 2, 2, 4, 54, 3, 2, 2, 2, 6, 58, 3, 2, 2, 2, 8, 70, 3, 2, 2, 2, 10, 74, 3, 2, 2, 2, 12, 76, 3, 2, 2, 2, 14, 82, 3, 2, 2, 2, 16, 92, 3, 2, 2, 2, 18, 98, 3, 2, 2, 2, 20, 105, 3, 2, 2, 2, 22, 108, 3, 2, 2, 2, 24, 110, 3, 2, 2, 2, 26, 112, 3, 2, 2, 2, 28, 114, 3, 2, 2, 2, 30, 118, 3, 2, 2, 2, 32, 123, 3, 2, 2, 2, 34, 125, 3, 2, 2, 2, 36, 127, 3, 2, 2, 2, 38, 141, 3, 2, 2, 2, 40, 168, 3, 2, 2, 2, 42, 179, 3, 2, 2, 2, 44, 181, 3, 2, 2, 2, 46, 183, 3, 2, 2, 2, 48, 49, 5, 4, 3, 2, 49, 50, 7, 2, 2, 3, 50, 3, 3, 2, 2, 2, 51, 53, 5, 8, 5, 2, 52, 51, 3, 2, 2, 2, 53, 56, 3, 2, 2, 2, 54, 52, 3, 2, 2, 2, 54, 55, 3, 2, 2, 2, 55, 5, 3, 2, 2, 2, 56, 54, 3, 2, 2, 2, 57, 59, 5, 8, 5, 2, 58, 57, 3, 2, 2, 2, 59, 60, 3, 2, 2, 2, 60, 58, 3, 2, 2, 2, 60, 61, 3, 2, 2, 2, 61, 7, 3, 2, 2, 2, 62, 71, 5, 28, 15, 2, 63, 71, 5, 30, 16, 2, 64, 71, 5, 10, 6, 2, 65, 71, 5, 16, 9, 2, 66, 71, 5, 20, 11, 2, 67, 71, 5, 24, 13, 2, 68, 71, 5, 18, 10, 2, 69, 71, 5, 26, 14, 2, 70, 62, 3, 2, 2, 2, 70, 63, 3, 2, 2, 2, 70, 64, 3, 2, 2, 2, 70, 65, 3, 2, 2, 2, 70, 66, 3, 2, 2, 2, 70, 67, 3, 2, 2, 2, 70, 68, 3, 2, 2, 2, 70, 69, 3, 2, 2, 2, 71, 9, 3, 2, 2, 2, 72, 75, 5, 12, 7, 2, 73, 75, 5, 14, 8, 2, 74, 72, 3, 2, 2, 2, 74, 73, 3, 2, 2, 2, 75, 11, 3, 2, 2, 2, 76, 77, 7, 3, 2, 2, 77, 78, 5, 40, 21, 2, 78, 79, 7, 4, 2, 2, 79, 80, 5, 6, 4, 2, 80, 81, 7, 5, 2, 2, 81, 13, 3, 2, 2, 2, 82, 83, 7, 3, 2, 2, 83, 84, 5, 40, 21, 2, 84, 85, 7, 4, 2, 2, 85, 86, 5, 6, 4, 2, 86, 87, 7, 5, 2, 2, 87, 88, 7, 6, 2, 2, 88, 89, 7, 4, 2, 2, 89, 90, 5, 6, 4, 2, 90, 91, 7, 5, 2, 2, 91, 15, 3, 2, 2, 2, 92, 93, 7, 7, 2, 2, 93, 94, 5, 46, 24, 2, 94, 95, 7, 4, 2, 2, 95, 96, 5, 6, 4, 2, 96, 97, 7, 5, 2, 2, 97, 17, 3, 2, 2, 2, 98, 99, 7, 8, 2, 2, 99, 100, 7, 9, 2, 2, 100, 101, 5, 38, 20, 2, 101, 102, 7, 10, 2, 2, 102, 103, 5, 38, 20, 2, 103, 104, 7, 11, 2, 2, 104, 19, 3, 2, 2, 2, 105, 106, 5, 22, 12, 2, 106, 107, 5, 38, 20, 2, 107, 21, 3, 2, 2, 2, 108, 109, 9, 2, 2, 2, 109, 23, 3, 2, 2, 2, 110, 111, 9, 3, 2, 2, 111, 25, 3, 2, 2, 2, 112, 113, 7, 18, 2, 2, 113, 27, 3, 2, 2, 2, 114, 115, 7, 36, 2, 2, 115, 116, 7, 19, 2, 2, 116, 117, 5, 38, 20, 2, 117, 29, 3, 2, 2, 2, 118, 119, 7, 20, 2, 2, 119, 120, 7, 9, 2, 2, 120, 121, 5, 38, 20, 2, 121, 122, 7, 11, 2, 2, 122, 31, 3, 2, 2, 2, 123, 124, 9, 4, 2, 2, 124, 33, 3, 2, 2, 2, 125, 126, 9, 5, 2, 2, 126, 35, 3, 2, 2, 2, 127, 128, 7, 22, 2, 2, 128, 37, 3, 2, 2, 2, 129, 130, 8, 20, 1, 2, 130, 131, 5, 36, 19, 2, 131, 132, 5, 38, 20, 8, 132, 142, 3, 2, 2, 2, 133, 134, 7, 9, 2, 2, 134, 135, 5, 38, 20, 2, 135, 136, 7, 11, 2, 2, 136, 142, 3, 2, 2, 2, 137, 142, 5, 46, 24, 2, 138, 139, 7, 36, 2, 2, 139, 140, 7, 19, 2, 2, 140, 142, 5, 38, 20, 3, 141, 129, 3, 2, 2, 2, 141, 133, 3, 2, 2, 2, 141, 137, 3, 2, 2, 2, 141, 138, 3, 2, 2, 2, 142, 153, 3, 2, 2, 2, 143, 144, 12, 7, 2, 2, 144, 145, 5, 32, 17, 2, 145, 146, 5, 38, 20, 8, 146, 152, 3, 2, 2, 2, 147, 148, 12, 6, 2, 2, 148, 149, 5, 34, 18, 2, 149, 150, 5, 38, 20, 7, 150, 152, 3, 2, 2, 2, 151, 143, 3, 2, 2, 2, 151, 147, 3, 2, 2, 2, 152, 155, 3, 2, 2, 2, 153, 151, 3, 2, 2, 2, 153, 154, 3, 2, 2, 2, 154, 39, 3, 2, 2, 2, 155, 153, 3, 2, 2, 2, 156, 157, 8, 21, 1, 2, 157, 158, 7, 34, 2, 2, 158, 169, 5, 40, 21, 7, 159, 160, 5, 38, 20, 2, 160, 161, 5, 42, 22, 2, 161, 162, 5, 38, 20, 2, 162, 169, 3, 2, 2, 2, 163, 169, 7, 25, 2, 2, 164, 165, 7, 9, 2, 2, 165, 166, 5, 40, 21, 2, 166, 167, 7, 11, 2, 2, 167, 169, 3, 2, 2, 2, 168, 156, 3, 2, 2, 2, 168, 159, 3, 2, 2, 2, 168, 163, 3, 2, 2, 2, 168, 164, 3, 2, 2, 2, 169, 176, 3, 2, 2, 2, 170, 171, 12, 5, 2, 2, 171, 172, 5, 44, 23, 2, 172, 173, 5, 40, 21, 6, 173, 175, 3, 2, 2, 2, 174, 170, 3, 2, 2, 2, 175, 178, 3, 2, 2, 2, 176, 174, 3, 2, 2, 2, 176, 177, 3, 2, 2, 2, 177, 41, 3, 2, 2, 2, 178, 176, 3, 2, 2, 2, 179, 180, 9, 6, 2, 2, 180, 43, 3, 2, 2, 2, 181, 182, 9, 7, 2, 2, 182, 45, 3, 2, 2, 2, 183, 184, 9, 8, 2, 2, 184, 47, 3, 2, 2, 2, 11, 54, 60, 70, 74, 141, 151, 153, 168, 176] \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.tokens b/ChironCore/turtparse/tlang.tokens index d50aa03..2449d08 100644 --- a/ChironCore/turtparse/tlang.tokens +++ b/ChironCore/turtparse/tlang.tokens @@ -15,24 +15,25 @@ T__13=14 T__14=15 T__15=16 T__16=17 -PLUS=18 -MINUS=19 -MUL=20 -DIV=21 -PENCOND=22 -LT=23 -GT=24 -EQ=25 -NEQ=26 -LTE=27 -GTE=28 -AND=29 -OR=30 -NOT=31 -NUM=32 -VAR=33 -NAME=34 -Whitespace=35 +T__17=18 +PLUS=19 +MINUS=20 +MUL=21 +DIV=22 +PENCOND=23 +LT=24 +GT=25 +EQ=26 +NEQ=27 +LTE=28 +GTE=29 +AND=30 +OR=31 +NOT=32 +NUM=33 +VAR=34 +NAME=35 +Whitespace=36 'if'=1 '['=2 ']'=3 @@ -50,17 +51,18 @@ Whitespace=35 'pendown'=15 'pause'=16 '='=17 -'+'=18 -'-'=19 -'*'=20 -'/'=21 -'pendown?'=22 -'<'=23 -'>'=24 -'=='=25 -'!='=26 -'<='=27 -'>='=28 -'&&'=29 -'||'=30 -'!'=31 +'print'=18 +'+'=19 +'-'=20 +'*'=21 +'/'=22 +'pendown?'=23 +'<'=24 +'>'=25 +'=='=26 +'!='=27 +'<='=28 +'>='=29 +'&&'=30 +'||'=31 +'!'=32 diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index 296e2ab..761cc81 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -17,6 +17,7 @@ null 'pendown' 'pause' '=' +'print' '+' '-' '*' @@ -55,6 +56,7 @@ null null null null +null PLUS MINUS MUL @@ -92,6 +94,7 @@ T__13 T__14 T__15 T__16 +T__17 PLUS MINUS MUL @@ -119,4 +122,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 37, 219, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 6, 33, 196, 10, 33, 13, 33, 14, 33, 197, 3, 34, 3, 34, 3, 34, 7, 34, 203, 10, 34, 12, 34, 14, 34, 206, 11, 34, 3, 35, 6, 35, 209, 10, 35, 13, 35, 14, 35, 210, 3, 36, 6, 36, 214, 10, 36, 13, 36, 14, 36, 215, 3, 36, 3, 36, 2, 2, 37, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 222, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 3, 73, 3, 2, 2, 2, 5, 76, 3, 2, 2, 2, 7, 78, 3, 2, 2, 2, 9, 80, 3, 2, 2, 2, 11, 85, 3, 2, 2, 2, 13, 92, 3, 2, 2, 2, 15, 97, 3, 2, 2, 2, 17, 99, 3, 2, 2, 2, 19, 101, 3, 2, 2, 2, 21, 103, 3, 2, 2, 2, 23, 111, 3, 2, 2, 2, 25, 120, 3, 2, 2, 2, 27, 125, 3, 2, 2, 2, 29, 131, 3, 2, 2, 2, 31, 137, 3, 2, 2, 2, 33, 145, 3, 2, 2, 2, 35, 151, 3, 2, 2, 2, 37, 153, 3, 2, 2, 2, 39, 155, 3, 2, 2, 2, 41, 157, 3, 2, 2, 2, 43, 159, 3, 2, 2, 2, 45, 161, 3, 2, 2, 2, 47, 170, 3, 2, 2, 2, 49, 172, 3, 2, 2, 2, 51, 174, 3, 2, 2, 2, 53, 177, 3, 2, 2, 2, 55, 180, 3, 2, 2, 2, 57, 183, 3, 2, 2, 2, 59, 186, 3, 2, 2, 2, 61, 189, 3, 2, 2, 2, 63, 192, 3, 2, 2, 2, 65, 195, 3, 2, 2, 2, 67, 199, 3, 2, 2, 2, 69, 208, 3, 2, 2, 2, 71, 213, 3, 2, 2, 2, 73, 74, 7, 107, 2, 2, 74, 75, 7, 104, 2, 2, 75, 4, 3, 2, 2, 2, 76, 77, 7, 93, 2, 2, 77, 6, 3, 2, 2, 2, 78, 79, 7, 95, 2, 2, 79, 8, 3, 2, 2, 2, 80, 81, 7, 103, 2, 2, 81, 82, 7, 110, 2, 2, 82, 83, 7, 117, 2, 2, 83, 84, 7, 103, 2, 2, 84, 10, 3, 2, 2, 2, 85, 86, 7, 116, 2, 2, 86, 87, 7, 103, 2, 2, 87, 88, 7, 114, 2, 2, 88, 89, 7, 103, 2, 2, 89, 90, 7, 99, 2, 2, 90, 91, 7, 118, 2, 2, 91, 12, 3, 2, 2, 2, 92, 93, 7, 105, 2, 2, 93, 94, 7, 113, 2, 2, 94, 95, 7, 118, 2, 2, 95, 96, 7, 113, 2, 2, 96, 14, 3, 2, 2, 2, 97, 98, 7, 42, 2, 2, 98, 16, 3, 2, 2, 2, 99, 100, 7, 46, 2, 2, 100, 18, 3, 2, 2, 2, 101, 102, 7, 43, 2, 2, 102, 20, 3, 2, 2, 2, 103, 104, 7, 104, 2, 2, 104, 105, 7, 113, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 121, 2, 2, 107, 108, 7, 99, 2, 2, 108, 109, 7, 116, 2, 2, 109, 110, 7, 102, 2, 2, 110, 22, 3, 2, 2, 2, 111, 112, 7, 100, 2, 2, 112, 113, 7, 99, 2, 2, 113, 114, 7, 101, 2, 2, 114, 115, 7, 109, 2, 2, 115, 116, 7, 121, 2, 2, 116, 117, 7, 99, 2, 2, 117, 118, 7, 116, 2, 2, 118, 119, 7, 102, 2, 2, 119, 24, 3, 2, 2, 2, 120, 121, 7, 110, 2, 2, 121, 122, 7, 103, 2, 2, 122, 123, 7, 104, 2, 2, 123, 124, 7, 118, 2, 2, 124, 26, 3, 2, 2, 2, 125, 126, 7, 116, 2, 2, 126, 127, 7, 107, 2, 2, 127, 128, 7, 105, 2, 2, 128, 129, 7, 106, 2, 2, 129, 130, 7, 118, 2, 2, 130, 28, 3, 2, 2, 2, 131, 132, 7, 114, 2, 2, 132, 133, 7, 103, 2, 2, 133, 134, 7, 112, 2, 2, 134, 135, 7, 119, 2, 2, 135, 136, 7, 114, 2, 2, 136, 30, 3, 2, 2, 2, 137, 138, 7, 114, 2, 2, 138, 139, 7, 103, 2, 2, 139, 140, 7, 112, 2, 2, 140, 141, 7, 102, 2, 2, 141, 142, 7, 113, 2, 2, 142, 143, 7, 121, 2, 2, 143, 144, 7, 112, 2, 2, 144, 32, 3, 2, 2, 2, 145, 146, 7, 114, 2, 2, 146, 147, 7, 99, 2, 2, 147, 148, 7, 119, 2, 2, 148, 149, 7, 117, 2, 2, 149, 150, 7, 103, 2, 2, 150, 34, 3, 2, 2, 2, 151, 152, 7, 63, 2, 2, 152, 36, 3, 2, 2, 2, 153, 154, 7, 45, 2, 2, 154, 38, 3, 2, 2, 2, 155, 156, 7, 47, 2, 2, 156, 40, 3, 2, 2, 2, 157, 158, 7, 44, 2, 2, 158, 42, 3, 2, 2, 2, 159, 160, 7, 49, 2, 2, 160, 44, 3, 2, 2, 2, 161, 162, 7, 114, 2, 2, 162, 163, 7, 103, 2, 2, 163, 164, 7, 112, 2, 2, 164, 165, 7, 102, 2, 2, 165, 166, 7, 113, 2, 2, 166, 167, 7, 121, 2, 2, 167, 168, 7, 112, 2, 2, 168, 169, 7, 65, 2, 2, 169, 46, 3, 2, 2, 2, 170, 171, 7, 62, 2, 2, 171, 48, 3, 2, 2, 2, 172, 173, 7, 64, 2, 2, 173, 50, 3, 2, 2, 2, 174, 175, 7, 63, 2, 2, 175, 176, 7, 63, 2, 2, 176, 52, 3, 2, 2, 2, 177, 178, 7, 35, 2, 2, 178, 179, 7, 63, 2, 2, 179, 54, 3, 2, 2, 2, 180, 181, 7, 62, 2, 2, 181, 182, 7, 63, 2, 2, 182, 56, 3, 2, 2, 2, 183, 184, 7, 64, 2, 2, 184, 185, 7, 63, 2, 2, 185, 58, 3, 2, 2, 2, 186, 187, 7, 40, 2, 2, 187, 188, 7, 40, 2, 2, 188, 60, 3, 2, 2, 2, 189, 190, 7, 126, 2, 2, 190, 191, 7, 126, 2, 2, 191, 62, 3, 2, 2, 2, 192, 193, 7, 35, 2, 2, 193, 64, 3, 2, 2, 2, 194, 196, 9, 2, 2, 2, 195, 194, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 195, 3, 2, 2, 2, 197, 198, 3, 2, 2, 2, 198, 66, 3, 2, 2, 2, 199, 200, 7, 60, 2, 2, 200, 204, 9, 3, 2, 2, 201, 203, 9, 4, 2, 2, 202, 201, 3, 2, 2, 2, 203, 206, 3, 2, 2, 2, 204, 202, 3, 2, 2, 2, 204, 205, 3, 2, 2, 2, 205, 68, 3, 2, 2, 2, 206, 204, 3, 2, 2, 2, 207, 209, 9, 5, 2, 2, 208, 207, 3, 2, 2, 2, 209, 210, 3, 2, 2, 2, 210, 208, 3, 2, 2, 2, 210, 211, 3, 2, 2, 2, 211, 70, 3, 2, 2, 2, 212, 214, 9, 6, 2, 2, 213, 212, 3, 2, 2, 2, 214, 215, 3, 2, 2, 2, 215, 213, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 218, 8, 36, 2, 2, 218, 72, 3, 2, 2, 2, 7, 2, 197, 204, 210, 215, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 38, 227, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 6, 34, 204, 10, 34, 13, 34, 14, 34, 205, 3, 35, 3, 35, 3, 35, 7, 35, 211, 10, 35, 12, 35, 14, 35, 214, 11, 35, 3, 36, 6, 36, 217, 10, 36, 13, 36, 14, 36, 218, 3, 37, 6, 37, 222, 10, 37, 13, 37, 14, 37, 223, 3, 37, 3, 37, 2, 2, 38, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 230, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 3, 75, 3, 2, 2, 2, 5, 78, 3, 2, 2, 2, 7, 80, 3, 2, 2, 2, 9, 82, 3, 2, 2, 2, 11, 87, 3, 2, 2, 2, 13, 94, 3, 2, 2, 2, 15, 99, 3, 2, 2, 2, 17, 101, 3, 2, 2, 2, 19, 103, 3, 2, 2, 2, 21, 105, 3, 2, 2, 2, 23, 113, 3, 2, 2, 2, 25, 122, 3, 2, 2, 2, 27, 127, 3, 2, 2, 2, 29, 133, 3, 2, 2, 2, 31, 139, 3, 2, 2, 2, 33, 147, 3, 2, 2, 2, 35, 153, 3, 2, 2, 2, 37, 155, 3, 2, 2, 2, 39, 161, 3, 2, 2, 2, 41, 163, 3, 2, 2, 2, 43, 165, 3, 2, 2, 2, 45, 167, 3, 2, 2, 2, 47, 169, 3, 2, 2, 2, 49, 178, 3, 2, 2, 2, 51, 180, 3, 2, 2, 2, 53, 182, 3, 2, 2, 2, 55, 185, 3, 2, 2, 2, 57, 188, 3, 2, 2, 2, 59, 191, 3, 2, 2, 2, 61, 194, 3, 2, 2, 2, 63, 197, 3, 2, 2, 2, 65, 200, 3, 2, 2, 2, 67, 203, 3, 2, 2, 2, 69, 207, 3, 2, 2, 2, 71, 216, 3, 2, 2, 2, 73, 221, 3, 2, 2, 2, 75, 76, 7, 107, 2, 2, 76, 77, 7, 104, 2, 2, 77, 4, 3, 2, 2, 2, 78, 79, 7, 93, 2, 2, 79, 6, 3, 2, 2, 2, 80, 81, 7, 95, 2, 2, 81, 8, 3, 2, 2, 2, 82, 83, 7, 103, 2, 2, 83, 84, 7, 110, 2, 2, 84, 85, 7, 117, 2, 2, 85, 86, 7, 103, 2, 2, 86, 10, 3, 2, 2, 2, 87, 88, 7, 116, 2, 2, 88, 89, 7, 103, 2, 2, 89, 90, 7, 114, 2, 2, 90, 91, 7, 103, 2, 2, 91, 92, 7, 99, 2, 2, 92, 93, 7, 118, 2, 2, 93, 12, 3, 2, 2, 2, 94, 95, 7, 105, 2, 2, 95, 96, 7, 113, 2, 2, 96, 97, 7, 118, 2, 2, 97, 98, 7, 113, 2, 2, 98, 14, 3, 2, 2, 2, 99, 100, 7, 42, 2, 2, 100, 16, 3, 2, 2, 2, 101, 102, 7, 46, 2, 2, 102, 18, 3, 2, 2, 2, 103, 104, 7, 43, 2, 2, 104, 20, 3, 2, 2, 2, 105, 106, 7, 104, 2, 2, 106, 107, 7, 113, 2, 2, 107, 108, 7, 116, 2, 2, 108, 109, 7, 121, 2, 2, 109, 110, 7, 99, 2, 2, 110, 111, 7, 116, 2, 2, 111, 112, 7, 102, 2, 2, 112, 22, 3, 2, 2, 2, 113, 114, 7, 100, 2, 2, 114, 115, 7, 99, 2, 2, 115, 116, 7, 101, 2, 2, 116, 117, 7, 109, 2, 2, 117, 118, 7, 121, 2, 2, 118, 119, 7, 99, 2, 2, 119, 120, 7, 116, 2, 2, 120, 121, 7, 102, 2, 2, 121, 24, 3, 2, 2, 2, 122, 123, 7, 110, 2, 2, 123, 124, 7, 103, 2, 2, 124, 125, 7, 104, 2, 2, 125, 126, 7, 118, 2, 2, 126, 26, 3, 2, 2, 2, 127, 128, 7, 116, 2, 2, 128, 129, 7, 107, 2, 2, 129, 130, 7, 105, 2, 2, 130, 131, 7, 106, 2, 2, 131, 132, 7, 118, 2, 2, 132, 28, 3, 2, 2, 2, 133, 134, 7, 114, 2, 2, 134, 135, 7, 103, 2, 2, 135, 136, 7, 112, 2, 2, 136, 137, 7, 119, 2, 2, 137, 138, 7, 114, 2, 2, 138, 30, 3, 2, 2, 2, 139, 140, 7, 114, 2, 2, 140, 141, 7, 103, 2, 2, 141, 142, 7, 112, 2, 2, 142, 143, 7, 102, 2, 2, 143, 144, 7, 113, 2, 2, 144, 145, 7, 121, 2, 2, 145, 146, 7, 112, 2, 2, 146, 32, 3, 2, 2, 2, 147, 148, 7, 114, 2, 2, 148, 149, 7, 99, 2, 2, 149, 150, 7, 119, 2, 2, 150, 151, 7, 117, 2, 2, 151, 152, 7, 103, 2, 2, 152, 34, 3, 2, 2, 2, 153, 154, 7, 63, 2, 2, 154, 36, 3, 2, 2, 2, 155, 156, 7, 114, 2, 2, 156, 157, 7, 116, 2, 2, 157, 158, 7, 107, 2, 2, 158, 159, 7, 112, 2, 2, 159, 160, 7, 118, 2, 2, 160, 38, 3, 2, 2, 2, 161, 162, 7, 45, 2, 2, 162, 40, 3, 2, 2, 2, 163, 164, 7, 47, 2, 2, 164, 42, 3, 2, 2, 2, 165, 166, 7, 44, 2, 2, 166, 44, 3, 2, 2, 2, 167, 168, 7, 49, 2, 2, 168, 46, 3, 2, 2, 2, 169, 170, 7, 114, 2, 2, 170, 171, 7, 103, 2, 2, 171, 172, 7, 112, 2, 2, 172, 173, 7, 102, 2, 2, 173, 174, 7, 113, 2, 2, 174, 175, 7, 121, 2, 2, 175, 176, 7, 112, 2, 2, 176, 177, 7, 65, 2, 2, 177, 48, 3, 2, 2, 2, 178, 179, 7, 62, 2, 2, 179, 50, 3, 2, 2, 2, 180, 181, 7, 64, 2, 2, 181, 52, 3, 2, 2, 2, 182, 183, 7, 63, 2, 2, 183, 184, 7, 63, 2, 2, 184, 54, 3, 2, 2, 2, 185, 186, 7, 35, 2, 2, 186, 187, 7, 63, 2, 2, 187, 56, 3, 2, 2, 2, 188, 189, 7, 62, 2, 2, 189, 190, 7, 63, 2, 2, 190, 58, 3, 2, 2, 2, 191, 192, 7, 64, 2, 2, 192, 193, 7, 63, 2, 2, 193, 60, 3, 2, 2, 2, 194, 195, 7, 40, 2, 2, 195, 196, 7, 40, 2, 2, 196, 62, 3, 2, 2, 2, 197, 198, 7, 126, 2, 2, 198, 199, 7, 126, 2, 2, 199, 64, 3, 2, 2, 2, 200, 201, 7, 35, 2, 2, 201, 66, 3, 2, 2, 2, 202, 204, 9, 2, 2, 2, 203, 202, 3, 2, 2, 2, 204, 205, 3, 2, 2, 2, 205, 203, 3, 2, 2, 2, 205, 206, 3, 2, 2, 2, 206, 68, 3, 2, 2, 2, 207, 208, 7, 60, 2, 2, 208, 212, 9, 3, 2, 2, 209, 211, 9, 4, 2, 2, 210, 209, 3, 2, 2, 2, 211, 214, 3, 2, 2, 2, 212, 210, 3, 2, 2, 2, 212, 213, 3, 2, 2, 2, 213, 70, 3, 2, 2, 2, 214, 212, 3, 2, 2, 2, 215, 217, 9, 5, 2, 2, 216, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 72, 3, 2, 2, 2, 220, 222, 9, 6, 2, 2, 221, 220, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 223, 224, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 226, 8, 37, 2, 2, 226, 74, 3, 2, 2, 2, 7, 2, 205, 212, 218, 223, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index 82979e7..168c686 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -8,91 +8,94 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2%") - buf.write("\u00db\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2&") + buf.write("\u00e3\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") buf.write("\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36") - buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\3\2\3") - buf.write("\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6") - buf.write("\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\t\3\t\3") - buf.write("\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f") - buf.write("\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\16") - buf.write("\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17") - buf.write("\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21") - buf.write("\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25") - buf.write("\3\26\3\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27") - buf.write("\3\30\3\30\3\31\3\31\3\32\3\32\3\32\3\33\3\33\3\33\3\34") - buf.write("\3\34\3\34\3\35\3\35\3\35\3\36\3\36\3\36\3\37\3\37\3\37") - buf.write("\3 \3 \3!\6!\u00c4\n!\r!\16!\u00c5\3\"\3\"\3\"\7\"\u00cb") - buf.write("\n\"\f\"\16\"\u00ce\13\"\3#\6#\u00d1\n#\r#\16#\u00d2\3") - buf.write("$\6$\u00d6\n$\r$\16$\u00d7\3$\3$\2\2%\3\3\5\4\7\5\t\6") - buf.write("\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20") - buf.write("\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65") - buf.write("\34\67\359\36;\37= ?!A\"C#E$G%\3\2\7\3\2\62;\5\2C\\aa") - buf.write("c|\5\2\62;C\\c|\4\2C\\c|\5\2\13\f\17\17\"\"\2\u00de\2") - buf.write("\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3") - buf.write("\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2") - buf.write("\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2") - buf.write("\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%") - buf.write("\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2") - buf.write("\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67") - buf.write("\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2") - buf.write("A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\3I\3\2\2\2") - buf.write("\5L\3\2\2\2\7N\3\2\2\2\tP\3\2\2\2\13U\3\2\2\2\r\\\3\2") - buf.write("\2\2\17a\3\2\2\2\21c\3\2\2\2\23e\3\2\2\2\25g\3\2\2\2\27") - buf.write("o\3\2\2\2\31x\3\2\2\2\33}\3\2\2\2\35\u0083\3\2\2\2\37") - buf.write("\u0089\3\2\2\2!\u0091\3\2\2\2#\u0097\3\2\2\2%\u0099\3") - buf.write("\2\2\2\'\u009b\3\2\2\2)\u009d\3\2\2\2+\u009f\3\2\2\2-") - buf.write("\u00a1\3\2\2\2/\u00aa\3\2\2\2\61\u00ac\3\2\2\2\63\u00ae") - buf.write("\3\2\2\2\65\u00b1\3\2\2\2\67\u00b4\3\2\2\29\u00b7\3\2") - buf.write("\2\2;\u00ba\3\2\2\2=\u00bd\3\2\2\2?\u00c0\3\2\2\2A\u00c3") - buf.write("\3\2\2\2C\u00c7\3\2\2\2E\u00d0\3\2\2\2G\u00d5\3\2\2\2") - buf.write("IJ\7k\2\2JK\7h\2\2K\4\3\2\2\2LM\7]\2\2M\6\3\2\2\2NO\7") - buf.write("_\2\2O\b\3\2\2\2PQ\7g\2\2QR\7n\2\2RS\7u\2\2ST\7g\2\2T") - buf.write("\n\3\2\2\2UV\7t\2\2VW\7g\2\2WX\7r\2\2XY\7g\2\2YZ\7c\2") - buf.write("\2Z[\7v\2\2[\f\3\2\2\2\\]\7i\2\2]^\7q\2\2^_\7v\2\2_`\7") - buf.write("q\2\2`\16\3\2\2\2ab\7*\2\2b\20\3\2\2\2cd\7.\2\2d\22\3") - buf.write("\2\2\2ef\7+\2\2f\24\3\2\2\2gh\7h\2\2hi\7q\2\2ij\7t\2\2") - buf.write("jk\7y\2\2kl\7c\2\2lm\7t\2\2mn\7f\2\2n\26\3\2\2\2op\7d") - buf.write("\2\2pq\7c\2\2qr\7e\2\2rs\7m\2\2st\7y\2\2tu\7c\2\2uv\7") - buf.write("t\2\2vw\7f\2\2w\30\3\2\2\2xy\7n\2\2yz\7g\2\2z{\7h\2\2") - buf.write("{|\7v\2\2|\32\3\2\2\2}~\7t\2\2~\177\7k\2\2\177\u0080\7") - buf.write("i\2\2\u0080\u0081\7j\2\2\u0081\u0082\7v\2\2\u0082\34\3") - buf.write("\2\2\2\u0083\u0084\7r\2\2\u0084\u0085\7g\2\2\u0085\u0086") - buf.write("\7p\2\2\u0086\u0087\7w\2\2\u0087\u0088\7r\2\2\u0088\36") - buf.write("\3\2\2\2\u0089\u008a\7r\2\2\u008a\u008b\7g\2\2\u008b\u008c") - buf.write("\7p\2\2\u008c\u008d\7f\2\2\u008d\u008e\7q\2\2\u008e\u008f") - buf.write("\7y\2\2\u008f\u0090\7p\2\2\u0090 \3\2\2\2\u0091\u0092") - buf.write("\7r\2\2\u0092\u0093\7c\2\2\u0093\u0094\7w\2\2\u0094\u0095") - buf.write("\7u\2\2\u0095\u0096\7g\2\2\u0096\"\3\2\2\2\u0097\u0098") - buf.write("\7?\2\2\u0098$\3\2\2\2\u0099\u009a\7-\2\2\u009a&\3\2\2") - buf.write("\2\u009b\u009c\7/\2\2\u009c(\3\2\2\2\u009d\u009e\7,\2") - buf.write("\2\u009e*\3\2\2\2\u009f\u00a0\7\61\2\2\u00a0,\3\2\2\2") - buf.write("\u00a1\u00a2\7r\2\2\u00a2\u00a3\7g\2\2\u00a3\u00a4\7p") - buf.write("\2\2\u00a4\u00a5\7f\2\2\u00a5\u00a6\7q\2\2\u00a6\u00a7") - buf.write("\7y\2\2\u00a7\u00a8\7p\2\2\u00a8\u00a9\7A\2\2\u00a9.\3") - buf.write("\2\2\2\u00aa\u00ab\7>\2\2\u00ab\60\3\2\2\2\u00ac\u00ad") - buf.write("\7@\2\2\u00ad\62\3\2\2\2\u00ae\u00af\7?\2\2\u00af\u00b0") - buf.write("\7?\2\2\u00b0\64\3\2\2\2\u00b1\u00b2\7#\2\2\u00b2\u00b3") - buf.write("\7?\2\2\u00b3\66\3\2\2\2\u00b4\u00b5\7>\2\2\u00b5\u00b6") - buf.write("\7?\2\2\u00b68\3\2\2\2\u00b7\u00b8\7@\2\2\u00b8\u00b9") - buf.write("\7?\2\2\u00b9:\3\2\2\2\u00ba\u00bb\7(\2\2\u00bb\u00bc") - buf.write("\7(\2\2\u00bc<\3\2\2\2\u00bd\u00be\7~\2\2\u00be\u00bf") - buf.write("\7~\2\2\u00bf>\3\2\2\2\u00c0\u00c1\7#\2\2\u00c1@\3\2\2") - buf.write("\2\u00c2\u00c4\t\2\2\2\u00c3\u00c2\3\2\2\2\u00c4\u00c5") - buf.write("\3\2\2\2\u00c5\u00c3\3\2\2\2\u00c5\u00c6\3\2\2\2\u00c6") - buf.write("B\3\2\2\2\u00c7\u00c8\7<\2\2\u00c8\u00cc\t\3\2\2\u00c9") - buf.write("\u00cb\t\4\2\2\u00ca\u00c9\3\2\2\2\u00cb\u00ce\3\2\2\2") - buf.write("\u00cc\u00ca\3\2\2\2\u00cc\u00cd\3\2\2\2\u00cdD\3\2\2") - buf.write("\2\u00ce\u00cc\3\2\2\2\u00cf\u00d1\t\5\2\2\u00d0\u00cf") - buf.write("\3\2\2\2\u00d1\u00d2\3\2\2\2\u00d2\u00d0\3\2\2\2\u00d2") - buf.write("\u00d3\3\2\2\2\u00d3F\3\2\2\2\u00d4\u00d6\t\6\2\2\u00d5") - buf.write("\u00d4\3\2\2\2\u00d6\u00d7\3\2\2\2\u00d7\u00d5\3\2\2\2") - buf.write("\u00d7\u00d8\3\2\2\2\u00d8\u00d9\3\2\2\2\u00d9\u00da\b") - buf.write("$\2\2\u00daH\3\2\2\2\7\2\u00c5\u00cc\u00d2\u00d7\3\b\2") - buf.write("\2") + buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%") + buf.write("\3\2\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3") + buf.write("\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\t") + buf.write("\3\t\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3") + buf.write("\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r") + buf.write("\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17") + buf.write("\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21") + buf.write("\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23\3\23\3\23") + buf.write("\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30") + buf.write("\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\31\3\31\3\32\3\32") + buf.write("\3\33\3\33\3\33\3\34\3\34\3\34\3\35\3\35\3\35\3\36\3\36") + buf.write("\3\36\3\37\3\37\3\37\3 \3 \3 \3!\3!\3\"\6\"\u00cc\n\"") + buf.write("\r\"\16\"\u00cd\3#\3#\3#\7#\u00d3\n#\f#\16#\u00d6\13#") + buf.write("\3$\6$\u00d9\n$\r$\16$\u00da\3%\6%\u00de\n%\r%\16%\u00df") + buf.write("\3%\3%\2\2&\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25") + buf.write("\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+") + buf.write("\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E") + buf.write("$G%I&\3\2\7\3\2\62;\5\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5") + buf.write("\2\13\f\17\17\"\"\2\u00e6\2\3\3\2\2\2\2\5\3\2\2\2\2\7") + buf.write("\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2") + buf.write("\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2") + buf.write("\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2") + buf.write("\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2") + buf.write("\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63") + buf.write("\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2") + buf.write("\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2") + buf.write("\2\2\2G\3\2\2\2\2I\3\2\2\2\3K\3\2\2\2\5N\3\2\2\2\7P\3") + buf.write("\2\2\2\tR\3\2\2\2\13W\3\2\2\2\r^\3\2\2\2\17c\3\2\2\2\21") + buf.write("e\3\2\2\2\23g\3\2\2\2\25i\3\2\2\2\27q\3\2\2\2\31z\3\2") + buf.write("\2\2\33\177\3\2\2\2\35\u0085\3\2\2\2\37\u008b\3\2\2\2") + buf.write("!\u0093\3\2\2\2#\u0099\3\2\2\2%\u009b\3\2\2\2\'\u00a1") + buf.write("\3\2\2\2)\u00a3\3\2\2\2+\u00a5\3\2\2\2-\u00a7\3\2\2\2") + buf.write("/\u00a9\3\2\2\2\61\u00b2\3\2\2\2\63\u00b4\3\2\2\2\65\u00b6") + buf.write("\3\2\2\2\67\u00b9\3\2\2\29\u00bc\3\2\2\2;\u00bf\3\2\2") + buf.write("\2=\u00c2\3\2\2\2?\u00c5\3\2\2\2A\u00c8\3\2\2\2C\u00cb") + buf.write("\3\2\2\2E\u00cf\3\2\2\2G\u00d8\3\2\2\2I\u00dd\3\2\2\2") + buf.write("KL\7k\2\2LM\7h\2\2M\4\3\2\2\2NO\7]\2\2O\6\3\2\2\2PQ\7") + buf.write("_\2\2Q\b\3\2\2\2RS\7g\2\2ST\7n\2\2TU\7u\2\2UV\7g\2\2V") + buf.write("\n\3\2\2\2WX\7t\2\2XY\7g\2\2YZ\7r\2\2Z[\7g\2\2[\\\7c\2") + buf.write("\2\\]\7v\2\2]\f\3\2\2\2^_\7i\2\2_`\7q\2\2`a\7v\2\2ab\7") + buf.write("q\2\2b\16\3\2\2\2cd\7*\2\2d\20\3\2\2\2ef\7.\2\2f\22\3") + buf.write("\2\2\2gh\7+\2\2h\24\3\2\2\2ij\7h\2\2jk\7q\2\2kl\7t\2\2") + buf.write("lm\7y\2\2mn\7c\2\2no\7t\2\2op\7f\2\2p\26\3\2\2\2qr\7d") + buf.write("\2\2rs\7c\2\2st\7e\2\2tu\7m\2\2uv\7y\2\2vw\7c\2\2wx\7") + buf.write("t\2\2xy\7f\2\2y\30\3\2\2\2z{\7n\2\2{|\7g\2\2|}\7h\2\2") + buf.write("}~\7v\2\2~\32\3\2\2\2\177\u0080\7t\2\2\u0080\u0081\7k") + buf.write("\2\2\u0081\u0082\7i\2\2\u0082\u0083\7j\2\2\u0083\u0084") + buf.write("\7v\2\2\u0084\34\3\2\2\2\u0085\u0086\7r\2\2\u0086\u0087") + buf.write("\7g\2\2\u0087\u0088\7p\2\2\u0088\u0089\7w\2\2\u0089\u008a") + buf.write("\7r\2\2\u008a\36\3\2\2\2\u008b\u008c\7r\2\2\u008c\u008d") + buf.write("\7g\2\2\u008d\u008e\7p\2\2\u008e\u008f\7f\2\2\u008f\u0090") + buf.write("\7q\2\2\u0090\u0091\7y\2\2\u0091\u0092\7p\2\2\u0092 \3") + buf.write("\2\2\2\u0093\u0094\7r\2\2\u0094\u0095\7c\2\2\u0095\u0096") + buf.write("\7w\2\2\u0096\u0097\7u\2\2\u0097\u0098\7g\2\2\u0098\"") + buf.write("\3\2\2\2\u0099\u009a\7?\2\2\u009a$\3\2\2\2\u009b\u009c") + buf.write("\7r\2\2\u009c\u009d\7t\2\2\u009d\u009e\7k\2\2\u009e\u009f") + buf.write("\7p\2\2\u009f\u00a0\7v\2\2\u00a0&\3\2\2\2\u00a1\u00a2") + buf.write("\7-\2\2\u00a2(\3\2\2\2\u00a3\u00a4\7/\2\2\u00a4*\3\2\2") + buf.write("\2\u00a5\u00a6\7,\2\2\u00a6,\3\2\2\2\u00a7\u00a8\7\61") + buf.write("\2\2\u00a8.\3\2\2\2\u00a9\u00aa\7r\2\2\u00aa\u00ab\7g") + buf.write("\2\2\u00ab\u00ac\7p\2\2\u00ac\u00ad\7f\2\2\u00ad\u00ae") + buf.write("\7q\2\2\u00ae\u00af\7y\2\2\u00af\u00b0\7p\2\2\u00b0\u00b1") + buf.write("\7A\2\2\u00b1\60\3\2\2\2\u00b2\u00b3\7>\2\2\u00b3\62\3") + buf.write("\2\2\2\u00b4\u00b5\7@\2\2\u00b5\64\3\2\2\2\u00b6\u00b7") + buf.write("\7?\2\2\u00b7\u00b8\7?\2\2\u00b8\66\3\2\2\2\u00b9\u00ba") + buf.write("\7#\2\2\u00ba\u00bb\7?\2\2\u00bb8\3\2\2\2\u00bc\u00bd") + buf.write("\7>\2\2\u00bd\u00be\7?\2\2\u00be:\3\2\2\2\u00bf\u00c0") + buf.write("\7@\2\2\u00c0\u00c1\7?\2\2\u00c1<\3\2\2\2\u00c2\u00c3") + buf.write("\7(\2\2\u00c3\u00c4\7(\2\2\u00c4>\3\2\2\2\u00c5\u00c6") + buf.write("\7~\2\2\u00c6\u00c7\7~\2\2\u00c7@\3\2\2\2\u00c8\u00c9") + buf.write("\7#\2\2\u00c9B\3\2\2\2\u00ca\u00cc\t\2\2\2\u00cb\u00ca") + buf.write("\3\2\2\2\u00cc\u00cd\3\2\2\2\u00cd\u00cb\3\2\2\2\u00cd") + buf.write("\u00ce\3\2\2\2\u00ceD\3\2\2\2\u00cf\u00d0\7<\2\2\u00d0") + buf.write("\u00d4\t\3\2\2\u00d1\u00d3\t\4\2\2\u00d2\u00d1\3\2\2\2") + buf.write("\u00d3\u00d6\3\2\2\2\u00d4\u00d2\3\2\2\2\u00d4\u00d5\3") + buf.write("\2\2\2\u00d5F\3\2\2\2\u00d6\u00d4\3\2\2\2\u00d7\u00d9") + buf.write("\t\5\2\2\u00d8\u00d7\3\2\2\2\u00d9\u00da\3\2\2\2\u00da") + buf.write("\u00d8\3\2\2\2\u00da\u00db\3\2\2\2\u00dbH\3\2\2\2\u00dc") + buf.write("\u00de\t\6\2\2\u00dd\u00dc\3\2\2\2\u00de\u00df\3\2\2\2") + buf.write("\u00df\u00dd\3\2\2\2\u00df\u00e0\3\2\2\2\u00e0\u00e1\3") + buf.write("\2\2\2\u00e1\u00e2\b%\2\2\u00e2J\3\2\2\2\7\2\u00cd\u00d4") + buf.write("\u00da\u00df\3\b\2\2") return buf.getvalue() @@ -119,24 +122,25 @@ class tlangLexer(Lexer): T__14 = 15 T__15 = 16 T__16 = 17 - PLUS = 18 - MINUS = 19 - MUL = 20 - DIV = 21 - PENCOND = 22 - LT = 23 - GT = 24 - EQ = 25 - NEQ = 26 - LTE = 27 - GTE = 28 - AND = 29 - OR = 30 - NOT = 31 - NUM = 32 - VAR = 33 - NAME = 34 - Whitespace = 35 + T__17 = 18 + PLUS = 19 + MINUS = 20 + MUL = 21 + DIV = 22 + PENCOND = 23 + LT = 24 + GT = 25 + EQ = 26 + NEQ = 27 + LTE = 28 + GTE = 29 + AND = 30 + OR = 31 + NOT = 32 + NUM = 33 + VAR = 34 + NAME = 35 + Whitespace = 36 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] @@ -145,9 +149,9 @@ class tlangLexer(Lexer): literalNames = [ "", "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", - "'penup'", "'pendown'", "'pause'", "'='", "'+'", "'-'", "'*'", - "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", "'>='", - "'&&'", "'||'", "'!'" ] + "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'+'", + "'-'", "'*'", "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", + "'<='", "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", @@ -156,9 +160,9 @@ class tlangLexer(Lexer): ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", - "T__14", "T__15", "T__16", "PLUS", "MINUS", "MUL", "DIV", - "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", "GTE", "AND", - "OR", "NOT", "NUM", "VAR", "NAME", "Whitespace" ] + "T__14", "T__15", "T__16", "T__17", "PLUS", "MINUS", "MUL", + "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", "GTE", + "AND", "OR", "NOT", "NUM", "VAR", "NAME", "Whitespace" ] grammarFileName = "tlang.g4" diff --git a/ChironCore/turtparse/tlangLexer.tokens b/ChironCore/turtparse/tlangLexer.tokens index d50aa03..2449d08 100644 --- a/ChironCore/turtparse/tlangLexer.tokens +++ b/ChironCore/turtparse/tlangLexer.tokens @@ -15,24 +15,25 @@ T__13=14 T__14=15 T__15=16 T__16=17 -PLUS=18 -MINUS=19 -MUL=20 -DIV=21 -PENCOND=22 -LT=23 -GT=24 -EQ=25 -NEQ=26 -LTE=27 -GTE=28 -AND=29 -OR=30 -NOT=31 -NUM=32 -VAR=33 -NAME=34 -Whitespace=35 +T__17=18 +PLUS=19 +MINUS=20 +MUL=21 +DIV=22 +PENCOND=23 +LT=24 +GT=25 +EQ=26 +NEQ=27 +LTE=28 +GTE=29 +AND=30 +OR=31 +NOT=32 +NUM=33 +VAR=34 +NAME=35 +Whitespace=36 'if'=1 '['=2 ']'=3 @@ -50,17 +51,18 @@ Whitespace=35 'pendown'=15 'pause'=16 '='=17 -'+'=18 -'-'=19 -'*'=20 -'/'=21 -'pendown?'=22 -'<'=23 -'>'=24 -'=='=25 -'!='=26 -'<='=27 -'>='=28 -'&&'=29 -'||'=30 -'!'=31 +'print'=18 +'+'=19 +'-'=20 +'*'=21 +'/'=22 +'pendown?'=23 +'<'=24 +'>'=25 +'=='=26 +'!='=27 +'<='=28 +'>='=29 +'&&'=30 +'||'=31 +'!'=32 diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index bb006db..370cf8e 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -8,71 +8,75 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3%") - buf.write("\u00b2\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3&") + buf.write("\u00ba\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") - buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\3\2\3\2\3\2\3") - buf.write("\3\7\3\63\n\3\f\3\16\3\66\13\3\3\4\6\49\n\4\r\4\16\4:") - buf.write("\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5D\n\5\3\6\3\6\5\6H\n\6") - buf.write("\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3") - buf.write("\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n") - buf.write("\3\n\3\n\3\13\3\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17") - buf.write("\3\17\3\17\3\17\3\20\3\20\3\21\3\21\3\22\3\22\3\23\3\23") - buf.write("\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\5\23") - buf.write("\u0086\n\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\7") - buf.write("\23\u0090\n\23\f\23\16\23\u0093\13\23\3\24\3\24\3\24\3") - buf.write("\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\5\24\u00a1") - buf.write("\n\24\3\24\3\24\3\24\3\24\7\24\u00a7\n\24\f\24\16\24\u00aa") - buf.write("\13\24\3\25\3\25\3\26\3\26\3\27\3\27\3\27\2\4$&\30\2\4") - buf.write("\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,\2\t\3\2\f") - buf.write("\17\3\2\20\21\3\2\26\27\3\2\24\25\3\2\31\36\3\2\37 \3") - buf.write("\2\"#\2\u00ad\2.\3\2\2\2\4\64\3\2\2\2\68\3\2\2\2\bC\3") - buf.write("\2\2\2\nG\3\2\2\2\fI\3\2\2\2\16O\3\2\2\2\20Y\3\2\2\2\22") - buf.write("_\3\2\2\2\24f\3\2\2\2\26i\3\2\2\2\30k\3\2\2\2\32m\3\2") - buf.write("\2\2\34o\3\2\2\2\36s\3\2\2\2 u\3\2\2\2\"w\3\2\2\2$\u0085") - buf.write("\3\2\2\2&\u00a0\3\2\2\2(\u00ab\3\2\2\2*\u00ad\3\2\2\2") - buf.write(",\u00af\3\2\2\2./\5\4\3\2/\60\7\2\2\3\60\3\3\2\2\2\61") - buf.write("\63\5\b\5\2\62\61\3\2\2\2\63\66\3\2\2\2\64\62\3\2\2\2") - buf.write("\64\65\3\2\2\2\65\5\3\2\2\2\66\64\3\2\2\2\679\5\b\5\2") - buf.write("8\67\3\2\2\29:\3\2\2\2:8\3\2\2\2:;\3\2\2\2;\7\3\2\2\2") - buf.write("D\5\20\t\2?D\5\24\13\2@D\5\30\r") - buf.write("\2AD\5\22\n\2BD\5\32\16\2C<\3\2\2\2C=\3\2\2\2C>\3\2\2") - buf.write("\2C?\3\2\2\2C@\3\2\2\2CA\3\2\2\2CB\3\2\2\2D\t\3\2\2\2") - buf.write("EH\5\f\7\2FH\5\16\b\2GE\3\2\2\2GF\3\2\2\2H\13\3\2\2\2") - buf.write("IJ\7\3\2\2JK\5&\24\2KL\7\4\2\2LM\5\6\4\2MN\7\5\2\2N\r") - buf.write("\3\2\2\2OP\7\3\2\2PQ\5&\24\2QR\7\4\2\2RS\5\6\4\2ST\7\5") - buf.write("\2\2TU\7\6\2\2UV\7\4\2\2VW\5\6\4\2WX\7\5\2\2X\17\3\2\2") - buf.write("\2YZ\7\7\2\2Z[\5,\27\2[\\\7\4\2\2\\]\5\6\4\2]^\7\5\2\2") - buf.write("^\21\3\2\2\2_`\7\b\2\2`a\7\t\2\2ab\5$\23\2bc\7\n\2\2c") - buf.write("d\5$\23\2de\7\13\2\2e\23\3\2\2\2fg\5\26\f\2gh\5$\23\2") - buf.write("h\25\3\2\2\2ij\t\2\2\2j\27\3\2\2\2kl\t\3\2\2l\31\3\2\2") - buf.write("\2mn\7\22\2\2n\33\3\2\2\2op\7#\2\2pq\7\23\2\2qr\5$\23") - buf.write("\2r\35\3\2\2\2st\t\4\2\2t\37\3\2\2\2uv\t\5\2\2v!\3\2\2") - buf.write("\2wx\7\25\2\2x#\3\2\2\2yz\b\23\1\2z{\5\"\22\2{|\5$\23") - buf.write("\b|\u0086\3\2\2\2}~\7\t\2\2~\177\5$\23\2\177\u0080\7\13") - buf.write("\2\2\u0080\u0086\3\2\2\2\u0081\u0086\5,\27\2\u0082\u0083") - buf.write("\7#\2\2\u0083\u0084\7\23\2\2\u0084\u0086\5$\23\3\u0085") - buf.write("y\3\2\2\2\u0085}\3\2\2\2\u0085\u0081\3\2\2\2\u0085\u0082") - buf.write("\3\2\2\2\u0086\u0091\3\2\2\2\u0087\u0088\f\7\2\2\u0088") - buf.write("\u0089\5\36\20\2\u0089\u008a\5$\23\b\u008a\u0090\3\2\2") - buf.write("\2\u008b\u008c\f\6\2\2\u008c\u008d\5 \21\2\u008d\u008e") - buf.write("\5$\23\7\u008e\u0090\3\2\2\2\u008f\u0087\3\2\2\2\u008f") - buf.write("\u008b\3\2\2\2\u0090\u0093\3\2\2\2\u0091\u008f\3\2\2\2") - buf.write("\u0091\u0092\3\2\2\2\u0092%\3\2\2\2\u0093\u0091\3\2\2") - buf.write("\2\u0094\u0095\b\24\1\2\u0095\u0096\7!\2\2\u0096\u00a1") - buf.write("\5&\24\7\u0097\u0098\5$\23\2\u0098\u0099\5(\25\2\u0099") - buf.write("\u009a\5$\23\2\u009a\u00a1\3\2\2\2\u009b\u00a1\7\30\2") - buf.write("\2\u009c\u009d\7\t\2\2\u009d\u009e\5&\24\2\u009e\u009f") - buf.write("\7\13\2\2\u009f\u00a1\3\2\2\2\u00a0\u0094\3\2\2\2\u00a0") - buf.write("\u0097\3\2\2\2\u00a0\u009b\3\2\2\2\u00a0\u009c\3\2\2\2") - buf.write("\u00a1\u00a8\3\2\2\2\u00a2\u00a3\f\5\2\2\u00a3\u00a4\5") - buf.write("*\26\2\u00a4\u00a5\5&\24\6\u00a5\u00a7\3\2\2\2\u00a6\u00a2") - buf.write("\3\2\2\2\u00a7\u00aa\3\2\2\2\u00a8\u00a6\3\2\2\2\u00a8") - buf.write("\u00a9\3\2\2\2\u00a9\'\3\2\2\2\u00aa\u00a8\3\2\2\2\u00ab") - buf.write("\u00ac\t\6\2\2\u00ac)\3\2\2\2\u00ad\u00ae\t\7\2\2\u00ae") - buf.write("+\3\2\2\2\u00af\u00b0\t\b\2\2\u00b0-\3\2\2\2\13\64:CG") - buf.write("\u0085\u008f\u0091\u00a0\u00a8") + buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\3\2") + buf.write("\3\2\3\2\3\3\7\3\65\n\3\f\3\16\38\13\3\3\4\6\4;\n\4\r") + buf.write("\4\16\4<\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5G\n\5\3\6") + buf.write("\3\6\5\6K\n\6\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b") + buf.write("\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3") + buf.write("\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\f\3\f\3\r\3\r") + buf.write("\3\16\3\16\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20") + buf.write("\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24\3\24\3\24\3\24") + buf.write("\3\24\3\24\3\24\3\24\3\24\3\24\3\24\5\24\u008e\n\24\3") + buf.write("\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\7\24\u0098\n\24") + buf.write("\f\24\16\24\u009b\13\24\3\25\3\25\3\25\3\25\3\25\3\25") + buf.write("\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u00a9\n\25\3\25\3") + buf.write("\25\3\25\3\25\7\25\u00af\n\25\f\25\16\25\u00b2\13\25\3") + buf.write("\26\3\26\3\27\3\27\3\30\3\30\3\30\2\4&(\31\2\4\6\b\n\f") + buf.write("\16\20\22\24\26\30\32\34\36 \"$&(*,.\2\t\3\2\f\17\3\2") + buf.write("\20\21\3\2\27\30\3\2\25\26\3\2\32\37\3\2 !\3\2#$\2\u00b5") + buf.write("\2\60\3\2\2\2\4\66\3\2\2\2\6:\3\2\2\2\bF\3\2\2\2\nJ\3") + buf.write("\2\2\2\fL\3\2\2\2\16R\3\2\2\2\20\\\3\2\2\2\22b\3\2\2\2") + buf.write("\24i\3\2\2\2\26l\3\2\2\2\30n\3\2\2\2\32p\3\2\2\2\34r\3") + buf.write("\2\2\2\36v\3\2\2\2 {\3\2\2\2\"}\3\2\2\2$\177\3\2\2\2&") + buf.write("\u008d\3\2\2\2(\u00a8\3\2\2\2*\u00b3\3\2\2\2,\u00b5\3") + buf.write("\2\2\2.\u00b7\3\2\2\2\60\61\5\4\3\2\61\62\7\2\2\3\62\3") + buf.write("\3\2\2\2\63\65\5\b\5\2\64\63\3\2\2\2\658\3\2\2\2\66\64") + buf.write("\3\2\2\2\66\67\3\2\2\2\67\5\3\2\2\28\66\3\2\2\29;\5\b") + buf.write("\5\2:9\3\2\2\2;<\3\2\2\2<:\3\2\2\2<=\3\2\2\2=\7\3\2\2") + buf.write("\2>G\5\34\17\2?G\5\36\20\2@G\5\n\6\2AG\5\20\t\2BG\5\24") + buf.write("\13\2CG\5\30\r\2DG\5\22\n\2EG\5\32\16\2F>\3\2\2\2F?\3") + buf.write("\2\2\2F@\3\2\2\2FA\3\2\2\2FB\3\2\2\2FC\3\2\2\2FD\3\2\2") + buf.write("\2FE\3\2\2\2G\t\3\2\2\2HK\5\f\7\2IK\5\16\b\2JH\3\2\2\2") + buf.write("JI\3\2\2\2K\13\3\2\2\2LM\7\3\2\2MN\5(\25\2NO\7\4\2\2O") + buf.write("P\5\6\4\2PQ\7\5\2\2Q\r\3\2\2\2RS\7\3\2\2ST\5(\25\2TU\7") + buf.write("\4\2\2UV\5\6\4\2VW\7\5\2\2WX\7\6\2\2XY\7\4\2\2YZ\5\6\4") + buf.write("\2Z[\7\5\2\2[\17\3\2\2\2\\]\7\7\2\2]^\5.\30\2^_\7\4\2") + buf.write("\2_`\5\6\4\2`a\7\5\2\2a\21\3\2\2\2bc\7\b\2\2cd\7\t\2\2") + buf.write("de\5&\24\2ef\7\n\2\2fg\5&\24\2gh\7\13\2\2h\23\3\2\2\2") + buf.write("ij\5\26\f\2jk\5&\24\2k\25\3\2\2\2lm\t\2\2\2m\27\3\2\2") + buf.write("\2no\t\3\2\2o\31\3\2\2\2pq\7\22\2\2q\33\3\2\2\2rs\7$\2") + buf.write("\2st\7\23\2\2tu\5&\24\2u\35\3\2\2\2vw\7\24\2\2wx\7\t\2") + buf.write("\2xy\5&\24\2yz\7\13\2\2z\37\3\2\2\2{|\t\4\2\2|!\3\2\2") + buf.write("\2}~\t\5\2\2~#\3\2\2\2\177\u0080\7\26\2\2\u0080%\3\2\2") + buf.write("\2\u0081\u0082\b\24\1\2\u0082\u0083\5$\23\2\u0083\u0084") + buf.write("\5&\24\b\u0084\u008e\3\2\2\2\u0085\u0086\7\t\2\2\u0086") + buf.write("\u0087\5&\24\2\u0087\u0088\7\13\2\2\u0088\u008e\3\2\2") + buf.write("\2\u0089\u008e\5.\30\2\u008a\u008b\7$\2\2\u008b\u008c") + buf.write("\7\23\2\2\u008c\u008e\5&\24\3\u008d\u0081\3\2\2\2\u008d") + buf.write("\u0085\3\2\2\2\u008d\u0089\3\2\2\2\u008d\u008a\3\2\2\2") + buf.write("\u008e\u0099\3\2\2\2\u008f\u0090\f\7\2\2\u0090\u0091\5") + buf.write(" \21\2\u0091\u0092\5&\24\b\u0092\u0098\3\2\2\2\u0093\u0094") + buf.write("\f\6\2\2\u0094\u0095\5\"\22\2\u0095\u0096\5&\24\7\u0096") + buf.write("\u0098\3\2\2\2\u0097\u008f\3\2\2\2\u0097\u0093\3\2\2\2") + buf.write("\u0098\u009b\3\2\2\2\u0099\u0097\3\2\2\2\u0099\u009a\3") + buf.write("\2\2\2\u009a\'\3\2\2\2\u009b\u0099\3\2\2\2\u009c\u009d") + buf.write("\b\25\1\2\u009d\u009e\7\"\2\2\u009e\u00a9\5(\25\7\u009f") + buf.write("\u00a0\5&\24\2\u00a0\u00a1\5*\26\2\u00a1\u00a2\5&\24\2") + buf.write("\u00a2\u00a9\3\2\2\2\u00a3\u00a9\7\31\2\2\u00a4\u00a5") + buf.write("\7\t\2\2\u00a5\u00a6\5(\25\2\u00a6\u00a7\7\13\2\2\u00a7") + buf.write("\u00a9\3\2\2\2\u00a8\u009c\3\2\2\2\u00a8\u009f\3\2\2\2") + buf.write("\u00a8\u00a3\3\2\2\2\u00a8\u00a4\3\2\2\2\u00a9\u00b0\3") + buf.write("\2\2\2\u00aa\u00ab\f\5\2\2\u00ab\u00ac\5,\27\2\u00ac\u00ad") + buf.write("\5(\25\6\u00ad\u00af\3\2\2\2\u00ae\u00aa\3\2\2\2\u00af") + buf.write("\u00b2\3\2\2\2\u00b0\u00ae\3\2\2\2\u00b0\u00b1\3\2\2\2") + buf.write("\u00b1)\3\2\2\2\u00b2\u00b0\3\2\2\2\u00b3\u00b4\t\6\2") + buf.write("\2\u00b4+\3\2\2\2\u00b5\u00b6\t\7\2\2\u00b6-\3\2\2\2\u00b7") + buf.write("\u00b8\t\b\2\2\u00b8/\3\2\2\2\13\66", "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", "'penup'", "'pendown'", "'pause'", - "'='", "'+'", "'-'", "'*'", "'/'", "'pendown?'", "'<'", - "'>'", "'=='", "'!='", "'<='", "'>='", "'&&'", "'||'", - "'!'" ] + "'='", "'print'", "'+'", "'-'", "'*'", "'/'", "'pendown?'", + "'<'", "'>'", "'=='", "'!='", "'<='", "'>='", "'&&'", + "'||'", "'!'" ] symbolicNames = [ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "PLUS", "MINUS", "MUL", - "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", - "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", "Whitespace" ] + "", "", "", "PLUS", "MINUS", + "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", + "LTE", "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", + "Whitespace" ] RULE_start = 0 RULE_instruction_list = 1 @@ -115,21 +120,22 @@ class tlangParser ( Parser ): RULE_penCommand = 11 RULE_pauseCommand = 12 RULE_assignment = 13 - RULE_multiplicative = 14 - RULE_additive = 15 - RULE_unaryArithOp = 16 - RULE_expression = 17 - RULE_condition = 18 - RULE_binCondOp = 19 - RULE_logicOp = 20 - RULE_value = 21 + RULE_printStatement = 14 + RULE_multiplicative = 15 + RULE_additive = 16 + RULE_unaryArithOp = 17 + RULE_expression = 18 + RULE_condition = 19 + RULE_binCondOp = 20 + RULE_logicOp = 21 + RULE_value = 22 ruleNames = [ "start", "instruction_list", "strict_ilist", "instruction", "conditional", "ifConditional", "ifElseConditional", "loop", "gotoCommand", "moveCommand", "moveOp", "penCommand", - "pauseCommand", "assignment", "multiplicative", "additive", - "unaryArithOp", "expression", "condition", "binCondOp", - "logicOp", "value" ] + "pauseCommand", "assignment", "printStatement", "multiplicative", + "additive", "unaryArithOp", "expression", "condition", + "binCondOp", "logicOp", "value" ] EOF = Token.EOF T__0=1 @@ -149,24 +155,25 @@ class tlangParser ( Parser ): T__14=15 T__15=16 T__16=17 - PLUS=18 - MINUS=19 - MUL=20 - DIV=21 - PENCOND=22 - LT=23 - GT=24 - EQ=25 - NEQ=26 - LTE=27 - GTE=28 - AND=29 - OR=30 - NOT=31 - NUM=32 - VAR=33 - NAME=34 - Whitespace=35 + T__17=18 + PLUS=19 + MINUS=20 + MUL=21 + DIV=22 + PENCOND=23 + LT=24 + GT=25 + EQ=26 + NEQ=27 + LTE=28 + GTE=29 + AND=30 + OR=31 + NOT=32 + NUM=33 + VAR=34 + NAME=35 + Whitespace=36 def __init__(self, input:TokenStream, output:TextIO = sys.stdout): super().__init__(input, output) @@ -208,9 +215,9 @@ def start(self): self.enterRule(localctx, 0, self.RULE_start) try: self.enterOuterAlt(localctx, 1) - self.state = 44 + self.state = 46 self.instruction_list() - self.state = 45 + self.state = 47 self.match(tlangParser.EOF) except RecognitionException as re: localctx.exception = re @@ -253,13 +260,13 @@ def instruction_list(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 50 + self.state = 52 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.VAR))) != 0): - self.state = 47 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.VAR))) != 0): + self.state = 49 self.instruction() - self.state = 52 + self.state = 54 self._errHandler.sync(self) _la = self._input.LA(1) @@ -304,16 +311,16 @@ def strict_ilist(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 54 + self.state = 56 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 53 + self.state = 55 self.instruction() - self.state = 56 + self.state = 58 self._errHandler.sync(self) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.VAR))) != 0)): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.VAR))) != 0)): break except RecognitionException as re: @@ -335,6 +342,10 @@ def assignment(self): return self.getTypedRuleContext(tlangParser.AssignmentContext,0) + def printStatement(self): + return self.getTypedRuleContext(tlangParser.PrintStatementContext,0) + + def conditional(self): return self.getTypedRuleContext(tlangParser.ConditionalContext,0) @@ -376,42 +387,47 @@ def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) self.enterRule(localctx, 6, self.RULE_instruction) try: - self.state = 65 + self.state = 68 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.VAR]: self.enterOuterAlt(localctx, 1) - self.state = 58 + self.state = 60 self.assignment() pass - elif token in [tlangParser.T__0]: + elif token in [tlangParser.T__17]: self.enterOuterAlt(localctx, 2) - self.state = 59 + self.state = 61 + self.printStatement() + pass + elif token in [tlangParser.T__0]: + self.enterOuterAlt(localctx, 3) + self.state = 62 self.conditional() pass elif token in [tlangParser.T__4]: - self.enterOuterAlt(localctx, 3) - self.state = 60 + self.enterOuterAlt(localctx, 4) + self.state = 63 self.loop() pass elif token in [tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12]: - self.enterOuterAlt(localctx, 4) - self.state = 61 + self.enterOuterAlt(localctx, 5) + self.state = 64 self.moveCommand() pass elif token in [tlangParser.T__13, tlangParser.T__14]: - self.enterOuterAlt(localctx, 5) - self.state = 62 + self.enterOuterAlt(localctx, 6) + self.state = 65 self.penCommand() pass elif token in [tlangParser.T__5]: - self.enterOuterAlt(localctx, 6) - self.state = 63 + self.enterOuterAlt(localctx, 7) + self.state = 66 self.gotoCommand() pass elif token in [tlangParser.T__15]: - self.enterOuterAlt(localctx, 7) - self.state = 64 + self.enterOuterAlt(localctx, 8) + self.state = 67 self.pauseCommand() pass else: @@ -457,18 +473,18 @@ def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) self.enterRule(localctx, 8, self.RULE_conditional) try: - self.state = 69 + self.state = 72 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,3,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 67 + self.state = 70 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 68 + self.state = 71 self.ifElseConditional() pass @@ -514,15 +530,15 @@ def ifConditional(self): self.enterRule(localctx, 10, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 71 + self.state = 74 self.match(tlangParser.T__0) - self.state = 72 + self.state = 75 self.condition(0) - self.state = 73 + self.state = 76 self.match(tlangParser.T__1) - self.state = 74 + self.state = 77 self.strict_ilist() - self.state = 75 + self.state = 78 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -568,23 +584,23 @@ def ifElseConditional(self): self.enterRule(localctx, 12, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 77 + self.state = 80 self.match(tlangParser.T__0) - self.state = 78 + self.state = 81 self.condition(0) - self.state = 79 + self.state = 82 self.match(tlangParser.T__1) - self.state = 80 + self.state = 83 self.strict_ilist() - self.state = 81 + self.state = 84 self.match(tlangParser.T__2) - self.state = 82 + self.state = 85 self.match(tlangParser.T__3) - self.state = 83 + self.state = 86 self.match(tlangParser.T__1) - self.state = 84 + self.state = 87 self.strict_ilist() - self.state = 85 + self.state = 88 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -627,15 +643,15 @@ def loop(self): self.enterRule(localctx, 14, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 87 + self.state = 90 self.match(tlangParser.T__4) - self.state = 88 + self.state = 91 self.value() - self.state = 89 + self.state = 92 self.match(tlangParser.T__1) - self.state = 90 + self.state = 93 self.strict_ilist() - self.state = 91 + self.state = 94 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -677,17 +693,17 @@ def gotoCommand(self): self.enterRule(localctx, 16, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 93 + self.state = 96 self.match(tlangParser.T__5) - self.state = 94 + self.state = 97 self.match(tlangParser.T__6) - self.state = 95 + self.state = 98 self.expression(0) - self.state = 96 + self.state = 99 self.match(tlangParser.T__7) - self.state = 97 + self.state = 100 self.expression(0) - self.state = 98 + self.state = 101 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -730,9 +746,9 @@ def moveCommand(self): self.enterRule(localctx, 18, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 100 + self.state = 103 self.moveOp() - self.state = 101 + self.state = 104 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -769,7 +785,7 @@ def moveOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 103 + self.state = 106 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -811,7 +827,7 @@ def penCommand(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 105 + self.state = 108 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -852,7 +868,7 @@ def pauseCommand(self): self.enterRule(localctx, 24, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 107 + self.state = 110 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -894,11 +910,11 @@ def assignment(self): self.enterRule(localctx, 26, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 109 + self.state = 112 self.match(tlangParser.VAR) - self.state = 110 + self.state = 113 self.match(tlangParser.T__16) - self.state = 111 + self.state = 114 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -909,6 +925,51 @@ def assignment(self): return localctx + class PrintStatementContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def expression(self): + return self.getTypedRuleContext(tlangParser.ExpressionContext,0) + + + def getRuleIndex(self): + return tlangParser.RULE_printStatement + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitPrintStatement" ): + return visitor.visitPrintStatement(self) + else: + return visitor.visitChildren(self) + + + + + def printStatement(self): + + localctx = tlangParser.PrintStatementContext(self, self._ctx, self.state) + self.enterRule(localctx, 28, self.RULE_printStatement) + try: + self.enterOuterAlt(localctx, 1) + self.state = 116 + self.match(tlangParser.T__17) + self.state = 117 + self.match(tlangParser.T__6) + self.state = 118 + self.expression(0) + self.state = 119 + self.match(tlangParser.T__8) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class MultiplicativeContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -936,11 +997,11 @@ def accept(self, visitor:ParseTreeVisitor): def multiplicative(self): localctx = tlangParser.MultiplicativeContext(self, self._ctx, self.state) - self.enterRule(localctx, 28, self.RULE_multiplicative) + self.enterRule(localctx, 30, self.RULE_multiplicative) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 113 + self.state = 121 _la = self._input.LA(1) if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) @@ -983,11 +1044,11 @@ def accept(self, visitor:ParseTreeVisitor): def additive(self): localctx = tlangParser.AdditiveContext(self, self._ctx, self.state) - self.enterRule(localctx, 30, self.RULE_additive) + self.enterRule(localctx, 32, self.RULE_additive) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 115 + self.state = 123 _la = self._input.LA(1) if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) @@ -1027,10 +1088,10 @@ def accept(self, visitor:ParseTreeVisitor): def unaryArithOp(self): localctx = tlangParser.UnaryArithOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 32, self.RULE_unaryArithOp) + self.enterRule(localctx, 34, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 117 + self.state = 125 self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re @@ -1181,11 +1242,11 @@ def expression(self, _p:int=0): _parentState = self.state localctx = tlangParser.ExpressionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 34 - self.enterRecursionRule(localctx, 34, self.RULE_expression, _p) + _startState = 36 + self.enterRecursionRule(localctx, 36, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 131 + self.state = 139 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,4,self._ctx) if la_ == 1: @@ -1193,9 +1254,9 @@ def expression(self, _p:int=0): self._ctx = localctx _prevctx = localctx - self.state = 120 + self.state = 128 self.unaryArithOp() - self.state = 121 + self.state = 129 self.expression(6) pass @@ -1203,11 +1264,11 @@ def expression(self, _p:int=0): localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 123 + self.state = 131 self.match(tlangParser.T__6) - self.state = 124 + self.state = 132 self.expression(0) - self.state = 125 + self.state = 133 self.match(tlangParser.T__8) pass @@ -1215,7 +1276,7 @@ def expression(self, _p:int=0): localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 127 + self.state = 135 self.value() pass @@ -1223,17 +1284,17 @@ def expression(self, _p:int=0): localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 128 + self.state = 136 self.match(tlangParser.VAR) - self.state = 129 + self.state = 137 self.match(tlangParser.T__16) - self.state = 130 + self.state = 138 self.expression(1) pass self._ctx.stop = self._input.LT(-1) - self.state = 143 + self.state = 151 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,6,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -1241,37 +1302,37 @@ def expression(self, _p:int=0): if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 141 + self.state = 149 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,5,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 133 + self.state = 141 if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 134 + self.state = 142 self.multiplicative() - self.state = 135 + self.state = 143 self.expression(6) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 137 + self.state = 145 if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") - self.state = 138 + self.state = 146 self.additive() - self.state = 139 + self.state = 147 self.expression(5) pass - self.state = 145 + self.state = 153 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,6,self._ctx) @@ -1334,46 +1395,46 @@ def condition(self, _p:int=0): _parentState = self.state localctx = tlangParser.ConditionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 36 - self.enterRecursionRule(localctx, 36, self.RULE_condition, _p) + _startState = 38 + self.enterRecursionRule(localctx, 38, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 158 + self.state = 166 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,7,self._ctx) if la_ == 1: - self.state = 147 + self.state = 155 self.match(tlangParser.NOT) - self.state = 148 + self.state = 156 self.condition(5) pass elif la_ == 2: - self.state = 149 + self.state = 157 self.expression(0) - self.state = 150 + self.state = 158 self.binCondOp() - self.state = 151 + self.state = 159 self.expression(0) pass elif la_ == 3: - self.state = 153 + self.state = 161 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 154 + self.state = 162 self.match(tlangParser.T__6) - self.state = 155 + self.state = 163 self.condition(0) - self.state = 156 + self.state = 164 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 166 + self.state = 174 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,8,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -1383,15 +1444,15 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 160 + self.state = 168 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 161 + self.state = 169 self.logicOp() - self.state = 162 + self.state = 170 self.condition(4) - self.state = 168 + self.state = 176 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,8,self._ctx) @@ -1443,11 +1504,11 @@ def accept(self, visitor:ParseTreeVisitor): def binCondOp(self): localctx = tlangParser.BinCondOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 38, self.RULE_binCondOp) + self.enterRule(localctx, 40, self.RULE_binCondOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 169 + self.state = 177 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -1490,11 +1551,11 @@ def accept(self, visitor:ParseTreeVisitor): def logicOp(self): localctx = tlangParser.LogicOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 40, self.RULE_logicOp) + self.enterRule(localctx, 42, self.RULE_logicOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 171 + self.state = 179 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -1537,11 +1598,11 @@ def accept(self, visitor:ParseTreeVisitor): def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) - self.enterRule(localctx, 42, self.RULE_value) + self.enterRule(localctx, 44, self.RULE_value) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 173 + self.state = 181 _la = self._input.LA(1) if not(_la==tlangParser.NUM or _la==tlangParser.VAR): self._errHandler.recoverInline(self) @@ -1561,8 +1622,8 @@ def value(self): def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): if self._predicates == None: self._predicates = dict() - self._predicates[17] = self.expression_sempred - self._predicates[18] = self.condition_sempred + self._predicates[18] = self.expression_sempred + self._predicates[19] = self.condition_sempred pred = self._predicates.get(ruleIndex, None) if pred is None: raise Exception("No predicate with index:" + str(ruleIndex)) diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index bd3a652..945d9dd 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -79,6 +79,11 @@ def visitAssignment(self, ctx:tlangParser.AssignmentContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#printStatement. + def visitPrintStatement(self, ctx:tlangParser.PrintStatementContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#multiplicative. def visitMultiplicative(self, ctx:tlangParser.MultiplicativeContext): return self.visitChildren(ctx) From 48b5d65c367a194164fd9328d46f0e17338f5ab1 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Mon, 10 Feb 2025 02:06:33 +0530 Subject: [PATCH 03/47] adding list support (nested) --- ChironCore/ChironAST/ChironAST.py | 17 + ChironCore/ChironAST/builder.py | 60 +- ChironCore/example/kachuapur.tl | 12 +- ChironCore/interpreter.py | 6 +- ChironCore/turtparse/tlang.g4 | 15 +- ChironCore/turtparse/tlang.interp | 7 +- ChironCore/turtparse/tlang.tokens | 66 ++- ChironCore/turtparse/tlangLexer.interp | 5 +- ChironCore/turtparse/tlangLexer.py | 217 +++---- ChironCore/turtparse/tlangLexer.tokens | 66 ++- ChironCore/turtparse/tlangParser.py | 771 +++++++++++++++++-------- ChironCore/turtparse/tlangVisitor.py | 15 + 12 files changed, 810 insertions(+), 447 deletions(-) diff --git a/ChironCore/ChironAST/ChironAST.py b/ChironCore/ChironAST/ChironAST.py index 4b368cb..260848b 100644 --- a/ChironCore/ChironAST/ChironAST.py +++ b/ChironCore/ChironAST/ChironAST.py @@ -239,3 +239,20 @@ def __init__(self, vname): def __str__(self): return self.varname + +class Array(Value): + def __init__(self, vname): + self.arr = vname + + def __str__(self): + return self.arr + +class ArrayAccess(Value): + def __init__(self, var, index): + self.var = var + self.idx = index + + def __str__(self): + indices_str = "".join(f"[{idx}]" for idx in self.idx) # Format multiple indices + return f"{self.var}{indices_str}" + # return self.var.__str__() + "[" + self.idx.__str__() + "]" \ No newline at end of file diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 4294e6c..499df97 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -19,6 +19,12 @@ def __init__(self): self.repeatInstrCount = 0 # keeps count for no of 'repeat' instructions self.stmtList=[] + def getLval(self,ctx): + if ctx.VAR(): + return ChironAST.Var(ctx.VAR().getText()) + elif ctx.arrayAccess(): + return self.visitArrayAccess(ctx.arrayAccess()) + def visitStart(self, ctx:tlangParser.StartContext): stmtList = self.visit(ctx.instruction_list()) self.stmtList.extend(stmtList) @@ -41,12 +47,14 @@ def visitStrict_ilist(self, ctx:tlangParser.Strict_ilistContext): return instrList + #computes list of recursive assign statements def visitAssignment(self, ctx:tlangParser.AssignmentContext): - print(ctx.VAR().getText(),ctx.expression().getText()) - lval = ChironAST.Var(ctx.VAR().getText()) + # print(ctx.VAR().getText(),ctx.expression().getText()) + lval = self.getLval(ctx) rval = self.visit(ctx.expression()) + # print(rval) if isinstance(rval, list): print(rval[-1][0]) rvaln = rval[-1][0].lvar # Get the last assigned variable as rval @@ -55,6 +63,26 @@ def visitAssignment(self, ctx:tlangParser.AssignmentContext): # Otherwise, just return a normal assignment return [(ChironAST.AssignmentCommand(lval, rval), 1)] + def visitArrayAccess(self, ctx:tlangParser.ArrayAccessContext): + var = ctx.VAR().getText() + indices = [self.visit(expr).val for expr in ctx.expression()] # Visit all expressions in [] + + # print(var, indices, "Inside multi-dimensional array access") + + return ChironAST.ArrayAccess(var, indices) # Return an object handling multiple indices + + def visitValue(self, ctx:tlangParser.ValueContext): + if ctx.NUM(): + return ChironAST.Num(ctx.NUM().getText()) + elif ctx.VAR(): + return ChironAST.Var(ctx.VAR().getText()) + elif ctx.array(): + return ChironAST.Array(ctx.array().getText()) + elif ctx.arrayAccess(): + print("entering heaven") + return self.visitArrayAccess(ctx.arrayAccess()) + + def visitAssignExpr(self, ctx: tlangParser.AssignExprContext): print("Assignment Expr") @@ -92,10 +120,6 @@ def visitGotoCommand(self, ctx:tlangParser.GotoCommandContext): # Visit a parse tree produced by tlangParser#unaryExpr. def visitUnaryExpr(self, ctx:tlangParser.UnaryExprContext): expr1 = self.visit(ctx.expression()) - # if isinstance(expr1, list): - # print("Unary & assignlist",expr1[-1][0]) - # expr1 = expr1[-1][0].lvar # Get the last assigned variable as rval - if ctx.unaryArithOp().MINUS(): return ChironAST.UMinus(expr1) @@ -104,20 +128,8 @@ def visitUnaryExpr(self, ctx:tlangParser.UnaryExprContext): # Visit a parse tree produced by tlangParser#addExpr. def visitAddExpr(self, ctx:tlangParser.AddExprContext): - print("visiting add expr") - # left_list=[] - # right_list=[] left = self.visit(ctx.expression(0)) - # if isinstance(left, list): - # left_list=left - # print("add and assignlist",left_list[-1][0]) - # left = left_list[-1][0].lvar # Get the last assigned variable as rval - right = self.visit(ctx.expression(1)) - # if isinstance(right, list): - # right_list=right - # print("add and assignlist",right_list[-1][0]) - # right = right_list[-1][0].lvar # Get the last assigned variable as rval if ctx.additive().PLUS(): ext= ChironAST.Sum(left, right) elif ctx.additive().MINUS(): @@ -184,11 +196,13 @@ def visitCondition(self, ctx:tlangParser.ConditionContext): return self.visitChildren(ctx) - def visitValue(self, ctx:tlangParser.ValueContext): - if ctx.NUM(): - return ChironAST.Num(ctx.NUM().getText()) - elif ctx.VAR(): - return ChironAST.Var(ctx.VAR().getText()) + + + + + + + def visitLoop(self, ctx:tlangParser.LoopContext): # insert counter variable in IR for tracking repeat count diff --git a/ChironCore/example/kachuapur.tl b/ChironCore/example/kachuapur.tl index be3bc51..b9d7a2f 100644 --- a/ChironCore/example/kachuapur.tl +++ b/ChironCore/example/kachuapur.tl @@ -1,6 +1,6 @@ -:i = 0 -repeat 8 [ - :i = 1 + :i - right(90) - forward(:delta * :i) -] +:i = [1,[2,3,4],3,4] +:i[1][0] = 30 +print(:i[0]=90) +:j= :i[0] = :k = 6 + :i[0] +print(:j) +print(:i) \ No newline at end of file diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index f7d1a3e..2cdc098 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -136,10 +136,10 @@ def initProgramContext(self, params): def handleAssignment(self, stmt, tgt): print(" Assignment Statement") lhs = str(stmt.lvar).replace(":","") - if isinstance(stmt.rexpr, ChironAST.AssignmentCommand): - print("this is nested") rhs = addContext(stmt.rexpr) - exec("setattr(self.prg,\"%s\",%s)" % (lhs,rhs)) + print(lhs,rhs,"Assignment") + # exec("setattr(self.prg,\"%s\",%s)" % (lhs,rhs)) + exec(f"self.prg.{lhs} = {rhs}") return 1 def handlePrint(self,stmt,tgt): diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index ce24946..c72c691 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -37,9 +37,12 @@ penCommand : 'penup' | 'pendown' ; pauseCommand : 'pause' ; +array + : '[' ( expression ( ',' expression )* )? ']' + ; assignment : - VAR '=' expression + ( VAR | arrayAccess| memberAccess ) '=' expression ; printStatement : 'print' '(' expression ')' ; @@ -61,10 +64,16 @@ expression : | expression additive expression #addExpr | '(' expression ')' #parenExpr | value #valueExpr - | VAR '=' expression #assignExpr + | ( VAR | arrayAccess | memberAccess ) '=' expression #assignExpr ; +arrayAccess + : VAR ('[' expression ']')+ + ; +memberAccess + : value ('.' value)+ ; + // TODO : @@ -96,6 +105,8 @@ NOT: '!' ; value : NUM | VAR + | array + | arrayAccess ; NUM : [0-9]+ ; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index c038128..24c5424 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -18,6 +18,7 @@ null 'pause' '=' 'print' +'.' '+' '-' '*' @@ -57,6 +58,7 @@ null null null null +null PLUS MINUS MUL @@ -90,12 +92,15 @@ moveCommand moveOp penCommand pauseCommand +array assignment printStatement multiplicative additive unaryArithOp expression +arrayAccess +memberAccess condition binCondOp logicOp @@ -103,4 +108,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 38, 186, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 53, 10, 3, 12, 3, 14, 3, 56, 11, 3, 3, 4, 6, 4, 59, 10, 4, 13, 4, 14, 4, 60, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 71, 10, 5, 3, 6, 3, 6, 5, 6, 75, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 5, 20, 142, 10, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 152, 10, 20, 12, 20, 14, 20, 155, 11, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 5, 21, 169, 10, 21, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 175, 10, 21, 12, 21, 14, 21, 178, 11, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 2, 4, 38, 40, 25, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 2, 9, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 23, 24, 3, 2, 21, 22, 3, 2, 26, 31, 3, 2, 32, 33, 3, 2, 35, 36, 2, 181, 2, 48, 3, 2, 2, 2, 4, 54, 3, 2, 2, 2, 6, 58, 3, 2, 2, 2, 8, 70, 3, 2, 2, 2, 10, 74, 3, 2, 2, 2, 12, 76, 3, 2, 2, 2, 14, 82, 3, 2, 2, 2, 16, 92, 3, 2, 2, 2, 18, 98, 3, 2, 2, 2, 20, 105, 3, 2, 2, 2, 22, 108, 3, 2, 2, 2, 24, 110, 3, 2, 2, 2, 26, 112, 3, 2, 2, 2, 28, 114, 3, 2, 2, 2, 30, 118, 3, 2, 2, 2, 32, 123, 3, 2, 2, 2, 34, 125, 3, 2, 2, 2, 36, 127, 3, 2, 2, 2, 38, 141, 3, 2, 2, 2, 40, 168, 3, 2, 2, 2, 42, 179, 3, 2, 2, 2, 44, 181, 3, 2, 2, 2, 46, 183, 3, 2, 2, 2, 48, 49, 5, 4, 3, 2, 49, 50, 7, 2, 2, 3, 50, 3, 3, 2, 2, 2, 51, 53, 5, 8, 5, 2, 52, 51, 3, 2, 2, 2, 53, 56, 3, 2, 2, 2, 54, 52, 3, 2, 2, 2, 54, 55, 3, 2, 2, 2, 55, 5, 3, 2, 2, 2, 56, 54, 3, 2, 2, 2, 57, 59, 5, 8, 5, 2, 58, 57, 3, 2, 2, 2, 59, 60, 3, 2, 2, 2, 60, 58, 3, 2, 2, 2, 60, 61, 3, 2, 2, 2, 61, 7, 3, 2, 2, 2, 62, 71, 5, 28, 15, 2, 63, 71, 5, 30, 16, 2, 64, 71, 5, 10, 6, 2, 65, 71, 5, 16, 9, 2, 66, 71, 5, 20, 11, 2, 67, 71, 5, 24, 13, 2, 68, 71, 5, 18, 10, 2, 69, 71, 5, 26, 14, 2, 70, 62, 3, 2, 2, 2, 70, 63, 3, 2, 2, 2, 70, 64, 3, 2, 2, 2, 70, 65, 3, 2, 2, 2, 70, 66, 3, 2, 2, 2, 70, 67, 3, 2, 2, 2, 70, 68, 3, 2, 2, 2, 70, 69, 3, 2, 2, 2, 71, 9, 3, 2, 2, 2, 72, 75, 5, 12, 7, 2, 73, 75, 5, 14, 8, 2, 74, 72, 3, 2, 2, 2, 74, 73, 3, 2, 2, 2, 75, 11, 3, 2, 2, 2, 76, 77, 7, 3, 2, 2, 77, 78, 5, 40, 21, 2, 78, 79, 7, 4, 2, 2, 79, 80, 5, 6, 4, 2, 80, 81, 7, 5, 2, 2, 81, 13, 3, 2, 2, 2, 82, 83, 7, 3, 2, 2, 83, 84, 5, 40, 21, 2, 84, 85, 7, 4, 2, 2, 85, 86, 5, 6, 4, 2, 86, 87, 7, 5, 2, 2, 87, 88, 7, 6, 2, 2, 88, 89, 7, 4, 2, 2, 89, 90, 5, 6, 4, 2, 90, 91, 7, 5, 2, 2, 91, 15, 3, 2, 2, 2, 92, 93, 7, 7, 2, 2, 93, 94, 5, 46, 24, 2, 94, 95, 7, 4, 2, 2, 95, 96, 5, 6, 4, 2, 96, 97, 7, 5, 2, 2, 97, 17, 3, 2, 2, 2, 98, 99, 7, 8, 2, 2, 99, 100, 7, 9, 2, 2, 100, 101, 5, 38, 20, 2, 101, 102, 7, 10, 2, 2, 102, 103, 5, 38, 20, 2, 103, 104, 7, 11, 2, 2, 104, 19, 3, 2, 2, 2, 105, 106, 5, 22, 12, 2, 106, 107, 5, 38, 20, 2, 107, 21, 3, 2, 2, 2, 108, 109, 9, 2, 2, 2, 109, 23, 3, 2, 2, 2, 110, 111, 9, 3, 2, 2, 111, 25, 3, 2, 2, 2, 112, 113, 7, 18, 2, 2, 113, 27, 3, 2, 2, 2, 114, 115, 7, 36, 2, 2, 115, 116, 7, 19, 2, 2, 116, 117, 5, 38, 20, 2, 117, 29, 3, 2, 2, 2, 118, 119, 7, 20, 2, 2, 119, 120, 7, 9, 2, 2, 120, 121, 5, 38, 20, 2, 121, 122, 7, 11, 2, 2, 122, 31, 3, 2, 2, 2, 123, 124, 9, 4, 2, 2, 124, 33, 3, 2, 2, 2, 125, 126, 9, 5, 2, 2, 126, 35, 3, 2, 2, 2, 127, 128, 7, 22, 2, 2, 128, 37, 3, 2, 2, 2, 129, 130, 8, 20, 1, 2, 130, 131, 5, 36, 19, 2, 131, 132, 5, 38, 20, 8, 132, 142, 3, 2, 2, 2, 133, 134, 7, 9, 2, 2, 134, 135, 5, 38, 20, 2, 135, 136, 7, 11, 2, 2, 136, 142, 3, 2, 2, 2, 137, 142, 5, 46, 24, 2, 138, 139, 7, 36, 2, 2, 139, 140, 7, 19, 2, 2, 140, 142, 5, 38, 20, 3, 141, 129, 3, 2, 2, 2, 141, 133, 3, 2, 2, 2, 141, 137, 3, 2, 2, 2, 141, 138, 3, 2, 2, 2, 142, 153, 3, 2, 2, 2, 143, 144, 12, 7, 2, 2, 144, 145, 5, 32, 17, 2, 145, 146, 5, 38, 20, 8, 146, 152, 3, 2, 2, 2, 147, 148, 12, 6, 2, 2, 148, 149, 5, 34, 18, 2, 149, 150, 5, 38, 20, 7, 150, 152, 3, 2, 2, 2, 151, 143, 3, 2, 2, 2, 151, 147, 3, 2, 2, 2, 152, 155, 3, 2, 2, 2, 153, 151, 3, 2, 2, 2, 153, 154, 3, 2, 2, 2, 154, 39, 3, 2, 2, 2, 155, 153, 3, 2, 2, 2, 156, 157, 8, 21, 1, 2, 157, 158, 7, 34, 2, 2, 158, 169, 5, 40, 21, 7, 159, 160, 5, 38, 20, 2, 160, 161, 5, 42, 22, 2, 161, 162, 5, 38, 20, 2, 162, 169, 3, 2, 2, 2, 163, 169, 7, 25, 2, 2, 164, 165, 7, 9, 2, 2, 165, 166, 5, 40, 21, 2, 166, 167, 7, 11, 2, 2, 167, 169, 3, 2, 2, 2, 168, 156, 3, 2, 2, 2, 168, 159, 3, 2, 2, 2, 168, 163, 3, 2, 2, 2, 168, 164, 3, 2, 2, 2, 169, 176, 3, 2, 2, 2, 170, 171, 12, 5, 2, 2, 171, 172, 5, 44, 23, 2, 172, 173, 5, 40, 21, 6, 173, 175, 3, 2, 2, 2, 174, 170, 3, 2, 2, 2, 175, 178, 3, 2, 2, 2, 176, 174, 3, 2, 2, 2, 176, 177, 3, 2, 2, 2, 177, 41, 3, 2, 2, 2, 178, 176, 3, 2, 2, 2, 179, 180, 9, 6, 2, 2, 180, 43, 3, 2, 2, 2, 181, 182, 9, 7, 2, 2, 182, 45, 3, 2, 2, 2, 183, 184, 9, 8, 2, 2, 184, 47, 3, 2, 2, 2, 11, 54, 60, 70, 74, 141, 151, 153, 168, 176] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 39, 233, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 59, 10, 3, 12, 3, 14, 3, 62, 11, 3, 3, 4, 6, 4, 65, 10, 4, 13, 4, 14, 4, 66, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 77, 10, 5, 3, 6, 3, 6, 5, 6, 81, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 125, 10, 15, 12, 15, 14, 15, 128, 11, 15, 5, 15, 130, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 5, 16, 137, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 5, 21, 165, 10, 21, 3, 21, 3, 21, 5, 21, 169, 10, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 179, 10, 21, 12, 21, 14, 21, 182, 11, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 6, 22, 189, 10, 22, 13, 22, 14, 22, 190, 3, 23, 3, 23, 3, 23, 6, 23, 196, 10, 23, 13, 23, 14, 23, 197, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 212, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 218, 10, 24, 12, 24, 14, 24, 221, 11, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 231, 10, 27, 3, 27, 2, 4, 40, 46, 28, 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, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 24, 25, 3, 2, 22, 23, 3, 2, 27, 32, 3, 2, 33, 34, 2, 236, 2, 54, 3, 2, 2, 2, 4, 60, 3, 2, 2, 2, 6, 64, 3, 2, 2, 2, 8, 76, 3, 2, 2, 2, 10, 80, 3, 2, 2, 2, 12, 82, 3, 2, 2, 2, 14, 88, 3, 2, 2, 2, 16, 98, 3, 2, 2, 2, 18, 104, 3, 2, 2, 2, 20, 111, 3, 2, 2, 2, 22, 114, 3, 2, 2, 2, 24, 116, 3, 2, 2, 2, 26, 118, 3, 2, 2, 2, 28, 120, 3, 2, 2, 2, 30, 136, 3, 2, 2, 2, 32, 141, 3, 2, 2, 2, 34, 146, 3, 2, 2, 2, 36, 148, 3, 2, 2, 2, 38, 150, 3, 2, 2, 2, 40, 168, 3, 2, 2, 2, 42, 183, 3, 2, 2, 2, 44, 192, 3, 2, 2, 2, 46, 211, 3, 2, 2, 2, 48, 222, 3, 2, 2, 2, 50, 224, 3, 2, 2, 2, 52, 230, 3, 2, 2, 2, 54, 55, 5, 4, 3, 2, 55, 56, 7, 2, 2, 3, 56, 3, 3, 2, 2, 2, 57, 59, 5, 8, 5, 2, 58, 57, 3, 2, 2, 2, 59, 62, 3, 2, 2, 2, 60, 58, 3, 2, 2, 2, 60, 61, 3, 2, 2, 2, 61, 5, 3, 2, 2, 2, 62, 60, 3, 2, 2, 2, 63, 65, 5, 8, 5, 2, 64, 63, 3, 2, 2, 2, 65, 66, 3, 2, 2, 2, 66, 64, 3, 2, 2, 2, 66, 67, 3, 2, 2, 2, 67, 7, 3, 2, 2, 2, 68, 77, 5, 30, 16, 2, 69, 77, 5, 32, 17, 2, 70, 77, 5, 10, 6, 2, 71, 77, 5, 16, 9, 2, 72, 77, 5, 20, 11, 2, 73, 77, 5, 24, 13, 2, 74, 77, 5, 18, 10, 2, 75, 77, 5, 26, 14, 2, 76, 68, 3, 2, 2, 2, 76, 69, 3, 2, 2, 2, 76, 70, 3, 2, 2, 2, 76, 71, 3, 2, 2, 2, 76, 72, 3, 2, 2, 2, 76, 73, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 76, 75, 3, 2, 2, 2, 77, 9, 3, 2, 2, 2, 78, 81, 5, 12, 7, 2, 79, 81, 5, 14, 8, 2, 80, 78, 3, 2, 2, 2, 80, 79, 3, 2, 2, 2, 81, 11, 3, 2, 2, 2, 82, 83, 7, 3, 2, 2, 83, 84, 5, 46, 24, 2, 84, 85, 7, 4, 2, 2, 85, 86, 5, 6, 4, 2, 86, 87, 7, 5, 2, 2, 87, 13, 3, 2, 2, 2, 88, 89, 7, 3, 2, 2, 89, 90, 5, 46, 24, 2, 90, 91, 7, 4, 2, 2, 91, 92, 5, 6, 4, 2, 92, 93, 7, 5, 2, 2, 93, 94, 7, 6, 2, 2, 94, 95, 7, 4, 2, 2, 95, 96, 5, 6, 4, 2, 96, 97, 7, 5, 2, 2, 97, 15, 3, 2, 2, 2, 98, 99, 7, 7, 2, 2, 99, 100, 5, 52, 27, 2, 100, 101, 7, 4, 2, 2, 101, 102, 5, 6, 4, 2, 102, 103, 7, 5, 2, 2, 103, 17, 3, 2, 2, 2, 104, 105, 7, 8, 2, 2, 105, 106, 7, 9, 2, 2, 106, 107, 5, 40, 21, 2, 107, 108, 7, 10, 2, 2, 108, 109, 5, 40, 21, 2, 109, 110, 7, 11, 2, 2, 110, 19, 3, 2, 2, 2, 111, 112, 5, 22, 12, 2, 112, 113, 5, 40, 21, 2, 113, 21, 3, 2, 2, 2, 114, 115, 9, 2, 2, 2, 115, 23, 3, 2, 2, 2, 116, 117, 9, 3, 2, 2, 117, 25, 3, 2, 2, 2, 118, 119, 7, 18, 2, 2, 119, 27, 3, 2, 2, 2, 120, 129, 7, 4, 2, 2, 121, 126, 5, 40, 21, 2, 122, 123, 7, 10, 2, 2, 123, 125, 5, 40, 21, 2, 124, 122, 3, 2, 2, 2, 125, 128, 3, 2, 2, 2, 126, 124, 3, 2, 2, 2, 126, 127, 3, 2, 2, 2, 127, 130, 3, 2, 2, 2, 128, 126, 3, 2, 2, 2, 129, 121, 3, 2, 2, 2, 129, 130, 3, 2, 2, 2, 130, 131, 3, 2, 2, 2, 131, 132, 7, 5, 2, 2, 132, 29, 3, 2, 2, 2, 133, 137, 7, 37, 2, 2, 134, 137, 5, 42, 22, 2, 135, 137, 5, 44, 23, 2, 136, 133, 3, 2, 2, 2, 136, 134, 3, 2, 2, 2, 136, 135, 3, 2, 2, 2, 137, 138, 3, 2, 2, 2, 138, 139, 7, 19, 2, 2, 139, 140, 5, 40, 21, 2, 140, 31, 3, 2, 2, 2, 141, 142, 7, 20, 2, 2, 142, 143, 7, 9, 2, 2, 143, 144, 5, 40, 21, 2, 144, 145, 7, 11, 2, 2, 145, 33, 3, 2, 2, 2, 146, 147, 9, 4, 2, 2, 147, 35, 3, 2, 2, 2, 148, 149, 9, 5, 2, 2, 149, 37, 3, 2, 2, 2, 150, 151, 7, 23, 2, 2, 151, 39, 3, 2, 2, 2, 152, 153, 8, 21, 1, 2, 153, 154, 5, 38, 20, 2, 154, 155, 5, 40, 21, 8, 155, 169, 3, 2, 2, 2, 156, 157, 7, 9, 2, 2, 157, 158, 5, 40, 21, 2, 158, 159, 7, 11, 2, 2, 159, 169, 3, 2, 2, 2, 160, 169, 5, 52, 27, 2, 161, 165, 7, 37, 2, 2, 162, 165, 5, 42, 22, 2, 163, 165, 5, 44, 23, 2, 164, 161, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 163, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 167, 7, 19, 2, 2, 167, 169, 5, 40, 21, 3, 168, 152, 3, 2, 2, 2, 168, 156, 3, 2, 2, 2, 168, 160, 3, 2, 2, 2, 168, 164, 3, 2, 2, 2, 169, 180, 3, 2, 2, 2, 170, 171, 12, 7, 2, 2, 171, 172, 5, 34, 18, 2, 172, 173, 5, 40, 21, 8, 173, 179, 3, 2, 2, 2, 174, 175, 12, 6, 2, 2, 175, 176, 5, 36, 19, 2, 176, 177, 5, 40, 21, 7, 177, 179, 3, 2, 2, 2, 178, 170, 3, 2, 2, 2, 178, 174, 3, 2, 2, 2, 179, 182, 3, 2, 2, 2, 180, 178, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 41, 3, 2, 2, 2, 182, 180, 3, 2, 2, 2, 183, 188, 7, 37, 2, 2, 184, 185, 7, 4, 2, 2, 185, 186, 5, 40, 21, 2, 186, 187, 7, 5, 2, 2, 187, 189, 3, 2, 2, 2, 188, 184, 3, 2, 2, 2, 189, 190, 3, 2, 2, 2, 190, 188, 3, 2, 2, 2, 190, 191, 3, 2, 2, 2, 191, 43, 3, 2, 2, 2, 192, 195, 5, 52, 27, 2, 193, 194, 7, 21, 2, 2, 194, 196, 5, 52, 27, 2, 195, 193, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 195, 3, 2, 2, 2, 197, 198, 3, 2, 2, 2, 198, 45, 3, 2, 2, 2, 199, 200, 8, 24, 1, 2, 200, 201, 7, 35, 2, 2, 201, 212, 5, 46, 24, 7, 202, 203, 5, 40, 21, 2, 203, 204, 5, 48, 25, 2, 204, 205, 5, 40, 21, 2, 205, 212, 3, 2, 2, 2, 206, 212, 7, 26, 2, 2, 207, 208, 7, 9, 2, 2, 208, 209, 5, 46, 24, 2, 209, 210, 7, 11, 2, 2, 210, 212, 3, 2, 2, 2, 211, 199, 3, 2, 2, 2, 211, 202, 3, 2, 2, 2, 211, 206, 3, 2, 2, 2, 211, 207, 3, 2, 2, 2, 212, 219, 3, 2, 2, 2, 213, 214, 12, 5, 2, 2, 214, 215, 5, 50, 26, 2, 215, 216, 5, 46, 24, 6, 216, 218, 3, 2, 2, 2, 217, 213, 3, 2, 2, 2, 218, 221, 3, 2, 2, 2, 219, 217, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 47, 3, 2, 2, 2, 221, 219, 3, 2, 2, 2, 222, 223, 9, 6, 2, 2, 223, 49, 3, 2, 2, 2, 224, 225, 9, 7, 2, 2, 225, 51, 3, 2, 2, 2, 226, 231, 7, 36, 2, 2, 227, 231, 7, 37, 2, 2, 228, 231, 5, 28, 15, 2, 229, 231, 5, 42, 22, 2, 230, 226, 3, 2, 2, 2, 230, 227, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 230, 229, 3, 2, 2, 2, 231, 53, 3, 2, 2, 2, 18, 60, 66, 76, 80, 126, 129, 136, 164, 168, 178, 180, 190, 197, 211, 219, 230] \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.tokens b/ChironCore/turtparse/tlang.tokens index 2449d08..13c167e 100644 --- a/ChironCore/turtparse/tlang.tokens +++ b/ChironCore/turtparse/tlang.tokens @@ -16,24 +16,25 @@ T__14=15 T__15=16 T__16=17 T__17=18 -PLUS=19 -MINUS=20 -MUL=21 -DIV=22 -PENCOND=23 -LT=24 -GT=25 -EQ=26 -NEQ=27 -LTE=28 -GTE=29 -AND=30 -OR=31 -NOT=32 -NUM=33 -VAR=34 -NAME=35 -Whitespace=36 +T__18=19 +PLUS=20 +MINUS=21 +MUL=22 +DIV=23 +PENCOND=24 +LT=25 +GT=26 +EQ=27 +NEQ=28 +LTE=29 +GTE=30 +AND=31 +OR=32 +NOT=33 +NUM=34 +VAR=35 +NAME=36 +Whitespace=37 'if'=1 '['=2 ']'=3 @@ -52,17 +53,18 @@ Whitespace=36 'pause'=16 '='=17 'print'=18 -'+'=19 -'-'=20 -'*'=21 -'/'=22 -'pendown?'=23 -'<'=24 -'>'=25 -'=='=26 -'!='=27 -'<='=28 -'>='=29 -'&&'=30 -'||'=31 -'!'=32 +'.'=19 +'+'=20 +'-'=21 +'*'=22 +'/'=23 +'pendown?'=24 +'<'=25 +'>'=26 +'=='=27 +'!='=28 +'<='=29 +'>='=30 +'&&'=31 +'||'=32 +'!'=33 diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index 761cc81..e99cc74 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -18,6 +18,7 @@ null 'pause' '=' 'print' +'.' '+' '-' '*' @@ -57,6 +58,7 @@ null null null null +null PLUS MINUS MUL @@ -95,6 +97,7 @@ T__14 T__15 T__16 T__17 +T__18 PLUS MINUS MUL @@ -122,4 +125,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 38, 227, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 6, 34, 204, 10, 34, 13, 34, 14, 34, 205, 3, 35, 3, 35, 3, 35, 7, 35, 211, 10, 35, 12, 35, 14, 35, 214, 11, 35, 3, 36, 6, 36, 217, 10, 36, 13, 36, 14, 36, 218, 3, 37, 6, 37, 222, 10, 37, 13, 37, 14, 37, 223, 3, 37, 3, 37, 2, 2, 38, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 230, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 3, 75, 3, 2, 2, 2, 5, 78, 3, 2, 2, 2, 7, 80, 3, 2, 2, 2, 9, 82, 3, 2, 2, 2, 11, 87, 3, 2, 2, 2, 13, 94, 3, 2, 2, 2, 15, 99, 3, 2, 2, 2, 17, 101, 3, 2, 2, 2, 19, 103, 3, 2, 2, 2, 21, 105, 3, 2, 2, 2, 23, 113, 3, 2, 2, 2, 25, 122, 3, 2, 2, 2, 27, 127, 3, 2, 2, 2, 29, 133, 3, 2, 2, 2, 31, 139, 3, 2, 2, 2, 33, 147, 3, 2, 2, 2, 35, 153, 3, 2, 2, 2, 37, 155, 3, 2, 2, 2, 39, 161, 3, 2, 2, 2, 41, 163, 3, 2, 2, 2, 43, 165, 3, 2, 2, 2, 45, 167, 3, 2, 2, 2, 47, 169, 3, 2, 2, 2, 49, 178, 3, 2, 2, 2, 51, 180, 3, 2, 2, 2, 53, 182, 3, 2, 2, 2, 55, 185, 3, 2, 2, 2, 57, 188, 3, 2, 2, 2, 59, 191, 3, 2, 2, 2, 61, 194, 3, 2, 2, 2, 63, 197, 3, 2, 2, 2, 65, 200, 3, 2, 2, 2, 67, 203, 3, 2, 2, 2, 69, 207, 3, 2, 2, 2, 71, 216, 3, 2, 2, 2, 73, 221, 3, 2, 2, 2, 75, 76, 7, 107, 2, 2, 76, 77, 7, 104, 2, 2, 77, 4, 3, 2, 2, 2, 78, 79, 7, 93, 2, 2, 79, 6, 3, 2, 2, 2, 80, 81, 7, 95, 2, 2, 81, 8, 3, 2, 2, 2, 82, 83, 7, 103, 2, 2, 83, 84, 7, 110, 2, 2, 84, 85, 7, 117, 2, 2, 85, 86, 7, 103, 2, 2, 86, 10, 3, 2, 2, 2, 87, 88, 7, 116, 2, 2, 88, 89, 7, 103, 2, 2, 89, 90, 7, 114, 2, 2, 90, 91, 7, 103, 2, 2, 91, 92, 7, 99, 2, 2, 92, 93, 7, 118, 2, 2, 93, 12, 3, 2, 2, 2, 94, 95, 7, 105, 2, 2, 95, 96, 7, 113, 2, 2, 96, 97, 7, 118, 2, 2, 97, 98, 7, 113, 2, 2, 98, 14, 3, 2, 2, 2, 99, 100, 7, 42, 2, 2, 100, 16, 3, 2, 2, 2, 101, 102, 7, 46, 2, 2, 102, 18, 3, 2, 2, 2, 103, 104, 7, 43, 2, 2, 104, 20, 3, 2, 2, 2, 105, 106, 7, 104, 2, 2, 106, 107, 7, 113, 2, 2, 107, 108, 7, 116, 2, 2, 108, 109, 7, 121, 2, 2, 109, 110, 7, 99, 2, 2, 110, 111, 7, 116, 2, 2, 111, 112, 7, 102, 2, 2, 112, 22, 3, 2, 2, 2, 113, 114, 7, 100, 2, 2, 114, 115, 7, 99, 2, 2, 115, 116, 7, 101, 2, 2, 116, 117, 7, 109, 2, 2, 117, 118, 7, 121, 2, 2, 118, 119, 7, 99, 2, 2, 119, 120, 7, 116, 2, 2, 120, 121, 7, 102, 2, 2, 121, 24, 3, 2, 2, 2, 122, 123, 7, 110, 2, 2, 123, 124, 7, 103, 2, 2, 124, 125, 7, 104, 2, 2, 125, 126, 7, 118, 2, 2, 126, 26, 3, 2, 2, 2, 127, 128, 7, 116, 2, 2, 128, 129, 7, 107, 2, 2, 129, 130, 7, 105, 2, 2, 130, 131, 7, 106, 2, 2, 131, 132, 7, 118, 2, 2, 132, 28, 3, 2, 2, 2, 133, 134, 7, 114, 2, 2, 134, 135, 7, 103, 2, 2, 135, 136, 7, 112, 2, 2, 136, 137, 7, 119, 2, 2, 137, 138, 7, 114, 2, 2, 138, 30, 3, 2, 2, 2, 139, 140, 7, 114, 2, 2, 140, 141, 7, 103, 2, 2, 141, 142, 7, 112, 2, 2, 142, 143, 7, 102, 2, 2, 143, 144, 7, 113, 2, 2, 144, 145, 7, 121, 2, 2, 145, 146, 7, 112, 2, 2, 146, 32, 3, 2, 2, 2, 147, 148, 7, 114, 2, 2, 148, 149, 7, 99, 2, 2, 149, 150, 7, 119, 2, 2, 150, 151, 7, 117, 2, 2, 151, 152, 7, 103, 2, 2, 152, 34, 3, 2, 2, 2, 153, 154, 7, 63, 2, 2, 154, 36, 3, 2, 2, 2, 155, 156, 7, 114, 2, 2, 156, 157, 7, 116, 2, 2, 157, 158, 7, 107, 2, 2, 158, 159, 7, 112, 2, 2, 159, 160, 7, 118, 2, 2, 160, 38, 3, 2, 2, 2, 161, 162, 7, 45, 2, 2, 162, 40, 3, 2, 2, 2, 163, 164, 7, 47, 2, 2, 164, 42, 3, 2, 2, 2, 165, 166, 7, 44, 2, 2, 166, 44, 3, 2, 2, 2, 167, 168, 7, 49, 2, 2, 168, 46, 3, 2, 2, 2, 169, 170, 7, 114, 2, 2, 170, 171, 7, 103, 2, 2, 171, 172, 7, 112, 2, 2, 172, 173, 7, 102, 2, 2, 173, 174, 7, 113, 2, 2, 174, 175, 7, 121, 2, 2, 175, 176, 7, 112, 2, 2, 176, 177, 7, 65, 2, 2, 177, 48, 3, 2, 2, 2, 178, 179, 7, 62, 2, 2, 179, 50, 3, 2, 2, 2, 180, 181, 7, 64, 2, 2, 181, 52, 3, 2, 2, 2, 182, 183, 7, 63, 2, 2, 183, 184, 7, 63, 2, 2, 184, 54, 3, 2, 2, 2, 185, 186, 7, 35, 2, 2, 186, 187, 7, 63, 2, 2, 187, 56, 3, 2, 2, 2, 188, 189, 7, 62, 2, 2, 189, 190, 7, 63, 2, 2, 190, 58, 3, 2, 2, 2, 191, 192, 7, 64, 2, 2, 192, 193, 7, 63, 2, 2, 193, 60, 3, 2, 2, 2, 194, 195, 7, 40, 2, 2, 195, 196, 7, 40, 2, 2, 196, 62, 3, 2, 2, 2, 197, 198, 7, 126, 2, 2, 198, 199, 7, 126, 2, 2, 199, 64, 3, 2, 2, 2, 200, 201, 7, 35, 2, 2, 201, 66, 3, 2, 2, 2, 202, 204, 9, 2, 2, 2, 203, 202, 3, 2, 2, 2, 204, 205, 3, 2, 2, 2, 205, 203, 3, 2, 2, 2, 205, 206, 3, 2, 2, 2, 206, 68, 3, 2, 2, 2, 207, 208, 7, 60, 2, 2, 208, 212, 9, 3, 2, 2, 209, 211, 9, 4, 2, 2, 210, 209, 3, 2, 2, 2, 211, 214, 3, 2, 2, 2, 212, 210, 3, 2, 2, 2, 212, 213, 3, 2, 2, 2, 213, 70, 3, 2, 2, 2, 214, 212, 3, 2, 2, 2, 215, 217, 9, 5, 2, 2, 216, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 72, 3, 2, 2, 2, 220, 222, 9, 6, 2, 2, 221, 220, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 223, 224, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 226, 8, 37, 2, 2, 226, 74, 3, 2, 2, 2, 7, 2, 205, 212, 218, 223, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 39, 231, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 6, 35, 208, 10, 35, 13, 35, 14, 35, 209, 3, 36, 3, 36, 3, 36, 7, 36, 215, 10, 36, 12, 36, 14, 36, 218, 11, 36, 3, 37, 6, 37, 221, 10, 37, 13, 37, 14, 37, 222, 3, 38, 6, 38, 226, 10, 38, 13, 38, 14, 38, 227, 3, 38, 3, 38, 2, 2, 39, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 234, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 3, 77, 3, 2, 2, 2, 5, 80, 3, 2, 2, 2, 7, 82, 3, 2, 2, 2, 9, 84, 3, 2, 2, 2, 11, 89, 3, 2, 2, 2, 13, 96, 3, 2, 2, 2, 15, 101, 3, 2, 2, 2, 17, 103, 3, 2, 2, 2, 19, 105, 3, 2, 2, 2, 21, 107, 3, 2, 2, 2, 23, 115, 3, 2, 2, 2, 25, 124, 3, 2, 2, 2, 27, 129, 3, 2, 2, 2, 29, 135, 3, 2, 2, 2, 31, 141, 3, 2, 2, 2, 33, 149, 3, 2, 2, 2, 35, 155, 3, 2, 2, 2, 37, 157, 3, 2, 2, 2, 39, 163, 3, 2, 2, 2, 41, 165, 3, 2, 2, 2, 43, 167, 3, 2, 2, 2, 45, 169, 3, 2, 2, 2, 47, 171, 3, 2, 2, 2, 49, 173, 3, 2, 2, 2, 51, 182, 3, 2, 2, 2, 53, 184, 3, 2, 2, 2, 55, 186, 3, 2, 2, 2, 57, 189, 3, 2, 2, 2, 59, 192, 3, 2, 2, 2, 61, 195, 3, 2, 2, 2, 63, 198, 3, 2, 2, 2, 65, 201, 3, 2, 2, 2, 67, 204, 3, 2, 2, 2, 69, 207, 3, 2, 2, 2, 71, 211, 3, 2, 2, 2, 73, 220, 3, 2, 2, 2, 75, 225, 3, 2, 2, 2, 77, 78, 7, 107, 2, 2, 78, 79, 7, 104, 2, 2, 79, 4, 3, 2, 2, 2, 80, 81, 7, 93, 2, 2, 81, 6, 3, 2, 2, 2, 82, 83, 7, 95, 2, 2, 83, 8, 3, 2, 2, 2, 84, 85, 7, 103, 2, 2, 85, 86, 7, 110, 2, 2, 86, 87, 7, 117, 2, 2, 87, 88, 7, 103, 2, 2, 88, 10, 3, 2, 2, 2, 89, 90, 7, 116, 2, 2, 90, 91, 7, 103, 2, 2, 91, 92, 7, 114, 2, 2, 92, 93, 7, 103, 2, 2, 93, 94, 7, 99, 2, 2, 94, 95, 7, 118, 2, 2, 95, 12, 3, 2, 2, 2, 96, 97, 7, 105, 2, 2, 97, 98, 7, 113, 2, 2, 98, 99, 7, 118, 2, 2, 99, 100, 7, 113, 2, 2, 100, 14, 3, 2, 2, 2, 101, 102, 7, 42, 2, 2, 102, 16, 3, 2, 2, 2, 103, 104, 7, 46, 2, 2, 104, 18, 3, 2, 2, 2, 105, 106, 7, 43, 2, 2, 106, 20, 3, 2, 2, 2, 107, 108, 7, 104, 2, 2, 108, 109, 7, 113, 2, 2, 109, 110, 7, 116, 2, 2, 110, 111, 7, 121, 2, 2, 111, 112, 7, 99, 2, 2, 112, 113, 7, 116, 2, 2, 113, 114, 7, 102, 2, 2, 114, 22, 3, 2, 2, 2, 115, 116, 7, 100, 2, 2, 116, 117, 7, 99, 2, 2, 117, 118, 7, 101, 2, 2, 118, 119, 7, 109, 2, 2, 119, 120, 7, 121, 2, 2, 120, 121, 7, 99, 2, 2, 121, 122, 7, 116, 2, 2, 122, 123, 7, 102, 2, 2, 123, 24, 3, 2, 2, 2, 124, 125, 7, 110, 2, 2, 125, 126, 7, 103, 2, 2, 126, 127, 7, 104, 2, 2, 127, 128, 7, 118, 2, 2, 128, 26, 3, 2, 2, 2, 129, 130, 7, 116, 2, 2, 130, 131, 7, 107, 2, 2, 131, 132, 7, 105, 2, 2, 132, 133, 7, 106, 2, 2, 133, 134, 7, 118, 2, 2, 134, 28, 3, 2, 2, 2, 135, 136, 7, 114, 2, 2, 136, 137, 7, 103, 2, 2, 137, 138, 7, 112, 2, 2, 138, 139, 7, 119, 2, 2, 139, 140, 7, 114, 2, 2, 140, 30, 3, 2, 2, 2, 141, 142, 7, 114, 2, 2, 142, 143, 7, 103, 2, 2, 143, 144, 7, 112, 2, 2, 144, 145, 7, 102, 2, 2, 145, 146, 7, 113, 2, 2, 146, 147, 7, 121, 2, 2, 147, 148, 7, 112, 2, 2, 148, 32, 3, 2, 2, 2, 149, 150, 7, 114, 2, 2, 150, 151, 7, 99, 2, 2, 151, 152, 7, 119, 2, 2, 152, 153, 7, 117, 2, 2, 153, 154, 7, 103, 2, 2, 154, 34, 3, 2, 2, 2, 155, 156, 7, 63, 2, 2, 156, 36, 3, 2, 2, 2, 157, 158, 7, 114, 2, 2, 158, 159, 7, 116, 2, 2, 159, 160, 7, 107, 2, 2, 160, 161, 7, 112, 2, 2, 161, 162, 7, 118, 2, 2, 162, 38, 3, 2, 2, 2, 163, 164, 7, 48, 2, 2, 164, 40, 3, 2, 2, 2, 165, 166, 7, 45, 2, 2, 166, 42, 3, 2, 2, 2, 167, 168, 7, 47, 2, 2, 168, 44, 3, 2, 2, 2, 169, 170, 7, 44, 2, 2, 170, 46, 3, 2, 2, 2, 171, 172, 7, 49, 2, 2, 172, 48, 3, 2, 2, 2, 173, 174, 7, 114, 2, 2, 174, 175, 7, 103, 2, 2, 175, 176, 7, 112, 2, 2, 176, 177, 7, 102, 2, 2, 177, 178, 7, 113, 2, 2, 178, 179, 7, 121, 2, 2, 179, 180, 7, 112, 2, 2, 180, 181, 7, 65, 2, 2, 181, 50, 3, 2, 2, 2, 182, 183, 7, 62, 2, 2, 183, 52, 3, 2, 2, 2, 184, 185, 7, 64, 2, 2, 185, 54, 3, 2, 2, 2, 186, 187, 7, 63, 2, 2, 187, 188, 7, 63, 2, 2, 188, 56, 3, 2, 2, 2, 189, 190, 7, 35, 2, 2, 190, 191, 7, 63, 2, 2, 191, 58, 3, 2, 2, 2, 192, 193, 7, 62, 2, 2, 193, 194, 7, 63, 2, 2, 194, 60, 3, 2, 2, 2, 195, 196, 7, 64, 2, 2, 196, 197, 7, 63, 2, 2, 197, 62, 3, 2, 2, 2, 198, 199, 7, 40, 2, 2, 199, 200, 7, 40, 2, 2, 200, 64, 3, 2, 2, 2, 201, 202, 7, 126, 2, 2, 202, 203, 7, 126, 2, 2, 203, 66, 3, 2, 2, 2, 204, 205, 7, 35, 2, 2, 205, 68, 3, 2, 2, 2, 206, 208, 9, 2, 2, 2, 207, 206, 3, 2, 2, 2, 208, 209, 3, 2, 2, 2, 209, 207, 3, 2, 2, 2, 209, 210, 3, 2, 2, 2, 210, 70, 3, 2, 2, 2, 211, 212, 7, 60, 2, 2, 212, 216, 9, 3, 2, 2, 213, 215, 9, 4, 2, 2, 214, 213, 3, 2, 2, 2, 215, 218, 3, 2, 2, 2, 216, 214, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 72, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 219, 221, 9, 5, 2, 2, 220, 219, 3, 2, 2, 2, 221, 222, 3, 2, 2, 2, 222, 220, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 74, 3, 2, 2, 2, 224, 226, 9, 6, 2, 2, 225, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 230, 8, 38, 2, 2, 230, 76, 3, 2, 2, 2, 7, 2, 209, 216, 222, 227, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index 168c686..16a5a49 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -8,94 +8,96 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2&") - buf.write("\u00e3\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\'") + buf.write("\u00e7\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") buf.write("\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36") buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%") - buf.write("\3\2\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3") - buf.write("\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\t") - buf.write("\3\t\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3") - buf.write("\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r") - buf.write("\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17") - buf.write("\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21") - buf.write("\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23\3\23\3\23") - buf.write("\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30") - buf.write("\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\31\3\31\3\32\3\32") - buf.write("\3\33\3\33\3\33\3\34\3\34\3\34\3\35\3\35\3\35\3\36\3\36") - buf.write("\3\36\3\37\3\37\3\37\3 \3 \3 \3!\3!\3\"\6\"\u00cc\n\"") - buf.write("\r\"\16\"\u00cd\3#\3#\3#\7#\u00d3\n#\f#\16#\u00d6\13#") - buf.write("\3$\6$\u00d9\n$\r$\16$\u00da\3%\6%\u00de\n%\r%\16%\u00df") - buf.write("\3%\3%\2\2&\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25") - buf.write("\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+") - buf.write("\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E") - buf.write("$G%I&\3\2\7\3\2\62;\5\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5") - buf.write("\2\13\f\17\17\"\"\2\u00e6\2\3\3\2\2\2\2\5\3\2\2\2\2\7") - buf.write("\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2") - buf.write("\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2") - buf.write("\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2") - buf.write("\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2") - buf.write("\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63") - buf.write("\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2") - buf.write("\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2") - buf.write("\2\2\2G\3\2\2\2\2I\3\2\2\2\3K\3\2\2\2\5N\3\2\2\2\7P\3") - buf.write("\2\2\2\tR\3\2\2\2\13W\3\2\2\2\r^\3\2\2\2\17c\3\2\2\2\21") - buf.write("e\3\2\2\2\23g\3\2\2\2\25i\3\2\2\2\27q\3\2\2\2\31z\3\2") - buf.write("\2\2\33\177\3\2\2\2\35\u0085\3\2\2\2\37\u008b\3\2\2\2") - buf.write("!\u0093\3\2\2\2#\u0099\3\2\2\2%\u009b\3\2\2\2\'\u00a1") - buf.write("\3\2\2\2)\u00a3\3\2\2\2+\u00a5\3\2\2\2-\u00a7\3\2\2\2") - buf.write("/\u00a9\3\2\2\2\61\u00b2\3\2\2\2\63\u00b4\3\2\2\2\65\u00b6") - buf.write("\3\2\2\2\67\u00b9\3\2\2\29\u00bc\3\2\2\2;\u00bf\3\2\2") - buf.write("\2=\u00c2\3\2\2\2?\u00c5\3\2\2\2A\u00c8\3\2\2\2C\u00cb") - buf.write("\3\2\2\2E\u00cf\3\2\2\2G\u00d8\3\2\2\2I\u00dd\3\2\2\2") - buf.write("KL\7k\2\2LM\7h\2\2M\4\3\2\2\2NO\7]\2\2O\6\3\2\2\2PQ\7") - buf.write("_\2\2Q\b\3\2\2\2RS\7g\2\2ST\7n\2\2TU\7u\2\2UV\7g\2\2V") - buf.write("\n\3\2\2\2WX\7t\2\2XY\7g\2\2YZ\7r\2\2Z[\7g\2\2[\\\7c\2") - buf.write("\2\\]\7v\2\2]\f\3\2\2\2^_\7i\2\2_`\7q\2\2`a\7v\2\2ab\7") - buf.write("q\2\2b\16\3\2\2\2cd\7*\2\2d\20\3\2\2\2ef\7.\2\2f\22\3") - buf.write("\2\2\2gh\7+\2\2h\24\3\2\2\2ij\7h\2\2jk\7q\2\2kl\7t\2\2") - buf.write("lm\7y\2\2mn\7c\2\2no\7t\2\2op\7f\2\2p\26\3\2\2\2qr\7d") - buf.write("\2\2rs\7c\2\2st\7e\2\2tu\7m\2\2uv\7y\2\2vw\7c\2\2wx\7") - buf.write("t\2\2xy\7f\2\2y\30\3\2\2\2z{\7n\2\2{|\7g\2\2|}\7h\2\2") - buf.write("}~\7v\2\2~\32\3\2\2\2\177\u0080\7t\2\2\u0080\u0081\7k") - buf.write("\2\2\u0081\u0082\7i\2\2\u0082\u0083\7j\2\2\u0083\u0084") - buf.write("\7v\2\2\u0084\34\3\2\2\2\u0085\u0086\7r\2\2\u0086\u0087") - buf.write("\7g\2\2\u0087\u0088\7p\2\2\u0088\u0089\7w\2\2\u0089\u008a") - buf.write("\7r\2\2\u008a\36\3\2\2\2\u008b\u008c\7r\2\2\u008c\u008d") - buf.write("\7g\2\2\u008d\u008e\7p\2\2\u008e\u008f\7f\2\2\u008f\u0090") - buf.write("\7q\2\2\u0090\u0091\7y\2\2\u0091\u0092\7p\2\2\u0092 \3") - buf.write("\2\2\2\u0093\u0094\7r\2\2\u0094\u0095\7c\2\2\u0095\u0096") - buf.write("\7w\2\2\u0096\u0097\7u\2\2\u0097\u0098\7g\2\2\u0098\"") - buf.write("\3\2\2\2\u0099\u009a\7?\2\2\u009a$\3\2\2\2\u009b\u009c") - buf.write("\7r\2\2\u009c\u009d\7t\2\2\u009d\u009e\7k\2\2\u009e\u009f") - buf.write("\7p\2\2\u009f\u00a0\7v\2\2\u00a0&\3\2\2\2\u00a1\u00a2") - buf.write("\7-\2\2\u00a2(\3\2\2\2\u00a3\u00a4\7/\2\2\u00a4*\3\2\2") - buf.write("\2\u00a5\u00a6\7,\2\2\u00a6,\3\2\2\2\u00a7\u00a8\7\61") - buf.write("\2\2\u00a8.\3\2\2\2\u00a9\u00aa\7r\2\2\u00aa\u00ab\7g") - buf.write("\2\2\u00ab\u00ac\7p\2\2\u00ac\u00ad\7f\2\2\u00ad\u00ae") - buf.write("\7q\2\2\u00ae\u00af\7y\2\2\u00af\u00b0\7p\2\2\u00b0\u00b1") - buf.write("\7A\2\2\u00b1\60\3\2\2\2\u00b2\u00b3\7>\2\2\u00b3\62\3") - buf.write("\2\2\2\u00b4\u00b5\7@\2\2\u00b5\64\3\2\2\2\u00b6\u00b7") - buf.write("\7?\2\2\u00b7\u00b8\7?\2\2\u00b8\66\3\2\2\2\u00b9\u00ba") - buf.write("\7#\2\2\u00ba\u00bb\7?\2\2\u00bb8\3\2\2\2\u00bc\u00bd") - buf.write("\7>\2\2\u00bd\u00be\7?\2\2\u00be:\3\2\2\2\u00bf\u00c0") - buf.write("\7@\2\2\u00c0\u00c1\7?\2\2\u00c1<\3\2\2\2\u00c2\u00c3") - buf.write("\7(\2\2\u00c3\u00c4\7(\2\2\u00c4>\3\2\2\2\u00c5\u00c6") - buf.write("\7~\2\2\u00c6\u00c7\7~\2\2\u00c7@\3\2\2\2\u00c8\u00c9") - buf.write("\7#\2\2\u00c9B\3\2\2\2\u00ca\u00cc\t\2\2\2\u00cb\u00ca") - buf.write("\3\2\2\2\u00cc\u00cd\3\2\2\2\u00cd\u00cb\3\2\2\2\u00cd") - buf.write("\u00ce\3\2\2\2\u00ceD\3\2\2\2\u00cf\u00d0\7<\2\2\u00d0") - buf.write("\u00d4\t\3\2\2\u00d1\u00d3\t\4\2\2\u00d2\u00d1\3\2\2\2") - buf.write("\u00d3\u00d6\3\2\2\2\u00d4\u00d2\3\2\2\2\u00d4\u00d5\3") - buf.write("\2\2\2\u00d5F\3\2\2\2\u00d6\u00d4\3\2\2\2\u00d7\u00d9") - buf.write("\t\5\2\2\u00d8\u00d7\3\2\2\2\u00d9\u00da\3\2\2\2\u00da") - buf.write("\u00d8\3\2\2\2\u00da\u00db\3\2\2\2\u00dbH\3\2\2\2\u00dc") - buf.write("\u00de\t\6\2\2\u00dd\u00dc\3\2\2\2\u00de\u00df\3\2\2\2") - buf.write("\u00df\u00dd\3\2\2\2\u00df\u00e0\3\2\2\2\u00e0\u00e1\3") - buf.write("\2\2\2\u00e1\u00e2\b%\2\2\u00e2J\3\2\2\2\7\2\u00cd\u00d4") - buf.write("\u00da\u00df\3\b\2\2") + buf.write("\4&\t&\3\2\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5") + buf.write("\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3") + buf.write("\b\3\t\3\t\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13") + buf.write("\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r") + buf.write("\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17") + buf.write("\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20") + buf.write("\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23") + buf.write("\3\23\3\23\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27") + buf.write("\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31") + buf.write("\3\32\3\32\3\33\3\33\3\34\3\34\3\34\3\35\3\35\3\35\3\36") + buf.write("\3\36\3\36\3\37\3\37\3\37\3 \3 \3 \3!\3!\3!\3\"\3\"\3") + buf.write("#\6#\u00d0\n#\r#\16#\u00d1\3$\3$\3$\7$\u00d7\n$\f$\16") + buf.write("$\u00da\13$\3%\6%\u00dd\n%\r%\16%\u00de\3&\6&\u00e2\n") + buf.write("&\r&\16&\u00e3\3&\3&\2\2\'\3\3\5\4\7\5\t\6\13\7\r\b\17") + buf.write("\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23") + buf.write("%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36") + buf.write(";\37= ?!A\"C#E$G%I&K\'\3\2\7\3\2\62;\5\2C\\aac|\5\2\62") + buf.write(";C\\c|\4\2C\\c|\5\2\13\f\17\17\"\"\2\u00ea\2\3\3\2\2\2") + buf.write("\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r") + buf.write("\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3") + buf.write("\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2") + buf.write("\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'") + buf.write("\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2") + buf.write("\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29") + buf.write("\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2") + buf.write("C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2") + buf.write("\3M\3\2\2\2\5P\3\2\2\2\7R\3\2\2\2\tT\3\2\2\2\13Y\3\2\2") + buf.write("\2\r`\3\2\2\2\17e\3\2\2\2\21g\3\2\2\2\23i\3\2\2\2\25k") + buf.write("\3\2\2\2\27s\3\2\2\2\31|\3\2\2\2\33\u0081\3\2\2\2\35\u0087") + buf.write("\3\2\2\2\37\u008d\3\2\2\2!\u0095\3\2\2\2#\u009b\3\2\2") + buf.write("\2%\u009d\3\2\2\2\'\u00a3\3\2\2\2)\u00a5\3\2\2\2+\u00a7") + buf.write("\3\2\2\2-\u00a9\3\2\2\2/\u00ab\3\2\2\2\61\u00ad\3\2\2") + buf.write("\2\63\u00b6\3\2\2\2\65\u00b8\3\2\2\2\67\u00ba\3\2\2\2") + buf.write("9\u00bd\3\2\2\2;\u00c0\3\2\2\2=\u00c3\3\2\2\2?\u00c6\3") + buf.write("\2\2\2A\u00c9\3\2\2\2C\u00cc\3\2\2\2E\u00cf\3\2\2\2G\u00d3") + buf.write("\3\2\2\2I\u00dc\3\2\2\2K\u00e1\3\2\2\2MN\7k\2\2NO\7h\2") + buf.write("\2O\4\3\2\2\2PQ\7]\2\2Q\6\3\2\2\2RS\7_\2\2S\b\3\2\2\2") + buf.write("TU\7g\2\2UV\7n\2\2VW\7u\2\2WX\7g\2\2X\n\3\2\2\2YZ\7t\2") + buf.write("\2Z[\7g\2\2[\\\7r\2\2\\]\7g\2\2]^\7c\2\2^_\7v\2\2_\f\3") + buf.write("\2\2\2`a\7i\2\2ab\7q\2\2bc\7v\2\2cd\7q\2\2d\16\3\2\2\2") + buf.write("ef\7*\2\2f\20\3\2\2\2gh\7.\2\2h\22\3\2\2\2ij\7+\2\2j\24") + buf.write("\3\2\2\2kl\7h\2\2lm\7q\2\2mn\7t\2\2no\7y\2\2op\7c\2\2") + buf.write("pq\7t\2\2qr\7f\2\2r\26\3\2\2\2st\7d\2\2tu\7c\2\2uv\7e") + buf.write("\2\2vw\7m\2\2wx\7y\2\2xy\7c\2\2yz\7t\2\2z{\7f\2\2{\30") + buf.write("\3\2\2\2|}\7n\2\2}~\7g\2\2~\177\7h\2\2\177\u0080\7v\2") + buf.write("\2\u0080\32\3\2\2\2\u0081\u0082\7t\2\2\u0082\u0083\7k") + buf.write("\2\2\u0083\u0084\7i\2\2\u0084\u0085\7j\2\2\u0085\u0086") + buf.write("\7v\2\2\u0086\34\3\2\2\2\u0087\u0088\7r\2\2\u0088\u0089") + buf.write("\7g\2\2\u0089\u008a\7p\2\2\u008a\u008b\7w\2\2\u008b\u008c") + buf.write("\7r\2\2\u008c\36\3\2\2\2\u008d\u008e\7r\2\2\u008e\u008f") + buf.write("\7g\2\2\u008f\u0090\7p\2\2\u0090\u0091\7f\2\2\u0091\u0092") + buf.write("\7q\2\2\u0092\u0093\7y\2\2\u0093\u0094\7p\2\2\u0094 \3") + buf.write("\2\2\2\u0095\u0096\7r\2\2\u0096\u0097\7c\2\2\u0097\u0098") + buf.write("\7w\2\2\u0098\u0099\7u\2\2\u0099\u009a\7g\2\2\u009a\"") + buf.write("\3\2\2\2\u009b\u009c\7?\2\2\u009c$\3\2\2\2\u009d\u009e") + buf.write("\7r\2\2\u009e\u009f\7t\2\2\u009f\u00a0\7k\2\2\u00a0\u00a1") + buf.write("\7p\2\2\u00a1\u00a2\7v\2\2\u00a2&\3\2\2\2\u00a3\u00a4") + buf.write("\7\60\2\2\u00a4(\3\2\2\2\u00a5\u00a6\7-\2\2\u00a6*\3\2") + buf.write("\2\2\u00a7\u00a8\7/\2\2\u00a8,\3\2\2\2\u00a9\u00aa\7,") + buf.write("\2\2\u00aa.\3\2\2\2\u00ab\u00ac\7\61\2\2\u00ac\60\3\2") + buf.write("\2\2\u00ad\u00ae\7r\2\2\u00ae\u00af\7g\2\2\u00af\u00b0") + buf.write("\7p\2\2\u00b0\u00b1\7f\2\2\u00b1\u00b2\7q\2\2\u00b2\u00b3") + buf.write("\7y\2\2\u00b3\u00b4\7p\2\2\u00b4\u00b5\7A\2\2\u00b5\62") + buf.write("\3\2\2\2\u00b6\u00b7\7>\2\2\u00b7\64\3\2\2\2\u00b8\u00b9") + buf.write("\7@\2\2\u00b9\66\3\2\2\2\u00ba\u00bb\7?\2\2\u00bb\u00bc") + buf.write("\7?\2\2\u00bc8\3\2\2\2\u00bd\u00be\7#\2\2\u00be\u00bf") + buf.write("\7?\2\2\u00bf:\3\2\2\2\u00c0\u00c1\7>\2\2\u00c1\u00c2") + buf.write("\7?\2\2\u00c2<\3\2\2\2\u00c3\u00c4\7@\2\2\u00c4\u00c5") + buf.write("\7?\2\2\u00c5>\3\2\2\2\u00c6\u00c7\7(\2\2\u00c7\u00c8") + buf.write("\7(\2\2\u00c8@\3\2\2\2\u00c9\u00ca\7~\2\2\u00ca\u00cb") + buf.write("\7~\2\2\u00cbB\3\2\2\2\u00cc\u00cd\7#\2\2\u00cdD\3\2\2") + buf.write("\2\u00ce\u00d0\t\2\2\2\u00cf\u00ce\3\2\2\2\u00d0\u00d1") + buf.write("\3\2\2\2\u00d1\u00cf\3\2\2\2\u00d1\u00d2\3\2\2\2\u00d2") + buf.write("F\3\2\2\2\u00d3\u00d4\7<\2\2\u00d4\u00d8\t\3\2\2\u00d5") + buf.write("\u00d7\t\4\2\2\u00d6\u00d5\3\2\2\2\u00d7\u00da\3\2\2\2") + buf.write("\u00d8\u00d6\3\2\2\2\u00d8\u00d9\3\2\2\2\u00d9H\3\2\2") + buf.write("\2\u00da\u00d8\3\2\2\2\u00db\u00dd\t\5\2\2\u00dc\u00db") + buf.write("\3\2\2\2\u00dd\u00de\3\2\2\2\u00de\u00dc\3\2\2\2\u00de") + buf.write("\u00df\3\2\2\2\u00dfJ\3\2\2\2\u00e0\u00e2\t\6\2\2\u00e1") + buf.write("\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3\u00e1\3\2\2\2") + buf.write("\u00e3\u00e4\3\2\2\2\u00e4\u00e5\3\2\2\2\u00e5\u00e6\b") + buf.write("&\2\2\u00e6L\3\2\2\2\7\2\u00d1\u00d8\u00de\u00e3\3\b\2") + buf.write("\2") return buf.getvalue() @@ -123,24 +125,25 @@ class tlangLexer(Lexer): T__15 = 16 T__16 = 17 T__17 = 18 - PLUS = 19 - MINUS = 20 - MUL = 21 - DIV = 22 - PENCOND = 23 - LT = 24 - GT = 25 - EQ = 26 - NEQ = 27 - LTE = 28 - GTE = 29 - AND = 30 - OR = 31 - NOT = 32 - NUM = 33 - VAR = 34 - NAME = 35 - Whitespace = 36 + T__18 = 19 + PLUS = 20 + MINUS = 21 + MUL = 22 + DIV = 23 + PENCOND = 24 + LT = 25 + GT = 26 + EQ = 27 + NEQ = 28 + LTE = 29 + GTE = 30 + AND = 31 + OR = 32 + NOT = 33 + NUM = 34 + VAR = 35 + NAME = 36 + Whitespace = 37 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] @@ -149,9 +152,9 @@ class tlangLexer(Lexer): literalNames = [ "", "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", - "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'+'", - "'-'", "'*'", "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", - "'<='", "'>='", "'&&'", "'||'", "'!'" ] + "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'.'", + "'+'", "'-'", "'*'", "'/'", "'pendown?'", "'<'", "'>'", "'=='", + "'!='", "'<='", "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", @@ -160,9 +163,9 @@ class tlangLexer(Lexer): ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", - "T__14", "T__15", "T__16", "T__17", "PLUS", "MINUS", "MUL", - "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", "GTE", - "AND", "OR", "NOT", "NUM", "VAR", "NAME", "Whitespace" ] + "T__14", "T__15", "T__16", "T__17", "T__18", "PLUS", "MINUS", + "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", + "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", "Whitespace" ] grammarFileName = "tlang.g4" diff --git a/ChironCore/turtparse/tlangLexer.tokens b/ChironCore/turtparse/tlangLexer.tokens index 2449d08..13c167e 100644 --- a/ChironCore/turtparse/tlangLexer.tokens +++ b/ChironCore/turtparse/tlangLexer.tokens @@ -16,24 +16,25 @@ T__14=15 T__15=16 T__16=17 T__17=18 -PLUS=19 -MINUS=20 -MUL=21 -DIV=22 -PENCOND=23 -LT=24 -GT=25 -EQ=26 -NEQ=27 -LTE=28 -GTE=29 -AND=30 -OR=31 -NOT=32 -NUM=33 -VAR=34 -NAME=35 -Whitespace=36 +T__18=19 +PLUS=20 +MINUS=21 +MUL=22 +DIV=23 +PENCOND=24 +LT=25 +GT=26 +EQ=27 +NEQ=28 +LTE=29 +GTE=30 +AND=31 +OR=32 +NOT=33 +NUM=34 +VAR=35 +NAME=36 +Whitespace=37 'if'=1 '['=2 ']'=3 @@ -52,17 +53,18 @@ Whitespace=36 'pause'=16 '='=17 'print'=18 -'+'=19 -'-'=20 -'*'=21 -'/'=22 -'pendown?'=23 -'<'=24 -'>'=25 -'=='=26 -'!='=27 -'<='=28 -'>='=29 -'&&'=30 -'||'=31 -'!'=32 +'.'=19 +'+'=20 +'-'=21 +'*'=22 +'/'=23 +'pendown?'=24 +'<'=25 +'>'=26 +'=='=27 +'!='=28 +'<='=29 +'>='=30 +'&&'=31 +'||'=32 +'!'=33 diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index 370cf8e..5eb558f 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -8,75 +8,101 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3&") - buf.write("\u00ba\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\'") + buf.write("\u00e9\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") - buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\3\2") - buf.write("\3\2\3\2\3\3\7\3\65\n\3\f\3\16\38\13\3\3\4\6\4;\n\4\r") - buf.write("\4\16\4<\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5G\n\5\3\6") - buf.write("\3\6\5\6K\n\6\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b") - buf.write("\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3") - buf.write("\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\f\3\f\3\r\3\r") - buf.write("\3\16\3\16\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20") - buf.write("\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24\3\24\3\24\3\24") - buf.write("\3\24\3\24\3\24\3\24\3\24\3\24\3\24\5\24\u008e\n\24\3") - buf.write("\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\7\24\u0098\n\24") - buf.write("\f\24\16\24\u009b\13\24\3\25\3\25\3\25\3\25\3\25\3\25") - buf.write("\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u00a9\n\25\3\25\3") - buf.write("\25\3\25\3\25\7\25\u00af\n\25\f\25\16\25\u00b2\13\25\3") - buf.write("\26\3\26\3\27\3\27\3\30\3\30\3\30\2\4&(\31\2\4\6\b\n\f") - buf.write("\16\20\22\24\26\30\32\34\36 \"$&(*,.\2\t\3\2\f\17\3\2") - buf.write("\20\21\3\2\27\30\3\2\25\26\3\2\32\37\3\2 !\3\2#$\2\u00b5") - buf.write("\2\60\3\2\2\2\4\66\3\2\2\2\6:\3\2\2\2\bF\3\2\2\2\nJ\3") - buf.write("\2\2\2\fL\3\2\2\2\16R\3\2\2\2\20\\\3\2\2\2\22b\3\2\2\2") - buf.write("\24i\3\2\2\2\26l\3\2\2\2\30n\3\2\2\2\32p\3\2\2\2\34r\3") - buf.write("\2\2\2\36v\3\2\2\2 {\3\2\2\2\"}\3\2\2\2$\177\3\2\2\2&") - buf.write("\u008d\3\2\2\2(\u00a8\3\2\2\2*\u00b3\3\2\2\2,\u00b5\3") - buf.write("\2\2\2.\u00b7\3\2\2\2\60\61\5\4\3\2\61\62\7\2\2\3\62\3") - buf.write("\3\2\2\2\63\65\5\b\5\2\64\63\3\2\2\2\658\3\2\2\2\66\64") - buf.write("\3\2\2\2\66\67\3\2\2\2\67\5\3\2\2\28\66\3\2\2\29;\5\b") - buf.write("\5\2:9\3\2\2\2;<\3\2\2\2<:\3\2\2\2<=\3\2\2\2=\7\3\2\2") - buf.write("\2>G\5\34\17\2?G\5\36\20\2@G\5\n\6\2AG\5\20\t\2BG\5\24") - buf.write("\13\2CG\5\30\r\2DG\5\22\n\2EG\5\32\16\2F>\3\2\2\2F?\3") - buf.write("\2\2\2F@\3\2\2\2FA\3\2\2\2FB\3\2\2\2FC\3\2\2\2FD\3\2\2") - buf.write("\2FE\3\2\2\2G\t\3\2\2\2HK\5\f\7\2IK\5\16\b\2JH\3\2\2\2") - buf.write("JI\3\2\2\2K\13\3\2\2\2LM\7\3\2\2MN\5(\25\2NO\7\4\2\2O") - buf.write("P\5\6\4\2PQ\7\5\2\2Q\r\3\2\2\2RS\7\3\2\2ST\5(\25\2TU\7") - buf.write("\4\2\2UV\5\6\4\2VW\7\5\2\2WX\7\6\2\2XY\7\4\2\2YZ\5\6\4") - buf.write("\2Z[\7\5\2\2[\17\3\2\2\2\\]\7\7\2\2]^\5.\30\2^_\7\4\2") - buf.write("\2_`\5\6\4\2`a\7\5\2\2a\21\3\2\2\2bc\7\b\2\2cd\7\t\2\2") - buf.write("de\5&\24\2ef\7\n\2\2fg\5&\24\2gh\7\13\2\2h\23\3\2\2\2") - buf.write("ij\5\26\f\2jk\5&\24\2k\25\3\2\2\2lm\t\2\2\2m\27\3\2\2") - buf.write("\2no\t\3\2\2o\31\3\2\2\2pq\7\22\2\2q\33\3\2\2\2rs\7$\2") - buf.write("\2st\7\23\2\2tu\5&\24\2u\35\3\2\2\2vw\7\24\2\2wx\7\t\2") - buf.write("\2xy\5&\24\2yz\7\13\2\2z\37\3\2\2\2{|\t\4\2\2|!\3\2\2") - buf.write("\2}~\t\5\2\2~#\3\2\2\2\177\u0080\7\26\2\2\u0080%\3\2\2") - buf.write("\2\u0081\u0082\b\24\1\2\u0082\u0083\5$\23\2\u0083\u0084") - buf.write("\5&\24\b\u0084\u008e\3\2\2\2\u0085\u0086\7\t\2\2\u0086") - buf.write("\u0087\5&\24\2\u0087\u0088\7\13\2\2\u0088\u008e\3\2\2") - buf.write("\2\u0089\u008e\5.\30\2\u008a\u008b\7$\2\2\u008b\u008c") - buf.write("\7\23\2\2\u008c\u008e\5&\24\3\u008d\u0081\3\2\2\2\u008d") - buf.write("\u0085\3\2\2\2\u008d\u0089\3\2\2\2\u008d\u008a\3\2\2\2") - buf.write("\u008e\u0099\3\2\2\2\u008f\u0090\f\7\2\2\u0090\u0091\5") - buf.write(" \21\2\u0091\u0092\5&\24\b\u0092\u0098\3\2\2\2\u0093\u0094") - buf.write("\f\6\2\2\u0094\u0095\5\"\22\2\u0095\u0096\5&\24\7\u0096") - buf.write("\u0098\3\2\2\2\u0097\u008f\3\2\2\2\u0097\u0093\3\2\2\2") - buf.write("\u0098\u009b\3\2\2\2\u0099\u0097\3\2\2\2\u0099\u009a\3") - buf.write("\2\2\2\u009a\'\3\2\2\2\u009b\u0099\3\2\2\2\u009c\u009d") - buf.write("\b\25\1\2\u009d\u009e\7\"\2\2\u009e\u00a9\5(\25\7\u009f") - buf.write("\u00a0\5&\24\2\u00a0\u00a1\5*\26\2\u00a1\u00a2\5&\24\2") - buf.write("\u00a2\u00a9\3\2\2\2\u00a3\u00a9\7\31\2\2\u00a4\u00a5") - buf.write("\7\t\2\2\u00a5\u00a6\5(\25\2\u00a6\u00a7\7\13\2\2\u00a7") - buf.write("\u00a9\3\2\2\2\u00a8\u009c\3\2\2\2\u00a8\u009f\3\2\2\2") - buf.write("\u00a8\u00a3\3\2\2\2\u00a8\u00a4\3\2\2\2\u00a9\u00b0\3") - buf.write("\2\2\2\u00aa\u00ab\f\5\2\2\u00ab\u00ac\5,\27\2\u00ac\u00ad") - buf.write("\5(\25\6\u00ad\u00af\3\2\2\2\u00ae\u00aa\3\2\2\2\u00af") - buf.write("\u00b2\3\2\2\2\u00b0\u00ae\3\2\2\2\u00b0\u00b1\3\2\2\2") - buf.write("\u00b1)\3\2\2\2\u00b2\u00b0\3\2\2\2\u00b3\u00b4\t\6\2") - buf.write("\2\u00b4+\3\2\2\2\u00b5\u00b6\t\7\2\2\u00b6-\3\2\2\2\u00b7") - buf.write("\u00b8\t\b\2\2\u00b8/\3\2\2\2\13\66\13\3\3\4\6\4A\n\4\r\4\16\4B\3\5\3\5\3\5\3\5\3\5") + buf.write("\3\5\3\5\3\5\5\5M\n\5\3\6\3\6\5\6Q\n\6\3\7\3\7\3\7\3\7") + buf.write("\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3") + buf.write("\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3") + buf.write("\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17\3\17\3\17") + buf.write("\7\17}\n\17\f\17\16\17\u0080\13\17\5\17\u0082\n\17\3\17") + buf.write("\3\17\3\20\3\20\3\20\5\20\u0089\n\20\3\20\3\20\3\20\3") + buf.write("\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24") + buf.write("\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25") + buf.write("\3\25\5\25\u00a5\n\25\3\25\3\25\5\25\u00a9\n\25\3\25\3") + buf.write("\25\3\25\3\25\3\25\3\25\3\25\3\25\7\25\u00b3\n\25\f\25") + buf.write("\16\25\u00b6\13\25\3\26\3\26\3\26\3\26\3\26\6\26\u00bd") + buf.write("\n\26\r\26\16\26\u00be\3\27\3\27\3\27\6\27\u00c4\n\27") + buf.write("\r\27\16\27\u00c5\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3") + buf.write("\30\3\30\3\30\3\30\3\30\5\30\u00d4\n\30\3\30\3\30\3\30") + buf.write("\3\30\7\30\u00da\n\30\f\30\16\30\u00dd\13\30\3\31\3\31") + buf.write("\3\32\3\32\3\33\3\33\3\33\3\33\5\33\u00e7\n\33\3\33\2") + buf.write("\4(.\34\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*") + buf.write(",.\60\62\64\2\b\3\2\f\17\3\2\20\21\3\2\30\31\3\2\26\27") + buf.write("\3\2\33 \3\2!\"\2\u00ec\2\66\3\2\2\2\4<\3\2\2\2\6@\3\2") + buf.write("\2\2\bL\3\2\2\2\nP\3\2\2\2\fR\3\2\2\2\16X\3\2\2\2\20b") + buf.write("\3\2\2\2\22h\3\2\2\2\24o\3\2\2\2\26r\3\2\2\2\30t\3\2\2") + buf.write("\2\32v\3\2\2\2\34x\3\2\2\2\36\u0088\3\2\2\2 \u008d\3\2") + buf.write("\2\2\"\u0092\3\2\2\2$\u0094\3\2\2\2&\u0096\3\2\2\2(\u00a8") + buf.write("\3\2\2\2*\u00b7\3\2\2\2,\u00c0\3\2\2\2.\u00d3\3\2\2\2") + buf.write("\60\u00de\3\2\2\2\62\u00e0\3\2\2\2\64\u00e6\3\2\2\2\66") + buf.write("\67\5\4\3\2\678\7\2\2\38\3\3\2\2\29;\5\b\5\2:9\3\2\2\2") + buf.write(";>\3\2\2\2<:\3\2\2\2<=\3\2\2\2=\5\3\2\2\2><\3\2\2\2?A") + buf.write("\5\b\5\2@?\3\2\2\2AB\3\2\2\2B@\3\2\2\2BC\3\2\2\2C\7\3") + buf.write("\2\2\2DM\5\36\20\2EM\5 \21\2FM\5\n\6\2GM\5\20\t\2HM\5") + buf.write("\24\13\2IM\5\30\r\2JM\5\22\n\2KM\5\32\16\2LD\3\2\2\2L") + buf.write("E\3\2\2\2LF\3\2\2\2LG\3\2\2\2LH\3\2\2\2LI\3\2\2\2LJ\3") + buf.write("\2\2\2LK\3\2\2\2M\t\3\2\2\2NQ\5\f\7\2OQ\5\16\b\2PN\3\2") + buf.write("\2\2PO\3\2\2\2Q\13\3\2\2\2RS\7\3\2\2ST\5.\30\2TU\7\4\2") + buf.write("\2UV\5\6\4\2VW\7\5\2\2W\r\3\2\2\2XY\7\3\2\2YZ\5.\30\2") + buf.write("Z[\7\4\2\2[\\\5\6\4\2\\]\7\5\2\2]^\7\6\2\2^_\7\4\2\2_") + buf.write("`\5\6\4\2`a\7\5\2\2a\17\3\2\2\2bc\7\7\2\2cd\5\64\33\2") + buf.write("de\7\4\2\2ef\5\6\4\2fg\7\5\2\2g\21\3\2\2\2hi\7\b\2\2i") + buf.write("j\7\t\2\2jk\5(\25\2kl\7\n\2\2lm\5(\25\2mn\7\13\2\2n\23") + buf.write("\3\2\2\2op\5\26\f\2pq\5(\25\2q\25\3\2\2\2rs\t\2\2\2s\27") + buf.write("\3\2\2\2tu\t\3\2\2u\31\3\2\2\2vw\7\22\2\2w\33\3\2\2\2") + buf.write("x\u0081\7\4\2\2y~\5(\25\2z{\7\n\2\2{}\5(\25\2|z\3\2\2") + buf.write("\2}\u0080\3\2\2\2~|\3\2\2\2~\177\3\2\2\2\177\u0082\3\2") + buf.write("\2\2\u0080~\3\2\2\2\u0081y\3\2\2\2\u0081\u0082\3\2\2\2") + buf.write("\u0082\u0083\3\2\2\2\u0083\u0084\7\5\2\2\u0084\35\3\2") + buf.write("\2\2\u0085\u0089\7%\2\2\u0086\u0089\5*\26\2\u0087\u0089") + buf.write("\5,\27\2\u0088\u0085\3\2\2\2\u0088\u0086\3\2\2\2\u0088") + buf.write("\u0087\3\2\2\2\u0089\u008a\3\2\2\2\u008a\u008b\7\23\2") + buf.write("\2\u008b\u008c\5(\25\2\u008c\37\3\2\2\2\u008d\u008e\7") + buf.write("\24\2\2\u008e\u008f\7\t\2\2\u008f\u0090\5(\25\2\u0090") + buf.write("\u0091\7\13\2\2\u0091!\3\2\2\2\u0092\u0093\t\4\2\2\u0093") + buf.write("#\3\2\2\2\u0094\u0095\t\5\2\2\u0095%\3\2\2\2\u0096\u0097") + buf.write("\7\27\2\2\u0097\'\3\2\2\2\u0098\u0099\b\25\1\2\u0099\u009a") + buf.write("\5&\24\2\u009a\u009b\5(\25\b\u009b\u00a9\3\2\2\2\u009c") + buf.write("\u009d\7\t\2\2\u009d\u009e\5(\25\2\u009e\u009f\7\13\2") + buf.write("\2\u009f\u00a9\3\2\2\2\u00a0\u00a9\5\64\33\2\u00a1\u00a5") + buf.write("\7%\2\2\u00a2\u00a5\5*\26\2\u00a3\u00a5\5,\27\2\u00a4") + buf.write("\u00a1\3\2\2\2\u00a4\u00a2\3\2\2\2\u00a4\u00a3\3\2\2\2") + buf.write("\u00a5\u00a6\3\2\2\2\u00a6\u00a7\7\23\2\2\u00a7\u00a9") + buf.write("\5(\25\3\u00a8\u0098\3\2\2\2\u00a8\u009c\3\2\2\2\u00a8") + buf.write("\u00a0\3\2\2\2\u00a8\u00a4\3\2\2\2\u00a9\u00b4\3\2\2\2") + buf.write("\u00aa\u00ab\f\7\2\2\u00ab\u00ac\5\"\22\2\u00ac\u00ad") + buf.write("\5(\25\b\u00ad\u00b3\3\2\2\2\u00ae\u00af\f\6\2\2\u00af") + buf.write("\u00b0\5$\23\2\u00b0\u00b1\5(\25\7\u00b1\u00b3\3\2\2\2") + buf.write("\u00b2\u00aa\3\2\2\2\u00b2\u00ae\3\2\2\2\u00b3\u00b6\3") + buf.write("\2\2\2\u00b4\u00b2\3\2\2\2\u00b4\u00b5\3\2\2\2\u00b5)") + buf.write("\3\2\2\2\u00b6\u00b4\3\2\2\2\u00b7\u00bc\7%\2\2\u00b8") + buf.write("\u00b9\7\4\2\2\u00b9\u00ba\5(\25\2\u00ba\u00bb\7\5\2\2") + buf.write("\u00bb\u00bd\3\2\2\2\u00bc\u00b8\3\2\2\2\u00bd\u00be\3") + buf.write("\2\2\2\u00be\u00bc\3\2\2\2\u00be\u00bf\3\2\2\2\u00bf+") + buf.write("\3\2\2\2\u00c0\u00c3\5\64\33\2\u00c1\u00c2\7\25\2\2\u00c2") + buf.write("\u00c4\5\64\33\2\u00c3\u00c1\3\2\2\2\u00c4\u00c5\3\2\2") + buf.write("\2\u00c5\u00c3\3\2\2\2\u00c5\u00c6\3\2\2\2\u00c6-\3\2") + buf.write("\2\2\u00c7\u00c8\b\30\1\2\u00c8\u00c9\7#\2\2\u00c9\u00d4") + buf.write("\5.\30\7\u00ca\u00cb\5(\25\2\u00cb\u00cc\5\60\31\2\u00cc") + buf.write("\u00cd\5(\25\2\u00cd\u00d4\3\2\2\2\u00ce\u00d4\7\32\2") + buf.write("\2\u00cf\u00d0\7\t\2\2\u00d0\u00d1\5.\30\2\u00d1\u00d2") + buf.write("\7\13\2\2\u00d2\u00d4\3\2\2\2\u00d3\u00c7\3\2\2\2\u00d3") + buf.write("\u00ca\3\2\2\2\u00d3\u00ce\3\2\2\2\u00d3\u00cf\3\2\2\2") + buf.write("\u00d4\u00db\3\2\2\2\u00d5\u00d6\f\5\2\2\u00d6\u00d7\5") + buf.write("\62\32\2\u00d7\u00d8\5.\30\6\u00d8\u00da\3\2\2\2\u00d9") + buf.write("\u00d5\3\2\2\2\u00da\u00dd\3\2\2\2\u00db\u00d9\3\2\2\2") + buf.write("\u00db\u00dc\3\2\2\2\u00dc/\3\2\2\2\u00dd\u00db\3\2\2") + buf.write("\2\u00de\u00df\t\6\2\2\u00df\61\3\2\2\2\u00e0\u00e1\t") + buf.write("\7\2\2\u00e1\63\3\2\2\2\u00e2\u00e7\7$\2\2\u00e3\u00e7") + buf.write("\7%\2\2\u00e4\u00e7\5\34\17\2\u00e5\u00e7\5*\26\2\u00e6") + buf.write("\u00e2\3\2\2\2\u00e6\u00e3\3\2\2\2\u00e6\u00e4\3\2\2\2") + buf.write("\u00e6\u00e5\3\2\2\2\u00e7\65\3\2\2\2\22", "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", "'penup'", "'pendown'", "'pause'", - "'='", "'print'", "'+'", "'-'", "'*'", "'/'", "'pendown?'", - "'<'", "'>'", "'=='", "'!='", "'<='", "'>='", "'&&'", - "'||'", "'!'" ] + "'='", "'print'", "'.'", "'+'", "'-'", "'*'", "'/'", + "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", + "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "PLUS", "MINUS", - "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", - "LTE", "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", - "Whitespace" ] + "", "", "", "", + "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", + "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", + "VAR", "NAME", "Whitespace" ] RULE_start = 0 RULE_instruction_list = 1 @@ -119,23 +145,27 @@ class tlangParser ( Parser ): RULE_moveOp = 10 RULE_penCommand = 11 RULE_pauseCommand = 12 - RULE_assignment = 13 - RULE_printStatement = 14 - RULE_multiplicative = 15 - RULE_additive = 16 - RULE_unaryArithOp = 17 - RULE_expression = 18 - RULE_condition = 19 - RULE_binCondOp = 20 - RULE_logicOp = 21 - RULE_value = 22 + RULE_array = 13 + RULE_assignment = 14 + RULE_printStatement = 15 + RULE_multiplicative = 16 + RULE_additive = 17 + RULE_unaryArithOp = 18 + RULE_expression = 19 + RULE_arrayAccess = 20 + RULE_memberAccess = 21 + RULE_condition = 22 + RULE_binCondOp = 23 + RULE_logicOp = 24 + RULE_value = 25 ruleNames = [ "start", "instruction_list", "strict_ilist", "instruction", "conditional", "ifConditional", "ifElseConditional", "loop", "gotoCommand", "moveCommand", "moveOp", "penCommand", - "pauseCommand", "assignment", "printStatement", "multiplicative", - "additive", "unaryArithOp", "expression", "condition", - "binCondOp", "logicOp", "value" ] + "pauseCommand", "array", "assignment", "printStatement", + "multiplicative", "additive", "unaryArithOp", "expression", + "arrayAccess", "memberAccess", "condition", "binCondOp", + "logicOp", "value" ] EOF = Token.EOF T__0=1 @@ -156,24 +186,25 @@ class tlangParser ( Parser ): T__15=16 T__16=17 T__17=18 - PLUS=19 - MINUS=20 - MUL=21 - DIV=22 - PENCOND=23 - LT=24 - GT=25 - EQ=26 - NEQ=27 - LTE=28 - GTE=29 - AND=30 - OR=31 - NOT=32 - NUM=33 - VAR=34 - NAME=35 - Whitespace=36 + T__18=19 + PLUS=20 + MINUS=21 + MUL=22 + DIV=23 + PENCOND=24 + LT=25 + GT=26 + EQ=27 + NEQ=28 + LTE=29 + GTE=30 + AND=31 + OR=32 + NOT=33 + NUM=34 + VAR=35 + NAME=36 + Whitespace=37 def __init__(self, input:TokenStream, output:TextIO = sys.stdout): super().__init__(input, output) @@ -215,9 +246,9 @@ def start(self): self.enterRule(localctx, 0, self.RULE_start) try: self.enterOuterAlt(localctx, 1) - self.state = 46 + self.state = 52 self.instruction_list() - self.state = 47 + self.state = 53 self.match(tlangParser.EOF) except RecognitionException as re: localctx.exception = re @@ -260,13 +291,13 @@ def instruction_list(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 52 + self.state = 58 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.VAR))) != 0): - self.state = 49 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.NUM) | (1 << tlangParser.VAR))) != 0): + self.state = 55 self.instruction() - self.state = 54 + self.state = 60 self._errHandler.sync(self) _la = self._input.LA(1) @@ -311,16 +342,16 @@ def strict_ilist(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 56 + self.state = 62 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 55 + self.state = 61 self.instruction() - self.state = 58 + self.state = 64 self._errHandler.sync(self) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.VAR))) != 0)): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.NUM) | (1 << tlangParser.VAR))) != 0)): break except RecognitionException as re: @@ -387,47 +418,47 @@ def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) self.enterRule(localctx, 6, self.RULE_instruction) try: - self.state = 68 + self.state = 74 self._errHandler.sync(self) token = self._input.LA(1) - if token in [tlangParser.VAR]: + if token in [tlangParser.T__1, tlangParser.NUM, tlangParser.VAR]: self.enterOuterAlt(localctx, 1) - self.state = 60 + self.state = 66 self.assignment() pass elif token in [tlangParser.T__17]: self.enterOuterAlt(localctx, 2) - self.state = 61 + self.state = 67 self.printStatement() pass elif token in [tlangParser.T__0]: self.enterOuterAlt(localctx, 3) - self.state = 62 + self.state = 68 self.conditional() pass elif token in [tlangParser.T__4]: self.enterOuterAlt(localctx, 4) - self.state = 63 + self.state = 69 self.loop() pass elif token in [tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12]: self.enterOuterAlt(localctx, 5) - self.state = 64 + self.state = 70 self.moveCommand() pass elif token in [tlangParser.T__13, tlangParser.T__14]: self.enterOuterAlt(localctx, 6) - self.state = 65 + self.state = 71 self.penCommand() pass elif token in [tlangParser.T__5]: self.enterOuterAlt(localctx, 7) - self.state = 66 + self.state = 72 self.gotoCommand() pass elif token in [tlangParser.T__15]: self.enterOuterAlt(localctx, 8) - self.state = 67 + self.state = 73 self.pauseCommand() pass else: @@ -473,18 +504,18 @@ def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) self.enterRule(localctx, 8, self.RULE_conditional) try: - self.state = 72 + self.state = 78 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,3,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 70 + self.state = 76 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 71 + self.state = 77 self.ifElseConditional() pass @@ -530,15 +561,15 @@ def ifConditional(self): self.enterRule(localctx, 10, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 74 + self.state = 80 self.match(tlangParser.T__0) - self.state = 75 + self.state = 81 self.condition(0) - self.state = 76 + self.state = 82 self.match(tlangParser.T__1) - self.state = 77 + self.state = 83 self.strict_ilist() - self.state = 78 + self.state = 84 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -584,23 +615,23 @@ def ifElseConditional(self): self.enterRule(localctx, 12, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 80 + self.state = 86 self.match(tlangParser.T__0) - self.state = 81 + self.state = 87 self.condition(0) - self.state = 82 + self.state = 88 self.match(tlangParser.T__1) - self.state = 83 + self.state = 89 self.strict_ilist() - self.state = 84 + self.state = 90 self.match(tlangParser.T__2) - self.state = 85 + self.state = 91 self.match(tlangParser.T__3) - self.state = 86 + self.state = 92 self.match(tlangParser.T__1) - self.state = 87 + self.state = 93 self.strict_ilist() - self.state = 88 + self.state = 94 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -643,15 +674,15 @@ def loop(self): self.enterRule(localctx, 14, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 90 + self.state = 96 self.match(tlangParser.T__4) - self.state = 91 + self.state = 97 self.value() - self.state = 92 + self.state = 98 self.match(tlangParser.T__1) - self.state = 93 + self.state = 99 self.strict_ilist() - self.state = 94 + self.state = 100 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -693,17 +724,17 @@ def gotoCommand(self): self.enterRule(localctx, 16, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 96 + self.state = 102 self.match(tlangParser.T__5) - self.state = 97 + self.state = 103 self.match(tlangParser.T__6) - self.state = 98 + self.state = 104 self.expression(0) - self.state = 99 + self.state = 105 self.match(tlangParser.T__7) - self.state = 100 + self.state = 106 self.expression(0) - self.state = 101 + self.state = 107 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -746,9 +777,9 @@ def moveCommand(self): self.enterRule(localctx, 18, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 103 + self.state = 109 self.moveOp() - self.state = 104 + self.state = 110 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -785,7 +816,7 @@ def moveOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 106 + self.state = 112 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -827,7 +858,7 @@ def penCommand(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 108 + self.state = 114 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -868,7 +899,7 @@ def pauseCommand(self): self.enterRule(localctx, 24, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 110 + self.state = 116 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -879,17 +910,90 @@ def pauseCommand(self): return localctx + class ArrayContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def expression(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.ExpressionContext) + else: + return self.getTypedRuleContext(tlangParser.ExpressionContext,i) + + + def getRuleIndex(self): + return tlangParser.RULE_array + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitArray" ): + return visitor.visitArray(self) + else: + return visitor.visitChildren(self) + + + + + def array(self): + + localctx = tlangParser.ArrayContext(self, self._ctx, self.state) + self.enterRule(localctx, 26, self.RULE_array) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 118 + self.match(tlangParser.T__1) + self.state = 127 + self._errHandler.sync(self) + _la = self._input.LA(1) + if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.VAR))) != 0): + self.state = 119 + self.expression(0) + self.state = 124 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==tlangParser.T__7: + self.state = 120 + self.match(tlangParser.T__7) + self.state = 121 + self.expression(0) + self.state = 126 + self._errHandler.sync(self) + _la = self._input.LA(1) + + + + self.state = 129 + self.match(tlangParser.T__2) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class AssignmentContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + def expression(self): + return self.getTypedRuleContext(tlangParser.ExpressionContext,0) + + def VAR(self): return self.getToken(tlangParser.VAR, 0) - def expression(self): - return self.getTypedRuleContext(tlangParser.ExpressionContext,0) + def arrayAccess(self): + return self.getTypedRuleContext(tlangParser.ArrayAccessContext,0) + + + def memberAccess(self): + return self.getTypedRuleContext(tlangParser.MemberAccessContext,0) def getRuleIndex(self): @@ -907,14 +1011,31 @@ def accept(self, visitor:ParseTreeVisitor): def assignment(self): localctx = tlangParser.AssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 26, self.RULE_assignment) + self.enterRule(localctx, 28, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 112 - self.match(tlangParser.VAR) - self.state = 113 + self.state = 134 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input,6,self._ctx) + if la_ == 1: + self.state = 131 + self.match(tlangParser.VAR) + pass + + elif la_ == 2: + self.state = 132 + self.arrayAccess() + pass + + elif la_ == 3: + self.state = 133 + self.memberAccess() + pass + + + self.state = 136 self.match(tlangParser.T__16) - self.state = 114 + self.state = 137 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -950,16 +1071,16 @@ def accept(self, visitor:ParseTreeVisitor): def printStatement(self): localctx = tlangParser.PrintStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 28, self.RULE_printStatement) + self.enterRule(localctx, 30, self.RULE_printStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 116 + self.state = 139 self.match(tlangParser.T__17) - self.state = 117 + self.state = 140 self.match(tlangParser.T__6) - self.state = 118 + self.state = 141 self.expression(0) - self.state = 119 + self.state = 142 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -997,11 +1118,11 @@ def accept(self, visitor:ParseTreeVisitor): def multiplicative(self): localctx = tlangParser.MultiplicativeContext(self, self._ctx, self.state) - self.enterRule(localctx, 30, self.RULE_multiplicative) + self.enterRule(localctx, 32, self.RULE_multiplicative) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 121 + self.state = 144 _la = self._input.LA(1) if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) @@ -1044,11 +1165,11 @@ def accept(self, visitor:ParseTreeVisitor): def additive(self): localctx = tlangParser.AdditiveContext(self, self._ctx, self.state) - self.enterRule(localctx, 32, self.RULE_additive) + self.enterRule(localctx, 34, self.RULE_additive) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 123 + self.state = 146 _la = self._input.LA(1) if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) @@ -1088,10 +1209,10 @@ def accept(self, visitor:ParseTreeVisitor): def unaryArithOp(self): localctx = tlangParser.UnaryArithOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 34, self.RULE_unaryArithOp) + self.enterRule(localctx, 36, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 125 + self.state = 148 self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re @@ -1206,11 +1327,17 @@ def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.Expr super().__init__(parser) self.copyFrom(ctx) - def VAR(self): - return self.getToken(tlangParser.VAR, 0) def expression(self): return self.getTypedRuleContext(tlangParser.ExpressionContext,0) + def VAR(self): + return self.getToken(tlangParser.VAR, 0) + def arrayAccess(self): + return self.getTypedRuleContext(tlangParser.ArrayAccessContext,0) + + def memberAccess(self): + return self.getTypedRuleContext(tlangParser.MemberAccessContext,0) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAssignExpr" ): @@ -1242,21 +1369,21 @@ def expression(self, _p:int=0): _parentState = self.state localctx = tlangParser.ExpressionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 36 - self.enterRecursionRule(localctx, 36, self.RULE_expression, _p) + _startState = 38 + self.enterRecursionRule(localctx, 38, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 139 + self.state = 166 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,4,self._ctx) + la_ = self._interp.adaptivePredict(self._input,8,self._ctx) if la_ == 1: localctx = tlangParser.UnaryExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 128 + self.state = 151 self.unaryArithOp() - self.state = 129 + self.state = 152 self.expression(6) pass @@ -1264,11 +1391,11 @@ def expression(self, _p:int=0): localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 131 + self.state = 154 self.match(tlangParser.T__6) - self.state = 132 + self.state = 155 self.expression(0) - self.state = 133 + self.state = 156 self.match(tlangParser.T__8) pass @@ -1276,7 +1403,7 @@ def expression(self, _p:int=0): localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 135 + self.state = 158 self.value() pass @@ -1284,57 +1411,74 @@ def expression(self, _p:int=0): localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 136 - self.match(tlangParser.VAR) - self.state = 137 + self.state = 162 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input,7,self._ctx) + if la_ == 1: + self.state = 159 + self.match(tlangParser.VAR) + pass + + elif la_ == 2: + self.state = 160 + self.arrayAccess() + pass + + elif la_ == 3: + self.state = 161 + self.memberAccess() + pass + + + self.state = 164 self.match(tlangParser.T__16) - self.state = 138 + self.state = 165 self.expression(1) pass self._ctx.stop = self._input.LT(-1) - self.state = 151 + self.state = 178 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,6,self._ctx) + _alt = self._interp.adaptivePredict(self._input,10,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 149 + self.state = 176 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,5,self._ctx) + la_ = self._interp.adaptivePredict(self._input,9,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 141 + self.state = 168 if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 142 + self.state = 169 self.multiplicative() - self.state = 143 + self.state = 170 self.expression(6) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 145 + self.state = 172 if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") - self.state = 146 + self.state = 173 self.additive() - self.state = 147 + self.state = 174 self.expression(5) pass - self.state = 153 + self.state = 180 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,6,self._ctx) + _alt = self._interp.adaptivePredict(self._input,10,self._ctx) except RecognitionException as re: localctx.exception = re @@ -1345,6 +1489,126 @@ def expression(self, _p:int=0): return localctx + class ArrayAccessContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def VAR(self): + return self.getToken(tlangParser.VAR, 0) + + def expression(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.ExpressionContext) + else: + return self.getTypedRuleContext(tlangParser.ExpressionContext,i) + + + def getRuleIndex(self): + return tlangParser.RULE_arrayAccess + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitArrayAccess" ): + return visitor.visitArrayAccess(self) + else: + return visitor.visitChildren(self) + + + + + def arrayAccess(self): + + localctx = tlangParser.ArrayAccessContext(self, self._ctx, self.state) + self.enterRule(localctx, 40, self.RULE_arrayAccess) + try: + self.enterOuterAlt(localctx, 1) + self.state = 181 + self.match(tlangParser.VAR) + self.state = 186 + self._errHandler.sync(self) + _alt = 1 + while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: + if _alt == 1: + self.state = 182 + self.match(tlangParser.T__1) + self.state = 183 + self.expression(0) + self.state = 184 + self.match(tlangParser.T__2) + + else: + raise NoViableAltException(self) + self.state = 188 + self._errHandler.sync(self) + _alt = self._interp.adaptivePredict(self._input,11,self._ctx) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class MemberAccessContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def value(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.ValueContext) + else: + return self.getTypedRuleContext(tlangParser.ValueContext,i) + + + def getRuleIndex(self): + return tlangParser.RULE_memberAccess + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitMemberAccess" ): + return visitor.visitMemberAccess(self) + else: + return visitor.visitChildren(self) + + + + + def memberAccess(self): + + localctx = tlangParser.MemberAccessContext(self, self._ctx, self.state) + self.enterRule(localctx, 42, self.RULE_memberAccess) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 190 + self.value() + self.state = 193 + self._errHandler.sync(self) + _la = self._input.LA(1) + while True: + self.state = 191 + self.match(tlangParser.T__18) + self.state = 192 + self.value() + self.state = 195 + self._errHandler.sync(self) + _la = self._input.LA(1) + if not (_la==tlangParser.T__18): + break + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class ConditionContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -1395,48 +1659,48 @@ def condition(self, _p:int=0): _parentState = self.state localctx = tlangParser.ConditionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 38 - self.enterRecursionRule(localctx, 38, self.RULE_condition, _p) + _startState = 44 + self.enterRecursionRule(localctx, 44, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 166 + self.state = 209 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,7,self._ctx) + la_ = self._interp.adaptivePredict(self._input,13,self._ctx) if la_ == 1: - self.state = 155 + self.state = 198 self.match(tlangParser.NOT) - self.state = 156 + self.state = 199 self.condition(5) pass elif la_ == 2: - self.state = 157 + self.state = 200 self.expression(0) - self.state = 158 + self.state = 201 self.binCondOp() - self.state = 159 + self.state = 202 self.expression(0) pass elif la_ == 3: - self.state = 161 + self.state = 204 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 162 + self.state = 205 self.match(tlangParser.T__6) - self.state = 163 + self.state = 206 self.condition(0) - self.state = 164 + self.state = 207 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 174 + self.state = 217 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,8,self._ctx) + _alt = self._interp.adaptivePredict(self._input,14,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -1444,17 +1708,17 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 168 + self.state = 211 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 169 + self.state = 212 self.logicOp() - self.state = 170 + self.state = 213 self.condition(4) - self.state = 176 + self.state = 219 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,8,self._ctx) + _alt = self._interp.adaptivePredict(self._input,14,self._ctx) except RecognitionException as re: localctx.exception = re @@ -1504,11 +1768,11 @@ def accept(self, visitor:ParseTreeVisitor): def binCondOp(self): localctx = tlangParser.BinCondOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 40, self.RULE_binCondOp) + self.enterRule(localctx, 46, self.RULE_binCondOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 177 + self.state = 220 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -1551,11 +1815,11 @@ def accept(self, visitor:ParseTreeVisitor): def logicOp(self): localctx = tlangParser.LogicOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 42, self.RULE_logicOp) + self.enterRule(localctx, 48, self.RULE_logicOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 179 + self.state = 222 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -1583,6 +1847,14 @@ def NUM(self): def VAR(self): return self.getToken(tlangParser.VAR, 0) + def array(self): + return self.getTypedRuleContext(tlangParser.ArrayContext,0) + + + def arrayAccess(self): + return self.getTypedRuleContext(tlangParser.ArrayAccessContext,0) + + def getRuleIndex(self): return tlangParser.RULE_value @@ -1598,17 +1870,36 @@ def accept(self, visitor:ParseTreeVisitor): def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) - self.enterRule(localctx, 44, self.RULE_value) - self._la = 0 # Token type + self.enterRule(localctx, 50, self.RULE_value) try: - self.enterOuterAlt(localctx, 1) - self.state = 181 - _la = self._input.LA(1) - if not(_la==tlangParser.NUM or _la==tlangParser.VAR): - self._errHandler.recoverInline(self) - else: - self._errHandler.reportMatch(self) - self.consume() + self.state = 228 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input,15,self._ctx) + if la_ == 1: + self.enterOuterAlt(localctx, 1) + self.state = 224 + self.match(tlangParser.NUM) + pass + + elif la_ == 2: + self.enterOuterAlt(localctx, 2) + self.state = 225 + self.match(tlangParser.VAR) + pass + + elif la_ == 3: + self.enterOuterAlt(localctx, 3) + self.state = 226 + self.array() + pass + + elif la_ == 4: + self.enterOuterAlt(localctx, 4) + self.state = 227 + self.arrayAccess() + pass + + except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -1622,8 +1913,8 @@ def value(self): def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): if self._predicates == None: self._predicates = dict() - self._predicates[18] = self.expression_sempred - self._predicates[19] = self.condition_sempred + self._predicates[19] = self.expression_sempred + self._predicates[22] = self.condition_sempred pred = self._predicates.get(ruleIndex, None) if pred is None: raise Exception("No predicate with index:" + str(ruleIndex)) diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index 945d9dd..bb34f15 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -74,6 +74,11 @@ def visitPauseCommand(self, ctx:tlangParser.PauseCommandContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#array. + def visitArray(self, ctx:tlangParser.ArrayContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#assignment. def visitAssignment(self, ctx:tlangParser.AssignmentContext): return self.visitChildren(ctx) @@ -129,6 +134,16 @@ def visitParenExpr(self, ctx:tlangParser.ParenExprContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#arrayAccess. + def visitArrayAccess(self, ctx:tlangParser.ArrayAccessContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by tlangParser#memberAccess. + def visitMemberAccess(self, ctx:tlangParser.MemberAccessContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#condition. def visitCondition(self, ctx:tlangParser.ConditionContext): return self.visitChildren(ctx) From 180f0664890b867a06c099e233798de83ea28b26 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Mon, 10 Feb 2025 22:12:25 +0530 Subject: [PATCH 04/47] class addition (without nested internal declaration, no nested class declaration) --- ChironCore/ChironAST/ChironAST.py | 48 +- ChironCore/ChironAST/builder.py | 73 +- ChironCore/example/kachuapur3.tl | 15 + ChironCore/interpreter.py | 54 +- ChironCore/turtparse/tlang.g4 | 29 +- ChironCore/turtparse/tlang.interp | 20 +- ChironCore/turtparse/tlang.tokens | 76 +- ChironCore/turtparse/tlangLexer.interp | 17 +- ChironCore/turtparse/tlangLexer.py | 234 ++++--- ChironCore/turtparse/tlangLexer.tokens | 76 +- ChironCore/turtparse/tlangParser.py | 914 ++++++++++++++++--------- ChironCore/turtparse/tlangVisitor.py | 28 +- 12 files changed, 1043 insertions(+), 541 deletions(-) create mode 100644 ChironCore/example/kachuapur3.tl diff --git a/ChironCore/ChironAST/ChironAST.py b/ChironCore/ChironAST/ChironAST.py index 260848b..c63b951 100644 --- a/ChironCore/ChironAST/ChironAST.py +++ b/ChironCore/ChironAST/ChironAST.py @@ -25,6 +25,18 @@ def __init__(self, leftvar, rexpr): def __str__(self): return self.lvar.__str__() + " = " + self.rexpr.__str__() + +class ClassDeclarationCommand(Instruction): + + + def __init__(self, className, attributes): + self.className = className # Class name as a string + self.attributes = attributes # List of AssignmentCommand objects + + def __str__(self): + attr_str = "\n ".join(str(attr) for attr in self.attributes) + return f"class {self.className} {{\n {attr_str if attr_str else ' // No attributes'}\n}}" + class ConditionCommand(Instruction): @@ -247,12 +259,36 @@ def __init__(self, vname): def __str__(self): return self.arr -class ArrayAccess(Value): - def __init__(self, var, index): +# class ArrayAccess(Value): +# def __init__(self, var, index): +# self.var = var +# self.idx = index + +# def __str__(self): +# indices_str = "".join(f"[{idx}]" for idx in self.idx) # Format multiple indices +# return f"{self.var}{indices_str}" +# # return self.var.__str__() + "[" + self.idx.__str__() + "]" + +class ObjectOrArrayAccess(Value): + def __init__(self, var, accesses): self.var = var - self.idx = index + self.accesses = accesses # List of attribute names or indices + + def __str__(self): + result = self.var + for access in self.accesses: + if isinstance(access, list): # Array indexing + indices_str = "".join(f"[{idx}]" for idx in access) + result += indices_str + else: # Object attribute access + result += f".{access}" + return result + +class ObjectInstantiationCommand(Instruction): + def __init__(self, target, class_name): + self.target = target # Variable name or Object/Array Access + self.class_name = class_name # The class being instantiated + def __str__(self): - indices_str = "".join(f"[{idx}]" for idx in self.idx) # Format multiple indices - return f"{self.var}{indices_str}" - # return self.var.__str__() + "[" + self.idx.__str__() + "]" \ No newline at end of file + return f"{self.target} = new {self.class_name}()" diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 499df97..c6b8c15 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -8,6 +8,7 @@ from turtparse.tlangParser import tlangParser from turtparse.tlangVisitor import tlangVisitor +from antlr4.tree.Tree import TerminalNodeImpl # Import TerminalNodeImpl from ChironAST import ChironAST @@ -20,10 +21,13 @@ def __init__(self): self.stmtList=[] def getLval(self,ctx): + if ctx.VAR(): + if isinstance(ctx.VAR(),list): + return ChironAST.Var(ctx.VAR()[0].getText()) return ChironAST.Var(ctx.VAR().getText()) - elif ctx.arrayAccess(): - return self.visitArrayAccess(ctx.arrayAccess()) + elif ctx.objectOrArrayAccess(): + return self.visitObjectOrArrayAccess(ctx.objectOrArrayAccess()) def visitStart(self, ctx:tlangParser.StartContext): stmtList = self.visit(ctx.instruction_list()) @@ -63,13 +67,64 @@ def visitAssignment(self, ctx:tlangParser.AssignmentContext): # Otherwise, just return a normal assignment return [(ChironAST.AssignmentCommand(lval, rval), 1)] - def visitArrayAccess(self, ctx:tlangParser.ArrayAccessContext): - var = ctx.VAR().getText() - indices = [self.visit(expr).val for expr in ctx.expression()] # Visit all expressions in [] + def visitObjectOrArrayAccess(self, ctx: tlangParser.ObjectOrArrayAccessContext): + # Start with the base variable (first part of access) + base = ctx.baseAccess().VAR().getText() + + # Traverse through the nested access ('.' for attributes, '[]' for indices) + accesses = [] + i = 1 # Start from second child (skip baseAccess) + + while i < len(ctx.children): + child = ctx.children[i] + + if isinstance(child, TerminalNodeImpl) and child.getText() == '.': + # Next child must be a VAR (attribute access) + i += 1 # Move to VAR + accesses.append(ctx.children[i].getText()) + + elif child.getText() == '[': + # Array access: Process the expression inside `[]` + i += 1 # Move to expression inside brackets + expr = self.visit(ctx.children[i]) # Visit and evaluate expression + accesses.append([expr.val]) # Store index as a list + + i += 1 # Skip closing ']' + + i += 1 # Move to the next child + + + return ChironAST.ObjectOrArrayAccess(base, accesses) + + def visitObjectInstantiation(self, ctx: tlangParser.ObjectInstantiationContext): + # Extract the left-hand side (target variable or object access) + lval = self.getLval(ctx) + # Extract the class name + class_name = ctx.VAR()[-1].getText() # The last VAR is the class being instantiated + + return [(ChironAST.ObjectInstantiationCommand(lval, class_name),1)] + + + def visitClassDeclaration(self, ctx: tlangParser.ClassDeclarationContext): + className = ctx.VAR().getText() # Extract class name + + attributes = [] + if ctx.classBody(): + for attrDecl in ctx.classBody().classAttributeDeclaration(): + assign_list= self.visitAssignment(attrDecl.assignment()) + attributes.extend(assign_list) + + print(className,attributes) + + return [(ChironAST.ClassDeclarationCommand(className, attributes),1)] + + # def visitArrayAccess(self, ctx:tlangParser.ArrayAccessContext): + # var = ctx.VAR().getText() + # indices = [self.visit(expr).val for expr in ctx.expression()] # Visit all expressions in [] - # print(var, indices, "Inside multi-dimensional array access") + # # print(var, indices, "Inside multi-dimensional array access") - return ChironAST.ArrayAccess(var, indices) # Return an object handling multiple indices + # return ChironAST.ArrayAccess(var, indices) # Return an object handling multiple indices def visitValue(self, ctx:tlangParser.ValueContext): if ctx.NUM(): @@ -78,9 +133,9 @@ def visitValue(self, ctx:tlangParser.ValueContext): return ChironAST.Var(ctx.VAR().getText()) elif ctx.array(): return ChironAST.Array(ctx.array().getText()) - elif ctx.arrayAccess(): + elif ctx.objectOrArrayAccess(): print("entering heaven") - return self.visitArrayAccess(ctx.arrayAccess()) + return self.visitObjectOrArrayAccess(ctx.objectOrArrayAccess()) def visitAssignExpr(self, ctx: tlangParser.AssignExprContext): diff --git a/ChironCore/example/kachuapur3.tl b/ChironCore/example/kachuapur3.tl new file mode 100644 index 0000000..ae7642b --- /dev/null +++ b/ChironCore/example/kachuapur3.tl @@ -0,0 +1,15 @@ +class :a { + :b = 3; + :c = 4; + :d = [2,3,4,[5,6]]; +} + +:b = new :a() +:b.:c = 5 +print(:b.:c) +:x = :a.:c + :b.:c * 2 +:y = :b.:d[3][1] +print(:x) +print(:y) +:b.:d[3][1]=99 +print(:b.:d ) \ No newline at end of file diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 2cdc098..4a67e29 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -2,11 +2,14 @@ from ChironAST import ChironAST from ChironHooks import Chironhooks import turtle - +import re Release="Chiron v5.3" def addContext(s): - return str(s).strip().replace(":", "self.prg.") + s= re.sub(r'(?'=26 -'=='=27 -'!='=28 -'<='=29 -'>='=30 -'&&'=31 -'||'=32 -'!'=33 +'class'=19 +'{'=20 +'}'=21 +';'=22 +'new'=23 +'.'=24 +'+'=25 +'-'=26 +'*'=27 +'/'=28 +'pendown?'=29 +'<'=30 +'>'=31 +'=='=32 +'!='=33 +'<='=34 +'>='=35 +'&&'=36 +'||'=37 +'!'=38 diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index e99cc74..4fc342c 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -18,6 +18,11 @@ null 'pause' '=' 'print' +'class' +'{' +'}' +';' +'new' '.' '+' '-' @@ -59,6 +64,11 @@ null null null null +null +null +null +null +null PLUS MINUS MUL @@ -98,6 +108,11 @@ T__15 T__16 T__17 T__18 +T__19 +T__20 +T__21 +T__22 +T__23 PLUS MINUS MUL @@ -125,4 +140,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 39, 231, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 6, 35, 208, 10, 35, 13, 35, 14, 35, 209, 3, 36, 3, 36, 3, 36, 7, 36, 215, 10, 36, 12, 36, 14, 36, 218, 11, 36, 3, 37, 6, 37, 221, 10, 37, 13, 37, 14, 37, 222, 3, 38, 6, 38, 226, 10, 38, 13, 38, 14, 38, 227, 3, 38, 3, 38, 2, 2, 39, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 234, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 3, 77, 3, 2, 2, 2, 5, 80, 3, 2, 2, 2, 7, 82, 3, 2, 2, 2, 9, 84, 3, 2, 2, 2, 11, 89, 3, 2, 2, 2, 13, 96, 3, 2, 2, 2, 15, 101, 3, 2, 2, 2, 17, 103, 3, 2, 2, 2, 19, 105, 3, 2, 2, 2, 21, 107, 3, 2, 2, 2, 23, 115, 3, 2, 2, 2, 25, 124, 3, 2, 2, 2, 27, 129, 3, 2, 2, 2, 29, 135, 3, 2, 2, 2, 31, 141, 3, 2, 2, 2, 33, 149, 3, 2, 2, 2, 35, 155, 3, 2, 2, 2, 37, 157, 3, 2, 2, 2, 39, 163, 3, 2, 2, 2, 41, 165, 3, 2, 2, 2, 43, 167, 3, 2, 2, 2, 45, 169, 3, 2, 2, 2, 47, 171, 3, 2, 2, 2, 49, 173, 3, 2, 2, 2, 51, 182, 3, 2, 2, 2, 53, 184, 3, 2, 2, 2, 55, 186, 3, 2, 2, 2, 57, 189, 3, 2, 2, 2, 59, 192, 3, 2, 2, 2, 61, 195, 3, 2, 2, 2, 63, 198, 3, 2, 2, 2, 65, 201, 3, 2, 2, 2, 67, 204, 3, 2, 2, 2, 69, 207, 3, 2, 2, 2, 71, 211, 3, 2, 2, 2, 73, 220, 3, 2, 2, 2, 75, 225, 3, 2, 2, 2, 77, 78, 7, 107, 2, 2, 78, 79, 7, 104, 2, 2, 79, 4, 3, 2, 2, 2, 80, 81, 7, 93, 2, 2, 81, 6, 3, 2, 2, 2, 82, 83, 7, 95, 2, 2, 83, 8, 3, 2, 2, 2, 84, 85, 7, 103, 2, 2, 85, 86, 7, 110, 2, 2, 86, 87, 7, 117, 2, 2, 87, 88, 7, 103, 2, 2, 88, 10, 3, 2, 2, 2, 89, 90, 7, 116, 2, 2, 90, 91, 7, 103, 2, 2, 91, 92, 7, 114, 2, 2, 92, 93, 7, 103, 2, 2, 93, 94, 7, 99, 2, 2, 94, 95, 7, 118, 2, 2, 95, 12, 3, 2, 2, 2, 96, 97, 7, 105, 2, 2, 97, 98, 7, 113, 2, 2, 98, 99, 7, 118, 2, 2, 99, 100, 7, 113, 2, 2, 100, 14, 3, 2, 2, 2, 101, 102, 7, 42, 2, 2, 102, 16, 3, 2, 2, 2, 103, 104, 7, 46, 2, 2, 104, 18, 3, 2, 2, 2, 105, 106, 7, 43, 2, 2, 106, 20, 3, 2, 2, 2, 107, 108, 7, 104, 2, 2, 108, 109, 7, 113, 2, 2, 109, 110, 7, 116, 2, 2, 110, 111, 7, 121, 2, 2, 111, 112, 7, 99, 2, 2, 112, 113, 7, 116, 2, 2, 113, 114, 7, 102, 2, 2, 114, 22, 3, 2, 2, 2, 115, 116, 7, 100, 2, 2, 116, 117, 7, 99, 2, 2, 117, 118, 7, 101, 2, 2, 118, 119, 7, 109, 2, 2, 119, 120, 7, 121, 2, 2, 120, 121, 7, 99, 2, 2, 121, 122, 7, 116, 2, 2, 122, 123, 7, 102, 2, 2, 123, 24, 3, 2, 2, 2, 124, 125, 7, 110, 2, 2, 125, 126, 7, 103, 2, 2, 126, 127, 7, 104, 2, 2, 127, 128, 7, 118, 2, 2, 128, 26, 3, 2, 2, 2, 129, 130, 7, 116, 2, 2, 130, 131, 7, 107, 2, 2, 131, 132, 7, 105, 2, 2, 132, 133, 7, 106, 2, 2, 133, 134, 7, 118, 2, 2, 134, 28, 3, 2, 2, 2, 135, 136, 7, 114, 2, 2, 136, 137, 7, 103, 2, 2, 137, 138, 7, 112, 2, 2, 138, 139, 7, 119, 2, 2, 139, 140, 7, 114, 2, 2, 140, 30, 3, 2, 2, 2, 141, 142, 7, 114, 2, 2, 142, 143, 7, 103, 2, 2, 143, 144, 7, 112, 2, 2, 144, 145, 7, 102, 2, 2, 145, 146, 7, 113, 2, 2, 146, 147, 7, 121, 2, 2, 147, 148, 7, 112, 2, 2, 148, 32, 3, 2, 2, 2, 149, 150, 7, 114, 2, 2, 150, 151, 7, 99, 2, 2, 151, 152, 7, 119, 2, 2, 152, 153, 7, 117, 2, 2, 153, 154, 7, 103, 2, 2, 154, 34, 3, 2, 2, 2, 155, 156, 7, 63, 2, 2, 156, 36, 3, 2, 2, 2, 157, 158, 7, 114, 2, 2, 158, 159, 7, 116, 2, 2, 159, 160, 7, 107, 2, 2, 160, 161, 7, 112, 2, 2, 161, 162, 7, 118, 2, 2, 162, 38, 3, 2, 2, 2, 163, 164, 7, 48, 2, 2, 164, 40, 3, 2, 2, 2, 165, 166, 7, 45, 2, 2, 166, 42, 3, 2, 2, 2, 167, 168, 7, 47, 2, 2, 168, 44, 3, 2, 2, 2, 169, 170, 7, 44, 2, 2, 170, 46, 3, 2, 2, 2, 171, 172, 7, 49, 2, 2, 172, 48, 3, 2, 2, 2, 173, 174, 7, 114, 2, 2, 174, 175, 7, 103, 2, 2, 175, 176, 7, 112, 2, 2, 176, 177, 7, 102, 2, 2, 177, 178, 7, 113, 2, 2, 178, 179, 7, 121, 2, 2, 179, 180, 7, 112, 2, 2, 180, 181, 7, 65, 2, 2, 181, 50, 3, 2, 2, 2, 182, 183, 7, 62, 2, 2, 183, 52, 3, 2, 2, 2, 184, 185, 7, 64, 2, 2, 185, 54, 3, 2, 2, 2, 186, 187, 7, 63, 2, 2, 187, 188, 7, 63, 2, 2, 188, 56, 3, 2, 2, 2, 189, 190, 7, 35, 2, 2, 190, 191, 7, 63, 2, 2, 191, 58, 3, 2, 2, 2, 192, 193, 7, 62, 2, 2, 193, 194, 7, 63, 2, 2, 194, 60, 3, 2, 2, 2, 195, 196, 7, 64, 2, 2, 196, 197, 7, 63, 2, 2, 197, 62, 3, 2, 2, 2, 198, 199, 7, 40, 2, 2, 199, 200, 7, 40, 2, 2, 200, 64, 3, 2, 2, 2, 201, 202, 7, 126, 2, 2, 202, 203, 7, 126, 2, 2, 203, 66, 3, 2, 2, 2, 204, 205, 7, 35, 2, 2, 205, 68, 3, 2, 2, 2, 206, 208, 9, 2, 2, 2, 207, 206, 3, 2, 2, 2, 208, 209, 3, 2, 2, 2, 209, 207, 3, 2, 2, 2, 209, 210, 3, 2, 2, 2, 210, 70, 3, 2, 2, 2, 211, 212, 7, 60, 2, 2, 212, 216, 9, 3, 2, 2, 213, 215, 9, 4, 2, 2, 214, 213, 3, 2, 2, 2, 215, 218, 3, 2, 2, 2, 216, 214, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 72, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 219, 221, 9, 5, 2, 2, 220, 219, 3, 2, 2, 2, 221, 222, 3, 2, 2, 2, 222, 220, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 74, 3, 2, 2, 2, 224, 226, 9, 6, 2, 2, 225, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 230, 8, 38, 2, 2, 230, 76, 3, 2, 2, 2, 7, 2, 209, 216, 222, 227, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 44, 257, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 6, 40, 234, 10, 40, 13, 40, 14, 40, 235, 3, 41, 3, 41, 3, 41, 7, 41, 241, 10, 41, 12, 41, 14, 41, 244, 11, 41, 3, 42, 6, 42, 247, 10, 42, 13, 42, 14, 42, 248, 3, 43, 6, 43, 252, 10, 43, 13, 43, 14, 43, 253, 3, 43, 3, 43, 2, 2, 44, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 260, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 3, 87, 3, 2, 2, 2, 5, 90, 3, 2, 2, 2, 7, 92, 3, 2, 2, 2, 9, 94, 3, 2, 2, 2, 11, 99, 3, 2, 2, 2, 13, 106, 3, 2, 2, 2, 15, 111, 3, 2, 2, 2, 17, 113, 3, 2, 2, 2, 19, 115, 3, 2, 2, 2, 21, 117, 3, 2, 2, 2, 23, 125, 3, 2, 2, 2, 25, 134, 3, 2, 2, 2, 27, 139, 3, 2, 2, 2, 29, 145, 3, 2, 2, 2, 31, 151, 3, 2, 2, 2, 33, 159, 3, 2, 2, 2, 35, 165, 3, 2, 2, 2, 37, 167, 3, 2, 2, 2, 39, 173, 3, 2, 2, 2, 41, 179, 3, 2, 2, 2, 43, 181, 3, 2, 2, 2, 45, 183, 3, 2, 2, 2, 47, 185, 3, 2, 2, 2, 49, 189, 3, 2, 2, 2, 51, 191, 3, 2, 2, 2, 53, 193, 3, 2, 2, 2, 55, 195, 3, 2, 2, 2, 57, 197, 3, 2, 2, 2, 59, 199, 3, 2, 2, 2, 61, 208, 3, 2, 2, 2, 63, 210, 3, 2, 2, 2, 65, 212, 3, 2, 2, 2, 67, 215, 3, 2, 2, 2, 69, 218, 3, 2, 2, 2, 71, 221, 3, 2, 2, 2, 73, 224, 3, 2, 2, 2, 75, 227, 3, 2, 2, 2, 77, 230, 3, 2, 2, 2, 79, 233, 3, 2, 2, 2, 81, 237, 3, 2, 2, 2, 83, 246, 3, 2, 2, 2, 85, 251, 3, 2, 2, 2, 87, 88, 7, 107, 2, 2, 88, 89, 7, 104, 2, 2, 89, 4, 3, 2, 2, 2, 90, 91, 7, 93, 2, 2, 91, 6, 3, 2, 2, 2, 92, 93, 7, 95, 2, 2, 93, 8, 3, 2, 2, 2, 94, 95, 7, 103, 2, 2, 95, 96, 7, 110, 2, 2, 96, 97, 7, 117, 2, 2, 97, 98, 7, 103, 2, 2, 98, 10, 3, 2, 2, 2, 99, 100, 7, 116, 2, 2, 100, 101, 7, 103, 2, 2, 101, 102, 7, 114, 2, 2, 102, 103, 7, 103, 2, 2, 103, 104, 7, 99, 2, 2, 104, 105, 7, 118, 2, 2, 105, 12, 3, 2, 2, 2, 106, 107, 7, 105, 2, 2, 107, 108, 7, 113, 2, 2, 108, 109, 7, 118, 2, 2, 109, 110, 7, 113, 2, 2, 110, 14, 3, 2, 2, 2, 111, 112, 7, 42, 2, 2, 112, 16, 3, 2, 2, 2, 113, 114, 7, 46, 2, 2, 114, 18, 3, 2, 2, 2, 115, 116, 7, 43, 2, 2, 116, 20, 3, 2, 2, 2, 117, 118, 7, 104, 2, 2, 118, 119, 7, 113, 2, 2, 119, 120, 7, 116, 2, 2, 120, 121, 7, 121, 2, 2, 121, 122, 7, 99, 2, 2, 122, 123, 7, 116, 2, 2, 123, 124, 7, 102, 2, 2, 124, 22, 3, 2, 2, 2, 125, 126, 7, 100, 2, 2, 126, 127, 7, 99, 2, 2, 127, 128, 7, 101, 2, 2, 128, 129, 7, 109, 2, 2, 129, 130, 7, 121, 2, 2, 130, 131, 7, 99, 2, 2, 131, 132, 7, 116, 2, 2, 132, 133, 7, 102, 2, 2, 133, 24, 3, 2, 2, 2, 134, 135, 7, 110, 2, 2, 135, 136, 7, 103, 2, 2, 136, 137, 7, 104, 2, 2, 137, 138, 7, 118, 2, 2, 138, 26, 3, 2, 2, 2, 139, 140, 7, 116, 2, 2, 140, 141, 7, 107, 2, 2, 141, 142, 7, 105, 2, 2, 142, 143, 7, 106, 2, 2, 143, 144, 7, 118, 2, 2, 144, 28, 3, 2, 2, 2, 145, 146, 7, 114, 2, 2, 146, 147, 7, 103, 2, 2, 147, 148, 7, 112, 2, 2, 148, 149, 7, 119, 2, 2, 149, 150, 7, 114, 2, 2, 150, 30, 3, 2, 2, 2, 151, 152, 7, 114, 2, 2, 152, 153, 7, 103, 2, 2, 153, 154, 7, 112, 2, 2, 154, 155, 7, 102, 2, 2, 155, 156, 7, 113, 2, 2, 156, 157, 7, 121, 2, 2, 157, 158, 7, 112, 2, 2, 158, 32, 3, 2, 2, 2, 159, 160, 7, 114, 2, 2, 160, 161, 7, 99, 2, 2, 161, 162, 7, 119, 2, 2, 162, 163, 7, 117, 2, 2, 163, 164, 7, 103, 2, 2, 164, 34, 3, 2, 2, 2, 165, 166, 7, 63, 2, 2, 166, 36, 3, 2, 2, 2, 167, 168, 7, 114, 2, 2, 168, 169, 7, 116, 2, 2, 169, 170, 7, 107, 2, 2, 170, 171, 7, 112, 2, 2, 171, 172, 7, 118, 2, 2, 172, 38, 3, 2, 2, 2, 173, 174, 7, 101, 2, 2, 174, 175, 7, 110, 2, 2, 175, 176, 7, 99, 2, 2, 176, 177, 7, 117, 2, 2, 177, 178, 7, 117, 2, 2, 178, 40, 3, 2, 2, 2, 179, 180, 7, 125, 2, 2, 180, 42, 3, 2, 2, 2, 181, 182, 7, 127, 2, 2, 182, 44, 3, 2, 2, 2, 183, 184, 7, 61, 2, 2, 184, 46, 3, 2, 2, 2, 185, 186, 7, 112, 2, 2, 186, 187, 7, 103, 2, 2, 187, 188, 7, 121, 2, 2, 188, 48, 3, 2, 2, 2, 189, 190, 7, 48, 2, 2, 190, 50, 3, 2, 2, 2, 191, 192, 7, 45, 2, 2, 192, 52, 3, 2, 2, 2, 193, 194, 7, 47, 2, 2, 194, 54, 3, 2, 2, 2, 195, 196, 7, 44, 2, 2, 196, 56, 3, 2, 2, 2, 197, 198, 7, 49, 2, 2, 198, 58, 3, 2, 2, 2, 199, 200, 7, 114, 2, 2, 200, 201, 7, 103, 2, 2, 201, 202, 7, 112, 2, 2, 202, 203, 7, 102, 2, 2, 203, 204, 7, 113, 2, 2, 204, 205, 7, 121, 2, 2, 205, 206, 7, 112, 2, 2, 206, 207, 7, 65, 2, 2, 207, 60, 3, 2, 2, 2, 208, 209, 7, 62, 2, 2, 209, 62, 3, 2, 2, 2, 210, 211, 7, 64, 2, 2, 211, 64, 3, 2, 2, 2, 212, 213, 7, 63, 2, 2, 213, 214, 7, 63, 2, 2, 214, 66, 3, 2, 2, 2, 215, 216, 7, 35, 2, 2, 216, 217, 7, 63, 2, 2, 217, 68, 3, 2, 2, 2, 218, 219, 7, 62, 2, 2, 219, 220, 7, 63, 2, 2, 220, 70, 3, 2, 2, 2, 221, 222, 7, 64, 2, 2, 222, 223, 7, 63, 2, 2, 223, 72, 3, 2, 2, 2, 224, 225, 7, 40, 2, 2, 225, 226, 7, 40, 2, 2, 226, 74, 3, 2, 2, 2, 227, 228, 7, 126, 2, 2, 228, 229, 7, 126, 2, 2, 229, 76, 3, 2, 2, 2, 230, 231, 7, 35, 2, 2, 231, 78, 3, 2, 2, 2, 232, 234, 9, 2, 2, 2, 233, 232, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 233, 3, 2, 2, 2, 235, 236, 3, 2, 2, 2, 236, 80, 3, 2, 2, 2, 237, 238, 7, 60, 2, 2, 238, 242, 9, 3, 2, 2, 239, 241, 9, 4, 2, 2, 240, 239, 3, 2, 2, 2, 241, 244, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 82, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 245, 247, 9, 5, 2, 2, 246, 245, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 84, 3, 2, 2, 2, 250, 252, 9, 6, 2, 2, 251, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 253, 254, 3, 2, 2, 2, 254, 255, 3, 2, 2, 2, 255, 256, 8, 43, 2, 2, 256, 86, 3, 2, 2, 2, 7, 2, 235, 242, 248, 253, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index 16a5a49..eae773c 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -8,95 +8,106 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\'") - buf.write("\u00e7\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2,") + buf.write("\u0101\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") buf.write("\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36") buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%") - buf.write("\4&\t&\3\2\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5") - buf.write("\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3") - buf.write("\b\3\t\3\t\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13") - buf.write("\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r") - buf.write("\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17") - buf.write("\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20") - buf.write("\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23") - buf.write("\3\23\3\23\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27") - buf.write("\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31") - buf.write("\3\32\3\32\3\33\3\33\3\34\3\34\3\34\3\35\3\35\3\35\3\36") - buf.write("\3\36\3\36\3\37\3\37\3\37\3 \3 \3 \3!\3!\3!\3\"\3\"\3") - buf.write("#\6#\u00d0\n#\r#\16#\u00d1\3$\3$\3$\7$\u00d7\n$\f$\16") - buf.write("$\u00da\13$\3%\6%\u00dd\n%\r%\16%\u00de\3&\6&\u00e2\n") - buf.write("&\r&\16&\u00e3\3&\3&\2\2\'\3\3\5\4\7\5\t\6\13\7\r\b\17") - buf.write("\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23") - buf.write("%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36") - buf.write(";\37= ?!A\"C#E$G%I&K\'\3\2\7\3\2\62;\5\2C\\aac|\5\2\62") - buf.write(";C\\c|\4\2C\\c|\5\2\13\f\17\17\"\"\2\u00ea\2\3\3\2\2\2") - buf.write("\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r") - buf.write("\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3") - buf.write("\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2") - buf.write("\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'") - buf.write("\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2") - buf.write("\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29") - buf.write("\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2") - buf.write("C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2") - buf.write("\3M\3\2\2\2\5P\3\2\2\2\7R\3\2\2\2\tT\3\2\2\2\13Y\3\2\2") - buf.write("\2\r`\3\2\2\2\17e\3\2\2\2\21g\3\2\2\2\23i\3\2\2\2\25k") - buf.write("\3\2\2\2\27s\3\2\2\2\31|\3\2\2\2\33\u0081\3\2\2\2\35\u0087") - buf.write("\3\2\2\2\37\u008d\3\2\2\2!\u0095\3\2\2\2#\u009b\3\2\2") - buf.write("\2%\u009d\3\2\2\2\'\u00a3\3\2\2\2)\u00a5\3\2\2\2+\u00a7") - buf.write("\3\2\2\2-\u00a9\3\2\2\2/\u00ab\3\2\2\2\61\u00ad\3\2\2") - buf.write("\2\63\u00b6\3\2\2\2\65\u00b8\3\2\2\2\67\u00ba\3\2\2\2") - buf.write("9\u00bd\3\2\2\2;\u00c0\3\2\2\2=\u00c3\3\2\2\2?\u00c6\3") - buf.write("\2\2\2A\u00c9\3\2\2\2C\u00cc\3\2\2\2E\u00cf\3\2\2\2G\u00d3") - buf.write("\3\2\2\2I\u00dc\3\2\2\2K\u00e1\3\2\2\2MN\7k\2\2NO\7h\2") - buf.write("\2O\4\3\2\2\2PQ\7]\2\2Q\6\3\2\2\2RS\7_\2\2S\b\3\2\2\2") - buf.write("TU\7g\2\2UV\7n\2\2VW\7u\2\2WX\7g\2\2X\n\3\2\2\2YZ\7t\2") - buf.write("\2Z[\7g\2\2[\\\7r\2\2\\]\7g\2\2]^\7c\2\2^_\7v\2\2_\f\3") - buf.write("\2\2\2`a\7i\2\2ab\7q\2\2bc\7v\2\2cd\7q\2\2d\16\3\2\2\2") - buf.write("ef\7*\2\2f\20\3\2\2\2gh\7.\2\2h\22\3\2\2\2ij\7+\2\2j\24") - buf.write("\3\2\2\2kl\7h\2\2lm\7q\2\2mn\7t\2\2no\7y\2\2op\7c\2\2") - buf.write("pq\7t\2\2qr\7f\2\2r\26\3\2\2\2st\7d\2\2tu\7c\2\2uv\7e") - buf.write("\2\2vw\7m\2\2wx\7y\2\2xy\7c\2\2yz\7t\2\2z{\7f\2\2{\30") - buf.write("\3\2\2\2|}\7n\2\2}~\7g\2\2~\177\7h\2\2\177\u0080\7v\2") - buf.write("\2\u0080\32\3\2\2\2\u0081\u0082\7t\2\2\u0082\u0083\7k") - buf.write("\2\2\u0083\u0084\7i\2\2\u0084\u0085\7j\2\2\u0085\u0086") - buf.write("\7v\2\2\u0086\34\3\2\2\2\u0087\u0088\7r\2\2\u0088\u0089") - buf.write("\7g\2\2\u0089\u008a\7p\2\2\u008a\u008b\7w\2\2\u008b\u008c") - buf.write("\7r\2\2\u008c\36\3\2\2\2\u008d\u008e\7r\2\2\u008e\u008f") - buf.write("\7g\2\2\u008f\u0090\7p\2\2\u0090\u0091\7f\2\2\u0091\u0092") - buf.write("\7q\2\2\u0092\u0093\7y\2\2\u0093\u0094\7p\2\2\u0094 \3") - buf.write("\2\2\2\u0095\u0096\7r\2\2\u0096\u0097\7c\2\2\u0097\u0098") - buf.write("\7w\2\2\u0098\u0099\7u\2\2\u0099\u009a\7g\2\2\u009a\"") - buf.write("\3\2\2\2\u009b\u009c\7?\2\2\u009c$\3\2\2\2\u009d\u009e") - buf.write("\7r\2\2\u009e\u009f\7t\2\2\u009f\u00a0\7k\2\2\u00a0\u00a1") - buf.write("\7p\2\2\u00a1\u00a2\7v\2\2\u00a2&\3\2\2\2\u00a3\u00a4") - buf.write("\7\60\2\2\u00a4(\3\2\2\2\u00a5\u00a6\7-\2\2\u00a6*\3\2") - buf.write("\2\2\u00a7\u00a8\7/\2\2\u00a8,\3\2\2\2\u00a9\u00aa\7,") - buf.write("\2\2\u00aa.\3\2\2\2\u00ab\u00ac\7\61\2\2\u00ac\60\3\2") - buf.write("\2\2\u00ad\u00ae\7r\2\2\u00ae\u00af\7g\2\2\u00af\u00b0") - buf.write("\7p\2\2\u00b0\u00b1\7f\2\2\u00b1\u00b2\7q\2\2\u00b2\u00b3") - buf.write("\7y\2\2\u00b3\u00b4\7p\2\2\u00b4\u00b5\7A\2\2\u00b5\62") - buf.write("\3\2\2\2\u00b6\u00b7\7>\2\2\u00b7\64\3\2\2\2\u00b8\u00b9") - buf.write("\7@\2\2\u00b9\66\3\2\2\2\u00ba\u00bb\7?\2\2\u00bb\u00bc") - buf.write("\7?\2\2\u00bc8\3\2\2\2\u00bd\u00be\7#\2\2\u00be\u00bf") - buf.write("\7?\2\2\u00bf:\3\2\2\2\u00c0\u00c1\7>\2\2\u00c1\u00c2") - buf.write("\7?\2\2\u00c2<\3\2\2\2\u00c3\u00c4\7@\2\2\u00c4\u00c5") - buf.write("\7?\2\2\u00c5>\3\2\2\2\u00c6\u00c7\7(\2\2\u00c7\u00c8") - buf.write("\7(\2\2\u00c8@\3\2\2\2\u00c9\u00ca\7~\2\2\u00ca\u00cb") - buf.write("\7~\2\2\u00cbB\3\2\2\2\u00cc\u00cd\7#\2\2\u00cdD\3\2\2") - buf.write("\2\u00ce\u00d0\t\2\2\2\u00cf\u00ce\3\2\2\2\u00d0\u00d1") - buf.write("\3\2\2\2\u00d1\u00cf\3\2\2\2\u00d1\u00d2\3\2\2\2\u00d2") - buf.write("F\3\2\2\2\u00d3\u00d4\7<\2\2\u00d4\u00d8\t\3\2\2\u00d5") - buf.write("\u00d7\t\4\2\2\u00d6\u00d5\3\2\2\2\u00d7\u00da\3\2\2\2") - buf.write("\u00d8\u00d6\3\2\2\2\u00d8\u00d9\3\2\2\2\u00d9H\3\2\2") - buf.write("\2\u00da\u00d8\3\2\2\2\u00db\u00dd\t\5\2\2\u00dc\u00db") - buf.write("\3\2\2\2\u00dd\u00de\3\2\2\2\u00de\u00dc\3\2\2\2\u00de") - buf.write("\u00df\3\2\2\2\u00dfJ\3\2\2\2\u00e0\u00e2\t\6\2\2\u00e1") - buf.write("\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3\u00e1\3\2\2\2") - buf.write("\u00e3\u00e4\3\2\2\2\u00e4\u00e5\3\2\2\2\u00e5\u00e6\b") - buf.write("&\2\2\u00e6L\3\2\2\2\7\2\u00d1\u00d8\u00de\u00e3\3\b\2") + buf.write("\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\3\2\3\2\3\2\3\3") + buf.write("\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3") + buf.write("\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\t\3\t\3\n\3\n\3\13") + buf.write("\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3") + buf.write("\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16") + buf.write("\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20") + buf.write("\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21") + buf.write("\3\21\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\24\3\24") + buf.write("\3\24\3\24\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\30") + buf.write("\3\30\3\30\3\30\3\31\3\31\3\32\3\32\3\33\3\33\3\34\3\34") + buf.write("\3\35\3\35\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36") + buf.write("\3\37\3\37\3 \3 \3!\3!\3!\3\"\3\"\3\"\3#\3#\3#\3$\3$\3") + buf.write("$\3%\3%\3%\3&\3&\3&\3\'\3\'\3(\6(\u00ea\n(\r(\16(\u00eb") + buf.write("\3)\3)\3)\7)\u00f1\n)\f)\16)\u00f4\13)\3*\6*\u00f7\n*") + buf.write("\r*\16*\u00f8\3+\6+\u00fc\n+\r+\16+\u00fd\3+\3+\2\2,\3") + buf.write("\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16") + buf.write("\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61") + buf.write("\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*") + buf.write("S+U,\3\2\7\3\2\62;\5\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5") + buf.write("\2\13\f\17\17\"\"\2\u0104\2\3\3\2\2\2\2\5\3\2\2\2\2\7") + buf.write("\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2") + buf.write("\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2") + buf.write("\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2") + buf.write("\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2") + buf.write("\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63") + buf.write("\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2") + buf.write("\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2") + buf.write("\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3") + buf.write("\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\3W\3\2\2\2\5Z") + buf.write("\3\2\2\2\7\\\3\2\2\2\t^\3\2\2\2\13c\3\2\2\2\rj\3\2\2\2") + buf.write("\17o\3\2\2\2\21q\3\2\2\2\23s\3\2\2\2\25u\3\2\2\2\27}\3") + buf.write("\2\2\2\31\u0086\3\2\2\2\33\u008b\3\2\2\2\35\u0091\3\2") + buf.write("\2\2\37\u0097\3\2\2\2!\u009f\3\2\2\2#\u00a5\3\2\2\2%\u00a7") + buf.write("\3\2\2\2\'\u00ad\3\2\2\2)\u00b3\3\2\2\2+\u00b5\3\2\2\2") + buf.write("-\u00b7\3\2\2\2/\u00b9\3\2\2\2\61\u00bd\3\2\2\2\63\u00bf") + buf.write("\3\2\2\2\65\u00c1\3\2\2\2\67\u00c3\3\2\2\29\u00c5\3\2") + buf.write("\2\2;\u00c7\3\2\2\2=\u00d0\3\2\2\2?\u00d2\3\2\2\2A\u00d4") + buf.write("\3\2\2\2C\u00d7\3\2\2\2E\u00da\3\2\2\2G\u00dd\3\2\2\2") + buf.write("I\u00e0\3\2\2\2K\u00e3\3\2\2\2M\u00e6\3\2\2\2O\u00e9\3") + buf.write("\2\2\2Q\u00ed\3\2\2\2S\u00f6\3\2\2\2U\u00fb\3\2\2\2WX") + buf.write("\7k\2\2XY\7h\2\2Y\4\3\2\2\2Z[\7]\2\2[\6\3\2\2\2\\]\7_") + buf.write("\2\2]\b\3\2\2\2^_\7g\2\2_`\7n\2\2`a\7u\2\2ab\7g\2\2b\n") + buf.write("\3\2\2\2cd\7t\2\2de\7g\2\2ef\7r\2\2fg\7g\2\2gh\7c\2\2") + buf.write("hi\7v\2\2i\f\3\2\2\2jk\7i\2\2kl\7q\2\2lm\7v\2\2mn\7q\2") + buf.write("\2n\16\3\2\2\2op\7*\2\2p\20\3\2\2\2qr\7.\2\2r\22\3\2\2") + buf.write("\2st\7+\2\2t\24\3\2\2\2uv\7h\2\2vw\7q\2\2wx\7t\2\2xy\7") + buf.write("y\2\2yz\7c\2\2z{\7t\2\2{|\7f\2\2|\26\3\2\2\2}~\7d\2\2") + buf.write("~\177\7c\2\2\177\u0080\7e\2\2\u0080\u0081\7m\2\2\u0081") + buf.write("\u0082\7y\2\2\u0082\u0083\7c\2\2\u0083\u0084\7t\2\2\u0084") + buf.write("\u0085\7f\2\2\u0085\30\3\2\2\2\u0086\u0087\7n\2\2\u0087") + buf.write("\u0088\7g\2\2\u0088\u0089\7h\2\2\u0089\u008a\7v\2\2\u008a") + buf.write("\32\3\2\2\2\u008b\u008c\7t\2\2\u008c\u008d\7k\2\2\u008d") + buf.write("\u008e\7i\2\2\u008e\u008f\7j\2\2\u008f\u0090\7v\2\2\u0090") + buf.write("\34\3\2\2\2\u0091\u0092\7r\2\2\u0092\u0093\7g\2\2\u0093") + buf.write("\u0094\7p\2\2\u0094\u0095\7w\2\2\u0095\u0096\7r\2\2\u0096") + buf.write("\36\3\2\2\2\u0097\u0098\7r\2\2\u0098\u0099\7g\2\2\u0099") + buf.write("\u009a\7p\2\2\u009a\u009b\7f\2\2\u009b\u009c\7q\2\2\u009c") + buf.write("\u009d\7y\2\2\u009d\u009e\7p\2\2\u009e \3\2\2\2\u009f") + buf.write("\u00a0\7r\2\2\u00a0\u00a1\7c\2\2\u00a1\u00a2\7w\2\2\u00a2") + buf.write("\u00a3\7u\2\2\u00a3\u00a4\7g\2\2\u00a4\"\3\2\2\2\u00a5") + buf.write("\u00a6\7?\2\2\u00a6$\3\2\2\2\u00a7\u00a8\7r\2\2\u00a8") + buf.write("\u00a9\7t\2\2\u00a9\u00aa\7k\2\2\u00aa\u00ab\7p\2\2\u00ab") + buf.write("\u00ac\7v\2\2\u00ac&\3\2\2\2\u00ad\u00ae\7e\2\2\u00ae") + buf.write("\u00af\7n\2\2\u00af\u00b0\7c\2\2\u00b0\u00b1\7u\2\2\u00b1") + buf.write("\u00b2\7u\2\2\u00b2(\3\2\2\2\u00b3\u00b4\7}\2\2\u00b4") + buf.write("*\3\2\2\2\u00b5\u00b6\7\177\2\2\u00b6,\3\2\2\2\u00b7\u00b8") + buf.write("\7=\2\2\u00b8.\3\2\2\2\u00b9\u00ba\7p\2\2\u00ba\u00bb") + buf.write("\7g\2\2\u00bb\u00bc\7y\2\2\u00bc\60\3\2\2\2\u00bd\u00be") + buf.write("\7\60\2\2\u00be\62\3\2\2\2\u00bf\u00c0\7-\2\2\u00c0\64") + buf.write("\3\2\2\2\u00c1\u00c2\7/\2\2\u00c2\66\3\2\2\2\u00c3\u00c4") + buf.write("\7,\2\2\u00c48\3\2\2\2\u00c5\u00c6\7\61\2\2\u00c6:\3\2") + buf.write("\2\2\u00c7\u00c8\7r\2\2\u00c8\u00c9\7g\2\2\u00c9\u00ca") + buf.write("\7p\2\2\u00ca\u00cb\7f\2\2\u00cb\u00cc\7q\2\2\u00cc\u00cd") + buf.write("\7y\2\2\u00cd\u00ce\7p\2\2\u00ce\u00cf\7A\2\2\u00cf<\3") + buf.write("\2\2\2\u00d0\u00d1\7>\2\2\u00d1>\3\2\2\2\u00d2\u00d3\7") + buf.write("@\2\2\u00d3@\3\2\2\2\u00d4\u00d5\7?\2\2\u00d5\u00d6\7") + buf.write("?\2\2\u00d6B\3\2\2\2\u00d7\u00d8\7#\2\2\u00d8\u00d9\7") + buf.write("?\2\2\u00d9D\3\2\2\2\u00da\u00db\7>\2\2\u00db\u00dc\7") + buf.write("?\2\2\u00dcF\3\2\2\2\u00dd\u00de\7@\2\2\u00de\u00df\7") + buf.write("?\2\2\u00dfH\3\2\2\2\u00e0\u00e1\7(\2\2\u00e1\u00e2\7") + buf.write("(\2\2\u00e2J\3\2\2\2\u00e3\u00e4\7~\2\2\u00e4\u00e5\7") + buf.write("~\2\2\u00e5L\3\2\2\2\u00e6\u00e7\7#\2\2\u00e7N\3\2\2\2") + buf.write("\u00e8\u00ea\t\2\2\2\u00e9\u00e8\3\2\2\2\u00ea\u00eb\3") + buf.write("\2\2\2\u00eb\u00e9\3\2\2\2\u00eb\u00ec\3\2\2\2\u00ecP") + buf.write("\3\2\2\2\u00ed\u00ee\7<\2\2\u00ee\u00f2\t\3\2\2\u00ef") + buf.write("\u00f1\t\4\2\2\u00f0\u00ef\3\2\2\2\u00f1\u00f4\3\2\2\2") + buf.write("\u00f2\u00f0\3\2\2\2\u00f2\u00f3\3\2\2\2\u00f3R\3\2\2") + buf.write("\2\u00f4\u00f2\3\2\2\2\u00f5\u00f7\t\5\2\2\u00f6\u00f5") + buf.write("\3\2\2\2\u00f7\u00f8\3\2\2\2\u00f8\u00f6\3\2\2\2\u00f8") + buf.write("\u00f9\3\2\2\2\u00f9T\3\2\2\2\u00fa\u00fc\t\6\2\2\u00fb") + buf.write("\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\u00fb\3\2\2\2") + buf.write("\u00fd\u00fe\3\2\2\2\u00fe\u00ff\3\2\2\2\u00ff\u0100\b") + buf.write("+\2\2\u0100V\3\2\2\2\7\2\u00eb\u00f2\u00f8\u00fd\3\b\2") buf.write("\2") return buf.getvalue() @@ -126,24 +137,29 @@ class tlangLexer(Lexer): T__16 = 17 T__17 = 18 T__18 = 19 - PLUS = 20 - MINUS = 21 - MUL = 22 - DIV = 23 - PENCOND = 24 - LT = 25 - GT = 26 - EQ = 27 - NEQ = 28 - LTE = 29 - GTE = 30 - AND = 31 - OR = 32 - NOT = 33 - NUM = 34 - VAR = 35 - NAME = 36 - Whitespace = 37 + T__19 = 20 + T__20 = 21 + T__21 = 22 + T__22 = 23 + T__23 = 24 + PLUS = 25 + MINUS = 26 + MUL = 27 + DIV = 28 + PENCOND = 29 + LT = 30 + GT = 31 + EQ = 32 + NEQ = 33 + LTE = 34 + GTE = 35 + AND = 36 + OR = 37 + NOT = 38 + NUM = 39 + VAR = 40 + NAME = 41 + Whitespace = 42 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] @@ -152,9 +168,10 @@ class tlangLexer(Lexer): literalNames = [ "", "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", - "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'.'", - "'+'", "'-'", "'*'", "'/'", "'pendown?'", "'<'", "'>'", "'=='", - "'!='", "'<='", "'>='", "'&&'", "'||'", "'!'" ] + "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'class'", + "'{'", "'}'", "';'", "'new'", "'.'", "'+'", "'-'", "'*'", "'/'", + "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", "'>='", + "'&&'", "'||'", "'!'" ] symbolicNames = [ "", "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", @@ -163,9 +180,10 @@ class tlangLexer(Lexer): ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", - "T__14", "T__15", "T__16", "T__17", "T__18", "PLUS", "MINUS", - "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", - "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", "Whitespace" ] + "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", + "T__20", "T__21", "T__22", "T__23", "PLUS", "MINUS", "MUL", + "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", "GTE", + "AND", "OR", "NOT", "NUM", "VAR", "NAME", "Whitespace" ] grammarFileName = "tlang.g4" diff --git a/ChironCore/turtparse/tlangLexer.tokens b/ChironCore/turtparse/tlangLexer.tokens index 13c167e..f6b3f9b 100644 --- a/ChironCore/turtparse/tlangLexer.tokens +++ b/ChironCore/turtparse/tlangLexer.tokens @@ -17,24 +17,29 @@ T__15=16 T__16=17 T__17=18 T__18=19 -PLUS=20 -MINUS=21 -MUL=22 -DIV=23 -PENCOND=24 -LT=25 -GT=26 -EQ=27 -NEQ=28 -LTE=29 -GTE=30 -AND=31 -OR=32 -NOT=33 -NUM=34 -VAR=35 -NAME=36 -Whitespace=37 +T__19=20 +T__20=21 +T__21=22 +T__22=23 +T__23=24 +PLUS=25 +MINUS=26 +MUL=27 +DIV=28 +PENCOND=29 +LT=30 +GT=31 +EQ=32 +NEQ=33 +LTE=34 +GTE=35 +AND=36 +OR=37 +NOT=38 +NUM=39 +VAR=40 +NAME=41 +Whitespace=42 'if'=1 '['=2 ']'=3 @@ -53,18 +58,23 @@ Whitespace=37 'pause'=16 '='=17 'print'=18 -'.'=19 -'+'=20 -'-'=21 -'*'=22 -'/'=23 -'pendown?'=24 -'<'=25 -'>'=26 -'=='=27 -'!='=28 -'<='=29 -'>='=30 -'&&'=31 -'||'=32 -'!'=33 +'class'=19 +'{'=20 +'}'=21 +';'=22 +'new'=23 +'.'=24 +'+'=25 +'-'=26 +'*'=27 +'/'=28 +'pendown?'=29 +'<'=30 +'>'=31 +'=='=32 +'!='=33 +'<='=34 +'>='=35 +'&&'=36 +'||'=37 +'!'=38 diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index 5eb558f..404d8aa 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -8,101 +8,115 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\'") - buf.write("\u00e9\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3,") + buf.write("\u0107\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") - buf.write("\t\31\4\32\t\32\4\33\t\33\3\2\3\2\3\2\3\3\7\3;\n\3\f\3") - buf.write("\16\3>\13\3\3\4\6\4A\n\4\r\4\16\4B\3\5\3\5\3\5\3\5\3\5") - buf.write("\3\5\3\5\3\5\5\5M\n\5\3\6\3\6\5\6Q\n\6\3\7\3\7\3\7\3\7") - buf.write("\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3") - buf.write("\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3") - buf.write("\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17\3\17\3\17") - buf.write("\7\17}\n\17\f\17\16\17\u0080\13\17\5\17\u0082\n\17\3\17") - buf.write("\3\17\3\20\3\20\3\20\5\20\u0089\n\20\3\20\3\20\3\20\3") - buf.write("\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24") - buf.write("\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25") - buf.write("\3\25\5\25\u00a5\n\25\3\25\3\25\5\25\u00a9\n\25\3\25\3") - buf.write("\25\3\25\3\25\3\25\3\25\3\25\3\25\7\25\u00b3\n\25\f\25") - buf.write("\16\25\u00b6\13\25\3\26\3\26\3\26\3\26\3\26\6\26\u00bd") - buf.write("\n\26\r\26\16\26\u00be\3\27\3\27\3\27\6\27\u00c4\n\27") - buf.write("\r\27\16\27\u00c5\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3") - buf.write("\30\3\30\3\30\3\30\3\30\5\30\u00d4\n\30\3\30\3\30\3\30") - buf.write("\3\30\7\30\u00da\n\30\f\30\16\30\u00dd\13\30\3\31\3\31") - buf.write("\3\32\3\32\3\33\3\33\3\33\3\33\5\33\u00e7\n\33\3\33\2") - buf.write("\4(.\34\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*") - buf.write(",.\60\62\64\2\b\3\2\f\17\3\2\20\21\3\2\30\31\3\2\26\27") - buf.write("\3\2\33 \3\2!\"\2\u00ec\2\66\3\2\2\2\4<\3\2\2\2\6@\3\2") - buf.write("\2\2\bL\3\2\2\2\nP\3\2\2\2\fR\3\2\2\2\16X\3\2\2\2\20b") - buf.write("\3\2\2\2\22h\3\2\2\2\24o\3\2\2\2\26r\3\2\2\2\30t\3\2\2") - buf.write("\2\32v\3\2\2\2\34x\3\2\2\2\36\u0088\3\2\2\2 \u008d\3\2") - buf.write("\2\2\"\u0092\3\2\2\2$\u0094\3\2\2\2&\u0096\3\2\2\2(\u00a8") - buf.write("\3\2\2\2*\u00b7\3\2\2\2,\u00c0\3\2\2\2.\u00d3\3\2\2\2") - buf.write("\60\u00de\3\2\2\2\62\u00e0\3\2\2\2\64\u00e6\3\2\2\2\66") - buf.write("\67\5\4\3\2\678\7\2\2\38\3\3\2\2\29;\5\b\5\2:9\3\2\2\2") - buf.write(";>\3\2\2\2<:\3\2\2\2<=\3\2\2\2=\5\3\2\2\2><\3\2\2\2?A") - buf.write("\5\b\5\2@?\3\2\2\2AB\3\2\2\2B@\3\2\2\2BC\3\2\2\2C\7\3") - buf.write("\2\2\2DM\5\36\20\2EM\5 \21\2FM\5\n\6\2GM\5\20\t\2HM\5") - buf.write("\24\13\2IM\5\30\r\2JM\5\22\n\2KM\5\32\16\2LD\3\2\2\2L") - buf.write("E\3\2\2\2LF\3\2\2\2LG\3\2\2\2LH\3\2\2\2LI\3\2\2\2LJ\3") - buf.write("\2\2\2LK\3\2\2\2M\t\3\2\2\2NQ\5\f\7\2OQ\5\16\b\2PN\3\2") - buf.write("\2\2PO\3\2\2\2Q\13\3\2\2\2RS\7\3\2\2ST\5.\30\2TU\7\4\2") - buf.write("\2UV\5\6\4\2VW\7\5\2\2W\r\3\2\2\2XY\7\3\2\2YZ\5.\30\2") - buf.write("Z[\7\4\2\2[\\\5\6\4\2\\]\7\5\2\2]^\7\6\2\2^_\7\4\2\2_") - buf.write("`\5\6\4\2`a\7\5\2\2a\17\3\2\2\2bc\7\7\2\2cd\5\64\33\2") - buf.write("de\7\4\2\2ef\5\6\4\2fg\7\5\2\2g\21\3\2\2\2hi\7\b\2\2i") - buf.write("j\7\t\2\2jk\5(\25\2kl\7\n\2\2lm\5(\25\2mn\7\13\2\2n\23") - buf.write("\3\2\2\2op\5\26\f\2pq\5(\25\2q\25\3\2\2\2rs\t\2\2\2s\27") - buf.write("\3\2\2\2tu\t\3\2\2u\31\3\2\2\2vw\7\22\2\2w\33\3\2\2\2") - buf.write("x\u0081\7\4\2\2y~\5(\25\2z{\7\n\2\2{}\5(\25\2|z\3\2\2") - buf.write("\2}\u0080\3\2\2\2~|\3\2\2\2~\177\3\2\2\2\177\u0082\3\2") - buf.write("\2\2\u0080~\3\2\2\2\u0081y\3\2\2\2\u0081\u0082\3\2\2\2") - buf.write("\u0082\u0083\3\2\2\2\u0083\u0084\7\5\2\2\u0084\35\3\2") - buf.write("\2\2\u0085\u0089\7%\2\2\u0086\u0089\5*\26\2\u0087\u0089") - buf.write("\5,\27\2\u0088\u0085\3\2\2\2\u0088\u0086\3\2\2\2\u0088") - buf.write("\u0087\3\2\2\2\u0089\u008a\3\2\2\2\u008a\u008b\7\23\2") - buf.write("\2\u008b\u008c\5(\25\2\u008c\37\3\2\2\2\u008d\u008e\7") - buf.write("\24\2\2\u008e\u008f\7\t\2\2\u008f\u0090\5(\25\2\u0090") - buf.write("\u0091\7\13\2\2\u0091!\3\2\2\2\u0092\u0093\t\4\2\2\u0093") - buf.write("#\3\2\2\2\u0094\u0095\t\5\2\2\u0095%\3\2\2\2\u0096\u0097") - buf.write("\7\27\2\2\u0097\'\3\2\2\2\u0098\u0099\b\25\1\2\u0099\u009a") - buf.write("\5&\24\2\u009a\u009b\5(\25\b\u009b\u00a9\3\2\2\2\u009c") - buf.write("\u009d\7\t\2\2\u009d\u009e\5(\25\2\u009e\u009f\7\13\2") - buf.write("\2\u009f\u00a9\3\2\2\2\u00a0\u00a9\5\64\33\2\u00a1\u00a5") - buf.write("\7%\2\2\u00a2\u00a5\5*\26\2\u00a3\u00a5\5,\27\2\u00a4") - buf.write("\u00a1\3\2\2\2\u00a4\u00a2\3\2\2\2\u00a4\u00a3\3\2\2\2") - buf.write("\u00a5\u00a6\3\2\2\2\u00a6\u00a7\7\23\2\2\u00a7\u00a9") - buf.write("\5(\25\3\u00a8\u0098\3\2\2\2\u00a8\u009c\3\2\2\2\u00a8") - buf.write("\u00a0\3\2\2\2\u00a8\u00a4\3\2\2\2\u00a9\u00b4\3\2\2\2") - buf.write("\u00aa\u00ab\f\7\2\2\u00ab\u00ac\5\"\22\2\u00ac\u00ad") - buf.write("\5(\25\b\u00ad\u00b3\3\2\2\2\u00ae\u00af\f\6\2\2\u00af") - buf.write("\u00b0\5$\23\2\u00b0\u00b1\5(\25\7\u00b1\u00b3\3\2\2\2") - buf.write("\u00b2\u00aa\3\2\2\2\u00b2\u00ae\3\2\2\2\u00b3\u00b6\3") - buf.write("\2\2\2\u00b4\u00b2\3\2\2\2\u00b4\u00b5\3\2\2\2\u00b5)") - buf.write("\3\2\2\2\u00b6\u00b4\3\2\2\2\u00b7\u00bc\7%\2\2\u00b8") - buf.write("\u00b9\7\4\2\2\u00b9\u00ba\5(\25\2\u00ba\u00bb\7\5\2\2") - buf.write("\u00bb\u00bd\3\2\2\2\u00bc\u00b8\3\2\2\2\u00bd\u00be\3") - buf.write("\2\2\2\u00be\u00bc\3\2\2\2\u00be\u00bf\3\2\2\2\u00bf+") - buf.write("\3\2\2\2\u00c0\u00c3\5\64\33\2\u00c1\u00c2\7\25\2\2\u00c2") - buf.write("\u00c4\5\64\33\2\u00c3\u00c1\3\2\2\2\u00c4\u00c5\3\2\2") - buf.write("\2\u00c5\u00c3\3\2\2\2\u00c5\u00c6\3\2\2\2\u00c6-\3\2") - buf.write("\2\2\u00c7\u00c8\b\30\1\2\u00c8\u00c9\7#\2\2\u00c9\u00d4") - buf.write("\5.\30\7\u00ca\u00cb\5(\25\2\u00cb\u00cc\5\60\31\2\u00cc") - buf.write("\u00cd\5(\25\2\u00cd\u00d4\3\2\2\2\u00ce\u00d4\7\32\2") - buf.write("\2\u00cf\u00d0\7\t\2\2\u00d0\u00d1\5.\30\2\u00d1\u00d2") - buf.write("\7\13\2\2\u00d2\u00d4\3\2\2\2\u00d3\u00c7\3\2\2\2\u00d3") - buf.write("\u00ca\3\2\2\2\u00d3\u00ce\3\2\2\2\u00d3\u00cf\3\2\2\2") - buf.write("\u00d4\u00db\3\2\2\2\u00d5\u00d6\f\5\2\2\u00d6\u00d7\5") - buf.write("\62\32\2\u00d7\u00d8\5.\30\6\u00d8\u00da\3\2\2\2\u00d9") - buf.write("\u00d5\3\2\2\2\u00da\u00dd\3\2\2\2\u00db\u00d9\3\2\2\2") - buf.write("\u00db\u00dc\3\2\2\2\u00dc/\3\2\2\2\u00dd\u00db\3\2\2") - buf.write("\2\u00de\u00df\t\6\2\2\u00df\61\3\2\2\2\u00e0\u00e1\t") - buf.write("\7\2\2\u00e1\63\3\2\2\2\u00e2\u00e7\7$\2\2\u00e3\u00e7") - buf.write("\7%\2\2\u00e4\u00e7\5\34\17\2\u00e5\u00e7\5*\26\2\u00e6") - buf.write("\u00e2\3\2\2\2\u00e6\u00e3\3\2\2\2\u00e6\u00e4\3\2\2\2") - buf.write("\u00e6\u00e5\3\2\2\2\u00e7\65\3\2\2\2\22\3\2\2\2\4D\3\2\2\2\6H\3\2\2\2\b") + buf.write("V\3\2\2\2\nZ\3\2\2\2\f\\\3\2\2\2\16b\3\2\2\2\20l\3\2\2") + buf.write("\2\22r\3\2\2\2\24y\3\2\2\2\26|\3\2\2\2\30~\3\2\2\2\32") + buf.write("\u0080\3\2\2\2\34\u0082\3\2\2\2\36\u0091\3\2\2\2 \u0096") + buf.write("\3\2\2\2\"\u009b\3\2\2\2$\u009d\3\2\2\2&\u009f\3\2\2\2") + buf.write("(\u00b0\3\2\2\2*\u00bf\3\2\2\2,\u00c8\3\2\2\2.\u00cb\3") + buf.write("\2\2\2\60\u00d0\3\2\2\2\62\u00d8\3\2\2\2\64\u00e3\3\2") + buf.write("\2\2\66\u00f1\3\2\2\28\u00fc\3\2\2\2:\u00fe\3\2\2\2<\u0104") + buf.write("\3\2\2\2>?\5\4\3\2?@\7\2\2\3@\3\3\2\2\2AC\5\b\5\2BA\3") + buf.write("\2\2\2CF\3\2\2\2DB\3\2\2\2DE\3\2\2\2E\5\3\2\2\2FD\3\2") + buf.write("\2\2GI\5\b\5\2HG\3\2\2\2IJ\3\2\2\2JH\3\2\2\2JK\3\2\2\2") + buf.write("K\7\3\2\2\2LW\5\36\20\2MW\5 \21\2NW\5\n\6\2OW\5\20\t\2") + buf.write("PW\5\24\13\2QW\5\30\r\2RW\5\22\n\2SW\5\32\16\2TW\5*\26") + buf.write("\2UW\5\60\31\2VL\3\2\2\2VM\3\2\2\2VN\3\2\2\2VO\3\2\2\2") + buf.write("VP\3\2\2\2VQ\3\2\2\2VR\3\2\2\2VS\3\2\2\2VT\3\2\2\2VU\3") + buf.write("\2\2\2W\t\3\2\2\2X[\5\f\7\2Y[\5\16\b\2ZX\3\2\2\2ZY\3\2") + buf.write("\2\2[\13\3\2\2\2\\]\7\3\2\2]^\5\66\34\2^_\7\4\2\2_`\5") + buf.write("\6\4\2`a\7\5\2\2a\r\3\2\2\2bc\7\3\2\2cd\5\66\34\2de\7") + buf.write("\4\2\2ef\5\6\4\2fg\7\5\2\2gh\7\6\2\2hi\7\4\2\2ij\5\6\4") + buf.write("\2jk\7\5\2\2k\17\3\2\2\2lm\7\7\2\2mn\5<\37\2no\7\4\2\2") + buf.write("op\5\6\4\2pq\7\5\2\2q\21\3\2\2\2rs\7\b\2\2st\7\t\2\2t") + buf.write("u\5(\25\2uv\7\n\2\2vw\5(\25\2wx\7\13\2\2x\23\3\2\2\2y") + buf.write("z\5\26\f\2z{\5(\25\2{\25\3\2\2\2|}\t\2\2\2}\27\3\2\2\2") + buf.write("~\177\t\3\2\2\177\31\3\2\2\2\u0080\u0081\7\22\2\2\u0081") + buf.write("\33\3\2\2\2\u0082\u008b\7\4\2\2\u0083\u0088\5(\25\2\u0084") + buf.write("\u0085\7\n\2\2\u0085\u0087\5(\25\2\u0086\u0084\3\2\2\2") + buf.write("\u0087\u008a\3\2\2\2\u0088\u0086\3\2\2\2\u0088\u0089\3") + buf.write("\2\2\2\u0089\u008c\3\2\2\2\u008a\u0088\3\2\2\2\u008b\u0083") + buf.write("\3\2\2\2\u008b\u008c\3\2\2\2\u008c\u008d\3\2\2\2\u008d") + buf.write("\u008e\7\5\2\2\u008e\35\3\2\2\2\u008f\u0092\7*\2\2\u0090") + buf.write("\u0092\5\62\32\2\u0091\u008f\3\2\2\2\u0091\u0090\3\2\2") + buf.write("\2\u0092\u0093\3\2\2\2\u0093\u0094\7\23\2\2\u0094\u0095") + buf.write("\5(\25\2\u0095\37\3\2\2\2\u0096\u0097\7\24\2\2\u0097\u0098") + buf.write("\7\t\2\2\u0098\u0099\5(\25\2\u0099\u009a\7\13\2\2\u009a") + buf.write("!\3\2\2\2\u009b\u009c\t\4\2\2\u009c#\3\2\2\2\u009d\u009e") + buf.write("\t\5\2\2\u009e%\3\2\2\2\u009f\u00a0\7\34\2\2\u00a0\'\3") + buf.write("\2\2\2\u00a1\u00a2\b\25\1\2\u00a2\u00a3\5&\24\2\u00a3") + buf.write("\u00a4\5(\25\b\u00a4\u00b1\3\2\2\2\u00a5\u00a6\7\t\2\2") + buf.write("\u00a6\u00a7\5(\25\2\u00a7\u00a8\7\13\2\2\u00a8\u00b1") + buf.write("\3\2\2\2\u00a9\u00b1\5<\37\2\u00aa\u00ad\7*\2\2\u00ab") + buf.write("\u00ad\5\62\32\2\u00ac\u00aa\3\2\2\2\u00ac\u00ab\3\2\2") + buf.write("\2\u00ad\u00ae\3\2\2\2\u00ae\u00af\7\23\2\2\u00af\u00b1") + buf.write("\5(\25\3\u00b0\u00a1\3\2\2\2\u00b0\u00a5\3\2\2\2\u00b0") + buf.write("\u00a9\3\2\2\2\u00b0\u00ac\3\2\2\2\u00b1\u00bc\3\2\2\2") + buf.write("\u00b2\u00b3\f\7\2\2\u00b3\u00b4\5\"\22\2\u00b4\u00b5") + buf.write("\5(\25\b\u00b5\u00bb\3\2\2\2\u00b6\u00b7\f\6\2\2\u00b7") + buf.write("\u00b8\5$\23\2\u00b8\u00b9\5(\25\7\u00b9\u00bb\3\2\2\2") + buf.write("\u00ba\u00b2\3\2\2\2\u00ba\u00b6\3\2\2\2\u00bb\u00be\3") + buf.write("\2\2\2\u00bc\u00ba\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd)") + buf.write("\3\2\2\2\u00be\u00bc\3\2\2\2\u00bf\u00c0\7\25\2\2\u00c0") + buf.write("\u00c1\7*\2\2\u00c1\u00c2\7\26\2\2\u00c2\u00c3\5,\27\2") + buf.write("\u00c3\u00c4\7\27\2\2\u00c4+\3\2\2\2\u00c5\u00c7\5.\30") + buf.write("\2\u00c6\u00c5\3\2\2\2\u00c7\u00ca\3\2\2\2\u00c8\u00c6") + buf.write("\3\2\2\2\u00c8\u00c9\3\2\2\2\u00c9-\3\2\2\2\u00ca\u00c8") + buf.write("\3\2\2\2\u00cb\u00cc\5\36\20\2\u00cc\u00cd\7\30\2\2\u00cd") + buf.write("/\3\2\2\2\u00ce\u00d1\7*\2\2\u00cf\u00d1\5\62\32\2\u00d0") + buf.write("\u00ce\3\2\2\2\u00d0\u00cf\3\2\2\2\u00d1\u00d2\3\2\2\2") + buf.write("\u00d2\u00d3\7\23\2\2\u00d3\u00d4\7\31\2\2\u00d4\u00d5") + buf.write("\7*\2\2\u00d5\u00d6\7\t\2\2\u00d6\u00d7\7\13\2\2\u00d7") + buf.write("\61\3\2\2\2\u00d8\u00df\5\64\33\2\u00d9\u00da\7\32\2\2") + buf.write("\u00da\u00e0\7*\2\2\u00db\u00dc\7\4\2\2\u00dc\u00dd\5") + buf.write("(\25\2\u00dd\u00de\7\5\2\2\u00de\u00e0\3\2\2\2\u00df\u00d9") + buf.write("\3\2\2\2\u00df\u00db\3\2\2\2\u00e0\u00e1\3\2\2\2\u00e1") + buf.write("\u00df\3\2\2\2\u00e1\u00e2\3\2\2\2\u00e2\63\3\2\2\2\u00e3") + buf.write("\u00e4\7*\2\2\u00e4\65\3\2\2\2\u00e5\u00e6\b\34\1\2\u00e6") + buf.write("\u00e7\7(\2\2\u00e7\u00f2\5\66\34\7\u00e8\u00e9\5(\25") + buf.write("\2\u00e9\u00ea\58\35\2\u00ea\u00eb\5(\25\2\u00eb\u00f2") + buf.write("\3\2\2\2\u00ec\u00f2\7\37\2\2\u00ed\u00ee\7\t\2\2\u00ee") + buf.write("\u00ef\5\66\34\2\u00ef\u00f0\7\13\2\2\u00f0\u00f2\3\2") + buf.write("\2\2\u00f1\u00e5\3\2\2\2\u00f1\u00e8\3\2\2\2\u00f1\u00ec") + buf.write("\3\2\2\2\u00f1\u00ed\3\2\2\2\u00f2\u00f9\3\2\2\2\u00f3") + buf.write("\u00f4\f\5\2\2\u00f4\u00f5\5:\36\2\u00f5\u00f6\5\66\34") + buf.write("\6\u00f6\u00f8\3\2\2\2\u00f7\u00f3\3\2\2\2\u00f8\u00fb") + buf.write("\3\2\2\2\u00f9\u00f7\3\2\2\2\u00f9\u00fa\3\2\2\2\u00fa") + buf.write("\67\3\2\2\2\u00fb\u00f9\3\2\2\2\u00fc\u00fd\t\6\2\2\u00fd") + buf.write("9\3\2\2\2\u00fe\u00ff\t\7\2\2\u00ff;\3\2\2\2\u0100\u0105") + buf.write("\7)\2\2\u0101\u0105\7*\2\2\u0102\u0105\5\34\17\2\u0103") + buf.write("\u0105\5\62\32\2\u0104\u0100\3\2\2\2\u0104\u0101\3\2\2") + buf.write("\2\u0104\u0102\3\2\2\2\u0104\u0103\3\2\2\2\u0105=\3\2") + buf.write("\2\2\24DJVZ\u0088\u008b\u0091\u00ac\u00b0\u00ba\u00bc") + buf.write("\u00c8\u00d0\u00df\u00e1\u00f1\u00f9\u0104") return buf.getvalue() @@ -119,18 +133,20 @@ class tlangParser ( Parser ): literalNames = [ "", "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", "'penup'", "'pendown'", "'pause'", - "'='", "'print'", "'.'", "'+'", "'-'", "'*'", "'/'", - "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", - "'>='", "'&&'", "'||'", "'!'" ] + "'='", "'print'", "'class'", "'{'", "'}'", "';'", "'new'", + "'.'", "'+'", "'-'", "'*'", "'/'", "'pendown?'", "'<'", + "'>'", "'=='", "'!='", "'<='", "'>='", "'&&'", "'||'", + "'!'" ] symbolicNames = [ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", - "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", - "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", - "VAR", "NAME", "Whitespace" ] + "", "", "", "", + "", "PLUS", "MINUS", "MUL", "DIV", "PENCOND", + "LT", "GT", "EQ", "NEQ", "LTE", "GTE", "AND", "OR", + "NOT", "NUM", "VAR", "NAME", "Whitespace" ] RULE_start = 0 RULE_instruction_list = 1 @@ -152,20 +168,25 @@ class tlangParser ( Parser ): RULE_additive = 17 RULE_unaryArithOp = 18 RULE_expression = 19 - RULE_arrayAccess = 20 - RULE_memberAccess = 21 - RULE_condition = 22 - RULE_binCondOp = 23 - RULE_logicOp = 24 - RULE_value = 25 + RULE_classDeclaration = 20 + RULE_classBody = 21 + RULE_classAttributeDeclaration = 22 + RULE_objectInstantiation = 23 + RULE_objectOrArrayAccess = 24 + RULE_baseAccess = 25 + RULE_condition = 26 + RULE_binCondOp = 27 + RULE_logicOp = 28 + RULE_value = 29 ruleNames = [ "start", "instruction_list", "strict_ilist", "instruction", "conditional", "ifConditional", "ifElseConditional", "loop", "gotoCommand", "moveCommand", "moveOp", "penCommand", "pauseCommand", "array", "assignment", "printStatement", "multiplicative", "additive", "unaryArithOp", "expression", - "arrayAccess", "memberAccess", "condition", "binCondOp", - "logicOp", "value" ] + "classDeclaration", "classBody", "classAttributeDeclaration", + "objectInstantiation", "objectOrArrayAccess", "baseAccess", + "condition", "binCondOp", "logicOp", "value" ] EOF = Token.EOF T__0=1 @@ -187,24 +208,29 @@ class tlangParser ( Parser ): T__16=17 T__17=18 T__18=19 - PLUS=20 - MINUS=21 - MUL=22 - DIV=23 - PENCOND=24 - LT=25 - GT=26 - EQ=27 - NEQ=28 - LTE=29 - GTE=30 - AND=31 - OR=32 - NOT=33 - NUM=34 - VAR=35 - NAME=36 - Whitespace=37 + T__19=20 + T__20=21 + T__21=22 + T__22=23 + T__23=24 + PLUS=25 + MINUS=26 + MUL=27 + DIV=28 + PENCOND=29 + LT=30 + GT=31 + EQ=32 + NEQ=33 + LTE=34 + GTE=35 + AND=36 + OR=37 + NOT=38 + NUM=39 + VAR=40 + NAME=41 + Whitespace=42 def __init__(self, input:TokenStream, output:TextIO = sys.stdout): super().__init__(input, output) @@ -246,9 +272,9 @@ def start(self): self.enterRule(localctx, 0, self.RULE_start) try: self.enterOuterAlt(localctx, 1) - self.state = 52 + self.state = 60 self.instruction_list() - self.state = 53 + self.state = 61 self.match(tlangParser.EOF) except RecognitionException as re: localctx.exception = re @@ -291,13 +317,13 @@ def instruction_list(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 58 + self.state = 66 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.NUM) | (1 << tlangParser.VAR))) != 0): - self.state = 55 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.VAR))) != 0): + self.state = 63 self.instruction() - self.state = 60 + self.state = 68 self._errHandler.sync(self) _la = self._input.LA(1) @@ -342,16 +368,16 @@ def strict_ilist(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 62 + self.state = 70 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 61 + self.state = 69 self.instruction() - self.state = 64 + self.state = 72 self._errHandler.sync(self) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.NUM) | (1 << tlangParser.VAR))) != 0)): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.VAR))) != 0)): break except RecognitionException as re: @@ -401,6 +427,14 @@ def pauseCommand(self): return self.getTypedRuleContext(tlangParser.PauseCommandContext,0) + def classDeclaration(self): + return self.getTypedRuleContext(tlangParser.ClassDeclarationContext,0) + + + def objectInstantiation(self): + return self.getTypedRuleContext(tlangParser.ObjectInstantiationContext,0) + + def getRuleIndex(self): return tlangParser.RULE_instruction @@ -418,51 +452,69 @@ def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) self.enterRule(localctx, 6, self.RULE_instruction) try: - self.state = 74 + self.state = 84 self._errHandler.sync(self) - token = self._input.LA(1) - if token in [tlangParser.T__1, tlangParser.NUM, tlangParser.VAR]: + la_ = self._interp.adaptivePredict(self._input,2,self._ctx) + if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 66 + self.state = 74 self.assignment() pass - elif token in [tlangParser.T__17]: + + elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 67 + self.state = 75 self.printStatement() pass - elif token in [tlangParser.T__0]: + + elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 68 + self.state = 76 self.conditional() pass - elif token in [tlangParser.T__4]: + + elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 69 + self.state = 77 self.loop() pass - elif token in [tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12]: + + elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 70 + self.state = 78 self.moveCommand() pass - elif token in [tlangParser.T__13, tlangParser.T__14]: + + elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 71 + self.state = 79 self.penCommand() pass - elif token in [tlangParser.T__5]: + + elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 72 + self.state = 80 self.gotoCommand() pass - elif token in [tlangParser.T__15]: + + elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 73 + self.state = 81 self.pauseCommand() pass - else: - raise NoViableAltException(self) + + elif la_ == 9: + self.enterOuterAlt(localctx, 9) + self.state = 82 + self.classDeclaration() + pass + + elif la_ == 10: + self.enterOuterAlt(localctx, 10) + self.state = 83 + self.objectInstantiation() + pass + except RecognitionException as re: localctx.exception = re @@ -504,18 +556,18 @@ def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) self.enterRule(localctx, 8, self.RULE_conditional) try: - self.state = 78 + self.state = 88 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,3,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 76 + self.state = 86 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 77 + self.state = 87 self.ifElseConditional() pass @@ -561,15 +613,15 @@ def ifConditional(self): self.enterRule(localctx, 10, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 80 + self.state = 90 self.match(tlangParser.T__0) - self.state = 81 + self.state = 91 self.condition(0) - self.state = 82 + self.state = 92 self.match(tlangParser.T__1) - self.state = 83 + self.state = 93 self.strict_ilist() - self.state = 84 + self.state = 94 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -615,23 +667,23 @@ def ifElseConditional(self): self.enterRule(localctx, 12, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 86 + self.state = 96 self.match(tlangParser.T__0) - self.state = 87 + self.state = 97 self.condition(0) - self.state = 88 + self.state = 98 self.match(tlangParser.T__1) - self.state = 89 + self.state = 99 self.strict_ilist() - self.state = 90 + self.state = 100 self.match(tlangParser.T__2) - self.state = 91 + self.state = 101 self.match(tlangParser.T__3) - self.state = 92 + self.state = 102 self.match(tlangParser.T__1) - self.state = 93 + self.state = 103 self.strict_ilist() - self.state = 94 + self.state = 104 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -674,15 +726,15 @@ def loop(self): self.enterRule(localctx, 14, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 96 + self.state = 106 self.match(tlangParser.T__4) - self.state = 97 + self.state = 107 self.value() - self.state = 98 + self.state = 108 self.match(tlangParser.T__1) - self.state = 99 + self.state = 109 self.strict_ilist() - self.state = 100 + self.state = 110 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -724,17 +776,17 @@ def gotoCommand(self): self.enterRule(localctx, 16, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 102 + self.state = 112 self.match(tlangParser.T__5) - self.state = 103 + self.state = 113 self.match(tlangParser.T__6) - self.state = 104 + self.state = 114 self.expression(0) - self.state = 105 + self.state = 115 self.match(tlangParser.T__7) - self.state = 106 + self.state = 116 self.expression(0) - self.state = 107 + self.state = 117 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -777,9 +829,9 @@ def moveCommand(self): self.enterRule(localctx, 18, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 109 + self.state = 119 self.moveOp() - self.state = 110 + self.state = 120 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -816,7 +868,7 @@ def moveOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 112 + self.state = 122 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -858,7 +910,7 @@ def penCommand(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 114 + self.state = 124 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -899,7 +951,7 @@ def pauseCommand(self): self.enterRule(localctx, 24, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 116 + self.state = 126 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -942,29 +994,29 @@ def array(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 118 + self.state = 128 self.match(tlangParser.T__1) - self.state = 127 + self.state = 137 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.VAR))) != 0): - self.state = 119 + self.state = 129 self.expression(0) - self.state = 124 + self.state = 134 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 120 + self.state = 130 self.match(tlangParser.T__7) - self.state = 121 + self.state = 131 self.expression(0) - self.state = 126 + self.state = 136 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 129 + self.state = 139 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -988,12 +1040,8 @@ def expression(self): def VAR(self): return self.getToken(tlangParser.VAR, 0) - def arrayAccess(self): - return self.getTypedRuleContext(tlangParser.ArrayAccessContext,0) - - - def memberAccess(self): - return self.getTypedRuleContext(tlangParser.MemberAccessContext,0) + def objectOrArrayAccess(self): + return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,0) def getRuleIndex(self): @@ -1014,28 +1062,23 @@ def assignment(self): self.enterRule(localctx, 28, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 134 + self.state = 143 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,6,self._ctx) if la_ == 1: - self.state = 131 + self.state = 141 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 132 - self.arrayAccess() - pass - - elif la_ == 3: - self.state = 133 - self.memberAccess() + self.state = 142 + self.objectOrArrayAccess() pass - self.state = 136 + self.state = 145 self.match(tlangParser.T__16) - self.state = 137 + self.state = 146 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1074,13 +1117,13 @@ def printStatement(self): self.enterRule(localctx, 30, self.RULE_printStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 139 + self.state = 148 self.match(tlangParser.T__17) - self.state = 140 + self.state = 149 self.match(tlangParser.T__6) - self.state = 141 + self.state = 150 self.expression(0) - self.state = 142 + self.state = 151 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1122,7 +1165,7 @@ def multiplicative(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 144 + self.state = 153 _la = self._input.LA(1) if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) @@ -1169,7 +1212,7 @@ def additive(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 146 + self.state = 155 _la = self._input.LA(1) if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) @@ -1212,7 +1255,7 @@ def unaryArithOp(self): self.enterRule(localctx, 36, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 148 + self.state = 157 self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re @@ -1332,11 +1375,8 @@ def expression(self): def VAR(self): return self.getToken(tlangParser.VAR, 0) - def arrayAccess(self): - return self.getTypedRuleContext(tlangParser.ArrayAccessContext,0) - - def memberAccess(self): - return self.getTypedRuleContext(tlangParser.MemberAccessContext,0) + def objectOrArrayAccess(self): + return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,0) def accept(self, visitor:ParseTreeVisitor): @@ -1373,7 +1413,7 @@ def expression(self, _p:int=0): self.enterRecursionRule(localctx, 38, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 166 + self.state = 174 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,8,self._ctx) if la_ == 1: @@ -1381,9 +1421,9 @@ def expression(self, _p:int=0): self._ctx = localctx _prevctx = localctx - self.state = 151 + self.state = 160 self.unaryArithOp() - self.state = 152 + self.state = 161 self.expression(6) pass @@ -1391,11 +1431,11 @@ def expression(self, _p:int=0): localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 154 + self.state = 163 self.match(tlangParser.T__6) - self.state = 155 + self.state = 164 self.expression(0) - self.state = 156 + self.state = 165 self.match(tlangParser.T__8) pass @@ -1403,7 +1443,7 @@ def expression(self, _p:int=0): localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 158 + self.state = 167 self.value() pass @@ -1411,34 +1451,29 @@ def expression(self, _p:int=0): localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 162 + self.state = 170 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,7,self._ctx) if la_ == 1: - self.state = 159 + self.state = 168 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 160 - self.arrayAccess() - pass - - elif la_ == 3: - self.state = 161 - self.memberAccess() + self.state = 169 + self.objectOrArrayAccess() pass - self.state = 164 + self.state = 172 self.match(tlangParser.T__16) - self.state = 165 + self.state = 173 self.expression(1) pass self._ctx.stop = self._input.LT(-1) - self.state = 178 + self.state = 186 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,10,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -1446,37 +1481,37 @@ def expression(self, _p:int=0): if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 176 + self.state = 184 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,9,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 168 + self.state = 176 if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 169 + self.state = 177 self.multiplicative() - self.state = 170 + self.state = 178 self.expression(6) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 172 + self.state = 180 if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") - self.state = 173 + self.state = 181 self.additive() - self.state = 174 + self.state = 182 self.expression(5) pass - self.state = 180 + self.state = 188 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,10,self._ctx) @@ -1489,7 +1524,7 @@ def expression(self, _p:int=0): return localctx - class ArrayAccessContext(ParserRuleContext): + class ClassDeclarationContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) @@ -1498,6 +1533,222 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): def VAR(self): return self.getToken(tlangParser.VAR, 0) + def classBody(self): + return self.getTypedRuleContext(tlangParser.ClassBodyContext,0) + + + def getRuleIndex(self): + return tlangParser.RULE_classDeclaration + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitClassDeclaration" ): + return visitor.visitClassDeclaration(self) + else: + return visitor.visitChildren(self) + + + + + def classDeclaration(self): + + localctx = tlangParser.ClassDeclarationContext(self, self._ctx, self.state) + self.enterRule(localctx, 40, self.RULE_classDeclaration) + try: + self.enterOuterAlt(localctx, 1) + self.state = 189 + self.match(tlangParser.T__18) + self.state = 190 + self.match(tlangParser.VAR) + self.state = 191 + self.match(tlangParser.T__19) + self.state = 192 + self.classBody() + self.state = 193 + self.match(tlangParser.T__20) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ClassBodyContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def classAttributeDeclaration(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.ClassAttributeDeclarationContext) + else: + return self.getTypedRuleContext(tlangParser.ClassAttributeDeclarationContext,i) + + + def getRuleIndex(self): + return tlangParser.RULE_classBody + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitClassBody" ): + return visitor.visitClassBody(self) + else: + return visitor.visitChildren(self) + + + + + def classBody(self): + + localctx = tlangParser.ClassBodyContext(self, self._ctx, self.state) + self.enterRule(localctx, 42, self.RULE_classBody) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 198 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==tlangParser.VAR: + self.state = 195 + self.classAttributeDeclaration() + self.state = 200 + self._errHandler.sync(self) + _la = self._input.LA(1) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ClassAttributeDeclarationContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def assignment(self): + return self.getTypedRuleContext(tlangParser.AssignmentContext,0) + + + def getRuleIndex(self): + return tlangParser.RULE_classAttributeDeclaration + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitClassAttributeDeclaration" ): + return visitor.visitClassAttributeDeclaration(self) + else: + return visitor.visitChildren(self) + + + + + def classAttributeDeclaration(self): + + localctx = tlangParser.ClassAttributeDeclarationContext(self, self._ctx, self.state) + self.enterRule(localctx, 44, self.RULE_classAttributeDeclaration) + try: + self.enterOuterAlt(localctx, 1) + self.state = 201 + self.assignment() + self.state = 202 + self.match(tlangParser.T__21) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ObjectInstantiationContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def VAR(self, i:int=None): + if i is None: + return self.getTokens(tlangParser.VAR) + else: + return self.getToken(tlangParser.VAR, i) + + def objectOrArrayAccess(self): + return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,0) + + + def getRuleIndex(self): + return tlangParser.RULE_objectInstantiation + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitObjectInstantiation" ): + return visitor.visitObjectInstantiation(self) + else: + return visitor.visitChildren(self) + + + + + def objectInstantiation(self): + + localctx = tlangParser.ObjectInstantiationContext(self, self._ctx, self.state) + self.enterRule(localctx, 46, self.RULE_objectInstantiation) + try: + self.enterOuterAlt(localctx, 1) + self.state = 206 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input,12,self._ctx) + if la_ == 1: + self.state = 204 + self.match(tlangParser.VAR) + pass + + elif la_ == 2: + self.state = 205 + self.objectOrArrayAccess() + pass + + + self.state = 208 + self.match(tlangParser.T__16) + self.state = 209 + self.match(tlangParser.T__22) + self.state = 210 + self.match(tlangParser.VAR) + self.state = 211 + self.match(tlangParser.T__6) + self.state = 212 + self.match(tlangParser.T__8) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ObjectOrArrayAccessContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def baseAccess(self): + return self.getTypedRuleContext(tlangParser.BaseAccessContext,0) + + + def VAR(self, i:int=None): + if i is None: + return self.getTokens(tlangParser.VAR) + else: + return self.getToken(tlangParser.VAR, i) + def expression(self, i:int=None): if i is None: return self.getTypedRuleContexts(tlangParser.ExpressionContext) @@ -1506,42 +1757,56 @@ def expression(self, i:int=None): def getRuleIndex(self): - return tlangParser.RULE_arrayAccess + return tlangParser.RULE_objectOrArrayAccess def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitArrayAccess" ): - return visitor.visitArrayAccess(self) + if hasattr( visitor, "visitObjectOrArrayAccess" ): + return visitor.visitObjectOrArrayAccess(self) else: return visitor.visitChildren(self) - def arrayAccess(self): + def objectOrArrayAccess(self): - localctx = tlangParser.ArrayAccessContext(self, self._ctx, self.state) - self.enterRule(localctx, 40, self.RULE_arrayAccess) + localctx = tlangParser.ObjectOrArrayAccessContext(self, self._ctx, self.state) + self.enterRule(localctx, 48, self.RULE_objectOrArrayAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 181 - self.match(tlangParser.VAR) - self.state = 186 + self.state = 214 + self.baseAccess() + self.state = 221 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 182 - self.match(tlangParser.T__1) - self.state = 183 - self.expression(0) - self.state = 184 - self.match(tlangParser.T__2) + self.state = 221 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [tlangParser.T__23]: + self.state = 215 + self.match(tlangParser.T__23) + self.state = 216 + self.match(tlangParser.VAR) + pass + elif token in [tlangParser.T__1]: + self.state = 217 + self.match(tlangParser.T__1) + self.state = 218 + self.expression(0) + self.state = 219 + self.match(tlangParser.T__2) + pass + else: + raise NoViableAltException(self) + else: raise NoViableAltException(self) - self.state = 188 + self.state = 223 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,11,self._ctx) + _alt = self._interp.adaptivePredict(self._input,14,self._ctx) except RecognitionException as re: localctx.exception = re @@ -1552,54 +1817,35 @@ def arrayAccess(self): return localctx - class MemberAccessContext(ParserRuleContext): + class BaseAccessContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def value(self, i:int=None): - if i is None: - return self.getTypedRuleContexts(tlangParser.ValueContext) - else: - return self.getTypedRuleContext(tlangParser.ValueContext,i) - + def VAR(self): + return self.getToken(tlangParser.VAR, 0) def getRuleIndex(self): - return tlangParser.RULE_memberAccess + return tlangParser.RULE_baseAccess def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitMemberAccess" ): - return visitor.visitMemberAccess(self) + if hasattr( visitor, "visitBaseAccess" ): + return visitor.visitBaseAccess(self) else: return visitor.visitChildren(self) - def memberAccess(self): + def baseAccess(self): - localctx = tlangParser.MemberAccessContext(self, self._ctx, self.state) - self.enterRule(localctx, 42, self.RULE_memberAccess) - self._la = 0 # Token type + localctx = tlangParser.BaseAccessContext(self, self._ctx, self.state) + self.enterRule(localctx, 50, self.RULE_baseAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 190 - self.value() - self.state = 193 - self._errHandler.sync(self) - _la = self._input.LA(1) - while True: - self.state = 191 - self.match(tlangParser.T__18) - self.state = 192 - self.value() - self.state = 195 - self._errHandler.sync(self) - _la = self._input.LA(1) - if not (_la==tlangParser.T__18): - break - + self.state = 225 + self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -1659,48 +1905,48 @@ def condition(self, _p:int=0): _parentState = self.state localctx = tlangParser.ConditionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 44 - self.enterRecursionRule(localctx, 44, self.RULE_condition, _p) + _startState = 52 + self.enterRecursionRule(localctx, 52, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 209 + self.state = 239 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,13,self._ctx) + la_ = self._interp.adaptivePredict(self._input,15,self._ctx) if la_ == 1: - self.state = 198 + self.state = 228 self.match(tlangParser.NOT) - self.state = 199 + self.state = 229 self.condition(5) pass elif la_ == 2: - self.state = 200 + self.state = 230 self.expression(0) - self.state = 201 + self.state = 231 self.binCondOp() - self.state = 202 + self.state = 232 self.expression(0) pass elif la_ == 3: - self.state = 204 + self.state = 234 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 205 + self.state = 235 self.match(tlangParser.T__6) - self.state = 206 + self.state = 236 self.condition(0) - self.state = 207 + self.state = 237 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 217 + self.state = 247 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,14,self._ctx) + _alt = self._interp.adaptivePredict(self._input,16,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -1708,17 +1954,17 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 211 + self.state = 241 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 212 + self.state = 242 self.logicOp() - self.state = 213 + self.state = 243 self.condition(4) - self.state = 219 + self.state = 249 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,14,self._ctx) + _alt = self._interp.adaptivePredict(self._input,16,self._ctx) except RecognitionException as re: localctx.exception = re @@ -1768,11 +2014,11 @@ def accept(self, visitor:ParseTreeVisitor): def binCondOp(self): localctx = tlangParser.BinCondOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 46, self.RULE_binCondOp) + self.enterRule(localctx, 54, self.RULE_binCondOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 220 + self.state = 250 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -1815,11 +2061,11 @@ def accept(self, visitor:ParseTreeVisitor): def logicOp(self): localctx = tlangParser.LogicOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 48, self.RULE_logicOp) + self.enterRule(localctx, 56, self.RULE_logicOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 222 + self.state = 252 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -1851,8 +2097,8 @@ def array(self): return self.getTypedRuleContext(tlangParser.ArrayContext,0) - def arrayAccess(self): - return self.getTypedRuleContext(tlangParser.ArrayAccessContext,0) + def objectOrArrayAccess(self): + return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,0) def getRuleIndex(self): @@ -1870,33 +2116,33 @@ def accept(self, visitor:ParseTreeVisitor): def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) - self.enterRule(localctx, 50, self.RULE_value) + self.enterRule(localctx, 58, self.RULE_value) try: - self.state = 228 + self.state = 258 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,15,self._ctx) + la_ = self._interp.adaptivePredict(self._input,17,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 224 + self.state = 254 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 225 + self.state = 255 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 226 + self.state = 256 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 227 - self.arrayAccess() + self.state = 257 + self.objectOrArrayAccess() pass @@ -1914,7 +2160,7 @@ def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): if self._predicates == None: self._predicates = dict() self._predicates[19] = self.expression_sempred - self._predicates[22] = self.condition_sempred + self._predicates[26] = self.condition_sempred pred = self._predicates.get(ruleIndex, None) if pred is None: raise Exception("No predicate with index:" + str(ruleIndex)) diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index bb34f15..a9ead74 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -134,13 +134,33 @@ def visitParenExpr(self, ctx:tlangParser.ParenExprContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#arrayAccess. - def visitArrayAccess(self, ctx:tlangParser.ArrayAccessContext): + # Visit a parse tree produced by tlangParser#classDeclaration. + def visitClassDeclaration(self, ctx:tlangParser.ClassDeclarationContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#memberAccess. - def visitMemberAccess(self, ctx:tlangParser.MemberAccessContext): + # Visit a parse tree produced by tlangParser#classBody. + def visitClassBody(self, ctx:tlangParser.ClassBodyContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by tlangParser#classAttributeDeclaration. + def visitClassAttributeDeclaration(self, ctx:tlangParser.ClassAttributeDeclarationContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by tlangParser#objectInstantiation. + def visitObjectInstantiation(self, ctx:tlangParser.ObjectInstantiationContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by tlangParser#objectOrArrayAccess. + def visitObjectOrArrayAccess(self, ctx:tlangParser.ObjectOrArrayAccessContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by tlangParser#baseAccess. + def visitBaseAccess(self, ctx:tlangParser.BaseAccessContext): return self.visitChildren(ctx) From 0020c219e13e9ebda87d906a72e0c173132f2ca9 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Wed, 19 Feb 2025 23:34:09 +0530 Subject: [PATCH 05/47] provision for functional programming --- ChironCore/ChironAST/ChironAST.py | 70 +- ChironCore/ChironAST/builder.py | 149 +++-- ChironCore/example/exampleFC.tl | 32 + ChironCore/interpreter.py | 50 +- ChironCore/turtparse/tlang.g4 | 11 +- ChironCore/turtparse/tlang.interp | 10 +- ChironCore/turtparse/tlang.tokens | 68 +- ChironCore/turtparse/tlangLexer.interp | 8 +- ChironCore/turtparse/tlangLexer.py | 255 ++++---- ChironCore/turtparse/tlangLexer.tokens | 68 +- ChironCore/turtparse/tlangParser.py | 861 ++++++++++++++++--------- ChironCore/turtparse/tlangVisitor.py | 20 + 12 files changed, 1035 insertions(+), 567 deletions(-) create mode 100644 ChironCore/example/exampleFC.tl diff --git a/ChironCore/ChironAST/ChironAST.py b/ChironCore/ChironAST/ChironAST.py index c63b951..3850e81 100644 --- a/ChironCore/ChironAST/ChironAST.py +++ b/ChironCore/ChironAST/ChironAST.py @@ -11,6 +11,7 @@ class AST(object): class Instruction(AST): pass + class PrintCommand(Instruction): def __init__(self, expr): self.expr = expr @@ -18,6 +19,7 @@ def __init__(self, expr): def __str__(self): return self.expr.__str__() + class AssignmentCommand(Instruction): def __init__(self, leftvar, rexpr): self.lvar = leftvar @@ -25,10 +27,10 @@ def __init__(self, leftvar, rexpr): def __str__(self): return self.lvar.__str__() + " = " + self.rexpr.__str__() - -class ClassDeclarationCommand(Instruction): +class ClassDeclarationCommand(Instruction): + def __init__(self, className, attributes): self.className = className # Class name as a string self.attributes = attributes # List of AssignmentCommand objects @@ -36,7 +38,6 @@ def __init__(self, className, attributes): def __str__(self): attr_str = "\n ".join(str(attr) for attr in self.attributes) return f"class {self.className} {{\n {attr_str if attr_str else ' // No attributes'}\n}}" - class ConditionCommand(Instruction): @@ -47,6 +48,8 @@ def __str__(self): return self.cond.__str__() # Not Implemented Yet. + + class AssertCommand(Instruction): def __init__(self, condition): self.cond = condition @@ -54,6 +57,7 @@ def __init__(self, condition): def __str__(self): return self.cond.__str__() + class MoveCommand(Instruction): def __init__(self, motion, expr): self.direction = motion @@ -70,6 +74,7 @@ def __init__(self, penstat): def __str__(self): return self.status + class GotoCommand(Instruction): def __init__(self, x, y): self.xcor = x @@ -78,6 +83,7 @@ def __init__(self, x, y): def __str__(self): return "goto " + str(self.xcor) + " " + str(self.ycor) + class NoOpCommand(Instruction): def __init__(self): pass @@ -85,6 +91,7 @@ def __init__(self): def __str__(self): return "NOP" + class PauseCommand(Instruction): def __init__(self): pass @@ -92,12 +99,51 @@ def __init__(self): def __str__(self): return "pause" + +class FunctionDeclarationCommand(Instruction): + def __init__(self, fname, params=None, body=None): + self.name = fname + self.params = params if params is not None else [] + self.body = body if body is not None else [] + + def __str__(self): + params_str = ", ".join(self.params) + body_str = "\n ".join(str(stmt) for stmt in self.body) + return f"def {self.name}({params_str}):\n {body_str}" + + +class FunctionCallCommand(Instruction): + def __init__(self, fname, arguments=None): + self.name = fname + self.args = arguments if arguments is not None else [] + + def __str__(self): + args_str = ", ".join(str(arg) for arg in self.args) + return f"{self.name}({args_str})" + + +class ReturnCommand(Instruction): + def __init__(self, numParams): + self.numParams = numParams + + def __str__(self): + return f"return {self.numParams}" + + +class ParametersPassingCommand(Instruction): + def __init__(self, parameters): + self.params = parameters + + def __str__(self): + return ", ".join(str(param) for param in self.params) + + class Expression(AST): pass - # --Arithmetic Expressions-------------------------------------------- + class ArithExpr(Expression): pass @@ -140,6 +186,7 @@ class Mult(BinArithOp): def __init__(self, lexpr, rexpr): super().__init__(lexpr, rexpr, "*") + class Div(BinArithOp): def __init__(self, lexpr, rexpr): super().__init__(lexpr, rexpr, "/") @@ -165,6 +212,7 @@ class AND(BinCondOp): def __init__(self, expr1, expr2): super().__init__(expr1, expr2, "and") + class OR(BinCondOp): def __init__(self, expr1, expr2): super().__init__(expr1, expr2, "or") @@ -251,29 +299,31 @@ def __init__(self, vname): def __str__(self): return self.varname - + + class Array(Value): def __init__(self, vname): self.arr = vname def __str__(self): return self.arr - + # class ArrayAccess(Value): # def __init__(self, var, index): # self.var = var # self.idx = index - + # def __str__(self): # indices_str = "".join(f"[{idx}]" for idx in self.idx) # Format multiple indices # return f"{self.var}{indices_str}" # # return self.var.__str__() + "[" + self.idx.__str__() + "]" + class ObjectOrArrayAccess(Value): def __init__(self, var, accesses): self.var = var self.accesses = accesses # List of attribute names or indices - + def __str__(self): result = self.var for access in self.accesses: @@ -283,8 +333,8 @@ def __str__(self): else: # Object attribute access result += f".{access}" return result - - + + class ObjectInstantiationCommand(Instruction): def __init__(self, target, class_name): self.target = target # Variable name or Object/Array Access diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index c6b8c15..3022020 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -2,58 +2,65 @@ # -*- coding: utf-8 -*- # ChironLang Abstract Syntax Tree Builder +from ChironAST import ChironAST +from antlr4.tree.Tree import TerminalNodeImpl # Import TerminalNodeImpl +from turtparse.tlangVisitor import tlangVisitor +from turtparse.tlangParser import tlangParser import os import sys sys.path.insert(0, os.path.join("..", "turtparse")) -from turtparse.tlangParser import tlangParser -from turtparse.tlangVisitor import tlangVisitor -from antlr4.tree.Tree import TerminalNodeImpl # Import TerminalNodeImpl - -from ChironAST import ChironAST - class astGenPass(tlangVisitor): - def __init__(self): - self.repeatInstrCount = 0 # keeps count for no of 'repeat' instructions - self.stmtList=[] + self.repeatInstrCount = 0 # keeps count for no of 'repeat' instructions + self.stmtList = [] + + def getLval(self, ctx): - def getLval(self,ctx): - if ctx.VAR(): - if isinstance(ctx.VAR(),list): + if isinstance(ctx.VAR(), list): return ChironAST.Var(ctx.VAR()[0].getText()) return ChironAST.Var(ctx.VAR().getText()) elif ctx.objectOrArrayAccess(): return self.visitObjectOrArrayAccess(ctx.objectOrArrayAccess()) - def visitStart(self, ctx:tlangParser.StartContext): + def visitStart(self, ctx: tlangParser.StartContext): stmtList = self.visit(ctx.instruction_list()) self.stmtList.extend(stmtList) return self.stmtList - def visitInstruction_list(self, ctx:tlangParser.Instruction_listContext): + def visitInstruction_list(self, ctx: tlangParser.Instruction_listContext): instrList = [] for instr in ctx.instruction(): self.stmtList.extend(self.visit(instr)) return [] - def visitStrict_ilist(self, ctx:tlangParser.Strict_ilistContext): - # TODO: code refactoring. visitInstruction_list and visitStrict_ilist have same body + def visitStrict_ilist(self, ctx: tlangParser.Strict_ilistContext): + # TODO: code refactoring. visitInstruction_list and visitStrict_ilist have same body instrList = [] for instr in ctx.instruction(): visvalue = self.visit(instr) instrList.extend(visvalue) return instrList + + def visitFunctionDeclaration(self, ctx: tlangParser.FunctionDeclarationContext): + functionName = ctx.NAME().getText() + functionParams = [ param.getText() for param in ctx.parameters().VAR() ] if ctx.parameters() is not None else None + functionBody = self.visit(ctx.strict_ilist()) + numParams = 0 if functionParams is None else len(functionParams) + return [(ChironAST.FunctionDeclarationCommand(functionName, functionParams, functionBody), len(functionBody) + 3)] + [(ChironAST.ParametersPassingCommand(functionParams), 1)] + functionBody + [(ChironAST.ReturnCommand(numParams), 1)] + def visitFunctionCall(self, ctx: tlangParser.FunctionCallContext): + functionName = ctx.NAME().getText() + functionArgs = [ self.visit(arg) for arg in ctx.arguments().expression() ] if ctx.arguments() is not None else None + return [(ChironAST.FunctionCallCommand(functionName, functionArgs), 1)] - -#computes list of recursive assign statements - def visitAssignment(self, ctx:tlangParser.AssignmentContext): + # computes list of recursive assign statements + def visitAssignment(self, ctx: tlangParser.AssignmentContext): # print(ctx.VAR().getText(),ctx.expression().getText()) lval = self.getLval(ctx) @@ -63,12 +70,12 @@ def visitAssignment(self, ctx:tlangParser.AssignmentContext): print(rval[-1][0]) rvaln = rval[-1][0].lvar # Get the last assigned variable as rval return rval + [(ChironAST.AssignmentCommand(lval, rvaln), 1)] - + # Otherwise, just return a normal assignment return [(ChironAST.AssignmentCommand(lval, rval), 1)] - + def visitObjectOrArrayAccess(self, ctx: tlangParser.ObjectOrArrayAccessContext): - # Start with the base variable (first part of access) + # Start with the base variable (first part of access) base = ctx.baseAccess().VAR().getText() # Traverse through the nested access ('.' for attributes, '[]' for indices) @@ -86,24 +93,24 @@ def visitObjectOrArrayAccess(self, ctx: tlangParser.ObjectOrArrayAccessContext): elif child.getText() == '[': # Array access: Process the expression inside `[]` i += 1 # Move to expression inside brackets - expr = self.visit(ctx.children[i]) # Visit and evaluate expression + # Visit and evaluate expression + expr = self.visit(ctx.children[i]) accesses.append([expr.val]) # Store index as a list i += 1 # Skip closing ']' i += 1 # Move to the next child - return ChironAST.ObjectOrArrayAccess(base, accesses) - + def visitObjectInstantiation(self, ctx: tlangParser.ObjectInstantiationContext): # Extract the left-hand side (target variable or object access) lval = self.getLval(ctx) # Extract the class name - class_name = ctx.VAR()[-1].getText() # The last VAR is the class being instantiated - - return [(ChironAST.ObjectInstantiationCommand(lval, class_name),1)] + # The last VAR is the class being instantiated + class_name = ctx.VAR()[-1].getText() + return [(ChironAST.ObjectInstantiationCommand(lval, class_name), 1)] def visitClassDeclaration(self, ctx: tlangParser.ClassDeclarationContext): className = ctx.VAR().getText() # Extract class name @@ -111,22 +118,22 @@ def visitClassDeclaration(self, ctx: tlangParser.ClassDeclarationContext): attributes = [] if ctx.classBody(): for attrDecl in ctx.classBody().classAttributeDeclaration(): - assign_list= self.visitAssignment(attrDecl.assignment()) + assign_list = self.visitAssignment(attrDecl.assignment()) attributes.extend(assign_list) - - print(className,attributes) - return [(ChironAST.ClassDeclarationCommand(className, attributes),1)] + print(className, attributes) + + return [(ChironAST.ClassDeclarationCommand(className, attributes), 1)] # def visitArrayAccess(self, ctx:tlangParser.ArrayAccessContext): # var = ctx.VAR().getText() # indices = [self.visit(expr).val for expr in ctx.expression()] # Visit all expressions in [] # # print(var, indices, "Inside multi-dimensional array access") - + # return ChironAST.ArrayAccess(var, indices) # Return an object handling multiple indices - - def visitValue(self, ctx:tlangParser.ValueContext): + + def visitValue(self, ctx: tlangParser.ValueContext): if ctx.NUM(): return ChironAST.Num(ctx.NUM().getText()) elif ctx.VAR(): @@ -137,63 +144,61 @@ def visitValue(self, ctx:tlangParser.ValueContext): print("entering heaven") return self.visitObjectOrArrayAccess(ctx.objectOrArrayAccess()) - def visitAssignExpr(self, ctx: tlangParser.AssignExprContext): print("Assignment Expr") - list=self.visitAssignment(ctx) + list = self.visitAssignment(ctx) self.stmtList.extend(list) return list[-1][0].lvar # return "("+ ChironAST.AssignmentCommand(lval, rval) + ")" # return # Calls visitAssignment - + def visitPrintStatement(self, ctx: tlangParser.PrintStatementContext): expr_value = self.visit(ctx.expression()) # Evaluate the expression - return [(ChironAST.PrintCommand(expr_value), 1)] # Return value in case it's used elsewhere - + # Return value in case it's used elsewhere + return [(ChironAST.PrintCommand(expr_value), 1)] - def visitIfConditional(self, ctx:tlangParser.IfConditionalContext): + def visitIfConditional(self, ctx: tlangParser.IfConditionalContext): condObj = ChironAST.ConditionCommand(self.visit(ctx.condition())) thenInstrList = self.visit(ctx.strict_ilist()) return [(condObj, len(thenInstrList) + 1)] + thenInstrList - def visitIfElseConditional(self, ctx:tlangParser.IfElseConditionalContext): + def visitIfElseConditional(self, ctx: tlangParser.IfElseConditionalContext): condObj = ChironAST.ConditionCommand(self.visit(ctx.condition())) thenInstrList = self.visit(ctx.strict_ilist(0)) elseInstrList = self.visit(ctx.strict_ilist(1)) - jumpOverElseBlock = [(ChironAST.ConditionCommand(ChironAST.BoolFalse()), len(elseInstrList) + 1)] + jumpOverElseBlock = [(ChironAST.ConditionCommand( + ChironAST.BoolFalse()), len(elseInstrList) + 1)] return [(condObj, len(thenInstrList) + 2)] + thenInstrList + jumpOverElseBlock + elseInstrList - def visitGotoCommand(self, ctx:tlangParser.GotoCommandContext): + def visitGotoCommand(self, ctx: tlangParser.GotoCommandContext): xcor = self.visit(ctx.expression(0)) ycor = self.visit(ctx.expression(1)) return [(ChironAST.GotoCommand(xcor, ycor), 1)] # Visit a parse tree produced by tlangParser#unaryExpr. - def visitUnaryExpr(self, ctx:tlangParser.UnaryExprContext): + def visitUnaryExpr(self, ctx: tlangParser.UnaryExprContext): expr1 = self.visit(ctx.expression()) if ctx.unaryArithOp().MINUS(): return ChironAST.UMinus(expr1) - - return self.visitChildren(ctx) + return self.visitChildren(ctx) # Visit a parse tree produced by tlangParser#addExpr. - def visitAddExpr(self, ctx:tlangParser.AddExprContext): + def visitAddExpr(self, ctx: tlangParser.AddExprContext): left = self.visit(ctx.expression(0)) right = self.visit(ctx.expression(1)) if ctx.additive().PLUS(): - ext= ChironAST.Sum(left, right) + ext = ChironAST.Sum(left, right) elif ctx.additive().MINUS(): - ext= ChironAST.Diff(left, right) - return ext - + ext = ChironAST.Diff(left, right) + return ext # Visit a parse tree produced by tlangParser#mulExpr. - def visitMulExpr(self, ctx:tlangParser.MulExprContext): + def visitMulExpr(self, ctx: tlangParser.MulExprContext): left = self.visit(ctx.expression(0)) right = self.visit(ctx.expression(1)) if ctx.multiplicative().MUL(): @@ -201,21 +206,18 @@ def visitMulExpr(self, ctx:tlangParser.MulExprContext): elif ctx.multiplicative().DIV(): return ChironAST.Div(left, right) - # Visit a parse tree produced by tlangParser#parenExpr. - def visitParenExpr(self, ctx:tlangParser.ParenExprContext): - return self.visit(ctx.expression()) - + def visitParenExpr(self, ctx: tlangParser.ParenExprContext): + return self.visit(ctx.expression()) - def visitCondition(self, ctx:tlangParser.ConditionContext): + def visitCondition(self, ctx: tlangParser.ConditionContext): if ctx.PENCOND(): - return ChironAST.PenStatus(); + return ChironAST.PenStatus() if ctx.NOT(): expr1 = self.visit(ctx.condition(0)) return ChironAST.NOT(expr1) - if ctx.logicOp(): expr1 = self.visit(ctx.condition(0)) expr2 = self.visit(ctx.condition(1)) @@ -226,7 +228,6 @@ def visitCondition(self, ctx:tlangParser.ConditionContext): elif logicOpCtx.OR(): return ChironAST.OR(expr1, expr2) - if ctx.binCondOp(): expr1 = self.visit(ctx.expression(0)) expr2 = self.visit(ctx.expression(1)) @@ -251,24 +252,20 @@ def visitCondition(self, ctx:tlangParser.ConditionContext): return self.visitChildren(ctx) - - - - - - - - - def visitLoop(self, ctx:tlangParser.LoopContext): + def visitLoop(self, ctx: tlangParser.LoopContext): # insert counter variable in IR for tracking repeat count self.repeatInstrCount += 1 repeatNum = self.visit(ctx.value()) - counterVar = ChironAST.Var(":__rep_counter_" + str(self.repeatInstrCount)) - counterVarInitInstr = ChironAST.AssignmentCommand(counterVar, repeatNum) + counterVar = ChironAST.Var( + ":__rep_counter_" + str(self.repeatInstrCount)) + counterVarInitInstr = ChironAST.AssignmentCommand( + counterVar, repeatNum) constZero = ChironAST.Num(0) constOne = ChironAST.Num(1) - loopCond = ChironAST.ConditionCommand(ChironAST.GT(counterVar, constZero)) - counterVarDecrInstr = ChironAST.AssignmentCommand(counterVar, ChironAST.Diff(counterVar, constOne)) + loopCond = ChironAST.ConditionCommand( + ChironAST.GT(counterVar, constZero)) + counterVarDecrInstr = ChironAST.AssignmentCommand( + counterVar, ChironAST.Diff(counterVar, constOne)) thenInstrList = [] for instr in ctx.strict_ilist().instruction(): @@ -279,10 +276,10 @@ def visitLoop(self, ctx:tlangParser.LoopContext): return [(counterVarInitInstr, 1), (loopCond, len(thenInstrList) + 3)] + thenInstrList +\ [(counterVarDecrInstr, 1), (boolFalse, -len(thenInstrList) - 2)] - def visitMoveCommand(self, ctx:tlangParser.MoveCommandContext): + def visitMoveCommand(self, ctx: tlangParser.MoveCommandContext): mvcommand = ctx.moveOp().getText() mvexpr = self.visit(ctx.expression()) return [(ChironAST.MoveCommand(mvcommand, mvexpr), 1)] - def visitPenCommand(self, ctx:tlangParser.PenCommandContext): + def visitPenCommand(self, ctx: tlangParser.PenCommandContext): return [(ChironAST.PenCommand(ctx.getText()), 1)] diff --git a/ChironCore/example/exampleFC.tl b/ChironCore/example/exampleFC.tl new file mode 100644 index 0000000..4c0bd84 --- /dev/null +++ b/ChironCore/example/exampleFC.tl @@ -0,0 +1,32 @@ +def drawRectangle(:l, :b) +{ + if :l <= 42 [ + :b = :b + 40 + ] else [ + :b = :b + 22 + ] + return +} + +def drawCircle() +{ + :r = 10 + :p1 = 1 + :p2 = 1 + if :p1 == 0 [ + :p1 = 2 + ] else [ + :p2 = 0 + ] + drawRectangle(80, 20) + return +} + +drawRectangle(80, 20) +drawCircle() +:b = :l +if :b <= 42 [ + :l = :l + 40 +] else [ + :l = :l + 22 +] diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 4a67e29..66951e6 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -64,7 +64,7 @@ def handlePauseCommand(self, stmt, tgt): def sanityCheck(self, irInstr): stmt, tgt = irInstr # if not a condition command, rel. jump can't be anything but 1 - if not isinstance(stmt, ChironAST.ConditionCommand): + if not isinstance(stmt, ChironAST.ConditionCommand) and not isinstance(stmt, ChironAST.FunctionDeclarationCommand): if tgt != 1: raise ValueError("Improper relative jump for non-conditional instruction", str(stmt), tgt) @@ -82,6 +82,12 @@ class ConcreteInterpreter(Interpreter): # Ref: https://realpython.com/beginners-guide-python-turtle cond_eval = None # used as a temporary variable within the embedded program interpreter prg = None + argument = None + + # map of function name to their pc in the IR + function_addresses = {} + #stack for handling function calls + call_stack = [] def __init__(self, irHandler, params): super().__init__(irHandler, params) @@ -116,6 +122,14 @@ def interpret(self): ntgt = self.handleClassDeclaration(stmt, tgt) elif isinstance(stmt, ChironAST.ObjectInstantiationCommand): ntgt = self.handleObjectInstantiation(stmt, tgt) + elif isinstance(stmt, ChironAST.FunctionDeclarationCommand): + ntgt = self.handleFunctionDeclaration(stmt, tgt) + elif isinstance(stmt, ChironAST.FunctionCallCommand): + ntgt = self.handleFunctionCall(stmt, tgt) + elif isinstance(stmt, ChironAST.ReturnCommand): + ntgt = self.handleFunctionReturn(stmt, tgt) + elif isinstance(stmt, ChironAST.ParametersPassingCommand): + ntgt = self.handleParametersPassing(stmt, tgt) else: raise NotImplementedError("Unknown instruction: %s, %s."%(type(stmt), stmt)) @@ -141,6 +155,40 @@ def initProgramContext(self, params): var = key.replace(":","") exec("setattr(self.prg,\"%s\",%s)" % (var, val)) + def handleFunctionDeclaration(self, stmt, tgt): + print(f"Function Declaration: {stmt.name}") + self.function_addresses[stmt.name] = self.pc + 1 + return tgt + + def handleFunctionCall(self, stmt, tgt): + print(f"Function Call: {stmt.name}") + self.call_stack.append(self.pc + 1) + # Save the current program context + self.call_stack.append(self.prg) + # Initialize a new program context for the function call + for arg in stmt.args: + arg_value = addContext(arg) + exec(f"self.argument = {arg_value}") + self.call_stack.append(self.argument) + self.prg = ProgramContext() + self.pc = self.function_addresses[stmt.name] + return 0 + + def handleFunctionReturn(self, stmt, tgt): + print(f"Function Return: {stmt}") + # Restore the previous program context + self.prg = self.call_stack.pop() + self.pc = self.call_stack.pop() + return 0 + + def handleParametersPassing(self, stmt, tgt): + print(f"Parameters Passing: {stmt.params}") + for param in reversed(stmt.params): + param = str(param).replace(":", "") + param_value = self.call_stack.pop() + exec(f"self.prg.{param} = {param_value}") + return 1 + def handleClassDeclaration(self, stmt, tgt): print(f" Class Declaration: {stmt.className}") diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index 39fdae2..316d94e 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -20,6 +20,8 @@ instruction : assignment | pauseCommand | classDeclaration | objectInstantiation + | functionDeclaration + | functionCall ; conditional : ifConditional | ifElseConditional ; @@ -83,10 +85,15 @@ objectOrArrayAccess : baseAccess ('.' VAR | '[' expression ']')+ ; baseAccess : VAR ; +// function call +functionCall : NAME '(' arguments ')' ; +// function declaration +functionDeclaration : 'def' NAME '(' parameters ')' '{' strict_ilist RETURN '}' ; +RETURN : 'return' ; - - +parameters : ( VAR ( ',' VAR )* )? ; +arguments : ( expression ( ',' expression )* )? ; // TODO : diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index d7d13a3..e357dd1 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -24,10 +24,12 @@ null ';' 'new' '.' +'def' '+' '-' '*' '/' +'return' 'pendown?' '<' '>' @@ -69,10 +71,12 @@ null null null null +null PLUS MINUS MUL DIV +RETURN PENCOND LT GT @@ -115,6 +119,10 @@ classAttributeDeclaration objectInstantiation objectOrArrayAccess baseAccess +functionCall +functionDeclaration +parameters +arguments condition binCondOp logicOp @@ -122,4 +130,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 44, 263, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 67, 10, 3, 12, 3, 14, 3, 70, 11, 3, 3, 4, 6, 4, 73, 10, 4, 13, 4, 14, 4, 74, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 87, 10, 5, 3, 6, 3, 6, 5, 6, 91, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 135, 10, 15, 12, 15, 14, 15, 138, 11, 15, 5, 15, 140, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 146, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 5, 21, 173, 10, 21, 3, 21, 3, 21, 5, 21, 177, 10, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 187, 10, 21, 12, 21, 14, 21, 190, 11, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 7, 23, 199, 10, 23, 12, 23, 14, 23, 202, 11, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 5, 25, 209, 10, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 6, 26, 224, 10, 26, 13, 26, 14, 26, 225, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 242, 10, 28, 3, 28, 3, 28, 3, 28, 3, 28, 7, 28, 248, 10, 28, 12, 28, 14, 28, 251, 11, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 261, 10, 31, 3, 31, 2, 4, 40, 54, 32, 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, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 29, 30, 3, 2, 27, 28, 3, 2, 32, 37, 3, 2, 38, 39, 2, 264, 2, 62, 3, 2, 2, 2, 4, 68, 3, 2, 2, 2, 6, 72, 3, 2, 2, 2, 8, 86, 3, 2, 2, 2, 10, 90, 3, 2, 2, 2, 12, 92, 3, 2, 2, 2, 14, 98, 3, 2, 2, 2, 16, 108, 3, 2, 2, 2, 18, 114, 3, 2, 2, 2, 20, 121, 3, 2, 2, 2, 22, 124, 3, 2, 2, 2, 24, 126, 3, 2, 2, 2, 26, 128, 3, 2, 2, 2, 28, 130, 3, 2, 2, 2, 30, 145, 3, 2, 2, 2, 32, 150, 3, 2, 2, 2, 34, 155, 3, 2, 2, 2, 36, 157, 3, 2, 2, 2, 38, 159, 3, 2, 2, 2, 40, 176, 3, 2, 2, 2, 42, 191, 3, 2, 2, 2, 44, 200, 3, 2, 2, 2, 46, 203, 3, 2, 2, 2, 48, 208, 3, 2, 2, 2, 50, 216, 3, 2, 2, 2, 52, 227, 3, 2, 2, 2, 54, 241, 3, 2, 2, 2, 56, 252, 3, 2, 2, 2, 58, 254, 3, 2, 2, 2, 60, 260, 3, 2, 2, 2, 62, 63, 5, 4, 3, 2, 63, 64, 7, 2, 2, 3, 64, 3, 3, 2, 2, 2, 65, 67, 5, 8, 5, 2, 66, 65, 3, 2, 2, 2, 67, 70, 3, 2, 2, 2, 68, 66, 3, 2, 2, 2, 68, 69, 3, 2, 2, 2, 69, 5, 3, 2, 2, 2, 70, 68, 3, 2, 2, 2, 71, 73, 5, 8, 5, 2, 72, 71, 3, 2, 2, 2, 73, 74, 3, 2, 2, 2, 74, 72, 3, 2, 2, 2, 74, 75, 3, 2, 2, 2, 75, 7, 3, 2, 2, 2, 76, 87, 5, 30, 16, 2, 77, 87, 5, 32, 17, 2, 78, 87, 5, 10, 6, 2, 79, 87, 5, 16, 9, 2, 80, 87, 5, 20, 11, 2, 81, 87, 5, 24, 13, 2, 82, 87, 5, 18, 10, 2, 83, 87, 5, 26, 14, 2, 84, 87, 5, 42, 22, 2, 85, 87, 5, 48, 25, 2, 86, 76, 3, 2, 2, 2, 86, 77, 3, 2, 2, 2, 86, 78, 3, 2, 2, 2, 86, 79, 3, 2, 2, 2, 86, 80, 3, 2, 2, 2, 86, 81, 3, 2, 2, 2, 86, 82, 3, 2, 2, 2, 86, 83, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 86, 85, 3, 2, 2, 2, 87, 9, 3, 2, 2, 2, 88, 91, 5, 12, 7, 2, 89, 91, 5, 14, 8, 2, 90, 88, 3, 2, 2, 2, 90, 89, 3, 2, 2, 2, 91, 11, 3, 2, 2, 2, 92, 93, 7, 3, 2, 2, 93, 94, 5, 54, 28, 2, 94, 95, 7, 4, 2, 2, 95, 96, 5, 6, 4, 2, 96, 97, 7, 5, 2, 2, 97, 13, 3, 2, 2, 2, 98, 99, 7, 3, 2, 2, 99, 100, 5, 54, 28, 2, 100, 101, 7, 4, 2, 2, 101, 102, 5, 6, 4, 2, 102, 103, 7, 5, 2, 2, 103, 104, 7, 6, 2, 2, 104, 105, 7, 4, 2, 2, 105, 106, 5, 6, 4, 2, 106, 107, 7, 5, 2, 2, 107, 15, 3, 2, 2, 2, 108, 109, 7, 7, 2, 2, 109, 110, 5, 60, 31, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 17, 3, 2, 2, 2, 114, 115, 7, 8, 2, 2, 115, 116, 7, 9, 2, 2, 116, 117, 5, 40, 21, 2, 117, 118, 7, 10, 2, 2, 118, 119, 5, 40, 21, 2, 119, 120, 7, 11, 2, 2, 120, 19, 3, 2, 2, 2, 121, 122, 5, 22, 12, 2, 122, 123, 5, 40, 21, 2, 123, 21, 3, 2, 2, 2, 124, 125, 9, 2, 2, 2, 125, 23, 3, 2, 2, 2, 126, 127, 9, 3, 2, 2, 127, 25, 3, 2, 2, 2, 128, 129, 7, 18, 2, 2, 129, 27, 3, 2, 2, 2, 130, 139, 7, 4, 2, 2, 131, 136, 5, 40, 21, 2, 132, 133, 7, 10, 2, 2, 133, 135, 5, 40, 21, 2, 134, 132, 3, 2, 2, 2, 135, 138, 3, 2, 2, 2, 136, 134, 3, 2, 2, 2, 136, 137, 3, 2, 2, 2, 137, 140, 3, 2, 2, 2, 138, 136, 3, 2, 2, 2, 139, 131, 3, 2, 2, 2, 139, 140, 3, 2, 2, 2, 140, 141, 3, 2, 2, 2, 141, 142, 7, 5, 2, 2, 142, 29, 3, 2, 2, 2, 143, 146, 7, 42, 2, 2, 144, 146, 5, 50, 26, 2, 145, 143, 3, 2, 2, 2, 145, 144, 3, 2, 2, 2, 146, 147, 3, 2, 2, 2, 147, 148, 7, 19, 2, 2, 148, 149, 5, 40, 21, 2, 149, 31, 3, 2, 2, 2, 150, 151, 7, 20, 2, 2, 151, 152, 7, 9, 2, 2, 152, 153, 5, 40, 21, 2, 153, 154, 7, 11, 2, 2, 154, 33, 3, 2, 2, 2, 155, 156, 9, 4, 2, 2, 156, 35, 3, 2, 2, 2, 157, 158, 9, 5, 2, 2, 158, 37, 3, 2, 2, 2, 159, 160, 7, 28, 2, 2, 160, 39, 3, 2, 2, 2, 161, 162, 8, 21, 1, 2, 162, 163, 5, 38, 20, 2, 163, 164, 5, 40, 21, 8, 164, 177, 3, 2, 2, 2, 165, 166, 7, 9, 2, 2, 166, 167, 5, 40, 21, 2, 167, 168, 7, 11, 2, 2, 168, 177, 3, 2, 2, 2, 169, 177, 5, 60, 31, 2, 170, 173, 7, 42, 2, 2, 171, 173, 5, 50, 26, 2, 172, 170, 3, 2, 2, 2, 172, 171, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 175, 7, 19, 2, 2, 175, 177, 5, 40, 21, 3, 176, 161, 3, 2, 2, 2, 176, 165, 3, 2, 2, 2, 176, 169, 3, 2, 2, 2, 176, 172, 3, 2, 2, 2, 177, 188, 3, 2, 2, 2, 178, 179, 12, 7, 2, 2, 179, 180, 5, 34, 18, 2, 180, 181, 5, 40, 21, 8, 181, 187, 3, 2, 2, 2, 182, 183, 12, 6, 2, 2, 183, 184, 5, 36, 19, 2, 184, 185, 5, 40, 21, 7, 185, 187, 3, 2, 2, 2, 186, 178, 3, 2, 2, 2, 186, 182, 3, 2, 2, 2, 187, 190, 3, 2, 2, 2, 188, 186, 3, 2, 2, 2, 188, 189, 3, 2, 2, 2, 189, 41, 3, 2, 2, 2, 190, 188, 3, 2, 2, 2, 191, 192, 7, 21, 2, 2, 192, 193, 7, 42, 2, 2, 193, 194, 7, 22, 2, 2, 194, 195, 5, 44, 23, 2, 195, 196, 7, 23, 2, 2, 196, 43, 3, 2, 2, 2, 197, 199, 5, 46, 24, 2, 198, 197, 3, 2, 2, 2, 199, 202, 3, 2, 2, 2, 200, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 45, 3, 2, 2, 2, 202, 200, 3, 2, 2, 2, 203, 204, 5, 30, 16, 2, 204, 205, 7, 24, 2, 2, 205, 47, 3, 2, 2, 2, 206, 209, 7, 42, 2, 2, 207, 209, 5, 50, 26, 2, 208, 206, 3, 2, 2, 2, 208, 207, 3, 2, 2, 2, 209, 210, 3, 2, 2, 2, 210, 211, 7, 19, 2, 2, 211, 212, 7, 25, 2, 2, 212, 213, 7, 42, 2, 2, 213, 214, 7, 9, 2, 2, 214, 215, 7, 11, 2, 2, 215, 49, 3, 2, 2, 2, 216, 223, 5, 52, 27, 2, 217, 218, 7, 26, 2, 2, 218, 224, 7, 42, 2, 2, 219, 220, 7, 4, 2, 2, 220, 221, 5, 40, 21, 2, 221, 222, 7, 5, 2, 2, 222, 224, 3, 2, 2, 2, 223, 217, 3, 2, 2, 2, 223, 219, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 223, 3, 2, 2, 2, 225, 226, 3, 2, 2, 2, 226, 51, 3, 2, 2, 2, 227, 228, 7, 42, 2, 2, 228, 53, 3, 2, 2, 2, 229, 230, 8, 28, 1, 2, 230, 231, 7, 40, 2, 2, 231, 242, 5, 54, 28, 7, 232, 233, 5, 40, 21, 2, 233, 234, 5, 56, 29, 2, 234, 235, 5, 40, 21, 2, 235, 242, 3, 2, 2, 2, 236, 242, 7, 31, 2, 2, 237, 238, 7, 9, 2, 2, 238, 239, 5, 54, 28, 2, 239, 240, 7, 11, 2, 2, 240, 242, 3, 2, 2, 2, 241, 229, 3, 2, 2, 2, 241, 232, 3, 2, 2, 2, 241, 236, 3, 2, 2, 2, 241, 237, 3, 2, 2, 2, 242, 249, 3, 2, 2, 2, 243, 244, 12, 5, 2, 2, 244, 245, 5, 58, 30, 2, 245, 246, 5, 54, 28, 6, 246, 248, 3, 2, 2, 2, 247, 243, 3, 2, 2, 2, 248, 251, 3, 2, 2, 2, 249, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 55, 3, 2, 2, 2, 251, 249, 3, 2, 2, 2, 252, 253, 9, 6, 2, 2, 253, 57, 3, 2, 2, 2, 254, 255, 9, 7, 2, 2, 255, 59, 3, 2, 2, 2, 256, 261, 7, 41, 2, 2, 257, 261, 7, 42, 2, 2, 258, 261, 5, 28, 15, 2, 259, 261, 5, 50, 26, 2, 260, 256, 3, 2, 2, 2, 260, 257, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 260, 259, 3, 2, 2, 2, 261, 61, 3, 2, 2, 2, 20, 68, 74, 86, 90, 136, 139, 145, 172, 176, 186, 188, 200, 208, 223, 225, 241, 249, 260] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 308, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 75, 10, 3, 12, 3, 14, 3, 78, 11, 3, 3, 4, 6, 4, 81, 10, 4, 13, 4, 14, 4, 82, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 97, 10, 5, 3, 6, 3, 6, 5, 6, 101, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 145, 10, 15, 12, 15, 14, 15, 148, 11, 15, 5, 15, 150, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 156, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 5, 21, 183, 10, 21, 3, 21, 3, 21, 5, 21, 187, 10, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 197, 10, 21, 12, 21, 14, 21, 200, 11, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 7, 23, 209, 10, 23, 12, 23, 14, 23, 212, 11, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 5, 25, 219, 10, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 6, 26, 234, 10, 26, 13, 26, 14, 26, 235, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 7, 30, 258, 10, 30, 12, 30, 14, 30, 261, 11, 30, 5, 30, 263, 10, 30, 3, 31, 3, 31, 3, 31, 7, 31, 268, 10, 31, 12, 31, 14, 31, 271, 11, 31, 5, 31, 273, 10, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 287, 10, 32, 3, 32, 3, 32, 3, 32, 3, 32, 7, 32, 293, 10, 32, 12, 32, 14, 32, 296, 11, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 306, 10, 35, 3, 35, 2, 4, 40, 62, 36, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 3, 2, 34, 39, 3, 2, 40, 41, 2, 311, 2, 70, 3, 2, 2, 2, 4, 76, 3, 2, 2, 2, 6, 80, 3, 2, 2, 2, 8, 96, 3, 2, 2, 2, 10, 100, 3, 2, 2, 2, 12, 102, 3, 2, 2, 2, 14, 108, 3, 2, 2, 2, 16, 118, 3, 2, 2, 2, 18, 124, 3, 2, 2, 2, 20, 131, 3, 2, 2, 2, 22, 134, 3, 2, 2, 2, 24, 136, 3, 2, 2, 2, 26, 138, 3, 2, 2, 2, 28, 140, 3, 2, 2, 2, 30, 155, 3, 2, 2, 2, 32, 160, 3, 2, 2, 2, 34, 165, 3, 2, 2, 2, 36, 167, 3, 2, 2, 2, 38, 169, 3, 2, 2, 2, 40, 186, 3, 2, 2, 2, 42, 201, 3, 2, 2, 2, 44, 210, 3, 2, 2, 2, 46, 213, 3, 2, 2, 2, 48, 218, 3, 2, 2, 2, 50, 226, 3, 2, 2, 2, 52, 237, 3, 2, 2, 2, 54, 239, 3, 2, 2, 2, 56, 244, 3, 2, 2, 2, 58, 262, 3, 2, 2, 2, 60, 272, 3, 2, 2, 2, 62, 286, 3, 2, 2, 2, 64, 297, 3, 2, 2, 2, 66, 299, 3, 2, 2, 2, 68, 305, 3, 2, 2, 2, 70, 71, 5, 4, 3, 2, 71, 72, 7, 2, 2, 3, 72, 3, 3, 2, 2, 2, 73, 75, 5, 8, 5, 2, 74, 73, 3, 2, 2, 2, 75, 78, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 76, 77, 3, 2, 2, 2, 77, 5, 3, 2, 2, 2, 78, 76, 3, 2, 2, 2, 79, 81, 5, 8, 5, 2, 80, 79, 3, 2, 2, 2, 81, 82, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 82, 83, 3, 2, 2, 2, 83, 7, 3, 2, 2, 2, 84, 97, 5, 30, 16, 2, 85, 97, 5, 32, 17, 2, 86, 97, 5, 10, 6, 2, 87, 97, 5, 16, 9, 2, 88, 97, 5, 20, 11, 2, 89, 97, 5, 24, 13, 2, 90, 97, 5, 18, 10, 2, 91, 97, 5, 26, 14, 2, 92, 97, 5, 42, 22, 2, 93, 97, 5, 48, 25, 2, 94, 97, 5, 56, 29, 2, 95, 97, 5, 54, 28, 2, 96, 84, 3, 2, 2, 2, 96, 85, 3, 2, 2, 2, 96, 86, 3, 2, 2, 2, 96, 87, 3, 2, 2, 2, 96, 88, 3, 2, 2, 2, 96, 89, 3, 2, 2, 2, 96, 90, 3, 2, 2, 2, 96, 91, 3, 2, 2, 2, 96, 92, 3, 2, 2, 2, 96, 93, 3, 2, 2, 2, 96, 94, 3, 2, 2, 2, 96, 95, 3, 2, 2, 2, 97, 9, 3, 2, 2, 2, 98, 101, 5, 12, 7, 2, 99, 101, 5, 14, 8, 2, 100, 98, 3, 2, 2, 2, 100, 99, 3, 2, 2, 2, 101, 11, 3, 2, 2, 2, 102, 103, 7, 3, 2, 2, 103, 104, 5, 62, 32, 2, 104, 105, 7, 4, 2, 2, 105, 106, 5, 6, 4, 2, 106, 107, 7, 5, 2, 2, 107, 13, 3, 2, 2, 2, 108, 109, 7, 3, 2, 2, 109, 110, 5, 62, 32, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 114, 7, 6, 2, 2, 114, 115, 7, 4, 2, 2, 115, 116, 5, 6, 4, 2, 116, 117, 7, 5, 2, 2, 117, 15, 3, 2, 2, 2, 118, 119, 7, 7, 2, 2, 119, 120, 5, 68, 35, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 17, 3, 2, 2, 2, 124, 125, 7, 8, 2, 2, 125, 126, 7, 9, 2, 2, 126, 127, 5, 40, 21, 2, 127, 128, 7, 10, 2, 2, 128, 129, 5, 40, 21, 2, 129, 130, 7, 11, 2, 2, 130, 19, 3, 2, 2, 2, 131, 132, 5, 22, 12, 2, 132, 133, 5, 40, 21, 2, 133, 21, 3, 2, 2, 2, 134, 135, 9, 2, 2, 2, 135, 23, 3, 2, 2, 2, 136, 137, 9, 3, 2, 2, 137, 25, 3, 2, 2, 2, 138, 139, 7, 18, 2, 2, 139, 27, 3, 2, 2, 2, 140, 149, 7, 4, 2, 2, 141, 146, 5, 40, 21, 2, 142, 143, 7, 10, 2, 2, 143, 145, 5, 40, 21, 2, 144, 142, 3, 2, 2, 2, 145, 148, 3, 2, 2, 2, 146, 144, 3, 2, 2, 2, 146, 147, 3, 2, 2, 2, 147, 150, 3, 2, 2, 2, 148, 146, 3, 2, 2, 2, 149, 141, 3, 2, 2, 2, 149, 150, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 152, 7, 5, 2, 2, 152, 29, 3, 2, 2, 2, 153, 156, 7, 44, 2, 2, 154, 156, 5, 50, 26, 2, 155, 153, 3, 2, 2, 2, 155, 154, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 158, 7, 19, 2, 2, 158, 159, 5, 40, 21, 2, 159, 31, 3, 2, 2, 2, 160, 161, 7, 20, 2, 2, 161, 162, 7, 9, 2, 2, 162, 163, 5, 40, 21, 2, 163, 164, 7, 11, 2, 2, 164, 33, 3, 2, 2, 2, 165, 166, 9, 4, 2, 2, 166, 35, 3, 2, 2, 2, 167, 168, 9, 5, 2, 2, 168, 37, 3, 2, 2, 2, 169, 170, 7, 29, 2, 2, 170, 39, 3, 2, 2, 2, 171, 172, 8, 21, 1, 2, 172, 173, 5, 38, 20, 2, 173, 174, 5, 40, 21, 8, 174, 187, 3, 2, 2, 2, 175, 176, 7, 9, 2, 2, 176, 177, 5, 40, 21, 2, 177, 178, 7, 11, 2, 2, 178, 187, 3, 2, 2, 2, 179, 187, 5, 68, 35, 2, 180, 183, 7, 44, 2, 2, 181, 183, 5, 50, 26, 2, 182, 180, 3, 2, 2, 2, 182, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 185, 7, 19, 2, 2, 185, 187, 5, 40, 21, 3, 186, 171, 3, 2, 2, 2, 186, 175, 3, 2, 2, 2, 186, 179, 3, 2, 2, 2, 186, 182, 3, 2, 2, 2, 187, 198, 3, 2, 2, 2, 188, 189, 12, 7, 2, 2, 189, 190, 5, 34, 18, 2, 190, 191, 5, 40, 21, 8, 191, 197, 3, 2, 2, 2, 192, 193, 12, 6, 2, 2, 193, 194, 5, 36, 19, 2, 194, 195, 5, 40, 21, 7, 195, 197, 3, 2, 2, 2, 196, 188, 3, 2, 2, 2, 196, 192, 3, 2, 2, 2, 197, 200, 3, 2, 2, 2, 198, 196, 3, 2, 2, 2, 198, 199, 3, 2, 2, 2, 199, 41, 3, 2, 2, 2, 200, 198, 3, 2, 2, 2, 201, 202, 7, 21, 2, 2, 202, 203, 7, 44, 2, 2, 203, 204, 7, 22, 2, 2, 204, 205, 5, 44, 23, 2, 205, 206, 7, 23, 2, 2, 206, 43, 3, 2, 2, 2, 207, 209, 5, 46, 24, 2, 208, 207, 3, 2, 2, 2, 209, 212, 3, 2, 2, 2, 210, 208, 3, 2, 2, 2, 210, 211, 3, 2, 2, 2, 211, 45, 3, 2, 2, 2, 212, 210, 3, 2, 2, 2, 213, 214, 5, 30, 16, 2, 214, 215, 7, 24, 2, 2, 215, 47, 3, 2, 2, 2, 216, 219, 7, 44, 2, 2, 217, 219, 5, 50, 26, 2, 218, 216, 3, 2, 2, 2, 218, 217, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 221, 7, 19, 2, 2, 221, 222, 7, 25, 2, 2, 222, 223, 7, 44, 2, 2, 223, 224, 7, 9, 2, 2, 224, 225, 7, 11, 2, 2, 225, 49, 3, 2, 2, 2, 226, 233, 5, 52, 27, 2, 227, 228, 7, 26, 2, 2, 228, 234, 7, 44, 2, 2, 229, 230, 7, 4, 2, 2, 230, 231, 5, 40, 21, 2, 231, 232, 7, 5, 2, 2, 232, 234, 3, 2, 2, 2, 233, 227, 3, 2, 2, 2, 233, 229, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 233, 3, 2, 2, 2, 235, 236, 3, 2, 2, 2, 236, 51, 3, 2, 2, 2, 237, 238, 7, 44, 2, 2, 238, 53, 3, 2, 2, 2, 239, 240, 7, 45, 2, 2, 240, 241, 7, 9, 2, 2, 241, 242, 5, 60, 31, 2, 242, 243, 7, 11, 2, 2, 243, 55, 3, 2, 2, 2, 244, 245, 7, 27, 2, 2, 245, 246, 7, 45, 2, 2, 246, 247, 7, 9, 2, 2, 247, 248, 5, 58, 30, 2, 248, 249, 7, 11, 2, 2, 249, 250, 7, 22, 2, 2, 250, 251, 5, 6, 4, 2, 251, 252, 7, 32, 2, 2, 252, 253, 7, 23, 2, 2, 253, 57, 3, 2, 2, 2, 254, 259, 7, 44, 2, 2, 255, 256, 7, 10, 2, 2, 256, 258, 7, 44, 2, 2, 257, 255, 3, 2, 2, 2, 258, 261, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 263, 3, 2, 2, 2, 261, 259, 3, 2, 2, 2, 262, 254, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 59, 3, 2, 2, 2, 264, 269, 5, 40, 21, 2, 265, 266, 7, 10, 2, 2, 266, 268, 5, 40, 21, 2, 267, 265, 3, 2, 2, 2, 268, 271, 3, 2, 2, 2, 269, 267, 3, 2, 2, 2, 269, 270, 3, 2, 2, 2, 270, 273, 3, 2, 2, 2, 271, 269, 3, 2, 2, 2, 272, 264, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 61, 3, 2, 2, 2, 274, 275, 8, 32, 1, 2, 275, 276, 7, 42, 2, 2, 276, 287, 5, 62, 32, 7, 277, 278, 5, 40, 21, 2, 278, 279, 5, 64, 33, 2, 279, 280, 5, 40, 21, 2, 280, 287, 3, 2, 2, 2, 281, 287, 7, 33, 2, 2, 282, 283, 7, 9, 2, 2, 283, 284, 5, 62, 32, 2, 284, 285, 7, 11, 2, 2, 285, 287, 3, 2, 2, 2, 286, 274, 3, 2, 2, 2, 286, 277, 3, 2, 2, 2, 286, 281, 3, 2, 2, 2, 286, 282, 3, 2, 2, 2, 287, 294, 3, 2, 2, 2, 288, 289, 12, 5, 2, 2, 289, 290, 5, 66, 34, 2, 290, 291, 5, 62, 32, 6, 291, 293, 3, 2, 2, 2, 292, 288, 3, 2, 2, 2, 293, 296, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 294, 295, 3, 2, 2, 2, 295, 63, 3, 2, 2, 2, 296, 294, 3, 2, 2, 2, 297, 298, 9, 6, 2, 2, 298, 65, 3, 2, 2, 2, 299, 300, 9, 7, 2, 2, 300, 67, 3, 2, 2, 2, 301, 306, 7, 43, 2, 2, 302, 306, 7, 44, 2, 2, 303, 306, 5, 28, 15, 2, 304, 306, 5, 50, 26, 2, 305, 301, 3, 2, 2, 2, 305, 302, 3, 2, 2, 2, 305, 303, 3, 2, 2, 2, 305, 304, 3, 2, 2, 2, 306, 69, 3, 2, 2, 2, 24, 76, 82, 96, 100, 146, 149, 155, 182, 186, 196, 198, 210, 218, 233, 235, 259, 262, 269, 272, 286, 294, 305] \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.tokens b/ChironCore/turtparse/tlang.tokens index f6b3f9b..eb1b614 100644 --- a/ChironCore/turtparse/tlang.tokens +++ b/ChironCore/turtparse/tlang.tokens @@ -22,24 +22,26 @@ T__20=21 T__21=22 T__22=23 T__23=24 -PLUS=25 -MINUS=26 -MUL=27 -DIV=28 -PENCOND=29 -LT=30 -GT=31 -EQ=32 -NEQ=33 -LTE=34 -GTE=35 -AND=36 -OR=37 -NOT=38 -NUM=39 -VAR=40 -NAME=41 -Whitespace=42 +T__24=25 +PLUS=26 +MINUS=27 +MUL=28 +DIV=29 +RETURN=30 +PENCOND=31 +LT=32 +GT=33 +EQ=34 +NEQ=35 +LTE=36 +GTE=37 +AND=38 +OR=39 +NOT=40 +NUM=41 +VAR=42 +NAME=43 +Whitespace=44 'if'=1 '['=2 ']'=3 @@ -64,17 +66,19 @@ Whitespace=42 ';'=22 'new'=23 '.'=24 -'+'=25 -'-'=26 -'*'=27 -'/'=28 -'pendown?'=29 -'<'=30 -'>'=31 -'=='=32 -'!='=33 -'<='=34 -'>='=35 -'&&'=36 -'||'=37 -'!'=38 +'def'=25 +'+'=26 +'-'=27 +'*'=28 +'/'=29 +'return'=30 +'pendown?'=31 +'<'=32 +'>'=33 +'=='=34 +'!='=35 +'<='=36 +'>='=37 +'&&'=38 +'||'=39 +'!'=40 diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index 4fc342c..a7558c8 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -24,10 +24,12 @@ null ';' 'new' '.' +'def' '+' '-' '*' '/' +'return' 'pendown?' '<' '>' @@ -69,10 +71,12 @@ null null null null +null PLUS MINUS MUL DIV +RETURN PENCOND LT GT @@ -113,10 +117,12 @@ T__20 T__21 T__22 T__23 +T__24 PLUS MINUS MUL DIV +RETURN PENCOND LT GT @@ -140,4 +146,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 44, 257, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 6, 40, 234, 10, 40, 13, 40, 14, 40, 235, 3, 41, 3, 41, 3, 41, 7, 41, 241, 10, 41, 12, 41, 14, 41, 244, 11, 41, 3, 42, 6, 42, 247, 10, 42, 13, 42, 14, 42, 248, 3, 43, 6, 43, 252, 10, 43, 13, 43, 14, 43, 253, 3, 43, 3, 43, 2, 2, 44, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 260, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 3, 87, 3, 2, 2, 2, 5, 90, 3, 2, 2, 2, 7, 92, 3, 2, 2, 2, 9, 94, 3, 2, 2, 2, 11, 99, 3, 2, 2, 2, 13, 106, 3, 2, 2, 2, 15, 111, 3, 2, 2, 2, 17, 113, 3, 2, 2, 2, 19, 115, 3, 2, 2, 2, 21, 117, 3, 2, 2, 2, 23, 125, 3, 2, 2, 2, 25, 134, 3, 2, 2, 2, 27, 139, 3, 2, 2, 2, 29, 145, 3, 2, 2, 2, 31, 151, 3, 2, 2, 2, 33, 159, 3, 2, 2, 2, 35, 165, 3, 2, 2, 2, 37, 167, 3, 2, 2, 2, 39, 173, 3, 2, 2, 2, 41, 179, 3, 2, 2, 2, 43, 181, 3, 2, 2, 2, 45, 183, 3, 2, 2, 2, 47, 185, 3, 2, 2, 2, 49, 189, 3, 2, 2, 2, 51, 191, 3, 2, 2, 2, 53, 193, 3, 2, 2, 2, 55, 195, 3, 2, 2, 2, 57, 197, 3, 2, 2, 2, 59, 199, 3, 2, 2, 2, 61, 208, 3, 2, 2, 2, 63, 210, 3, 2, 2, 2, 65, 212, 3, 2, 2, 2, 67, 215, 3, 2, 2, 2, 69, 218, 3, 2, 2, 2, 71, 221, 3, 2, 2, 2, 73, 224, 3, 2, 2, 2, 75, 227, 3, 2, 2, 2, 77, 230, 3, 2, 2, 2, 79, 233, 3, 2, 2, 2, 81, 237, 3, 2, 2, 2, 83, 246, 3, 2, 2, 2, 85, 251, 3, 2, 2, 2, 87, 88, 7, 107, 2, 2, 88, 89, 7, 104, 2, 2, 89, 4, 3, 2, 2, 2, 90, 91, 7, 93, 2, 2, 91, 6, 3, 2, 2, 2, 92, 93, 7, 95, 2, 2, 93, 8, 3, 2, 2, 2, 94, 95, 7, 103, 2, 2, 95, 96, 7, 110, 2, 2, 96, 97, 7, 117, 2, 2, 97, 98, 7, 103, 2, 2, 98, 10, 3, 2, 2, 2, 99, 100, 7, 116, 2, 2, 100, 101, 7, 103, 2, 2, 101, 102, 7, 114, 2, 2, 102, 103, 7, 103, 2, 2, 103, 104, 7, 99, 2, 2, 104, 105, 7, 118, 2, 2, 105, 12, 3, 2, 2, 2, 106, 107, 7, 105, 2, 2, 107, 108, 7, 113, 2, 2, 108, 109, 7, 118, 2, 2, 109, 110, 7, 113, 2, 2, 110, 14, 3, 2, 2, 2, 111, 112, 7, 42, 2, 2, 112, 16, 3, 2, 2, 2, 113, 114, 7, 46, 2, 2, 114, 18, 3, 2, 2, 2, 115, 116, 7, 43, 2, 2, 116, 20, 3, 2, 2, 2, 117, 118, 7, 104, 2, 2, 118, 119, 7, 113, 2, 2, 119, 120, 7, 116, 2, 2, 120, 121, 7, 121, 2, 2, 121, 122, 7, 99, 2, 2, 122, 123, 7, 116, 2, 2, 123, 124, 7, 102, 2, 2, 124, 22, 3, 2, 2, 2, 125, 126, 7, 100, 2, 2, 126, 127, 7, 99, 2, 2, 127, 128, 7, 101, 2, 2, 128, 129, 7, 109, 2, 2, 129, 130, 7, 121, 2, 2, 130, 131, 7, 99, 2, 2, 131, 132, 7, 116, 2, 2, 132, 133, 7, 102, 2, 2, 133, 24, 3, 2, 2, 2, 134, 135, 7, 110, 2, 2, 135, 136, 7, 103, 2, 2, 136, 137, 7, 104, 2, 2, 137, 138, 7, 118, 2, 2, 138, 26, 3, 2, 2, 2, 139, 140, 7, 116, 2, 2, 140, 141, 7, 107, 2, 2, 141, 142, 7, 105, 2, 2, 142, 143, 7, 106, 2, 2, 143, 144, 7, 118, 2, 2, 144, 28, 3, 2, 2, 2, 145, 146, 7, 114, 2, 2, 146, 147, 7, 103, 2, 2, 147, 148, 7, 112, 2, 2, 148, 149, 7, 119, 2, 2, 149, 150, 7, 114, 2, 2, 150, 30, 3, 2, 2, 2, 151, 152, 7, 114, 2, 2, 152, 153, 7, 103, 2, 2, 153, 154, 7, 112, 2, 2, 154, 155, 7, 102, 2, 2, 155, 156, 7, 113, 2, 2, 156, 157, 7, 121, 2, 2, 157, 158, 7, 112, 2, 2, 158, 32, 3, 2, 2, 2, 159, 160, 7, 114, 2, 2, 160, 161, 7, 99, 2, 2, 161, 162, 7, 119, 2, 2, 162, 163, 7, 117, 2, 2, 163, 164, 7, 103, 2, 2, 164, 34, 3, 2, 2, 2, 165, 166, 7, 63, 2, 2, 166, 36, 3, 2, 2, 2, 167, 168, 7, 114, 2, 2, 168, 169, 7, 116, 2, 2, 169, 170, 7, 107, 2, 2, 170, 171, 7, 112, 2, 2, 171, 172, 7, 118, 2, 2, 172, 38, 3, 2, 2, 2, 173, 174, 7, 101, 2, 2, 174, 175, 7, 110, 2, 2, 175, 176, 7, 99, 2, 2, 176, 177, 7, 117, 2, 2, 177, 178, 7, 117, 2, 2, 178, 40, 3, 2, 2, 2, 179, 180, 7, 125, 2, 2, 180, 42, 3, 2, 2, 2, 181, 182, 7, 127, 2, 2, 182, 44, 3, 2, 2, 2, 183, 184, 7, 61, 2, 2, 184, 46, 3, 2, 2, 2, 185, 186, 7, 112, 2, 2, 186, 187, 7, 103, 2, 2, 187, 188, 7, 121, 2, 2, 188, 48, 3, 2, 2, 2, 189, 190, 7, 48, 2, 2, 190, 50, 3, 2, 2, 2, 191, 192, 7, 45, 2, 2, 192, 52, 3, 2, 2, 2, 193, 194, 7, 47, 2, 2, 194, 54, 3, 2, 2, 2, 195, 196, 7, 44, 2, 2, 196, 56, 3, 2, 2, 2, 197, 198, 7, 49, 2, 2, 198, 58, 3, 2, 2, 2, 199, 200, 7, 114, 2, 2, 200, 201, 7, 103, 2, 2, 201, 202, 7, 112, 2, 2, 202, 203, 7, 102, 2, 2, 203, 204, 7, 113, 2, 2, 204, 205, 7, 121, 2, 2, 205, 206, 7, 112, 2, 2, 206, 207, 7, 65, 2, 2, 207, 60, 3, 2, 2, 2, 208, 209, 7, 62, 2, 2, 209, 62, 3, 2, 2, 2, 210, 211, 7, 64, 2, 2, 211, 64, 3, 2, 2, 2, 212, 213, 7, 63, 2, 2, 213, 214, 7, 63, 2, 2, 214, 66, 3, 2, 2, 2, 215, 216, 7, 35, 2, 2, 216, 217, 7, 63, 2, 2, 217, 68, 3, 2, 2, 2, 218, 219, 7, 62, 2, 2, 219, 220, 7, 63, 2, 2, 220, 70, 3, 2, 2, 2, 221, 222, 7, 64, 2, 2, 222, 223, 7, 63, 2, 2, 223, 72, 3, 2, 2, 2, 224, 225, 7, 40, 2, 2, 225, 226, 7, 40, 2, 2, 226, 74, 3, 2, 2, 2, 227, 228, 7, 126, 2, 2, 228, 229, 7, 126, 2, 2, 229, 76, 3, 2, 2, 2, 230, 231, 7, 35, 2, 2, 231, 78, 3, 2, 2, 2, 232, 234, 9, 2, 2, 2, 233, 232, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 233, 3, 2, 2, 2, 235, 236, 3, 2, 2, 2, 236, 80, 3, 2, 2, 2, 237, 238, 7, 60, 2, 2, 238, 242, 9, 3, 2, 2, 239, 241, 9, 4, 2, 2, 240, 239, 3, 2, 2, 2, 241, 244, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 82, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 245, 247, 9, 5, 2, 2, 246, 245, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 84, 3, 2, 2, 2, 250, 252, 9, 6, 2, 2, 251, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 253, 254, 3, 2, 2, 2, 254, 255, 3, 2, 2, 2, 255, 256, 8, 43, 2, 2, 256, 86, 3, 2, 2, 2, 7, 2, 235, 242, 248, 253, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 46, 272, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 249, 10, 42, 13, 42, 14, 42, 250, 3, 43, 3, 43, 3, 43, 7, 43, 256, 10, 43, 12, 43, 14, 43, 259, 11, 43, 3, 44, 6, 44, 262, 10, 44, 13, 44, 14, 44, 263, 3, 45, 6, 45, 267, 10, 45, 13, 45, 14, 45, 268, 3, 45, 3, 45, 2, 2, 46, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 275, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 3, 91, 3, 2, 2, 2, 5, 94, 3, 2, 2, 2, 7, 96, 3, 2, 2, 2, 9, 98, 3, 2, 2, 2, 11, 103, 3, 2, 2, 2, 13, 110, 3, 2, 2, 2, 15, 115, 3, 2, 2, 2, 17, 117, 3, 2, 2, 2, 19, 119, 3, 2, 2, 2, 21, 121, 3, 2, 2, 2, 23, 129, 3, 2, 2, 2, 25, 138, 3, 2, 2, 2, 27, 143, 3, 2, 2, 2, 29, 149, 3, 2, 2, 2, 31, 155, 3, 2, 2, 2, 33, 163, 3, 2, 2, 2, 35, 169, 3, 2, 2, 2, 37, 171, 3, 2, 2, 2, 39, 177, 3, 2, 2, 2, 41, 183, 3, 2, 2, 2, 43, 185, 3, 2, 2, 2, 45, 187, 3, 2, 2, 2, 47, 189, 3, 2, 2, 2, 49, 193, 3, 2, 2, 2, 51, 195, 3, 2, 2, 2, 53, 199, 3, 2, 2, 2, 55, 201, 3, 2, 2, 2, 57, 203, 3, 2, 2, 2, 59, 205, 3, 2, 2, 2, 61, 207, 3, 2, 2, 2, 63, 214, 3, 2, 2, 2, 65, 223, 3, 2, 2, 2, 67, 225, 3, 2, 2, 2, 69, 227, 3, 2, 2, 2, 71, 230, 3, 2, 2, 2, 73, 233, 3, 2, 2, 2, 75, 236, 3, 2, 2, 2, 77, 239, 3, 2, 2, 2, 79, 242, 3, 2, 2, 2, 81, 245, 3, 2, 2, 2, 83, 248, 3, 2, 2, 2, 85, 252, 3, 2, 2, 2, 87, 261, 3, 2, 2, 2, 89, 266, 3, 2, 2, 2, 91, 92, 7, 107, 2, 2, 92, 93, 7, 104, 2, 2, 93, 4, 3, 2, 2, 2, 94, 95, 7, 93, 2, 2, 95, 6, 3, 2, 2, 2, 96, 97, 7, 95, 2, 2, 97, 8, 3, 2, 2, 2, 98, 99, 7, 103, 2, 2, 99, 100, 7, 110, 2, 2, 100, 101, 7, 117, 2, 2, 101, 102, 7, 103, 2, 2, 102, 10, 3, 2, 2, 2, 103, 104, 7, 116, 2, 2, 104, 105, 7, 103, 2, 2, 105, 106, 7, 114, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 99, 2, 2, 108, 109, 7, 118, 2, 2, 109, 12, 3, 2, 2, 2, 110, 111, 7, 105, 2, 2, 111, 112, 7, 113, 2, 2, 112, 113, 7, 118, 2, 2, 113, 114, 7, 113, 2, 2, 114, 14, 3, 2, 2, 2, 115, 116, 7, 42, 2, 2, 116, 16, 3, 2, 2, 2, 117, 118, 7, 46, 2, 2, 118, 18, 3, 2, 2, 2, 119, 120, 7, 43, 2, 2, 120, 20, 3, 2, 2, 2, 121, 122, 7, 104, 2, 2, 122, 123, 7, 113, 2, 2, 123, 124, 7, 116, 2, 2, 124, 125, 7, 121, 2, 2, 125, 126, 7, 99, 2, 2, 126, 127, 7, 116, 2, 2, 127, 128, 7, 102, 2, 2, 128, 22, 3, 2, 2, 2, 129, 130, 7, 100, 2, 2, 130, 131, 7, 99, 2, 2, 131, 132, 7, 101, 2, 2, 132, 133, 7, 109, 2, 2, 133, 134, 7, 121, 2, 2, 134, 135, 7, 99, 2, 2, 135, 136, 7, 116, 2, 2, 136, 137, 7, 102, 2, 2, 137, 24, 3, 2, 2, 2, 138, 139, 7, 110, 2, 2, 139, 140, 7, 103, 2, 2, 140, 141, 7, 104, 2, 2, 141, 142, 7, 118, 2, 2, 142, 26, 3, 2, 2, 2, 143, 144, 7, 116, 2, 2, 144, 145, 7, 107, 2, 2, 145, 146, 7, 105, 2, 2, 146, 147, 7, 106, 2, 2, 147, 148, 7, 118, 2, 2, 148, 28, 3, 2, 2, 2, 149, 150, 7, 114, 2, 2, 150, 151, 7, 103, 2, 2, 151, 152, 7, 112, 2, 2, 152, 153, 7, 119, 2, 2, 153, 154, 7, 114, 2, 2, 154, 30, 3, 2, 2, 2, 155, 156, 7, 114, 2, 2, 156, 157, 7, 103, 2, 2, 157, 158, 7, 112, 2, 2, 158, 159, 7, 102, 2, 2, 159, 160, 7, 113, 2, 2, 160, 161, 7, 121, 2, 2, 161, 162, 7, 112, 2, 2, 162, 32, 3, 2, 2, 2, 163, 164, 7, 114, 2, 2, 164, 165, 7, 99, 2, 2, 165, 166, 7, 119, 2, 2, 166, 167, 7, 117, 2, 2, 167, 168, 7, 103, 2, 2, 168, 34, 3, 2, 2, 2, 169, 170, 7, 63, 2, 2, 170, 36, 3, 2, 2, 2, 171, 172, 7, 114, 2, 2, 172, 173, 7, 116, 2, 2, 173, 174, 7, 107, 2, 2, 174, 175, 7, 112, 2, 2, 175, 176, 7, 118, 2, 2, 176, 38, 3, 2, 2, 2, 177, 178, 7, 101, 2, 2, 178, 179, 7, 110, 2, 2, 179, 180, 7, 99, 2, 2, 180, 181, 7, 117, 2, 2, 181, 182, 7, 117, 2, 2, 182, 40, 3, 2, 2, 2, 183, 184, 7, 125, 2, 2, 184, 42, 3, 2, 2, 2, 185, 186, 7, 127, 2, 2, 186, 44, 3, 2, 2, 2, 187, 188, 7, 61, 2, 2, 188, 46, 3, 2, 2, 2, 189, 190, 7, 112, 2, 2, 190, 191, 7, 103, 2, 2, 191, 192, 7, 121, 2, 2, 192, 48, 3, 2, 2, 2, 193, 194, 7, 48, 2, 2, 194, 50, 3, 2, 2, 2, 195, 196, 7, 102, 2, 2, 196, 197, 7, 103, 2, 2, 197, 198, 7, 104, 2, 2, 198, 52, 3, 2, 2, 2, 199, 200, 7, 45, 2, 2, 200, 54, 3, 2, 2, 2, 201, 202, 7, 47, 2, 2, 202, 56, 3, 2, 2, 2, 203, 204, 7, 44, 2, 2, 204, 58, 3, 2, 2, 2, 205, 206, 7, 49, 2, 2, 206, 60, 3, 2, 2, 2, 207, 208, 7, 116, 2, 2, 208, 209, 7, 103, 2, 2, 209, 210, 7, 118, 2, 2, 210, 211, 7, 119, 2, 2, 211, 212, 7, 116, 2, 2, 212, 213, 7, 112, 2, 2, 213, 62, 3, 2, 2, 2, 214, 215, 7, 114, 2, 2, 215, 216, 7, 103, 2, 2, 216, 217, 7, 112, 2, 2, 217, 218, 7, 102, 2, 2, 218, 219, 7, 113, 2, 2, 219, 220, 7, 121, 2, 2, 220, 221, 7, 112, 2, 2, 221, 222, 7, 65, 2, 2, 222, 64, 3, 2, 2, 2, 223, 224, 7, 62, 2, 2, 224, 66, 3, 2, 2, 2, 225, 226, 7, 64, 2, 2, 226, 68, 3, 2, 2, 2, 227, 228, 7, 63, 2, 2, 228, 229, 7, 63, 2, 2, 229, 70, 3, 2, 2, 2, 230, 231, 7, 35, 2, 2, 231, 232, 7, 63, 2, 2, 232, 72, 3, 2, 2, 2, 233, 234, 7, 62, 2, 2, 234, 235, 7, 63, 2, 2, 235, 74, 3, 2, 2, 2, 236, 237, 7, 64, 2, 2, 237, 238, 7, 63, 2, 2, 238, 76, 3, 2, 2, 2, 239, 240, 7, 40, 2, 2, 240, 241, 7, 40, 2, 2, 241, 78, 3, 2, 2, 2, 242, 243, 7, 126, 2, 2, 243, 244, 7, 126, 2, 2, 244, 80, 3, 2, 2, 2, 245, 246, 7, 35, 2, 2, 246, 82, 3, 2, 2, 2, 247, 249, 9, 2, 2, 2, 248, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 250, 251, 3, 2, 2, 2, 251, 84, 3, 2, 2, 2, 252, 253, 7, 60, 2, 2, 253, 257, 9, 3, 2, 2, 254, 256, 9, 4, 2, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 86, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 262, 9, 5, 2, 2, 261, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 88, 3, 2, 2, 2, 265, 267, 9, 6, 2, 2, 266, 265, 3, 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 270, 3, 2, 2, 2, 270, 271, 8, 45, 2, 2, 271, 90, 3, 2, 2, 2, 7, 2, 250, 257, 263, 268, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index eae773c..b315881 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -8,107 +8,113 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2,") - buf.write("\u0101\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2.") + buf.write("\u0110\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") buf.write("\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36") buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%") - buf.write("\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\3\2\3\2\3\2\3\3") - buf.write("\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3") - buf.write("\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\t\3\t\3\n\3\n\3\13") - buf.write("\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3") - buf.write("\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16") - buf.write("\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20") - buf.write("\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21") - buf.write("\3\21\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\24\3\24") - buf.write("\3\24\3\24\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\30") - buf.write("\3\30\3\30\3\30\3\31\3\31\3\32\3\32\3\33\3\33\3\34\3\34") - buf.write("\3\35\3\35\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36") - buf.write("\3\37\3\37\3 \3 \3!\3!\3!\3\"\3\"\3\"\3#\3#\3#\3$\3$\3") - buf.write("$\3%\3%\3%\3&\3&\3&\3\'\3\'\3(\6(\u00ea\n(\r(\16(\u00eb") - buf.write("\3)\3)\3)\7)\u00f1\n)\f)\16)\u00f4\13)\3*\6*\u00f7\n*") - buf.write("\r*\16*\u00f8\3+\6+\u00fc\n+\r+\16+\u00fd\3+\3+\2\2,\3") - buf.write("\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16") - buf.write("\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61") - buf.write("\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*") - buf.write("S+U,\3\2\7\3\2\62;\5\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5") - buf.write("\2\13\f\17\17\"\"\2\u0104\2\3\3\2\2\2\2\5\3\2\2\2\2\7") - buf.write("\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2") - buf.write("\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2") - buf.write("\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2") - buf.write("\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2") - buf.write("\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63") - buf.write("\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2") - buf.write("\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2") - buf.write("\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3") - buf.write("\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\3W\3\2\2\2\5Z") - buf.write("\3\2\2\2\7\\\3\2\2\2\t^\3\2\2\2\13c\3\2\2\2\rj\3\2\2\2") - buf.write("\17o\3\2\2\2\21q\3\2\2\2\23s\3\2\2\2\25u\3\2\2\2\27}\3") - buf.write("\2\2\2\31\u0086\3\2\2\2\33\u008b\3\2\2\2\35\u0091\3\2") - buf.write("\2\2\37\u0097\3\2\2\2!\u009f\3\2\2\2#\u00a5\3\2\2\2%\u00a7") - buf.write("\3\2\2\2\'\u00ad\3\2\2\2)\u00b3\3\2\2\2+\u00b5\3\2\2\2") - buf.write("-\u00b7\3\2\2\2/\u00b9\3\2\2\2\61\u00bd\3\2\2\2\63\u00bf") - buf.write("\3\2\2\2\65\u00c1\3\2\2\2\67\u00c3\3\2\2\29\u00c5\3\2") - buf.write("\2\2;\u00c7\3\2\2\2=\u00d0\3\2\2\2?\u00d2\3\2\2\2A\u00d4") - buf.write("\3\2\2\2C\u00d7\3\2\2\2E\u00da\3\2\2\2G\u00dd\3\2\2\2") - buf.write("I\u00e0\3\2\2\2K\u00e3\3\2\2\2M\u00e6\3\2\2\2O\u00e9\3") - buf.write("\2\2\2Q\u00ed\3\2\2\2S\u00f6\3\2\2\2U\u00fb\3\2\2\2WX") - buf.write("\7k\2\2XY\7h\2\2Y\4\3\2\2\2Z[\7]\2\2[\6\3\2\2\2\\]\7_") - buf.write("\2\2]\b\3\2\2\2^_\7g\2\2_`\7n\2\2`a\7u\2\2ab\7g\2\2b\n") - buf.write("\3\2\2\2cd\7t\2\2de\7g\2\2ef\7r\2\2fg\7g\2\2gh\7c\2\2") - buf.write("hi\7v\2\2i\f\3\2\2\2jk\7i\2\2kl\7q\2\2lm\7v\2\2mn\7q\2") - buf.write("\2n\16\3\2\2\2op\7*\2\2p\20\3\2\2\2qr\7.\2\2r\22\3\2\2") - buf.write("\2st\7+\2\2t\24\3\2\2\2uv\7h\2\2vw\7q\2\2wx\7t\2\2xy\7") - buf.write("y\2\2yz\7c\2\2z{\7t\2\2{|\7f\2\2|\26\3\2\2\2}~\7d\2\2") - buf.write("~\177\7c\2\2\177\u0080\7e\2\2\u0080\u0081\7m\2\2\u0081") - buf.write("\u0082\7y\2\2\u0082\u0083\7c\2\2\u0083\u0084\7t\2\2\u0084") - buf.write("\u0085\7f\2\2\u0085\30\3\2\2\2\u0086\u0087\7n\2\2\u0087") - buf.write("\u0088\7g\2\2\u0088\u0089\7h\2\2\u0089\u008a\7v\2\2\u008a") - buf.write("\32\3\2\2\2\u008b\u008c\7t\2\2\u008c\u008d\7k\2\2\u008d") - buf.write("\u008e\7i\2\2\u008e\u008f\7j\2\2\u008f\u0090\7v\2\2\u0090") - buf.write("\34\3\2\2\2\u0091\u0092\7r\2\2\u0092\u0093\7g\2\2\u0093") - buf.write("\u0094\7p\2\2\u0094\u0095\7w\2\2\u0095\u0096\7r\2\2\u0096") - buf.write("\36\3\2\2\2\u0097\u0098\7r\2\2\u0098\u0099\7g\2\2\u0099") - buf.write("\u009a\7p\2\2\u009a\u009b\7f\2\2\u009b\u009c\7q\2\2\u009c") - buf.write("\u009d\7y\2\2\u009d\u009e\7p\2\2\u009e \3\2\2\2\u009f") - buf.write("\u00a0\7r\2\2\u00a0\u00a1\7c\2\2\u00a1\u00a2\7w\2\2\u00a2") - buf.write("\u00a3\7u\2\2\u00a3\u00a4\7g\2\2\u00a4\"\3\2\2\2\u00a5") - buf.write("\u00a6\7?\2\2\u00a6$\3\2\2\2\u00a7\u00a8\7r\2\2\u00a8") - buf.write("\u00a9\7t\2\2\u00a9\u00aa\7k\2\2\u00aa\u00ab\7p\2\2\u00ab") - buf.write("\u00ac\7v\2\2\u00ac&\3\2\2\2\u00ad\u00ae\7e\2\2\u00ae") - buf.write("\u00af\7n\2\2\u00af\u00b0\7c\2\2\u00b0\u00b1\7u\2\2\u00b1") - buf.write("\u00b2\7u\2\2\u00b2(\3\2\2\2\u00b3\u00b4\7}\2\2\u00b4") - buf.write("*\3\2\2\2\u00b5\u00b6\7\177\2\2\u00b6,\3\2\2\2\u00b7\u00b8") - buf.write("\7=\2\2\u00b8.\3\2\2\2\u00b9\u00ba\7p\2\2\u00ba\u00bb") - buf.write("\7g\2\2\u00bb\u00bc\7y\2\2\u00bc\60\3\2\2\2\u00bd\u00be") - buf.write("\7\60\2\2\u00be\62\3\2\2\2\u00bf\u00c0\7-\2\2\u00c0\64") - buf.write("\3\2\2\2\u00c1\u00c2\7/\2\2\u00c2\66\3\2\2\2\u00c3\u00c4") - buf.write("\7,\2\2\u00c48\3\2\2\2\u00c5\u00c6\7\61\2\2\u00c6:\3\2") - buf.write("\2\2\u00c7\u00c8\7r\2\2\u00c8\u00c9\7g\2\2\u00c9\u00ca") - buf.write("\7p\2\2\u00ca\u00cb\7f\2\2\u00cb\u00cc\7q\2\2\u00cc\u00cd") - buf.write("\7y\2\2\u00cd\u00ce\7p\2\2\u00ce\u00cf\7A\2\2\u00cf<\3") - buf.write("\2\2\2\u00d0\u00d1\7>\2\2\u00d1>\3\2\2\2\u00d2\u00d3\7") - buf.write("@\2\2\u00d3@\3\2\2\2\u00d4\u00d5\7?\2\2\u00d5\u00d6\7") - buf.write("?\2\2\u00d6B\3\2\2\2\u00d7\u00d8\7#\2\2\u00d8\u00d9\7") - buf.write("?\2\2\u00d9D\3\2\2\2\u00da\u00db\7>\2\2\u00db\u00dc\7") - buf.write("?\2\2\u00dcF\3\2\2\2\u00dd\u00de\7@\2\2\u00de\u00df\7") - buf.write("?\2\2\u00dfH\3\2\2\2\u00e0\u00e1\7(\2\2\u00e1\u00e2\7") - buf.write("(\2\2\u00e2J\3\2\2\2\u00e3\u00e4\7~\2\2\u00e4\u00e5\7") - buf.write("~\2\2\u00e5L\3\2\2\2\u00e6\u00e7\7#\2\2\u00e7N\3\2\2\2") - buf.write("\u00e8\u00ea\t\2\2\2\u00e9\u00e8\3\2\2\2\u00ea\u00eb\3") - buf.write("\2\2\2\u00eb\u00e9\3\2\2\2\u00eb\u00ec\3\2\2\2\u00ecP") - buf.write("\3\2\2\2\u00ed\u00ee\7<\2\2\u00ee\u00f2\t\3\2\2\u00ef") - buf.write("\u00f1\t\4\2\2\u00f0\u00ef\3\2\2\2\u00f1\u00f4\3\2\2\2") - buf.write("\u00f2\u00f0\3\2\2\2\u00f2\u00f3\3\2\2\2\u00f3R\3\2\2") - buf.write("\2\u00f4\u00f2\3\2\2\2\u00f5\u00f7\t\5\2\2\u00f6\u00f5") - buf.write("\3\2\2\2\u00f7\u00f8\3\2\2\2\u00f8\u00f6\3\2\2\2\u00f8") - buf.write("\u00f9\3\2\2\2\u00f9T\3\2\2\2\u00fa\u00fc\t\6\2\2\u00fb") - buf.write("\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\u00fb\3\2\2\2") - buf.write("\u00fd\u00fe\3\2\2\2\u00fe\u00ff\3\2\2\2\u00ff\u0100\b") - buf.write("+\2\2\u0100V\3\2\2\2\7\2\u00eb\u00f2\u00f8\u00fd\3\b\2") - buf.write("\2") + buf.write("\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\3\2") + buf.write("\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3") + buf.write("\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\t\3\t") + buf.write("\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3") + buf.write("\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\16") + buf.write("\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17") + buf.write("\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21") + buf.write("\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23") + buf.write("\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\26\3\26\3\27") + buf.write("\3\27\3\30\3\30\3\30\3\30\3\31\3\31\3\32\3\32\3\32\3\32") + buf.write("\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3\37") + buf.write("\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3 \3 \3 \3 \3 \3!\3!") + buf.write("\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3&\3&\3&\3\'\3\'\3") + buf.write("\'\3(\3(\3(\3)\3)\3*\6*\u00f9\n*\r*\16*\u00fa\3+\3+\3") + buf.write("+\7+\u0100\n+\f+\16+\u0103\13+\3,\6,\u0106\n,\r,\16,\u0107") + buf.write("\3-\6-\u010b\n-\r-\16-\u010c\3-\3-\2\2.\3\3\5\4\7\5\t") + buf.write("\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20") + buf.write("\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65") + buf.write("\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.\3\2") + buf.write("\7\3\2\62;\5\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5\2\13\f\17") + buf.write("\17\"\"\2\u0113\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2") + buf.write("\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21") + buf.write("\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3") + buf.write("\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2") + buf.write("\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2") + buf.write("\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2") + buf.write("\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2") + buf.write("\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3") + buf.write("\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q") + buf.write("\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\3") + buf.write("[\3\2\2\2\5^\3\2\2\2\7`\3\2\2\2\tb\3\2\2\2\13g\3\2\2\2") + buf.write("\rn\3\2\2\2\17s\3\2\2\2\21u\3\2\2\2\23w\3\2\2\2\25y\3") + buf.write("\2\2\2\27\u0081\3\2\2\2\31\u008a\3\2\2\2\33\u008f\3\2") + buf.write("\2\2\35\u0095\3\2\2\2\37\u009b\3\2\2\2!\u00a3\3\2\2\2") + buf.write("#\u00a9\3\2\2\2%\u00ab\3\2\2\2\'\u00b1\3\2\2\2)\u00b7") + buf.write("\3\2\2\2+\u00b9\3\2\2\2-\u00bb\3\2\2\2/\u00bd\3\2\2\2") + buf.write("\61\u00c1\3\2\2\2\63\u00c3\3\2\2\2\65\u00c7\3\2\2\2\67") + buf.write("\u00c9\3\2\2\29\u00cb\3\2\2\2;\u00cd\3\2\2\2=\u00cf\3") + buf.write("\2\2\2?\u00d6\3\2\2\2A\u00df\3\2\2\2C\u00e1\3\2\2\2E\u00e3") + buf.write("\3\2\2\2G\u00e6\3\2\2\2I\u00e9\3\2\2\2K\u00ec\3\2\2\2") + buf.write("M\u00ef\3\2\2\2O\u00f2\3\2\2\2Q\u00f5\3\2\2\2S\u00f8\3") + buf.write("\2\2\2U\u00fc\3\2\2\2W\u0105\3\2\2\2Y\u010a\3\2\2\2[\\") + buf.write("\7k\2\2\\]\7h\2\2]\4\3\2\2\2^_\7]\2\2_\6\3\2\2\2`a\7_") + buf.write("\2\2a\b\3\2\2\2bc\7g\2\2cd\7n\2\2de\7u\2\2ef\7g\2\2f\n") + buf.write("\3\2\2\2gh\7t\2\2hi\7g\2\2ij\7r\2\2jk\7g\2\2kl\7c\2\2") + buf.write("lm\7v\2\2m\f\3\2\2\2no\7i\2\2op\7q\2\2pq\7v\2\2qr\7q\2") + buf.write("\2r\16\3\2\2\2st\7*\2\2t\20\3\2\2\2uv\7.\2\2v\22\3\2\2") + buf.write("\2wx\7+\2\2x\24\3\2\2\2yz\7h\2\2z{\7q\2\2{|\7t\2\2|}\7") + buf.write("y\2\2}~\7c\2\2~\177\7t\2\2\177\u0080\7f\2\2\u0080\26\3") + buf.write("\2\2\2\u0081\u0082\7d\2\2\u0082\u0083\7c\2\2\u0083\u0084") + buf.write("\7e\2\2\u0084\u0085\7m\2\2\u0085\u0086\7y\2\2\u0086\u0087") + buf.write("\7c\2\2\u0087\u0088\7t\2\2\u0088\u0089\7f\2\2\u0089\30") + buf.write("\3\2\2\2\u008a\u008b\7n\2\2\u008b\u008c\7g\2\2\u008c\u008d") + buf.write("\7h\2\2\u008d\u008e\7v\2\2\u008e\32\3\2\2\2\u008f\u0090") + buf.write("\7t\2\2\u0090\u0091\7k\2\2\u0091\u0092\7i\2\2\u0092\u0093") + buf.write("\7j\2\2\u0093\u0094\7v\2\2\u0094\34\3\2\2\2\u0095\u0096") + buf.write("\7r\2\2\u0096\u0097\7g\2\2\u0097\u0098\7p\2\2\u0098\u0099") + buf.write("\7w\2\2\u0099\u009a\7r\2\2\u009a\36\3\2\2\2\u009b\u009c") + buf.write("\7r\2\2\u009c\u009d\7g\2\2\u009d\u009e\7p\2\2\u009e\u009f") + buf.write("\7f\2\2\u009f\u00a0\7q\2\2\u00a0\u00a1\7y\2\2\u00a1\u00a2") + buf.write("\7p\2\2\u00a2 \3\2\2\2\u00a3\u00a4\7r\2\2\u00a4\u00a5") + buf.write("\7c\2\2\u00a5\u00a6\7w\2\2\u00a6\u00a7\7u\2\2\u00a7\u00a8") + buf.write("\7g\2\2\u00a8\"\3\2\2\2\u00a9\u00aa\7?\2\2\u00aa$\3\2") + buf.write("\2\2\u00ab\u00ac\7r\2\2\u00ac\u00ad\7t\2\2\u00ad\u00ae") + buf.write("\7k\2\2\u00ae\u00af\7p\2\2\u00af\u00b0\7v\2\2\u00b0&\3") + buf.write("\2\2\2\u00b1\u00b2\7e\2\2\u00b2\u00b3\7n\2\2\u00b3\u00b4") + buf.write("\7c\2\2\u00b4\u00b5\7u\2\2\u00b5\u00b6\7u\2\2\u00b6(\3") + buf.write("\2\2\2\u00b7\u00b8\7}\2\2\u00b8*\3\2\2\2\u00b9\u00ba\7") + buf.write("\177\2\2\u00ba,\3\2\2\2\u00bb\u00bc\7=\2\2\u00bc.\3\2") + buf.write("\2\2\u00bd\u00be\7p\2\2\u00be\u00bf\7g\2\2\u00bf\u00c0") + buf.write("\7y\2\2\u00c0\60\3\2\2\2\u00c1\u00c2\7\60\2\2\u00c2\62") + buf.write("\3\2\2\2\u00c3\u00c4\7f\2\2\u00c4\u00c5\7g\2\2\u00c5\u00c6") + buf.write("\7h\2\2\u00c6\64\3\2\2\2\u00c7\u00c8\7-\2\2\u00c8\66\3") + buf.write("\2\2\2\u00c9\u00ca\7/\2\2\u00ca8\3\2\2\2\u00cb\u00cc\7") + buf.write(",\2\2\u00cc:\3\2\2\2\u00cd\u00ce\7\61\2\2\u00ce<\3\2\2") + buf.write("\2\u00cf\u00d0\7t\2\2\u00d0\u00d1\7g\2\2\u00d1\u00d2\7") + buf.write("v\2\2\u00d2\u00d3\7w\2\2\u00d3\u00d4\7t\2\2\u00d4\u00d5") + buf.write("\7p\2\2\u00d5>\3\2\2\2\u00d6\u00d7\7r\2\2\u00d7\u00d8") + buf.write("\7g\2\2\u00d8\u00d9\7p\2\2\u00d9\u00da\7f\2\2\u00da\u00db") + buf.write("\7q\2\2\u00db\u00dc\7y\2\2\u00dc\u00dd\7p\2\2\u00dd\u00de") + buf.write("\7A\2\2\u00de@\3\2\2\2\u00df\u00e0\7>\2\2\u00e0B\3\2\2") + buf.write("\2\u00e1\u00e2\7@\2\2\u00e2D\3\2\2\2\u00e3\u00e4\7?\2") + buf.write("\2\u00e4\u00e5\7?\2\2\u00e5F\3\2\2\2\u00e6\u00e7\7#\2") + buf.write("\2\u00e7\u00e8\7?\2\2\u00e8H\3\2\2\2\u00e9\u00ea\7>\2") + buf.write("\2\u00ea\u00eb\7?\2\2\u00ebJ\3\2\2\2\u00ec\u00ed\7@\2") + buf.write("\2\u00ed\u00ee\7?\2\2\u00eeL\3\2\2\2\u00ef\u00f0\7(\2") + buf.write("\2\u00f0\u00f1\7(\2\2\u00f1N\3\2\2\2\u00f2\u00f3\7~\2") + buf.write("\2\u00f3\u00f4\7~\2\2\u00f4P\3\2\2\2\u00f5\u00f6\7#\2") + buf.write("\2\u00f6R\3\2\2\2\u00f7\u00f9\t\2\2\2\u00f8\u00f7\3\2") + buf.write("\2\2\u00f9\u00fa\3\2\2\2\u00fa\u00f8\3\2\2\2\u00fa\u00fb") + buf.write("\3\2\2\2\u00fbT\3\2\2\2\u00fc\u00fd\7<\2\2\u00fd\u0101") + buf.write("\t\3\2\2\u00fe\u0100\t\4\2\2\u00ff\u00fe\3\2\2\2\u0100") + buf.write("\u0103\3\2\2\2\u0101\u00ff\3\2\2\2\u0101\u0102\3\2\2\2") + buf.write("\u0102V\3\2\2\2\u0103\u0101\3\2\2\2\u0104\u0106\t\5\2") + buf.write("\2\u0105\u0104\3\2\2\2\u0106\u0107\3\2\2\2\u0107\u0105") + buf.write("\3\2\2\2\u0107\u0108\3\2\2\2\u0108X\3\2\2\2\u0109\u010b") + buf.write("\t\6\2\2\u010a\u0109\3\2\2\2\u010b\u010c\3\2\2\2\u010c") + buf.write("\u010a\3\2\2\2\u010c\u010d\3\2\2\2\u010d\u010e\3\2\2\2") + buf.write("\u010e\u010f\b-\2\2\u010fZ\3\2\2\2\7\2\u00fa\u0101\u0107") + buf.write("\u010c\3\b\2\2") return buf.getvalue() @@ -142,24 +148,26 @@ class tlangLexer(Lexer): T__21 = 22 T__22 = 23 T__23 = 24 - PLUS = 25 - MINUS = 26 - MUL = 27 - DIV = 28 - PENCOND = 29 - LT = 30 - GT = 31 - EQ = 32 - NEQ = 33 - LTE = 34 - GTE = 35 - AND = 36 - OR = 37 - NOT = 38 - NUM = 39 - VAR = 40 - NAME = 41 - Whitespace = 42 + T__24 = 25 + PLUS = 26 + MINUS = 27 + MUL = 28 + DIV = 29 + RETURN = 30 + PENCOND = 31 + LT = 32 + GT = 33 + EQ = 34 + NEQ = 35 + LTE = 36 + GTE = 37 + AND = 38 + OR = 39 + NOT = 40 + NUM = 41 + VAR = 42 + NAME = 43 + Whitespace = 44 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] @@ -169,21 +177,22 @@ class tlangLexer(Lexer): "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'class'", - "'{'", "'}'", "';'", "'new'", "'.'", "'+'", "'-'", "'*'", "'/'", - "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", "'>='", - "'&&'", "'||'", "'!'" ] + "'{'", "'}'", "';'", "'new'", "'.'", "'def'", "'+'", "'-'", + "'*'", "'/'", "'return'", "'pendown?'", "'<'", "'>'", "'=='", + "'!='", "'<='", "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", - "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", - "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", - "Whitespace" ] + "PLUS", "MINUS", "MUL", "DIV", "RETURN", "PENCOND", "LT", "GT", + "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "VAR", + "NAME", "Whitespace" ] ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", - "T__20", "T__21", "T__22", "T__23", "PLUS", "MINUS", "MUL", - "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", "GTE", - "AND", "OR", "NOT", "NUM", "VAR", "NAME", "Whitespace" ] + "T__20", "T__21", "T__22", "T__23", "T__24", "PLUS", "MINUS", + "MUL", "DIV", "RETURN", "PENCOND", "LT", "GT", "EQ", "NEQ", + "LTE", "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", + "Whitespace" ] grammarFileName = "tlang.g4" diff --git a/ChironCore/turtparse/tlangLexer.tokens b/ChironCore/turtparse/tlangLexer.tokens index f6b3f9b..eb1b614 100644 --- a/ChironCore/turtparse/tlangLexer.tokens +++ b/ChironCore/turtparse/tlangLexer.tokens @@ -22,24 +22,26 @@ T__20=21 T__21=22 T__22=23 T__23=24 -PLUS=25 -MINUS=26 -MUL=27 -DIV=28 -PENCOND=29 -LT=30 -GT=31 -EQ=32 -NEQ=33 -LTE=34 -GTE=35 -AND=36 -OR=37 -NOT=38 -NUM=39 -VAR=40 -NAME=41 -Whitespace=42 +T__24=25 +PLUS=26 +MINUS=27 +MUL=28 +DIV=29 +RETURN=30 +PENCOND=31 +LT=32 +GT=33 +EQ=34 +NEQ=35 +LTE=36 +GTE=37 +AND=38 +OR=39 +NOT=40 +NUM=41 +VAR=42 +NAME=43 +Whitespace=44 'if'=1 '['=2 ']'=3 @@ -64,17 +66,19 @@ Whitespace=42 ';'=22 'new'=23 '.'=24 -'+'=25 -'-'=26 -'*'=27 -'/'=28 -'pendown?'=29 -'<'=30 -'>'=31 -'=='=32 -'!='=33 -'<='=34 -'>='=35 -'&&'=36 -'||'=37 -'!'=38 +'def'=25 +'+'=26 +'-'=27 +'*'=28 +'/'=29 +'return'=30 +'pendown?'=31 +'<'=32 +'>'=33 +'=='=34 +'!='=35 +'<='=36 +'>='=37 +'&&'=38 +'||'=39 +'!'=40 diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index 404d8aa..49a99ed 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -8,115 +8,136 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3,") - buf.write("\u0107\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3.") + buf.write("\u0134\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36") - buf.write("\4\37\t\37\3\2\3\2\3\2\3\3\7\3C\n\3\f\3\16\3F\13\3\3\4") - buf.write("\6\4I\n\4\r\4\16\4J\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3") - buf.write("\5\3\5\5\5W\n\5\3\6\3\6\5\6[\n\6\3\7\3\7\3\7\3\7\3\7\3") - buf.write("\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t") - buf.write("\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13") - buf.write("\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17\3\17\3\17\7\17\u0087") - buf.write("\n\17\f\17\16\17\u008a\13\17\5\17\u008c\n\17\3\17\3\17") - buf.write("\3\20\3\20\5\20\u0092\n\20\3\20\3\20\3\20\3\21\3\21\3") - buf.write("\21\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25") - buf.write("\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u00ad") - buf.write("\n\25\3\25\3\25\5\25\u00b1\n\25\3\25\3\25\3\25\3\25\3") - buf.write("\25\3\25\3\25\3\25\7\25\u00bb\n\25\f\25\16\25\u00be\13") - buf.write("\25\3\26\3\26\3\26\3\26\3\26\3\26\3\27\7\27\u00c7\n\27") - buf.write("\f\27\16\27\u00ca\13\27\3\30\3\30\3\30\3\31\3\31\5\31") - buf.write("\u00d1\n\31\3\31\3\31\3\31\3\31\3\31\3\31\3\32\3\32\3") - buf.write("\32\3\32\3\32\3\32\3\32\6\32\u00e0\n\32\r\32\16\32\u00e1") - buf.write("\3\33\3\33\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\34") - buf.write("\3\34\3\34\3\34\5\34\u00f2\n\34\3\34\3\34\3\34\3\34\7") - buf.write("\34\u00f8\n\34\f\34\16\34\u00fb\13\34\3\35\3\35\3\36\3") - buf.write("\36\3\37\3\37\3\37\3\37\5\37\u0105\n\37\3\37\2\4(\66 ") - buf.write("\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62") - buf.write("\64\668:<\2\b\3\2\f\17\3\2\20\21\3\2\35\36\3\2\33\34\3") - buf.write("\2 %\3\2&\'\2\u0108\2>\3\2\2\2\4D\3\2\2\2\6H\3\2\2\2\b") - buf.write("V\3\2\2\2\nZ\3\2\2\2\f\\\3\2\2\2\16b\3\2\2\2\20l\3\2\2") - buf.write("\2\22r\3\2\2\2\24y\3\2\2\2\26|\3\2\2\2\30~\3\2\2\2\32") - buf.write("\u0080\3\2\2\2\34\u0082\3\2\2\2\36\u0091\3\2\2\2 \u0096") - buf.write("\3\2\2\2\"\u009b\3\2\2\2$\u009d\3\2\2\2&\u009f\3\2\2\2") - buf.write("(\u00b0\3\2\2\2*\u00bf\3\2\2\2,\u00c8\3\2\2\2.\u00cb\3") - buf.write("\2\2\2\60\u00d0\3\2\2\2\62\u00d8\3\2\2\2\64\u00e3\3\2") - buf.write("\2\2\66\u00f1\3\2\2\28\u00fc\3\2\2\2:\u00fe\3\2\2\2<\u0104") - buf.write("\3\2\2\2>?\5\4\3\2?@\7\2\2\3@\3\3\2\2\2AC\5\b\5\2BA\3") - buf.write("\2\2\2CF\3\2\2\2DB\3\2\2\2DE\3\2\2\2E\5\3\2\2\2FD\3\2") - buf.write("\2\2GI\5\b\5\2HG\3\2\2\2IJ\3\2\2\2JH\3\2\2\2JK\3\2\2\2") - buf.write("K\7\3\2\2\2LW\5\36\20\2MW\5 \21\2NW\5\n\6\2OW\5\20\t\2") - buf.write("PW\5\24\13\2QW\5\30\r\2RW\5\22\n\2SW\5\32\16\2TW\5*\26") - buf.write("\2UW\5\60\31\2VL\3\2\2\2VM\3\2\2\2VN\3\2\2\2VO\3\2\2\2") - buf.write("VP\3\2\2\2VQ\3\2\2\2VR\3\2\2\2VS\3\2\2\2VT\3\2\2\2VU\3") - buf.write("\2\2\2W\t\3\2\2\2X[\5\f\7\2Y[\5\16\b\2ZX\3\2\2\2ZY\3\2") - buf.write("\2\2[\13\3\2\2\2\\]\7\3\2\2]^\5\66\34\2^_\7\4\2\2_`\5") - buf.write("\6\4\2`a\7\5\2\2a\r\3\2\2\2bc\7\3\2\2cd\5\66\34\2de\7") - buf.write("\4\2\2ef\5\6\4\2fg\7\5\2\2gh\7\6\2\2hi\7\4\2\2ij\5\6\4") - buf.write("\2jk\7\5\2\2k\17\3\2\2\2lm\7\7\2\2mn\5<\37\2no\7\4\2\2") - buf.write("op\5\6\4\2pq\7\5\2\2q\21\3\2\2\2rs\7\b\2\2st\7\t\2\2t") - buf.write("u\5(\25\2uv\7\n\2\2vw\5(\25\2wx\7\13\2\2x\23\3\2\2\2y") - buf.write("z\5\26\f\2z{\5(\25\2{\25\3\2\2\2|}\t\2\2\2}\27\3\2\2\2") - buf.write("~\177\t\3\2\2\177\31\3\2\2\2\u0080\u0081\7\22\2\2\u0081") - buf.write("\33\3\2\2\2\u0082\u008b\7\4\2\2\u0083\u0088\5(\25\2\u0084") - buf.write("\u0085\7\n\2\2\u0085\u0087\5(\25\2\u0086\u0084\3\2\2\2") - buf.write("\u0087\u008a\3\2\2\2\u0088\u0086\3\2\2\2\u0088\u0089\3") - buf.write("\2\2\2\u0089\u008c\3\2\2\2\u008a\u0088\3\2\2\2\u008b\u0083") - buf.write("\3\2\2\2\u008b\u008c\3\2\2\2\u008c\u008d\3\2\2\2\u008d") - buf.write("\u008e\7\5\2\2\u008e\35\3\2\2\2\u008f\u0092\7*\2\2\u0090") - buf.write("\u0092\5\62\32\2\u0091\u008f\3\2\2\2\u0091\u0090\3\2\2") - buf.write("\2\u0092\u0093\3\2\2\2\u0093\u0094\7\23\2\2\u0094\u0095") - buf.write("\5(\25\2\u0095\37\3\2\2\2\u0096\u0097\7\24\2\2\u0097\u0098") - buf.write("\7\t\2\2\u0098\u0099\5(\25\2\u0099\u009a\7\13\2\2\u009a") - buf.write("!\3\2\2\2\u009b\u009c\t\4\2\2\u009c#\3\2\2\2\u009d\u009e") - buf.write("\t\5\2\2\u009e%\3\2\2\2\u009f\u00a0\7\34\2\2\u00a0\'\3") - buf.write("\2\2\2\u00a1\u00a2\b\25\1\2\u00a2\u00a3\5&\24\2\u00a3") - buf.write("\u00a4\5(\25\b\u00a4\u00b1\3\2\2\2\u00a5\u00a6\7\t\2\2") - buf.write("\u00a6\u00a7\5(\25\2\u00a7\u00a8\7\13\2\2\u00a8\u00b1") - buf.write("\3\2\2\2\u00a9\u00b1\5<\37\2\u00aa\u00ad\7*\2\2\u00ab") - buf.write("\u00ad\5\62\32\2\u00ac\u00aa\3\2\2\2\u00ac\u00ab\3\2\2") - buf.write("\2\u00ad\u00ae\3\2\2\2\u00ae\u00af\7\23\2\2\u00af\u00b1") - buf.write("\5(\25\3\u00b0\u00a1\3\2\2\2\u00b0\u00a5\3\2\2\2\u00b0") - buf.write("\u00a9\3\2\2\2\u00b0\u00ac\3\2\2\2\u00b1\u00bc\3\2\2\2") - buf.write("\u00b2\u00b3\f\7\2\2\u00b3\u00b4\5\"\22\2\u00b4\u00b5") - buf.write("\5(\25\b\u00b5\u00bb\3\2\2\2\u00b6\u00b7\f\6\2\2\u00b7") - buf.write("\u00b8\5$\23\2\u00b8\u00b9\5(\25\7\u00b9\u00bb\3\2\2\2") - buf.write("\u00ba\u00b2\3\2\2\2\u00ba\u00b6\3\2\2\2\u00bb\u00be\3") - buf.write("\2\2\2\u00bc\u00ba\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd)") - buf.write("\3\2\2\2\u00be\u00bc\3\2\2\2\u00bf\u00c0\7\25\2\2\u00c0") - buf.write("\u00c1\7*\2\2\u00c1\u00c2\7\26\2\2\u00c2\u00c3\5,\27\2") - buf.write("\u00c3\u00c4\7\27\2\2\u00c4+\3\2\2\2\u00c5\u00c7\5.\30") - buf.write("\2\u00c6\u00c5\3\2\2\2\u00c7\u00ca\3\2\2\2\u00c8\u00c6") - buf.write("\3\2\2\2\u00c8\u00c9\3\2\2\2\u00c9-\3\2\2\2\u00ca\u00c8") - buf.write("\3\2\2\2\u00cb\u00cc\5\36\20\2\u00cc\u00cd\7\30\2\2\u00cd") - buf.write("/\3\2\2\2\u00ce\u00d1\7*\2\2\u00cf\u00d1\5\62\32\2\u00d0") - buf.write("\u00ce\3\2\2\2\u00d0\u00cf\3\2\2\2\u00d1\u00d2\3\2\2\2") - buf.write("\u00d2\u00d3\7\23\2\2\u00d3\u00d4\7\31\2\2\u00d4\u00d5") - buf.write("\7*\2\2\u00d5\u00d6\7\t\2\2\u00d6\u00d7\7\13\2\2\u00d7") - buf.write("\61\3\2\2\2\u00d8\u00df\5\64\33\2\u00d9\u00da\7\32\2\2") - buf.write("\u00da\u00e0\7*\2\2\u00db\u00dc\7\4\2\2\u00dc\u00dd\5") - buf.write("(\25\2\u00dd\u00de\7\5\2\2\u00de\u00e0\3\2\2\2\u00df\u00d9") - buf.write("\3\2\2\2\u00df\u00db\3\2\2\2\u00e0\u00e1\3\2\2\2\u00e1") - buf.write("\u00df\3\2\2\2\u00e1\u00e2\3\2\2\2\u00e2\63\3\2\2\2\u00e3") - buf.write("\u00e4\7*\2\2\u00e4\65\3\2\2\2\u00e5\u00e6\b\34\1\2\u00e6") - buf.write("\u00e7\7(\2\2\u00e7\u00f2\5\66\34\7\u00e8\u00e9\5(\25") - buf.write("\2\u00e9\u00ea\58\35\2\u00ea\u00eb\5(\25\2\u00eb\u00f2") - buf.write("\3\2\2\2\u00ec\u00f2\7\37\2\2\u00ed\u00ee\7\t\2\2\u00ee") - buf.write("\u00ef\5\66\34\2\u00ef\u00f0\7\13\2\2\u00f0\u00f2\3\2") - buf.write("\2\2\u00f1\u00e5\3\2\2\2\u00f1\u00e8\3\2\2\2\u00f1\u00ec") - buf.write("\3\2\2\2\u00f1\u00ed\3\2\2\2\u00f2\u00f9\3\2\2\2\u00f3") - buf.write("\u00f4\f\5\2\2\u00f4\u00f5\5:\36\2\u00f5\u00f6\5\66\34") - buf.write("\6\u00f6\u00f8\3\2\2\2\u00f7\u00f3\3\2\2\2\u00f8\u00fb") - buf.write("\3\2\2\2\u00f9\u00f7\3\2\2\2\u00f9\u00fa\3\2\2\2\u00fa") - buf.write("\67\3\2\2\2\u00fb\u00f9\3\2\2\2\u00fc\u00fd\t\6\2\2\u00fd") - buf.write("9\3\2\2\2\u00fe\u00ff\t\7\2\2\u00ff;\3\2\2\2\u0100\u0105") - buf.write("\7)\2\2\u0101\u0105\7*\2\2\u0102\u0105\5\34\17\2\u0103") - buf.write("\u0105\5\62\32\2\u0104\u0100\3\2\2\2\u0104\u0101\3\2\2") - buf.write("\2\u0104\u0102\3\2\2\2\u0104\u0103\3\2\2\2\u0105=\3\2") - buf.write("\2\2\24DJVZ\u0088\u008b\u0091\u00ac\u00b0\u00ba\u00bc") - buf.write("\u00c8\u00d0\u00df\u00e1\u00f1\u00f9\u0104") + buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\3\2\3\2\3\2\3\3\7") + buf.write("\3K\n\3\f\3\16\3N\13\3\3\4\6\4Q\n\4\r\4\16\4R\3\5\3\5") + buf.write("\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5a\n\5\3\6") + buf.write("\3\6\5\6e\n\6\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b") + buf.write("\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3") + buf.write("\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\f\3\f\3\r\3\r") + buf.write("\3\16\3\16\3\17\3\17\3\17\3\17\7\17\u0091\n\17\f\17\16") + buf.write("\17\u0094\13\17\5\17\u0096\n\17\3\17\3\17\3\20\3\20\5") + buf.write("\20\u009c\n\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21") + buf.write("\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\25\3\25\3\25") + buf.write("\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u00b7\n\25\3\25\3") + buf.write("\25\5\25\u00bb\n\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25") + buf.write("\3\25\7\25\u00c5\n\25\f\25\16\25\u00c8\13\25\3\26\3\26") + buf.write("\3\26\3\26\3\26\3\26\3\27\7\27\u00d1\n\27\f\27\16\27\u00d4") + buf.write("\13\27\3\30\3\30\3\30\3\31\3\31\5\31\u00db\n\31\3\31\3") + buf.write("\31\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\32") + buf.write("\3\32\6\32\u00ea\n\32\r\32\16\32\u00eb\3\33\3\33\3\34") + buf.write("\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35") + buf.write("\3\35\3\35\3\35\3\36\3\36\3\36\7\36\u0102\n\36\f\36\16") + buf.write("\36\u0105\13\36\5\36\u0107\n\36\3\37\3\37\3\37\7\37\u010c") + buf.write("\n\37\f\37\16\37\u010f\13\37\5\37\u0111\n\37\3 \3 \3 ") + buf.write("\3 \3 \3 \3 \3 \3 \3 \3 \3 \5 \u011f\n \3 \3 \3 \3 \7") + buf.write(" \u0125\n \f \16 \u0128\13 \3!\3!\3\"\3\"\3#\3#\3#\3#") + buf.write("\5#\u0132\n#\3#\2\4(>$\2\4\6\b\n\f\16\20\22\24\26\30\32") + buf.write("\34\36 \"$&(*,.\60\62\64\668:<>@BD\2\b\3\2\f\17\3\2\20") + buf.write("\21\3\2\36\37\3\2\34\35\3\2\"\'\3\2()\2\u0137\2F\3\2\2") + buf.write("\2\4L\3\2\2\2\6P\3\2\2\2\b`\3\2\2\2\nd\3\2\2\2\ff\3\2") + buf.write("\2\2\16l\3\2\2\2\20v\3\2\2\2\22|\3\2\2\2\24\u0083\3\2") + buf.write("\2\2\26\u0086\3\2\2\2\30\u0088\3\2\2\2\32\u008a\3\2\2") + buf.write("\2\34\u008c\3\2\2\2\36\u009b\3\2\2\2 \u00a0\3\2\2\2\"") + buf.write("\u00a5\3\2\2\2$\u00a7\3\2\2\2&\u00a9\3\2\2\2(\u00ba\3") + buf.write("\2\2\2*\u00c9\3\2\2\2,\u00d2\3\2\2\2.\u00d5\3\2\2\2\60") + buf.write("\u00da\3\2\2\2\62\u00e2\3\2\2\2\64\u00ed\3\2\2\2\66\u00ef") + buf.write("\3\2\2\28\u00f4\3\2\2\2:\u0106\3\2\2\2<\u0110\3\2\2\2") + buf.write(">\u011e\3\2\2\2@\u0129\3\2\2\2B\u012b\3\2\2\2D\u0131\3") + buf.write("\2\2\2FG\5\4\3\2GH\7\2\2\3H\3\3\2\2\2IK\5\b\5\2JI\3\2") + buf.write("\2\2KN\3\2\2\2LJ\3\2\2\2LM\3\2\2\2M\5\3\2\2\2NL\3\2\2") + buf.write("\2OQ\5\b\5\2PO\3\2\2\2QR\3\2\2\2RP\3\2\2\2RS\3\2\2\2S") + buf.write("\7\3\2\2\2Ta\5\36\20\2Ua\5 \21\2Va\5\n\6\2Wa\5\20\t\2") + buf.write("Xa\5\24\13\2Ya\5\30\r\2Za\5\22\n\2[a\5\32\16\2\\a\5*\26") + buf.write("\2]a\5\60\31\2^a\58\35\2_a\5\66\34\2`T\3\2\2\2`U\3\2\2") + buf.write("\2`V\3\2\2\2`W\3\2\2\2`X\3\2\2\2`Y\3\2\2\2`Z\3\2\2\2`") + buf.write("[\3\2\2\2`\\\3\2\2\2`]\3\2\2\2`^\3\2\2\2`_\3\2\2\2a\t") + buf.write("\3\2\2\2be\5\f\7\2ce\5\16\b\2db\3\2\2\2dc\3\2\2\2e\13") + buf.write("\3\2\2\2fg\7\3\2\2gh\5> \2hi\7\4\2\2ij\5\6\4\2jk\7\5\2") + buf.write("\2k\r\3\2\2\2lm\7\3\2\2mn\5> \2no\7\4\2\2op\5\6\4\2pq") + buf.write("\7\5\2\2qr\7\6\2\2rs\7\4\2\2st\5\6\4\2tu\7\5\2\2u\17\3") + buf.write("\2\2\2vw\7\7\2\2wx\5D#\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2") + buf.write("{\21\3\2\2\2|}\7\b\2\2}~\7\t\2\2~\177\5(\25\2\177\u0080") + buf.write("\7\n\2\2\u0080\u0081\5(\25\2\u0081\u0082\7\13\2\2\u0082") + buf.write("\23\3\2\2\2\u0083\u0084\5\26\f\2\u0084\u0085\5(\25\2\u0085") + buf.write("\25\3\2\2\2\u0086\u0087\t\2\2\2\u0087\27\3\2\2\2\u0088") + buf.write("\u0089\t\3\2\2\u0089\31\3\2\2\2\u008a\u008b\7\22\2\2\u008b") + buf.write("\33\3\2\2\2\u008c\u0095\7\4\2\2\u008d\u0092\5(\25\2\u008e") + buf.write("\u008f\7\n\2\2\u008f\u0091\5(\25\2\u0090\u008e\3\2\2\2") + buf.write("\u0091\u0094\3\2\2\2\u0092\u0090\3\2\2\2\u0092\u0093\3") + buf.write("\2\2\2\u0093\u0096\3\2\2\2\u0094\u0092\3\2\2\2\u0095\u008d") + buf.write("\3\2\2\2\u0095\u0096\3\2\2\2\u0096\u0097\3\2\2\2\u0097") + buf.write("\u0098\7\5\2\2\u0098\35\3\2\2\2\u0099\u009c\7,\2\2\u009a") + buf.write("\u009c\5\62\32\2\u009b\u0099\3\2\2\2\u009b\u009a\3\2\2") + buf.write("\2\u009c\u009d\3\2\2\2\u009d\u009e\7\23\2\2\u009e\u009f") + buf.write("\5(\25\2\u009f\37\3\2\2\2\u00a0\u00a1\7\24\2\2\u00a1\u00a2") + buf.write("\7\t\2\2\u00a2\u00a3\5(\25\2\u00a3\u00a4\7\13\2\2\u00a4") + buf.write("!\3\2\2\2\u00a5\u00a6\t\4\2\2\u00a6#\3\2\2\2\u00a7\u00a8") + buf.write("\t\5\2\2\u00a8%\3\2\2\2\u00a9\u00aa\7\35\2\2\u00aa\'\3") + buf.write("\2\2\2\u00ab\u00ac\b\25\1\2\u00ac\u00ad\5&\24\2\u00ad") + buf.write("\u00ae\5(\25\b\u00ae\u00bb\3\2\2\2\u00af\u00b0\7\t\2\2") + buf.write("\u00b0\u00b1\5(\25\2\u00b1\u00b2\7\13\2\2\u00b2\u00bb") + buf.write("\3\2\2\2\u00b3\u00bb\5D#\2\u00b4\u00b7\7,\2\2\u00b5\u00b7") + buf.write("\5\62\32\2\u00b6\u00b4\3\2\2\2\u00b6\u00b5\3\2\2\2\u00b7") + buf.write("\u00b8\3\2\2\2\u00b8\u00b9\7\23\2\2\u00b9\u00bb\5(\25") + buf.write("\3\u00ba\u00ab\3\2\2\2\u00ba\u00af\3\2\2\2\u00ba\u00b3") + buf.write("\3\2\2\2\u00ba\u00b6\3\2\2\2\u00bb\u00c6\3\2\2\2\u00bc") + buf.write("\u00bd\f\7\2\2\u00bd\u00be\5\"\22\2\u00be\u00bf\5(\25") + buf.write("\b\u00bf\u00c5\3\2\2\2\u00c0\u00c1\f\6\2\2\u00c1\u00c2") + buf.write("\5$\23\2\u00c2\u00c3\5(\25\7\u00c3\u00c5\3\2\2\2\u00c4") + buf.write("\u00bc\3\2\2\2\u00c4\u00c0\3\2\2\2\u00c5\u00c8\3\2\2\2") + buf.write("\u00c6\u00c4\3\2\2\2\u00c6\u00c7\3\2\2\2\u00c7)\3\2\2") + buf.write("\2\u00c8\u00c6\3\2\2\2\u00c9\u00ca\7\25\2\2\u00ca\u00cb") + buf.write("\7,\2\2\u00cb\u00cc\7\26\2\2\u00cc\u00cd\5,\27\2\u00cd") + buf.write("\u00ce\7\27\2\2\u00ce+\3\2\2\2\u00cf\u00d1\5.\30\2\u00d0") + buf.write("\u00cf\3\2\2\2\u00d1\u00d4\3\2\2\2\u00d2\u00d0\3\2\2\2") + buf.write("\u00d2\u00d3\3\2\2\2\u00d3-\3\2\2\2\u00d4\u00d2\3\2\2") + buf.write("\2\u00d5\u00d6\5\36\20\2\u00d6\u00d7\7\30\2\2\u00d7/\3") + buf.write("\2\2\2\u00d8\u00db\7,\2\2\u00d9\u00db\5\62\32\2\u00da") + buf.write("\u00d8\3\2\2\2\u00da\u00d9\3\2\2\2\u00db\u00dc\3\2\2\2") + buf.write("\u00dc\u00dd\7\23\2\2\u00dd\u00de\7\31\2\2\u00de\u00df") + buf.write("\7,\2\2\u00df\u00e0\7\t\2\2\u00e0\u00e1\7\13\2\2\u00e1") + buf.write("\61\3\2\2\2\u00e2\u00e9\5\64\33\2\u00e3\u00e4\7\32\2\2") + buf.write("\u00e4\u00ea\7,\2\2\u00e5\u00e6\7\4\2\2\u00e6\u00e7\5") + buf.write("(\25\2\u00e7\u00e8\7\5\2\2\u00e8\u00ea\3\2\2\2\u00e9\u00e3") + buf.write("\3\2\2\2\u00e9\u00e5\3\2\2\2\u00ea\u00eb\3\2\2\2\u00eb") + buf.write("\u00e9\3\2\2\2\u00eb\u00ec\3\2\2\2\u00ec\63\3\2\2\2\u00ed") + buf.write("\u00ee\7,\2\2\u00ee\65\3\2\2\2\u00ef\u00f0\7-\2\2\u00f0") + buf.write("\u00f1\7\t\2\2\u00f1\u00f2\5<\37\2\u00f2\u00f3\7\13\2") + buf.write("\2\u00f3\67\3\2\2\2\u00f4\u00f5\7\33\2\2\u00f5\u00f6\7") + buf.write("-\2\2\u00f6\u00f7\7\t\2\2\u00f7\u00f8\5:\36\2\u00f8\u00f9") + buf.write("\7\13\2\2\u00f9\u00fa\7\26\2\2\u00fa\u00fb\5\6\4\2\u00fb") + buf.write("\u00fc\7 \2\2\u00fc\u00fd\7\27\2\2\u00fd9\3\2\2\2\u00fe") + buf.write("\u0103\7,\2\2\u00ff\u0100\7\n\2\2\u0100\u0102\7,\2\2\u0101") + buf.write("\u00ff\3\2\2\2\u0102\u0105\3\2\2\2\u0103\u0101\3\2\2\2") + buf.write("\u0103\u0104\3\2\2\2\u0104\u0107\3\2\2\2\u0105\u0103\3") + buf.write("\2\2\2\u0106\u00fe\3\2\2\2\u0106\u0107\3\2\2\2\u0107;") + buf.write("\3\2\2\2\u0108\u010d\5(\25\2\u0109\u010a\7\n\2\2\u010a") + buf.write("\u010c\5(\25\2\u010b\u0109\3\2\2\2\u010c\u010f\3\2\2\2") + buf.write("\u010d\u010b\3\2\2\2\u010d\u010e\3\2\2\2\u010e\u0111\3") + buf.write("\2\2\2\u010f\u010d\3\2\2\2\u0110\u0108\3\2\2\2\u0110\u0111") + buf.write("\3\2\2\2\u0111=\3\2\2\2\u0112\u0113\b \1\2\u0113\u0114") + buf.write("\7*\2\2\u0114\u011f\5> \7\u0115\u0116\5(\25\2\u0116\u0117") + buf.write("\5@!\2\u0117\u0118\5(\25\2\u0118\u011f\3\2\2\2\u0119\u011f") + buf.write("\7!\2\2\u011a\u011b\7\t\2\2\u011b\u011c\5> \2\u011c\u011d") + buf.write("\7\13\2\2\u011d\u011f\3\2\2\2\u011e\u0112\3\2\2\2\u011e") + buf.write("\u0115\3\2\2\2\u011e\u0119\3\2\2\2\u011e\u011a\3\2\2\2") + buf.write("\u011f\u0126\3\2\2\2\u0120\u0121\f\5\2\2\u0121\u0122\5") + buf.write("B\"\2\u0122\u0123\5> \6\u0123\u0125\3\2\2\2\u0124\u0120") + buf.write("\3\2\2\2\u0125\u0128\3\2\2\2\u0126\u0124\3\2\2\2\u0126") + buf.write("\u0127\3\2\2\2\u0127?\3\2\2\2\u0128\u0126\3\2\2\2\u0129") + buf.write("\u012a\t\6\2\2\u012aA\3\2\2\2\u012b\u012c\t\7\2\2\u012c") + buf.write("C\3\2\2\2\u012d\u0132\7+\2\2\u012e\u0132\7,\2\2\u012f") + buf.write("\u0132\5\34\17\2\u0130\u0132\5\62\32\2\u0131\u012d\3\2") + buf.write("\2\2\u0131\u012e\3\2\2\2\u0131\u012f\3\2\2\2\u0131\u0130") + buf.write("\3\2\2\2\u0132E\3\2\2\2\30LR`d\u0092\u0095\u009b\u00b6") + buf.write("\u00ba\u00c4\u00c6\u00d2\u00da\u00e9\u00eb\u0103\u0106") + buf.write("\u010d\u0110\u011e\u0126\u0131") return buf.getvalue() @@ -134,9 +155,9 @@ class tlangParser ( Parser ): "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'class'", "'{'", "'}'", "';'", "'new'", - "'.'", "'+'", "'-'", "'*'", "'/'", "'pendown?'", "'<'", - "'>'", "'=='", "'!='", "'<='", "'>='", "'&&'", "'||'", - "'!'" ] + "'.'", "'def'", "'+'", "'-'", "'*'", "'/'", "'return'", + "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", + "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", "", "", "", "", "", "", "", @@ -144,9 +165,10 @@ class tlangParser ( Parser ): "", "", "", "", "", "", "", "", "", "", "", "", - "", "PLUS", "MINUS", "MUL", "DIV", "PENCOND", - "LT", "GT", "EQ", "NEQ", "LTE", "GTE", "AND", "OR", - "NOT", "NUM", "VAR", "NAME", "Whitespace" ] + "", "", "PLUS", "MINUS", "MUL", + "DIV", "RETURN", "PENCOND", "LT", "GT", "EQ", "NEQ", + "LTE", "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", + "Whitespace" ] RULE_start = 0 RULE_instruction_list = 1 @@ -174,10 +196,14 @@ class tlangParser ( Parser ): RULE_objectInstantiation = 23 RULE_objectOrArrayAccess = 24 RULE_baseAccess = 25 - RULE_condition = 26 - RULE_binCondOp = 27 - RULE_logicOp = 28 - RULE_value = 29 + RULE_functionCall = 26 + RULE_functionDeclaration = 27 + RULE_parameters = 28 + RULE_arguments = 29 + RULE_condition = 30 + RULE_binCondOp = 31 + RULE_logicOp = 32 + RULE_value = 33 ruleNames = [ "start", "instruction_list", "strict_ilist", "instruction", "conditional", "ifConditional", "ifElseConditional", @@ -186,7 +212,8 @@ class tlangParser ( Parser ): "multiplicative", "additive", "unaryArithOp", "expression", "classDeclaration", "classBody", "classAttributeDeclaration", "objectInstantiation", "objectOrArrayAccess", "baseAccess", - "condition", "binCondOp", "logicOp", "value" ] + "functionCall", "functionDeclaration", "parameters", + "arguments", "condition", "binCondOp", "logicOp", "value" ] EOF = Token.EOF T__0=1 @@ -213,24 +240,26 @@ class tlangParser ( Parser ): T__21=22 T__22=23 T__23=24 - PLUS=25 - MINUS=26 - MUL=27 - DIV=28 - PENCOND=29 - LT=30 - GT=31 - EQ=32 - NEQ=33 - LTE=34 - GTE=35 - AND=36 - OR=37 - NOT=38 - NUM=39 - VAR=40 - NAME=41 - Whitespace=42 + T__24=25 + PLUS=26 + MINUS=27 + MUL=28 + DIV=29 + RETURN=30 + PENCOND=31 + LT=32 + GT=33 + EQ=34 + NEQ=35 + LTE=36 + GTE=37 + AND=38 + OR=39 + NOT=40 + NUM=41 + VAR=42 + NAME=43 + Whitespace=44 def __init__(self, input:TokenStream, output:TextIO = sys.stdout): super().__init__(input, output) @@ -272,9 +301,9 @@ def start(self): self.enterRule(localctx, 0, self.RULE_start) try: self.enterOuterAlt(localctx, 1) - self.state = 60 + self.state = 68 self.instruction_list() - self.state = 61 + self.state = 69 self.match(tlangParser.EOF) except RecognitionException as re: localctx.exception = re @@ -317,13 +346,13 @@ def instruction_list(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 66 + self.state = 74 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.VAR))) != 0): - self.state = 63 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): + self.state = 71 self.instruction() - self.state = 68 + self.state = 76 self._errHandler.sync(self) _la = self._input.LA(1) @@ -368,16 +397,16 @@ def strict_ilist(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 70 + self.state = 78 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 69 + self.state = 77 self.instruction() - self.state = 72 + self.state = 80 self._errHandler.sync(self) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.VAR))) != 0)): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): break except RecognitionException as re: @@ -435,6 +464,14 @@ def objectInstantiation(self): return self.getTypedRuleContext(tlangParser.ObjectInstantiationContext,0) + def functionDeclaration(self): + return self.getTypedRuleContext(tlangParser.FunctionDeclarationContext,0) + + + def functionCall(self): + return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) + + def getRuleIndex(self): return tlangParser.RULE_instruction @@ -452,69 +489,81 @@ def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) self.enterRule(localctx, 6, self.RULE_instruction) try: - self.state = 84 + self.state = 94 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,2,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 74 + self.state = 82 self.assignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 75 + self.state = 83 self.printStatement() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 76 + self.state = 84 self.conditional() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 77 + self.state = 85 self.loop() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 78 + self.state = 86 self.moveCommand() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 79 + self.state = 87 self.penCommand() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 80 + self.state = 88 self.gotoCommand() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 81 + self.state = 89 self.pauseCommand() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 82 + self.state = 90 self.classDeclaration() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 83 + self.state = 91 self.objectInstantiation() pass + elif la_ == 11: + self.enterOuterAlt(localctx, 11) + self.state = 92 + self.functionDeclaration() + pass + + elif la_ == 12: + self.enterOuterAlt(localctx, 12) + self.state = 93 + self.functionCall() + pass + except RecognitionException as re: localctx.exception = re @@ -556,18 +605,18 @@ def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) self.enterRule(localctx, 8, self.RULE_conditional) try: - self.state = 88 + self.state = 98 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,3,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 86 + self.state = 96 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 87 + self.state = 97 self.ifElseConditional() pass @@ -613,15 +662,15 @@ def ifConditional(self): self.enterRule(localctx, 10, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 90 + self.state = 100 self.match(tlangParser.T__0) - self.state = 91 + self.state = 101 self.condition(0) - self.state = 92 + self.state = 102 self.match(tlangParser.T__1) - self.state = 93 + self.state = 103 self.strict_ilist() - self.state = 94 + self.state = 104 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -667,23 +716,23 @@ def ifElseConditional(self): self.enterRule(localctx, 12, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 96 + self.state = 106 self.match(tlangParser.T__0) - self.state = 97 + self.state = 107 self.condition(0) - self.state = 98 + self.state = 108 self.match(tlangParser.T__1) - self.state = 99 + self.state = 109 self.strict_ilist() - self.state = 100 + self.state = 110 self.match(tlangParser.T__2) - self.state = 101 + self.state = 111 self.match(tlangParser.T__3) - self.state = 102 + self.state = 112 self.match(tlangParser.T__1) - self.state = 103 + self.state = 113 self.strict_ilist() - self.state = 104 + self.state = 114 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -726,15 +775,15 @@ def loop(self): self.enterRule(localctx, 14, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 106 + self.state = 116 self.match(tlangParser.T__4) - self.state = 107 + self.state = 117 self.value() - self.state = 108 + self.state = 118 self.match(tlangParser.T__1) - self.state = 109 + self.state = 119 self.strict_ilist() - self.state = 110 + self.state = 120 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -776,17 +825,17 @@ def gotoCommand(self): self.enterRule(localctx, 16, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 112 + self.state = 122 self.match(tlangParser.T__5) - self.state = 113 + self.state = 123 self.match(tlangParser.T__6) - self.state = 114 + self.state = 124 self.expression(0) - self.state = 115 + self.state = 125 self.match(tlangParser.T__7) - self.state = 116 + self.state = 126 self.expression(0) - self.state = 117 + self.state = 127 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -829,9 +878,9 @@ def moveCommand(self): self.enterRule(localctx, 18, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 119 + self.state = 129 self.moveOp() - self.state = 120 + self.state = 130 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -868,7 +917,7 @@ def moveOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 122 + self.state = 132 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -910,7 +959,7 @@ def penCommand(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 124 + self.state = 134 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -951,7 +1000,7 @@ def pauseCommand(self): self.enterRule(localctx, 24, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 126 + self.state = 136 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -994,29 +1043,29 @@ def array(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 128 + self.state = 138 self.match(tlangParser.T__1) - self.state = 137 + self.state = 147 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.VAR))) != 0): - self.state = 129 + self.state = 139 self.expression(0) - self.state = 134 + self.state = 144 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 130 + self.state = 140 self.match(tlangParser.T__7) - self.state = 131 + self.state = 141 self.expression(0) - self.state = 136 + self.state = 146 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 139 + self.state = 149 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -1062,23 +1111,23 @@ def assignment(self): self.enterRule(localctx, 28, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 143 + self.state = 153 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,6,self._ctx) if la_ == 1: - self.state = 141 + self.state = 151 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 142 + self.state = 152 self.objectOrArrayAccess() pass - self.state = 145 + self.state = 155 self.match(tlangParser.T__16) - self.state = 146 + self.state = 156 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1117,13 +1166,13 @@ def printStatement(self): self.enterRule(localctx, 30, self.RULE_printStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 148 + self.state = 158 self.match(tlangParser.T__17) - self.state = 149 + self.state = 159 self.match(tlangParser.T__6) - self.state = 150 + self.state = 160 self.expression(0) - self.state = 151 + self.state = 161 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1165,7 +1214,7 @@ def multiplicative(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 153 + self.state = 163 _la = self._input.LA(1) if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) @@ -1212,7 +1261,7 @@ def additive(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 155 + self.state = 165 _la = self._input.LA(1) if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) @@ -1255,7 +1304,7 @@ def unaryArithOp(self): self.enterRule(localctx, 36, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 157 + self.state = 167 self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re @@ -1413,7 +1462,7 @@ def expression(self, _p:int=0): self.enterRecursionRule(localctx, 38, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 174 + self.state = 184 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,8,self._ctx) if la_ == 1: @@ -1421,9 +1470,9 @@ def expression(self, _p:int=0): self._ctx = localctx _prevctx = localctx - self.state = 160 + self.state = 170 self.unaryArithOp() - self.state = 161 + self.state = 171 self.expression(6) pass @@ -1431,11 +1480,11 @@ def expression(self, _p:int=0): localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 163 + self.state = 173 self.match(tlangParser.T__6) - self.state = 164 + self.state = 174 self.expression(0) - self.state = 165 + self.state = 175 self.match(tlangParser.T__8) pass @@ -1443,7 +1492,7 @@ def expression(self, _p:int=0): localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 167 + self.state = 177 self.value() pass @@ -1451,29 +1500,29 @@ def expression(self, _p:int=0): localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 170 + self.state = 180 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,7,self._ctx) if la_ == 1: - self.state = 168 + self.state = 178 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 169 + self.state = 179 self.objectOrArrayAccess() pass - self.state = 172 + self.state = 182 self.match(tlangParser.T__16) - self.state = 173 + self.state = 183 self.expression(1) pass self._ctx.stop = self._input.LT(-1) - self.state = 186 + self.state = 196 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,10,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -1481,37 +1530,37 @@ def expression(self, _p:int=0): if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 184 + self.state = 194 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,9,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 176 + self.state = 186 if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 177 + self.state = 187 self.multiplicative() - self.state = 178 + self.state = 188 self.expression(6) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 180 + self.state = 190 if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") - self.state = 181 + self.state = 191 self.additive() - self.state = 182 + self.state = 192 self.expression(5) pass - self.state = 188 + self.state = 198 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,10,self._ctx) @@ -1555,15 +1604,15 @@ def classDeclaration(self): self.enterRule(localctx, 40, self.RULE_classDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 189 + self.state = 199 self.match(tlangParser.T__18) - self.state = 190 + self.state = 200 self.match(tlangParser.VAR) - self.state = 191 + self.state = 201 self.match(tlangParser.T__19) - self.state = 192 + self.state = 202 self.classBody() - self.state = 193 + self.state = 203 self.match(tlangParser.T__20) except RecognitionException as re: localctx.exception = re @@ -1606,13 +1655,13 @@ def classBody(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 198 + self.state = 208 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 195 + self.state = 205 self.classAttributeDeclaration() - self.state = 200 + self.state = 210 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1653,9 +1702,9 @@ def classAttributeDeclaration(self): self.enterRule(localctx, 44, self.RULE_classAttributeDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 201 + self.state = 211 self.assignment() - self.state = 202 + self.state = 212 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -1700,29 +1749,29 @@ def objectInstantiation(self): self.enterRule(localctx, 46, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 206 + self.state = 216 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,12,self._ctx) if la_ == 1: - self.state = 204 + self.state = 214 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 205 + self.state = 215 self.objectOrArrayAccess() pass - self.state = 208 + self.state = 218 self.match(tlangParser.T__16) - self.state = 209 + self.state = 219 self.match(tlangParser.T__22) - self.state = 210 + self.state = 220 self.match(tlangParser.VAR) - self.state = 211 + self.state = 221 self.match(tlangParser.T__6) - self.state = 212 + self.state = 222 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1774,28 +1823,28 @@ def objectOrArrayAccess(self): self.enterRule(localctx, 48, self.RULE_objectOrArrayAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 214 + self.state = 224 self.baseAccess() - self.state = 221 + self.state = 231 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 221 + self.state = 231 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__23]: - self.state = 215 + self.state = 225 self.match(tlangParser.T__23) - self.state = 216 + self.state = 226 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 217 + self.state = 227 self.match(tlangParser.T__1) - self.state = 218 + self.state = 228 self.expression(0) - self.state = 219 + self.state = 229 self.match(tlangParser.T__2) pass else: @@ -1804,7 +1853,7 @@ def objectOrArrayAccess(self): else: raise NoViableAltException(self) - self.state = 223 + self.state = 233 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,14,self._ctx) @@ -1844,7 +1893,7 @@ def baseAccess(self): self.enterRule(localctx, 50, self.RULE_baseAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 225 + self.state = 235 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -1855,6 +1904,240 @@ def baseAccess(self): return localctx + class FunctionCallContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def NAME(self): + return self.getToken(tlangParser.NAME, 0) + + def arguments(self): + return self.getTypedRuleContext(tlangParser.ArgumentsContext,0) + + + def getRuleIndex(self): + return tlangParser.RULE_functionCall + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitFunctionCall" ): + return visitor.visitFunctionCall(self) + else: + return visitor.visitChildren(self) + + + + + def functionCall(self): + + localctx = tlangParser.FunctionCallContext(self, self._ctx, self.state) + self.enterRule(localctx, 52, self.RULE_functionCall) + try: + self.enterOuterAlt(localctx, 1) + self.state = 237 + self.match(tlangParser.NAME) + self.state = 238 + self.match(tlangParser.T__6) + self.state = 239 + self.arguments() + self.state = 240 + self.match(tlangParser.T__8) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class FunctionDeclarationContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def NAME(self): + return self.getToken(tlangParser.NAME, 0) + + def parameters(self): + return self.getTypedRuleContext(tlangParser.ParametersContext,0) + + + def strict_ilist(self): + return self.getTypedRuleContext(tlangParser.Strict_ilistContext,0) + + + def RETURN(self): + return self.getToken(tlangParser.RETURN, 0) + + def getRuleIndex(self): + return tlangParser.RULE_functionDeclaration + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitFunctionDeclaration" ): + return visitor.visitFunctionDeclaration(self) + else: + return visitor.visitChildren(self) + + + + + def functionDeclaration(self): + + localctx = tlangParser.FunctionDeclarationContext(self, self._ctx, self.state) + self.enterRule(localctx, 54, self.RULE_functionDeclaration) + try: + self.enterOuterAlt(localctx, 1) + self.state = 242 + self.match(tlangParser.T__24) + self.state = 243 + self.match(tlangParser.NAME) + self.state = 244 + self.match(tlangParser.T__6) + self.state = 245 + self.parameters() + self.state = 246 + self.match(tlangParser.T__8) + self.state = 247 + self.match(tlangParser.T__19) + self.state = 248 + self.strict_ilist() + self.state = 249 + self.match(tlangParser.RETURN) + self.state = 250 + self.match(tlangParser.T__20) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ParametersContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def VAR(self, i:int=None): + if i is None: + return self.getTokens(tlangParser.VAR) + else: + return self.getToken(tlangParser.VAR, i) + + def getRuleIndex(self): + return tlangParser.RULE_parameters + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitParameters" ): + return visitor.visitParameters(self) + else: + return visitor.visitChildren(self) + + + + + def parameters(self): + + localctx = tlangParser.ParametersContext(self, self._ctx, self.state) + self.enterRule(localctx, 56, self.RULE_parameters) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 260 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==tlangParser.VAR: + self.state = 252 + self.match(tlangParser.VAR) + self.state = 257 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==tlangParser.T__7: + self.state = 253 + self.match(tlangParser.T__7) + self.state = 254 + self.match(tlangParser.VAR) + self.state = 259 + self._errHandler.sync(self) + _la = self._input.LA(1) + + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ArgumentsContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def expression(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.ExpressionContext) + else: + return self.getTypedRuleContext(tlangParser.ExpressionContext,i) + + + def getRuleIndex(self): + return tlangParser.RULE_arguments + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitArguments" ): + return visitor.visitArguments(self) + else: + return visitor.visitChildren(self) + + + + + def arguments(self): + + localctx = tlangParser.ArgumentsContext(self, self._ctx, self.state) + self.enterRule(localctx, 58, self.RULE_arguments) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 270 + self._errHandler.sync(self) + _la = self._input.LA(1) + if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.VAR))) != 0): + self.state = 262 + self.expression(0) + self.state = 267 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==tlangParser.T__7: + self.state = 263 + self.match(tlangParser.T__7) + self.state = 264 + self.expression(0) + self.state = 269 + self._errHandler.sync(self) + _la = self._input.LA(1) + + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class ConditionContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -1905,48 +2188,48 @@ def condition(self, _p:int=0): _parentState = self.state localctx = tlangParser.ConditionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 52 - self.enterRecursionRule(localctx, 52, self.RULE_condition, _p) + _startState = 60 + self.enterRecursionRule(localctx, 60, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 239 + self.state = 284 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,15,self._ctx) + la_ = self._interp.adaptivePredict(self._input,19,self._ctx) if la_ == 1: - self.state = 228 + self.state = 273 self.match(tlangParser.NOT) - self.state = 229 + self.state = 274 self.condition(5) pass elif la_ == 2: - self.state = 230 + self.state = 275 self.expression(0) - self.state = 231 + self.state = 276 self.binCondOp() - self.state = 232 + self.state = 277 self.expression(0) pass elif la_ == 3: - self.state = 234 + self.state = 279 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 235 + self.state = 280 self.match(tlangParser.T__6) - self.state = 236 + self.state = 281 self.condition(0) - self.state = 237 + self.state = 282 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 247 + self.state = 292 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,16,self._ctx) + _alt = self._interp.adaptivePredict(self._input,20,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -1954,17 +2237,17 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 241 + self.state = 286 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 242 + self.state = 287 self.logicOp() - self.state = 243 + self.state = 288 self.condition(4) - self.state = 249 + self.state = 294 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,16,self._ctx) + _alt = self._interp.adaptivePredict(self._input,20,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2014,11 +2297,11 @@ def accept(self, visitor:ParseTreeVisitor): def binCondOp(self): localctx = tlangParser.BinCondOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 54, self.RULE_binCondOp) + self.enterRule(localctx, 62, self.RULE_binCondOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 250 + self.state = 295 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2061,11 +2344,11 @@ def accept(self, visitor:ParseTreeVisitor): def logicOp(self): localctx = tlangParser.LogicOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 56, self.RULE_logicOp) + self.enterRule(localctx, 64, self.RULE_logicOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 252 + self.state = 297 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2116,32 +2399,32 @@ def accept(self, visitor:ParseTreeVisitor): def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) - self.enterRule(localctx, 58, self.RULE_value) + self.enterRule(localctx, 66, self.RULE_value) try: - self.state = 258 + self.state = 303 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,17,self._ctx) + la_ = self._interp.adaptivePredict(self._input,21,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 254 + self.state = 299 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 255 + self.state = 300 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 256 + self.state = 301 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 257 + self.state = 302 self.objectOrArrayAccess() pass @@ -2160,7 +2443,7 @@ def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): if self._predicates == None: self._predicates = dict() self._predicates[19] = self.expression_sempred - self._predicates[26] = self.condition_sempred + self._predicates[30] = self.condition_sempred pred = self._predicates.get(ruleIndex, None) if pred is None: raise Exception("No predicate with index:" + str(ruleIndex)) diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index a9ead74..a054503 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -164,6 +164,26 @@ def visitBaseAccess(self, ctx:tlangParser.BaseAccessContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#functionCall. + def visitFunctionCall(self, ctx:tlangParser.FunctionCallContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by tlangParser#functionDeclaration. + def visitFunctionDeclaration(self, ctx:tlangParser.FunctionDeclarationContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by tlangParser#parameters. + def visitParameters(self, ctx:tlangParser.ParametersContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by tlangParser#arguments. + def visitArguments(self, ctx:tlangParser.ArgumentsContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#condition. def visitCondition(self, ctx:tlangParser.ConditionContext): return self.visitChildren(ctx) From ed51e6c483a67c6b90a59fb99733b4c537108111 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Thu, 20 Feb 2025 01:30:15 +0530 Subject: [PATCH 06/47] returning values from functions now supported --- ChironCore/ChironAST/ChironAST.py | 11 +- ChironCore/ChironAST/builder.py | 22 +- ChironCore/example/exampleFC.tl | 21 +- ChironCore/interpreter.py | 17 + ChironCore/turtparse/tlang.g4 | 9 +- ChironCore/turtparse/tlang.interp | 8 +- ChironCore/turtparse/tlang.tokens | 34 +- ChironCore/turtparse/tlangLexer.interp | 8 +- ChironCore/turtparse/tlangLexer.py | 76 +-- ChironCore/turtparse/tlangLexer.tokens | 34 +- ChironCore/turtparse/tlangParser.py | 899 +++++++++++++++---------- ChironCore/turtparse/tlangVisitor.py | 10 + 12 files changed, 680 insertions(+), 469 deletions(-) diff --git a/ChironCore/ChironAST/ChironAST.py b/ChironCore/ChironAST/ChironAST.py index 3850e81..fe54b30 100644 --- a/ChironCore/ChironAST/ChironAST.py +++ b/ChironCore/ChironAST/ChironAST.py @@ -123,11 +123,16 @@ def __str__(self): class ReturnCommand(Instruction): - def __init__(self, numParams): - self.numParams = numParams + def __init__(self, returnValues): + self.returnValues = returnValues + def __str__(self): + return f"return {self.returnValues}" +class ReadReturnCommand(Instruction): + def __init__(self, returnValues): + self.returnValues = returnValues def __str__(self): - return f"return {self.numParams}" + return f"read {self.returnValues}" class ParametersPassingCommand(Instruction): diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 3022020..3205410 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -46,19 +46,31 @@ def visitStrict_ilist(self, ctx: tlangParser.Strict_ilistContext): instrList.extend(visvalue) return instrList - + def visitFunctionDeclaration(self, ctx: tlangParser.FunctionDeclarationContext): functionName = ctx.NAME().getText() - functionParams = [ param.getText() for param in ctx.parameters().VAR() ] if ctx.parameters() is not None else None + functionParams = [param.getText() for param in ctx.parameters( + ).VAR()] if ctx.parameters() is not None else None functionBody = self.visit(ctx.strict_ilist()) - numParams = 0 if functionParams is None else len(functionParams) - return [(ChironAST.FunctionDeclarationCommand(functionName, functionParams, functionBody), len(functionBody) + 3)] + [(ChironAST.ParametersPassingCommand(functionParams), 1)] + functionBody + [(ChironAST.ReturnCommand(numParams), 1)] + return [(ChironAST.FunctionDeclarationCommand(functionName, functionParams, functionBody), len(functionBody) + 2)] + [(ChironAST.ParametersPassingCommand(functionParams), 1)] + functionBody def visitFunctionCall(self, ctx: tlangParser.FunctionCallContext): functionName = ctx.NAME().getText() - functionArgs = [ self.visit(arg) for arg in ctx.arguments().expression() ] if ctx.arguments() is not None else None + functionArgs = [self.visit(arg) for arg in ctx.arguments( + ).expression()] if ctx.arguments() is not None else None return [(ChironAST.FunctionCallCommand(functionName, functionArgs), 1)] + def visitFunctionCallWithReturnValues(self, ctx: tlangParser.FunctionCallWithReturnValuesContext): + functionCallCommand = self.visitFunctionCall(ctx.functionCall()) + returnLocations = [var.getText() for var in ctx.VAR()] + readReturnCommand = ChironAST.ReadReturnCommand(returnLocations) + return functionCallCommand + [(readReturnCommand, 1)] + + def visitReturnStatement(self, ctx: tlangParser.ReturnStatementContext): + returnValues = [self.visit(expr) for expr in ctx.expression( + )] if ctx.expression() is not None else None + return [(ChironAST.ReturnCommand(returnValues), 1)] + # computes list of recursive assign statements def visitAssignment(self, ctx: tlangParser.AssignmentContext): diff --git a/ChironCore/example/exampleFC.tl b/ChironCore/example/exampleFC.tl index 4c0bd84..9368042 100644 --- a/ChironCore/example/exampleFC.tl +++ b/ChironCore/example/exampleFC.tl @@ -1,32 +1,35 @@ def drawRectangle(:l, :b) { - if :l <= 42 [ + if :l == 0 [ + return + ] + if :l <= 1 [ :b = :b + 40 ] else [ :b = :b + 22 ] + drawRectangle(:l - 1, :b) return } def drawCircle() { :r = 10 - :p1 = 1 - :p2 = 1 + :p1 = 80 + :p2 = 80 if :p1 == 0 [ :p1 = 2 ] else [ - :p2 = 0 + :p2 = 1 ] - drawRectangle(80, 20) - return + return :p2, :p1 } -drawRectangle(80, 20) -drawCircle() -:b = :l +:l, :b = drawCircle() +print(:b) if :b <= 42 [ :l = :l + 40 ] else [ :l = :l + 22 ] +print(:l) \ No newline at end of file diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 66951e6..c3881ec 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -83,6 +83,7 @@ class ConcreteInterpreter(Interpreter): cond_eval = None # used as a temporary variable within the embedded program interpreter prg = None argument = None + return_value = None # map of function name to their pc in the IR function_addresses = {} @@ -130,6 +131,8 @@ def interpret(self): ntgt = self.handleFunctionReturn(stmt, tgt) elif isinstance(stmt, ChironAST.ParametersPassingCommand): ntgt = self.handleParametersPassing(stmt, tgt) + elif isinstance(stmt, ChironAST.ReadReturnCommand): + ntgt = self.handleReturnRead(stmt, tgt) else: raise NotImplementedError("Unknown instruction: %s, %s."%(type(stmt), stmt)) @@ -173,13 +176,27 @@ def handleFunctionCall(self, stmt, tgt): self.prg = ProgramContext() self.pc = self.function_addresses[stmt.name] return 0 + + def handleReturnRead(self, stmt, tgt): + print(f"Read Return: {stmt.returnValues}") + for rval in reversed(stmt.returnValues): + rval = str(rval).replace(":", "") + exec(f"self.prg.{rval} = self.call_stack.pop()") + return 1 def handleFunctionReturn(self, stmt, tgt): print(f"Function Return: {stmt}") # Restore the previous program context + rval_list = [] + for rval in stmt.returnValues: + rval_value = addContext(rval) + exec(f"self.return_value = {rval_value}") + rval_list.append(self.return_value) self.prg = self.call_stack.pop() self.pc = self.call_stack.pop() + self.call_stack.extend(rval_list) return 0 + def handleParametersPassing(self, stmt, tgt): print(f"Parameters Passing: {stmt.params}") diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index 316d94e..7a980a7 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -22,6 +22,8 @@ instruction : assignment | objectInstantiation | functionDeclaration | functionCall + | functionCallWithReturnValues + | returnStatement ; conditional : ifConditional | ifElseConditional ; @@ -62,6 +64,8 @@ MUL : '*' ; DIV : '/' ; +returnStatement : 'return' ( expression ( ',' expression )* )? ; + expression : unaryArithOp expression #unaryExpr | expression multiplicative expression #mulExpr @@ -88,9 +92,10 @@ baseAccess : VAR ; // function call functionCall : NAME '(' arguments ')' ; +functionCallWithReturnValues : VAR ( ',' VAR )* '=' functionCall ; + // function declaration -functionDeclaration : 'def' NAME '(' parameters ')' '{' strict_ilist RETURN '}' ; -RETURN : 'return' ; +functionDeclaration : 'def' NAME '(' parameters ')' '{' strict_ilist '}' ; parameters : ( VAR ( ',' VAR )* )? ; arguments : ( expression ( ',' expression )* )? ; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index e357dd1..19ed578 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -18,6 +18,7 @@ null 'pause' '=' 'print' +'return' 'class' '{' '}' @@ -29,7 +30,6 @@ null '-' '*' '/' -'return' 'pendown?' '<' '>' @@ -72,11 +72,11 @@ null null null null +null PLUS MINUS MUL DIV -RETURN PENCOND LT GT @@ -112,6 +112,7 @@ printStatement multiplicative additive unaryArithOp +returnStatement expression classDeclaration classBody @@ -120,6 +121,7 @@ objectInstantiation objectOrArrayAccess baseAccess functionCall +functionCallWithReturnValues functionDeclaration parameters arguments @@ -130,4 +132,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 308, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 75, 10, 3, 12, 3, 14, 3, 78, 11, 3, 3, 4, 6, 4, 81, 10, 4, 13, 4, 14, 4, 82, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 97, 10, 5, 3, 6, 3, 6, 5, 6, 101, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 145, 10, 15, 12, 15, 14, 15, 148, 11, 15, 5, 15, 150, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 156, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 5, 21, 183, 10, 21, 3, 21, 3, 21, 5, 21, 187, 10, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 197, 10, 21, 12, 21, 14, 21, 200, 11, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 7, 23, 209, 10, 23, 12, 23, 14, 23, 212, 11, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 5, 25, 219, 10, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 6, 26, 234, 10, 26, 13, 26, 14, 26, 235, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 7, 30, 258, 10, 30, 12, 30, 14, 30, 261, 11, 30, 5, 30, 263, 10, 30, 3, 31, 3, 31, 3, 31, 7, 31, 268, 10, 31, 12, 31, 14, 31, 271, 11, 31, 5, 31, 273, 10, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 287, 10, 32, 3, 32, 3, 32, 3, 32, 3, 32, 7, 32, 293, 10, 32, 12, 32, 14, 32, 296, 11, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 306, 10, 35, 3, 35, 2, 4, 40, 62, 36, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 3, 2, 34, 39, 3, 2, 40, 41, 2, 311, 2, 70, 3, 2, 2, 2, 4, 76, 3, 2, 2, 2, 6, 80, 3, 2, 2, 2, 8, 96, 3, 2, 2, 2, 10, 100, 3, 2, 2, 2, 12, 102, 3, 2, 2, 2, 14, 108, 3, 2, 2, 2, 16, 118, 3, 2, 2, 2, 18, 124, 3, 2, 2, 2, 20, 131, 3, 2, 2, 2, 22, 134, 3, 2, 2, 2, 24, 136, 3, 2, 2, 2, 26, 138, 3, 2, 2, 2, 28, 140, 3, 2, 2, 2, 30, 155, 3, 2, 2, 2, 32, 160, 3, 2, 2, 2, 34, 165, 3, 2, 2, 2, 36, 167, 3, 2, 2, 2, 38, 169, 3, 2, 2, 2, 40, 186, 3, 2, 2, 2, 42, 201, 3, 2, 2, 2, 44, 210, 3, 2, 2, 2, 46, 213, 3, 2, 2, 2, 48, 218, 3, 2, 2, 2, 50, 226, 3, 2, 2, 2, 52, 237, 3, 2, 2, 2, 54, 239, 3, 2, 2, 2, 56, 244, 3, 2, 2, 2, 58, 262, 3, 2, 2, 2, 60, 272, 3, 2, 2, 2, 62, 286, 3, 2, 2, 2, 64, 297, 3, 2, 2, 2, 66, 299, 3, 2, 2, 2, 68, 305, 3, 2, 2, 2, 70, 71, 5, 4, 3, 2, 71, 72, 7, 2, 2, 3, 72, 3, 3, 2, 2, 2, 73, 75, 5, 8, 5, 2, 74, 73, 3, 2, 2, 2, 75, 78, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 76, 77, 3, 2, 2, 2, 77, 5, 3, 2, 2, 2, 78, 76, 3, 2, 2, 2, 79, 81, 5, 8, 5, 2, 80, 79, 3, 2, 2, 2, 81, 82, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 82, 83, 3, 2, 2, 2, 83, 7, 3, 2, 2, 2, 84, 97, 5, 30, 16, 2, 85, 97, 5, 32, 17, 2, 86, 97, 5, 10, 6, 2, 87, 97, 5, 16, 9, 2, 88, 97, 5, 20, 11, 2, 89, 97, 5, 24, 13, 2, 90, 97, 5, 18, 10, 2, 91, 97, 5, 26, 14, 2, 92, 97, 5, 42, 22, 2, 93, 97, 5, 48, 25, 2, 94, 97, 5, 56, 29, 2, 95, 97, 5, 54, 28, 2, 96, 84, 3, 2, 2, 2, 96, 85, 3, 2, 2, 2, 96, 86, 3, 2, 2, 2, 96, 87, 3, 2, 2, 2, 96, 88, 3, 2, 2, 2, 96, 89, 3, 2, 2, 2, 96, 90, 3, 2, 2, 2, 96, 91, 3, 2, 2, 2, 96, 92, 3, 2, 2, 2, 96, 93, 3, 2, 2, 2, 96, 94, 3, 2, 2, 2, 96, 95, 3, 2, 2, 2, 97, 9, 3, 2, 2, 2, 98, 101, 5, 12, 7, 2, 99, 101, 5, 14, 8, 2, 100, 98, 3, 2, 2, 2, 100, 99, 3, 2, 2, 2, 101, 11, 3, 2, 2, 2, 102, 103, 7, 3, 2, 2, 103, 104, 5, 62, 32, 2, 104, 105, 7, 4, 2, 2, 105, 106, 5, 6, 4, 2, 106, 107, 7, 5, 2, 2, 107, 13, 3, 2, 2, 2, 108, 109, 7, 3, 2, 2, 109, 110, 5, 62, 32, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 114, 7, 6, 2, 2, 114, 115, 7, 4, 2, 2, 115, 116, 5, 6, 4, 2, 116, 117, 7, 5, 2, 2, 117, 15, 3, 2, 2, 2, 118, 119, 7, 7, 2, 2, 119, 120, 5, 68, 35, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 17, 3, 2, 2, 2, 124, 125, 7, 8, 2, 2, 125, 126, 7, 9, 2, 2, 126, 127, 5, 40, 21, 2, 127, 128, 7, 10, 2, 2, 128, 129, 5, 40, 21, 2, 129, 130, 7, 11, 2, 2, 130, 19, 3, 2, 2, 2, 131, 132, 5, 22, 12, 2, 132, 133, 5, 40, 21, 2, 133, 21, 3, 2, 2, 2, 134, 135, 9, 2, 2, 2, 135, 23, 3, 2, 2, 2, 136, 137, 9, 3, 2, 2, 137, 25, 3, 2, 2, 2, 138, 139, 7, 18, 2, 2, 139, 27, 3, 2, 2, 2, 140, 149, 7, 4, 2, 2, 141, 146, 5, 40, 21, 2, 142, 143, 7, 10, 2, 2, 143, 145, 5, 40, 21, 2, 144, 142, 3, 2, 2, 2, 145, 148, 3, 2, 2, 2, 146, 144, 3, 2, 2, 2, 146, 147, 3, 2, 2, 2, 147, 150, 3, 2, 2, 2, 148, 146, 3, 2, 2, 2, 149, 141, 3, 2, 2, 2, 149, 150, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 152, 7, 5, 2, 2, 152, 29, 3, 2, 2, 2, 153, 156, 7, 44, 2, 2, 154, 156, 5, 50, 26, 2, 155, 153, 3, 2, 2, 2, 155, 154, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 158, 7, 19, 2, 2, 158, 159, 5, 40, 21, 2, 159, 31, 3, 2, 2, 2, 160, 161, 7, 20, 2, 2, 161, 162, 7, 9, 2, 2, 162, 163, 5, 40, 21, 2, 163, 164, 7, 11, 2, 2, 164, 33, 3, 2, 2, 2, 165, 166, 9, 4, 2, 2, 166, 35, 3, 2, 2, 2, 167, 168, 9, 5, 2, 2, 168, 37, 3, 2, 2, 2, 169, 170, 7, 29, 2, 2, 170, 39, 3, 2, 2, 2, 171, 172, 8, 21, 1, 2, 172, 173, 5, 38, 20, 2, 173, 174, 5, 40, 21, 8, 174, 187, 3, 2, 2, 2, 175, 176, 7, 9, 2, 2, 176, 177, 5, 40, 21, 2, 177, 178, 7, 11, 2, 2, 178, 187, 3, 2, 2, 2, 179, 187, 5, 68, 35, 2, 180, 183, 7, 44, 2, 2, 181, 183, 5, 50, 26, 2, 182, 180, 3, 2, 2, 2, 182, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 185, 7, 19, 2, 2, 185, 187, 5, 40, 21, 3, 186, 171, 3, 2, 2, 2, 186, 175, 3, 2, 2, 2, 186, 179, 3, 2, 2, 2, 186, 182, 3, 2, 2, 2, 187, 198, 3, 2, 2, 2, 188, 189, 12, 7, 2, 2, 189, 190, 5, 34, 18, 2, 190, 191, 5, 40, 21, 8, 191, 197, 3, 2, 2, 2, 192, 193, 12, 6, 2, 2, 193, 194, 5, 36, 19, 2, 194, 195, 5, 40, 21, 7, 195, 197, 3, 2, 2, 2, 196, 188, 3, 2, 2, 2, 196, 192, 3, 2, 2, 2, 197, 200, 3, 2, 2, 2, 198, 196, 3, 2, 2, 2, 198, 199, 3, 2, 2, 2, 199, 41, 3, 2, 2, 2, 200, 198, 3, 2, 2, 2, 201, 202, 7, 21, 2, 2, 202, 203, 7, 44, 2, 2, 203, 204, 7, 22, 2, 2, 204, 205, 5, 44, 23, 2, 205, 206, 7, 23, 2, 2, 206, 43, 3, 2, 2, 2, 207, 209, 5, 46, 24, 2, 208, 207, 3, 2, 2, 2, 209, 212, 3, 2, 2, 2, 210, 208, 3, 2, 2, 2, 210, 211, 3, 2, 2, 2, 211, 45, 3, 2, 2, 2, 212, 210, 3, 2, 2, 2, 213, 214, 5, 30, 16, 2, 214, 215, 7, 24, 2, 2, 215, 47, 3, 2, 2, 2, 216, 219, 7, 44, 2, 2, 217, 219, 5, 50, 26, 2, 218, 216, 3, 2, 2, 2, 218, 217, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 221, 7, 19, 2, 2, 221, 222, 7, 25, 2, 2, 222, 223, 7, 44, 2, 2, 223, 224, 7, 9, 2, 2, 224, 225, 7, 11, 2, 2, 225, 49, 3, 2, 2, 2, 226, 233, 5, 52, 27, 2, 227, 228, 7, 26, 2, 2, 228, 234, 7, 44, 2, 2, 229, 230, 7, 4, 2, 2, 230, 231, 5, 40, 21, 2, 231, 232, 7, 5, 2, 2, 232, 234, 3, 2, 2, 2, 233, 227, 3, 2, 2, 2, 233, 229, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 233, 3, 2, 2, 2, 235, 236, 3, 2, 2, 2, 236, 51, 3, 2, 2, 2, 237, 238, 7, 44, 2, 2, 238, 53, 3, 2, 2, 2, 239, 240, 7, 45, 2, 2, 240, 241, 7, 9, 2, 2, 241, 242, 5, 60, 31, 2, 242, 243, 7, 11, 2, 2, 243, 55, 3, 2, 2, 2, 244, 245, 7, 27, 2, 2, 245, 246, 7, 45, 2, 2, 246, 247, 7, 9, 2, 2, 247, 248, 5, 58, 30, 2, 248, 249, 7, 11, 2, 2, 249, 250, 7, 22, 2, 2, 250, 251, 5, 6, 4, 2, 251, 252, 7, 32, 2, 2, 252, 253, 7, 23, 2, 2, 253, 57, 3, 2, 2, 2, 254, 259, 7, 44, 2, 2, 255, 256, 7, 10, 2, 2, 256, 258, 7, 44, 2, 2, 257, 255, 3, 2, 2, 2, 258, 261, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 263, 3, 2, 2, 2, 261, 259, 3, 2, 2, 2, 262, 254, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 59, 3, 2, 2, 2, 264, 269, 5, 40, 21, 2, 265, 266, 7, 10, 2, 2, 266, 268, 5, 40, 21, 2, 267, 265, 3, 2, 2, 2, 268, 271, 3, 2, 2, 2, 269, 267, 3, 2, 2, 2, 269, 270, 3, 2, 2, 2, 270, 273, 3, 2, 2, 2, 271, 269, 3, 2, 2, 2, 272, 264, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 61, 3, 2, 2, 2, 274, 275, 8, 32, 1, 2, 275, 276, 7, 42, 2, 2, 276, 287, 5, 62, 32, 7, 277, 278, 5, 40, 21, 2, 278, 279, 5, 64, 33, 2, 279, 280, 5, 40, 21, 2, 280, 287, 3, 2, 2, 2, 281, 287, 7, 33, 2, 2, 282, 283, 7, 9, 2, 2, 283, 284, 5, 62, 32, 2, 284, 285, 7, 11, 2, 2, 285, 287, 3, 2, 2, 2, 286, 274, 3, 2, 2, 2, 286, 277, 3, 2, 2, 2, 286, 281, 3, 2, 2, 2, 286, 282, 3, 2, 2, 2, 287, 294, 3, 2, 2, 2, 288, 289, 12, 5, 2, 2, 289, 290, 5, 66, 34, 2, 290, 291, 5, 62, 32, 6, 291, 293, 3, 2, 2, 2, 292, 288, 3, 2, 2, 2, 293, 296, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 294, 295, 3, 2, 2, 2, 295, 63, 3, 2, 2, 2, 296, 294, 3, 2, 2, 2, 297, 298, 9, 6, 2, 2, 298, 65, 3, 2, 2, 2, 299, 300, 9, 7, 2, 2, 300, 67, 3, 2, 2, 2, 301, 306, 7, 43, 2, 2, 302, 306, 7, 44, 2, 2, 303, 306, 5, 28, 15, 2, 304, 306, 5, 50, 26, 2, 305, 301, 3, 2, 2, 2, 305, 302, 3, 2, 2, 2, 305, 303, 3, 2, 2, 2, 305, 304, 3, 2, 2, 2, 306, 69, 3, 2, 2, 2, 24, 76, 82, 96, 100, 146, 149, 155, 182, 186, 196, 198, 210, 218, 233, 235, 259, 262, 269, 272, 286, 294, 305] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 335, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 79, 10, 3, 12, 3, 14, 3, 82, 11, 3, 3, 4, 6, 4, 85, 10, 4, 13, 4, 14, 4, 86, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 103, 10, 5, 3, 6, 3, 6, 5, 6, 107, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 151, 10, 15, 12, 15, 14, 15, 154, 11, 15, 5, 15, 156, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 162, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 182, 10, 21, 12, 21, 14, 21, 185, 11, 21, 5, 21, 187, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 200, 10, 22, 3, 22, 3, 22, 5, 22, 204, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 214, 10, 22, 12, 22, 14, 22, 217, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 226, 10, 24, 12, 24, 14, 24, 229, 11, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 5, 26, 236, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 251, 10, 27, 13, 27, 14, 27, 252, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 7, 30, 265, 10, 30, 12, 30, 14, 30, 268, 11, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 7, 32, 285, 10, 32, 12, 32, 14, 32, 288, 11, 32, 5, 32, 290, 10, 32, 3, 33, 3, 33, 3, 33, 7, 33, 295, 10, 33, 12, 33, 14, 33, 298, 11, 33, 5, 33, 300, 10, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 314, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 7, 34, 320, 10, 34, 12, 34, 14, 34, 323, 11, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 333, 10, 37, 3, 37, 2, 4, 42, 66, 38, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 341, 2, 74, 3, 2, 2, 2, 4, 80, 3, 2, 2, 2, 6, 84, 3, 2, 2, 2, 8, 102, 3, 2, 2, 2, 10, 106, 3, 2, 2, 2, 12, 108, 3, 2, 2, 2, 14, 114, 3, 2, 2, 2, 16, 124, 3, 2, 2, 2, 18, 130, 3, 2, 2, 2, 20, 137, 3, 2, 2, 2, 22, 140, 3, 2, 2, 2, 24, 142, 3, 2, 2, 2, 26, 144, 3, 2, 2, 2, 28, 146, 3, 2, 2, 2, 30, 161, 3, 2, 2, 2, 32, 166, 3, 2, 2, 2, 34, 171, 3, 2, 2, 2, 36, 173, 3, 2, 2, 2, 38, 175, 3, 2, 2, 2, 40, 177, 3, 2, 2, 2, 42, 203, 3, 2, 2, 2, 44, 218, 3, 2, 2, 2, 46, 227, 3, 2, 2, 2, 48, 230, 3, 2, 2, 2, 50, 235, 3, 2, 2, 2, 52, 243, 3, 2, 2, 2, 54, 254, 3, 2, 2, 2, 56, 256, 3, 2, 2, 2, 58, 261, 3, 2, 2, 2, 60, 272, 3, 2, 2, 2, 62, 289, 3, 2, 2, 2, 64, 299, 3, 2, 2, 2, 66, 313, 3, 2, 2, 2, 68, 324, 3, 2, 2, 2, 70, 326, 3, 2, 2, 2, 72, 332, 3, 2, 2, 2, 74, 75, 5, 4, 3, 2, 75, 76, 7, 2, 2, 3, 76, 3, 3, 2, 2, 2, 77, 79, 5, 8, 5, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 5, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 85, 5, 8, 5, 2, 84, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 7, 3, 2, 2, 2, 88, 103, 5, 30, 16, 2, 89, 103, 5, 32, 17, 2, 90, 103, 5, 10, 6, 2, 91, 103, 5, 16, 9, 2, 92, 103, 5, 20, 11, 2, 93, 103, 5, 24, 13, 2, 94, 103, 5, 18, 10, 2, 95, 103, 5, 26, 14, 2, 96, 103, 5, 44, 23, 2, 97, 103, 5, 50, 26, 2, 98, 103, 5, 60, 31, 2, 99, 103, 5, 56, 29, 2, 100, 103, 5, 58, 30, 2, 101, 103, 5, 40, 21, 2, 102, 88, 3, 2, 2, 2, 102, 89, 3, 2, 2, 2, 102, 90, 3, 2, 2, 2, 102, 91, 3, 2, 2, 2, 102, 92, 3, 2, 2, 2, 102, 93, 3, 2, 2, 2, 102, 94, 3, 2, 2, 2, 102, 95, 3, 2, 2, 2, 102, 96, 3, 2, 2, 2, 102, 97, 3, 2, 2, 2, 102, 98, 3, 2, 2, 2, 102, 99, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 102, 101, 3, 2, 2, 2, 103, 9, 3, 2, 2, 2, 104, 107, 5, 12, 7, 2, 105, 107, 5, 14, 8, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 11, 3, 2, 2, 2, 108, 109, 7, 3, 2, 2, 109, 110, 5, 66, 34, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 13, 3, 2, 2, 2, 114, 115, 7, 3, 2, 2, 115, 116, 5, 66, 34, 2, 116, 117, 7, 4, 2, 2, 117, 118, 5, 6, 4, 2, 118, 119, 7, 5, 2, 2, 119, 120, 7, 6, 2, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 15, 3, 2, 2, 2, 124, 125, 7, 7, 2, 2, 125, 126, 5, 72, 37, 2, 126, 127, 7, 4, 2, 2, 127, 128, 5, 6, 4, 2, 128, 129, 7, 5, 2, 2, 129, 17, 3, 2, 2, 2, 130, 131, 7, 8, 2, 2, 131, 132, 7, 9, 2, 2, 132, 133, 5, 42, 22, 2, 133, 134, 7, 10, 2, 2, 134, 135, 5, 42, 22, 2, 135, 136, 7, 11, 2, 2, 136, 19, 3, 2, 2, 2, 137, 138, 5, 22, 12, 2, 138, 139, 5, 42, 22, 2, 139, 21, 3, 2, 2, 2, 140, 141, 9, 2, 2, 2, 141, 23, 3, 2, 2, 2, 142, 143, 9, 3, 2, 2, 143, 25, 3, 2, 2, 2, 144, 145, 7, 18, 2, 2, 145, 27, 3, 2, 2, 2, 146, 155, 7, 4, 2, 2, 147, 152, 5, 42, 22, 2, 148, 149, 7, 10, 2, 2, 149, 151, 5, 42, 22, 2, 150, 148, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 156, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 147, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 158, 7, 5, 2, 2, 158, 29, 3, 2, 2, 2, 159, 162, 7, 44, 2, 2, 160, 162, 5, 52, 27, 2, 161, 159, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 164, 7, 19, 2, 2, 164, 165, 5, 42, 22, 2, 165, 31, 3, 2, 2, 2, 166, 167, 7, 20, 2, 2, 167, 168, 7, 9, 2, 2, 168, 169, 5, 42, 22, 2, 169, 170, 7, 11, 2, 2, 170, 33, 3, 2, 2, 2, 171, 172, 9, 4, 2, 2, 172, 35, 3, 2, 2, 2, 173, 174, 9, 5, 2, 2, 174, 37, 3, 2, 2, 2, 175, 176, 7, 30, 2, 2, 176, 39, 3, 2, 2, 2, 177, 186, 7, 21, 2, 2, 178, 183, 5, 42, 22, 2, 179, 180, 7, 10, 2, 2, 180, 182, 5, 42, 22, 2, 181, 179, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 178, 3, 2, 2, 2, 186, 187, 3, 2, 2, 2, 187, 41, 3, 2, 2, 2, 188, 189, 8, 22, 1, 2, 189, 190, 5, 38, 20, 2, 190, 191, 5, 42, 22, 8, 191, 204, 3, 2, 2, 2, 192, 193, 7, 9, 2, 2, 193, 194, 5, 42, 22, 2, 194, 195, 7, 11, 2, 2, 195, 204, 3, 2, 2, 2, 196, 204, 5, 72, 37, 2, 197, 200, 7, 44, 2, 2, 198, 200, 5, 52, 27, 2, 199, 197, 3, 2, 2, 2, 199, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 7, 19, 2, 2, 202, 204, 5, 42, 22, 3, 203, 188, 3, 2, 2, 2, 203, 192, 3, 2, 2, 2, 203, 196, 3, 2, 2, 2, 203, 199, 3, 2, 2, 2, 204, 215, 3, 2, 2, 2, 205, 206, 12, 7, 2, 2, 206, 207, 5, 34, 18, 2, 207, 208, 5, 42, 22, 8, 208, 214, 3, 2, 2, 2, 209, 210, 12, 6, 2, 2, 210, 211, 5, 36, 19, 2, 211, 212, 5, 42, 22, 7, 212, 214, 3, 2, 2, 2, 213, 205, 3, 2, 2, 2, 213, 209, 3, 2, 2, 2, 214, 217, 3, 2, 2, 2, 215, 213, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 43, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 218, 219, 7, 22, 2, 2, 219, 220, 7, 44, 2, 2, 220, 221, 7, 23, 2, 2, 221, 222, 5, 46, 24, 2, 222, 223, 7, 24, 2, 2, 223, 45, 3, 2, 2, 2, 224, 226, 5, 48, 25, 2, 225, 224, 3, 2, 2, 2, 226, 229, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 47, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 230, 231, 5, 30, 16, 2, 231, 232, 7, 25, 2, 2, 232, 49, 3, 2, 2, 2, 233, 236, 7, 44, 2, 2, 234, 236, 5, 52, 27, 2, 235, 233, 3, 2, 2, 2, 235, 234, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 238, 7, 19, 2, 2, 238, 239, 7, 26, 2, 2, 239, 240, 7, 44, 2, 2, 240, 241, 7, 9, 2, 2, 241, 242, 7, 11, 2, 2, 242, 51, 3, 2, 2, 2, 243, 250, 5, 54, 28, 2, 244, 245, 7, 27, 2, 2, 245, 251, 7, 44, 2, 2, 246, 247, 7, 4, 2, 2, 247, 248, 5, 42, 22, 2, 248, 249, 7, 5, 2, 2, 249, 251, 3, 2, 2, 2, 250, 244, 3, 2, 2, 2, 250, 246, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 53, 3, 2, 2, 2, 254, 255, 7, 44, 2, 2, 255, 55, 3, 2, 2, 2, 256, 257, 7, 45, 2, 2, 257, 258, 7, 9, 2, 2, 258, 259, 5, 64, 33, 2, 259, 260, 7, 11, 2, 2, 260, 57, 3, 2, 2, 2, 261, 266, 7, 44, 2, 2, 262, 263, 7, 10, 2, 2, 263, 265, 7, 44, 2, 2, 264, 262, 3, 2, 2, 2, 265, 268, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 269, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 269, 270, 7, 19, 2, 2, 270, 271, 5, 56, 29, 2, 271, 59, 3, 2, 2, 2, 272, 273, 7, 28, 2, 2, 273, 274, 7, 45, 2, 2, 274, 275, 7, 9, 2, 2, 275, 276, 5, 62, 32, 2, 276, 277, 7, 11, 2, 2, 277, 278, 7, 23, 2, 2, 278, 279, 5, 6, 4, 2, 279, 280, 7, 24, 2, 2, 280, 61, 3, 2, 2, 2, 281, 286, 7, 44, 2, 2, 282, 283, 7, 10, 2, 2, 283, 285, 7, 44, 2, 2, 284, 282, 3, 2, 2, 2, 285, 288, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 290, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 289, 281, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 63, 3, 2, 2, 2, 291, 296, 5, 42, 22, 2, 292, 293, 7, 10, 2, 2, 293, 295, 5, 42, 22, 2, 294, 292, 3, 2, 2, 2, 295, 298, 3, 2, 2, 2, 296, 294, 3, 2, 2, 2, 296, 297, 3, 2, 2, 2, 297, 300, 3, 2, 2, 2, 298, 296, 3, 2, 2, 2, 299, 291, 3, 2, 2, 2, 299, 300, 3, 2, 2, 2, 300, 65, 3, 2, 2, 2, 301, 302, 8, 34, 1, 2, 302, 303, 7, 42, 2, 2, 303, 314, 5, 66, 34, 7, 304, 305, 5, 42, 22, 2, 305, 306, 5, 68, 35, 2, 306, 307, 5, 42, 22, 2, 307, 314, 3, 2, 2, 2, 308, 314, 7, 33, 2, 2, 309, 310, 7, 9, 2, 2, 310, 311, 5, 66, 34, 2, 311, 312, 7, 11, 2, 2, 312, 314, 3, 2, 2, 2, 313, 301, 3, 2, 2, 2, 313, 304, 3, 2, 2, 2, 313, 308, 3, 2, 2, 2, 313, 309, 3, 2, 2, 2, 314, 321, 3, 2, 2, 2, 315, 316, 12, 5, 2, 2, 316, 317, 5, 70, 36, 2, 317, 318, 5, 66, 34, 6, 318, 320, 3, 2, 2, 2, 319, 315, 3, 2, 2, 2, 320, 323, 3, 2, 2, 2, 321, 319, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 67, 3, 2, 2, 2, 323, 321, 3, 2, 2, 2, 324, 325, 9, 6, 2, 2, 325, 69, 3, 2, 2, 2, 326, 327, 9, 7, 2, 2, 327, 71, 3, 2, 2, 2, 328, 333, 7, 43, 2, 2, 329, 333, 7, 44, 2, 2, 330, 333, 5, 28, 15, 2, 331, 333, 5, 52, 27, 2, 332, 328, 3, 2, 2, 2, 332, 329, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 332, 331, 3, 2, 2, 2, 333, 73, 3, 2, 2, 2, 27, 80, 86, 102, 106, 152, 155, 161, 183, 186, 199, 203, 213, 215, 227, 235, 250, 252, 266, 286, 289, 296, 299, 313, 321, 332] \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.tokens b/ChironCore/turtparse/tlang.tokens index eb1b614..f2b0e23 100644 --- a/ChironCore/turtparse/tlang.tokens +++ b/ChironCore/turtparse/tlang.tokens @@ -23,11 +23,11 @@ T__21=22 T__22=23 T__23=24 T__24=25 -PLUS=26 -MINUS=27 -MUL=28 -DIV=29 -RETURN=30 +T__25=26 +PLUS=27 +MINUS=28 +MUL=29 +DIV=30 PENCOND=31 LT=32 GT=33 @@ -60,18 +60,18 @@ Whitespace=44 'pause'=16 '='=17 'print'=18 -'class'=19 -'{'=20 -'}'=21 -';'=22 -'new'=23 -'.'=24 -'def'=25 -'+'=26 -'-'=27 -'*'=28 -'/'=29 -'return'=30 +'return'=19 +'class'=20 +'{'=21 +'}'=22 +';'=23 +'new'=24 +'.'=25 +'def'=26 +'+'=27 +'-'=28 +'*'=29 +'/'=30 'pendown?'=31 '<'=32 '>'=33 diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index a7558c8..8e963b6 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -18,6 +18,7 @@ null 'pause' '=' 'print' +'return' 'class' '{' '}' @@ -29,7 +30,6 @@ null '-' '*' '/' -'return' 'pendown?' '<' '>' @@ -72,11 +72,11 @@ null null null null +null PLUS MINUS MUL DIV -RETURN PENCOND LT GT @@ -118,11 +118,11 @@ T__21 T__22 T__23 T__24 +T__25 PLUS MINUS MUL DIV -RETURN PENCOND LT GT @@ -146,4 +146,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 46, 272, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 249, 10, 42, 13, 42, 14, 42, 250, 3, 43, 3, 43, 3, 43, 7, 43, 256, 10, 43, 12, 43, 14, 43, 259, 11, 43, 3, 44, 6, 44, 262, 10, 44, 13, 44, 14, 44, 263, 3, 45, 6, 45, 267, 10, 45, 13, 45, 14, 45, 268, 3, 45, 3, 45, 2, 2, 46, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 275, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 3, 91, 3, 2, 2, 2, 5, 94, 3, 2, 2, 2, 7, 96, 3, 2, 2, 2, 9, 98, 3, 2, 2, 2, 11, 103, 3, 2, 2, 2, 13, 110, 3, 2, 2, 2, 15, 115, 3, 2, 2, 2, 17, 117, 3, 2, 2, 2, 19, 119, 3, 2, 2, 2, 21, 121, 3, 2, 2, 2, 23, 129, 3, 2, 2, 2, 25, 138, 3, 2, 2, 2, 27, 143, 3, 2, 2, 2, 29, 149, 3, 2, 2, 2, 31, 155, 3, 2, 2, 2, 33, 163, 3, 2, 2, 2, 35, 169, 3, 2, 2, 2, 37, 171, 3, 2, 2, 2, 39, 177, 3, 2, 2, 2, 41, 183, 3, 2, 2, 2, 43, 185, 3, 2, 2, 2, 45, 187, 3, 2, 2, 2, 47, 189, 3, 2, 2, 2, 49, 193, 3, 2, 2, 2, 51, 195, 3, 2, 2, 2, 53, 199, 3, 2, 2, 2, 55, 201, 3, 2, 2, 2, 57, 203, 3, 2, 2, 2, 59, 205, 3, 2, 2, 2, 61, 207, 3, 2, 2, 2, 63, 214, 3, 2, 2, 2, 65, 223, 3, 2, 2, 2, 67, 225, 3, 2, 2, 2, 69, 227, 3, 2, 2, 2, 71, 230, 3, 2, 2, 2, 73, 233, 3, 2, 2, 2, 75, 236, 3, 2, 2, 2, 77, 239, 3, 2, 2, 2, 79, 242, 3, 2, 2, 2, 81, 245, 3, 2, 2, 2, 83, 248, 3, 2, 2, 2, 85, 252, 3, 2, 2, 2, 87, 261, 3, 2, 2, 2, 89, 266, 3, 2, 2, 2, 91, 92, 7, 107, 2, 2, 92, 93, 7, 104, 2, 2, 93, 4, 3, 2, 2, 2, 94, 95, 7, 93, 2, 2, 95, 6, 3, 2, 2, 2, 96, 97, 7, 95, 2, 2, 97, 8, 3, 2, 2, 2, 98, 99, 7, 103, 2, 2, 99, 100, 7, 110, 2, 2, 100, 101, 7, 117, 2, 2, 101, 102, 7, 103, 2, 2, 102, 10, 3, 2, 2, 2, 103, 104, 7, 116, 2, 2, 104, 105, 7, 103, 2, 2, 105, 106, 7, 114, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 99, 2, 2, 108, 109, 7, 118, 2, 2, 109, 12, 3, 2, 2, 2, 110, 111, 7, 105, 2, 2, 111, 112, 7, 113, 2, 2, 112, 113, 7, 118, 2, 2, 113, 114, 7, 113, 2, 2, 114, 14, 3, 2, 2, 2, 115, 116, 7, 42, 2, 2, 116, 16, 3, 2, 2, 2, 117, 118, 7, 46, 2, 2, 118, 18, 3, 2, 2, 2, 119, 120, 7, 43, 2, 2, 120, 20, 3, 2, 2, 2, 121, 122, 7, 104, 2, 2, 122, 123, 7, 113, 2, 2, 123, 124, 7, 116, 2, 2, 124, 125, 7, 121, 2, 2, 125, 126, 7, 99, 2, 2, 126, 127, 7, 116, 2, 2, 127, 128, 7, 102, 2, 2, 128, 22, 3, 2, 2, 2, 129, 130, 7, 100, 2, 2, 130, 131, 7, 99, 2, 2, 131, 132, 7, 101, 2, 2, 132, 133, 7, 109, 2, 2, 133, 134, 7, 121, 2, 2, 134, 135, 7, 99, 2, 2, 135, 136, 7, 116, 2, 2, 136, 137, 7, 102, 2, 2, 137, 24, 3, 2, 2, 2, 138, 139, 7, 110, 2, 2, 139, 140, 7, 103, 2, 2, 140, 141, 7, 104, 2, 2, 141, 142, 7, 118, 2, 2, 142, 26, 3, 2, 2, 2, 143, 144, 7, 116, 2, 2, 144, 145, 7, 107, 2, 2, 145, 146, 7, 105, 2, 2, 146, 147, 7, 106, 2, 2, 147, 148, 7, 118, 2, 2, 148, 28, 3, 2, 2, 2, 149, 150, 7, 114, 2, 2, 150, 151, 7, 103, 2, 2, 151, 152, 7, 112, 2, 2, 152, 153, 7, 119, 2, 2, 153, 154, 7, 114, 2, 2, 154, 30, 3, 2, 2, 2, 155, 156, 7, 114, 2, 2, 156, 157, 7, 103, 2, 2, 157, 158, 7, 112, 2, 2, 158, 159, 7, 102, 2, 2, 159, 160, 7, 113, 2, 2, 160, 161, 7, 121, 2, 2, 161, 162, 7, 112, 2, 2, 162, 32, 3, 2, 2, 2, 163, 164, 7, 114, 2, 2, 164, 165, 7, 99, 2, 2, 165, 166, 7, 119, 2, 2, 166, 167, 7, 117, 2, 2, 167, 168, 7, 103, 2, 2, 168, 34, 3, 2, 2, 2, 169, 170, 7, 63, 2, 2, 170, 36, 3, 2, 2, 2, 171, 172, 7, 114, 2, 2, 172, 173, 7, 116, 2, 2, 173, 174, 7, 107, 2, 2, 174, 175, 7, 112, 2, 2, 175, 176, 7, 118, 2, 2, 176, 38, 3, 2, 2, 2, 177, 178, 7, 101, 2, 2, 178, 179, 7, 110, 2, 2, 179, 180, 7, 99, 2, 2, 180, 181, 7, 117, 2, 2, 181, 182, 7, 117, 2, 2, 182, 40, 3, 2, 2, 2, 183, 184, 7, 125, 2, 2, 184, 42, 3, 2, 2, 2, 185, 186, 7, 127, 2, 2, 186, 44, 3, 2, 2, 2, 187, 188, 7, 61, 2, 2, 188, 46, 3, 2, 2, 2, 189, 190, 7, 112, 2, 2, 190, 191, 7, 103, 2, 2, 191, 192, 7, 121, 2, 2, 192, 48, 3, 2, 2, 2, 193, 194, 7, 48, 2, 2, 194, 50, 3, 2, 2, 2, 195, 196, 7, 102, 2, 2, 196, 197, 7, 103, 2, 2, 197, 198, 7, 104, 2, 2, 198, 52, 3, 2, 2, 2, 199, 200, 7, 45, 2, 2, 200, 54, 3, 2, 2, 2, 201, 202, 7, 47, 2, 2, 202, 56, 3, 2, 2, 2, 203, 204, 7, 44, 2, 2, 204, 58, 3, 2, 2, 2, 205, 206, 7, 49, 2, 2, 206, 60, 3, 2, 2, 2, 207, 208, 7, 116, 2, 2, 208, 209, 7, 103, 2, 2, 209, 210, 7, 118, 2, 2, 210, 211, 7, 119, 2, 2, 211, 212, 7, 116, 2, 2, 212, 213, 7, 112, 2, 2, 213, 62, 3, 2, 2, 2, 214, 215, 7, 114, 2, 2, 215, 216, 7, 103, 2, 2, 216, 217, 7, 112, 2, 2, 217, 218, 7, 102, 2, 2, 218, 219, 7, 113, 2, 2, 219, 220, 7, 121, 2, 2, 220, 221, 7, 112, 2, 2, 221, 222, 7, 65, 2, 2, 222, 64, 3, 2, 2, 2, 223, 224, 7, 62, 2, 2, 224, 66, 3, 2, 2, 2, 225, 226, 7, 64, 2, 2, 226, 68, 3, 2, 2, 2, 227, 228, 7, 63, 2, 2, 228, 229, 7, 63, 2, 2, 229, 70, 3, 2, 2, 2, 230, 231, 7, 35, 2, 2, 231, 232, 7, 63, 2, 2, 232, 72, 3, 2, 2, 2, 233, 234, 7, 62, 2, 2, 234, 235, 7, 63, 2, 2, 235, 74, 3, 2, 2, 2, 236, 237, 7, 64, 2, 2, 237, 238, 7, 63, 2, 2, 238, 76, 3, 2, 2, 2, 239, 240, 7, 40, 2, 2, 240, 241, 7, 40, 2, 2, 241, 78, 3, 2, 2, 2, 242, 243, 7, 126, 2, 2, 243, 244, 7, 126, 2, 2, 244, 80, 3, 2, 2, 2, 245, 246, 7, 35, 2, 2, 246, 82, 3, 2, 2, 2, 247, 249, 9, 2, 2, 2, 248, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 250, 251, 3, 2, 2, 2, 251, 84, 3, 2, 2, 2, 252, 253, 7, 60, 2, 2, 253, 257, 9, 3, 2, 2, 254, 256, 9, 4, 2, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 86, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 262, 9, 5, 2, 2, 261, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 88, 3, 2, 2, 2, 265, 267, 9, 6, 2, 2, 266, 265, 3, 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 270, 3, 2, 2, 2, 270, 271, 8, 45, 2, 2, 271, 90, 3, 2, 2, 2, 7, 2, 250, 257, 263, 268, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 46, 272, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 249, 10, 42, 13, 42, 14, 42, 250, 3, 43, 3, 43, 3, 43, 7, 43, 256, 10, 43, 12, 43, 14, 43, 259, 11, 43, 3, 44, 6, 44, 262, 10, 44, 13, 44, 14, 44, 263, 3, 45, 6, 45, 267, 10, 45, 13, 45, 14, 45, 268, 3, 45, 3, 45, 2, 2, 46, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 275, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 3, 91, 3, 2, 2, 2, 5, 94, 3, 2, 2, 2, 7, 96, 3, 2, 2, 2, 9, 98, 3, 2, 2, 2, 11, 103, 3, 2, 2, 2, 13, 110, 3, 2, 2, 2, 15, 115, 3, 2, 2, 2, 17, 117, 3, 2, 2, 2, 19, 119, 3, 2, 2, 2, 21, 121, 3, 2, 2, 2, 23, 129, 3, 2, 2, 2, 25, 138, 3, 2, 2, 2, 27, 143, 3, 2, 2, 2, 29, 149, 3, 2, 2, 2, 31, 155, 3, 2, 2, 2, 33, 163, 3, 2, 2, 2, 35, 169, 3, 2, 2, 2, 37, 171, 3, 2, 2, 2, 39, 177, 3, 2, 2, 2, 41, 184, 3, 2, 2, 2, 43, 190, 3, 2, 2, 2, 45, 192, 3, 2, 2, 2, 47, 194, 3, 2, 2, 2, 49, 196, 3, 2, 2, 2, 51, 200, 3, 2, 2, 2, 53, 202, 3, 2, 2, 2, 55, 206, 3, 2, 2, 2, 57, 208, 3, 2, 2, 2, 59, 210, 3, 2, 2, 2, 61, 212, 3, 2, 2, 2, 63, 214, 3, 2, 2, 2, 65, 223, 3, 2, 2, 2, 67, 225, 3, 2, 2, 2, 69, 227, 3, 2, 2, 2, 71, 230, 3, 2, 2, 2, 73, 233, 3, 2, 2, 2, 75, 236, 3, 2, 2, 2, 77, 239, 3, 2, 2, 2, 79, 242, 3, 2, 2, 2, 81, 245, 3, 2, 2, 2, 83, 248, 3, 2, 2, 2, 85, 252, 3, 2, 2, 2, 87, 261, 3, 2, 2, 2, 89, 266, 3, 2, 2, 2, 91, 92, 7, 107, 2, 2, 92, 93, 7, 104, 2, 2, 93, 4, 3, 2, 2, 2, 94, 95, 7, 93, 2, 2, 95, 6, 3, 2, 2, 2, 96, 97, 7, 95, 2, 2, 97, 8, 3, 2, 2, 2, 98, 99, 7, 103, 2, 2, 99, 100, 7, 110, 2, 2, 100, 101, 7, 117, 2, 2, 101, 102, 7, 103, 2, 2, 102, 10, 3, 2, 2, 2, 103, 104, 7, 116, 2, 2, 104, 105, 7, 103, 2, 2, 105, 106, 7, 114, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 99, 2, 2, 108, 109, 7, 118, 2, 2, 109, 12, 3, 2, 2, 2, 110, 111, 7, 105, 2, 2, 111, 112, 7, 113, 2, 2, 112, 113, 7, 118, 2, 2, 113, 114, 7, 113, 2, 2, 114, 14, 3, 2, 2, 2, 115, 116, 7, 42, 2, 2, 116, 16, 3, 2, 2, 2, 117, 118, 7, 46, 2, 2, 118, 18, 3, 2, 2, 2, 119, 120, 7, 43, 2, 2, 120, 20, 3, 2, 2, 2, 121, 122, 7, 104, 2, 2, 122, 123, 7, 113, 2, 2, 123, 124, 7, 116, 2, 2, 124, 125, 7, 121, 2, 2, 125, 126, 7, 99, 2, 2, 126, 127, 7, 116, 2, 2, 127, 128, 7, 102, 2, 2, 128, 22, 3, 2, 2, 2, 129, 130, 7, 100, 2, 2, 130, 131, 7, 99, 2, 2, 131, 132, 7, 101, 2, 2, 132, 133, 7, 109, 2, 2, 133, 134, 7, 121, 2, 2, 134, 135, 7, 99, 2, 2, 135, 136, 7, 116, 2, 2, 136, 137, 7, 102, 2, 2, 137, 24, 3, 2, 2, 2, 138, 139, 7, 110, 2, 2, 139, 140, 7, 103, 2, 2, 140, 141, 7, 104, 2, 2, 141, 142, 7, 118, 2, 2, 142, 26, 3, 2, 2, 2, 143, 144, 7, 116, 2, 2, 144, 145, 7, 107, 2, 2, 145, 146, 7, 105, 2, 2, 146, 147, 7, 106, 2, 2, 147, 148, 7, 118, 2, 2, 148, 28, 3, 2, 2, 2, 149, 150, 7, 114, 2, 2, 150, 151, 7, 103, 2, 2, 151, 152, 7, 112, 2, 2, 152, 153, 7, 119, 2, 2, 153, 154, 7, 114, 2, 2, 154, 30, 3, 2, 2, 2, 155, 156, 7, 114, 2, 2, 156, 157, 7, 103, 2, 2, 157, 158, 7, 112, 2, 2, 158, 159, 7, 102, 2, 2, 159, 160, 7, 113, 2, 2, 160, 161, 7, 121, 2, 2, 161, 162, 7, 112, 2, 2, 162, 32, 3, 2, 2, 2, 163, 164, 7, 114, 2, 2, 164, 165, 7, 99, 2, 2, 165, 166, 7, 119, 2, 2, 166, 167, 7, 117, 2, 2, 167, 168, 7, 103, 2, 2, 168, 34, 3, 2, 2, 2, 169, 170, 7, 63, 2, 2, 170, 36, 3, 2, 2, 2, 171, 172, 7, 114, 2, 2, 172, 173, 7, 116, 2, 2, 173, 174, 7, 107, 2, 2, 174, 175, 7, 112, 2, 2, 175, 176, 7, 118, 2, 2, 176, 38, 3, 2, 2, 2, 177, 178, 7, 116, 2, 2, 178, 179, 7, 103, 2, 2, 179, 180, 7, 118, 2, 2, 180, 181, 7, 119, 2, 2, 181, 182, 7, 116, 2, 2, 182, 183, 7, 112, 2, 2, 183, 40, 3, 2, 2, 2, 184, 185, 7, 101, 2, 2, 185, 186, 7, 110, 2, 2, 186, 187, 7, 99, 2, 2, 187, 188, 7, 117, 2, 2, 188, 189, 7, 117, 2, 2, 189, 42, 3, 2, 2, 2, 190, 191, 7, 125, 2, 2, 191, 44, 3, 2, 2, 2, 192, 193, 7, 127, 2, 2, 193, 46, 3, 2, 2, 2, 194, 195, 7, 61, 2, 2, 195, 48, 3, 2, 2, 2, 196, 197, 7, 112, 2, 2, 197, 198, 7, 103, 2, 2, 198, 199, 7, 121, 2, 2, 199, 50, 3, 2, 2, 2, 200, 201, 7, 48, 2, 2, 201, 52, 3, 2, 2, 2, 202, 203, 7, 102, 2, 2, 203, 204, 7, 103, 2, 2, 204, 205, 7, 104, 2, 2, 205, 54, 3, 2, 2, 2, 206, 207, 7, 45, 2, 2, 207, 56, 3, 2, 2, 2, 208, 209, 7, 47, 2, 2, 209, 58, 3, 2, 2, 2, 210, 211, 7, 44, 2, 2, 211, 60, 3, 2, 2, 2, 212, 213, 7, 49, 2, 2, 213, 62, 3, 2, 2, 2, 214, 215, 7, 114, 2, 2, 215, 216, 7, 103, 2, 2, 216, 217, 7, 112, 2, 2, 217, 218, 7, 102, 2, 2, 218, 219, 7, 113, 2, 2, 219, 220, 7, 121, 2, 2, 220, 221, 7, 112, 2, 2, 221, 222, 7, 65, 2, 2, 222, 64, 3, 2, 2, 2, 223, 224, 7, 62, 2, 2, 224, 66, 3, 2, 2, 2, 225, 226, 7, 64, 2, 2, 226, 68, 3, 2, 2, 2, 227, 228, 7, 63, 2, 2, 228, 229, 7, 63, 2, 2, 229, 70, 3, 2, 2, 2, 230, 231, 7, 35, 2, 2, 231, 232, 7, 63, 2, 2, 232, 72, 3, 2, 2, 2, 233, 234, 7, 62, 2, 2, 234, 235, 7, 63, 2, 2, 235, 74, 3, 2, 2, 2, 236, 237, 7, 64, 2, 2, 237, 238, 7, 63, 2, 2, 238, 76, 3, 2, 2, 2, 239, 240, 7, 40, 2, 2, 240, 241, 7, 40, 2, 2, 241, 78, 3, 2, 2, 2, 242, 243, 7, 126, 2, 2, 243, 244, 7, 126, 2, 2, 244, 80, 3, 2, 2, 2, 245, 246, 7, 35, 2, 2, 246, 82, 3, 2, 2, 2, 247, 249, 9, 2, 2, 2, 248, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 250, 251, 3, 2, 2, 2, 251, 84, 3, 2, 2, 2, 252, 253, 7, 60, 2, 2, 253, 257, 9, 3, 2, 2, 254, 256, 9, 4, 2, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 86, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 262, 9, 5, 2, 2, 261, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 88, 3, 2, 2, 2, 265, 267, 9, 6, 2, 2, 266, 265, 3, 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 270, 3, 2, 2, 2, 270, 271, 8, 45, 2, 2, 271, 90, 3, 2, 2, 2, 7, 2, 250, 257, 263, 268, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index b315881..a8b9026 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -23,10 +23,10 @@ def serializedATN(): buf.write("\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17") buf.write("\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21") buf.write("\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23") - buf.write("\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\26\3\26\3\27") - buf.write("\3\27\3\30\3\30\3\30\3\30\3\31\3\31\3\32\3\32\3\32\3\32") - buf.write("\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3\37") - buf.write("\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3 \3 \3 \3 \3 \3!\3!") + buf.write("\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25") + buf.write("\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30\3\31\3\31\3\31") + buf.write("\3\31\3\32\3\32\3\33\3\33\3\33\3\33\3\34\3\34\3\35\3\35") + buf.write("\3\36\3\36\3\37\3\37\3 \3 \3 \3 \3 \3 \3 \3 \3 \3!\3!") buf.write("\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3&\3&\3&\3\'\3\'\3") buf.write("\'\3(\3(\3(\3)\3)\3*\6*\u00f9\n*\r*\16*\u00fa\3+\3+\3") buf.write("+\7+\u0100\n+\f+\16+\u0103\13+\3,\6,\u0106\n,\r,\16,\u0107") @@ -49,10 +49,10 @@ def serializedATN(): buf.write("\rn\3\2\2\2\17s\3\2\2\2\21u\3\2\2\2\23w\3\2\2\2\25y\3") buf.write("\2\2\2\27\u0081\3\2\2\2\31\u008a\3\2\2\2\33\u008f\3\2") buf.write("\2\2\35\u0095\3\2\2\2\37\u009b\3\2\2\2!\u00a3\3\2\2\2") - buf.write("#\u00a9\3\2\2\2%\u00ab\3\2\2\2\'\u00b1\3\2\2\2)\u00b7") - buf.write("\3\2\2\2+\u00b9\3\2\2\2-\u00bb\3\2\2\2/\u00bd\3\2\2\2") - buf.write("\61\u00c1\3\2\2\2\63\u00c3\3\2\2\2\65\u00c7\3\2\2\2\67") - buf.write("\u00c9\3\2\2\29\u00cb\3\2\2\2;\u00cd\3\2\2\2=\u00cf\3") + buf.write("#\u00a9\3\2\2\2%\u00ab\3\2\2\2\'\u00b1\3\2\2\2)\u00b8") + buf.write("\3\2\2\2+\u00be\3\2\2\2-\u00c0\3\2\2\2/\u00c2\3\2\2\2") + buf.write("\61\u00c4\3\2\2\2\63\u00c8\3\2\2\2\65\u00ca\3\2\2\2\67") + buf.write("\u00ce\3\2\2\29\u00d0\3\2\2\2;\u00d2\3\2\2\2=\u00d4\3") buf.write("\2\2\2?\u00d6\3\2\2\2A\u00df\3\2\2\2C\u00e1\3\2\2\2E\u00e3") buf.write("\3\2\2\2G\u00e6\3\2\2\2I\u00e9\3\2\2\2K\u00ec\3\2\2\2") buf.write("M\u00ef\3\2\2\2O\u00f2\3\2\2\2Q\u00f5\3\2\2\2S\u00f8\3") @@ -80,20 +80,20 @@ def serializedATN(): buf.write("\7g\2\2\u00a8\"\3\2\2\2\u00a9\u00aa\7?\2\2\u00aa$\3\2") buf.write("\2\2\u00ab\u00ac\7r\2\2\u00ac\u00ad\7t\2\2\u00ad\u00ae") buf.write("\7k\2\2\u00ae\u00af\7p\2\2\u00af\u00b0\7v\2\2\u00b0&\3") - buf.write("\2\2\2\u00b1\u00b2\7e\2\2\u00b2\u00b3\7n\2\2\u00b3\u00b4") - buf.write("\7c\2\2\u00b4\u00b5\7u\2\2\u00b5\u00b6\7u\2\2\u00b6(\3") - buf.write("\2\2\2\u00b7\u00b8\7}\2\2\u00b8*\3\2\2\2\u00b9\u00ba\7") - buf.write("\177\2\2\u00ba,\3\2\2\2\u00bb\u00bc\7=\2\2\u00bc.\3\2") - buf.write("\2\2\u00bd\u00be\7p\2\2\u00be\u00bf\7g\2\2\u00bf\u00c0") - buf.write("\7y\2\2\u00c0\60\3\2\2\2\u00c1\u00c2\7\60\2\2\u00c2\62") - buf.write("\3\2\2\2\u00c3\u00c4\7f\2\2\u00c4\u00c5\7g\2\2\u00c5\u00c6") - buf.write("\7h\2\2\u00c6\64\3\2\2\2\u00c7\u00c8\7-\2\2\u00c8\66\3") - buf.write("\2\2\2\u00c9\u00ca\7/\2\2\u00ca8\3\2\2\2\u00cb\u00cc\7") - buf.write(",\2\2\u00cc:\3\2\2\2\u00cd\u00ce\7\61\2\2\u00ce<\3\2\2") - buf.write("\2\u00cf\u00d0\7t\2\2\u00d0\u00d1\7g\2\2\u00d1\u00d2\7") - buf.write("v\2\2\u00d2\u00d3\7w\2\2\u00d3\u00d4\7t\2\2\u00d4\u00d5") - buf.write("\7p\2\2\u00d5>\3\2\2\2\u00d6\u00d7\7r\2\2\u00d7\u00d8") - buf.write("\7g\2\2\u00d8\u00d9\7p\2\2\u00d9\u00da\7f\2\2\u00da\u00db") + buf.write("\2\2\2\u00b1\u00b2\7t\2\2\u00b2\u00b3\7g\2\2\u00b3\u00b4") + buf.write("\7v\2\2\u00b4\u00b5\7w\2\2\u00b5\u00b6\7t\2\2\u00b6\u00b7") + buf.write("\7p\2\2\u00b7(\3\2\2\2\u00b8\u00b9\7e\2\2\u00b9\u00ba") + buf.write("\7n\2\2\u00ba\u00bb\7c\2\2\u00bb\u00bc\7u\2\2\u00bc\u00bd") + buf.write("\7u\2\2\u00bd*\3\2\2\2\u00be\u00bf\7}\2\2\u00bf,\3\2\2") + buf.write("\2\u00c0\u00c1\7\177\2\2\u00c1.\3\2\2\2\u00c2\u00c3\7") + buf.write("=\2\2\u00c3\60\3\2\2\2\u00c4\u00c5\7p\2\2\u00c5\u00c6") + buf.write("\7g\2\2\u00c6\u00c7\7y\2\2\u00c7\62\3\2\2\2\u00c8\u00c9") + buf.write("\7\60\2\2\u00c9\64\3\2\2\2\u00ca\u00cb\7f\2\2\u00cb\u00cc") + buf.write("\7g\2\2\u00cc\u00cd\7h\2\2\u00cd\66\3\2\2\2\u00ce\u00cf") + buf.write("\7-\2\2\u00cf8\3\2\2\2\u00d0\u00d1\7/\2\2\u00d1:\3\2\2") + buf.write("\2\u00d2\u00d3\7,\2\2\u00d3<\3\2\2\2\u00d4\u00d5\7\61") + buf.write("\2\2\u00d5>\3\2\2\2\u00d6\u00d7\7r\2\2\u00d7\u00d8\7g") + buf.write("\2\2\u00d8\u00d9\7p\2\2\u00d9\u00da\7f\2\2\u00da\u00db") buf.write("\7q\2\2\u00db\u00dc\7y\2\2\u00dc\u00dd\7p\2\2\u00dd\u00de") buf.write("\7A\2\2\u00de@\3\2\2\2\u00df\u00e0\7>\2\2\u00e0B\3\2\2") buf.write("\2\u00e1\u00e2\7@\2\2\u00e2D\3\2\2\2\u00e3\u00e4\7?\2") @@ -149,11 +149,11 @@ class tlangLexer(Lexer): T__22 = 23 T__23 = 24 T__24 = 25 - PLUS = 26 - MINUS = 27 - MUL = 28 - DIV = 29 - RETURN = 30 + T__25 = 26 + PLUS = 27 + MINUS = 28 + MUL = 29 + DIV = 30 PENCOND = 31 LT = 32 GT = 33 @@ -176,23 +176,23 @@ class tlangLexer(Lexer): literalNames = [ "", "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", - "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'class'", - "'{'", "'}'", "';'", "'new'", "'.'", "'def'", "'+'", "'-'", - "'*'", "'/'", "'return'", "'pendown?'", "'<'", "'>'", "'=='", - "'!='", "'<='", "'>='", "'&&'", "'||'", "'!'" ] + "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'return'", + "'class'", "'{'", "'}'", "';'", "'new'", "'.'", "'def'", "'+'", + "'-'", "'*'", "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", + "'<='", "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", - "PLUS", "MINUS", "MUL", "DIV", "RETURN", "PENCOND", "LT", "GT", - "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "VAR", - "NAME", "Whitespace" ] + "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", + "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", + "Whitespace" ] ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", - "T__20", "T__21", "T__22", "T__23", "T__24", "PLUS", "MINUS", - "MUL", "DIV", "RETURN", "PENCOND", "LT", "GT", "EQ", "NEQ", - "LTE", "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", - "Whitespace" ] + "T__20", "T__21", "T__22", "T__23", "T__24", "T__25", + "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", + "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", + "VAR", "NAME", "Whitespace" ] grammarFileName = "tlang.g4" diff --git a/ChironCore/turtparse/tlangLexer.tokens b/ChironCore/turtparse/tlangLexer.tokens index eb1b614..f2b0e23 100644 --- a/ChironCore/turtparse/tlangLexer.tokens +++ b/ChironCore/turtparse/tlangLexer.tokens @@ -23,11 +23,11 @@ T__21=22 T__22=23 T__23=24 T__24=25 -PLUS=26 -MINUS=27 -MUL=28 -DIV=29 -RETURN=30 +T__25=26 +PLUS=27 +MINUS=28 +MUL=29 +DIV=30 PENCOND=31 LT=32 GT=33 @@ -60,18 +60,18 @@ Whitespace=44 'pause'=16 '='=17 'print'=18 -'class'=19 -'{'=20 -'}'=21 -';'=22 -'new'=23 -'.'=24 -'def'=25 -'+'=26 -'-'=27 -'*'=28 -'/'=29 -'return'=30 +'return'=19 +'class'=20 +'{'=21 +'}'=22 +';'=23 +'new'=24 +'.'=25 +'def'=26 +'+'=27 +'-'=28 +'*'=29 +'/'=30 'pendown?'=31 '<'=32 '>'=33 diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index 49a99ed..5e9440c 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -9,135 +9,149 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3.") - buf.write("\u0134\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\u014f\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36") - buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\3\2\3\2\3\2\3\3\7") - buf.write("\3K\n\3\f\3\16\3N\13\3\3\4\6\4Q\n\4\r\4\16\4R\3\5\3\5") - buf.write("\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5a\n\5\3\6") - buf.write("\3\6\5\6e\n\6\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b") - buf.write("\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3") - buf.write("\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\f\3\f\3\r\3\r") - buf.write("\3\16\3\16\3\17\3\17\3\17\3\17\7\17\u0091\n\17\f\17\16") - buf.write("\17\u0094\13\17\5\17\u0096\n\17\3\17\3\17\3\20\3\20\5") - buf.write("\20\u009c\n\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21") - buf.write("\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\25\3\25\3\25") - buf.write("\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u00b7\n\25\3\25\3") - buf.write("\25\5\25\u00bb\n\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25") - buf.write("\3\25\7\25\u00c5\n\25\f\25\16\25\u00c8\13\25\3\26\3\26") - buf.write("\3\26\3\26\3\26\3\26\3\27\7\27\u00d1\n\27\f\27\16\27\u00d4") - buf.write("\13\27\3\30\3\30\3\30\3\31\3\31\5\31\u00db\n\31\3\31\3") - buf.write("\31\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\32") - buf.write("\3\32\6\32\u00ea\n\32\r\32\16\32\u00eb\3\33\3\33\3\34") - buf.write("\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35") - buf.write("\3\35\3\35\3\35\3\36\3\36\3\36\7\36\u0102\n\36\f\36\16") - buf.write("\36\u0105\13\36\5\36\u0107\n\36\3\37\3\37\3\37\7\37\u010c") - buf.write("\n\37\f\37\16\37\u010f\13\37\5\37\u0111\n\37\3 \3 \3 ") - buf.write("\3 \3 \3 \3 \3 \3 \3 \3 \3 \5 \u011f\n \3 \3 \3 \3 \7") - buf.write(" \u0125\n \f \16 \u0128\13 \3!\3!\3\"\3\"\3#\3#\3#\3#") - buf.write("\5#\u0132\n#\3#\2\4(>$\2\4\6\b\n\f\16\20\22\24\26\30\32") - buf.write("\34\36 \"$&(*,.\60\62\64\668:<>@BD\2\b\3\2\f\17\3\2\20") - buf.write("\21\3\2\36\37\3\2\34\35\3\2\"\'\3\2()\2\u0137\2F\3\2\2") - buf.write("\2\4L\3\2\2\2\6P\3\2\2\2\b`\3\2\2\2\nd\3\2\2\2\ff\3\2") - buf.write("\2\2\16l\3\2\2\2\20v\3\2\2\2\22|\3\2\2\2\24\u0083\3\2") - buf.write("\2\2\26\u0086\3\2\2\2\30\u0088\3\2\2\2\32\u008a\3\2\2") - buf.write("\2\34\u008c\3\2\2\2\36\u009b\3\2\2\2 \u00a0\3\2\2\2\"") - buf.write("\u00a5\3\2\2\2$\u00a7\3\2\2\2&\u00a9\3\2\2\2(\u00ba\3") - buf.write("\2\2\2*\u00c9\3\2\2\2,\u00d2\3\2\2\2.\u00d5\3\2\2\2\60") - buf.write("\u00da\3\2\2\2\62\u00e2\3\2\2\2\64\u00ed\3\2\2\2\66\u00ef") - buf.write("\3\2\2\28\u00f4\3\2\2\2:\u0106\3\2\2\2<\u0110\3\2\2\2") - buf.write(">\u011e\3\2\2\2@\u0129\3\2\2\2B\u012b\3\2\2\2D\u0131\3") - buf.write("\2\2\2FG\5\4\3\2GH\7\2\2\3H\3\3\2\2\2IK\5\b\5\2JI\3\2") - buf.write("\2\2KN\3\2\2\2LJ\3\2\2\2LM\3\2\2\2M\5\3\2\2\2NL\3\2\2") - buf.write("\2OQ\5\b\5\2PO\3\2\2\2QR\3\2\2\2RP\3\2\2\2RS\3\2\2\2S") - buf.write("\7\3\2\2\2Ta\5\36\20\2Ua\5 \21\2Va\5\n\6\2Wa\5\20\t\2") - buf.write("Xa\5\24\13\2Ya\5\30\r\2Za\5\22\n\2[a\5\32\16\2\\a\5*\26") - buf.write("\2]a\5\60\31\2^a\58\35\2_a\5\66\34\2`T\3\2\2\2`U\3\2\2") - buf.write("\2`V\3\2\2\2`W\3\2\2\2`X\3\2\2\2`Y\3\2\2\2`Z\3\2\2\2`") - buf.write("[\3\2\2\2`\\\3\2\2\2`]\3\2\2\2`^\3\2\2\2`_\3\2\2\2a\t") - buf.write("\3\2\2\2be\5\f\7\2ce\5\16\b\2db\3\2\2\2dc\3\2\2\2e\13") - buf.write("\3\2\2\2fg\7\3\2\2gh\5> \2hi\7\4\2\2ij\5\6\4\2jk\7\5\2") - buf.write("\2k\r\3\2\2\2lm\7\3\2\2mn\5> \2no\7\4\2\2op\5\6\4\2pq") - buf.write("\7\5\2\2qr\7\6\2\2rs\7\4\2\2st\5\6\4\2tu\7\5\2\2u\17\3") - buf.write("\2\2\2vw\7\7\2\2wx\5D#\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2") - buf.write("{\21\3\2\2\2|}\7\b\2\2}~\7\t\2\2~\177\5(\25\2\177\u0080") - buf.write("\7\n\2\2\u0080\u0081\5(\25\2\u0081\u0082\7\13\2\2\u0082") - buf.write("\23\3\2\2\2\u0083\u0084\5\26\f\2\u0084\u0085\5(\25\2\u0085") - buf.write("\25\3\2\2\2\u0086\u0087\t\2\2\2\u0087\27\3\2\2\2\u0088") - buf.write("\u0089\t\3\2\2\u0089\31\3\2\2\2\u008a\u008b\7\22\2\2\u008b") - buf.write("\33\3\2\2\2\u008c\u0095\7\4\2\2\u008d\u0092\5(\25\2\u008e") - buf.write("\u008f\7\n\2\2\u008f\u0091\5(\25\2\u0090\u008e\3\2\2\2") - buf.write("\u0091\u0094\3\2\2\2\u0092\u0090\3\2\2\2\u0092\u0093\3") - buf.write("\2\2\2\u0093\u0096\3\2\2\2\u0094\u0092\3\2\2\2\u0095\u008d") - buf.write("\3\2\2\2\u0095\u0096\3\2\2\2\u0096\u0097\3\2\2\2\u0097") - buf.write("\u0098\7\5\2\2\u0098\35\3\2\2\2\u0099\u009c\7,\2\2\u009a") - buf.write("\u009c\5\62\32\2\u009b\u0099\3\2\2\2\u009b\u009a\3\2\2") - buf.write("\2\u009c\u009d\3\2\2\2\u009d\u009e\7\23\2\2\u009e\u009f") - buf.write("\5(\25\2\u009f\37\3\2\2\2\u00a0\u00a1\7\24\2\2\u00a1\u00a2") - buf.write("\7\t\2\2\u00a2\u00a3\5(\25\2\u00a3\u00a4\7\13\2\2\u00a4") - buf.write("!\3\2\2\2\u00a5\u00a6\t\4\2\2\u00a6#\3\2\2\2\u00a7\u00a8") - buf.write("\t\5\2\2\u00a8%\3\2\2\2\u00a9\u00aa\7\35\2\2\u00aa\'\3") - buf.write("\2\2\2\u00ab\u00ac\b\25\1\2\u00ac\u00ad\5&\24\2\u00ad") - buf.write("\u00ae\5(\25\b\u00ae\u00bb\3\2\2\2\u00af\u00b0\7\t\2\2") - buf.write("\u00b0\u00b1\5(\25\2\u00b1\u00b2\7\13\2\2\u00b2\u00bb") - buf.write("\3\2\2\2\u00b3\u00bb\5D#\2\u00b4\u00b7\7,\2\2\u00b5\u00b7") - buf.write("\5\62\32\2\u00b6\u00b4\3\2\2\2\u00b6\u00b5\3\2\2\2\u00b7") - buf.write("\u00b8\3\2\2\2\u00b8\u00b9\7\23\2\2\u00b9\u00bb\5(\25") - buf.write("\3\u00ba\u00ab\3\2\2\2\u00ba\u00af\3\2\2\2\u00ba\u00b3") - buf.write("\3\2\2\2\u00ba\u00b6\3\2\2\2\u00bb\u00c6\3\2\2\2\u00bc") - buf.write("\u00bd\f\7\2\2\u00bd\u00be\5\"\22\2\u00be\u00bf\5(\25") - buf.write("\b\u00bf\u00c5\3\2\2\2\u00c0\u00c1\f\6\2\2\u00c1\u00c2") - buf.write("\5$\23\2\u00c2\u00c3\5(\25\7\u00c3\u00c5\3\2\2\2\u00c4") - buf.write("\u00bc\3\2\2\2\u00c4\u00c0\3\2\2\2\u00c5\u00c8\3\2\2\2") - buf.write("\u00c6\u00c4\3\2\2\2\u00c6\u00c7\3\2\2\2\u00c7)\3\2\2") - buf.write("\2\u00c8\u00c6\3\2\2\2\u00c9\u00ca\7\25\2\2\u00ca\u00cb") - buf.write("\7,\2\2\u00cb\u00cc\7\26\2\2\u00cc\u00cd\5,\27\2\u00cd") - buf.write("\u00ce\7\27\2\2\u00ce+\3\2\2\2\u00cf\u00d1\5.\30\2\u00d0") - buf.write("\u00cf\3\2\2\2\u00d1\u00d4\3\2\2\2\u00d2\u00d0\3\2\2\2") - buf.write("\u00d2\u00d3\3\2\2\2\u00d3-\3\2\2\2\u00d4\u00d2\3\2\2") - buf.write("\2\u00d5\u00d6\5\36\20\2\u00d6\u00d7\7\30\2\2\u00d7/\3") - buf.write("\2\2\2\u00d8\u00db\7,\2\2\u00d9\u00db\5\62\32\2\u00da") - buf.write("\u00d8\3\2\2\2\u00da\u00d9\3\2\2\2\u00db\u00dc\3\2\2\2") - buf.write("\u00dc\u00dd\7\23\2\2\u00dd\u00de\7\31\2\2\u00de\u00df") - buf.write("\7,\2\2\u00df\u00e0\7\t\2\2\u00e0\u00e1\7\13\2\2\u00e1") - buf.write("\61\3\2\2\2\u00e2\u00e9\5\64\33\2\u00e3\u00e4\7\32\2\2") - buf.write("\u00e4\u00ea\7,\2\2\u00e5\u00e6\7\4\2\2\u00e6\u00e7\5") - buf.write("(\25\2\u00e7\u00e8\7\5\2\2\u00e8\u00ea\3\2\2\2\u00e9\u00e3") - buf.write("\3\2\2\2\u00e9\u00e5\3\2\2\2\u00ea\u00eb\3\2\2\2\u00eb") - buf.write("\u00e9\3\2\2\2\u00eb\u00ec\3\2\2\2\u00ec\63\3\2\2\2\u00ed") - buf.write("\u00ee\7,\2\2\u00ee\65\3\2\2\2\u00ef\u00f0\7-\2\2\u00f0") - buf.write("\u00f1\7\t\2\2\u00f1\u00f2\5<\37\2\u00f2\u00f3\7\13\2") - buf.write("\2\u00f3\67\3\2\2\2\u00f4\u00f5\7\33\2\2\u00f5\u00f6\7") - buf.write("-\2\2\u00f6\u00f7\7\t\2\2\u00f7\u00f8\5:\36\2\u00f8\u00f9") - buf.write("\7\13\2\2\u00f9\u00fa\7\26\2\2\u00fa\u00fb\5\6\4\2\u00fb") - buf.write("\u00fc\7 \2\2\u00fc\u00fd\7\27\2\2\u00fd9\3\2\2\2\u00fe") - buf.write("\u0103\7,\2\2\u00ff\u0100\7\n\2\2\u0100\u0102\7,\2\2\u0101") - buf.write("\u00ff\3\2\2\2\u0102\u0105\3\2\2\2\u0103\u0101\3\2\2\2") - buf.write("\u0103\u0104\3\2\2\2\u0104\u0107\3\2\2\2\u0105\u0103\3") - buf.write("\2\2\2\u0106\u00fe\3\2\2\2\u0106\u0107\3\2\2\2\u0107;") - buf.write("\3\2\2\2\u0108\u010d\5(\25\2\u0109\u010a\7\n\2\2\u010a") - buf.write("\u010c\5(\25\2\u010b\u0109\3\2\2\2\u010c\u010f\3\2\2\2") - buf.write("\u010d\u010b\3\2\2\2\u010d\u010e\3\2\2\2\u010e\u0111\3") - buf.write("\2\2\2\u010f\u010d\3\2\2\2\u0110\u0108\3\2\2\2\u0110\u0111") - buf.write("\3\2\2\2\u0111=\3\2\2\2\u0112\u0113\b \1\2\u0113\u0114") - buf.write("\7*\2\2\u0114\u011f\5> \7\u0115\u0116\5(\25\2\u0116\u0117") - buf.write("\5@!\2\u0117\u0118\5(\25\2\u0118\u011f\3\2\2\2\u0119\u011f") - buf.write("\7!\2\2\u011a\u011b\7\t\2\2\u011b\u011c\5> \2\u011c\u011d") - buf.write("\7\13\2\2\u011d\u011f\3\2\2\2\u011e\u0112\3\2\2\2\u011e") - buf.write("\u0115\3\2\2\2\u011e\u0119\3\2\2\2\u011e\u011a\3\2\2\2") - buf.write("\u011f\u0126\3\2\2\2\u0120\u0121\f\5\2\2\u0121\u0122\5") - buf.write("B\"\2\u0122\u0123\5> \6\u0123\u0125\3\2\2\2\u0124\u0120") - buf.write("\3\2\2\2\u0125\u0128\3\2\2\2\u0126\u0124\3\2\2\2\u0126") - buf.write("\u0127\3\2\2\2\u0127?\3\2\2\2\u0128\u0126\3\2\2\2\u0129") - buf.write("\u012a\t\6\2\2\u012aA\3\2\2\2\u012b\u012c\t\7\2\2\u012c") - buf.write("C\3\2\2\2\u012d\u0132\7+\2\2\u012e\u0132\7,\2\2\u012f") - buf.write("\u0132\5\34\17\2\u0130\u0132\5\62\32\2\u0131\u012d\3\2") - buf.write("\2\2\u0131\u012e\3\2\2\2\u0131\u012f\3\2\2\2\u0131\u0130") - buf.write("\3\2\2\2\u0132E\3\2\2\2\30LR`d\u0092\u0095\u009b\u00b6") - buf.write("\u00ba\u00c4\u00c6\u00d2\u00da\u00e9\u00eb\u0103\u0106") - buf.write("\u010d\u0110\u011e\u0126\u0131") + buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\3\2\3") + buf.write("\2\3\2\3\3\7\3O\n\3\f\3\16\3R\13\3\3\4\6\4U\n\4\r\4\16") + buf.write("\4V\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3") + buf.write("\5\3\5\5\5g\n\5\3\6\3\6\5\6k\n\6\3\7\3\7\3\7\3\7\3\7\3") + buf.write("\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t") + buf.write("\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13") + buf.write("\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17\3\17\3\17\7\17\u0097") + buf.write("\n\17\f\17\16\17\u009a\13\17\5\17\u009c\n\17\3\17\3\17") + buf.write("\3\20\3\20\5\20\u00a2\n\20\3\20\3\20\3\20\3\21\3\21\3") + buf.write("\21\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25") + buf.write("\3\25\3\25\7\25\u00b6\n\25\f\25\16\25\u00b9\13\25\5\25") + buf.write("\u00bb\n\25\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3") + buf.write("\26\3\26\3\26\5\26\u00c8\n\26\3\26\3\26\5\26\u00cc\n\26") + buf.write("\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\7\26\u00d6\n") + buf.write("\26\f\26\16\26\u00d9\13\26\3\27\3\27\3\27\3\27\3\27\3") + buf.write("\27\3\30\7\30\u00e2\n\30\f\30\16\30\u00e5\13\30\3\31\3") + buf.write("\31\3\31\3\32\3\32\5\32\u00ec\n\32\3\32\3\32\3\32\3\32") + buf.write("\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\6\33\u00fb") + buf.write("\n\33\r\33\16\33\u00fc\3\34\3\34\3\35\3\35\3\35\3\35\3") + buf.write("\35\3\36\3\36\3\36\7\36\u0109\n\36\f\36\16\36\u010c\13") + buf.write("\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37") + buf.write("\3\37\3\37\3 \3 \3 \7 \u011d\n \f \16 \u0120\13 \5 \u0122") + buf.write("\n \3!\3!\3!\7!\u0127\n!\f!\16!\u012a\13!\5!\u012c\n!") + buf.write("\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\5\"\u013a") + buf.write("\n\"\3\"\3\"\3\"\3\"\7\"\u0140\n\"\f\"\16\"\u0143\13\"") + buf.write("\3#\3#\3$\3$\3%\3%\3%\3%\5%\u014d\n%\3%\2\4*B&\2\4\6\b") + buf.write("\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668") + buf.write(":<>@BDFH\2\b\3\2\f\17\3\2\20\21\3\2\37 \3\2\35\36\3\2") + buf.write("\"\'\3\2()\2\u0155\2J\3\2\2\2\4P\3\2\2\2\6T\3\2\2\2\b") + buf.write("f\3\2\2\2\nj\3\2\2\2\fl\3\2\2\2\16r\3\2\2\2\20|\3\2\2") + buf.write("\2\22\u0082\3\2\2\2\24\u0089\3\2\2\2\26\u008c\3\2\2\2") + buf.write("\30\u008e\3\2\2\2\32\u0090\3\2\2\2\34\u0092\3\2\2\2\36") + buf.write("\u00a1\3\2\2\2 \u00a6\3\2\2\2\"\u00ab\3\2\2\2$\u00ad\3") + buf.write("\2\2\2&\u00af\3\2\2\2(\u00b1\3\2\2\2*\u00cb\3\2\2\2,\u00da") + buf.write("\3\2\2\2.\u00e3\3\2\2\2\60\u00e6\3\2\2\2\62\u00eb\3\2") + buf.write("\2\2\64\u00f3\3\2\2\2\66\u00fe\3\2\2\28\u0100\3\2\2\2") + buf.write(":\u0105\3\2\2\2<\u0110\3\2\2\2>\u0121\3\2\2\2@\u012b\3") + buf.write("\2\2\2B\u0139\3\2\2\2D\u0144\3\2\2\2F\u0146\3\2\2\2H\u014c") + buf.write("\3\2\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2MO\5\b\5\2NM\3") + buf.write("\2\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2Q\5\3\2\2\2RP\3\2") + buf.write("\2\2SU\5\b\5\2TS\3\2\2\2UV\3\2\2\2VT\3\2\2\2VW\3\2\2\2") + buf.write("W\7\3\2\2\2Xg\5\36\20\2Yg\5 \21\2Zg\5\n\6\2[g\5\20\t\2") + buf.write("\\g\5\24\13\2]g\5\30\r\2^g\5\22\n\2_g\5\32\16\2`g\5,\27") + buf.write("\2ag\5\62\32\2bg\5<\37\2cg\58\35\2dg\5:\36\2eg\5(\25\2") + buf.write("fX\3\2\2\2fY\3\2\2\2fZ\3\2\2\2f[\3\2\2\2f\\\3\2\2\2f]") + buf.write("\3\2\2\2f^\3\2\2\2f_\3\2\2\2f`\3\2\2\2fa\3\2\2\2fb\3\2") + buf.write("\2\2fc\3\2\2\2fd\3\2\2\2fe\3\2\2\2g\t\3\2\2\2hk\5\f\7") + buf.write("\2ik\5\16\b\2jh\3\2\2\2ji\3\2\2\2k\13\3\2\2\2lm\7\3\2") + buf.write("\2mn\5B\"\2no\7\4\2\2op\5\6\4\2pq\7\5\2\2q\r\3\2\2\2r") + buf.write("s\7\3\2\2st\5B\"\2tu\7\4\2\2uv\5\6\4\2vw\7\5\2\2wx\7\6") + buf.write("\2\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2{\17\3\2\2\2|}\7\7\2") + buf.write("\2}~\5H%\2~\177\7\4\2\2\177\u0080\5\6\4\2\u0080\u0081") + buf.write("\7\5\2\2\u0081\21\3\2\2\2\u0082\u0083\7\b\2\2\u0083\u0084") + buf.write("\7\t\2\2\u0084\u0085\5*\26\2\u0085\u0086\7\n\2\2\u0086") + buf.write("\u0087\5*\26\2\u0087\u0088\7\13\2\2\u0088\23\3\2\2\2\u0089") + buf.write("\u008a\5\26\f\2\u008a\u008b\5*\26\2\u008b\25\3\2\2\2\u008c") + buf.write("\u008d\t\2\2\2\u008d\27\3\2\2\2\u008e\u008f\t\3\2\2\u008f") + buf.write("\31\3\2\2\2\u0090\u0091\7\22\2\2\u0091\33\3\2\2\2\u0092") + buf.write("\u009b\7\4\2\2\u0093\u0098\5*\26\2\u0094\u0095\7\n\2\2") + buf.write("\u0095\u0097\5*\26\2\u0096\u0094\3\2\2\2\u0097\u009a\3") + buf.write("\2\2\2\u0098\u0096\3\2\2\2\u0098\u0099\3\2\2\2\u0099\u009c") + buf.write("\3\2\2\2\u009a\u0098\3\2\2\2\u009b\u0093\3\2\2\2\u009b") + buf.write("\u009c\3\2\2\2\u009c\u009d\3\2\2\2\u009d\u009e\7\5\2\2") + buf.write("\u009e\35\3\2\2\2\u009f\u00a2\7,\2\2\u00a0\u00a2\5\64") + buf.write("\33\2\u00a1\u009f\3\2\2\2\u00a1\u00a0\3\2\2\2\u00a2\u00a3") + buf.write("\3\2\2\2\u00a3\u00a4\7\23\2\2\u00a4\u00a5\5*\26\2\u00a5") + buf.write("\37\3\2\2\2\u00a6\u00a7\7\24\2\2\u00a7\u00a8\7\t\2\2\u00a8") + buf.write("\u00a9\5*\26\2\u00a9\u00aa\7\13\2\2\u00aa!\3\2\2\2\u00ab") + buf.write("\u00ac\t\4\2\2\u00ac#\3\2\2\2\u00ad\u00ae\t\5\2\2\u00ae") + buf.write("%\3\2\2\2\u00af\u00b0\7\36\2\2\u00b0\'\3\2\2\2\u00b1\u00ba") + buf.write("\7\25\2\2\u00b2\u00b7\5*\26\2\u00b3\u00b4\7\n\2\2\u00b4") + buf.write("\u00b6\5*\26\2\u00b5\u00b3\3\2\2\2\u00b6\u00b9\3\2\2\2") + buf.write("\u00b7\u00b5\3\2\2\2\u00b7\u00b8\3\2\2\2\u00b8\u00bb\3") + buf.write("\2\2\2\u00b9\u00b7\3\2\2\2\u00ba\u00b2\3\2\2\2\u00ba\u00bb") + buf.write("\3\2\2\2\u00bb)\3\2\2\2\u00bc\u00bd\b\26\1\2\u00bd\u00be") + buf.write("\5&\24\2\u00be\u00bf\5*\26\b\u00bf\u00cc\3\2\2\2\u00c0") + buf.write("\u00c1\7\t\2\2\u00c1\u00c2\5*\26\2\u00c2\u00c3\7\13\2") + buf.write("\2\u00c3\u00cc\3\2\2\2\u00c4\u00cc\5H%\2\u00c5\u00c8\7") + buf.write(",\2\2\u00c6\u00c8\5\64\33\2\u00c7\u00c5\3\2\2\2\u00c7") + buf.write("\u00c6\3\2\2\2\u00c8\u00c9\3\2\2\2\u00c9\u00ca\7\23\2") + buf.write("\2\u00ca\u00cc\5*\26\3\u00cb\u00bc\3\2\2\2\u00cb\u00c0") + buf.write("\3\2\2\2\u00cb\u00c4\3\2\2\2\u00cb\u00c7\3\2\2\2\u00cc") + buf.write("\u00d7\3\2\2\2\u00cd\u00ce\f\7\2\2\u00ce\u00cf\5\"\22") + buf.write("\2\u00cf\u00d0\5*\26\b\u00d0\u00d6\3\2\2\2\u00d1\u00d2") + buf.write("\f\6\2\2\u00d2\u00d3\5$\23\2\u00d3\u00d4\5*\26\7\u00d4") + buf.write("\u00d6\3\2\2\2\u00d5\u00cd\3\2\2\2\u00d5\u00d1\3\2\2\2") + buf.write("\u00d6\u00d9\3\2\2\2\u00d7\u00d5\3\2\2\2\u00d7\u00d8\3") + buf.write("\2\2\2\u00d8+\3\2\2\2\u00d9\u00d7\3\2\2\2\u00da\u00db") + buf.write("\7\26\2\2\u00db\u00dc\7,\2\2\u00dc\u00dd\7\27\2\2\u00dd") + buf.write("\u00de\5.\30\2\u00de\u00df\7\30\2\2\u00df-\3\2\2\2\u00e0") + buf.write("\u00e2\5\60\31\2\u00e1\u00e0\3\2\2\2\u00e2\u00e5\3\2\2") + buf.write("\2\u00e3\u00e1\3\2\2\2\u00e3\u00e4\3\2\2\2\u00e4/\3\2") + buf.write("\2\2\u00e5\u00e3\3\2\2\2\u00e6\u00e7\5\36\20\2\u00e7\u00e8") + buf.write("\7\31\2\2\u00e8\61\3\2\2\2\u00e9\u00ec\7,\2\2\u00ea\u00ec") + buf.write("\5\64\33\2\u00eb\u00e9\3\2\2\2\u00eb\u00ea\3\2\2\2\u00ec") + buf.write("\u00ed\3\2\2\2\u00ed\u00ee\7\23\2\2\u00ee\u00ef\7\32\2") + buf.write("\2\u00ef\u00f0\7,\2\2\u00f0\u00f1\7\t\2\2\u00f1\u00f2") + buf.write("\7\13\2\2\u00f2\63\3\2\2\2\u00f3\u00fa\5\66\34\2\u00f4") + buf.write("\u00f5\7\33\2\2\u00f5\u00fb\7,\2\2\u00f6\u00f7\7\4\2\2") + buf.write("\u00f7\u00f8\5*\26\2\u00f8\u00f9\7\5\2\2\u00f9\u00fb\3") + buf.write("\2\2\2\u00fa\u00f4\3\2\2\2\u00fa\u00f6\3\2\2\2\u00fb\u00fc") + buf.write("\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd") + buf.write("\65\3\2\2\2\u00fe\u00ff\7,\2\2\u00ff\67\3\2\2\2\u0100") + buf.write("\u0101\7-\2\2\u0101\u0102\7\t\2\2\u0102\u0103\5@!\2\u0103") + buf.write("\u0104\7\13\2\2\u01049\3\2\2\2\u0105\u010a\7,\2\2\u0106") + buf.write("\u0107\7\n\2\2\u0107\u0109\7,\2\2\u0108\u0106\3\2\2\2") + buf.write("\u0109\u010c\3\2\2\2\u010a\u0108\3\2\2\2\u010a\u010b\3") + buf.write("\2\2\2\u010b\u010d\3\2\2\2\u010c\u010a\3\2\2\2\u010d\u010e") + buf.write("\7\23\2\2\u010e\u010f\58\35\2\u010f;\3\2\2\2\u0110\u0111") + buf.write("\7\34\2\2\u0111\u0112\7-\2\2\u0112\u0113\7\t\2\2\u0113") + buf.write("\u0114\5> \2\u0114\u0115\7\13\2\2\u0115\u0116\7\27\2\2") + buf.write("\u0116\u0117\5\6\4\2\u0117\u0118\7\30\2\2\u0118=\3\2\2") + buf.write("\2\u0119\u011e\7,\2\2\u011a\u011b\7\n\2\2\u011b\u011d") + buf.write("\7,\2\2\u011c\u011a\3\2\2\2\u011d\u0120\3\2\2\2\u011e") + buf.write("\u011c\3\2\2\2\u011e\u011f\3\2\2\2\u011f\u0122\3\2\2\2") + buf.write("\u0120\u011e\3\2\2\2\u0121\u0119\3\2\2\2\u0121\u0122\3") + buf.write("\2\2\2\u0122?\3\2\2\2\u0123\u0128\5*\26\2\u0124\u0125") + buf.write("\7\n\2\2\u0125\u0127\5*\26\2\u0126\u0124\3\2\2\2\u0127") + buf.write("\u012a\3\2\2\2\u0128\u0126\3\2\2\2\u0128\u0129\3\2\2\2") + buf.write("\u0129\u012c\3\2\2\2\u012a\u0128\3\2\2\2\u012b\u0123\3") + buf.write("\2\2\2\u012b\u012c\3\2\2\2\u012cA\3\2\2\2\u012d\u012e") + buf.write("\b\"\1\2\u012e\u012f\7*\2\2\u012f\u013a\5B\"\7\u0130\u0131") + buf.write("\5*\26\2\u0131\u0132\5D#\2\u0132\u0133\5*\26\2\u0133\u013a") + buf.write("\3\2\2\2\u0134\u013a\7!\2\2\u0135\u0136\7\t\2\2\u0136") + buf.write("\u0137\5B\"\2\u0137\u0138\7\13\2\2\u0138\u013a\3\2\2\2") + buf.write("\u0139\u012d\3\2\2\2\u0139\u0130\3\2\2\2\u0139\u0134\3") + buf.write("\2\2\2\u0139\u0135\3\2\2\2\u013a\u0141\3\2\2\2\u013b\u013c") + buf.write("\f\5\2\2\u013c\u013d\5F$\2\u013d\u013e\5B\"\6\u013e\u0140") + buf.write("\3\2\2\2\u013f\u013b\3\2\2\2\u0140\u0143\3\2\2\2\u0141") + buf.write("\u013f\3\2\2\2\u0141\u0142\3\2\2\2\u0142C\3\2\2\2\u0143") + buf.write("\u0141\3\2\2\2\u0144\u0145\t\6\2\2\u0145E\3\2\2\2\u0146") + buf.write("\u0147\t\7\2\2\u0147G\3\2\2\2\u0148\u014d\7+\2\2\u0149") + buf.write("\u014d\7,\2\2\u014a\u014d\5\34\17\2\u014b\u014d\5\64\33") + buf.write("\2\u014c\u0148\3\2\2\2\u014c\u0149\3\2\2\2\u014c\u014a") + buf.write("\3\2\2\2\u014c\u014b\3\2\2\2\u014dI\3\2\2\2\33PVfj\u0098") + buf.write("\u009b\u00a1\u00b7\u00ba\u00c7\u00cb\u00d5\u00d7\u00e3") + buf.write("\u00eb\u00fa\u00fc\u010a\u011e\u0121\u0128\u012b\u0139") + buf.write("\u0141\u014c") return buf.getvalue() @@ -154,10 +168,10 @@ class tlangParser ( Parser ): literalNames = [ "", "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", "'penup'", "'pendown'", "'pause'", - "'='", "'print'", "'class'", "'{'", "'}'", "';'", "'new'", - "'.'", "'def'", "'+'", "'-'", "'*'", "'/'", "'return'", - "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", - "'>='", "'&&'", "'||'", "'!'" ] + "'='", "'print'", "'return'", "'class'", "'{'", "'}'", + "';'", "'new'", "'.'", "'def'", "'+'", "'-'", "'*'", + "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", + "'<='", "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", "", "", "", "", "", "", "", @@ -165,8 +179,8 @@ class tlangParser ( Parser ): "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "PLUS", "MINUS", "MUL", - "DIV", "RETURN", "PENCOND", "LT", "GT", "EQ", "NEQ", + "", "", "", "PLUS", "MINUS", + "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", "Whitespace" ] @@ -189,31 +203,34 @@ class tlangParser ( Parser ): RULE_multiplicative = 16 RULE_additive = 17 RULE_unaryArithOp = 18 - RULE_expression = 19 - RULE_classDeclaration = 20 - RULE_classBody = 21 - RULE_classAttributeDeclaration = 22 - RULE_objectInstantiation = 23 - RULE_objectOrArrayAccess = 24 - RULE_baseAccess = 25 - RULE_functionCall = 26 - RULE_functionDeclaration = 27 - RULE_parameters = 28 - RULE_arguments = 29 - RULE_condition = 30 - RULE_binCondOp = 31 - RULE_logicOp = 32 - RULE_value = 33 + RULE_returnStatement = 19 + RULE_expression = 20 + RULE_classDeclaration = 21 + RULE_classBody = 22 + RULE_classAttributeDeclaration = 23 + RULE_objectInstantiation = 24 + RULE_objectOrArrayAccess = 25 + RULE_baseAccess = 26 + RULE_functionCall = 27 + RULE_functionCallWithReturnValues = 28 + RULE_functionDeclaration = 29 + RULE_parameters = 30 + RULE_arguments = 31 + RULE_condition = 32 + RULE_binCondOp = 33 + RULE_logicOp = 34 + RULE_value = 35 ruleNames = [ "start", "instruction_list", "strict_ilist", "instruction", "conditional", "ifConditional", "ifElseConditional", "loop", "gotoCommand", "moveCommand", "moveOp", "penCommand", "pauseCommand", "array", "assignment", "printStatement", - "multiplicative", "additive", "unaryArithOp", "expression", - "classDeclaration", "classBody", "classAttributeDeclaration", + "multiplicative", "additive", "unaryArithOp", "returnStatement", + "expression", "classDeclaration", "classBody", "classAttributeDeclaration", "objectInstantiation", "objectOrArrayAccess", "baseAccess", - "functionCall", "functionDeclaration", "parameters", - "arguments", "condition", "binCondOp", "logicOp", "value" ] + "functionCall", "functionCallWithReturnValues", "functionDeclaration", + "parameters", "arguments", "condition", "binCondOp", + "logicOp", "value" ] EOF = Token.EOF T__0=1 @@ -241,11 +258,11 @@ class tlangParser ( Parser ): T__22=23 T__23=24 T__24=25 - PLUS=26 - MINUS=27 - MUL=28 - DIV=29 - RETURN=30 + T__25=26 + PLUS=27 + MINUS=28 + MUL=29 + DIV=30 PENCOND=31 LT=32 GT=33 @@ -301,9 +318,9 @@ def start(self): self.enterRule(localctx, 0, self.RULE_start) try: self.enterOuterAlt(localctx, 1) - self.state = 68 + self.state = 72 self.instruction_list() - self.state = 69 + self.state = 73 self.match(tlangParser.EOF) except RecognitionException as re: localctx.exception = re @@ -346,13 +363,13 @@ def instruction_list(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 74 + self.state = 78 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 71 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__25) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): + self.state = 75 self.instruction() - self.state = 76 + self.state = 80 self._errHandler.sync(self) _la = self._input.LA(1) @@ -397,16 +414,16 @@ def strict_ilist(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 78 + self.state = 82 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 77 + self.state = 81 self.instruction() - self.state = 80 + self.state = 84 self._errHandler.sync(self) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__25) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): break except RecognitionException as re: @@ -472,6 +489,14 @@ def functionCall(self): return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) + def functionCallWithReturnValues(self): + return self.getTypedRuleContext(tlangParser.FunctionCallWithReturnValuesContext,0) + + + def returnStatement(self): + return self.getTypedRuleContext(tlangParser.ReturnStatementContext,0) + + def getRuleIndex(self): return tlangParser.RULE_instruction @@ -489,81 +514,93 @@ def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) self.enterRule(localctx, 6, self.RULE_instruction) try: - self.state = 94 + self.state = 100 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,2,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 82 + self.state = 86 self.assignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 83 + self.state = 87 self.printStatement() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 84 + self.state = 88 self.conditional() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 85 + self.state = 89 self.loop() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 86 + self.state = 90 self.moveCommand() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 87 + self.state = 91 self.penCommand() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 88 + self.state = 92 self.gotoCommand() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 89 + self.state = 93 self.pauseCommand() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 90 + self.state = 94 self.classDeclaration() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 91 + self.state = 95 self.objectInstantiation() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 92 + self.state = 96 self.functionDeclaration() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 93 + self.state = 97 self.functionCall() pass + elif la_ == 13: + self.enterOuterAlt(localctx, 13) + self.state = 98 + self.functionCallWithReturnValues() + pass + + elif la_ == 14: + self.enterOuterAlt(localctx, 14) + self.state = 99 + self.returnStatement() + pass + except RecognitionException as re: localctx.exception = re @@ -605,18 +642,18 @@ def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) self.enterRule(localctx, 8, self.RULE_conditional) try: - self.state = 98 + self.state = 104 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,3,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 96 + self.state = 102 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 97 + self.state = 103 self.ifElseConditional() pass @@ -662,15 +699,15 @@ def ifConditional(self): self.enterRule(localctx, 10, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 100 + self.state = 106 self.match(tlangParser.T__0) - self.state = 101 + self.state = 107 self.condition(0) - self.state = 102 + self.state = 108 self.match(tlangParser.T__1) - self.state = 103 + self.state = 109 self.strict_ilist() - self.state = 104 + self.state = 110 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -716,23 +753,23 @@ def ifElseConditional(self): self.enterRule(localctx, 12, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 106 + self.state = 112 self.match(tlangParser.T__0) - self.state = 107 + self.state = 113 self.condition(0) - self.state = 108 + self.state = 114 self.match(tlangParser.T__1) - self.state = 109 + self.state = 115 self.strict_ilist() - self.state = 110 + self.state = 116 self.match(tlangParser.T__2) - self.state = 111 + self.state = 117 self.match(tlangParser.T__3) - self.state = 112 + self.state = 118 self.match(tlangParser.T__1) - self.state = 113 + self.state = 119 self.strict_ilist() - self.state = 114 + self.state = 120 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -775,15 +812,15 @@ def loop(self): self.enterRule(localctx, 14, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 116 + self.state = 122 self.match(tlangParser.T__4) - self.state = 117 + self.state = 123 self.value() - self.state = 118 + self.state = 124 self.match(tlangParser.T__1) - self.state = 119 + self.state = 125 self.strict_ilist() - self.state = 120 + self.state = 126 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -825,17 +862,17 @@ def gotoCommand(self): self.enterRule(localctx, 16, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 122 + self.state = 128 self.match(tlangParser.T__5) - self.state = 123 + self.state = 129 self.match(tlangParser.T__6) - self.state = 124 + self.state = 130 self.expression(0) - self.state = 125 + self.state = 131 self.match(tlangParser.T__7) - self.state = 126 + self.state = 132 self.expression(0) - self.state = 127 + self.state = 133 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -878,9 +915,9 @@ def moveCommand(self): self.enterRule(localctx, 18, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 129 + self.state = 135 self.moveOp() - self.state = 130 + self.state = 136 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -917,7 +954,7 @@ def moveOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 132 + self.state = 138 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -959,7 +996,7 @@ def penCommand(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 134 + self.state = 140 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -1000,7 +1037,7 @@ def pauseCommand(self): self.enterRule(localctx, 24, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 136 + self.state = 142 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -1043,29 +1080,29 @@ def array(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 138 + self.state = 144 self.match(tlangParser.T__1) - self.state = 147 + self.state = 153 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.VAR))) != 0): - self.state = 139 + self.state = 145 self.expression(0) - self.state = 144 + self.state = 150 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 140 + self.state = 146 self.match(tlangParser.T__7) - self.state = 141 + self.state = 147 self.expression(0) - self.state = 146 + self.state = 152 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 149 + self.state = 155 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -1111,23 +1148,23 @@ def assignment(self): self.enterRule(localctx, 28, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 153 + self.state = 159 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,6,self._ctx) if la_ == 1: - self.state = 151 + self.state = 157 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 152 + self.state = 158 self.objectOrArrayAccess() pass - self.state = 155 + self.state = 161 self.match(tlangParser.T__16) - self.state = 156 + self.state = 162 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1166,13 +1203,13 @@ def printStatement(self): self.enterRule(localctx, 30, self.RULE_printStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 158 + self.state = 164 self.match(tlangParser.T__17) - self.state = 159 + self.state = 165 self.match(tlangParser.T__6) - self.state = 160 + self.state = 166 self.expression(0) - self.state = 161 + self.state = 167 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1214,7 +1251,7 @@ def multiplicative(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 163 + self.state = 169 _la = self._input.LA(1) if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) @@ -1261,7 +1298,7 @@ def additive(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 165 + self.state = 171 _la = self._input.LA(1) if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) @@ -1304,7 +1341,7 @@ def unaryArithOp(self): self.enterRule(localctx, 36, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 167 + self.state = 173 self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re @@ -1315,6 +1352,69 @@ def unaryArithOp(self): return localctx + class ReturnStatementContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def expression(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.ExpressionContext) + else: + return self.getTypedRuleContext(tlangParser.ExpressionContext,i) + + + def getRuleIndex(self): + return tlangParser.RULE_returnStatement + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitReturnStatement" ): + return visitor.visitReturnStatement(self) + else: + return visitor.visitChildren(self) + + + + + def returnStatement(self): + + localctx = tlangParser.ReturnStatementContext(self, self._ctx, self.state) + self.enterRule(localctx, 38, self.RULE_returnStatement) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 175 + self.match(tlangParser.T__18) + self.state = 184 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input,8,self._ctx) + if la_ == 1: + self.state = 176 + self.expression(0) + self.state = 181 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==tlangParser.T__7: + self.state = 177 + self.match(tlangParser.T__7) + self.state = 178 + self.expression(0) + self.state = 183 + self._errHandler.sync(self) + _la = self._input.LA(1) + + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class ExpressionContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -1458,21 +1558,21 @@ def expression(self, _p:int=0): _parentState = self.state localctx = tlangParser.ExpressionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 38 - self.enterRecursionRule(localctx, 38, self.RULE_expression, _p) + _startState = 40 + self.enterRecursionRule(localctx, 40, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 184 + self.state = 201 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,8,self._ctx) + la_ = self._interp.adaptivePredict(self._input,10,self._ctx) if la_ == 1: localctx = tlangParser.UnaryExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 170 + self.state = 187 self.unaryArithOp() - self.state = 171 + self.state = 188 self.expression(6) pass @@ -1480,11 +1580,11 @@ def expression(self, _p:int=0): localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 173 + self.state = 190 self.match(tlangParser.T__6) - self.state = 174 + self.state = 191 self.expression(0) - self.state = 175 + self.state = 192 self.match(tlangParser.T__8) pass @@ -1492,7 +1592,7 @@ def expression(self, _p:int=0): localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 177 + self.state = 194 self.value() pass @@ -1500,69 +1600,69 @@ def expression(self, _p:int=0): localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 180 + self.state = 197 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,7,self._ctx) + la_ = self._interp.adaptivePredict(self._input,9,self._ctx) if la_ == 1: - self.state = 178 + self.state = 195 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 179 + self.state = 196 self.objectOrArrayAccess() pass - self.state = 182 + self.state = 199 self.match(tlangParser.T__16) - self.state = 183 + self.state = 200 self.expression(1) pass self._ctx.stop = self._input.LT(-1) - self.state = 196 + self.state = 213 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,10,self._ctx) + _alt = self._interp.adaptivePredict(self._input,12,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 194 + self.state = 211 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,9,self._ctx) + la_ = self._interp.adaptivePredict(self._input,11,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 186 + self.state = 203 if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 187 + self.state = 204 self.multiplicative() - self.state = 188 + self.state = 205 self.expression(6) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 190 + self.state = 207 if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") - self.state = 191 + self.state = 208 self.additive() - self.state = 192 + self.state = 209 self.expression(5) pass - self.state = 198 + self.state = 215 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,10,self._ctx) + _alt = self._interp.adaptivePredict(self._input,12,self._ctx) except RecognitionException as re: localctx.exception = re @@ -1601,19 +1701,19 @@ def accept(self, visitor:ParseTreeVisitor): def classDeclaration(self): localctx = tlangParser.ClassDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 40, self.RULE_classDeclaration) + self.enterRule(localctx, 42, self.RULE_classDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 199 - self.match(tlangParser.T__18) - self.state = 200 - self.match(tlangParser.VAR) - self.state = 201 + self.state = 216 self.match(tlangParser.T__19) - self.state = 202 - self.classBody() - self.state = 203 + self.state = 217 + self.match(tlangParser.VAR) + self.state = 218 self.match(tlangParser.T__20) + self.state = 219 + self.classBody() + self.state = 220 + self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -1651,17 +1751,17 @@ def accept(self, visitor:ParseTreeVisitor): def classBody(self): localctx = tlangParser.ClassBodyContext(self, self._ctx, self.state) - self.enterRule(localctx, 42, self.RULE_classBody) + self.enterRule(localctx, 44, self.RULE_classBody) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 208 + self.state = 225 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 205 + self.state = 222 self.classAttributeDeclaration() - self.state = 210 + self.state = 227 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1699,13 +1799,13 @@ def accept(self, visitor:ParseTreeVisitor): def classAttributeDeclaration(self): localctx = tlangParser.ClassAttributeDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 44, self.RULE_classAttributeDeclaration) + self.enterRule(localctx, 46, self.RULE_classAttributeDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 211 + self.state = 228 self.assignment() - self.state = 212 - self.match(tlangParser.T__21) + self.state = 229 + self.match(tlangParser.T__22) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -1746,32 +1846,32 @@ def accept(self, visitor:ParseTreeVisitor): def objectInstantiation(self): localctx = tlangParser.ObjectInstantiationContext(self, self._ctx, self.state) - self.enterRule(localctx, 46, self.RULE_objectInstantiation) + self.enterRule(localctx, 48, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 216 + self.state = 233 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,12,self._ctx) + la_ = self._interp.adaptivePredict(self._input,14,self._ctx) if la_ == 1: - self.state = 214 + self.state = 231 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 215 + self.state = 232 self.objectOrArrayAccess() pass - self.state = 218 + self.state = 235 self.match(tlangParser.T__16) - self.state = 219 - self.match(tlangParser.T__22) - self.state = 220 + self.state = 236 + self.match(tlangParser.T__23) + self.state = 237 self.match(tlangParser.VAR) - self.state = 221 + self.state = 238 self.match(tlangParser.T__6) - self.state = 222 + self.state = 239 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1820,31 +1920,31 @@ def accept(self, visitor:ParseTreeVisitor): def objectOrArrayAccess(self): localctx = tlangParser.ObjectOrArrayAccessContext(self, self._ctx, self.state) - self.enterRule(localctx, 48, self.RULE_objectOrArrayAccess) + self.enterRule(localctx, 50, self.RULE_objectOrArrayAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 224 + self.state = 241 self.baseAccess() - self.state = 231 + self.state = 248 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 231 + self.state = 248 self._errHandler.sync(self) token = self._input.LA(1) - if token in [tlangParser.T__23]: - self.state = 225 - self.match(tlangParser.T__23) - self.state = 226 + if token in [tlangParser.T__24]: + self.state = 242 + self.match(tlangParser.T__24) + self.state = 243 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 227 + self.state = 244 self.match(tlangParser.T__1) - self.state = 228 + self.state = 245 self.expression(0) - self.state = 229 + self.state = 246 self.match(tlangParser.T__2) pass else: @@ -1853,9 +1953,9 @@ def objectOrArrayAccess(self): else: raise NoViableAltException(self) - self.state = 233 + self.state = 250 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,14,self._ctx) + _alt = self._interp.adaptivePredict(self._input,16,self._ctx) except RecognitionException as re: localctx.exception = re @@ -1890,10 +1990,10 @@ def accept(self, visitor:ParseTreeVisitor): def baseAccess(self): localctx = tlangParser.BaseAccessContext(self, self._ctx, self.state) - self.enterRule(localctx, 50, self.RULE_baseAccess) + self.enterRule(localctx, 52, self.RULE_baseAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 235 + self.state = 252 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -1932,16 +2032,16 @@ def accept(self, visitor:ParseTreeVisitor): def functionCall(self): localctx = tlangParser.FunctionCallContext(self, self._ctx, self.state) - self.enterRule(localctx, 52, self.RULE_functionCall) + self.enterRule(localctx, 54, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 237 + self.state = 254 self.match(tlangParser.NAME) - self.state = 238 + self.state = 255 self.match(tlangParser.T__6) - self.state = 239 + self.state = 256 self.arguments() - self.state = 240 + self.state = 257 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1952,6 +2052,68 @@ def functionCall(self): return localctx + class FunctionCallWithReturnValuesContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def VAR(self, i:int=None): + if i is None: + return self.getTokens(tlangParser.VAR) + else: + return self.getToken(tlangParser.VAR, i) + + def functionCall(self): + return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) + + + def getRuleIndex(self): + return tlangParser.RULE_functionCallWithReturnValues + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitFunctionCallWithReturnValues" ): + return visitor.visitFunctionCallWithReturnValues(self) + else: + return visitor.visitChildren(self) + + + + + def functionCallWithReturnValues(self): + + localctx = tlangParser.FunctionCallWithReturnValuesContext(self, self._ctx, self.state) + self.enterRule(localctx, 56, self.RULE_functionCallWithReturnValues) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 259 + self.match(tlangParser.VAR) + self.state = 264 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==tlangParser.T__7: + self.state = 260 + self.match(tlangParser.T__7) + self.state = 261 + self.match(tlangParser.VAR) + self.state = 266 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 267 + self.match(tlangParser.T__16) + self.state = 268 + self.functionCall() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class FunctionDeclarationContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -1969,9 +2131,6 @@ def strict_ilist(self): return self.getTypedRuleContext(tlangParser.Strict_ilistContext,0) - def RETURN(self): - return self.getToken(tlangParser.RETURN, 0) - def getRuleIndex(self): return tlangParser.RULE_functionDeclaration @@ -1987,27 +2146,25 @@ def accept(self, visitor:ParseTreeVisitor): def functionDeclaration(self): localctx = tlangParser.FunctionDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 54, self.RULE_functionDeclaration) + self.enterRule(localctx, 58, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 242 - self.match(tlangParser.T__24) - self.state = 243 + self.state = 270 + self.match(tlangParser.T__25) + self.state = 271 self.match(tlangParser.NAME) - self.state = 244 + self.state = 272 self.match(tlangParser.T__6) - self.state = 245 + self.state = 273 self.parameters() - self.state = 246 + self.state = 274 self.match(tlangParser.T__8) - self.state = 247 - self.match(tlangParser.T__19) - self.state = 248 - self.strict_ilist() - self.state = 249 - self.match(tlangParser.RETURN) - self.state = 250 + self.state = 275 self.match(tlangParser.T__20) + self.state = 276 + self.strict_ilist() + self.state = 277 + self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -2044,25 +2201,25 @@ def accept(self, visitor:ParseTreeVisitor): def parameters(self): localctx = tlangParser.ParametersContext(self, self._ctx, self.state) - self.enterRule(localctx, 56, self.RULE_parameters) + self.enterRule(localctx, 60, self.RULE_parameters) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 260 + self.state = 287 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.VAR: - self.state = 252 + self.state = 279 self.match(tlangParser.VAR) - self.state = 257 + self.state = 284 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 253 + self.state = 280 self.match(tlangParser.T__7) - self.state = 254 + self.state = 281 self.match(tlangParser.VAR) - self.state = 259 + self.state = 286 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2105,25 +2262,25 @@ def accept(self, visitor:ParseTreeVisitor): def arguments(self): localctx = tlangParser.ArgumentsContext(self, self._ctx, self.state) - self.enterRule(localctx, 58, self.RULE_arguments) + self.enterRule(localctx, 62, self.RULE_arguments) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 270 + self.state = 297 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.VAR))) != 0): - self.state = 262 + self.state = 289 self.expression(0) - self.state = 267 + self.state = 294 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 263 + self.state = 290 self.match(tlangParser.T__7) - self.state = 264 + self.state = 291 self.expression(0) - self.state = 269 + self.state = 296 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2188,48 +2345,48 @@ def condition(self, _p:int=0): _parentState = self.state localctx = tlangParser.ConditionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 60 - self.enterRecursionRule(localctx, 60, self.RULE_condition, _p) + _startState = 64 + self.enterRecursionRule(localctx, 64, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 284 + self.state = 311 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,19,self._ctx) + la_ = self._interp.adaptivePredict(self._input,22,self._ctx) if la_ == 1: - self.state = 273 + self.state = 300 self.match(tlangParser.NOT) - self.state = 274 + self.state = 301 self.condition(5) pass elif la_ == 2: - self.state = 275 + self.state = 302 self.expression(0) - self.state = 276 + self.state = 303 self.binCondOp() - self.state = 277 + self.state = 304 self.expression(0) pass elif la_ == 3: - self.state = 279 + self.state = 306 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 280 + self.state = 307 self.match(tlangParser.T__6) - self.state = 281 + self.state = 308 self.condition(0) - self.state = 282 + self.state = 309 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 292 + self.state = 319 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,20,self._ctx) + _alt = self._interp.adaptivePredict(self._input,23,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -2237,17 +2394,17 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 286 + self.state = 313 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 287 + self.state = 314 self.logicOp() - self.state = 288 + self.state = 315 self.condition(4) - self.state = 294 + self.state = 321 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,20,self._ctx) + _alt = self._interp.adaptivePredict(self._input,23,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2297,11 +2454,11 @@ def accept(self, visitor:ParseTreeVisitor): def binCondOp(self): localctx = tlangParser.BinCondOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 62, self.RULE_binCondOp) + self.enterRule(localctx, 66, self.RULE_binCondOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 295 + self.state = 322 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2344,11 +2501,11 @@ def accept(self, visitor:ParseTreeVisitor): def logicOp(self): localctx = tlangParser.LogicOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 64, self.RULE_logicOp) + self.enterRule(localctx, 68, self.RULE_logicOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 297 + self.state = 324 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2399,32 +2556,32 @@ def accept(self, visitor:ParseTreeVisitor): def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) - self.enterRule(localctx, 66, self.RULE_value) + self.enterRule(localctx, 70, self.RULE_value) try: - self.state = 303 + self.state = 330 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,21,self._ctx) + la_ = self._interp.adaptivePredict(self._input,24,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 299 + self.state = 326 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 300 + self.state = 327 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 301 + self.state = 328 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 302 + self.state = 329 self.objectOrArrayAccess() pass @@ -2442,8 +2599,8 @@ def value(self): def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): if self._predicates == None: self._predicates = dict() - self._predicates[19] = self.expression_sempred - self._predicates[30] = self.condition_sempred + self._predicates[20] = self.expression_sempred + self._predicates[32] = self.condition_sempred pred = self._predicates.get(ruleIndex, None) if pred is None: raise Exception("No predicate with index:" + str(ruleIndex)) diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index a054503..3a3448f 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -104,6 +104,11 @@ def visitUnaryArithOp(self, ctx:tlangParser.UnaryArithOpContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#returnStatement. + def visitReturnStatement(self, ctx:tlangParser.ReturnStatementContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#unaryExpr. def visitUnaryExpr(self, ctx:tlangParser.UnaryExprContext): return self.visitChildren(ctx) @@ -169,6 +174,11 @@ def visitFunctionCall(self, ctx:tlangParser.FunctionCallContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#functionCallWithReturnValues. + def visitFunctionCallWithReturnValues(self, ctx:tlangParser.FunctionCallWithReturnValuesContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#functionDeclaration. def visitFunctionDeclaration(self, ctx:tlangParser.FunctionDeclarationContext): return self.visitChildren(ctx) From aeff8134f82b5550b3abb4b307fa2920f0d870d9 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Thu, 20 Feb 2025 15:39:37 +0530 Subject: [PATCH 07/47] rangoli code added --- ChironCore/ChironAST/ChironAST.py | 7 + ChironCore/ChironAST/builder.py | 2 + ChironCore/example/example2.tl | 2 - ChironCore/example/exampleFC.tl | 74 ++++--- ChironCore/example/issues.txt | 6 + ChironCore/example/kachuapur3.tl | 19 +- ChironCore/example/library.tl | 38 ++++ ChironCore/example/rangoli.tl | 60 ++++++ ChironCore/turtparse/tlang.g4 | 3 +- ChironCore/turtparse/tlang.interp | 4 +- ChironCore/turtparse/tlang.tokens | 7 +- ChironCore/turtparse/tlangLexer.interp | 5 +- ChironCore/turtparse/tlangLexer.py | 227 +++++++++++----------- ChironCore/turtparse/tlangLexer.tokens | 7 +- ChironCore/turtparse/tlangParser.py | 257 +++++++++++++------------ 15 files changed, 437 insertions(+), 281 deletions(-) create mode 100644 ChironCore/example/issues.txt create mode 100644 ChironCore/example/library.tl create mode 100644 ChironCore/example/rangoli.tl diff --git a/ChironCore/ChironAST/ChironAST.py b/ChironCore/ChironAST/ChironAST.py index fe54b30..1d6b537 100644 --- a/ChironCore/ChironAST/ChironAST.py +++ b/ChironCore/ChironAST/ChironAST.py @@ -297,6 +297,13 @@ def __init__(self, v): def __str__(self): return str(self.val) +class Real(Value): + def __init__(self, v): + self.val = float(v) + + def __str__(self): + return str(self.val) + class Var(Value): def __init__(self, vname): diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 3205410..7ebb875 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -148,6 +148,8 @@ def visitClassDeclaration(self, ctx: tlangParser.ClassDeclarationContext): def visitValue(self, ctx: tlangParser.ValueContext): if ctx.NUM(): return ChironAST.Num(ctx.NUM().getText()) + if ctx.REAL(): + return ChironAST.Real(ctx.REAL().getText()) elif ctx.VAR(): return ChironAST.Var(ctx.VAR().getText()) elif ctx.array(): diff --git a/ChironCore/example/example2.tl b/ChironCore/example/example2.tl index 7d2984e..bacdeb1 100644 --- a/ChironCore/example/example2.tl +++ b/ChironCore/example/example2.tl @@ -1,8 +1,6 @@ penup goto (50, 50) pendown -:two = 200 -:one = 100 forward 50 right 90 forward 50 diff --git a/ChironCore/example/exampleFC.tl b/ChironCore/example/exampleFC.tl index 9368042..da1b1c7 100644 --- a/ChironCore/example/exampleFC.tl +++ b/ChironCore/example/exampleFC.tl @@ -1,35 +1,59 @@ + def drawRectangle(:l, :b) { - if :l == 0 [ - return - ] - if :l <= 1 [ - :b = :b + 40 - ] else [ - :b = :b + 22 - ] - drawRectangle(:l - 1, :b) + penup + goto (:l, :b) + pendown + forward :l + right 90 + forward :b + right 90 + forward :l + right 90 + forward :b + penup return } def drawCircle() { - :r = 10 - :p1 = 80 - :p2 = 80 - if :p1 == 0 [ - :p1 = 2 - ] else [ - :p2 = 1 + :vara = 20 + :varb = 100 + :varc = 60 + repeat 1 [ + goto (0, 0) + pendown + repeat 6 [ + if (:vara != :varb) [ + if ( :vara > :varb) [ right :vara ] + else [ left :varb ] + ] + else [ + if ((:vara <= :varc) || (:varb <= :varc)) [ + :vara = :varc / :vara + :varb = :varb / :varc + :varc = :varb + ] + ] + forward :vara + right :varb + forward :varc + left :varc + ] + left 45 + ] + penup + return +} + +def factorial(:n) +{ + if :n == 1 [ + return 1 ] - return :p2, :p1 + :ret = factorial(:n - 1) + return :ret * :n } -:l, :b = drawCircle() -print(:b) -if :b <= 42 [ - :l = :l + 40 -] else [ - :l = :l + 22 -] -print(:l) \ No newline at end of file +drawRectangle(50, 50) +drawCircle() diff --git a/ChironCore/example/issues.txt b/ChironCore/example/issues.txt new file mode 100644 index 0000000..f2fce70 --- /dev/null +++ b/ChironCore/example/issues.txt @@ -0,0 +1,6 @@ +:n -1 +Syntax Error +Line : 54, Column : 24 +Report: (extraneous input '-1' expecting ')') + + diff --git a/ChironCore/example/kachuapur3.tl b/ChironCore/example/kachuapur3.tl index ae7642b..fc4d4f8 100644 --- a/ChironCore/example/kachuapur3.tl +++ b/ChironCore/example/kachuapur3.tl @@ -1,15 +1,6 @@ -class :a { - :b = 3; - :c = 4; - :d = [2,3,4,[5,6]]; +class :Point { + :x = 6; + :y = 4; } - -:b = new :a() -:b.:c = 5 -print(:b.:c) -:x = :a.:c + :b.:c * 2 -:y = :b.:d[3][1] -print(:x) -print(:y) -:b.:d[3][1]=99 -print(:b.:d ) \ No newline at end of file +print(:Point.:x) +:point = new :Point() \ No newline at end of file diff --git a/ChironCore/example/library.tl b/ChironCore/example/library.tl new file mode 100644 index 0000000..5f9fc46 --- /dev/null +++ b/ChironCore/example/library.tl @@ -0,0 +1,38 @@ +def sqroot(:n) +{ + if (:n == 0) [ + return 0 + ] + if (:n == 1) [ + return 1 + ] + + :low = 0 + :high = :n + :ans = 0 + :epsilon = 0.0001 + repeat 50 [ + :mid = (:low + :high) / 2 + :square = :mid * :mid + + if (:square == :n) [ + return :mid + ] + + if (:square < :n) [ + :low = :mid + :ans = :mid + ] + else [ + :high = :mid + ] + + if ((:high - :low) < :epsilon) [ + return :ans + ] + ] + return :ans +} + +:a = sqroot(20) +print(:a) \ No newline at end of file diff --git a/ChironCore/example/rangoli.tl b/ChironCore/example/rangoli.tl new file mode 100644 index 0000000..a1c006d --- /dev/null +++ b/ChironCore/example/rangoli.tl @@ -0,0 +1,60 @@ +def sqroot(:n) +{ + if (:n == 0) [ + return 0 + ] + if (:n == 1) [ + return 1 + ] + + :low = 0 + :high = :n + :ans = 0 + :epsilon = 0.0001 + repeat 50 [ + :mid = (:low + :high) / 2 + :square = :mid * :mid + + if (:square == :n) [ + return :mid + ] + + if (:square < :n) [ + :low = :mid + :ans = :mid + ] + else [ + :high = :mid + ] + + if ((:high - :low) < :epsilon) [ + return :ans + ] + ] + return :ans +} + +def drawRangoli(:size) +{ + penup + pendown + forward :size + left 90 + forward :size + left 90 + forward :size + left 90 + forward :size + penup + + left 90 + forward :size/2 + left 45 + :size = sqroot((:size * :size ) / 2) + if :size > 10 + [ drawRangoli(:size) ] + return +} + +goto (0, 0) +drawRangoli(:size) \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index 7a980a7..9696bce 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -132,10 +132,11 @@ value : NUM | VAR | array | objectOrArrayAccess + | REAL ; NUM : [0-9]+ ; - +REAL : [+-]?[0-9]+('.'[0-9]+)?; VAR : ':'[a-zA-Z_] [a-zA-Z0-9]* ; NAME : [a-zA-Z]+ ; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index 19ed578..f96361e 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -44,6 +44,7 @@ null null null null +null token symbolic names: null @@ -88,6 +89,7 @@ AND OR NOT NUM +REAL VAR NAME Whitespace @@ -132,4 +134,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 335, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 79, 10, 3, 12, 3, 14, 3, 82, 11, 3, 3, 4, 6, 4, 85, 10, 4, 13, 4, 14, 4, 86, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 103, 10, 5, 3, 6, 3, 6, 5, 6, 107, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 151, 10, 15, 12, 15, 14, 15, 154, 11, 15, 5, 15, 156, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 162, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 182, 10, 21, 12, 21, 14, 21, 185, 11, 21, 5, 21, 187, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 200, 10, 22, 3, 22, 3, 22, 5, 22, 204, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 214, 10, 22, 12, 22, 14, 22, 217, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 226, 10, 24, 12, 24, 14, 24, 229, 11, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 5, 26, 236, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 251, 10, 27, 13, 27, 14, 27, 252, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 7, 30, 265, 10, 30, 12, 30, 14, 30, 268, 11, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 7, 32, 285, 10, 32, 12, 32, 14, 32, 288, 11, 32, 5, 32, 290, 10, 32, 3, 33, 3, 33, 3, 33, 7, 33, 295, 10, 33, 12, 33, 14, 33, 298, 11, 33, 5, 33, 300, 10, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 314, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 7, 34, 320, 10, 34, 12, 34, 14, 34, 323, 11, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 333, 10, 37, 3, 37, 2, 4, 42, 66, 38, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 341, 2, 74, 3, 2, 2, 2, 4, 80, 3, 2, 2, 2, 6, 84, 3, 2, 2, 2, 8, 102, 3, 2, 2, 2, 10, 106, 3, 2, 2, 2, 12, 108, 3, 2, 2, 2, 14, 114, 3, 2, 2, 2, 16, 124, 3, 2, 2, 2, 18, 130, 3, 2, 2, 2, 20, 137, 3, 2, 2, 2, 22, 140, 3, 2, 2, 2, 24, 142, 3, 2, 2, 2, 26, 144, 3, 2, 2, 2, 28, 146, 3, 2, 2, 2, 30, 161, 3, 2, 2, 2, 32, 166, 3, 2, 2, 2, 34, 171, 3, 2, 2, 2, 36, 173, 3, 2, 2, 2, 38, 175, 3, 2, 2, 2, 40, 177, 3, 2, 2, 2, 42, 203, 3, 2, 2, 2, 44, 218, 3, 2, 2, 2, 46, 227, 3, 2, 2, 2, 48, 230, 3, 2, 2, 2, 50, 235, 3, 2, 2, 2, 52, 243, 3, 2, 2, 2, 54, 254, 3, 2, 2, 2, 56, 256, 3, 2, 2, 2, 58, 261, 3, 2, 2, 2, 60, 272, 3, 2, 2, 2, 62, 289, 3, 2, 2, 2, 64, 299, 3, 2, 2, 2, 66, 313, 3, 2, 2, 2, 68, 324, 3, 2, 2, 2, 70, 326, 3, 2, 2, 2, 72, 332, 3, 2, 2, 2, 74, 75, 5, 4, 3, 2, 75, 76, 7, 2, 2, 3, 76, 3, 3, 2, 2, 2, 77, 79, 5, 8, 5, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 5, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 85, 5, 8, 5, 2, 84, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 7, 3, 2, 2, 2, 88, 103, 5, 30, 16, 2, 89, 103, 5, 32, 17, 2, 90, 103, 5, 10, 6, 2, 91, 103, 5, 16, 9, 2, 92, 103, 5, 20, 11, 2, 93, 103, 5, 24, 13, 2, 94, 103, 5, 18, 10, 2, 95, 103, 5, 26, 14, 2, 96, 103, 5, 44, 23, 2, 97, 103, 5, 50, 26, 2, 98, 103, 5, 60, 31, 2, 99, 103, 5, 56, 29, 2, 100, 103, 5, 58, 30, 2, 101, 103, 5, 40, 21, 2, 102, 88, 3, 2, 2, 2, 102, 89, 3, 2, 2, 2, 102, 90, 3, 2, 2, 2, 102, 91, 3, 2, 2, 2, 102, 92, 3, 2, 2, 2, 102, 93, 3, 2, 2, 2, 102, 94, 3, 2, 2, 2, 102, 95, 3, 2, 2, 2, 102, 96, 3, 2, 2, 2, 102, 97, 3, 2, 2, 2, 102, 98, 3, 2, 2, 2, 102, 99, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 102, 101, 3, 2, 2, 2, 103, 9, 3, 2, 2, 2, 104, 107, 5, 12, 7, 2, 105, 107, 5, 14, 8, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 11, 3, 2, 2, 2, 108, 109, 7, 3, 2, 2, 109, 110, 5, 66, 34, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 13, 3, 2, 2, 2, 114, 115, 7, 3, 2, 2, 115, 116, 5, 66, 34, 2, 116, 117, 7, 4, 2, 2, 117, 118, 5, 6, 4, 2, 118, 119, 7, 5, 2, 2, 119, 120, 7, 6, 2, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 15, 3, 2, 2, 2, 124, 125, 7, 7, 2, 2, 125, 126, 5, 72, 37, 2, 126, 127, 7, 4, 2, 2, 127, 128, 5, 6, 4, 2, 128, 129, 7, 5, 2, 2, 129, 17, 3, 2, 2, 2, 130, 131, 7, 8, 2, 2, 131, 132, 7, 9, 2, 2, 132, 133, 5, 42, 22, 2, 133, 134, 7, 10, 2, 2, 134, 135, 5, 42, 22, 2, 135, 136, 7, 11, 2, 2, 136, 19, 3, 2, 2, 2, 137, 138, 5, 22, 12, 2, 138, 139, 5, 42, 22, 2, 139, 21, 3, 2, 2, 2, 140, 141, 9, 2, 2, 2, 141, 23, 3, 2, 2, 2, 142, 143, 9, 3, 2, 2, 143, 25, 3, 2, 2, 2, 144, 145, 7, 18, 2, 2, 145, 27, 3, 2, 2, 2, 146, 155, 7, 4, 2, 2, 147, 152, 5, 42, 22, 2, 148, 149, 7, 10, 2, 2, 149, 151, 5, 42, 22, 2, 150, 148, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 156, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 147, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 158, 7, 5, 2, 2, 158, 29, 3, 2, 2, 2, 159, 162, 7, 44, 2, 2, 160, 162, 5, 52, 27, 2, 161, 159, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 164, 7, 19, 2, 2, 164, 165, 5, 42, 22, 2, 165, 31, 3, 2, 2, 2, 166, 167, 7, 20, 2, 2, 167, 168, 7, 9, 2, 2, 168, 169, 5, 42, 22, 2, 169, 170, 7, 11, 2, 2, 170, 33, 3, 2, 2, 2, 171, 172, 9, 4, 2, 2, 172, 35, 3, 2, 2, 2, 173, 174, 9, 5, 2, 2, 174, 37, 3, 2, 2, 2, 175, 176, 7, 30, 2, 2, 176, 39, 3, 2, 2, 2, 177, 186, 7, 21, 2, 2, 178, 183, 5, 42, 22, 2, 179, 180, 7, 10, 2, 2, 180, 182, 5, 42, 22, 2, 181, 179, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 178, 3, 2, 2, 2, 186, 187, 3, 2, 2, 2, 187, 41, 3, 2, 2, 2, 188, 189, 8, 22, 1, 2, 189, 190, 5, 38, 20, 2, 190, 191, 5, 42, 22, 8, 191, 204, 3, 2, 2, 2, 192, 193, 7, 9, 2, 2, 193, 194, 5, 42, 22, 2, 194, 195, 7, 11, 2, 2, 195, 204, 3, 2, 2, 2, 196, 204, 5, 72, 37, 2, 197, 200, 7, 44, 2, 2, 198, 200, 5, 52, 27, 2, 199, 197, 3, 2, 2, 2, 199, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 7, 19, 2, 2, 202, 204, 5, 42, 22, 3, 203, 188, 3, 2, 2, 2, 203, 192, 3, 2, 2, 2, 203, 196, 3, 2, 2, 2, 203, 199, 3, 2, 2, 2, 204, 215, 3, 2, 2, 2, 205, 206, 12, 7, 2, 2, 206, 207, 5, 34, 18, 2, 207, 208, 5, 42, 22, 8, 208, 214, 3, 2, 2, 2, 209, 210, 12, 6, 2, 2, 210, 211, 5, 36, 19, 2, 211, 212, 5, 42, 22, 7, 212, 214, 3, 2, 2, 2, 213, 205, 3, 2, 2, 2, 213, 209, 3, 2, 2, 2, 214, 217, 3, 2, 2, 2, 215, 213, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 43, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 218, 219, 7, 22, 2, 2, 219, 220, 7, 44, 2, 2, 220, 221, 7, 23, 2, 2, 221, 222, 5, 46, 24, 2, 222, 223, 7, 24, 2, 2, 223, 45, 3, 2, 2, 2, 224, 226, 5, 48, 25, 2, 225, 224, 3, 2, 2, 2, 226, 229, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 47, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 230, 231, 5, 30, 16, 2, 231, 232, 7, 25, 2, 2, 232, 49, 3, 2, 2, 2, 233, 236, 7, 44, 2, 2, 234, 236, 5, 52, 27, 2, 235, 233, 3, 2, 2, 2, 235, 234, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 238, 7, 19, 2, 2, 238, 239, 7, 26, 2, 2, 239, 240, 7, 44, 2, 2, 240, 241, 7, 9, 2, 2, 241, 242, 7, 11, 2, 2, 242, 51, 3, 2, 2, 2, 243, 250, 5, 54, 28, 2, 244, 245, 7, 27, 2, 2, 245, 251, 7, 44, 2, 2, 246, 247, 7, 4, 2, 2, 247, 248, 5, 42, 22, 2, 248, 249, 7, 5, 2, 2, 249, 251, 3, 2, 2, 2, 250, 244, 3, 2, 2, 2, 250, 246, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 53, 3, 2, 2, 2, 254, 255, 7, 44, 2, 2, 255, 55, 3, 2, 2, 2, 256, 257, 7, 45, 2, 2, 257, 258, 7, 9, 2, 2, 258, 259, 5, 64, 33, 2, 259, 260, 7, 11, 2, 2, 260, 57, 3, 2, 2, 2, 261, 266, 7, 44, 2, 2, 262, 263, 7, 10, 2, 2, 263, 265, 7, 44, 2, 2, 264, 262, 3, 2, 2, 2, 265, 268, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 269, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 269, 270, 7, 19, 2, 2, 270, 271, 5, 56, 29, 2, 271, 59, 3, 2, 2, 2, 272, 273, 7, 28, 2, 2, 273, 274, 7, 45, 2, 2, 274, 275, 7, 9, 2, 2, 275, 276, 5, 62, 32, 2, 276, 277, 7, 11, 2, 2, 277, 278, 7, 23, 2, 2, 278, 279, 5, 6, 4, 2, 279, 280, 7, 24, 2, 2, 280, 61, 3, 2, 2, 2, 281, 286, 7, 44, 2, 2, 282, 283, 7, 10, 2, 2, 283, 285, 7, 44, 2, 2, 284, 282, 3, 2, 2, 2, 285, 288, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 290, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 289, 281, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 63, 3, 2, 2, 2, 291, 296, 5, 42, 22, 2, 292, 293, 7, 10, 2, 2, 293, 295, 5, 42, 22, 2, 294, 292, 3, 2, 2, 2, 295, 298, 3, 2, 2, 2, 296, 294, 3, 2, 2, 2, 296, 297, 3, 2, 2, 2, 297, 300, 3, 2, 2, 2, 298, 296, 3, 2, 2, 2, 299, 291, 3, 2, 2, 2, 299, 300, 3, 2, 2, 2, 300, 65, 3, 2, 2, 2, 301, 302, 8, 34, 1, 2, 302, 303, 7, 42, 2, 2, 303, 314, 5, 66, 34, 7, 304, 305, 5, 42, 22, 2, 305, 306, 5, 68, 35, 2, 306, 307, 5, 42, 22, 2, 307, 314, 3, 2, 2, 2, 308, 314, 7, 33, 2, 2, 309, 310, 7, 9, 2, 2, 310, 311, 5, 66, 34, 2, 311, 312, 7, 11, 2, 2, 312, 314, 3, 2, 2, 2, 313, 301, 3, 2, 2, 2, 313, 304, 3, 2, 2, 2, 313, 308, 3, 2, 2, 2, 313, 309, 3, 2, 2, 2, 314, 321, 3, 2, 2, 2, 315, 316, 12, 5, 2, 2, 316, 317, 5, 70, 36, 2, 317, 318, 5, 66, 34, 6, 318, 320, 3, 2, 2, 2, 319, 315, 3, 2, 2, 2, 320, 323, 3, 2, 2, 2, 321, 319, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 67, 3, 2, 2, 2, 323, 321, 3, 2, 2, 2, 324, 325, 9, 6, 2, 2, 325, 69, 3, 2, 2, 2, 326, 327, 9, 7, 2, 2, 327, 71, 3, 2, 2, 2, 328, 333, 7, 43, 2, 2, 329, 333, 7, 44, 2, 2, 330, 333, 5, 28, 15, 2, 331, 333, 5, 52, 27, 2, 332, 328, 3, 2, 2, 2, 332, 329, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 332, 331, 3, 2, 2, 2, 333, 73, 3, 2, 2, 2, 27, 80, 86, 102, 106, 152, 155, 161, 183, 186, 199, 203, 213, 215, 227, 235, 250, 252, 266, 286, 289, 296, 299, 313, 321, 332] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 336, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 79, 10, 3, 12, 3, 14, 3, 82, 11, 3, 3, 4, 6, 4, 85, 10, 4, 13, 4, 14, 4, 86, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 103, 10, 5, 3, 6, 3, 6, 5, 6, 107, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 151, 10, 15, 12, 15, 14, 15, 154, 11, 15, 5, 15, 156, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 162, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 182, 10, 21, 12, 21, 14, 21, 185, 11, 21, 5, 21, 187, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 200, 10, 22, 3, 22, 3, 22, 5, 22, 204, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 214, 10, 22, 12, 22, 14, 22, 217, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 226, 10, 24, 12, 24, 14, 24, 229, 11, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 5, 26, 236, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 251, 10, 27, 13, 27, 14, 27, 252, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 7, 30, 265, 10, 30, 12, 30, 14, 30, 268, 11, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 7, 32, 285, 10, 32, 12, 32, 14, 32, 288, 11, 32, 5, 32, 290, 10, 32, 3, 33, 3, 33, 3, 33, 7, 33, 295, 10, 33, 12, 33, 14, 33, 298, 11, 33, 5, 33, 300, 10, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 314, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 7, 34, 320, 10, 34, 12, 34, 14, 34, 323, 11, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 334, 10, 37, 3, 37, 2, 4, 42, 66, 38, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 343, 2, 74, 3, 2, 2, 2, 4, 80, 3, 2, 2, 2, 6, 84, 3, 2, 2, 2, 8, 102, 3, 2, 2, 2, 10, 106, 3, 2, 2, 2, 12, 108, 3, 2, 2, 2, 14, 114, 3, 2, 2, 2, 16, 124, 3, 2, 2, 2, 18, 130, 3, 2, 2, 2, 20, 137, 3, 2, 2, 2, 22, 140, 3, 2, 2, 2, 24, 142, 3, 2, 2, 2, 26, 144, 3, 2, 2, 2, 28, 146, 3, 2, 2, 2, 30, 161, 3, 2, 2, 2, 32, 166, 3, 2, 2, 2, 34, 171, 3, 2, 2, 2, 36, 173, 3, 2, 2, 2, 38, 175, 3, 2, 2, 2, 40, 177, 3, 2, 2, 2, 42, 203, 3, 2, 2, 2, 44, 218, 3, 2, 2, 2, 46, 227, 3, 2, 2, 2, 48, 230, 3, 2, 2, 2, 50, 235, 3, 2, 2, 2, 52, 243, 3, 2, 2, 2, 54, 254, 3, 2, 2, 2, 56, 256, 3, 2, 2, 2, 58, 261, 3, 2, 2, 2, 60, 272, 3, 2, 2, 2, 62, 289, 3, 2, 2, 2, 64, 299, 3, 2, 2, 2, 66, 313, 3, 2, 2, 2, 68, 324, 3, 2, 2, 2, 70, 326, 3, 2, 2, 2, 72, 333, 3, 2, 2, 2, 74, 75, 5, 4, 3, 2, 75, 76, 7, 2, 2, 3, 76, 3, 3, 2, 2, 2, 77, 79, 5, 8, 5, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 5, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 85, 5, 8, 5, 2, 84, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 7, 3, 2, 2, 2, 88, 103, 5, 30, 16, 2, 89, 103, 5, 32, 17, 2, 90, 103, 5, 10, 6, 2, 91, 103, 5, 16, 9, 2, 92, 103, 5, 20, 11, 2, 93, 103, 5, 24, 13, 2, 94, 103, 5, 18, 10, 2, 95, 103, 5, 26, 14, 2, 96, 103, 5, 44, 23, 2, 97, 103, 5, 50, 26, 2, 98, 103, 5, 60, 31, 2, 99, 103, 5, 56, 29, 2, 100, 103, 5, 58, 30, 2, 101, 103, 5, 40, 21, 2, 102, 88, 3, 2, 2, 2, 102, 89, 3, 2, 2, 2, 102, 90, 3, 2, 2, 2, 102, 91, 3, 2, 2, 2, 102, 92, 3, 2, 2, 2, 102, 93, 3, 2, 2, 2, 102, 94, 3, 2, 2, 2, 102, 95, 3, 2, 2, 2, 102, 96, 3, 2, 2, 2, 102, 97, 3, 2, 2, 2, 102, 98, 3, 2, 2, 2, 102, 99, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 102, 101, 3, 2, 2, 2, 103, 9, 3, 2, 2, 2, 104, 107, 5, 12, 7, 2, 105, 107, 5, 14, 8, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 11, 3, 2, 2, 2, 108, 109, 7, 3, 2, 2, 109, 110, 5, 66, 34, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 13, 3, 2, 2, 2, 114, 115, 7, 3, 2, 2, 115, 116, 5, 66, 34, 2, 116, 117, 7, 4, 2, 2, 117, 118, 5, 6, 4, 2, 118, 119, 7, 5, 2, 2, 119, 120, 7, 6, 2, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 15, 3, 2, 2, 2, 124, 125, 7, 7, 2, 2, 125, 126, 5, 72, 37, 2, 126, 127, 7, 4, 2, 2, 127, 128, 5, 6, 4, 2, 128, 129, 7, 5, 2, 2, 129, 17, 3, 2, 2, 2, 130, 131, 7, 8, 2, 2, 131, 132, 7, 9, 2, 2, 132, 133, 5, 42, 22, 2, 133, 134, 7, 10, 2, 2, 134, 135, 5, 42, 22, 2, 135, 136, 7, 11, 2, 2, 136, 19, 3, 2, 2, 2, 137, 138, 5, 22, 12, 2, 138, 139, 5, 42, 22, 2, 139, 21, 3, 2, 2, 2, 140, 141, 9, 2, 2, 2, 141, 23, 3, 2, 2, 2, 142, 143, 9, 3, 2, 2, 143, 25, 3, 2, 2, 2, 144, 145, 7, 18, 2, 2, 145, 27, 3, 2, 2, 2, 146, 155, 7, 4, 2, 2, 147, 152, 5, 42, 22, 2, 148, 149, 7, 10, 2, 2, 149, 151, 5, 42, 22, 2, 150, 148, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 156, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 147, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 158, 7, 5, 2, 2, 158, 29, 3, 2, 2, 2, 159, 162, 7, 45, 2, 2, 160, 162, 5, 52, 27, 2, 161, 159, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 164, 7, 19, 2, 2, 164, 165, 5, 42, 22, 2, 165, 31, 3, 2, 2, 2, 166, 167, 7, 20, 2, 2, 167, 168, 7, 9, 2, 2, 168, 169, 5, 42, 22, 2, 169, 170, 7, 11, 2, 2, 170, 33, 3, 2, 2, 2, 171, 172, 9, 4, 2, 2, 172, 35, 3, 2, 2, 2, 173, 174, 9, 5, 2, 2, 174, 37, 3, 2, 2, 2, 175, 176, 7, 30, 2, 2, 176, 39, 3, 2, 2, 2, 177, 186, 7, 21, 2, 2, 178, 183, 5, 42, 22, 2, 179, 180, 7, 10, 2, 2, 180, 182, 5, 42, 22, 2, 181, 179, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 178, 3, 2, 2, 2, 186, 187, 3, 2, 2, 2, 187, 41, 3, 2, 2, 2, 188, 189, 8, 22, 1, 2, 189, 190, 5, 38, 20, 2, 190, 191, 5, 42, 22, 8, 191, 204, 3, 2, 2, 2, 192, 193, 7, 9, 2, 2, 193, 194, 5, 42, 22, 2, 194, 195, 7, 11, 2, 2, 195, 204, 3, 2, 2, 2, 196, 204, 5, 72, 37, 2, 197, 200, 7, 45, 2, 2, 198, 200, 5, 52, 27, 2, 199, 197, 3, 2, 2, 2, 199, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 7, 19, 2, 2, 202, 204, 5, 42, 22, 3, 203, 188, 3, 2, 2, 2, 203, 192, 3, 2, 2, 2, 203, 196, 3, 2, 2, 2, 203, 199, 3, 2, 2, 2, 204, 215, 3, 2, 2, 2, 205, 206, 12, 7, 2, 2, 206, 207, 5, 34, 18, 2, 207, 208, 5, 42, 22, 8, 208, 214, 3, 2, 2, 2, 209, 210, 12, 6, 2, 2, 210, 211, 5, 36, 19, 2, 211, 212, 5, 42, 22, 7, 212, 214, 3, 2, 2, 2, 213, 205, 3, 2, 2, 2, 213, 209, 3, 2, 2, 2, 214, 217, 3, 2, 2, 2, 215, 213, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 43, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 218, 219, 7, 22, 2, 2, 219, 220, 7, 45, 2, 2, 220, 221, 7, 23, 2, 2, 221, 222, 5, 46, 24, 2, 222, 223, 7, 24, 2, 2, 223, 45, 3, 2, 2, 2, 224, 226, 5, 48, 25, 2, 225, 224, 3, 2, 2, 2, 226, 229, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 47, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 230, 231, 5, 30, 16, 2, 231, 232, 7, 25, 2, 2, 232, 49, 3, 2, 2, 2, 233, 236, 7, 45, 2, 2, 234, 236, 5, 52, 27, 2, 235, 233, 3, 2, 2, 2, 235, 234, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 238, 7, 19, 2, 2, 238, 239, 7, 26, 2, 2, 239, 240, 7, 45, 2, 2, 240, 241, 7, 9, 2, 2, 241, 242, 7, 11, 2, 2, 242, 51, 3, 2, 2, 2, 243, 250, 5, 54, 28, 2, 244, 245, 7, 27, 2, 2, 245, 251, 7, 45, 2, 2, 246, 247, 7, 4, 2, 2, 247, 248, 5, 42, 22, 2, 248, 249, 7, 5, 2, 2, 249, 251, 3, 2, 2, 2, 250, 244, 3, 2, 2, 2, 250, 246, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 53, 3, 2, 2, 2, 254, 255, 7, 45, 2, 2, 255, 55, 3, 2, 2, 2, 256, 257, 7, 46, 2, 2, 257, 258, 7, 9, 2, 2, 258, 259, 5, 64, 33, 2, 259, 260, 7, 11, 2, 2, 260, 57, 3, 2, 2, 2, 261, 266, 7, 45, 2, 2, 262, 263, 7, 10, 2, 2, 263, 265, 7, 45, 2, 2, 264, 262, 3, 2, 2, 2, 265, 268, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 269, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 269, 270, 7, 19, 2, 2, 270, 271, 5, 56, 29, 2, 271, 59, 3, 2, 2, 2, 272, 273, 7, 28, 2, 2, 273, 274, 7, 46, 2, 2, 274, 275, 7, 9, 2, 2, 275, 276, 5, 62, 32, 2, 276, 277, 7, 11, 2, 2, 277, 278, 7, 23, 2, 2, 278, 279, 5, 6, 4, 2, 279, 280, 7, 24, 2, 2, 280, 61, 3, 2, 2, 2, 281, 286, 7, 45, 2, 2, 282, 283, 7, 10, 2, 2, 283, 285, 7, 45, 2, 2, 284, 282, 3, 2, 2, 2, 285, 288, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 290, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 289, 281, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 63, 3, 2, 2, 2, 291, 296, 5, 42, 22, 2, 292, 293, 7, 10, 2, 2, 293, 295, 5, 42, 22, 2, 294, 292, 3, 2, 2, 2, 295, 298, 3, 2, 2, 2, 296, 294, 3, 2, 2, 2, 296, 297, 3, 2, 2, 2, 297, 300, 3, 2, 2, 2, 298, 296, 3, 2, 2, 2, 299, 291, 3, 2, 2, 2, 299, 300, 3, 2, 2, 2, 300, 65, 3, 2, 2, 2, 301, 302, 8, 34, 1, 2, 302, 303, 7, 42, 2, 2, 303, 314, 5, 66, 34, 7, 304, 305, 5, 42, 22, 2, 305, 306, 5, 68, 35, 2, 306, 307, 5, 42, 22, 2, 307, 314, 3, 2, 2, 2, 308, 314, 7, 33, 2, 2, 309, 310, 7, 9, 2, 2, 310, 311, 5, 66, 34, 2, 311, 312, 7, 11, 2, 2, 312, 314, 3, 2, 2, 2, 313, 301, 3, 2, 2, 2, 313, 304, 3, 2, 2, 2, 313, 308, 3, 2, 2, 2, 313, 309, 3, 2, 2, 2, 314, 321, 3, 2, 2, 2, 315, 316, 12, 5, 2, 2, 316, 317, 5, 70, 36, 2, 317, 318, 5, 66, 34, 6, 318, 320, 3, 2, 2, 2, 319, 315, 3, 2, 2, 2, 320, 323, 3, 2, 2, 2, 321, 319, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 67, 3, 2, 2, 2, 323, 321, 3, 2, 2, 2, 324, 325, 9, 6, 2, 2, 325, 69, 3, 2, 2, 2, 326, 327, 9, 7, 2, 2, 327, 71, 3, 2, 2, 2, 328, 334, 7, 43, 2, 2, 329, 334, 7, 45, 2, 2, 330, 334, 5, 28, 15, 2, 331, 334, 5, 52, 27, 2, 332, 334, 7, 44, 2, 2, 333, 328, 3, 2, 2, 2, 333, 329, 3, 2, 2, 2, 333, 330, 3, 2, 2, 2, 333, 331, 3, 2, 2, 2, 333, 332, 3, 2, 2, 2, 334, 73, 3, 2, 2, 2, 27, 80, 86, 102, 106, 152, 155, 161, 183, 186, 199, 203, 213, 215, 227, 235, 250, 252, 266, 286, 289, 296, 299, 313, 321, 333] \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.tokens b/ChironCore/turtparse/tlang.tokens index f2b0e23..d855f44 100644 --- a/ChironCore/turtparse/tlang.tokens +++ b/ChironCore/turtparse/tlang.tokens @@ -39,9 +39,10 @@ AND=38 OR=39 NOT=40 NUM=41 -VAR=42 -NAME=43 -Whitespace=44 +REAL=42 +VAR=43 +NAME=44 +Whitespace=45 'if'=1 '['=2 ']'=3 diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index 8e963b6..1ed56c9 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -44,6 +44,7 @@ null null null null +null token symbolic names: null @@ -88,6 +89,7 @@ AND OR NOT NUM +REAL VAR NAME Whitespace @@ -134,6 +136,7 @@ AND OR NOT NUM +REAL VAR NAME Whitespace @@ -146,4 +149,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 46, 272, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 249, 10, 42, 13, 42, 14, 42, 250, 3, 43, 3, 43, 3, 43, 7, 43, 256, 10, 43, 12, 43, 14, 43, 259, 11, 43, 3, 44, 6, 44, 262, 10, 44, 13, 44, 14, 44, 263, 3, 45, 6, 45, 267, 10, 45, 13, 45, 14, 45, 268, 3, 45, 3, 45, 2, 2, 46, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 275, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 3, 91, 3, 2, 2, 2, 5, 94, 3, 2, 2, 2, 7, 96, 3, 2, 2, 2, 9, 98, 3, 2, 2, 2, 11, 103, 3, 2, 2, 2, 13, 110, 3, 2, 2, 2, 15, 115, 3, 2, 2, 2, 17, 117, 3, 2, 2, 2, 19, 119, 3, 2, 2, 2, 21, 121, 3, 2, 2, 2, 23, 129, 3, 2, 2, 2, 25, 138, 3, 2, 2, 2, 27, 143, 3, 2, 2, 2, 29, 149, 3, 2, 2, 2, 31, 155, 3, 2, 2, 2, 33, 163, 3, 2, 2, 2, 35, 169, 3, 2, 2, 2, 37, 171, 3, 2, 2, 2, 39, 177, 3, 2, 2, 2, 41, 184, 3, 2, 2, 2, 43, 190, 3, 2, 2, 2, 45, 192, 3, 2, 2, 2, 47, 194, 3, 2, 2, 2, 49, 196, 3, 2, 2, 2, 51, 200, 3, 2, 2, 2, 53, 202, 3, 2, 2, 2, 55, 206, 3, 2, 2, 2, 57, 208, 3, 2, 2, 2, 59, 210, 3, 2, 2, 2, 61, 212, 3, 2, 2, 2, 63, 214, 3, 2, 2, 2, 65, 223, 3, 2, 2, 2, 67, 225, 3, 2, 2, 2, 69, 227, 3, 2, 2, 2, 71, 230, 3, 2, 2, 2, 73, 233, 3, 2, 2, 2, 75, 236, 3, 2, 2, 2, 77, 239, 3, 2, 2, 2, 79, 242, 3, 2, 2, 2, 81, 245, 3, 2, 2, 2, 83, 248, 3, 2, 2, 2, 85, 252, 3, 2, 2, 2, 87, 261, 3, 2, 2, 2, 89, 266, 3, 2, 2, 2, 91, 92, 7, 107, 2, 2, 92, 93, 7, 104, 2, 2, 93, 4, 3, 2, 2, 2, 94, 95, 7, 93, 2, 2, 95, 6, 3, 2, 2, 2, 96, 97, 7, 95, 2, 2, 97, 8, 3, 2, 2, 2, 98, 99, 7, 103, 2, 2, 99, 100, 7, 110, 2, 2, 100, 101, 7, 117, 2, 2, 101, 102, 7, 103, 2, 2, 102, 10, 3, 2, 2, 2, 103, 104, 7, 116, 2, 2, 104, 105, 7, 103, 2, 2, 105, 106, 7, 114, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 99, 2, 2, 108, 109, 7, 118, 2, 2, 109, 12, 3, 2, 2, 2, 110, 111, 7, 105, 2, 2, 111, 112, 7, 113, 2, 2, 112, 113, 7, 118, 2, 2, 113, 114, 7, 113, 2, 2, 114, 14, 3, 2, 2, 2, 115, 116, 7, 42, 2, 2, 116, 16, 3, 2, 2, 2, 117, 118, 7, 46, 2, 2, 118, 18, 3, 2, 2, 2, 119, 120, 7, 43, 2, 2, 120, 20, 3, 2, 2, 2, 121, 122, 7, 104, 2, 2, 122, 123, 7, 113, 2, 2, 123, 124, 7, 116, 2, 2, 124, 125, 7, 121, 2, 2, 125, 126, 7, 99, 2, 2, 126, 127, 7, 116, 2, 2, 127, 128, 7, 102, 2, 2, 128, 22, 3, 2, 2, 2, 129, 130, 7, 100, 2, 2, 130, 131, 7, 99, 2, 2, 131, 132, 7, 101, 2, 2, 132, 133, 7, 109, 2, 2, 133, 134, 7, 121, 2, 2, 134, 135, 7, 99, 2, 2, 135, 136, 7, 116, 2, 2, 136, 137, 7, 102, 2, 2, 137, 24, 3, 2, 2, 2, 138, 139, 7, 110, 2, 2, 139, 140, 7, 103, 2, 2, 140, 141, 7, 104, 2, 2, 141, 142, 7, 118, 2, 2, 142, 26, 3, 2, 2, 2, 143, 144, 7, 116, 2, 2, 144, 145, 7, 107, 2, 2, 145, 146, 7, 105, 2, 2, 146, 147, 7, 106, 2, 2, 147, 148, 7, 118, 2, 2, 148, 28, 3, 2, 2, 2, 149, 150, 7, 114, 2, 2, 150, 151, 7, 103, 2, 2, 151, 152, 7, 112, 2, 2, 152, 153, 7, 119, 2, 2, 153, 154, 7, 114, 2, 2, 154, 30, 3, 2, 2, 2, 155, 156, 7, 114, 2, 2, 156, 157, 7, 103, 2, 2, 157, 158, 7, 112, 2, 2, 158, 159, 7, 102, 2, 2, 159, 160, 7, 113, 2, 2, 160, 161, 7, 121, 2, 2, 161, 162, 7, 112, 2, 2, 162, 32, 3, 2, 2, 2, 163, 164, 7, 114, 2, 2, 164, 165, 7, 99, 2, 2, 165, 166, 7, 119, 2, 2, 166, 167, 7, 117, 2, 2, 167, 168, 7, 103, 2, 2, 168, 34, 3, 2, 2, 2, 169, 170, 7, 63, 2, 2, 170, 36, 3, 2, 2, 2, 171, 172, 7, 114, 2, 2, 172, 173, 7, 116, 2, 2, 173, 174, 7, 107, 2, 2, 174, 175, 7, 112, 2, 2, 175, 176, 7, 118, 2, 2, 176, 38, 3, 2, 2, 2, 177, 178, 7, 116, 2, 2, 178, 179, 7, 103, 2, 2, 179, 180, 7, 118, 2, 2, 180, 181, 7, 119, 2, 2, 181, 182, 7, 116, 2, 2, 182, 183, 7, 112, 2, 2, 183, 40, 3, 2, 2, 2, 184, 185, 7, 101, 2, 2, 185, 186, 7, 110, 2, 2, 186, 187, 7, 99, 2, 2, 187, 188, 7, 117, 2, 2, 188, 189, 7, 117, 2, 2, 189, 42, 3, 2, 2, 2, 190, 191, 7, 125, 2, 2, 191, 44, 3, 2, 2, 2, 192, 193, 7, 127, 2, 2, 193, 46, 3, 2, 2, 2, 194, 195, 7, 61, 2, 2, 195, 48, 3, 2, 2, 2, 196, 197, 7, 112, 2, 2, 197, 198, 7, 103, 2, 2, 198, 199, 7, 121, 2, 2, 199, 50, 3, 2, 2, 2, 200, 201, 7, 48, 2, 2, 201, 52, 3, 2, 2, 2, 202, 203, 7, 102, 2, 2, 203, 204, 7, 103, 2, 2, 204, 205, 7, 104, 2, 2, 205, 54, 3, 2, 2, 2, 206, 207, 7, 45, 2, 2, 207, 56, 3, 2, 2, 2, 208, 209, 7, 47, 2, 2, 209, 58, 3, 2, 2, 2, 210, 211, 7, 44, 2, 2, 211, 60, 3, 2, 2, 2, 212, 213, 7, 49, 2, 2, 213, 62, 3, 2, 2, 2, 214, 215, 7, 114, 2, 2, 215, 216, 7, 103, 2, 2, 216, 217, 7, 112, 2, 2, 217, 218, 7, 102, 2, 2, 218, 219, 7, 113, 2, 2, 219, 220, 7, 121, 2, 2, 220, 221, 7, 112, 2, 2, 221, 222, 7, 65, 2, 2, 222, 64, 3, 2, 2, 2, 223, 224, 7, 62, 2, 2, 224, 66, 3, 2, 2, 2, 225, 226, 7, 64, 2, 2, 226, 68, 3, 2, 2, 2, 227, 228, 7, 63, 2, 2, 228, 229, 7, 63, 2, 2, 229, 70, 3, 2, 2, 2, 230, 231, 7, 35, 2, 2, 231, 232, 7, 63, 2, 2, 232, 72, 3, 2, 2, 2, 233, 234, 7, 62, 2, 2, 234, 235, 7, 63, 2, 2, 235, 74, 3, 2, 2, 2, 236, 237, 7, 64, 2, 2, 237, 238, 7, 63, 2, 2, 238, 76, 3, 2, 2, 2, 239, 240, 7, 40, 2, 2, 240, 241, 7, 40, 2, 2, 241, 78, 3, 2, 2, 2, 242, 243, 7, 126, 2, 2, 243, 244, 7, 126, 2, 2, 244, 80, 3, 2, 2, 2, 245, 246, 7, 35, 2, 2, 246, 82, 3, 2, 2, 2, 247, 249, 9, 2, 2, 2, 248, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 250, 251, 3, 2, 2, 2, 251, 84, 3, 2, 2, 2, 252, 253, 7, 60, 2, 2, 253, 257, 9, 3, 2, 2, 254, 256, 9, 4, 2, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 86, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 262, 9, 5, 2, 2, 261, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 88, 3, 2, 2, 2, 265, 267, 9, 6, 2, 2, 266, 265, 3, 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 270, 3, 2, 2, 2, 270, 271, 8, 45, 2, 2, 271, 90, 3, 2, 2, 2, 7, 2, 250, 257, 263, 268, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 47, 290, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 251, 10, 42, 13, 42, 14, 42, 252, 3, 43, 5, 43, 256, 10, 43, 3, 43, 6, 43, 259, 10, 43, 13, 43, 14, 43, 260, 3, 43, 3, 43, 6, 43, 265, 10, 43, 13, 43, 14, 43, 266, 5, 43, 269, 10, 43, 3, 44, 3, 44, 3, 44, 7, 44, 274, 10, 44, 12, 44, 14, 44, 277, 11, 44, 3, 45, 6, 45, 280, 10, 45, 13, 45, 14, 45, 281, 3, 46, 6, 46, 285, 10, 46, 13, 46, 14, 46, 286, 3, 46, 3, 46, 2, 2, 47, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 3, 2, 8, 3, 2, 50, 59, 4, 2, 45, 45, 47, 47, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 297, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 3, 93, 3, 2, 2, 2, 5, 96, 3, 2, 2, 2, 7, 98, 3, 2, 2, 2, 9, 100, 3, 2, 2, 2, 11, 105, 3, 2, 2, 2, 13, 112, 3, 2, 2, 2, 15, 117, 3, 2, 2, 2, 17, 119, 3, 2, 2, 2, 19, 121, 3, 2, 2, 2, 21, 123, 3, 2, 2, 2, 23, 131, 3, 2, 2, 2, 25, 140, 3, 2, 2, 2, 27, 145, 3, 2, 2, 2, 29, 151, 3, 2, 2, 2, 31, 157, 3, 2, 2, 2, 33, 165, 3, 2, 2, 2, 35, 171, 3, 2, 2, 2, 37, 173, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 186, 3, 2, 2, 2, 43, 192, 3, 2, 2, 2, 45, 194, 3, 2, 2, 2, 47, 196, 3, 2, 2, 2, 49, 198, 3, 2, 2, 2, 51, 202, 3, 2, 2, 2, 53, 204, 3, 2, 2, 2, 55, 208, 3, 2, 2, 2, 57, 210, 3, 2, 2, 2, 59, 212, 3, 2, 2, 2, 61, 214, 3, 2, 2, 2, 63, 216, 3, 2, 2, 2, 65, 225, 3, 2, 2, 2, 67, 227, 3, 2, 2, 2, 69, 229, 3, 2, 2, 2, 71, 232, 3, 2, 2, 2, 73, 235, 3, 2, 2, 2, 75, 238, 3, 2, 2, 2, 77, 241, 3, 2, 2, 2, 79, 244, 3, 2, 2, 2, 81, 247, 3, 2, 2, 2, 83, 250, 3, 2, 2, 2, 85, 255, 3, 2, 2, 2, 87, 270, 3, 2, 2, 2, 89, 279, 3, 2, 2, 2, 91, 284, 3, 2, 2, 2, 93, 94, 7, 107, 2, 2, 94, 95, 7, 104, 2, 2, 95, 4, 3, 2, 2, 2, 96, 97, 7, 93, 2, 2, 97, 6, 3, 2, 2, 2, 98, 99, 7, 95, 2, 2, 99, 8, 3, 2, 2, 2, 100, 101, 7, 103, 2, 2, 101, 102, 7, 110, 2, 2, 102, 103, 7, 117, 2, 2, 103, 104, 7, 103, 2, 2, 104, 10, 3, 2, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 114, 2, 2, 108, 109, 7, 103, 2, 2, 109, 110, 7, 99, 2, 2, 110, 111, 7, 118, 2, 2, 111, 12, 3, 2, 2, 2, 112, 113, 7, 105, 2, 2, 113, 114, 7, 113, 2, 2, 114, 115, 7, 118, 2, 2, 115, 116, 7, 113, 2, 2, 116, 14, 3, 2, 2, 2, 117, 118, 7, 42, 2, 2, 118, 16, 3, 2, 2, 2, 119, 120, 7, 46, 2, 2, 120, 18, 3, 2, 2, 2, 121, 122, 7, 43, 2, 2, 122, 20, 3, 2, 2, 2, 123, 124, 7, 104, 2, 2, 124, 125, 7, 113, 2, 2, 125, 126, 7, 116, 2, 2, 126, 127, 7, 121, 2, 2, 127, 128, 7, 99, 2, 2, 128, 129, 7, 116, 2, 2, 129, 130, 7, 102, 2, 2, 130, 22, 3, 2, 2, 2, 131, 132, 7, 100, 2, 2, 132, 133, 7, 99, 2, 2, 133, 134, 7, 101, 2, 2, 134, 135, 7, 109, 2, 2, 135, 136, 7, 121, 2, 2, 136, 137, 7, 99, 2, 2, 137, 138, 7, 116, 2, 2, 138, 139, 7, 102, 2, 2, 139, 24, 3, 2, 2, 2, 140, 141, 7, 110, 2, 2, 141, 142, 7, 103, 2, 2, 142, 143, 7, 104, 2, 2, 143, 144, 7, 118, 2, 2, 144, 26, 3, 2, 2, 2, 145, 146, 7, 116, 2, 2, 146, 147, 7, 107, 2, 2, 147, 148, 7, 105, 2, 2, 148, 149, 7, 106, 2, 2, 149, 150, 7, 118, 2, 2, 150, 28, 3, 2, 2, 2, 151, 152, 7, 114, 2, 2, 152, 153, 7, 103, 2, 2, 153, 154, 7, 112, 2, 2, 154, 155, 7, 119, 2, 2, 155, 156, 7, 114, 2, 2, 156, 30, 3, 2, 2, 2, 157, 158, 7, 114, 2, 2, 158, 159, 7, 103, 2, 2, 159, 160, 7, 112, 2, 2, 160, 161, 7, 102, 2, 2, 161, 162, 7, 113, 2, 2, 162, 163, 7, 121, 2, 2, 163, 164, 7, 112, 2, 2, 164, 32, 3, 2, 2, 2, 165, 166, 7, 114, 2, 2, 166, 167, 7, 99, 2, 2, 167, 168, 7, 119, 2, 2, 168, 169, 7, 117, 2, 2, 169, 170, 7, 103, 2, 2, 170, 34, 3, 2, 2, 2, 171, 172, 7, 63, 2, 2, 172, 36, 3, 2, 2, 2, 173, 174, 7, 114, 2, 2, 174, 175, 7, 116, 2, 2, 175, 176, 7, 107, 2, 2, 176, 177, 7, 112, 2, 2, 177, 178, 7, 118, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 116, 2, 2, 180, 181, 7, 103, 2, 2, 181, 182, 7, 118, 2, 2, 182, 183, 7, 119, 2, 2, 183, 184, 7, 116, 2, 2, 184, 185, 7, 112, 2, 2, 185, 40, 3, 2, 2, 2, 186, 187, 7, 101, 2, 2, 187, 188, 7, 110, 2, 2, 188, 189, 7, 99, 2, 2, 189, 190, 7, 117, 2, 2, 190, 191, 7, 117, 2, 2, 191, 42, 3, 2, 2, 2, 192, 193, 7, 125, 2, 2, 193, 44, 3, 2, 2, 2, 194, 195, 7, 127, 2, 2, 195, 46, 3, 2, 2, 2, 196, 197, 7, 61, 2, 2, 197, 48, 3, 2, 2, 2, 198, 199, 7, 112, 2, 2, 199, 200, 7, 103, 2, 2, 200, 201, 7, 121, 2, 2, 201, 50, 3, 2, 2, 2, 202, 203, 7, 48, 2, 2, 203, 52, 3, 2, 2, 2, 204, 205, 7, 102, 2, 2, 205, 206, 7, 103, 2, 2, 206, 207, 7, 104, 2, 2, 207, 54, 3, 2, 2, 2, 208, 209, 7, 45, 2, 2, 209, 56, 3, 2, 2, 2, 210, 211, 7, 47, 2, 2, 211, 58, 3, 2, 2, 2, 212, 213, 7, 44, 2, 2, 213, 60, 3, 2, 2, 2, 214, 215, 7, 49, 2, 2, 215, 62, 3, 2, 2, 2, 216, 217, 7, 114, 2, 2, 217, 218, 7, 103, 2, 2, 218, 219, 7, 112, 2, 2, 219, 220, 7, 102, 2, 2, 220, 221, 7, 113, 2, 2, 221, 222, 7, 121, 2, 2, 222, 223, 7, 112, 2, 2, 223, 224, 7, 65, 2, 2, 224, 64, 3, 2, 2, 2, 225, 226, 7, 62, 2, 2, 226, 66, 3, 2, 2, 2, 227, 228, 7, 64, 2, 2, 228, 68, 3, 2, 2, 2, 229, 230, 7, 63, 2, 2, 230, 231, 7, 63, 2, 2, 231, 70, 3, 2, 2, 2, 232, 233, 7, 35, 2, 2, 233, 234, 7, 63, 2, 2, 234, 72, 3, 2, 2, 2, 235, 236, 7, 62, 2, 2, 236, 237, 7, 63, 2, 2, 237, 74, 3, 2, 2, 2, 238, 239, 7, 64, 2, 2, 239, 240, 7, 63, 2, 2, 240, 76, 3, 2, 2, 2, 241, 242, 7, 40, 2, 2, 242, 243, 7, 40, 2, 2, 243, 78, 3, 2, 2, 2, 244, 245, 7, 126, 2, 2, 245, 246, 7, 126, 2, 2, 246, 80, 3, 2, 2, 2, 247, 248, 7, 35, 2, 2, 248, 82, 3, 2, 2, 2, 249, 251, 9, 2, 2, 2, 250, 249, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 84, 3, 2, 2, 2, 254, 256, 9, 3, 2, 2, 255, 254, 3, 2, 2, 2, 255, 256, 3, 2, 2, 2, 256, 258, 3, 2, 2, 2, 257, 259, 9, 2, 2, 2, 258, 257, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 268, 3, 2, 2, 2, 262, 264, 7, 48, 2, 2, 263, 265, 9, 2, 2, 2, 264, 263, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 269, 3, 2, 2, 2, 268, 262, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 86, 3, 2, 2, 2, 270, 271, 7, 60, 2, 2, 271, 275, 9, 4, 2, 2, 272, 274, 9, 5, 2, 2, 273, 272, 3, 2, 2, 2, 274, 277, 3, 2, 2, 2, 275, 273, 3, 2, 2, 2, 275, 276, 3, 2, 2, 2, 276, 88, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 278, 280, 9, 6, 2, 2, 279, 278, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 90, 3, 2, 2, 2, 283, 285, 9, 7, 2, 2, 284, 283, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 288, 3, 2, 2, 2, 288, 289, 8, 46, 2, 2, 289, 92, 3, 2, 2, 2, 11, 2, 252, 255, 260, 266, 268, 275, 281, 286, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index a8b9026..184a70a 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -8,113 +8,123 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2.") - buf.write("\u0110\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2/") + buf.write("\u0122\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") buf.write("\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36") buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%") - buf.write("\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\3\2") - buf.write("\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3") - buf.write("\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\t\3\t") - buf.write("\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3") - buf.write("\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\16") - buf.write("\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17") - buf.write("\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21") - buf.write("\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23") - buf.write("\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25") - buf.write("\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30\3\31\3\31\3\31") - buf.write("\3\31\3\32\3\32\3\33\3\33\3\33\3\33\3\34\3\34\3\35\3\35") - buf.write("\3\36\3\36\3\37\3\37\3 \3 \3 \3 \3 \3 \3 \3 \3 \3!\3!") - buf.write("\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3&\3&\3&\3\'\3\'\3") - buf.write("\'\3(\3(\3(\3)\3)\3*\6*\u00f9\n*\r*\16*\u00fa\3+\3+\3") - buf.write("+\7+\u0100\n+\f+\16+\u0103\13+\3,\6,\u0106\n,\r,\16,\u0107") - buf.write("\3-\6-\u010b\n-\r-\16-\u010c\3-\3-\2\2.\3\3\5\4\7\5\t") - buf.write("\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20") - buf.write("\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65") - buf.write("\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.\3\2") - buf.write("\7\3\2\62;\5\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5\2\13\f\17") - buf.write("\17\"\"\2\u0113\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2") - buf.write("\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21") - buf.write("\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3") - buf.write("\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2") - buf.write("\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2") - buf.write("\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2") - buf.write("\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2") - buf.write("\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3") - buf.write("\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q") - buf.write("\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\3") - buf.write("[\3\2\2\2\5^\3\2\2\2\7`\3\2\2\2\tb\3\2\2\2\13g\3\2\2\2") - buf.write("\rn\3\2\2\2\17s\3\2\2\2\21u\3\2\2\2\23w\3\2\2\2\25y\3") - buf.write("\2\2\2\27\u0081\3\2\2\2\31\u008a\3\2\2\2\33\u008f\3\2") - buf.write("\2\2\35\u0095\3\2\2\2\37\u009b\3\2\2\2!\u00a3\3\2\2\2") - buf.write("#\u00a9\3\2\2\2%\u00ab\3\2\2\2\'\u00b1\3\2\2\2)\u00b8") - buf.write("\3\2\2\2+\u00be\3\2\2\2-\u00c0\3\2\2\2/\u00c2\3\2\2\2") - buf.write("\61\u00c4\3\2\2\2\63\u00c8\3\2\2\2\65\u00ca\3\2\2\2\67") - buf.write("\u00ce\3\2\2\29\u00d0\3\2\2\2;\u00d2\3\2\2\2=\u00d4\3") - buf.write("\2\2\2?\u00d6\3\2\2\2A\u00df\3\2\2\2C\u00e1\3\2\2\2E\u00e3") - buf.write("\3\2\2\2G\u00e6\3\2\2\2I\u00e9\3\2\2\2K\u00ec\3\2\2\2") - buf.write("M\u00ef\3\2\2\2O\u00f2\3\2\2\2Q\u00f5\3\2\2\2S\u00f8\3") - buf.write("\2\2\2U\u00fc\3\2\2\2W\u0105\3\2\2\2Y\u010a\3\2\2\2[\\") - buf.write("\7k\2\2\\]\7h\2\2]\4\3\2\2\2^_\7]\2\2_\6\3\2\2\2`a\7_") - buf.write("\2\2a\b\3\2\2\2bc\7g\2\2cd\7n\2\2de\7u\2\2ef\7g\2\2f\n") - buf.write("\3\2\2\2gh\7t\2\2hi\7g\2\2ij\7r\2\2jk\7g\2\2kl\7c\2\2") - buf.write("lm\7v\2\2m\f\3\2\2\2no\7i\2\2op\7q\2\2pq\7v\2\2qr\7q\2") - buf.write("\2r\16\3\2\2\2st\7*\2\2t\20\3\2\2\2uv\7.\2\2v\22\3\2\2") - buf.write("\2wx\7+\2\2x\24\3\2\2\2yz\7h\2\2z{\7q\2\2{|\7t\2\2|}\7") - buf.write("y\2\2}~\7c\2\2~\177\7t\2\2\177\u0080\7f\2\2\u0080\26\3") - buf.write("\2\2\2\u0081\u0082\7d\2\2\u0082\u0083\7c\2\2\u0083\u0084") - buf.write("\7e\2\2\u0084\u0085\7m\2\2\u0085\u0086\7y\2\2\u0086\u0087") - buf.write("\7c\2\2\u0087\u0088\7t\2\2\u0088\u0089\7f\2\2\u0089\30") - buf.write("\3\2\2\2\u008a\u008b\7n\2\2\u008b\u008c\7g\2\2\u008c\u008d") - buf.write("\7h\2\2\u008d\u008e\7v\2\2\u008e\32\3\2\2\2\u008f\u0090") - buf.write("\7t\2\2\u0090\u0091\7k\2\2\u0091\u0092\7i\2\2\u0092\u0093") - buf.write("\7j\2\2\u0093\u0094\7v\2\2\u0094\34\3\2\2\2\u0095\u0096") - buf.write("\7r\2\2\u0096\u0097\7g\2\2\u0097\u0098\7p\2\2\u0098\u0099") - buf.write("\7w\2\2\u0099\u009a\7r\2\2\u009a\36\3\2\2\2\u009b\u009c") - buf.write("\7r\2\2\u009c\u009d\7g\2\2\u009d\u009e\7p\2\2\u009e\u009f") - buf.write("\7f\2\2\u009f\u00a0\7q\2\2\u00a0\u00a1\7y\2\2\u00a1\u00a2") - buf.write("\7p\2\2\u00a2 \3\2\2\2\u00a3\u00a4\7r\2\2\u00a4\u00a5") - buf.write("\7c\2\2\u00a5\u00a6\7w\2\2\u00a6\u00a7\7u\2\2\u00a7\u00a8") - buf.write("\7g\2\2\u00a8\"\3\2\2\2\u00a9\u00aa\7?\2\2\u00aa$\3\2") - buf.write("\2\2\u00ab\u00ac\7r\2\2\u00ac\u00ad\7t\2\2\u00ad\u00ae") - buf.write("\7k\2\2\u00ae\u00af\7p\2\2\u00af\u00b0\7v\2\2\u00b0&\3") - buf.write("\2\2\2\u00b1\u00b2\7t\2\2\u00b2\u00b3\7g\2\2\u00b3\u00b4") - buf.write("\7v\2\2\u00b4\u00b5\7w\2\2\u00b5\u00b6\7t\2\2\u00b6\u00b7") - buf.write("\7p\2\2\u00b7(\3\2\2\2\u00b8\u00b9\7e\2\2\u00b9\u00ba") - buf.write("\7n\2\2\u00ba\u00bb\7c\2\2\u00bb\u00bc\7u\2\2\u00bc\u00bd") - buf.write("\7u\2\2\u00bd*\3\2\2\2\u00be\u00bf\7}\2\2\u00bf,\3\2\2") - buf.write("\2\u00c0\u00c1\7\177\2\2\u00c1.\3\2\2\2\u00c2\u00c3\7") - buf.write("=\2\2\u00c3\60\3\2\2\2\u00c4\u00c5\7p\2\2\u00c5\u00c6") - buf.write("\7g\2\2\u00c6\u00c7\7y\2\2\u00c7\62\3\2\2\2\u00c8\u00c9") - buf.write("\7\60\2\2\u00c9\64\3\2\2\2\u00ca\u00cb\7f\2\2\u00cb\u00cc") - buf.write("\7g\2\2\u00cc\u00cd\7h\2\2\u00cd\66\3\2\2\2\u00ce\u00cf") - buf.write("\7-\2\2\u00cf8\3\2\2\2\u00d0\u00d1\7/\2\2\u00d1:\3\2\2") - buf.write("\2\u00d2\u00d3\7,\2\2\u00d3<\3\2\2\2\u00d4\u00d5\7\61") - buf.write("\2\2\u00d5>\3\2\2\2\u00d6\u00d7\7r\2\2\u00d7\u00d8\7g") - buf.write("\2\2\u00d8\u00d9\7p\2\2\u00d9\u00da\7f\2\2\u00da\u00db") - buf.write("\7q\2\2\u00db\u00dc\7y\2\2\u00dc\u00dd\7p\2\2\u00dd\u00de") - buf.write("\7A\2\2\u00de@\3\2\2\2\u00df\u00e0\7>\2\2\u00e0B\3\2\2") - buf.write("\2\u00e1\u00e2\7@\2\2\u00e2D\3\2\2\2\u00e3\u00e4\7?\2") - buf.write("\2\u00e4\u00e5\7?\2\2\u00e5F\3\2\2\2\u00e6\u00e7\7#\2") - buf.write("\2\u00e7\u00e8\7?\2\2\u00e8H\3\2\2\2\u00e9\u00ea\7>\2") - buf.write("\2\u00ea\u00eb\7?\2\2\u00ebJ\3\2\2\2\u00ec\u00ed\7@\2") - buf.write("\2\u00ed\u00ee\7?\2\2\u00eeL\3\2\2\2\u00ef\u00f0\7(\2") - buf.write("\2\u00f0\u00f1\7(\2\2\u00f1N\3\2\2\2\u00f2\u00f3\7~\2") - buf.write("\2\u00f3\u00f4\7~\2\2\u00f4P\3\2\2\2\u00f5\u00f6\7#\2") - buf.write("\2\u00f6R\3\2\2\2\u00f7\u00f9\t\2\2\2\u00f8\u00f7\3\2") - buf.write("\2\2\u00f9\u00fa\3\2\2\2\u00fa\u00f8\3\2\2\2\u00fa\u00fb") - buf.write("\3\2\2\2\u00fbT\3\2\2\2\u00fc\u00fd\7<\2\2\u00fd\u0101") - buf.write("\t\3\2\2\u00fe\u0100\t\4\2\2\u00ff\u00fe\3\2\2\2\u0100") - buf.write("\u0103\3\2\2\2\u0101\u00ff\3\2\2\2\u0101\u0102\3\2\2\2") - buf.write("\u0102V\3\2\2\2\u0103\u0101\3\2\2\2\u0104\u0106\t\5\2") - buf.write("\2\u0105\u0104\3\2\2\2\u0106\u0107\3\2\2\2\u0107\u0105") - buf.write("\3\2\2\2\u0107\u0108\3\2\2\2\u0108X\3\2\2\2\u0109\u010b") - buf.write("\t\6\2\2\u010a\u0109\3\2\2\2\u010b\u010c\3\2\2\2\u010c") - buf.write("\u010a\3\2\2\2\u010c\u010d\3\2\2\2\u010d\u010e\3\2\2\2") - buf.write("\u010e\u010f\b-\2\2\u010fZ\3\2\2\2\7\2\u00fa\u0101\u0107") - buf.write("\u010c\3\b\2\2") + buf.write("\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\4.") + buf.write("\t.\3\2\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3") + buf.write("\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b") + buf.write("\3\t\3\t\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3") + buf.write("\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3") + buf.write("\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3") + buf.write("\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20") + buf.write("\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23") + buf.write("\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25") + buf.write("\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30") + buf.write("\3\31\3\31\3\31\3\31\3\32\3\32\3\33\3\33\3\33\3\33\3\34") + buf.write("\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3 \3 \3 \3 \3 \3 ") + buf.write("\3 \3 \3 \3!\3!\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3&") + buf.write("\3&\3&\3\'\3\'\3\'\3(\3(\3(\3)\3)\3*\6*\u00fb\n*\r*\16") + buf.write("*\u00fc\3+\5+\u0100\n+\3+\6+\u0103\n+\r+\16+\u0104\3+") + buf.write("\3+\6+\u0109\n+\r+\16+\u010a\5+\u010d\n+\3,\3,\3,\7,\u0112") + buf.write("\n,\f,\16,\u0115\13,\3-\6-\u0118\n-\r-\16-\u0119\3.\6") + buf.write(".\u011d\n.\r.\16.\u011e\3.\3.\2\2/\3\3\5\4\7\5\t\6\13") + buf.write("\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37") + buf.write("\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34") + buf.write("\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/\3\2\b") + buf.write("\3\2\62;\4\2--//\5\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5\2") + buf.write("\13\f\17\17\"\"\2\u0129\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3") + buf.write("\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2") + buf.write("\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2") + buf.write("\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2") + buf.write("!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2") + buf.write("\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3") + buf.write("\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2") + buf.write("\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2") + buf.write("\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2") + buf.write("\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3") + buf.write("\2\2\2\2[\3\2\2\2\3]\3\2\2\2\5`\3\2\2\2\7b\3\2\2\2\td") + buf.write("\3\2\2\2\13i\3\2\2\2\rp\3\2\2\2\17u\3\2\2\2\21w\3\2\2") + buf.write("\2\23y\3\2\2\2\25{\3\2\2\2\27\u0083\3\2\2\2\31\u008c\3") + buf.write("\2\2\2\33\u0091\3\2\2\2\35\u0097\3\2\2\2\37\u009d\3\2") + buf.write("\2\2!\u00a5\3\2\2\2#\u00ab\3\2\2\2%\u00ad\3\2\2\2\'\u00b3") + buf.write("\3\2\2\2)\u00ba\3\2\2\2+\u00c0\3\2\2\2-\u00c2\3\2\2\2") + buf.write("/\u00c4\3\2\2\2\61\u00c6\3\2\2\2\63\u00ca\3\2\2\2\65\u00cc") + buf.write("\3\2\2\2\67\u00d0\3\2\2\29\u00d2\3\2\2\2;\u00d4\3\2\2") + buf.write("\2=\u00d6\3\2\2\2?\u00d8\3\2\2\2A\u00e1\3\2\2\2C\u00e3") + buf.write("\3\2\2\2E\u00e5\3\2\2\2G\u00e8\3\2\2\2I\u00eb\3\2\2\2") + buf.write("K\u00ee\3\2\2\2M\u00f1\3\2\2\2O\u00f4\3\2\2\2Q\u00f7\3") + buf.write("\2\2\2S\u00fa\3\2\2\2U\u00ff\3\2\2\2W\u010e\3\2\2\2Y\u0117") + buf.write("\3\2\2\2[\u011c\3\2\2\2]^\7k\2\2^_\7h\2\2_\4\3\2\2\2`") + buf.write("a\7]\2\2a\6\3\2\2\2bc\7_\2\2c\b\3\2\2\2de\7g\2\2ef\7n") + buf.write("\2\2fg\7u\2\2gh\7g\2\2h\n\3\2\2\2ij\7t\2\2jk\7g\2\2kl") + buf.write("\7r\2\2lm\7g\2\2mn\7c\2\2no\7v\2\2o\f\3\2\2\2pq\7i\2\2") + buf.write("qr\7q\2\2rs\7v\2\2st\7q\2\2t\16\3\2\2\2uv\7*\2\2v\20\3") + buf.write("\2\2\2wx\7.\2\2x\22\3\2\2\2yz\7+\2\2z\24\3\2\2\2{|\7h") + buf.write("\2\2|}\7q\2\2}~\7t\2\2~\177\7y\2\2\177\u0080\7c\2\2\u0080") + buf.write("\u0081\7t\2\2\u0081\u0082\7f\2\2\u0082\26\3\2\2\2\u0083") + buf.write("\u0084\7d\2\2\u0084\u0085\7c\2\2\u0085\u0086\7e\2\2\u0086") + buf.write("\u0087\7m\2\2\u0087\u0088\7y\2\2\u0088\u0089\7c\2\2\u0089") + buf.write("\u008a\7t\2\2\u008a\u008b\7f\2\2\u008b\30\3\2\2\2\u008c") + buf.write("\u008d\7n\2\2\u008d\u008e\7g\2\2\u008e\u008f\7h\2\2\u008f") + buf.write("\u0090\7v\2\2\u0090\32\3\2\2\2\u0091\u0092\7t\2\2\u0092") + buf.write("\u0093\7k\2\2\u0093\u0094\7i\2\2\u0094\u0095\7j\2\2\u0095") + buf.write("\u0096\7v\2\2\u0096\34\3\2\2\2\u0097\u0098\7r\2\2\u0098") + buf.write("\u0099\7g\2\2\u0099\u009a\7p\2\2\u009a\u009b\7w\2\2\u009b") + buf.write("\u009c\7r\2\2\u009c\36\3\2\2\2\u009d\u009e\7r\2\2\u009e") + buf.write("\u009f\7g\2\2\u009f\u00a0\7p\2\2\u00a0\u00a1\7f\2\2\u00a1") + buf.write("\u00a2\7q\2\2\u00a2\u00a3\7y\2\2\u00a3\u00a4\7p\2\2\u00a4") + buf.write(" \3\2\2\2\u00a5\u00a6\7r\2\2\u00a6\u00a7\7c\2\2\u00a7") + buf.write("\u00a8\7w\2\2\u00a8\u00a9\7u\2\2\u00a9\u00aa\7g\2\2\u00aa") + buf.write("\"\3\2\2\2\u00ab\u00ac\7?\2\2\u00ac$\3\2\2\2\u00ad\u00ae") + buf.write("\7r\2\2\u00ae\u00af\7t\2\2\u00af\u00b0\7k\2\2\u00b0\u00b1") + buf.write("\7p\2\2\u00b1\u00b2\7v\2\2\u00b2&\3\2\2\2\u00b3\u00b4") + buf.write("\7t\2\2\u00b4\u00b5\7g\2\2\u00b5\u00b6\7v\2\2\u00b6\u00b7") + buf.write("\7w\2\2\u00b7\u00b8\7t\2\2\u00b8\u00b9\7p\2\2\u00b9(\3") + buf.write("\2\2\2\u00ba\u00bb\7e\2\2\u00bb\u00bc\7n\2\2\u00bc\u00bd") + buf.write("\7c\2\2\u00bd\u00be\7u\2\2\u00be\u00bf\7u\2\2\u00bf*\3") + buf.write("\2\2\2\u00c0\u00c1\7}\2\2\u00c1,\3\2\2\2\u00c2\u00c3\7") + buf.write("\177\2\2\u00c3.\3\2\2\2\u00c4\u00c5\7=\2\2\u00c5\60\3") + buf.write("\2\2\2\u00c6\u00c7\7p\2\2\u00c7\u00c8\7g\2\2\u00c8\u00c9") + buf.write("\7y\2\2\u00c9\62\3\2\2\2\u00ca\u00cb\7\60\2\2\u00cb\64") + buf.write("\3\2\2\2\u00cc\u00cd\7f\2\2\u00cd\u00ce\7g\2\2\u00ce\u00cf") + buf.write("\7h\2\2\u00cf\66\3\2\2\2\u00d0\u00d1\7-\2\2\u00d18\3\2") + buf.write("\2\2\u00d2\u00d3\7/\2\2\u00d3:\3\2\2\2\u00d4\u00d5\7,") + buf.write("\2\2\u00d5<\3\2\2\2\u00d6\u00d7\7\61\2\2\u00d7>\3\2\2") + buf.write("\2\u00d8\u00d9\7r\2\2\u00d9\u00da\7g\2\2\u00da\u00db\7") + buf.write("p\2\2\u00db\u00dc\7f\2\2\u00dc\u00dd\7q\2\2\u00dd\u00de") + buf.write("\7y\2\2\u00de\u00df\7p\2\2\u00df\u00e0\7A\2\2\u00e0@\3") + buf.write("\2\2\2\u00e1\u00e2\7>\2\2\u00e2B\3\2\2\2\u00e3\u00e4\7") + buf.write("@\2\2\u00e4D\3\2\2\2\u00e5\u00e6\7?\2\2\u00e6\u00e7\7") + buf.write("?\2\2\u00e7F\3\2\2\2\u00e8\u00e9\7#\2\2\u00e9\u00ea\7") + buf.write("?\2\2\u00eaH\3\2\2\2\u00eb\u00ec\7>\2\2\u00ec\u00ed\7") + buf.write("?\2\2\u00edJ\3\2\2\2\u00ee\u00ef\7@\2\2\u00ef\u00f0\7") + buf.write("?\2\2\u00f0L\3\2\2\2\u00f1\u00f2\7(\2\2\u00f2\u00f3\7") + buf.write("(\2\2\u00f3N\3\2\2\2\u00f4\u00f5\7~\2\2\u00f5\u00f6\7") + buf.write("~\2\2\u00f6P\3\2\2\2\u00f7\u00f8\7#\2\2\u00f8R\3\2\2\2") + buf.write("\u00f9\u00fb\t\2\2\2\u00fa\u00f9\3\2\2\2\u00fb\u00fc\3") + buf.write("\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fdT") + buf.write("\3\2\2\2\u00fe\u0100\t\3\2\2\u00ff\u00fe\3\2\2\2\u00ff") + buf.write("\u0100\3\2\2\2\u0100\u0102\3\2\2\2\u0101\u0103\t\2\2\2") + buf.write("\u0102\u0101\3\2\2\2\u0103\u0104\3\2\2\2\u0104\u0102\3") + buf.write("\2\2\2\u0104\u0105\3\2\2\2\u0105\u010c\3\2\2\2\u0106\u0108") + buf.write("\7\60\2\2\u0107\u0109\t\2\2\2\u0108\u0107\3\2\2\2\u0109") + buf.write("\u010a\3\2\2\2\u010a\u0108\3\2\2\2\u010a\u010b\3\2\2\2") + buf.write("\u010b\u010d\3\2\2\2\u010c\u0106\3\2\2\2\u010c\u010d\3") + buf.write("\2\2\2\u010dV\3\2\2\2\u010e\u010f\7<\2\2\u010f\u0113\t") + buf.write("\4\2\2\u0110\u0112\t\5\2\2\u0111\u0110\3\2\2\2\u0112\u0115") + buf.write("\3\2\2\2\u0113\u0111\3\2\2\2\u0113\u0114\3\2\2\2\u0114") + buf.write("X\3\2\2\2\u0115\u0113\3\2\2\2\u0116\u0118\t\6\2\2\u0117") + buf.write("\u0116\3\2\2\2\u0118\u0119\3\2\2\2\u0119\u0117\3\2\2\2") + buf.write("\u0119\u011a\3\2\2\2\u011aZ\3\2\2\2\u011b\u011d\t\7\2") + buf.write("\2\u011c\u011b\3\2\2\2\u011d\u011e\3\2\2\2\u011e\u011c") + buf.write("\3\2\2\2\u011e\u011f\3\2\2\2\u011f\u0120\3\2\2\2\u0120") + buf.write("\u0121\b.\2\2\u0121\\\3\2\2\2\13\2\u00fc\u00ff\u0104\u010a") + buf.write("\u010c\u0113\u0119\u011e\3\b\2\2") return buf.getvalue() @@ -165,9 +175,10 @@ class tlangLexer(Lexer): OR = 39 NOT = 40 NUM = 41 - VAR = 42 - NAME = 43 - Whitespace = 44 + REAL = 42 + VAR = 43 + NAME = 44 + Whitespace = 45 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] @@ -183,8 +194,8 @@ class tlangLexer(Lexer): symbolicNames = [ "", "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", - "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", - "Whitespace" ] + "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", + "NAME", "Whitespace" ] ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", @@ -192,7 +203,7 @@ class tlangLexer(Lexer): "T__20", "T__21", "T__22", "T__23", "T__24", "T__25", "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", - "VAR", "NAME", "Whitespace" ] + "REAL", "VAR", "NAME", "Whitespace" ] grammarFileName = "tlang.g4" diff --git a/ChironCore/turtparse/tlangLexer.tokens b/ChironCore/turtparse/tlangLexer.tokens index f2b0e23..d855f44 100644 --- a/ChironCore/turtparse/tlangLexer.tokens +++ b/ChironCore/turtparse/tlangLexer.tokens @@ -39,9 +39,10 @@ AND=38 OR=39 NOT=40 NUM=41 -VAR=42 -NAME=43 -Whitespace=44 +REAL=42 +VAR=43 +NAME=44 +Whitespace=45 'if'=1 '['=2 ']'=3 diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index 5e9440c..2049f52 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -8,8 +8,8 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3.") - buf.write("\u014f\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3/") + buf.write("\u0150\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") @@ -39,119 +39,120 @@ def serializedATN(): buf.write("\n \3!\3!\3!\7!\u0127\n!\f!\16!\u012a\13!\5!\u012c\n!") buf.write("\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\5\"\u013a") buf.write("\n\"\3\"\3\"\3\"\3\"\7\"\u0140\n\"\f\"\16\"\u0143\13\"") - buf.write("\3#\3#\3$\3$\3%\3%\3%\3%\5%\u014d\n%\3%\2\4*B&\2\4\6\b") - buf.write("\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668") - buf.write(":<>@BDFH\2\b\3\2\f\17\3\2\20\21\3\2\37 \3\2\35\36\3\2") - buf.write("\"\'\3\2()\2\u0155\2J\3\2\2\2\4P\3\2\2\2\6T\3\2\2\2\b") - buf.write("f\3\2\2\2\nj\3\2\2\2\fl\3\2\2\2\16r\3\2\2\2\20|\3\2\2") - buf.write("\2\22\u0082\3\2\2\2\24\u0089\3\2\2\2\26\u008c\3\2\2\2") - buf.write("\30\u008e\3\2\2\2\32\u0090\3\2\2\2\34\u0092\3\2\2\2\36") - buf.write("\u00a1\3\2\2\2 \u00a6\3\2\2\2\"\u00ab\3\2\2\2$\u00ad\3") - buf.write("\2\2\2&\u00af\3\2\2\2(\u00b1\3\2\2\2*\u00cb\3\2\2\2,\u00da") - buf.write("\3\2\2\2.\u00e3\3\2\2\2\60\u00e6\3\2\2\2\62\u00eb\3\2") - buf.write("\2\2\64\u00f3\3\2\2\2\66\u00fe\3\2\2\28\u0100\3\2\2\2") - buf.write(":\u0105\3\2\2\2<\u0110\3\2\2\2>\u0121\3\2\2\2@\u012b\3") - buf.write("\2\2\2B\u0139\3\2\2\2D\u0144\3\2\2\2F\u0146\3\2\2\2H\u014c") - buf.write("\3\2\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2MO\5\b\5\2NM\3") - buf.write("\2\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2Q\5\3\2\2\2RP\3\2") - buf.write("\2\2SU\5\b\5\2TS\3\2\2\2UV\3\2\2\2VT\3\2\2\2VW\3\2\2\2") - buf.write("W\7\3\2\2\2Xg\5\36\20\2Yg\5 \21\2Zg\5\n\6\2[g\5\20\t\2") - buf.write("\\g\5\24\13\2]g\5\30\r\2^g\5\22\n\2_g\5\32\16\2`g\5,\27") - buf.write("\2ag\5\62\32\2bg\5<\37\2cg\58\35\2dg\5:\36\2eg\5(\25\2") - buf.write("fX\3\2\2\2fY\3\2\2\2fZ\3\2\2\2f[\3\2\2\2f\\\3\2\2\2f]") - buf.write("\3\2\2\2f^\3\2\2\2f_\3\2\2\2f`\3\2\2\2fa\3\2\2\2fb\3\2") - buf.write("\2\2fc\3\2\2\2fd\3\2\2\2fe\3\2\2\2g\t\3\2\2\2hk\5\f\7") - buf.write("\2ik\5\16\b\2jh\3\2\2\2ji\3\2\2\2k\13\3\2\2\2lm\7\3\2") - buf.write("\2mn\5B\"\2no\7\4\2\2op\5\6\4\2pq\7\5\2\2q\r\3\2\2\2r") - buf.write("s\7\3\2\2st\5B\"\2tu\7\4\2\2uv\5\6\4\2vw\7\5\2\2wx\7\6") - buf.write("\2\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2{\17\3\2\2\2|}\7\7\2") - buf.write("\2}~\5H%\2~\177\7\4\2\2\177\u0080\5\6\4\2\u0080\u0081") - buf.write("\7\5\2\2\u0081\21\3\2\2\2\u0082\u0083\7\b\2\2\u0083\u0084") - buf.write("\7\t\2\2\u0084\u0085\5*\26\2\u0085\u0086\7\n\2\2\u0086") - buf.write("\u0087\5*\26\2\u0087\u0088\7\13\2\2\u0088\23\3\2\2\2\u0089") - buf.write("\u008a\5\26\f\2\u008a\u008b\5*\26\2\u008b\25\3\2\2\2\u008c") - buf.write("\u008d\t\2\2\2\u008d\27\3\2\2\2\u008e\u008f\t\3\2\2\u008f") - buf.write("\31\3\2\2\2\u0090\u0091\7\22\2\2\u0091\33\3\2\2\2\u0092") - buf.write("\u009b\7\4\2\2\u0093\u0098\5*\26\2\u0094\u0095\7\n\2\2") - buf.write("\u0095\u0097\5*\26\2\u0096\u0094\3\2\2\2\u0097\u009a\3") - buf.write("\2\2\2\u0098\u0096\3\2\2\2\u0098\u0099\3\2\2\2\u0099\u009c") - buf.write("\3\2\2\2\u009a\u0098\3\2\2\2\u009b\u0093\3\2\2\2\u009b") - buf.write("\u009c\3\2\2\2\u009c\u009d\3\2\2\2\u009d\u009e\7\5\2\2") - buf.write("\u009e\35\3\2\2\2\u009f\u00a2\7,\2\2\u00a0\u00a2\5\64") - buf.write("\33\2\u00a1\u009f\3\2\2\2\u00a1\u00a0\3\2\2\2\u00a2\u00a3") - buf.write("\3\2\2\2\u00a3\u00a4\7\23\2\2\u00a4\u00a5\5*\26\2\u00a5") - buf.write("\37\3\2\2\2\u00a6\u00a7\7\24\2\2\u00a7\u00a8\7\t\2\2\u00a8") - buf.write("\u00a9\5*\26\2\u00a9\u00aa\7\13\2\2\u00aa!\3\2\2\2\u00ab") - buf.write("\u00ac\t\4\2\2\u00ac#\3\2\2\2\u00ad\u00ae\t\5\2\2\u00ae") - buf.write("%\3\2\2\2\u00af\u00b0\7\36\2\2\u00b0\'\3\2\2\2\u00b1\u00ba") - buf.write("\7\25\2\2\u00b2\u00b7\5*\26\2\u00b3\u00b4\7\n\2\2\u00b4") - buf.write("\u00b6\5*\26\2\u00b5\u00b3\3\2\2\2\u00b6\u00b9\3\2\2\2") - buf.write("\u00b7\u00b5\3\2\2\2\u00b7\u00b8\3\2\2\2\u00b8\u00bb\3") - buf.write("\2\2\2\u00b9\u00b7\3\2\2\2\u00ba\u00b2\3\2\2\2\u00ba\u00bb") - buf.write("\3\2\2\2\u00bb)\3\2\2\2\u00bc\u00bd\b\26\1\2\u00bd\u00be") - buf.write("\5&\24\2\u00be\u00bf\5*\26\b\u00bf\u00cc\3\2\2\2\u00c0") - buf.write("\u00c1\7\t\2\2\u00c1\u00c2\5*\26\2\u00c2\u00c3\7\13\2") - buf.write("\2\u00c3\u00cc\3\2\2\2\u00c4\u00cc\5H%\2\u00c5\u00c8\7") - buf.write(",\2\2\u00c6\u00c8\5\64\33\2\u00c7\u00c5\3\2\2\2\u00c7") - buf.write("\u00c6\3\2\2\2\u00c8\u00c9\3\2\2\2\u00c9\u00ca\7\23\2") - buf.write("\2\u00ca\u00cc\5*\26\3\u00cb\u00bc\3\2\2\2\u00cb\u00c0") - buf.write("\3\2\2\2\u00cb\u00c4\3\2\2\2\u00cb\u00c7\3\2\2\2\u00cc") - buf.write("\u00d7\3\2\2\2\u00cd\u00ce\f\7\2\2\u00ce\u00cf\5\"\22") - buf.write("\2\u00cf\u00d0\5*\26\b\u00d0\u00d6\3\2\2\2\u00d1\u00d2") - buf.write("\f\6\2\2\u00d2\u00d3\5$\23\2\u00d3\u00d4\5*\26\7\u00d4") - buf.write("\u00d6\3\2\2\2\u00d5\u00cd\3\2\2\2\u00d5\u00d1\3\2\2\2") - buf.write("\u00d6\u00d9\3\2\2\2\u00d7\u00d5\3\2\2\2\u00d7\u00d8\3") - buf.write("\2\2\2\u00d8+\3\2\2\2\u00d9\u00d7\3\2\2\2\u00da\u00db") - buf.write("\7\26\2\2\u00db\u00dc\7,\2\2\u00dc\u00dd\7\27\2\2\u00dd") - buf.write("\u00de\5.\30\2\u00de\u00df\7\30\2\2\u00df-\3\2\2\2\u00e0") - buf.write("\u00e2\5\60\31\2\u00e1\u00e0\3\2\2\2\u00e2\u00e5\3\2\2") - buf.write("\2\u00e3\u00e1\3\2\2\2\u00e3\u00e4\3\2\2\2\u00e4/\3\2") - buf.write("\2\2\u00e5\u00e3\3\2\2\2\u00e6\u00e7\5\36\20\2\u00e7\u00e8") - buf.write("\7\31\2\2\u00e8\61\3\2\2\2\u00e9\u00ec\7,\2\2\u00ea\u00ec") - buf.write("\5\64\33\2\u00eb\u00e9\3\2\2\2\u00eb\u00ea\3\2\2\2\u00ec") - buf.write("\u00ed\3\2\2\2\u00ed\u00ee\7\23\2\2\u00ee\u00ef\7\32\2") - buf.write("\2\u00ef\u00f0\7,\2\2\u00f0\u00f1\7\t\2\2\u00f1\u00f2") - buf.write("\7\13\2\2\u00f2\63\3\2\2\2\u00f3\u00fa\5\66\34\2\u00f4") - buf.write("\u00f5\7\33\2\2\u00f5\u00fb\7,\2\2\u00f6\u00f7\7\4\2\2") - buf.write("\u00f7\u00f8\5*\26\2\u00f8\u00f9\7\5\2\2\u00f9\u00fb\3") - buf.write("\2\2\2\u00fa\u00f4\3\2\2\2\u00fa\u00f6\3\2\2\2\u00fb\u00fc") - buf.write("\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd") - buf.write("\65\3\2\2\2\u00fe\u00ff\7,\2\2\u00ff\67\3\2\2\2\u0100") - buf.write("\u0101\7-\2\2\u0101\u0102\7\t\2\2\u0102\u0103\5@!\2\u0103") - buf.write("\u0104\7\13\2\2\u01049\3\2\2\2\u0105\u010a\7,\2\2\u0106") - buf.write("\u0107\7\n\2\2\u0107\u0109\7,\2\2\u0108\u0106\3\2\2\2") - buf.write("\u0109\u010c\3\2\2\2\u010a\u0108\3\2\2\2\u010a\u010b\3") - buf.write("\2\2\2\u010b\u010d\3\2\2\2\u010c\u010a\3\2\2\2\u010d\u010e") - buf.write("\7\23\2\2\u010e\u010f\58\35\2\u010f;\3\2\2\2\u0110\u0111") - buf.write("\7\34\2\2\u0111\u0112\7-\2\2\u0112\u0113\7\t\2\2\u0113") - buf.write("\u0114\5> \2\u0114\u0115\7\13\2\2\u0115\u0116\7\27\2\2") - buf.write("\u0116\u0117\5\6\4\2\u0117\u0118\7\30\2\2\u0118=\3\2\2") - buf.write("\2\u0119\u011e\7,\2\2\u011a\u011b\7\n\2\2\u011b\u011d") - buf.write("\7,\2\2\u011c\u011a\3\2\2\2\u011d\u0120\3\2\2\2\u011e") - buf.write("\u011c\3\2\2\2\u011e\u011f\3\2\2\2\u011f\u0122\3\2\2\2") - buf.write("\u0120\u011e\3\2\2\2\u0121\u0119\3\2\2\2\u0121\u0122\3") - buf.write("\2\2\2\u0122?\3\2\2\2\u0123\u0128\5*\26\2\u0124\u0125") - buf.write("\7\n\2\2\u0125\u0127\5*\26\2\u0126\u0124\3\2\2\2\u0127") - buf.write("\u012a\3\2\2\2\u0128\u0126\3\2\2\2\u0128\u0129\3\2\2\2") - buf.write("\u0129\u012c\3\2\2\2\u012a\u0128\3\2\2\2\u012b\u0123\3") - buf.write("\2\2\2\u012b\u012c\3\2\2\2\u012cA\3\2\2\2\u012d\u012e") - buf.write("\b\"\1\2\u012e\u012f\7*\2\2\u012f\u013a\5B\"\7\u0130\u0131") - buf.write("\5*\26\2\u0131\u0132\5D#\2\u0132\u0133\5*\26\2\u0133\u013a") - buf.write("\3\2\2\2\u0134\u013a\7!\2\2\u0135\u0136\7\t\2\2\u0136") - buf.write("\u0137\5B\"\2\u0137\u0138\7\13\2\2\u0138\u013a\3\2\2\2") - buf.write("\u0139\u012d\3\2\2\2\u0139\u0130\3\2\2\2\u0139\u0134\3") - buf.write("\2\2\2\u0139\u0135\3\2\2\2\u013a\u0141\3\2\2\2\u013b\u013c") - buf.write("\f\5\2\2\u013c\u013d\5F$\2\u013d\u013e\5B\"\6\u013e\u0140") - buf.write("\3\2\2\2\u013f\u013b\3\2\2\2\u0140\u0143\3\2\2\2\u0141") - buf.write("\u013f\3\2\2\2\u0141\u0142\3\2\2\2\u0142C\3\2\2\2\u0143") - buf.write("\u0141\3\2\2\2\u0144\u0145\t\6\2\2\u0145E\3\2\2\2\u0146") - buf.write("\u0147\t\7\2\2\u0147G\3\2\2\2\u0148\u014d\7+\2\2\u0149") - buf.write("\u014d\7,\2\2\u014a\u014d\5\34\17\2\u014b\u014d\5\64\33") - buf.write("\2\u014c\u0148\3\2\2\2\u014c\u0149\3\2\2\2\u014c\u014a") - buf.write("\3\2\2\2\u014c\u014b\3\2\2\2\u014dI\3\2\2\2\33PVfj\u0098") - buf.write("\u009b\u00a1\u00b7\u00ba\u00c7\u00cb\u00d5\u00d7\u00e3") - buf.write("\u00eb\u00fa\u00fc\u010a\u011e\u0121\u0128\u012b\u0139") - buf.write("\u0141\u014c") + buf.write("\3#\3#\3$\3$\3%\3%\3%\3%\3%\5%\u014e\n%\3%\2\4*B&\2\4") + buf.write("\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64") + buf.write("\668:<>@BDFH\2\b\3\2\f\17\3\2\20\21\3\2\37 \3\2\35\36") + buf.write("\3\2\"\'\3\2()\2\u0157\2J\3\2\2\2\4P\3\2\2\2\6T\3\2\2") + buf.write("\2\bf\3\2\2\2\nj\3\2\2\2\fl\3\2\2\2\16r\3\2\2\2\20|\3") + buf.write("\2\2\2\22\u0082\3\2\2\2\24\u0089\3\2\2\2\26\u008c\3\2") + buf.write("\2\2\30\u008e\3\2\2\2\32\u0090\3\2\2\2\34\u0092\3\2\2") + buf.write("\2\36\u00a1\3\2\2\2 \u00a6\3\2\2\2\"\u00ab\3\2\2\2$\u00ad") + buf.write("\3\2\2\2&\u00af\3\2\2\2(\u00b1\3\2\2\2*\u00cb\3\2\2\2") + buf.write(",\u00da\3\2\2\2.\u00e3\3\2\2\2\60\u00e6\3\2\2\2\62\u00eb") + buf.write("\3\2\2\2\64\u00f3\3\2\2\2\66\u00fe\3\2\2\28\u0100\3\2") + buf.write("\2\2:\u0105\3\2\2\2<\u0110\3\2\2\2>\u0121\3\2\2\2@\u012b") + buf.write("\3\2\2\2B\u0139\3\2\2\2D\u0144\3\2\2\2F\u0146\3\2\2\2") + buf.write("H\u014d\3\2\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2MO\5\b\5") + buf.write("\2NM\3\2\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2Q\5\3\2\2\2") + buf.write("RP\3\2\2\2SU\5\b\5\2TS\3\2\2\2UV\3\2\2\2VT\3\2\2\2VW\3") + buf.write("\2\2\2W\7\3\2\2\2Xg\5\36\20\2Yg\5 \21\2Zg\5\n\6\2[g\5") + buf.write("\20\t\2\\g\5\24\13\2]g\5\30\r\2^g\5\22\n\2_g\5\32\16\2") + buf.write("`g\5,\27\2ag\5\62\32\2bg\5<\37\2cg\58\35\2dg\5:\36\2e") + buf.write("g\5(\25\2fX\3\2\2\2fY\3\2\2\2fZ\3\2\2\2f[\3\2\2\2f\\\3") + buf.write("\2\2\2f]\3\2\2\2f^\3\2\2\2f_\3\2\2\2f`\3\2\2\2fa\3\2\2") + buf.write("\2fb\3\2\2\2fc\3\2\2\2fd\3\2\2\2fe\3\2\2\2g\t\3\2\2\2") + buf.write("hk\5\f\7\2ik\5\16\b\2jh\3\2\2\2ji\3\2\2\2k\13\3\2\2\2") + buf.write("lm\7\3\2\2mn\5B\"\2no\7\4\2\2op\5\6\4\2pq\7\5\2\2q\r\3") + buf.write("\2\2\2rs\7\3\2\2st\5B\"\2tu\7\4\2\2uv\5\6\4\2vw\7\5\2") + buf.write("\2wx\7\6\2\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2{\17\3\2\2\2") + buf.write("|}\7\7\2\2}~\5H%\2~\177\7\4\2\2\177\u0080\5\6\4\2\u0080") + buf.write("\u0081\7\5\2\2\u0081\21\3\2\2\2\u0082\u0083\7\b\2\2\u0083") + buf.write("\u0084\7\t\2\2\u0084\u0085\5*\26\2\u0085\u0086\7\n\2\2") + buf.write("\u0086\u0087\5*\26\2\u0087\u0088\7\13\2\2\u0088\23\3\2") + buf.write("\2\2\u0089\u008a\5\26\f\2\u008a\u008b\5*\26\2\u008b\25") + buf.write("\3\2\2\2\u008c\u008d\t\2\2\2\u008d\27\3\2\2\2\u008e\u008f") + buf.write("\t\3\2\2\u008f\31\3\2\2\2\u0090\u0091\7\22\2\2\u0091\33") + buf.write("\3\2\2\2\u0092\u009b\7\4\2\2\u0093\u0098\5*\26\2\u0094") + buf.write("\u0095\7\n\2\2\u0095\u0097\5*\26\2\u0096\u0094\3\2\2\2") + buf.write("\u0097\u009a\3\2\2\2\u0098\u0096\3\2\2\2\u0098\u0099\3") + buf.write("\2\2\2\u0099\u009c\3\2\2\2\u009a\u0098\3\2\2\2\u009b\u0093") + buf.write("\3\2\2\2\u009b\u009c\3\2\2\2\u009c\u009d\3\2\2\2\u009d") + buf.write("\u009e\7\5\2\2\u009e\35\3\2\2\2\u009f\u00a2\7-\2\2\u00a0") + buf.write("\u00a2\5\64\33\2\u00a1\u009f\3\2\2\2\u00a1\u00a0\3\2\2") + buf.write("\2\u00a2\u00a3\3\2\2\2\u00a3\u00a4\7\23\2\2\u00a4\u00a5") + buf.write("\5*\26\2\u00a5\37\3\2\2\2\u00a6\u00a7\7\24\2\2\u00a7\u00a8") + buf.write("\7\t\2\2\u00a8\u00a9\5*\26\2\u00a9\u00aa\7\13\2\2\u00aa") + buf.write("!\3\2\2\2\u00ab\u00ac\t\4\2\2\u00ac#\3\2\2\2\u00ad\u00ae") + buf.write("\t\5\2\2\u00ae%\3\2\2\2\u00af\u00b0\7\36\2\2\u00b0\'\3") + buf.write("\2\2\2\u00b1\u00ba\7\25\2\2\u00b2\u00b7\5*\26\2\u00b3") + buf.write("\u00b4\7\n\2\2\u00b4\u00b6\5*\26\2\u00b5\u00b3\3\2\2\2") + buf.write("\u00b6\u00b9\3\2\2\2\u00b7\u00b5\3\2\2\2\u00b7\u00b8\3") + buf.write("\2\2\2\u00b8\u00bb\3\2\2\2\u00b9\u00b7\3\2\2\2\u00ba\u00b2") + buf.write("\3\2\2\2\u00ba\u00bb\3\2\2\2\u00bb)\3\2\2\2\u00bc\u00bd") + buf.write("\b\26\1\2\u00bd\u00be\5&\24\2\u00be\u00bf\5*\26\b\u00bf") + buf.write("\u00cc\3\2\2\2\u00c0\u00c1\7\t\2\2\u00c1\u00c2\5*\26\2") + buf.write("\u00c2\u00c3\7\13\2\2\u00c3\u00cc\3\2\2\2\u00c4\u00cc") + buf.write("\5H%\2\u00c5\u00c8\7-\2\2\u00c6\u00c8\5\64\33\2\u00c7") + buf.write("\u00c5\3\2\2\2\u00c7\u00c6\3\2\2\2\u00c8\u00c9\3\2\2\2") + buf.write("\u00c9\u00ca\7\23\2\2\u00ca\u00cc\5*\26\3\u00cb\u00bc") + buf.write("\3\2\2\2\u00cb\u00c0\3\2\2\2\u00cb\u00c4\3\2\2\2\u00cb") + buf.write("\u00c7\3\2\2\2\u00cc\u00d7\3\2\2\2\u00cd\u00ce\f\7\2\2") + buf.write("\u00ce\u00cf\5\"\22\2\u00cf\u00d0\5*\26\b\u00d0\u00d6") + buf.write("\3\2\2\2\u00d1\u00d2\f\6\2\2\u00d2\u00d3\5$\23\2\u00d3") + buf.write("\u00d4\5*\26\7\u00d4\u00d6\3\2\2\2\u00d5\u00cd\3\2\2\2") + buf.write("\u00d5\u00d1\3\2\2\2\u00d6\u00d9\3\2\2\2\u00d7\u00d5\3") + buf.write("\2\2\2\u00d7\u00d8\3\2\2\2\u00d8+\3\2\2\2\u00d9\u00d7") + buf.write("\3\2\2\2\u00da\u00db\7\26\2\2\u00db\u00dc\7-\2\2\u00dc") + buf.write("\u00dd\7\27\2\2\u00dd\u00de\5.\30\2\u00de\u00df\7\30\2") + buf.write("\2\u00df-\3\2\2\2\u00e0\u00e2\5\60\31\2\u00e1\u00e0\3") + buf.write("\2\2\2\u00e2\u00e5\3\2\2\2\u00e3\u00e1\3\2\2\2\u00e3\u00e4") + buf.write("\3\2\2\2\u00e4/\3\2\2\2\u00e5\u00e3\3\2\2\2\u00e6\u00e7") + buf.write("\5\36\20\2\u00e7\u00e8\7\31\2\2\u00e8\61\3\2\2\2\u00e9") + buf.write("\u00ec\7-\2\2\u00ea\u00ec\5\64\33\2\u00eb\u00e9\3\2\2") + buf.write("\2\u00eb\u00ea\3\2\2\2\u00ec\u00ed\3\2\2\2\u00ed\u00ee") + buf.write("\7\23\2\2\u00ee\u00ef\7\32\2\2\u00ef\u00f0\7-\2\2\u00f0") + buf.write("\u00f1\7\t\2\2\u00f1\u00f2\7\13\2\2\u00f2\63\3\2\2\2\u00f3") + buf.write("\u00fa\5\66\34\2\u00f4\u00f5\7\33\2\2\u00f5\u00fb\7-\2") + buf.write("\2\u00f6\u00f7\7\4\2\2\u00f7\u00f8\5*\26\2\u00f8\u00f9") + buf.write("\7\5\2\2\u00f9\u00fb\3\2\2\2\u00fa\u00f4\3\2\2\2\u00fa") + buf.write("\u00f6\3\2\2\2\u00fb\u00fc\3\2\2\2\u00fc\u00fa\3\2\2\2") + buf.write("\u00fc\u00fd\3\2\2\2\u00fd\65\3\2\2\2\u00fe\u00ff\7-\2") + buf.write("\2\u00ff\67\3\2\2\2\u0100\u0101\7.\2\2\u0101\u0102\7\t") + buf.write("\2\2\u0102\u0103\5@!\2\u0103\u0104\7\13\2\2\u01049\3\2") + buf.write("\2\2\u0105\u010a\7-\2\2\u0106\u0107\7\n\2\2\u0107\u0109") + buf.write("\7-\2\2\u0108\u0106\3\2\2\2\u0109\u010c\3\2\2\2\u010a") + buf.write("\u0108\3\2\2\2\u010a\u010b\3\2\2\2\u010b\u010d\3\2\2\2") + buf.write("\u010c\u010a\3\2\2\2\u010d\u010e\7\23\2\2\u010e\u010f") + buf.write("\58\35\2\u010f;\3\2\2\2\u0110\u0111\7\34\2\2\u0111\u0112") + buf.write("\7.\2\2\u0112\u0113\7\t\2\2\u0113\u0114\5> \2\u0114\u0115") + buf.write("\7\13\2\2\u0115\u0116\7\27\2\2\u0116\u0117\5\6\4\2\u0117") + buf.write("\u0118\7\30\2\2\u0118=\3\2\2\2\u0119\u011e\7-\2\2\u011a") + buf.write("\u011b\7\n\2\2\u011b\u011d\7-\2\2\u011c\u011a\3\2\2\2") + buf.write("\u011d\u0120\3\2\2\2\u011e\u011c\3\2\2\2\u011e\u011f\3") + buf.write("\2\2\2\u011f\u0122\3\2\2\2\u0120\u011e\3\2\2\2\u0121\u0119") + buf.write("\3\2\2\2\u0121\u0122\3\2\2\2\u0122?\3\2\2\2\u0123\u0128") + buf.write("\5*\26\2\u0124\u0125\7\n\2\2\u0125\u0127\5*\26\2\u0126") + buf.write("\u0124\3\2\2\2\u0127\u012a\3\2\2\2\u0128\u0126\3\2\2\2") + buf.write("\u0128\u0129\3\2\2\2\u0129\u012c\3\2\2\2\u012a\u0128\3") + buf.write("\2\2\2\u012b\u0123\3\2\2\2\u012b\u012c\3\2\2\2\u012cA") + buf.write("\3\2\2\2\u012d\u012e\b\"\1\2\u012e\u012f\7*\2\2\u012f") + buf.write("\u013a\5B\"\7\u0130\u0131\5*\26\2\u0131\u0132\5D#\2\u0132") + buf.write("\u0133\5*\26\2\u0133\u013a\3\2\2\2\u0134\u013a\7!\2\2") + buf.write("\u0135\u0136\7\t\2\2\u0136\u0137\5B\"\2\u0137\u0138\7") + buf.write("\13\2\2\u0138\u013a\3\2\2\2\u0139\u012d\3\2\2\2\u0139") + buf.write("\u0130\3\2\2\2\u0139\u0134\3\2\2\2\u0139\u0135\3\2\2\2") + buf.write("\u013a\u0141\3\2\2\2\u013b\u013c\f\5\2\2\u013c\u013d\5") + buf.write("F$\2\u013d\u013e\5B\"\6\u013e\u0140\3\2\2\2\u013f\u013b") + buf.write("\3\2\2\2\u0140\u0143\3\2\2\2\u0141\u013f\3\2\2\2\u0141") + buf.write("\u0142\3\2\2\2\u0142C\3\2\2\2\u0143\u0141\3\2\2\2\u0144") + buf.write("\u0145\t\6\2\2\u0145E\3\2\2\2\u0146\u0147\t\7\2\2\u0147") + buf.write("G\3\2\2\2\u0148\u014e\7+\2\2\u0149\u014e\7-\2\2\u014a") + buf.write("\u014e\5\34\17\2\u014b\u014e\5\64\33\2\u014c\u014e\7,") + buf.write("\2\2\u014d\u0148\3\2\2\2\u014d\u0149\3\2\2\2\u014d\u014a") + buf.write("\3\2\2\2\u014d\u014b\3\2\2\2\u014d\u014c\3\2\2\2\u014e") + buf.write("I\3\2\2\2\33PVfj\u0098\u009b\u00a1\u00b7\u00ba\u00c7\u00cb") + buf.write("\u00d5\u00d7\u00e3\u00eb\u00fa\u00fc\u010a\u011e\u0121") + buf.write("\u0128\u012b\u0139\u0141\u014d") return buf.getvalue() @@ -181,8 +182,8 @@ class tlangParser ( Parser ): "", "", "", "", "", "", "", "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", - "LTE", "GTE", "AND", "OR", "NOT", "NUM", "VAR", "NAME", - "Whitespace" ] + "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", + "NAME", "Whitespace" ] RULE_start = 0 RULE_instruction_list = 1 @@ -274,9 +275,10 @@ class tlangParser ( Parser ): OR=39 NOT=40 NUM=41 - VAR=42 - NAME=43 - Whitespace=44 + REAL=42 + VAR=43 + NAME=44 + Whitespace=45 def __init__(self, input:TokenStream, output:TextIO = sys.stdout): super().__init__(input, output) @@ -1085,7 +1087,7 @@ def array(self): self.state = 153 self._errHandler.sync(self) _la = self._input.LA(1) - if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.VAR))) != 0): + if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR))) != 0): self.state = 145 self.expression(0) self.state = 150 @@ -2269,7 +2271,7 @@ def arguments(self): self.state = 297 self._errHandler.sync(self) _la = self._input.LA(1) - if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.VAR))) != 0): + if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR))) != 0): self.state = 289 self.expression(0) self.state = 294 @@ -2541,6 +2543,9 @@ def objectOrArrayAccess(self): return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,0) + def REAL(self): + return self.getToken(tlangParser.REAL, 0) + def getRuleIndex(self): return tlangParser.RULE_value @@ -2558,7 +2563,7 @@ def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) self.enterRule(localctx, 70, self.RULE_value) try: - self.state = 330 + self.state = 331 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,24,self._ctx) if la_ == 1: @@ -2585,6 +2590,12 @@ def value(self): self.objectOrArrayAccess() pass + elif la_ == 5: + self.enterOuterAlt(localctx, 5) + self.state = 330 + self.match(tlangParser.REAL) + pass + except RecognitionException as re: localctx.exception = re From ebf8a68ae600458223e8e1ee8ef7a65be5e00b46 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Thu, 20 Feb 2025 20:44:57 +0530 Subject: [PATCH 08/47] real number issue fixed --- ChironCore/turtparse/tlang.g4 | 2 +- ChironCore/turtparse/tlangLexer.interp | 2 +- ChironCore/turtparse/tlangLexer.py | 192 ++++++++++++------------- 3 files changed, 97 insertions(+), 99 deletions(-) diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index 9696bce..ded1292 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -136,7 +136,7 @@ value : NUM ; NUM : [0-9]+ ; -REAL : [+-]?[0-9]+('.'[0-9]+)?; +REAL : [0-9]+('.'[0-9]+)?; VAR : ':'[a-zA-Z_] [a-zA-Z0-9]* ; NAME : [a-zA-Z]+ ; diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index 1ed56c9..aa43a61 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -149,4 +149,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 47, 290, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 251, 10, 42, 13, 42, 14, 42, 252, 3, 43, 5, 43, 256, 10, 43, 3, 43, 6, 43, 259, 10, 43, 13, 43, 14, 43, 260, 3, 43, 3, 43, 6, 43, 265, 10, 43, 13, 43, 14, 43, 266, 5, 43, 269, 10, 43, 3, 44, 3, 44, 3, 44, 7, 44, 274, 10, 44, 12, 44, 14, 44, 277, 11, 44, 3, 45, 6, 45, 280, 10, 45, 13, 45, 14, 45, 281, 3, 46, 6, 46, 285, 10, 46, 13, 46, 14, 46, 286, 3, 46, 3, 46, 2, 2, 47, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 3, 2, 8, 3, 2, 50, 59, 4, 2, 45, 45, 47, 47, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 297, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 3, 93, 3, 2, 2, 2, 5, 96, 3, 2, 2, 2, 7, 98, 3, 2, 2, 2, 9, 100, 3, 2, 2, 2, 11, 105, 3, 2, 2, 2, 13, 112, 3, 2, 2, 2, 15, 117, 3, 2, 2, 2, 17, 119, 3, 2, 2, 2, 19, 121, 3, 2, 2, 2, 21, 123, 3, 2, 2, 2, 23, 131, 3, 2, 2, 2, 25, 140, 3, 2, 2, 2, 27, 145, 3, 2, 2, 2, 29, 151, 3, 2, 2, 2, 31, 157, 3, 2, 2, 2, 33, 165, 3, 2, 2, 2, 35, 171, 3, 2, 2, 2, 37, 173, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 186, 3, 2, 2, 2, 43, 192, 3, 2, 2, 2, 45, 194, 3, 2, 2, 2, 47, 196, 3, 2, 2, 2, 49, 198, 3, 2, 2, 2, 51, 202, 3, 2, 2, 2, 53, 204, 3, 2, 2, 2, 55, 208, 3, 2, 2, 2, 57, 210, 3, 2, 2, 2, 59, 212, 3, 2, 2, 2, 61, 214, 3, 2, 2, 2, 63, 216, 3, 2, 2, 2, 65, 225, 3, 2, 2, 2, 67, 227, 3, 2, 2, 2, 69, 229, 3, 2, 2, 2, 71, 232, 3, 2, 2, 2, 73, 235, 3, 2, 2, 2, 75, 238, 3, 2, 2, 2, 77, 241, 3, 2, 2, 2, 79, 244, 3, 2, 2, 2, 81, 247, 3, 2, 2, 2, 83, 250, 3, 2, 2, 2, 85, 255, 3, 2, 2, 2, 87, 270, 3, 2, 2, 2, 89, 279, 3, 2, 2, 2, 91, 284, 3, 2, 2, 2, 93, 94, 7, 107, 2, 2, 94, 95, 7, 104, 2, 2, 95, 4, 3, 2, 2, 2, 96, 97, 7, 93, 2, 2, 97, 6, 3, 2, 2, 2, 98, 99, 7, 95, 2, 2, 99, 8, 3, 2, 2, 2, 100, 101, 7, 103, 2, 2, 101, 102, 7, 110, 2, 2, 102, 103, 7, 117, 2, 2, 103, 104, 7, 103, 2, 2, 104, 10, 3, 2, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 114, 2, 2, 108, 109, 7, 103, 2, 2, 109, 110, 7, 99, 2, 2, 110, 111, 7, 118, 2, 2, 111, 12, 3, 2, 2, 2, 112, 113, 7, 105, 2, 2, 113, 114, 7, 113, 2, 2, 114, 115, 7, 118, 2, 2, 115, 116, 7, 113, 2, 2, 116, 14, 3, 2, 2, 2, 117, 118, 7, 42, 2, 2, 118, 16, 3, 2, 2, 2, 119, 120, 7, 46, 2, 2, 120, 18, 3, 2, 2, 2, 121, 122, 7, 43, 2, 2, 122, 20, 3, 2, 2, 2, 123, 124, 7, 104, 2, 2, 124, 125, 7, 113, 2, 2, 125, 126, 7, 116, 2, 2, 126, 127, 7, 121, 2, 2, 127, 128, 7, 99, 2, 2, 128, 129, 7, 116, 2, 2, 129, 130, 7, 102, 2, 2, 130, 22, 3, 2, 2, 2, 131, 132, 7, 100, 2, 2, 132, 133, 7, 99, 2, 2, 133, 134, 7, 101, 2, 2, 134, 135, 7, 109, 2, 2, 135, 136, 7, 121, 2, 2, 136, 137, 7, 99, 2, 2, 137, 138, 7, 116, 2, 2, 138, 139, 7, 102, 2, 2, 139, 24, 3, 2, 2, 2, 140, 141, 7, 110, 2, 2, 141, 142, 7, 103, 2, 2, 142, 143, 7, 104, 2, 2, 143, 144, 7, 118, 2, 2, 144, 26, 3, 2, 2, 2, 145, 146, 7, 116, 2, 2, 146, 147, 7, 107, 2, 2, 147, 148, 7, 105, 2, 2, 148, 149, 7, 106, 2, 2, 149, 150, 7, 118, 2, 2, 150, 28, 3, 2, 2, 2, 151, 152, 7, 114, 2, 2, 152, 153, 7, 103, 2, 2, 153, 154, 7, 112, 2, 2, 154, 155, 7, 119, 2, 2, 155, 156, 7, 114, 2, 2, 156, 30, 3, 2, 2, 2, 157, 158, 7, 114, 2, 2, 158, 159, 7, 103, 2, 2, 159, 160, 7, 112, 2, 2, 160, 161, 7, 102, 2, 2, 161, 162, 7, 113, 2, 2, 162, 163, 7, 121, 2, 2, 163, 164, 7, 112, 2, 2, 164, 32, 3, 2, 2, 2, 165, 166, 7, 114, 2, 2, 166, 167, 7, 99, 2, 2, 167, 168, 7, 119, 2, 2, 168, 169, 7, 117, 2, 2, 169, 170, 7, 103, 2, 2, 170, 34, 3, 2, 2, 2, 171, 172, 7, 63, 2, 2, 172, 36, 3, 2, 2, 2, 173, 174, 7, 114, 2, 2, 174, 175, 7, 116, 2, 2, 175, 176, 7, 107, 2, 2, 176, 177, 7, 112, 2, 2, 177, 178, 7, 118, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 116, 2, 2, 180, 181, 7, 103, 2, 2, 181, 182, 7, 118, 2, 2, 182, 183, 7, 119, 2, 2, 183, 184, 7, 116, 2, 2, 184, 185, 7, 112, 2, 2, 185, 40, 3, 2, 2, 2, 186, 187, 7, 101, 2, 2, 187, 188, 7, 110, 2, 2, 188, 189, 7, 99, 2, 2, 189, 190, 7, 117, 2, 2, 190, 191, 7, 117, 2, 2, 191, 42, 3, 2, 2, 2, 192, 193, 7, 125, 2, 2, 193, 44, 3, 2, 2, 2, 194, 195, 7, 127, 2, 2, 195, 46, 3, 2, 2, 2, 196, 197, 7, 61, 2, 2, 197, 48, 3, 2, 2, 2, 198, 199, 7, 112, 2, 2, 199, 200, 7, 103, 2, 2, 200, 201, 7, 121, 2, 2, 201, 50, 3, 2, 2, 2, 202, 203, 7, 48, 2, 2, 203, 52, 3, 2, 2, 2, 204, 205, 7, 102, 2, 2, 205, 206, 7, 103, 2, 2, 206, 207, 7, 104, 2, 2, 207, 54, 3, 2, 2, 2, 208, 209, 7, 45, 2, 2, 209, 56, 3, 2, 2, 2, 210, 211, 7, 47, 2, 2, 211, 58, 3, 2, 2, 2, 212, 213, 7, 44, 2, 2, 213, 60, 3, 2, 2, 2, 214, 215, 7, 49, 2, 2, 215, 62, 3, 2, 2, 2, 216, 217, 7, 114, 2, 2, 217, 218, 7, 103, 2, 2, 218, 219, 7, 112, 2, 2, 219, 220, 7, 102, 2, 2, 220, 221, 7, 113, 2, 2, 221, 222, 7, 121, 2, 2, 222, 223, 7, 112, 2, 2, 223, 224, 7, 65, 2, 2, 224, 64, 3, 2, 2, 2, 225, 226, 7, 62, 2, 2, 226, 66, 3, 2, 2, 2, 227, 228, 7, 64, 2, 2, 228, 68, 3, 2, 2, 2, 229, 230, 7, 63, 2, 2, 230, 231, 7, 63, 2, 2, 231, 70, 3, 2, 2, 2, 232, 233, 7, 35, 2, 2, 233, 234, 7, 63, 2, 2, 234, 72, 3, 2, 2, 2, 235, 236, 7, 62, 2, 2, 236, 237, 7, 63, 2, 2, 237, 74, 3, 2, 2, 2, 238, 239, 7, 64, 2, 2, 239, 240, 7, 63, 2, 2, 240, 76, 3, 2, 2, 2, 241, 242, 7, 40, 2, 2, 242, 243, 7, 40, 2, 2, 243, 78, 3, 2, 2, 2, 244, 245, 7, 126, 2, 2, 245, 246, 7, 126, 2, 2, 246, 80, 3, 2, 2, 2, 247, 248, 7, 35, 2, 2, 248, 82, 3, 2, 2, 2, 249, 251, 9, 2, 2, 2, 250, 249, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 84, 3, 2, 2, 2, 254, 256, 9, 3, 2, 2, 255, 254, 3, 2, 2, 2, 255, 256, 3, 2, 2, 2, 256, 258, 3, 2, 2, 2, 257, 259, 9, 2, 2, 2, 258, 257, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 268, 3, 2, 2, 2, 262, 264, 7, 48, 2, 2, 263, 265, 9, 2, 2, 2, 264, 263, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 269, 3, 2, 2, 2, 268, 262, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 86, 3, 2, 2, 2, 270, 271, 7, 60, 2, 2, 271, 275, 9, 4, 2, 2, 272, 274, 9, 5, 2, 2, 273, 272, 3, 2, 2, 2, 274, 277, 3, 2, 2, 2, 275, 273, 3, 2, 2, 2, 275, 276, 3, 2, 2, 2, 276, 88, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 278, 280, 9, 6, 2, 2, 279, 278, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 90, 3, 2, 2, 2, 283, 285, 9, 7, 2, 2, 284, 283, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 288, 3, 2, 2, 2, 288, 289, 8, 46, 2, 2, 289, 92, 3, 2, 2, 2, 11, 2, 252, 255, 260, 266, 268, 275, 281, 286, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 47, 287, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 251, 10, 42, 13, 42, 14, 42, 252, 3, 43, 6, 43, 256, 10, 43, 13, 43, 14, 43, 257, 3, 43, 3, 43, 6, 43, 262, 10, 43, 13, 43, 14, 43, 263, 5, 43, 266, 10, 43, 3, 44, 3, 44, 3, 44, 7, 44, 271, 10, 44, 12, 44, 14, 44, 274, 11, 44, 3, 45, 6, 45, 277, 10, 45, 13, 45, 14, 45, 278, 3, 46, 6, 46, 282, 10, 46, 13, 46, 14, 46, 283, 3, 46, 3, 46, 2, 2, 47, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 293, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 3, 93, 3, 2, 2, 2, 5, 96, 3, 2, 2, 2, 7, 98, 3, 2, 2, 2, 9, 100, 3, 2, 2, 2, 11, 105, 3, 2, 2, 2, 13, 112, 3, 2, 2, 2, 15, 117, 3, 2, 2, 2, 17, 119, 3, 2, 2, 2, 19, 121, 3, 2, 2, 2, 21, 123, 3, 2, 2, 2, 23, 131, 3, 2, 2, 2, 25, 140, 3, 2, 2, 2, 27, 145, 3, 2, 2, 2, 29, 151, 3, 2, 2, 2, 31, 157, 3, 2, 2, 2, 33, 165, 3, 2, 2, 2, 35, 171, 3, 2, 2, 2, 37, 173, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 186, 3, 2, 2, 2, 43, 192, 3, 2, 2, 2, 45, 194, 3, 2, 2, 2, 47, 196, 3, 2, 2, 2, 49, 198, 3, 2, 2, 2, 51, 202, 3, 2, 2, 2, 53, 204, 3, 2, 2, 2, 55, 208, 3, 2, 2, 2, 57, 210, 3, 2, 2, 2, 59, 212, 3, 2, 2, 2, 61, 214, 3, 2, 2, 2, 63, 216, 3, 2, 2, 2, 65, 225, 3, 2, 2, 2, 67, 227, 3, 2, 2, 2, 69, 229, 3, 2, 2, 2, 71, 232, 3, 2, 2, 2, 73, 235, 3, 2, 2, 2, 75, 238, 3, 2, 2, 2, 77, 241, 3, 2, 2, 2, 79, 244, 3, 2, 2, 2, 81, 247, 3, 2, 2, 2, 83, 250, 3, 2, 2, 2, 85, 255, 3, 2, 2, 2, 87, 267, 3, 2, 2, 2, 89, 276, 3, 2, 2, 2, 91, 281, 3, 2, 2, 2, 93, 94, 7, 107, 2, 2, 94, 95, 7, 104, 2, 2, 95, 4, 3, 2, 2, 2, 96, 97, 7, 93, 2, 2, 97, 6, 3, 2, 2, 2, 98, 99, 7, 95, 2, 2, 99, 8, 3, 2, 2, 2, 100, 101, 7, 103, 2, 2, 101, 102, 7, 110, 2, 2, 102, 103, 7, 117, 2, 2, 103, 104, 7, 103, 2, 2, 104, 10, 3, 2, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 114, 2, 2, 108, 109, 7, 103, 2, 2, 109, 110, 7, 99, 2, 2, 110, 111, 7, 118, 2, 2, 111, 12, 3, 2, 2, 2, 112, 113, 7, 105, 2, 2, 113, 114, 7, 113, 2, 2, 114, 115, 7, 118, 2, 2, 115, 116, 7, 113, 2, 2, 116, 14, 3, 2, 2, 2, 117, 118, 7, 42, 2, 2, 118, 16, 3, 2, 2, 2, 119, 120, 7, 46, 2, 2, 120, 18, 3, 2, 2, 2, 121, 122, 7, 43, 2, 2, 122, 20, 3, 2, 2, 2, 123, 124, 7, 104, 2, 2, 124, 125, 7, 113, 2, 2, 125, 126, 7, 116, 2, 2, 126, 127, 7, 121, 2, 2, 127, 128, 7, 99, 2, 2, 128, 129, 7, 116, 2, 2, 129, 130, 7, 102, 2, 2, 130, 22, 3, 2, 2, 2, 131, 132, 7, 100, 2, 2, 132, 133, 7, 99, 2, 2, 133, 134, 7, 101, 2, 2, 134, 135, 7, 109, 2, 2, 135, 136, 7, 121, 2, 2, 136, 137, 7, 99, 2, 2, 137, 138, 7, 116, 2, 2, 138, 139, 7, 102, 2, 2, 139, 24, 3, 2, 2, 2, 140, 141, 7, 110, 2, 2, 141, 142, 7, 103, 2, 2, 142, 143, 7, 104, 2, 2, 143, 144, 7, 118, 2, 2, 144, 26, 3, 2, 2, 2, 145, 146, 7, 116, 2, 2, 146, 147, 7, 107, 2, 2, 147, 148, 7, 105, 2, 2, 148, 149, 7, 106, 2, 2, 149, 150, 7, 118, 2, 2, 150, 28, 3, 2, 2, 2, 151, 152, 7, 114, 2, 2, 152, 153, 7, 103, 2, 2, 153, 154, 7, 112, 2, 2, 154, 155, 7, 119, 2, 2, 155, 156, 7, 114, 2, 2, 156, 30, 3, 2, 2, 2, 157, 158, 7, 114, 2, 2, 158, 159, 7, 103, 2, 2, 159, 160, 7, 112, 2, 2, 160, 161, 7, 102, 2, 2, 161, 162, 7, 113, 2, 2, 162, 163, 7, 121, 2, 2, 163, 164, 7, 112, 2, 2, 164, 32, 3, 2, 2, 2, 165, 166, 7, 114, 2, 2, 166, 167, 7, 99, 2, 2, 167, 168, 7, 119, 2, 2, 168, 169, 7, 117, 2, 2, 169, 170, 7, 103, 2, 2, 170, 34, 3, 2, 2, 2, 171, 172, 7, 63, 2, 2, 172, 36, 3, 2, 2, 2, 173, 174, 7, 114, 2, 2, 174, 175, 7, 116, 2, 2, 175, 176, 7, 107, 2, 2, 176, 177, 7, 112, 2, 2, 177, 178, 7, 118, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 116, 2, 2, 180, 181, 7, 103, 2, 2, 181, 182, 7, 118, 2, 2, 182, 183, 7, 119, 2, 2, 183, 184, 7, 116, 2, 2, 184, 185, 7, 112, 2, 2, 185, 40, 3, 2, 2, 2, 186, 187, 7, 101, 2, 2, 187, 188, 7, 110, 2, 2, 188, 189, 7, 99, 2, 2, 189, 190, 7, 117, 2, 2, 190, 191, 7, 117, 2, 2, 191, 42, 3, 2, 2, 2, 192, 193, 7, 125, 2, 2, 193, 44, 3, 2, 2, 2, 194, 195, 7, 127, 2, 2, 195, 46, 3, 2, 2, 2, 196, 197, 7, 61, 2, 2, 197, 48, 3, 2, 2, 2, 198, 199, 7, 112, 2, 2, 199, 200, 7, 103, 2, 2, 200, 201, 7, 121, 2, 2, 201, 50, 3, 2, 2, 2, 202, 203, 7, 48, 2, 2, 203, 52, 3, 2, 2, 2, 204, 205, 7, 102, 2, 2, 205, 206, 7, 103, 2, 2, 206, 207, 7, 104, 2, 2, 207, 54, 3, 2, 2, 2, 208, 209, 7, 45, 2, 2, 209, 56, 3, 2, 2, 2, 210, 211, 7, 47, 2, 2, 211, 58, 3, 2, 2, 2, 212, 213, 7, 44, 2, 2, 213, 60, 3, 2, 2, 2, 214, 215, 7, 49, 2, 2, 215, 62, 3, 2, 2, 2, 216, 217, 7, 114, 2, 2, 217, 218, 7, 103, 2, 2, 218, 219, 7, 112, 2, 2, 219, 220, 7, 102, 2, 2, 220, 221, 7, 113, 2, 2, 221, 222, 7, 121, 2, 2, 222, 223, 7, 112, 2, 2, 223, 224, 7, 65, 2, 2, 224, 64, 3, 2, 2, 2, 225, 226, 7, 62, 2, 2, 226, 66, 3, 2, 2, 2, 227, 228, 7, 64, 2, 2, 228, 68, 3, 2, 2, 2, 229, 230, 7, 63, 2, 2, 230, 231, 7, 63, 2, 2, 231, 70, 3, 2, 2, 2, 232, 233, 7, 35, 2, 2, 233, 234, 7, 63, 2, 2, 234, 72, 3, 2, 2, 2, 235, 236, 7, 62, 2, 2, 236, 237, 7, 63, 2, 2, 237, 74, 3, 2, 2, 2, 238, 239, 7, 64, 2, 2, 239, 240, 7, 63, 2, 2, 240, 76, 3, 2, 2, 2, 241, 242, 7, 40, 2, 2, 242, 243, 7, 40, 2, 2, 243, 78, 3, 2, 2, 2, 244, 245, 7, 126, 2, 2, 245, 246, 7, 126, 2, 2, 246, 80, 3, 2, 2, 2, 247, 248, 7, 35, 2, 2, 248, 82, 3, 2, 2, 2, 249, 251, 9, 2, 2, 2, 250, 249, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 84, 3, 2, 2, 2, 254, 256, 9, 2, 2, 2, 255, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 265, 3, 2, 2, 2, 259, 261, 7, 48, 2, 2, 260, 262, 9, 2, 2, 2, 261, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 266, 3, 2, 2, 2, 265, 259, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 86, 3, 2, 2, 2, 267, 268, 7, 60, 2, 2, 268, 272, 9, 3, 2, 2, 269, 271, 9, 4, 2, 2, 270, 269, 3, 2, 2, 2, 271, 274, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 88, 3, 2, 2, 2, 274, 272, 3, 2, 2, 2, 275, 277, 9, 5, 2, 2, 276, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 276, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 90, 3, 2, 2, 2, 280, 282, 9, 6, 2, 2, 281, 280, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 286, 8, 46, 2, 2, 286, 92, 3, 2, 2, 2, 10, 2, 252, 257, 263, 265, 272, 278, 283, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index 184a70a..719f80c 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -9,7 +9,7 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2/") - buf.write("\u0122\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") + buf.write("\u011f\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") @@ -29,102 +29,100 @@ def serializedATN(): buf.write("\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3 \3 \3 \3 \3 \3 ") buf.write("\3 \3 \3 \3!\3!\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3&") buf.write("\3&\3&\3\'\3\'\3\'\3(\3(\3(\3)\3)\3*\6*\u00fb\n*\r*\16") - buf.write("*\u00fc\3+\5+\u0100\n+\3+\6+\u0103\n+\r+\16+\u0104\3+") - buf.write("\3+\6+\u0109\n+\r+\16+\u010a\5+\u010d\n+\3,\3,\3,\7,\u0112") - buf.write("\n,\f,\16,\u0115\13,\3-\6-\u0118\n-\r-\16-\u0119\3.\6") - buf.write(".\u011d\n.\r.\16.\u011e\3.\3.\2\2/\3\3\5\4\7\5\t\6\13") - buf.write("\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37") - buf.write("\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34") - buf.write("\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/\3\2\b") - buf.write("\3\2\62;\4\2--//\5\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5\2") - buf.write("\13\f\17\17\"\"\2\u0129\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3") - buf.write("\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2") - buf.write("\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2") - buf.write("\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2") - buf.write("!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2") - buf.write("\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3") - buf.write("\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2") - buf.write("\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2") - buf.write("\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2") - buf.write("\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3") - buf.write("\2\2\2\2[\3\2\2\2\3]\3\2\2\2\5`\3\2\2\2\7b\3\2\2\2\td") - buf.write("\3\2\2\2\13i\3\2\2\2\rp\3\2\2\2\17u\3\2\2\2\21w\3\2\2") - buf.write("\2\23y\3\2\2\2\25{\3\2\2\2\27\u0083\3\2\2\2\31\u008c\3") - buf.write("\2\2\2\33\u0091\3\2\2\2\35\u0097\3\2\2\2\37\u009d\3\2") - buf.write("\2\2!\u00a5\3\2\2\2#\u00ab\3\2\2\2%\u00ad\3\2\2\2\'\u00b3") - buf.write("\3\2\2\2)\u00ba\3\2\2\2+\u00c0\3\2\2\2-\u00c2\3\2\2\2") - buf.write("/\u00c4\3\2\2\2\61\u00c6\3\2\2\2\63\u00ca\3\2\2\2\65\u00cc") - buf.write("\3\2\2\2\67\u00d0\3\2\2\29\u00d2\3\2\2\2;\u00d4\3\2\2") - buf.write("\2=\u00d6\3\2\2\2?\u00d8\3\2\2\2A\u00e1\3\2\2\2C\u00e3") - buf.write("\3\2\2\2E\u00e5\3\2\2\2G\u00e8\3\2\2\2I\u00eb\3\2\2\2") - buf.write("K\u00ee\3\2\2\2M\u00f1\3\2\2\2O\u00f4\3\2\2\2Q\u00f7\3") - buf.write("\2\2\2S\u00fa\3\2\2\2U\u00ff\3\2\2\2W\u010e\3\2\2\2Y\u0117") - buf.write("\3\2\2\2[\u011c\3\2\2\2]^\7k\2\2^_\7h\2\2_\4\3\2\2\2`") - buf.write("a\7]\2\2a\6\3\2\2\2bc\7_\2\2c\b\3\2\2\2de\7g\2\2ef\7n") - buf.write("\2\2fg\7u\2\2gh\7g\2\2h\n\3\2\2\2ij\7t\2\2jk\7g\2\2kl") - buf.write("\7r\2\2lm\7g\2\2mn\7c\2\2no\7v\2\2o\f\3\2\2\2pq\7i\2\2") - buf.write("qr\7q\2\2rs\7v\2\2st\7q\2\2t\16\3\2\2\2uv\7*\2\2v\20\3") - buf.write("\2\2\2wx\7.\2\2x\22\3\2\2\2yz\7+\2\2z\24\3\2\2\2{|\7h") - buf.write("\2\2|}\7q\2\2}~\7t\2\2~\177\7y\2\2\177\u0080\7c\2\2\u0080") - buf.write("\u0081\7t\2\2\u0081\u0082\7f\2\2\u0082\26\3\2\2\2\u0083") - buf.write("\u0084\7d\2\2\u0084\u0085\7c\2\2\u0085\u0086\7e\2\2\u0086") - buf.write("\u0087\7m\2\2\u0087\u0088\7y\2\2\u0088\u0089\7c\2\2\u0089") - buf.write("\u008a\7t\2\2\u008a\u008b\7f\2\2\u008b\30\3\2\2\2\u008c") - buf.write("\u008d\7n\2\2\u008d\u008e\7g\2\2\u008e\u008f\7h\2\2\u008f") - buf.write("\u0090\7v\2\2\u0090\32\3\2\2\2\u0091\u0092\7t\2\2\u0092") - buf.write("\u0093\7k\2\2\u0093\u0094\7i\2\2\u0094\u0095\7j\2\2\u0095") - buf.write("\u0096\7v\2\2\u0096\34\3\2\2\2\u0097\u0098\7r\2\2\u0098") - buf.write("\u0099\7g\2\2\u0099\u009a\7p\2\2\u009a\u009b\7w\2\2\u009b") - buf.write("\u009c\7r\2\2\u009c\36\3\2\2\2\u009d\u009e\7r\2\2\u009e") - buf.write("\u009f\7g\2\2\u009f\u00a0\7p\2\2\u00a0\u00a1\7f\2\2\u00a1") - buf.write("\u00a2\7q\2\2\u00a2\u00a3\7y\2\2\u00a3\u00a4\7p\2\2\u00a4") - buf.write(" \3\2\2\2\u00a5\u00a6\7r\2\2\u00a6\u00a7\7c\2\2\u00a7") - buf.write("\u00a8\7w\2\2\u00a8\u00a9\7u\2\2\u00a9\u00aa\7g\2\2\u00aa") - buf.write("\"\3\2\2\2\u00ab\u00ac\7?\2\2\u00ac$\3\2\2\2\u00ad\u00ae") - buf.write("\7r\2\2\u00ae\u00af\7t\2\2\u00af\u00b0\7k\2\2\u00b0\u00b1") - buf.write("\7p\2\2\u00b1\u00b2\7v\2\2\u00b2&\3\2\2\2\u00b3\u00b4") - buf.write("\7t\2\2\u00b4\u00b5\7g\2\2\u00b5\u00b6\7v\2\2\u00b6\u00b7") - buf.write("\7w\2\2\u00b7\u00b8\7t\2\2\u00b8\u00b9\7p\2\2\u00b9(\3") - buf.write("\2\2\2\u00ba\u00bb\7e\2\2\u00bb\u00bc\7n\2\2\u00bc\u00bd") - buf.write("\7c\2\2\u00bd\u00be\7u\2\2\u00be\u00bf\7u\2\2\u00bf*\3") - buf.write("\2\2\2\u00c0\u00c1\7}\2\2\u00c1,\3\2\2\2\u00c2\u00c3\7") - buf.write("\177\2\2\u00c3.\3\2\2\2\u00c4\u00c5\7=\2\2\u00c5\60\3") - buf.write("\2\2\2\u00c6\u00c7\7p\2\2\u00c7\u00c8\7g\2\2\u00c8\u00c9") - buf.write("\7y\2\2\u00c9\62\3\2\2\2\u00ca\u00cb\7\60\2\2\u00cb\64") - buf.write("\3\2\2\2\u00cc\u00cd\7f\2\2\u00cd\u00ce\7g\2\2\u00ce\u00cf") - buf.write("\7h\2\2\u00cf\66\3\2\2\2\u00d0\u00d1\7-\2\2\u00d18\3\2") - buf.write("\2\2\u00d2\u00d3\7/\2\2\u00d3:\3\2\2\2\u00d4\u00d5\7,") - buf.write("\2\2\u00d5<\3\2\2\2\u00d6\u00d7\7\61\2\2\u00d7>\3\2\2") - buf.write("\2\u00d8\u00d9\7r\2\2\u00d9\u00da\7g\2\2\u00da\u00db\7") - buf.write("p\2\2\u00db\u00dc\7f\2\2\u00dc\u00dd\7q\2\2\u00dd\u00de") - buf.write("\7y\2\2\u00de\u00df\7p\2\2\u00df\u00e0\7A\2\2\u00e0@\3") - buf.write("\2\2\2\u00e1\u00e2\7>\2\2\u00e2B\3\2\2\2\u00e3\u00e4\7") - buf.write("@\2\2\u00e4D\3\2\2\2\u00e5\u00e6\7?\2\2\u00e6\u00e7\7") - buf.write("?\2\2\u00e7F\3\2\2\2\u00e8\u00e9\7#\2\2\u00e9\u00ea\7") - buf.write("?\2\2\u00eaH\3\2\2\2\u00eb\u00ec\7>\2\2\u00ec\u00ed\7") - buf.write("?\2\2\u00edJ\3\2\2\2\u00ee\u00ef\7@\2\2\u00ef\u00f0\7") - buf.write("?\2\2\u00f0L\3\2\2\2\u00f1\u00f2\7(\2\2\u00f2\u00f3\7") - buf.write("(\2\2\u00f3N\3\2\2\2\u00f4\u00f5\7~\2\2\u00f5\u00f6\7") - buf.write("~\2\2\u00f6P\3\2\2\2\u00f7\u00f8\7#\2\2\u00f8R\3\2\2\2") - buf.write("\u00f9\u00fb\t\2\2\2\u00fa\u00f9\3\2\2\2\u00fb\u00fc\3") - buf.write("\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fdT") - buf.write("\3\2\2\2\u00fe\u0100\t\3\2\2\u00ff\u00fe\3\2\2\2\u00ff") - buf.write("\u0100\3\2\2\2\u0100\u0102\3\2\2\2\u0101\u0103\t\2\2\2") - buf.write("\u0102\u0101\3\2\2\2\u0103\u0104\3\2\2\2\u0104\u0102\3") - buf.write("\2\2\2\u0104\u0105\3\2\2\2\u0105\u010c\3\2\2\2\u0106\u0108") - buf.write("\7\60\2\2\u0107\u0109\t\2\2\2\u0108\u0107\3\2\2\2\u0109") - buf.write("\u010a\3\2\2\2\u010a\u0108\3\2\2\2\u010a\u010b\3\2\2\2") - buf.write("\u010b\u010d\3\2\2\2\u010c\u0106\3\2\2\2\u010c\u010d\3") - buf.write("\2\2\2\u010dV\3\2\2\2\u010e\u010f\7<\2\2\u010f\u0113\t") - buf.write("\4\2\2\u0110\u0112\t\5\2\2\u0111\u0110\3\2\2\2\u0112\u0115") - buf.write("\3\2\2\2\u0113\u0111\3\2\2\2\u0113\u0114\3\2\2\2\u0114") - buf.write("X\3\2\2\2\u0115\u0113\3\2\2\2\u0116\u0118\t\6\2\2\u0117") - buf.write("\u0116\3\2\2\2\u0118\u0119\3\2\2\2\u0119\u0117\3\2\2\2") - buf.write("\u0119\u011a\3\2\2\2\u011aZ\3\2\2\2\u011b\u011d\t\7\2") - buf.write("\2\u011c\u011b\3\2\2\2\u011d\u011e\3\2\2\2\u011e\u011c") - buf.write("\3\2\2\2\u011e\u011f\3\2\2\2\u011f\u0120\3\2\2\2\u0120") - buf.write("\u0121\b.\2\2\u0121\\\3\2\2\2\13\2\u00fc\u00ff\u0104\u010a") - buf.write("\u010c\u0113\u0119\u011e\3\b\2\2") + buf.write("*\u00fc\3+\6+\u0100\n+\r+\16+\u0101\3+\3+\6+\u0106\n+") + buf.write("\r+\16+\u0107\5+\u010a\n+\3,\3,\3,\7,\u010f\n,\f,\16,") + buf.write("\u0112\13,\3-\6-\u0115\n-\r-\16-\u0116\3.\6.\u011a\n.") + buf.write("\r.\16.\u011b\3.\3.\2\2/\3\3\5\4\7\5\t\6\13\7\r\b\17\t") + buf.write("\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23") + buf.write("%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36") + buf.write(";\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/\3\2\7\3\2\62;\5") + buf.write("\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5\2\13\f\17\17\"\"\2\u0125") + buf.write("\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13") + buf.write("\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3") + buf.write("\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2") + buf.write("\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2") + buf.write("%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2") + buf.write("\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67") + buf.write("\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2") + buf.write("A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2") + buf.write("\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2") + buf.write("\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\3]\3\2") + buf.write("\2\2\5`\3\2\2\2\7b\3\2\2\2\td\3\2\2\2\13i\3\2\2\2\rp\3") + buf.write("\2\2\2\17u\3\2\2\2\21w\3\2\2\2\23y\3\2\2\2\25{\3\2\2\2") + buf.write("\27\u0083\3\2\2\2\31\u008c\3\2\2\2\33\u0091\3\2\2\2\35") + buf.write("\u0097\3\2\2\2\37\u009d\3\2\2\2!\u00a5\3\2\2\2#\u00ab") + buf.write("\3\2\2\2%\u00ad\3\2\2\2\'\u00b3\3\2\2\2)\u00ba\3\2\2\2") + buf.write("+\u00c0\3\2\2\2-\u00c2\3\2\2\2/\u00c4\3\2\2\2\61\u00c6") + buf.write("\3\2\2\2\63\u00ca\3\2\2\2\65\u00cc\3\2\2\2\67\u00d0\3") + buf.write("\2\2\29\u00d2\3\2\2\2;\u00d4\3\2\2\2=\u00d6\3\2\2\2?\u00d8") + buf.write("\3\2\2\2A\u00e1\3\2\2\2C\u00e3\3\2\2\2E\u00e5\3\2\2\2") + buf.write("G\u00e8\3\2\2\2I\u00eb\3\2\2\2K\u00ee\3\2\2\2M\u00f1\3") + buf.write("\2\2\2O\u00f4\3\2\2\2Q\u00f7\3\2\2\2S\u00fa\3\2\2\2U\u00ff") + buf.write("\3\2\2\2W\u010b\3\2\2\2Y\u0114\3\2\2\2[\u0119\3\2\2\2") + buf.write("]^\7k\2\2^_\7h\2\2_\4\3\2\2\2`a\7]\2\2a\6\3\2\2\2bc\7") + buf.write("_\2\2c\b\3\2\2\2de\7g\2\2ef\7n\2\2fg\7u\2\2gh\7g\2\2h") + buf.write("\n\3\2\2\2ij\7t\2\2jk\7g\2\2kl\7r\2\2lm\7g\2\2mn\7c\2") + buf.write("\2no\7v\2\2o\f\3\2\2\2pq\7i\2\2qr\7q\2\2rs\7v\2\2st\7") + buf.write("q\2\2t\16\3\2\2\2uv\7*\2\2v\20\3\2\2\2wx\7.\2\2x\22\3") + buf.write("\2\2\2yz\7+\2\2z\24\3\2\2\2{|\7h\2\2|}\7q\2\2}~\7t\2\2") + buf.write("~\177\7y\2\2\177\u0080\7c\2\2\u0080\u0081\7t\2\2\u0081") + buf.write("\u0082\7f\2\2\u0082\26\3\2\2\2\u0083\u0084\7d\2\2\u0084") + buf.write("\u0085\7c\2\2\u0085\u0086\7e\2\2\u0086\u0087\7m\2\2\u0087") + buf.write("\u0088\7y\2\2\u0088\u0089\7c\2\2\u0089\u008a\7t\2\2\u008a") + buf.write("\u008b\7f\2\2\u008b\30\3\2\2\2\u008c\u008d\7n\2\2\u008d") + buf.write("\u008e\7g\2\2\u008e\u008f\7h\2\2\u008f\u0090\7v\2\2\u0090") + buf.write("\32\3\2\2\2\u0091\u0092\7t\2\2\u0092\u0093\7k\2\2\u0093") + buf.write("\u0094\7i\2\2\u0094\u0095\7j\2\2\u0095\u0096\7v\2\2\u0096") + buf.write("\34\3\2\2\2\u0097\u0098\7r\2\2\u0098\u0099\7g\2\2\u0099") + buf.write("\u009a\7p\2\2\u009a\u009b\7w\2\2\u009b\u009c\7r\2\2\u009c") + buf.write("\36\3\2\2\2\u009d\u009e\7r\2\2\u009e\u009f\7g\2\2\u009f") + buf.write("\u00a0\7p\2\2\u00a0\u00a1\7f\2\2\u00a1\u00a2\7q\2\2\u00a2") + buf.write("\u00a3\7y\2\2\u00a3\u00a4\7p\2\2\u00a4 \3\2\2\2\u00a5") + buf.write("\u00a6\7r\2\2\u00a6\u00a7\7c\2\2\u00a7\u00a8\7w\2\2\u00a8") + buf.write("\u00a9\7u\2\2\u00a9\u00aa\7g\2\2\u00aa\"\3\2\2\2\u00ab") + buf.write("\u00ac\7?\2\2\u00ac$\3\2\2\2\u00ad\u00ae\7r\2\2\u00ae") + buf.write("\u00af\7t\2\2\u00af\u00b0\7k\2\2\u00b0\u00b1\7p\2\2\u00b1") + buf.write("\u00b2\7v\2\2\u00b2&\3\2\2\2\u00b3\u00b4\7t\2\2\u00b4") + buf.write("\u00b5\7g\2\2\u00b5\u00b6\7v\2\2\u00b6\u00b7\7w\2\2\u00b7") + buf.write("\u00b8\7t\2\2\u00b8\u00b9\7p\2\2\u00b9(\3\2\2\2\u00ba") + buf.write("\u00bb\7e\2\2\u00bb\u00bc\7n\2\2\u00bc\u00bd\7c\2\2\u00bd") + buf.write("\u00be\7u\2\2\u00be\u00bf\7u\2\2\u00bf*\3\2\2\2\u00c0") + buf.write("\u00c1\7}\2\2\u00c1,\3\2\2\2\u00c2\u00c3\7\177\2\2\u00c3") + buf.write(".\3\2\2\2\u00c4\u00c5\7=\2\2\u00c5\60\3\2\2\2\u00c6\u00c7") + buf.write("\7p\2\2\u00c7\u00c8\7g\2\2\u00c8\u00c9\7y\2\2\u00c9\62") + buf.write("\3\2\2\2\u00ca\u00cb\7\60\2\2\u00cb\64\3\2\2\2\u00cc\u00cd") + buf.write("\7f\2\2\u00cd\u00ce\7g\2\2\u00ce\u00cf\7h\2\2\u00cf\66") + buf.write("\3\2\2\2\u00d0\u00d1\7-\2\2\u00d18\3\2\2\2\u00d2\u00d3") + buf.write("\7/\2\2\u00d3:\3\2\2\2\u00d4\u00d5\7,\2\2\u00d5<\3\2\2") + buf.write("\2\u00d6\u00d7\7\61\2\2\u00d7>\3\2\2\2\u00d8\u00d9\7r") + buf.write("\2\2\u00d9\u00da\7g\2\2\u00da\u00db\7p\2\2\u00db\u00dc") + buf.write("\7f\2\2\u00dc\u00dd\7q\2\2\u00dd\u00de\7y\2\2\u00de\u00df") + buf.write("\7p\2\2\u00df\u00e0\7A\2\2\u00e0@\3\2\2\2\u00e1\u00e2") + buf.write("\7>\2\2\u00e2B\3\2\2\2\u00e3\u00e4\7@\2\2\u00e4D\3\2\2") + buf.write("\2\u00e5\u00e6\7?\2\2\u00e6\u00e7\7?\2\2\u00e7F\3\2\2") + buf.write("\2\u00e8\u00e9\7#\2\2\u00e9\u00ea\7?\2\2\u00eaH\3\2\2") + buf.write("\2\u00eb\u00ec\7>\2\2\u00ec\u00ed\7?\2\2\u00edJ\3\2\2") + buf.write("\2\u00ee\u00ef\7@\2\2\u00ef\u00f0\7?\2\2\u00f0L\3\2\2") + buf.write("\2\u00f1\u00f2\7(\2\2\u00f2\u00f3\7(\2\2\u00f3N\3\2\2") + buf.write("\2\u00f4\u00f5\7~\2\2\u00f5\u00f6\7~\2\2\u00f6P\3\2\2") + buf.write("\2\u00f7\u00f8\7#\2\2\u00f8R\3\2\2\2\u00f9\u00fb\t\2\2") + buf.write("\2\u00fa\u00f9\3\2\2\2\u00fb\u00fc\3\2\2\2\u00fc\u00fa") + buf.write("\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fdT\3\2\2\2\u00fe\u0100") + buf.write("\t\2\2\2\u00ff\u00fe\3\2\2\2\u0100\u0101\3\2\2\2\u0101") + buf.write("\u00ff\3\2\2\2\u0101\u0102\3\2\2\2\u0102\u0109\3\2\2\2") + buf.write("\u0103\u0105\7\60\2\2\u0104\u0106\t\2\2\2\u0105\u0104") + buf.write("\3\2\2\2\u0106\u0107\3\2\2\2\u0107\u0105\3\2\2\2\u0107") + buf.write("\u0108\3\2\2\2\u0108\u010a\3\2\2\2\u0109\u0103\3\2\2\2") + buf.write("\u0109\u010a\3\2\2\2\u010aV\3\2\2\2\u010b\u010c\7<\2\2") + buf.write("\u010c\u0110\t\3\2\2\u010d\u010f\t\4\2\2\u010e\u010d\3") + buf.write("\2\2\2\u010f\u0112\3\2\2\2\u0110\u010e\3\2\2\2\u0110\u0111") + buf.write("\3\2\2\2\u0111X\3\2\2\2\u0112\u0110\3\2\2\2\u0113\u0115") + buf.write("\t\5\2\2\u0114\u0113\3\2\2\2\u0115\u0116\3\2\2\2\u0116") + buf.write("\u0114\3\2\2\2\u0116\u0117\3\2\2\2\u0117Z\3\2\2\2\u0118") + buf.write("\u011a\t\6\2\2\u0119\u0118\3\2\2\2\u011a\u011b\3\2\2\2") + buf.write("\u011b\u0119\3\2\2\2\u011b\u011c\3\2\2\2\u011c\u011d\3") + buf.write("\2\2\2\u011d\u011e\b.\2\2\u011e\\\3\2\2\2\n\2\u00fc\u0101") + buf.write("\u0107\u0109\u0110\u0116\u011b\3\b\2\2") return buf.getvalue() From 06adbe4f2a8cbf3d49ca5ad14d13de5ba2ea5720 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Thu, 20 Feb 2025 21:44:26 +0530 Subject: [PATCH 09/47] function call with array assignment --- ChironCore/turtparse/tlang.g4 | 2 +- ChironCore/turtparse/tlang.interp | 2 +- ChironCore/turtparse/tlangParser.py | 391 +++++++++++++++------------- 3 files changed, 215 insertions(+), 180 deletions(-) diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index ded1292..6f45328 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -92,7 +92,7 @@ baseAccess : VAR ; // function call functionCall : NAME '(' arguments ')' ; -functionCallWithReturnValues : VAR ( ',' VAR )* '=' functionCall ; +functionCallWithReturnValues : ( VAR | objectOrArrayAccess) ( ',' ( VAR | objectOrArrayAccess) )* '=' functionCall ; // function declaration functionDeclaration : 'def' NAME '(' parameters ')' '{' strict_ilist '}' ; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index f96361e..49ec3a8 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -134,4 +134,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 336, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 79, 10, 3, 12, 3, 14, 3, 82, 11, 3, 3, 4, 6, 4, 85, 10, 4, 13, 4, 14, 4, 86, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 103, 10, 5, 3, 6, 3, 6, 5, 6, 107, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 151, 10, 15, 12, 15, 14, 15, 154, 11, 15, 5, 15, 156, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 162, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 182, 10, 21, 12, 21, 14, 21, 185, 11, 21, 5, 21, 187, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 200, 10, 22, 3, 22, 3, 22, 5, 22, 204, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 214, 10, 22, 12, 22, 14, 22, 217, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 226, 10, 24, 12, 24, 14, 24, 229, 11, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 5, 26, 236, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 251, 10, 27, 13, 27, 14, 27, 252, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 7, 30, 265, 10, 30, 12, 30, 14, 30, 268, 11, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 7, 32, 285, 10, 32, 12, 32, 14, 32, 288, 11, 32, 5, 32, 290, 10, 32, 3, 33, 3, 33, 3, 33, 7, 33, 295, 10, 33, 12, 33, 14, 33, 298, 11, 33, 5, 33, 300, 10, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 314, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 7, 34, 320, 10, 34, 12, 34, 14, 34, 323, 11, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 334, 10, 37, 3, 37, 2, 4, 42, 66, 38, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 343, 2, 74, 3, 2, 2, 2, 4, 80, 3, 2, 2, 2, 6, 84, 3, 2, 2, 2, 8, 102, 3, 2, 2, 2, 10, 106, 3, 2, 2, 2, 12, 108, 3, 2, 2, 2, 14, 114, 3, 2, 2, 2, 16, 124, 3, 2, 2, 2, 18, 130, 3, 2, 2, 2, 20, 137, 3, 2, 2, 2, 22, 140, 3, 2, 2, 2, 24, 142, 3, 2, 2, 2, 26, 144, 3, 2, 2, 2, 28, 146, 3, 2, 2, 2, 30, 161, 3, 2, 2, 2, 32, 166, 3, 2, 2, 2, 34, 171, 3, 2, 2, 2, 36, 173, 3, 2, 2, 2, 38, 175, 3, 2, 2, 2, 40, 177, 3, 2, 2, 2, 42, 203, 3, 2, 2, 2, 44, 218, 3, 2, 2, 2, 46, 227, 3, 2, 2, 2, 48, 230, 3, 2, 2, 2, 50, 235, 3, 2, 2, 2, 52, 243, 3, 2, 2, 2, 54, 254, 3, 2, 2, 2, 56, 256, 3, 2, 2, 2, 58, 261, 3, 2, 2, 2, 60, 272, 3, 2, 2, 2, 62, 289, 3, 2, 2, 2, 64, 299, 3, 2, 2, 2, 66, 313, 3, 2, 2, 2, 68, 324, 3, 2, 2, 2, 70, 326, 3, 2, 2, 2, 72, 333, 3, 2, 2, 2, 74, 75, 5, 4, 3, 2, 75, 76, 7, 2, 2, 3, 76, 3, 3, 2, 2, 2, 77, 79, 5, 8, 5, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 5, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 85, 5, 8, 5, 2, 84, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 7, 3, 2, 2, 2, 88, 103, 5, 30, 16, 2, 89, 103, 5, 32, 17, 2, 90, 103, 5, 10, 6, 2, 91, 103, 5, 16, 9, 2, 92, 103, 5, 20, 11, 2, 93, 103, 5, 24, 13, 2, 94, 103, 5, 18, 10, 2, 95, 103, 5, 26, 14, 2, 96, 103, 5, 44, 23, 2, 97, 103, 5, 50, 26, 2, 98, 103, 5, 60, 31, 2, 99, 103, 5, 56, 29, 2, 100, 103, 5, 58, 30, 2, 101, 103, 5, 40, 21, 2, 102, 88, 3, 2, 2, 2, 102, 89, 3, 2, 2, 2, 102, 90, 3, 2, 2, 2, 102, 91, 3, 2, 2, 2, 102, 92, 3, 2, 2, 2, 102, 93, 3, 2, 2, 2, 102, 94, 3, 2, 2, 2, 102, 95, 3, 2, 2, 2, 102, 96, 3, 2, 2, 2, 102, 97, 3, 2, 2, 2, 102, 98, 3, 2, 2, 2, 102, 99, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 102, 101, 3, 2, 2, 2, 103, 9, 3, 2, 2, 2, 104, 107, 5, 12, 7, 2, 105, 107, 5, 14, 8, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 11, 3, 2, 2, 2, 108, 109, 7, 3, 2, 2, 109, 110, 5, 66, 34, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 13, 3, 2, 2, 2, 114, 115, 7, 3, 2, 2, 115, 116, 5, 66, 34, 2, 116, 117, 7, 4, 2, 2, 117, 118, 5, 6, 4, 2, 118, 119, 7, 5, 2, 2, 119, 120, 7, 6, 2, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 15, 3, 2, 2, 2, 124, 125, 7, 7, 2, 2, 125, 126, 5, 72, 37, 2, 126, 127, 7, 4, 2, 2, 127, 128, 5, 6, 4, 2, 128, 129, 7, 5, 2, 2, 129, 17, 3, 2, 2, 2, 130, 131, 7, 8, 2, 2, 131, 132, 7, 9, 2, 2, 132, 133, 5, 42, 22, 2, 133, 134, 7, 10, 2, 2, 134, 135, 5, 42, 22, 2, 135, 136, 7, 11, 2, 2, 136, 19, 3, 2, 2, 2, 137, 138, 5, 22, 12, 2, 138, 139, 5, 42, 22, 2, 139, 21, 3, 2, 2, 2, 140, 141, 9, 2, 2, 2, 141, 23, 3, 2, 2, 2, 142, 143, 9, 3, 2, 2, 143, 25, 3, 2, 2, 2, 144, 145, 7, 18, 2, 2, 145, 27, 3, 2, 2, 2, 146, 155, 7, 4, 2, 2, 147, 152, 5, 42, 22, 2, 148, 149, 7, 10, 2, 2, 149, 151, 5, 42, 22, 2, 150, 148, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 156, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 147, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 158, 7, 5, 2, 2, 158, 29, 3, 2, 2, 2, 159, 162, 7, 45, 2, 2, 160, 162, 5, 52, 27, 2, 161, 159, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 164, 7, 19, 2, 2, 164, 165, 5, 42, 22, 2, 165, 31, 3, 2, 2, 2, 166, 167, 7, 20, 2, 2, 167, 168, 7, 9, 2, 2, 168, 169, 5, 42, 22, 2, 169, 170, 7, 11, 2, 2, 170, 33, 3, 2, 2, 2, 171, 172, 9, 4, 2, 2, 172, 35, 3, 2, 2, 2, 173, 174, 9, 5, 2, 2, 174, 37, 3, 2, 2, 2, 175, 176, 7, 30, 2, 2, 176, 39, 3, 2, 2, 2, 177, 186, 7, 21, 2, 2, 178, 183, 5, 42, 22, 2, 179, 180, 7, 10, 2, 2, 180, 182, 5, 42, 22, 2, 181, 179, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 178, 3, 2, 2, 2, 186, 187, 3, 2, 2, 2, 187, 41, 3, 2, 2, 2, 188, 189, 8, 22, 1, 2, 189, 190, 5, 38, 20, 2, 190, 191, 5, 42, 22, 8, 191, 204, 3, 2, 2, 2, 192, 193, 7, 9, 2, 2, 193, 194, 5, 42, 22, 2, 194, 195, 7, 11, 2, 2, 195, 204, 3, 2, 2, 2, 196, 204, 5, 72, 37, 2, 197, 200, 7, 45, 2, 2, 198, 200, 5, 52, 27, 2, 199, 197, 3, 2, 2, 2, 199, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 7, 19, 2, 2, 202, 204, 5, 42, 22, 3, 203, 188, 3, 2, 2, 2, 203, 192, 3, 2, 2, 2, 203, 196, 3, 2, 2, 2, 203, 199, 3, 2, 2, 2, 204, 215, 3, 2, 2, 2, 205, 206, 12, 7, 2, 2, 206, 207, 5, 34, 18, 2, 207, 208, 5, 42, 22, 8, 208, 214, 3, 2, 2, 2, 209, 210, 12, 6, 2, 2, 210, 211, 5, 36, 19, 2, 211, 212, 5, 42, 22, 7, 212, 214, 3, 2, 2, 2, 213, 205, 3, 2, 2, 2, 213, 209, 3, 2, 2, 2, 214, 217, 3, 2, 2, 2, 215, 213, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 43, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 218, 219, 7, 22, 2, 2, 219, 220, 7, 45, 2, 2, 220, 221, 7, 23, 2, 2, 221, 222, 5, 46, 24, 2, 222, 223, 7, 24, 2, 2, 223, 45, 3, 2, 2, 2, 224, 226, 5, 48, 25, 2, 225, 224, 3, 2, 2, 2, 226, 229, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 47, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 230, 231, 5, 30, 16, 2, 231, 232, 7, 25, 2, 2, 232, 49, 3, 2, 2, 2, 233, 236, 7, 45, 2, 2, 234, 236, 5, 52, 27, 2, 235, 233, 3, 2, 2, 2, 235, 234, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 238, 7, 19, 2, 2, 238, 239, 7, 26, 2, 2, 239, 240, 7, 45, 2, 2, 240, 241, 7, 9, 2, 2, 241, 242, 7, 11, 2, 2, 242, 51, 3, 2, 2, 2, 243, 250, 5, 54, 28, 2, 244, 245, 7, 27, 2, 2, 245, 251, 7, 45, 2, 2, 246, 247, 7, 4, 2, 2, 247, 248, 5, 42, 22, 2, 248, 249, 7, 5, 2, 2, 249, 251, 3, 2, 2, 2, 250, 244, 3, 2, 2, 2, 250, 246, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 53, 3, 2, 2, 2, 254, 255, 7, 45, 2, 2, 255, 55, 3, 2, 2, 2, 256, 257, 7, 46, 2, 2, 257, 258, 7, 9, 2, 2, 258, 259, 5, 64, 33, 2, 259, 260, 7, 11, 2, 2, 260, 57, 3, 2, 2, 2, 261, 266, 7, 45, 2, 2, 262, 263, 7, 10, 2, 2, 263, 265, 7, 45, 2, 2, 264, 262, 3, 2, 2, 2, 265, 268, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 269, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 269, 270, 7, 19, 2, 2, 270, 271, 5, 56, 29, 2, 271, 59, 3, 2, 2, 2, 272, 273, 7, 28, 2, 2, 273, 274, 7, 46, 2, 2, 274, 275, 7, 9, 2, 2, 275, 276, 5, 62, 32, 2, 276, 277, 7, 11, 2, 2, 277, 278, 7, 23, 2, 2, 278, 279, 5, 6, 4, 2, 279, 280, 7, 24, 2, 2, 280, 61, 3, 2, 2, 2, 281, 286, 7, 45, 2, 2, 282, 283, 7, 10, 2, 2, 283, 285, 7, 45, 2, 2, 284, 282, 3, 2, 2, 2, 285, 288, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 290, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 289, 281, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 63, 3, 2, 2, 2, 291, 296, 5, 42, 22, 2, 292, 293, 7, 10, 2, 2, 293, 295, 5, 42, 22, 2, 294, 292, 3, 2, 2, 2, 295, 298, 3, 2, 2, 2, 296, 294, 3, 2, 2, 2, 296, 297, 3, 2, 2, 2, 297, 300, 3, 2, 2, 2, 298, 296, 3, 2, 2, 2, 299, 291, 3, 2, 2, 2, 299, 300, 3, 2, 2, 2, 300, 65, 3, 2, 2, 2, 301, 302, 8, 34, 1, 2, 302, 303, 7, 42, 2, 2, 303, 314, 5, 66, 34, 7, 304, 305, 5, 42, 22, 2, 305, 306, 5, 68, 35, 2, 306, 307, 5, 42, 22, 2, 307, 314, 3, 2, 2, 2, 308, 314, 7, 33, 2, 2, 309, 310, 7, 9, 2, 2, 310, 311, 5, 66, 34, 2, 311, 312, 7, 11, 2, 2, 312, 314, 3, 2, 2, 2, 313, 301, 3, 2, 2, 2, 313, 304, 3, 2, 2, 2, 313, 308, 3, 2, 2, 2, 313, 309, 3, 2, 2, 2, 314, 321, 3, 2, 2, 2, 315, 316, 12, 5, 2, 2, 316, 317, 5, 70, 36, 2, 317, 318, 5, 66, 34, 6, 318, 320, 3, 2, 2, 2, 319, 315, 3, 2, 2, 2, 320, 323, 3, 2, 2, 2, 321, 319, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 67, 3, 2, 2, 2, 323, 321, 3, 2, 2, 2, 324, 325, 9, 6, 2, 2, 325, 69, 3, 2, 2, 2, 326, 327, 9, 7, 2, 2, 327, 71, 3, 2, 2, 2, 328, 334, 7, 43, 2, 2, 329, 334, 7, 45, 2, 2, 330, 334, 5, 28, 15, 2, 331, 334, 5, 52, 27, 2, 332, 334, 7, 44, 2, 2, 333, 328, 3, 2, 2, 2, 333, 329, 3, 2, 2, 2, 333, 330, 3, 2, 2, 2, 333, 331, 3, 2, 2, 2, 333, 332, 3, 2, 2, 2, 334, 73, 3, 2, 2, 2, 27, 80, 86, 102, 106, 152, 155, 161, 183, 186, 199, 203, 213, 215, 227, 235, 250, 252, 266, 286, 289, 296, 299, 313, 321, 333] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 342, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 79, 10, 3, 12, 3, 14, 3, 82, 11, 3, 3, 4, 6, 4, 85, 10, 4, 13, 4, 14, 4, 86, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 103, 10, 5, 3, 6, 3, 6, 5, 6, 107, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 151, 10, 15, 12, 15, 14, 15, 154, 11, 15, 5, 15, 156, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 162, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 182, 10, 21, 12, 21, 14, 21, 185, 11, 21, 5, 21, 187, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 200, 10, 22, 3, 22, 3, 22, 5, 22, 204, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 214, 10, 22, 12, 22, 14, 22, 217, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 226, 10, 24, 12, 24, 14, 24, 229, 11, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 5, 26, 236, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 251, 10, 27, 13, 27, 14, 27, 252, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 264, 10, 30, 3, 30, 3, 30, 3, 30, 5, 30, 269, 10, 30, 7, 30, 271, 10, 30, 12, 30, 14, 30, 274, 11, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 7, 32, 291, 10, 32, 12, 32, 14, 32, 294, 11, 32, 5, 32, 296, 10, 32, 3, 33, 3, 33, 3, 33, 7, 33, 301, 10, 33, 12, 33, 14, 33, 304, 11, 33, 5, 33, 306, 10, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 320, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 7, 34, 326, 10, 34, 12, 34, 14, 34, 329, 11, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 340, 10, 37, 3, 37, 2, 4, 42, 66, 38, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 351, 2, 74, 3, 2, 2, 2, 4, 80, 3, 2, 2, 2, 6, 84, 3, 2, 2, 2, 8, 102, 3, 2, 2, 2, 10, 106, 3, 2, 2, 2, 12, 108, 3, 2, 2, 2, 14, 114, 3, 2, 2, 2, 16, 124, 3, 2, 2, 2, 18, 130, 3, 2, 2, 2, 20, 137, 3, 2, 2, 2, 22, 140, 3, 2, 2, 2, 24, 142, 3, 2, 2, 2, 26, 144, 3, 2, 2, 2, 28, 146, 3, 2, 2, 2, 30, 161, 3, 2, 2, 2, 32, 166, 3, 2, 2, 2, 34, 171, 3, 2, 2, 2, 36, 173, 3, 2, 2, 2, 38, 175, 3, 2, 2, 2, 40, 177, 3, 2, 2, 2, 42, 203, 3, 2, 2, 2, 44, 218, 3, 2, 2, 2, 46, 227, 3, 2, 2, 2, 48, 230, 3, 2, 2, 2, 50, 235, 3, 2, 2, 2, 52, 243, 3, 2, 2, 2, 54, 254, 3, 2, 2, 2, 56, 256, 3, 2, 2, 2, 58, 263, 3, 2, 2, 2, 60, 278, 3, 2, 2, 2, 62, 295, 3, 2, 2, 2, 64, 305, 3, 2, 2, 2, 66, 319, 3, 2, 2, 2, 68, 330, 3, 2, 2, 2, 70, 332, 3, 2, 2, 2, 72, 339, 3, 2, 2, 2, 74, 75, 5, 4, 3, 2, 75, 76, 7, 2, 2, 3, 76, 3, 3, 2, 2, 2, 77, 79, 5, 8, 5, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 5, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 85, 5, 8, 5, 2, 84, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 7, 3, 2, 2, 2, 88, 103, 5, 30, 16, 2, 89, 103, 5, 32, 17, 2, 90, 103, 5, 10, 6, 2, 91, 103, 5, 16, 9, 2, 92, 103, 5, 20, 11, 2, 93, 103, 5, 24, 13, 2, 94, 103, 5, 18, 10, 2, 95, 103, 5, 26, 14, 2, 96, 103, 5, 44, 23, 2, 97, 103, 5, 50, 26, 2, 98, 103, 5, 60, 31, 2, 99, 103, 5, 56, 29, 2, 100, 103, 5, 58, 30, 2, 101, 103, 5, 40, 21, 2, 102, 88, 3, 2, 2, 2, 102, 89, 3, 2, 2, 2, 102, 90, 3, 2, 2, 2, 102, 91, 3, 2, 2, 2, 102, 92, 3, 2, 2, 2, 102, 93, 3, 2, 2, 2, 102, 94, 3, 2, 2, 2, 102, 95, 3, 2, 2, 2, 102, 96, 3, 2, 2, 2, 102, 97, 3, 2, 2, 2, 102, 98, 3, 2, 2, 2, 102, 99, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 102, 101, 3, 2, 2, 2, 103, 9, 3, 2, 2, 2, 104, 107, 5, 12, 7, 2, 105, 107, 5, 14, 8, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 11, 3, 2, 2, 2, 108, 109, 7, 3, 2, 2, 109, 110, 5, 66, 34, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 13, 3, 2, 2, 2, 114, 115, 7, 3, 2, 2, 115, 116, 5, 66, 34, 2, 116, 117, 7, 4, 2, 2, 117, 118, 5, 6, 4, 2, 118, 119, 7, 5, 2, 2, 119, 120, 7, 6, 2, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 15, 3, 2, 2, 2, 124, 125, 7, 7, 2, 2, 125, 126, 5, 72, 37, 2, 126, 127, 7, 4, 2, 2, 127, 128, 5, 6, 4, 2, 128, 129, 7, 5, 2, 2, 129, 17, 3, 2, 2, 2, 130, 131, 7, 8, 2, 2, 131, 132, 7, 9, 2, 2, 132, 133, 5, 42, 22, 2, 133, 134, 7, 10, 2, 2, 134, 135, 5, 42, 22, 2, 135, 136, 7, 11, 2, 2, 136, 19, 3, 2, 2, 2, 137, 138, 5, 22, 12, 2, 138, 139, 5, 42, 22, 2, 139, 21, 3, 2, 2, 2, 140, 141, 9, 2, 2, 2, 141, 23, 3, 2, 2, 2, 142, 143, 9, 3, 2, 2, 143, 25, 3, 2, 2, 2, 144, 145, 7, 18, 2, 2, 145, 27, 3, 2, 2, 2, 146, 155, 7, 4, 2, 2, 147, 152, 5, 42, 22, 2, 148, 149, 7, 10, 2, 2, 149, 151, 5, 42, 22, 2, 150, 148, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 156, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 147, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 158, 7, 5, 2, 2, 158, 29, 3, 2, 2, 2, 159, 162, 7, 45, 2, 2, 160, 162, 5, 52, 27, 2, 161, 159, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 164, 7, 19, 2, 2, 164, 165, 5, 42, 22, 2, 165, 31, 3, 2, 2, 2, 166, 167, 7, 20, 2, 2, 167, 168, 7, 9, 2, 2, 168, 169, 5, 42, 22, 2, 169, 170, 7, 11, 2, 2, 170, 33, 3, 2, 2, 2, 171, 172, 9, 4, 2, 2, 172, 35, 3, 2, 2, 2, 173, 174, 9, 5, 2, 2, 174, 37, 3, 2, 2, 2, 175, 176, 7, 30, 2, 2, 176, 39, 3, 2, 2, 2, 177, 186, 7, 21, 2, 2, 178, 183, 5, 42, 22, 2, 179, 180, 7, 10, 2, 2, 180, 182, 5, 42, 22, 2, 181, 179, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 178, 3, 2, 2, 2, 186, 187, 3, 2, 2, 2, 187, 41, 3, 2, 2, 2, 188, 189, 8, 22, 1, 2, 189, 190, 5, 38, 20, 2, 190, 191, 5, 42, 22, 8, 191, 204, 3, 2, 2, 2, 192, 193, 7, 9, 2, 2, 193, 194, 5, 42, 22, 2, 194, 195, 7, 11, 2, 2, 195, 204, 3, 2, 2, 2, 196, 204, 5, 72, 37, 2, 197, 200, 7, 45, 2, 2, 198, 200, 5, 52, 27, 2, 199, 197, 3, 2, 2, 2, 199, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 7, 19, 2, 2, 202, 204, 5, 42, 22, 3, 203, 188, 3, 2, 2, 2, 203, 192, 3, 2, 2, 2, 203, 196, 3, 2, 2, 2, 203, 199, 3, 2, 2, 2, 204, 215, 3, 2, 2, 2, 205, 206, 12, 7, 2, 2, 206, 207, 5, 34, 18, 2, 207, 208, 5, 42, 22, 8, 208, 214, 3, 2, 2, 2, 209, 210, 12, 6, 2, 2, 210, 211, 5, 36, 19, 2, 211, 212, 5, 42, 22, 7, 212, 214, 3, 2, 2, 2, 213, 205, 3, 2, 2, 2, 213, 209, 3, 2, 2, 2, 214, 217, 3, 2, 2, 2, 215, 213, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 43, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 218, 219, 7, 22, 2, 2, 219, 220, 7, 45, 2, 2, 220, 221, 7, 23, 2, 2, 221, 222, 5, 46, 24, 2, 222, 223, 7, 24, 2, 2, 223, 45, 3, 2, 2, 2, 224, 226, 5, 48, 25, 2, 225, 224, 3, 2, 2, 2, 226, 229, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 47, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 230, 231, 5, 30, 16, 2, 231, 232, 7, 25, 2, 2, 232, 49, 3, 2, 2, 2, 233, 236, 7, 45, 2, 2, 234, 236, 5, 52, 27, 2, 235, 233, 3, 2, 2, 2, 235, 234, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 238, 7, 19, 2, 2, 238, 239, 7, 26, 2, 2, 239, 240, 7, 45, 2, 2, 240, 241, 7, 9, 2, 2, 241, 242, 7, 11, 2, 2, 242, 51, 3, 2, 2, 2, 243, 250, 5, 54, 28, 2, 244, 245, 7, 27, 2, 2, 245, 251, 7, 45, 2, 2, 246, 247, 7, 4, 2, 2, 247, 248, 5, 42, 22, 2, 248, 249, 7, 5, 2, 2, 249, 251, 3, 2, 2, 2, 250, 244, 3, 2, 2, 2, 250, 246, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 53, 3, 2, 2, 2, 254, 255, 7, 45, 2, 2, 255, 55, 3, 2, 2, 2, 256, 257, 7, 46, 2, 2, 257, 258, 7, 9, 2, 2, 258, 259, 5, 64, 33, 2, 259, 260, 7, 11, 2, 2, 260, 57, 3, 2, 2, 2, 261, 264, 7, 45, 2, 2, 262, 264, 5, 52, 27, 2, 263, 261, 3, 2, 2, 2, 263, 262, 3, 2, 2, 2, 264, 272, 3, 2, 2, 2, 265, 268, 7, 10, 2, 2, 266, 269, 7, 45, 2, 2, 267, 269, 5, 52, 27, 2, 268, 266, 3, 2, 2, 2, 268, 267, 3, 2, 2, 2, 269, 271, 3, 2, 2, 2, 270, 265, 3, 2, 2, 2, 271, 274, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 275, 3, 2, 2, 2, 274, 272, 3, 2, 2, 2, 275, 276, 7, 19, 2, 2, 276, 277, 5, 56, 29, 2, 277, 59, 3, 2, 2, 2, 278, 279, 7, 28, 2, 2, 279, 280, 7, 46, 2, 2, 280, 281, 7, 9, 2, 2, 281, 282, 5, 62, 32, 2, 282, 283, 7, 11, 2, 2, 283, 284, 7, 23, 2, 2, 284, 285, 5, 6, 4, 2, 285, 286, 7, 24, 2, 2, 286, 61, 3, 2, 2, 2, 287, 292, 7, 45, 2, 2, 288, 289, 7, 10, 2, 2, 289, 291, 7, 45, 2, 2, 290, 288, 3, 2, 2, 2, 291, 294, 3, 2, 2, 2, 292, 290, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 296, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 295, 287, 3, 2, 2, 2, 295, 296, 3, 2, 2, 2, 296, 63, 3, 2, 2, 2, 297, 302, 5, 42, 22, 2, 298, 299, 7, 10, 2, 2, 299, 301, 5, 42, 22, 2, 300, 298, 3, 2, 2, 2, 301, 304, 3, 2, 2, 2, 302, 300, 3, 2, 2, 2, 302, 303, 3, 2, 2, 2, 303, 306, 3, 2, 2, 2, 304, 302, 3, 2, 2, 2, 305, 297, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 65, 3, 2, 2, 2, 307, 308, 8, 34, 1, 2, 308, 309, 7, 42, 2, 2, 309, 320, 5, 66, 34, 7, 310, 311, 5, 42, 22, 2, 311, 312, 5, 68, 35, 2, 312, 313, 5, 42, 22, 2, 313, 320, 3, 2, 2, 2, 314, 320, 7, 33, 2, 2, 315, 316, 7, 9, 2, 2, 316, 317, 5, 66, 34, 2, 317, 318, 7, 11, 2, 2, 318, 320, 3, 2, 2, 2, 319, 307, 3, 2, 2, 2, 319, 310, 3, 2, 2, 2, 319, 314, 3, 2, 2, 2, 319, 315, 3, 2, 2, 2, 320, 327, 3, 2, 2, 2, 321, 322, 12, 5, 2, 2, 322, 323, 5, 70, 36, 2, 323, 324, 5, 66, 34, 6, 324, 326, 3, 2, 2, 2, 325, 321, 3, 2, 2, 2, 326, 329, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 327, 328, 3, 2, 2, 2, 328, 67, 3, 2, 2, 2, 329, 327, 3, 2, 2, 2, 330, 331, 9, 6, 2, 2, 331, 69, 3, 2, 2, 2, 332, 333, 9, 7, 2, 2, 333, 71, 3, 2, 2, 2, 334, 340, 7, 43, 2, 2, 335, 340, 7, 45, 2, 2, 336, 340, 5, 28, 15, 2, 337, 340, 5, 52, 27, 2, 338, 340, 7, 44, 2, 2, 339, 334, 3, 2, 2, 2, 339, 335, 3, 2, 2, 2, 339, 336, 3, 2, 2, 2, 339, 337, 3, 2, 2, 2, 339, 338, 3, 2, 2, 2, 340, 73, 3, 2, 2, 2, 29, 80, 86, 102, 106, 152, 155, 161, 183, 186, 199, 203, 213, 215, 227, 235, 250, 252, 263, 268, 272, 292, 295, 302, 305, 319, 327, 339] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index 2049f52..e2bc1de 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -9,7 +9,7 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3/") - buf.write("\u0150\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\u0156\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") @@ -33,126 +33,130 @@ def serializedATN(): buf.write("\31\3\31\3\32\3\32\5\32\u00ec\n\32\3\32\3\32\3\32\3\32") buf.write("\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\6\33\u00fb") buf.write("\n\33\r\33\16\33\u00fc\3\34\3\34\3\35\3\35\3\35\3\35\3") - buf.write("\35\3\36\3\36\3\36\7\36\u0109\n\36\f\36\16\36\u010c\13") - buf.write("\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37") - buf.write("\3\37\3\37\3 \3 \3 \7 \u011d\n \f \16 \u0120\13 \5 \u0122") - buf.write("\n \3!\3!\3!\7!\u0127\n!\f!\16!\u012a\13!\5!\u012c\n!") - buf.write("\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\5\"\u013a") - buf.write("\n\"\3\"\3\"\3\"\3\"\7\"\u0140\n\"\f\"\16\"\u0143\13\"") - buf.write("\3#\3#\3$\3$\3%\3%\3%\3%\3%\5%\u014e\n%\3%\2\4*B&\2\4") - buf.write("\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64") - buf.write("\668:<>@BDFH\2\b\3\2\f\17\3\2\20\21\3\2\37 \3\2\35\36") - buf.write("\3\2\"\'\3\2()\2\u0157\2J\3\2\2\2\4P\3\2\2\2\6T\3\2\2") - buf.write("\2\bf\3\2\2\2\nj\3\2\2\2\fl\3\2\2\2\16r\3\2\2\2\20|\3") - buf.write("\2\2\2\22\u0082\3\2\2\2\24\u0089\3\2\2\2\26\u008c\3\2") - buf.write("\2\2\30\u008e\3\2\2\2\32\u0090\3\2\2\2\34\u0092\3\2\2") - buf.write("\2\36\u00a1\3\2\2\2 \u00a6\3\2\2\2\"\u00ab\3\2\2\2$\u00ad") - buf.write("\3\2\2\2&\u00af\3\2\2\2(\u00b1\3\2\2\2*\u00cb\3\2\2\2") - buf.write(",\u00da\3\2\2\2.\u00e3\3\2\2\2\60\u00e6\3\2\2\2\62\u00eb") - buf.write("\3\2\2\2\64\u00f3\3\2\2\2\66\u00fe\3\2\2\28\u0100\3\2") - buf.write("\2\2:\u0105\3\2\2\2<\u0110\3\2\2\2>\u0121\3\2\2\2@\u012b") - buf.write("\3\2\2\2B\u0139\3\2\2\2D\u0144\3\2\2\2F\u0146\3\2\2\2") - buf.write("H\u014d\3\2\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2MO\5\b\5") - buf.write("\2NM\3\2\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2Q\5\3\2\2\2") - buf.write("RP\3\2\2\2SU\5\b\5\2TS\3\2\2\2UV\3\2\2\2VT\3\2\2\2VW\3") - buf.write("\2\2\2W\7\3\2\2\2Xg\5\36\20\2Yg\5 \21\2Zg\5\n\6\2[g\5") - buf.write("\20\t\2\\g\5\24\13\2]g\5\30\r\2^g\5\22\n\2_g\5\32\16\2") - buf.write("`g\5,\27\2ag\5\62\32\2bg\5<\37\2cg\58\35\2dg\5:\36\2e") - buf.write("g\5(\25\2fX\3\2\2\2fY\3\2\2\2fZ\3\2\2\2f[\3\2\2\2f\\\3") - buf.write("\2\2\2f]\3\2\2\2f^\3\2\2\2f_\3\2\2\2f`\3\2\2\2fa\3\2\2") - buf.write("\2fb\3\2\2\2fc\3\2\2\2fd\3\2\2\2fe\3\2\2\2g\t\3\2\2\2") - buf.write("hk\5\f\7\2ik\5\16\b\2jh\3\2\2\2ji\3\2\2\2k\13\3\2\2\2") - buf.write("lm\7\3\2\2mn\5B\"\2no\7\4\2\2op\5\6\4\2pq\7\5\2\2q\r\3") - buf.write("\2\2\2rs\7\3\2\2st\5B\"\2tu\7\4\2\2uv\5\6\4\2vw\7\5\2") - buf.write("\2wx\7\6\2\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2{\17\3\2\2\2") - buf.write("|}\7\7\2\2}~\5H%\2~\177\7\4\2\2\177\u0080\5\6\4\2\u0080") - buf.write("\u0081\7\5\2\2\u0081\21\3\2\2\2\u0082\u0083\7\b\2\2\u0083") - buf.write("\u0084\7\t\2\2\u0084\u0085\5*\26\2\u0085\u0086\7\n\2\2") - buf.write("\u0086\u0087\5*\26\2\u0087\u0088\7\13\2\2\u0088\23\3\2") - buf.write("\2\2\u0089\u008a\5\26\f\2\u008a\u008b\5*\26\2\u008b\25") - buf.write("\3\2\2\2\u008c\u008d\t\2\2\2\u008d\27\3\2\2\2\u008e\u008f") - buf.write("\t\3\2\2\u008f\31\3\2\2\2\u0090\u0091\7\22\2\2\u0091\33") - buf.write("\3\2\2\2\u0092\u009b\7\4\2\2\u0093\u0098\5*\26\2\u0094") - buf.write("\u0095\7\n\2\2\u0095\u0097\5*\26\2\u0096\u0094\3\2\2\2") - buf.write("\u0097\u009a\3\2\2\2\u0098\u0096\3\2\2\2\u0098\u0099\3") - buf.write("\2\2\2\u0099\u009c\3\2\2\2\u009a\u0098\3\2\2\2\u009b\u0093") - buf.write("\3\2\2\2\u009b\u009c\3\2\2\2\u009c\u009d\3\2\2\2\u009d") - buf.write("\u009e\7\5\2\2\u009e\35\3\2\2\2\u009f\u00a2\7-\2\2\u00a0") - buf.write("\u00a2\5\64\33\2\u00a1\u009f\3\2\2\2\u00a1\u00a0\3\2\2") - buf.write("\2\u00a2\u00a3\3\2\2\2\u00a3\u00a4\7\23\2\2\u00a4\u00a5") - buf.write("\5*\26\2\u00a5\37\3\2\2\2\u00a6\u00a7\7\24\2\2\u00a7\u00a8") - buf.write("\7\t\2\2\u00a8\u00a9\5*\26\2\u00a9\u00aa\7\13\2\2\u00aa") - buf.write("!\3\2\2\2\u00ab\u00ac\t\4\2\2\u00ac#\3\2\2\2\u00ad\u00ae") - buf.write("\t\5\2\2\u00ae%\3\2\2\2\u00af\u00b0\7\36\2\2\u00b0\'\3") - buf.write("\2\2\2\u00b1\u00ba\7\25\2\2\u00b2\u00b7\5*\26\2\u00b3") - buf.write("\u00b4\7\n\2\2\u00b4\u00b6\5*\26\2\u00b5\u00b3\3\2\2\2") - buf.write("\u00b6\u00b9\3\2\2\2\u00b7\u00b5\3\2\2\2\u00b7\u00b8\3") - buf.write("\2\2\2\u00b8\u00bb\3\2\2\2\u00b9\u00b7\3\2\2\2\u00ba\u00b2") - buf.write("\3\2\2\2\u00ba\u00bb\3\2\2\2\u00bb)\3\2\2\2\u00bc\u00bd") - buf.write("\b\26\1\2\u00bd\u00be\5&\24\2\u00be\u00bf\5*\26\b\u00bf") - buf.write("\u00cc\3\2\2\2\u00c0\u00c1\7\t\2\2\u00c1\u00c2\5*\26\2") - buf.write("\u00c2\u00c3\7\13\2\2\u00c3\u00cc\3\2\2\2\u00c4\u00cc") - buf.write("\5H%\2\u00c5\u00c8\7-\2\2\u00c6\u00c8\5\64\33\2\u00c7") - buf.write("\u00c5\3\2\2\2\u00c7\u00c6\3\2\2\2\u00c8\u00c9\3\2\2\2") - buf.write("\u00c9\u00ca\7\23\2\2\u00ca\u00cc\5*\26\3\u00cb\u00bc") - buf.write("\3\2\2\2\u00cb\u00c0\3\2\2\2\u00cb\u00c4\3\2\2\2\u00cb") - buf.write("\u00c7\3\2\2\2\u00cc\u00d7\3\2\2\2\u00cd\u00ce\f\7\2\2") - buf.write("\u00ce\u00cf\5\"\22\2\u00cf\u00d0\5*\26\b\u00d0\u00d6") - buf.write("\3\2\2\2\u00d1\u00d2\f\6\2\2\u00d2\u00d3\5$\23\2\u00d3") - buf.write("\u00d4\5*\26\7\u00d4\u00d6\3\2\2\2\u00d5\u00cd\3\2\2\2") - buf.write("\u00d5\u00d1\3\2\2\2\u00d6\u00d9\3\2\2\2\u00d7\u00d5\3") - buf.write("\2\2\2\u00d7\u00d8\3\2\2\2\u00d8+\3\2\2\2\u00d9\u00d7") - buf.write("\3\2\2\2\u00da\u00db\7\26\2\2\u00db\u00dc\7-\2\2\u00dc") - buf.write("\u00dd\7\27\2\2\u00dd\u00de\5.\30\2\u00de\u00df\7\30\2") - buf.write("\2\u00df-\3\2\2\2\u00e0\u00e2\5\60\31\2\u00e1\u00e0\3") - buf.write("\2\2\2\u00e2\u00e5\3\2\2\2\u00e3\u00e1\3\2\2\2\u00e3\u00e4") - buf.write("\3\2\2\2\u00e4/\3\2\2\2\u00e5\u00e3\3\2\2\2\u00e6\u00e7") - buf.write("\5\36\20\2\u00e7\u00e8\7\31\2\2\u00e8\61\3\2\2\2\u00e9") - buf.write("\u00ec\7-\2\2\u00ea\u00ec\5\64\33\2\u00eb\u00e9\3\2\2") - buf.write("\2\u00eb\u00ea\3\2\2\2\u00ec\u00ed\3\2\2\2\u00ed\u00ee") - buf.write("\7\23\2\2\u00ee\u00ef\7\32\2\2\u00ef\u00f0\7-\2\2\u00f0") - buf.write("\u00f1\7\t\2\2\u00f1\u00f2\7\13\2\2\u00f2\63\3\2\2\2\u00f3") - buf.write("\u00fa\5\66\34\2\u00f4\u00f5\7\33\2\2\u00f5\u00fb\7-\2") - buf.write("\2\u00f6\u00f7\7\4\2\2\u00f7\u00f8\5*\26\2\u00f8\u00f9") - buf.write("\7\5\2\2\u00f9\u00fb\3\2\2\2\u00fa\u00f4\3\2\2\2\u00fa") - buf.write("\u00f6\3\2\2\2\u00fb\u00fc\3\2\2\2\u00fc\u00fa\3\2\2\2") - buf.write("\u00fc\u00fd\3\2\2\2\u00fd\65\3\2\2\2\u00fe\u00ff\7-\2") - buf.write("\2\u00ff\67\3\2\2\2\u0100\u0101\7.\2\2\u0101\u0102\7\t") - buf.write("\2\2\u0102\u0103\5@!\2\u0103\u0104\7\13\2\2\u01049\3\2") - buf.write("\2\2\u0105\u010a\7-\2\2\u0106\u0107\7\n\2\2\u0107\u0109") - buf.write("\7-\2\2\u0108\u0106\3\2\2\2\u0109\u010c\3\2\2\2\u010a") - buf.write("\u0108\3\2\2\2\u010a\u010b\3\2\2\2\u010b\u010d\3\2\2\2") - buf.write("\u010c\u010a\3\2\2\2\u010d\u010e\7\23\2\2\u010e\u010f") - buf.write("\58\35\2\u010f;\3\2\2\2\u0110\u0111\7\34\2\2\u0111\u0112") - buf.write("\7.\2\2\u0112\u0113\7\t\2\2\u0113\u0114\5> \2\u0114\u0115") - buf.write("\7\13\2\2\u0115\u0116\7\27\2\2\u0116\u0117\5\6\4\2\u0117") - buf.write("\u0118\7\30\2\2\u0118=\3\2\2\2\u0119\u011e\7-\2\2\u011a") - buf.write("\u011b\7\n\2\2\u011b\u011d\7-\2\2\u011c\u011a\3\2\2\2") - buf.write("\u011d\u0120\3\2\2\2\u011e\u011c\3\2\2\2\u011e\u011f\3") - buf.write("\2\2\2\u011f\u0122\3\2\2\2\u0120\u011e\3\2\2\2\u0121\u0119") - buf.write("\3\2\2\2\u0121\u0122\3\2\2\2\u0122?\3\2\2\2\u0123\u0128") - buf.write("\5*\26\2\u0124\u0125\7\n\2\2\u0125\u0127\5*\26\2\u0126") - buf.write("\u0124\3\2\2\2\u0127\u012a\3\2\2\2\u0128\u0126\3\2\2\2") - buf.write("\u0128\u0129\3\2\2\2\u0129\u012c\3\2\2\2\u012a\u0128\3") - buf.write("\2\2\2\u012b\u0123\3\2\2\2\u012b\u012c\3\2\2\2\u012cA") - buf.write("\3\2\2\2\u012d\u012e\b\"\1\2\u012e\u012f\7*\2\2\u012f") - buf.write("\u013a\5B\"\7\u0130\u0131\5*\26\2\u0131\u0132\5D#\2\u0132") - buf.write("\u0133\5*\26\2\u0133\u013a\3\2\2\2\u0134\u013a\7!\2\2") - buf.write("\u0135\u0136\7\t\2\2\u0136\u0137\5B\"\2\u0137\u0138\7") - buf.write("\13\2\2\u0138\u013a\3\2\2\2\u0139\u012d\3\2\2\2\u0139") - buf.write("\u0130\3\2\2\2\u0139\u0134\3\2\2\2\u0139\u0135\3\2\2\2") - buf.write("\u013a\u0141\3\2\2\2\u013b\u013c\f\5\2\2\u013c\u013d\5") - buf.write("F$\2\u013d\u013e\5B\"\6\u013e\u0140\3\2\2\2\u013f\u013b") - buf.write("\3\2\2\2\u0140\u0143\3\2\2\2\u0141\u013f\3\2\2\2\u0141") - buf.write("\u0142\3\2\2\2\u0142C\3\2\2\2\u0143\u0141\3\2\2\2\u0144") - buf.write("\u0145\t\6\2\2\u0145E\3\2\2\2\u0146\u0147\t\7\2\2\u0147") - buf.write("G\3\2\2\2\u0148\u014e\7+\2\2\u0149\u014e\7-\2\2\u014a") - buf.write("\u014e\5\34\17\2\u014b\u014e\5\64\33\2\u014c\u014e\7,") - buf.write("\2\2\u014d\u0148\3\2\2\2\u014d\u0149\3\2\2\2\u014d\u014a") - buf.write("\3\2\2\2\u014d\u014b\3\2\2\2\u014d\u014c\3\2\2\2\u014e") - buf.write("I\3\2\2\2\33PVfj\u0098\u009b\u00a1\u00b7\u00ba\u00c7\u00cb") - buf.write("\u00d5\u00d7\u00e3\u00eb\u00fa\u00fc\u010a\u011e\u0121") - buf.write("\u0128\u012b\u0139\u0141\u014d") + buf.write("\35\3\36\3\36\5\36\u0108\n\36\3\36\3\36\3\36\5\36\u010d") + buf.write("\n\36\7\36\u010f\n\36\f\36\16\36\u0112\13\36\3\36\3\36") + buf.write("\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3 ") + buf.write("\3 \3 \7 \u0123\n \f \16 \u0126\13 \5 \u0128\n \3!\3!") + buf.write("\3!\7!\u012d\n!\f!\16!\u0130\13!\5!\u0132\n!\3\"\3\"\3") + buf.write("\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\5\"\u0140\n\"\3") + buf.write("\"\3\"\3\"\3\"\7\"\u0146\n\"\f\"\16\"\u0149\13\"\3#\3") + buf.write("#\3$\3$\3%\3%\3%\3%\3%\5%\u0154\n%\3%\2\4*B&\2\4\6\b\n") + buf.write("\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<") + buf.write(">@BDFH\2\b\3\2\f\17\3\2\20\21\3\2\37 \3\2\35\36\3\2\"") + buf.write("\'\3\2()\2\u015f\2J\3\2\2\2\4P\3\2\2\2\6T\3\2\2\2\bf\3") + buf.write("\2\2\2\nj\3\2\2\2\fl\3\2\2\2\16r\3\2\2\2\20|\3\2\2\2\22") + buf.write("\u0082\3\2\2\2\24\u0089\3\2\2\2\26\u008c\3\2\2\2\30\u008e") + buf.write("\3\2\2\2\32\u0090\3\2\2\2\34\u0092\3\2\2\2\36\u00a1\3") + buf.write("\2\2\2 \u00a6\3\2\2\2\"\u00ab\3\2\2\2$\u00ad\3\2\2\2&") + buf.write("\u00af\3\2\2\2(\u00b1\3\2\2\2*\u00cb\3\2\2\2,\u00da\3") + buf.write("\2\2\2.\u00e3\3\2\2\2\60\u00e6\3\2\2\2\62\u00eb\3\2\2") + buf.write("\2\64\u00f3\3\2\2\2\66\u00fe\3\2\2\28\u0100\3\2\2\2:\u0107") + buf.write("\3\2\2\2<\u0116\3\2\2\2>\u0127\3\2\2\2@\u0131\3\2\2\2") + buf.write("B\u013f\3\2\2\2D\u014a\3\2\2\2F\u014c\3\2\2\2H\u0153\3") + buf.write("\2\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2MO\5\b\5\2NM\3\2") + buf.write("\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2Q\5\3\2\2\2RP\3\2\2") + buf.write("\2SU\5\b\5\2TS\3\2\2\2UV\3\2\2\2VT\3\2\2\2VW\3\2\2\2W") + buf.write("\7\3\2\2\2Xg\5\36\20\2Yg\5 \21\2Zg\5\n\6\2[g\5\20\t\2") + buf.write("\\g\5\24\13\2]g\5\30\r\2^g\5\22\n\2_g\5\32\16\2`g\5,\27") + buf.write("\2ag\5\62\32\2bg\5<\37\2cg\58\35\2dg\5:\36\2eg\5(\25\2") + buf.write("fX\3\2\2\2fY\3\2\2\2fZ\3\2\2\2f[\3\2\2\2f\\\3\2\2\2f]") + buf.write("\3\2\2\2f^\3\2\2\2f_\3\2\2\2f`\3\2\2\2fa\3\2\2\2fb\3\2") + buf.write("\2\2fc\3\2\2\2fd\3\2\2\2fe\3\2\2\2g\t\3\2\2\2hk\5\f\7") + buf.write("\2ik\5\16\b\2jh\3\2\2\2ji\3\2\2\2k\13\3\2\2\2lm\7\3\2") + buf.write("\2mn\5B\"\2no\7\4\2\2op\5\6\4\2pq\7\5\2\2q\r\3\2\2\2r") + buf.write("s\7\3\2\2st\5B\"\2tu\7\4\2\2uv\5\6\4\2vw\7\5\2\2wx\7\6") + buf.write("\2\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2{\17\3\2\2\2|}\7\7\2") + buf.write("\2}~\5H%\2~\177\7\4\2\2\177\u0080\5\6\4\2\u0080\u0081") + buf.write("\7\5\2\2\u0081\21\3\2\2\2\u0082\u0083\7\b\2\2\u0083\u0084") + buf.write("\7\t\2\2\u0084\u0085\5*\26\2\u0085\u0086\7\n\2\2\u0086") + buf.write("\u0087\5*\26\2\u0087\u0088\7\13\2\2\u0088\23\3\2\2\2\u0089") + buf.write("\u008a\5\26\f\2\u008a\u008b\5*\26\2\u008b\25\3\2\2\2\u008c") + buf.write("\u008d\t\2\2\2\u008d\27\3\2\2\2\u008e\u008f\t\3\2\2\u008f") + buf.write("\31\3\2\2\2\u0090\u0091\7\22\2\2\u0091\33\3\2\2\2\u0092") + buf.write("\u009b\7\4\2\2\u0093\u0098\5*\26\2\u0094\u0095\7\n\2\2") + buf.write("\u0095\u0097\5*\26\2\u0096\u0094\3\2\2\2\u0097\u009a\3") + buf.write("\2\2\2\u0098\u0096\3\2\2\2\u0098\u0099\3\2\2\2\u0099\u009c") + buf.write("\3\2\2\2\u009a\u0098\3\2\2\2\u009b\u0093\3\2\2\2\u009b") + buf.write("\u009c\3\2\2\2\u009c\u009d\3\2\2\2\u009d\u009e\7\5\2\2") + buf.write("\u009e\35\3\2\2\2\u009f\u00a2\7-\2\2\u00a0\u00a2\5\64") + buf.write("\33\2\u00a1\u009f\3\2\2\2\u00a1\u00a0\3\2\2\2\u00a2\u00a3") + buf.write("\3\2\2\2\u00a3\u00a4\7\23\2\2\u00a4\u00a5\5*\26\2\u00a5") + buf.write("\37\3\2\2\2\u00a6\u00a7\7\24\2\2\u00a7\u00a8\7\t\2\2\u00a8") + buf.write("\u00a9\5*\26\2\u00a9\u00aa\7\13\2\2\u00aa!\3\2\2\2\u00ab") + buf.write("\u00ac\t\4\2\2\u00ac#\3\2\2\2\u00ad\u00ae\t\5\2\2\u00ae") + buf.write("%\3\2\2\2\u00af\u00b0\7\36\2\2\u00b0\'\3\2\2\2\u00b1\u00ba") + buf.write("\7\25\2\2\u00b2\u00b7\5*\26\2\u00b3\u00b4\7\n\2\2\u00b4") + buf.write("\u00b6\5*\26\2\u00b5\u00b3\3\2\2\2\u00b6\u00b9\3\2\2\2") + buf.write("\u00b7\u00b5\3\2\2\2\u00b7\u00b8\3\2\2\2\u00b8\u00bb\3") + buf.write("\2\2\2\u00b9\u00b7\3\2\2\2\u00ba\u00b2\3\2\2\2\u00ba\u00bb") + buf.write("\3\2\2\2\u00bb)\3\2\2\2\u00bc\u00bd\b\26\1\2\u00bd\u00be") + buf.write("\5&\24\2\u00be\u00bf\5*\26\b\u00bf\u00cc\3\2\2\2\u00c0") + buf.write("\u00c1\7\t\2\2\u00c1\u00c2\5*\26\2\u00c2\u00c3\7\13\2") + buf.write("\2\u00c3\u00cc\3\2\2\2\u00c4\u00cc\5H%\2\u00c5\u00c8\7") + buf.write("-\2\2\u00c6\u00c8\5\64\33\2\u00c7\u00c5\3\2\2\2\u00c7") + buf.write("\u00c6\3\2\2\2\u00c8\u00c9\3\2\2\2\u00c9\u00ca\7\23\2") + buf.write("\2\u00ca\u00cc\5*\26\3\u00cb\u00bc\3\2\2\2\u00cb\u00c0") + buf.write("\3\2\2\2\u00cb\u00c4\3\2\2\2\u00cb\u00c7\3\2\2\2\u00cc") + buf.write("\u00d7\3\2\2\2\u00cd\u00ce\f\7\2\2\u00ce\u00cf\5\"\22") + buf.write("\2\u00cf\u00d0\5*\26\b\u00d0\u00d6\3\2\2\2\u00d1\u00d2") + buf.write("\f\6\2\2\u00d2\u00d3\5$\23\2\u00d3\u00d4\5*\26\7\u00d4") + buf.write("\u00d6\3\2\2\2\u00d5\u00cd\3\2\2\2\u00d5\u00d1\3\2\2\2") + buf.write("\u00d6\u00d9\3\2\2\2\u00d7\u00d5\3\2\2\2\u00d7\u00d8\3") + buf.write("\2\2\2\u00d8+\3\2\2\2\u00d9\u00d7\3\2\2\2\u00da\u00db") + buf.write("\7\26\2\2\u00db\u00dc\7-\2\2\u00dc\u00dd\7\27\2\2\u00dd") + buf.write("\u00de\5.\30\2\u00de\u00df\7\30\2\2\u00df-\3\2\2\2\u00e0") + buf.write("\u00e2\5\60\31\2\u00e1\u00e0\3\2\2\2\u00e2\u00e5\3\2\2") + buf.write("\2\u00e3\u00e1\3\2\2\2\u00e3\u00e4\3\2\2\2\u00e4/\3\2") + buf.write("\2\2\u00e5\u00e3\3\2\2\2\u00e6\u00e7\5\36\20\2\u00e7\u00e8") + buf.write("\7\31\2\2\u00e8\61\3\2\2\2\u00e9\u00ec\7-\2\2\u00ea\u00ec") + buf.write("\5\64\33\2\u00eb\u00e9\3\2\2\2\u00eb\u00ea\3\2\2\2\u00ec") + buf.write("\u00ed\3\2\2\2\u00ed\u00ee\7\23\2\2\u00ee\u00ef\7\32\2") + buf.write("\2\u00ef\u00f0\7-\2\2\u00f0\u00f1\7\t\2\2\u00f1\u00f2") + buf.write("\7\13\2\2\u00f2\63\3\2\2\2\u00f3\u00fa\5\66\34\2\u00f4") + buf.write("\u00f5\7\33\2\2\u00f5\u00fb\7-\2\2\u00f6\u00f7\7\4\2\2") + buf.write("\u00f7\u00f8\5*\26\2\u00f8\u00f9\7\5\2\2\u00f9\u00fb\3") + buf.write("\2\2\2\u00fa\u00f4\3\2\2\2\u00fa\u00f6\3\2\2\2\u00fb\u00fc") + buf.write("\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd") + buf.write("\65\3\2\2\2\u00fe\u00ff\7-\2\2\u00ff\67\3\2\2\2\u0100") + buf.write("\u0101\7.\2\2\u0101\u0102\7\t\2\2\u0102\u0103\5@!\2\u0103") + buf.write("\u0104\7\13\2\2\u01049\3\2\2\2\u0105\u0108\7-\2\2\u0106") + buf.write("\u0108\5\64\33\2\u0107\u0105\3\2\2\2\u0107\u0106\3\2\2") + buf.write("\2\u0108\u0110\3\2\2\2\u0109\u010c\7\n\2\2\u010a\u010d") + buf.write("\7-\2\2\u010b\u010d\5\64\33\2\u010c\u010a\3\2\2\2\u010c") + buf.write("\u010b\3\2\2\2\u010d\u010f\3\2\2\2\u010e\u0109\3\2\2\2") + buf.write("\u010f\u0112\3\2\2\2\u0110\u010e\3\2\2\2\u0110\u0111\3") + buf.write("\2\2\2\u0111\u0113\3\2\2\2\u0112\u0110\3\2\2\2\u0113\u0114") + buf.write("\7\23\2\2\u0114\u0115\58\35\2\u0115;\3\2\2\2\u0116\u0117") + buf.write("\7\34\2\2\u0117\u0118\7.\2\2\u0118\u0119\7\t\2\2\u0119") + buf.write("\u011a\5> \2\u011a\u011b\7\13\2\2\u011b\u011c\7\27\2\2") + buf.write("\u011c\u011d\5\6\4\2\u011d\u011e\7\30\2\2\u011e=\3\2\2") + buf.write("\2\u011f\u0124\7-\2\2\u0120\u0121\7\n\2\2\u0121\u0123") + buf.write("\7-\2\2\u0122\u0120\3\2\2\2\u0123\u0126\3\2\2\2\u0124") + buf.write("\u0122\3\2\2\2\u0124\u0125\3\2\2\2\u0125\u0128\3\2\2\2") + buf.write("\u0126\u0124\3\2\2\2\u0127\u011f\3\2\2\2\u0127\u0128\3") + buf.write("\2\2\2\u0128?\3\2\2\2\u0129\u012e\5*\26\2\u012a\u012b") + buf.write("\7\n\2\2\u012b\u012d\5*\26\2\u012c\u012a\3\2\2\2\u012d") + buf.write("\u0130\3\2\2\2\u012e\u012c\3\2\2\2\u012e\u012f\3\2\2\2") + buf.write("\u012f\u0132\3\2\2\2\u0130\u012e\3\2\2\2\u0131\u0129\3") + buf.write("\2\2\2\u0131\u0132\3\2\2\2\u0132A\3\2\2\2\u0133\u0134") + buf.write("\b\"\1\2\u0134\u0135\7*\2\2\u0135\u0140\5B\"\7\u0136\u0137") + buf.write("\5*\26\2\u0137\u0138\5D#\2\u0138\u0139\5*\26\2\u0139\u0140") + buf.write("\3\2\2\2\u013a\u0140\7!\2\2\u013b\u013c\7\t\2\2\u013c") + buf.write("\u013d\5B\"\2\u013d\u013e\7\13\2\2\u013e\u0140\3\2\2\2") + buf.write("\u013f\u0133\3\2\2\2\u013f\u0136\3\2\2\2\u013f\u013a\3") + buf.write("\2\2\2\u013f\u013b\3\2\2\2\u0140\u0147\3\2\2\2\u0141\u0142") + buf.write("\f\5\2\2\u0142\u0143\5F$\2\u0143\u0144\5B\"\6\u0144\u0146") + buf.write("\3\2\2\2\u0145\u0141\3\2\2\2\u0146\u0149\3\2\2\2\u0147") + buf.write("\u0145\3\2\2\2\u0147\u0148\3\2\2\2\u0148C\3\2\2\2\u0149") + buf.write("\u0147\3\2\2\2\u014a\u014b\t\6\2\2\u014bE\3\2\2\2\u014c") + buf.write("\u014d\t\7\2\2\u014dG\3\2\2\2\u014e\u0154\7+\2\2\u014f") + buf.write("\u0154\7-\2\2\u0150\u0154\5\34\17\2\u0151\u0154\5\64\33") + buf.write("\2\u0152\u0154\7,\2\2\u0153\u014e\3\2\2\2\u0153\u014f") + buf.write("\3\2\2\2\u0153\u0150\3\2\2\2\u0153\u0151\3\2\2\2\u0153") + buf.write("\u0152\3\2\2\2\u0154I\3\2\2\2\35PVfj\u0098\u009b\u00a1") + buf.write("\u00b7\u00ba\u00c7\u00cb\u00d5\u00d7\u00e3\u00eb\u00fa") + buf.write("\u00fc\u0107\u010c\u0110\u0124\u0127\u012e\u0131\u013f") + buf.write("\u0147\u0153") return buf.getvalue() @@ -2060,14 +2064,21 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + def functionCall(self): + return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) + + def VAR(self, i:int=None): if i is None: return self.getTokens(tlangParser.VAR) else: return self.getToken(tlangParser.VAR, i) - def functionCall(self): - return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) + def objectOrArrayAccess(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.ObjectOrArrayAccessContext) + else: + return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,i) def getRuleIndex(self): @@ -2089,23 +2100,47 @@ def functionCallWithReturnValues(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 259 - self.match(tlangParser.VAR) - self.state = 264 + self.state = 261 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input,17,self._ctx) + if la_ == 1: + self.state = 259 + self.match(tlangParser.VAR) + pass + + elif la_ == 2: + self.state = 260 + self.objectOrArrayAccess() + pass + + + self.state = 270 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 260 + self.state = 263 self.match(tlangParser.T__7) - self.state = 261 - self.match(tlangParser.VAR) self.state = 266 self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input,18,self._ctx) + if la_ == 1: + self.state = 264 + self.match(tlangParser.VAR) + pass + + elif la_ == 2: + self.state = 265 + self.objectOrArrayAccess() + pass + + + self.state = 272 + self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 267 + self.state = 273 self.match(tlangParser.T__16) - self.state = 268 + self.state = 274 self.functionCall() except RecognitionException as re: localctx.exception = re @@ -2151,21 +2186,21 @@ def functionDeclaration(self): self.enterRule(localctx, 58, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 270 + self.state = 276 self.match(tlangParser.T__25) - self.state = 271 + self.state = 277 self.match(tlangParser.NAME) - self.state = 272 + self.state = 278 self.match(tlangParser.T__6) - self.state = 273 + self.state = 279 self.parameters() - self.state = 274 + self.state = 280 self.match(tlangParser.T__8) - self.state = 275 + self.state = 281 self.match(tlangParser.T__20) - self.state = 276 + self.state = 282 self.strict_ilist() - self.state = 277 + self.state = 283 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -2207,21 +2242,21 @@ def parameters(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 287 + self.state = 293 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.VAR: - self.state = 279 + self.state = 285 self.match(tlangParser.VAR) - self.state = 284 + self.state = 290 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 280 + self.state = 286 self.match(tlangParser.T__7) - self.state = 281 + self.state = 287 self.match(tlangParser.VAR) - self.state = 286 + self.state = 292 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2268,21 +2303,21 @@ def arguments(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 297 + self.state = 303 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR))) != 0): - self.state = 289 + self.state = 295 self.expression(0) - self.state = 294 + self.state = 300 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 290 + self.state = 296 self.match(tlangParser.T__7) - self.state = 291 + self.state = 297 self.expression(0) - self.state = 296 + self.state = 302 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2351,44 +2386,44 @@ def condition(self, _p:int=0): self.enterRecursionRule(localctx, 64, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 311 + self.state = 317 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,22,self._ctx) + la_ = self._interp.adaptivePredict(self._input,24,self._ctx) if la_ == 1: - self.state = 300 + self.state = 306 self.match(tlangParser.NOT) - self.state = 301 + self.state = 307 self.condition(5) pass elif la_ == 2: - self.state = 302 + self.state = 308 self.expression(0) - self.state = 303 + self.state = 309 self.binCondOp() - self.state = 304 + self.state = 310 self.expression(0) pass elif la_ == 3: - self.state = 306 + self.state = 312 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 307 + self.state = 313 self.match(tlangParser.T__6) - self.state = 308 + self.state = 314 self.condition(0) - self.state = 309 + self.state = 315 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 319 + self.state = 325 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,23,self._ctx) + _alt = self._interp.adaptivePredict(self._input,25,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -2396,17 +2431,17 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 313 + self.state = 319 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 314 + self.state = 320 self.logicOp() - self.state = 315 + self.state = 321 self.condition(4) - self.state = 321 + self.state = 327 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,23,self._ctx) + _alt = self._interp.adaptivePredict(self._input,25,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2460,7 +2495,7 @@ def binCondOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 322 + self.state = 328 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2507,7 +2542,7 @@ def logicOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 324 + self.state = 330 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2563,36 +2598,36 @@ def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) self.enterRule(localctx, 70, self.RULE_value) try: - self.state = 331 + self.state = 337 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,24,self._ctx) + la_ = self._interp.adaptivePredict(self._input,26,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 326 + self.state = 332 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 327 + self.state = 333 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 328 + self.state = 334 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 329 + self.state = 335 self.objectOrArrayAccess() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 330 + self.state = 336 self.match(tlangParser.REAL) pass From 6455bb27b90b0f547ad206fa8f8161c5b309cc38 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Fri, 21 Feb 2025 02:11:42 +0530 Subject: [PATCH 10/47] recursive expression temporary registers used --- ChironCore/turtparse/tlang.g4 | 7 +- ChironCore/turtparse/tlang.interp | 2 +- ChironCore/turtparse/tlangParser.py | 399 ++++++++++++++------------- ChironCore/turtparse/tlangVisitor.py | 5 + 4 files changed, 223 insertions(+), 190 deletions(-) diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index 6f45328..9a087bf 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -10,7 +10,8 @@ instruction_list : (instruction)* strict_ilist : (instruction)+ ; -instruction : assignment +instruction : functionCallWithReturnValues + | assignment | printStatement | conditional | loop @@ -22,7 +23,6 @@ instruction : assignment | objectInstantiation | functionDeclaration | functionCall - | functionCallWithReturnValues | returnStatement ; @@ -73,6 +73,7 @@ expression : | '(' expression ')' #parenExpr | value #valueExpr | ( VAR | objectOrArrayAccess) '=' expression #assignExpr + | functionCall #functionCallExpr ; @@ -92,7 +93,7 @@ baseAccess : VAR ; // function call functionCall : NAME '(' arguments ')' ; -functionCallWithReturnValues : ( VAR | objectOrArrayAccess) ( ',' ( VAR | objectOrArrayAccess) )* '=' functionCall ; +functionCallWithReturnValues : ( VAR | objectOrArrayAccess) ( ',' ( VAR | objectOrArrayAccess) )+ '=' functionCall ; // function declaration functionDeclaration : 'def' NAME '(' parameters ')' '{' strict_ilist '}' ; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index 49ec3a8..3465964 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -134,4 +134,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 342, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 79, 10, 3, 12, 3, 14, 3, 82, 11, 3, 3, 4, 6, 4, 85, 10, 4, 13, 4, 14, 4, 86, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 103, 10, 5, 3, 6, 3, 6, 5, 6, 107, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 151, 10, 15, 12, 15, 14, 15, 154, 11, 15, 5, 15, 156, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 162, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 182, 10, 21, 12, 21, 14, 21, 185, 11, 21, 5, 21, 187, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 200, 10, 22, 3, 22, 3, 22, 5, 22, 204, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 214, 10, 22, 12, 22, 14, 22, 217, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 226, 10, 24, 12, 24, 14, 24, 229, 11, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 5, 26, 236, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 251, 10, 27, 13, 27, 14, 27, 252, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 264, 10, 30, 3, 30, 3, 30, 3, 30, 5, 30, 269, 10, 30, 7, 30, 271, 10, 30, 12, 30, 14, 30, 274, 11, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 7, 32, 291, 10, 32, 12, 32, 14, 32, 294, 11, 32, 5, 32, 296, 10, 32, 3, 33, 3, 33, 3, 33, 7, 33, 301, 10, 33, 12, 33, 14, 33, 304, 11, 33, 5, 33, 306, 10, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 320, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 7, 34, 326, 10, 34, 12, 34, 14, 34, 329, 11, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 340, 10, 37, 3, 37, 2, 4, 42, 66, 38, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 351, 2, 74, 3, 2, 2, 2, 4, 80, 3, 2, 2, 2, 6, 84, 3, 2, 2, 2, 8, 102, 3, 2, 2, 2, 10, 106, 3, 2, 2, 2, 12, 108, 3, 2, 2, 2, 14, 114, 3, 2, 2, 2, 16, 124, 3, 2, 2, 2, 18, 130, 3, 2, 2, 2, 20, 137, 3, 2, 2, 2, 22, 140, 3, 2, 2, 2, 24, 142, 3, 2, 2, 2, 26, 144, 3, 2, 2, 2, 28, 146, 3, 2, 2, 2, 30, 161, 3, 2, 2, 2, 32, 166, 3, 2, 2, 2, 34, 171, 3, 2, 2, 2, 36, 173, 3, 2, 2, 2, 38, 175, 3, 2, 2, 2, 40, 177, 3, 2, 2, 2, 42, 203, 3, 2, 2, 2, 44, 218, 3, 2, 2, 2, 46, 227, 3, 2, 2, 2, 48, 230, 3, 2, 2, 2, 50, 235, 3, 2, 2, 2, 52, 243, 3, 2, 2, 2, 54, 254, 3, 2, 2, 2, 56, 256, 3, 2, 2, 2, 58, 263, 3, 2, 2, 2, 60, 278, 3, 2, 2, 2, 62, 295, 3, 2, 2, 2, 64, 305, 3, 2, 2, 2, 66, 319, 3, 2, 2, 2, 68, 330, 3, 2, 2, 2, 70, 332, 3, 2, 2, 2, 72, 339, 3, 2, 2, 2, 74, 75, 5, 4, 3, 2, 75, 76, 7, 2, 2, 3, 76, 3, 3, 2, 2, 2, 77, 79, 5, 8, 5, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 5, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 85, 5, 8, 5, 2, 84, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 7, 3, 2, 2, 2, 88, 103, 5, 30, 16, 2, 89, 103, 5, 32, 17, 2, 90, 103, 5, 10, 6, 2, 91, 103, 5, 16, 9, 2, 92, 103, 5, 20, 11, 2, 93, 103, 5, 24, 13, 2, 94, 103, 5, 18, 10, 2, 95, 103, 5, 26, 14, 2, 96, 103, 5, 44, 23, 2, 97, 103, 5, 50, 26, 2, 98, 103, 5, 60, 31, 2, 99, 103, 5, 56, 29, 2, 100, 103, 5, 58, 30, 2, 101, 103, 5, 40, 21, 2, 102, 88, 3, 2, 2, 2, 102, 89, 3, 2, 2, 2, 102, 90, 3, 2, 2, 2, 102, 91, 3, 2, 2, 2, 102, 92, 3, 2, 2, 2, 102, 93, 3, 2, 2, 2, 102, 94, 3, 2, 2, 2, 102, 95, 3, 2, 2, 2, 102, 96, 3, 2, 2, 2, 102, 97, 3, 2, 2, 2, 102, 98, 3, 2, 2, 2, 102, 99, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 102, 101, 3, 2, 2, 2, 103, 9, 3, 2, 2, 2, 104, 107, 5, 12, 7, 2, 105, 107, 5, 14, 8, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 11, 3, 2, 2, 2, 108, 109, 7, 3, 2, 2, 109, 110, 5, 66, 34, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 13, 3, 2, 2, 2, 114, 115, 7, 3, 2, 2, 115, 116, 5, 66, 34, 2, 116, 117, 7, 4, 2, 2, 117, 118, 5, 6, 4, 2, 118, 119, 7, 5, 2, 2, 119, 120, 7, 6, 2, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 15, 3, 2, 2, 2, 124, 125, 7, 7, 2, 2, 125, 126, 5, 72, 37, 2, 126, 127, 7, 4, 2, 2, 127, 128, 5, 6, 4, 2, 128, 129, 7, 5, 2, 2, 129, 17, 3, 2, 2, 2, 130, 131, 7, 8, 2, 2, 131, 132, 7, 9, 2, 2, 132, 133, 5, 42, 22, 2, 133, 134, 7, 10, 2, 2, 134, 135, 5, 42, 22, 2, 135, 136, 7, 11, 2, 2, 136, 19, 3, 2, 2, 2, 137, 138, 5, 22, 12, 2, 138, 139, 5, 42, 22, 2, 139, 21, 3, 2, 2, 2, 140, 141, 9, 2, 2, 2, 141, 23, 3, 2, 2, 2, 142, 143, 9, 3, 2, 2, 143, 25, 3, 2, 2, 2, 144, 145, 7, 18, 2, 2, 145, 27, 3, 2, 2, 2, 146, 155, 7, 4, 2, 2, 147, 152, 5, 42, 22, 2, 148, 149, 7, 10, 2, 2, 149, 151, 5, 42, 22, 2, 150, 148, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 156, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 147, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 158, 7, 5, 2, 2, 158, 29, 3, 2, 2, 2, 159, 162, 7, 45, 2, 2, 160, 162, 5, 52, 27, 2, 161, 159, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 164, 7, 19, 2, 2, 164, 165, 5, 42, 22, 2, 165, 31, 3, 2, 2, 2, 166, 167, 7, 20, 2, 2, 167, 168, 7, 9, 2, 2, 168, 169, 5, 42, 22, 2, 169, 170, 7, 11, 2, 2, 170, 33, 3, 2, 2, 2, 171, 172, 9, 4, 2, 2, 172, 35, 3, 2, 2, 2, 173, 174, 9, 5, 2, 2, 174, 37, 3, 2, 2, 2, 175, 176, 7, 30, 2, 2, 176, 39, 3, 2, 2, 2, 177, 186, 7, 21, 2, 2, 178, 183, 5, 42, 22, 2, 179, 180, 7, 10, 2, 2, 180, 182, 5, 42, 22, 2, 181, 179, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 178, 3, 2, 2, 2, 186, 187, 3, 2, 2, 2, 187, 41, 3, 2, 2, 2, 188, 189, 8, 22, 1, 2, 189, 190, 5, 38, 20, 2, 190, 191, 5, 42, 22, 8, 191, 204, 3, 2, 2, 2, 192, 193, 7, 9, 2, 2, 193, 194, 5, 42, 22, 2, 194, 195, 7, 11, 2, 2, 195, 204, 3, 2, 2, 2, 196, 204, 5, 72, 37, 2, 197, 200, 7, 45, 2, 2, 198, 200, 5, 52, 27, 2, 199, 197, 3, 2, 2, 2, 199, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 7, 19, 2, 2, 202, 204, 5, 42, 22, 3, 203, 188, 3, 2, 2, 2, 203, 192, 3, 2, 2, 2, 203, 196, 3, 2, 2, 2, 203, 199, 3, 2, 2, 2, 204, 215, 3, 2, 2, 2, 205, 206, 12, 7, 2, 2, 206, 207, 5, 34, 18, 2, 207, 208, 5, 42, 22, 8, 208, 214, 3, 2, 2, 2, 209, 210, 12, 6, 2, 2, 210, 211, 5, 36, 19, 2, 211, 212, 5, 42, 22, 7, 212, 214, 3, 2, 2, 2, 213, 205, 3, 2, 2, 2, 213, 209, 3, 2, 2, 2, 214, 217, 3, 2, 2, 2, 215, 213, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 43, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 218, 219, 7, 22, 2, 2, 219, 220, 7, 45, 2, 2, 220, 221, 7, 23, 2, 2, 221, 222, 5, 46, 24, 2, 222, 223, 7, 24, 2, 2, 223, 45, 3, 2, 2, 2, 224, 226, 5, 48, 25, 2, 225, 224, 3, 2, 2, 2, 226, 229, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 47, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 230, 231, 5, 30, 16, 2, 231, 232, 7, 25, 2, 2, 232, 49, 3, 2, 2, 2, 233, 236, 7, 45, 2, 2, 234, 236, 5, 52, 27, 2, 235, 233, 3, 2, 2, 2, 235, 234, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 238, 7, 19, 2, 2, 238, 239, 7, 26, 2, 2, 239, 240, 7, 45, 2, 2, 240, 241, 7, 9, 2, 2, 241, 242, 7, 11, 2, 2, 242, 51, 3, 2, 2, 2, 243, 250, 5, 54, 28, 2, 244, 245, 7, 27, 2, 2, 245, 251, 7, 45, 2, 2, 246, 247, 7, 4, 2, 2, 247, 248, 5, 42, 22, 2, 248, 249, 7, 5, 2, 2, 249, 251, 3, 2, 2, 2, 250, 244, 3, 2, 2, 2, 250, 246, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 53, 3, 2, 2, 2, 254, 255, 7, 45, 2, 2, 255, 55, 3, 2, 2, 2, 256, 257, 7, 46, 2, 2, 257, 258, 7, 9, 2, 2, 258, 259, 5, 64, 33, 2, 259, 260, 7, 11, 2, 2, 260, 57, 3, 2, 2, 2, 261, 264, 7, 45, 2, 2, 262, 264, 5, 52, 27, 2, 263, 261, 3, 2, 2, 2, 263, 262, 3, 2, 2, 2, 264, 272, 3, 2, 2, 2, 265, 268, 7, 10, 2, 2, 266, 269, 7, 45, 2, 2, 267, 269, 5, 52, 27, 2, 268, 266, 3, 2, 2, 2, 268, 267, 3, 2, 2, 2, 269, 271, 3, 2, 2, 2, 270, 265, 3, 2, 2, 2, 271, 274, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 275, 3, 2, 2, 2, 274, 272, 3, 2, 2, 2, 275, 276, 7, 19, 2, 2, 276, 277, 5, 56, 29, 2, 277, 59, 3, 2, 2, 2, 278, 279, 7, 28, 2, 2, 279, 280, 7, 46, 2, 2, 280, 281, 7, 9, 2, 2, 281, 282, 5, 62, 32, 2, 282, 283, 7, 11, 2, 2, 283, 284, 7, 23, 2, 2, 284, 285, 5, 6, 4, 2, 285, 286, 7, 24, 2, 2, 286, 61, 3, 2, 2, 2, 287, 292, 7, 45, 2, 2, 288, 289, 7, 10, 2, 2, 289, 291, 7, 45, 2, 2, 290, 288, 3, 2, 2, 2, 291, 294, 3, 2, 2, 2, 292, 290, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 296, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 295, 287, 3, 2, 2, 2, 295, 296, 3, 2, 2, 2, 296, 63, 3, 2, 2, 2, 297, 302, 5, 42, 22, 2, 298, 299, 7, 10, 2, 2, 299, 301, 5, 42, 22, 2, 300, 298, 3, 2, 2, 2, 301, 304, 3, 2, 2, 2, 302, 300, 3, 2, 2, 2, 302, 303, 3, 2, 2, 2, 303, 306, 3, 2, 2, 2, 304, 302, 3, 2, 2, 2, 305, 297, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 65, 3, 2, 2, 2, 307, 308, 8, 34, 1, 2, 308, 309, 7, 42, 2, 2, 309, 320, 5, 66, 34, 7, 310, 311, 5, 42, 22, 2, 311, 312, 5, 68, 35, 2, 312, 313, 5, 42, 22, 2, 313, 320, 3, 2, 2, 2, 314, 320, 7, 33, 2, 2, 315, 316, 7, 9, 2, 2, 316, 317, 5, 66, 34, 2, 317, 318, 7, 11, 2, 2, 318, 320, 3, 2, 2, 2, 319, 307, 3, 2, 2, 2, 319, 310, 3, 2, 2, 2, 319, 314, 3, 2, 2, 2, 319, 315, 3, 2, 2, 2, 320, 327, 3, 2, 2, 2, 321, 322, 12, 5, 2, 2, 322, 323, 5, 70, 36, 2, 323, 324, 5, 66, 34, 6, 324, 326, 3, 2, 2, 2, 325, 321, 3, 2, 2, 2, 326, 329, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 327, 328, 3, 2, 2, 2, 328, 67, 3, 2, 2, 2, 329, 327, 3, 2, 2, 2, 330, 331, 9, 6, 2, 2, 331, 69, 3, 2, 2, 2, 332, 333, 9, 7, 2, 2, 333, 71, 3, 2, 2, 2, 334, 340, 7, 43, 2, 2, 335, 340, 7, 45, 2, 2, 336, 340, 5, 28, 15, 2, 337, 340, 5, 52, 27, 2, 338, 340, 7, 44, 2, 2, 339, 334, 3, 2, 2, 2, 339, 335, 3, 2, 2, 2, 339, 336, 3, 2, 2, 2, 339, 337, 3, 2, 2, 2, 339, 338, 3, 2, 2, 2, 340, 73, 3, 2, 2, 2, 29, 80, 86, 102, 106, 152, 155, 161, 183, 186, 199, 203, 213, 215, 227, 235, 250, 252, 263, 268, 272, 292, 295, 302, 305, 319, 327, 339] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 342, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 79, 10, 3, 12, 3, 14, 3, 82, 11, 3, 3, 4, 6, 4, 85, 10, 4, 13, 4, 14, 4, 86, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 103, 10, 5, 3, 6, 3, 6, 5, 6, 107, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 151, 10, 15, 12, 15, 14, 15, 154, 11, 15, 5, 15, 156, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 162, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 182, 10, 21, 12, 21, 14, 21, 185, 11, 21, 5, 21, 187, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 200, 10, 22, 3, 22, 3, 22, 3, 22, 5, 22, 205, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 215, 10, 22, 12, 22, 14, 22, 218, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 227, 10, 24, 12, 24, 14, 24, 230, 11, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 5, 26, 237, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 252, 10, 27, 13, 27, 14, 27, 253, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 265, 10, 30, 3, 30, 3, 30, 3, 30, 5, 30, 270, 10, 30, 6, 30, 272, 10, 30, 13, 30, 14, 30, 273, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 7, 32, 291, 10, 32, 12, 32, 14, 32, 294, 11, 32, 5, 32, 296, 10, 32, 3, 33, 3, 33, 3, 33, 7, 33, 301, 10, 33, 12, 33, 14, 33, 304, 11, 33, 5, 33, 306, 10, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 320, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 7, 34, 326, 10, 34, 12, 34, 14, 34, 329, 11, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 340, 10, 37, 3, 37, 2, 4, 42, 66, 38, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 352, 2, 74, 3, 2, 2, 2, 4, 80, 3, 2, 2, 2, 6, 84, 3, 2, 2, 2, 8, 102, 3, 2, 2, 2, 10, 106, 3, 2, 2, 2, 12, 108, 3, 2, 2, 2, 14, 114, 3, 2, 2, 2, 16, 124, 3, 2, 2, 2, 18, 130, 3, 2, 2, 2, 20, 137, 3, 2, 2, 2, 22, 140, 3, 2, 2, 2, 24, 142, 3, 2, 2, 2, 26, 144, 3, 2, 2, 2, 28, 146, 3, 2, 2, 2, 30, 161, 3, 2, 2, 2, 32, 166, 3, 2, 2, 2, 34, 171, 3, 2, 2, 2, 36, 173, 3, 2, 2, 2, 38, 175, 3, 2, 2, 2, 40, 177, 3, 2, 2, 2, 42, 204, 3, 2, 2, 2, 44, 219, 3, 2, 2, 2, 46, 228, 3, 2, 2, 2, 48, 231, 3, 2, 2, 2, 50, 236, 3, 2, 2, 2, 52, 244, 3, 2, 2, 2, 54, 255, 3, 2, 2, 2, 56, 257, 3, 2, 2, 2, 58, 264, 3, 2, 2, 2, 60, 278, 3, 2, 2, 2, 62, 295, 3, 2, 2, 2, 64, 305, 3, 2, 2, 2, 66, 319, 3, 2, 2, 2, 68, 330, 3, 2, 2, 2, 70, 332, 3, 2, 2, 2, 72, 339, 3, 2, 2, 2, 74, 75, 5, 4, 3, 2, 75, 76, 7, 2, 2, 3, 76, 3, 3, 2, 2, 2, 77, 79, 5, 8, 5, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 5, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 85, 5, 8, 5, 2, 84, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 7, 3, 2, 2, 2, 88, 103, 5, 58, 30, 2, 89, 103, 5, 30, 16, 2, 90, 103, 5, 32, 17, 2, 91, 103, 5, 10, 6, 2, 92, 103, 5, 16, 9, 2, 93, 103, 5, 20, 11, 2, 94, 103, 5, 24, 13, 2, 95, 103, 5, 18, 10, 2, 96, 103, 5, 26, 14, 2, 97, 103, 5, 44, 23, 2, 98, 103, 5, 50, 26, 2, 99, 103, 5, 60, 31, 2, 100, 103, 5, 56, 29, 2, 101, 103, 5, 40, 21, 2, 102, 88, 3, 2, 2, 2, 102, 89, 3, 2, 2, 2, 102, 90, 3, 2, 2, 2, 102, 91, 3, 2, 2, 2, 102, 92, 3, 2, 2, 2, 102, 93, 3, 2, 2, 2, 102, 94, 3, 2, 2, 2, 102, 95, 3, 2, 2, 2, 102, 96, 3, 2, 2, 2, 102, 97, 3, 2, 2, 2, 102, 98, 3, 2, 2, 2, 102, 99, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 102, 101, 3, 2, 2, 2, 103, 9, 3, 2, 2, 2, 104, 107, 5, 12, 7, 2, 105, 107, 5, 14, 8, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 11, 3, 2, 2, 2, 108, 109, 7, 3, 2, 2, 109, 110, 5, 66, 34, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 13, 3, 2, 2, 2, 114, 115, 7, 3, 2, 2, 115, 116, 5, 66, 34, 2, 116, 117, 7, 4, 2, 2, 117, 118, 5, 6, 4, 2, 118, 119, 7, 5, 2, 2, 119, 120, 7, 6, 2, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 15, 3, 2, 2, 2, 124, 125, 7, 7, 2, 2, 125, 126, 5, 72, 37, 2, 126, 127, 7, 4, 2, 2, 127, 128, 5, 6, 4, 2, 128, 129, 7, 5, 2, 2, 129, 17, 3, 2, 2, 2, 130, 131, 7, 8, 2, 2, 131, 132, 7, 9, 2, 2, 132, 133, 5, 42, 22, 2, 133, 134, 7, 10, 2, 2, 134, 135, 5, 42, 22, 2, 135, 136, 7, 11, 2, 2, 136, 19, 3, 2, 2, 2, 137, 138, 5, 22, 12, 2, 138, 139, 5, 42, 22, 2, 139, 21, 3, 2, 2, 2, 140, 141, 9, 2, 2, 2, 141, 23, 3, 2, 2, 2, 142, 143, 9, 3, 2, 2, 143, 25, 3, 2, 2, 2, 144, 145, 7, 18, 2, 2, 145, 27, 3, 2, 2, 2, 146, 155, 7, 4, 2, 2, 147, 152, 5, 42, 22, 2, 148, 149, 7, 10, 2, 2, 149, 151, 5, 42, 22, 2, 150, 148, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 156, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 147, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 158, 7, 5, 2, 2, 158, 29, 3, 2, 2, 2, 159, 162, 7, 45, 2, 2, 160, 162, 5, 52, 27, 2, 161, 159, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 164, 7, 19, 2, 2, 164, 165, 5, 42, 22, 2, 165, 31, 3, 2, 2, 2, 166, 167, 7, 20, 2, 2, 167, 168, 7, 9, 2, 2, 168, 169, 5, 42, 22, 2, 169, 170, 7, 11, 2, 2, 170, 33, 3, 2, 2, 2, 171, 172, 9, 4, 2, 2, 172, 35, 3, 2, 2, 2, 173, 174, 9, 5, 2, 2, 174, 37, 3, 2, 2, 2, 175, 176, 7, 30, 2, 2, 176, 39, 3, 2, 2, 2, 177, 186, 7, 21, 2, 2, 178, 183, 5, 42, 22, 2, 179, 180, 7, 10, 2, 2, 180, 182, 5, 42, 22, 2, 181, 179, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 178, 3, 2, 2, 2, 186, 187, 3, 2, 2, 2, 187, 41, 3, 2, 2, 2, 188, 189, 8, 22, 1, 2, 189, 190, 5, 38, 20, 2, 190, 191, 5, 42, 22, 9, 191, 205, 3, 2, 2, 2, 192, 193, 7, 9, 2, 2, 193, 194, 5, 42, 22, 2, 194, 195, 7, 11, 2, 2, 195, 205, 3, 2, 2, 2, 196, 205, 5, 72, 37, 2, 197, 200, 7, 45, 2, 2, 198, 200, 5, 52, 27, 2, 199, 197, 3, 2, 2, 2, 199, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 7, 19, 2, 2, 202, 205, 5, 42, 22, 4, 203, 205, 5, 56, 29, 2, 204, 188, 3, 2, 2, 2, 204, 192, 3, 2, 2, 2, 204, 196, 3, 2, 2, 2, 204, 199, 3, 2, 2, 2, 204, 203, 3, 2, 2, 2, 205, 216, 3, 2, 2, 2, 206, 207, 12, 8, 2, 2, 207, 208, 5, 34, 18, 2, 208, 209, 5, 42, 22, 9, 209, 215, 3, 2, 2, 2, 210, 211, 12, 7, 2, 2, 211, 212, 5, 36, 19, 2, 212, 213, 5, 42, 22, 8, 213, 215, 3, 2, 2, 2, 214, 206, 3, 2, 2, 2, 214, 210, 3, 2, 2, 2, 215, 218, 3, 2, 2, 2, 216, 214, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 43, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 219, 220, 7, 22, 2, 2, 220, 221, 7, 45, 2, 2, 221, 222, 7, 23, 2, 2, 222, 223, 5, 46, 24, 2, 223, 224, 7, 24, 2, 2, 224, 45, 3, 2, 2, 2, 225, 227, 5, 48, 25, 2, 226, 225, 3, 2, 2, 2, 227, 230, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 47, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 231, 232, 5, 30, 16, 2, 232, 233, 7, 25, 2, 2, 233, 49, 3, 2, 2, 2, 234, 237, 7, 45, 2, 2, 235, 237, 5, 52, 27, 2, 236, 234, 3, 2, 2, 2, 236, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 239, 7, 19, 2, 2, 239, 240, 7, 26, 2, 2, 240, 241, 7, 45, 2, 2, 241, 242, 7, 9, 2, 2, 242, 243, 7, 11, 2, 2, 243, 51, 3, 2, 2, 2, 244, 251, 5, 54, 28, 2, 245, 246, 7, 27, 2, 2, 246, 252, 7, 45, 2, 2, 247, 248, 7, 4, 2, 2, 248, 249, 5, 42, 22, 2, 249, 250, 7, 5, 2, 2, 250, 252, 3, 2, 2, 2, 251, 245, 3, 2, 2, 2, 251, 247, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 253, 254, 3, 2, 2, 2, 254, 53, 3, 2, 2, 2, 255, 256, 7, 45, 2, 2, 256, 55, 3, 2, 2, 2, 257, 258, 7, 46, 2, 2, 258, 259, 7, 9, 2, 2, 259, 260, 5, 64, 33, 2, 260, 261, 7, 11, 2, 2, 261, 57, 3, 2, 2, 2, 262, 265, 7, 45, 2, 2, 263, 265, 5, 52, 27, 2, 264, 262, 3, 2, 2, 2, 264, 263, 3, 2, 2, 2, 265, 271, 3, 2, 2, 2, 266, 269, 7, 10, 2, 2, 267, 270, 7, 45, 2, 2, 268, 270, 5, 52, 27, 2, 269, 267, 3, 2, 2, 2, 269, 268, 3, 2, 2, 2, 270, 272, 3, 2, 2, 2, 271, 266, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 271, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 275, 3, 2, 2, 2, 275, 276, 7, 19, 2, 2, 276, 277, 5, 56, 29, 2, 277, 59, 3, 2, 2, 2, 278, 279, 7, 28, 2, 2, 279, 280, 7, 46, 2, 2, 280, 281, 7, 9, 2, 2, 281, 282, 5, 62, 32, 2, 282, 283, 7, 11, 2, 2, 283, 284, 7, 23, 2, 2, 284, 285, 5, 6, 4, 2, 285, 286, 7, 24, 2, 2, 286, 61, 3, 2, 2, 2, 287, 292, 7, 45, 2, 2, 288, 289, 7, 10, 2, 2, 289, 291, 7, 45, 2, 2, 290, 288, 3, 2, 2, 2, 291, 294, 3, 2, 2, 2, 292, 290, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 296, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 295, 287, 3, 2, 2, 2, 295, 296, 3, 2, 2, 2, 296, 63, 3, 2, 2, 2, 297, 302, 5, 42, 22, 2, 298, 299, 7, 10, 2, 2, 299, 301, 5, 42, 22, 2, 300, 298, 3, 2, 2, 2, 301, 304, 3, 2, 2, 2, 302, 300, 3, 2, 2, 2, 302, 303, 3, 2, 2, 2, 303, 306, 3, 2, 2, 2, 304, 302, 3, 2, 2, 2, 305, 297, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 65, 3, 2, 2, 2, 307, 308, 8, 34, 1, 2, 308, 309, 7, 42, 2, 2, 309, 320, 5, 66, 34, 7, 310, 311, 5, 42, 22, 2, 311, 312, 5, 68, 35, 2, 312, 313, 5, 42, 22, 2, 313, 320, 3, 2, 2, 2, 314, 320, 7, 33, 2, 2, 315, 316, 7, 9, 2, 2, 316, 317, 5, 66, 34, 2, 317, 318, 7, 11, 2, 2, 318, 320, 3, 2, 2, 2, 319, 307, 3, 2, 2, 2, 319, 310, 3, 2, 2, 2, 319, 314, 3, 2, 2, 2, 319, 315, 3, 2, 2, 2, 320, 327, 3, 2, 2, 2, 321, 322, 12, 5, 2, 2, 322, 323, 5, 70, 36, 2, 323, 324, 5, 66, 34, 6, 324, 326, 3, 2, 2, 2, 325, 321, 3, 2, 2, 2, 326, 329, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 327, 328, 3, 2, 2, 2, 328, 67, 3, 2, 2, 2, 329, 327, 3, 2, 2, 2, 330, 331, 9, 6, 2, 2, 331, 69, 3, 2, 2, 2, 332, 333, 9, 7, 2, 2, 333, 71, 3, 2, 2, 2, 334, 340, 7, 43, 2, 2, 335, 340, 7, 45, 2, 2, 336, 340, 5, 28, 15, 2, 337, 340, 5, 52, 27, 2, 338, 340, 7, 44, 2, 2, 339, 334, 3, 2, 2, 2, 339, 335, 3, 2, 2, 2, 339, 336, 3, 2, 2, 2, 339, 337, 3, 2, 2, 2, 339, 338, 3, 2, 2, 2, 340, 73, 3, 2, 2, 2, 29, 80, 86, 102, 106, 152, 155, 161, 183, 186, 199, 204, 214, 216, 228, 236, 251, 253, 264, 269, 273, 292, 295, 302, 305, 319, 327, 339] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index e2bc1de..c9dff1e 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -26,47 +26,47 @@ def serializedATN(): buf.write("\21\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25") buf.write("\3\25\3\25\7\25\u00b6\n\25\f\25\16\25\u00b9\13\25\5\25") buf.write("\u00bb\n\25\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3") - buf.write("\26\3\26\3\26\5\26\u00c8\n\26\3\26\3\26\5\26\u00cc\n\26") - buf.write("\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\7\26\u00d6\n") - buf.write("\26\f\26\16\26\u00d9\13\26\3\27\3\27\3\27\3\27\3\27\3") - buf.write("\27\3\30\7\30\u00e2\n\30\f\30\16\30\u00e5\13\30\3\31\3") - buf.write("\31\3\31\3\32\3\32\5\32\u00ec\n\32\3\32\3\32\3\32\3\32") - buf.write("\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\6\33\u00fb") - buf.write("\n\33\r\33\16\33\u00fc\3\34\3\34\3\35\3\35\3\35\3\35\3") - buf.write("\35\3\36\3\36\5\36\u0108\n\36\3\36\3\36\3\36\5\36\u010d") - buf.write("\n\36\7\36\u010f\n\36\f\36\16\36\u0112\13\36\3\36\3\36") - buf.write("\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3 ") - buf.write("\3 \3 \7 \u0123\n \f \16 \u0126\13 \5 \u0128\n \3!\3!") - buf.write("\3!\7!\u012d\n!\f!\16!\u0130\13!\5!\u0132\n!\3\"\3\"\3") - buf.write("\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\5\"\u0140\n\"\3") - buf.write("\"\3\"\3\"\3\"\7\"\u0146\n\"\f\"\16\"\u0149\13\"\3#\3") - buf.write("#\3$\3$\3%\3%\3%\3%\3%\5%\u0154\n%\3%\2\4*B&\2\4\6\b\n") - buf.write("\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<") - buf.write(">@BDFH\2\b\3\2\f\17\3\2\20\21\3\2\37 \3\2\35\36\3\2\"") - buf.write("\'\3\2()\2\u015f\2J\3\2\2\2\4P\3\2\2\2\6T\3\2\2\2\bf\3") - buf.write("\2\2\2\nj\3\2\2\2\fl\3\2\2\2\16r\3\2\2\2\20|\3\2\2\2\22") - buf.write("\u0082\3\2\2\2\24\u0089\3\2\2\2\26\u008c\3\2\2\2\30\u008e") - buf.write("\3\2\2\2\32\u0090\3\2\2\2\34\u0092\3\2\2\2\36\u00a1\3") - buf.write("\2\2\2 \u00a6\3\2\2\2\"\u00ab\3\2\2\2$\u00ad\3\2\2\2&") - buf.write("\u00af\3\2\2\2(\u00b1\3\2\2\2*\u00cb\3\2\2\2,\u00da\3") - buf.write("\2\2\2.\u00e3\3\2\2\2\60\u00e6\3\2\2\2\62\u00eb\3\2\2") - buf.write("\2\64\u00f3\3\2\2\2\66\u00fe\3\2\2\28\u0100\3\2\2\2:\u0107") - buf.write("\3\2\2\2<\u0116\3\2\2\2>\u0127\3\2\2\2@\u0131\3\2\2\2") - buf.write("B\u013f\3\2\2\2D\u014a\3\2\2\2F\u014c\3\2\2\2H\u0153\3") - buf.write("\2\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2MO\5\b\5\2NM\3\2") - buf.write("\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2Q\5\3\2\2\2RP\3\2\2") - buf.write("\2SU\5\b\5\2TS\3\2\2\2UV\3\2\2\2VT\3\2\2\2VW\3\2\2\2W") - buf.write("\7\3\2\2\2Xg\5\36\20\2Yg\5 \21\2Zg\5\n\6\2[g\5\20\t\2") - buf.write("\\g\5\24\13\2]g\5\30\r\2^g\5\22\n\2_g\5\32\16\2`g\5,\27") - buf.write("\2ag\5\62\32\2bg\5<\37\2cg\58\35\2dg\5:\36\2eg\5(\25\2") - buf.write("fX\3\2\2\2fY\3\2\2\2fZ\3\2\2\2f[\3\2\2\2f\\\3\2\2\2f]") - buf.write("\3\2\2\2f^\3\2\2\2f_\3\2\2\2f`\3\2\2\2fa\3\2\2\2fb\3\2") - buf.write("\2\2fc\3\2\2\2fd\3\2\2\2fe\3\2\2\2g\t\3\2\2\2hk\5\f\7") - buf.write("\2ik\5\16\b\2jh\3\2\2\2ji\3\2\2\2k\13\3\2\2\2lm\7\3\2") - buf.write("\2mn\5B\"\2no\7\4\2\2op\5\6\4\2pq\7\5\2\2q\r\3\2\2\2r") - buf.write("s\7\3\2\2st\5B\"\2tu\7\4\2\2uv\5\6\4\2vw\7\5\2\2wx\7\6") - buf.write("\2\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2{\17\3\2\2\2|}\7\7\2") - buf.write("\2}~\5H%\2~\177\7\4\2\2\177\u0080\5\6\4\2\u0080\u0081") + buf.write("\26\3\26\3\26\5\26\u00c8\n\26\3\26\3\26\3\26\5\26\u00cd") + buf.write("\n\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\7\26\u00d7") + buf.write("\n\26\f\26\16\26\u00da\13\26\3\27\3\27\3\27\3\27\3\27") + buf.write("\3\27\3\30\7\30\u00e3\n\30\f\30\16\30\u00e6\13\30\3\31") + buf.write("\3\31\3\31\3\32\3\32\5\32\u00ed\n\32\3\32\3\32\3\32\3") + buf.write("\32\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\6\33") + buf.write("\u00fc\n\33\r\33\16\33\u00fd\3\34\3\34\3\35\3\35\3\35") + buf.write("\3\35\3\35\3\36\3\36\5\36\u0109\n\36\3\36\3\36\3\36\5") + buf.write("\36\u010e\n\36\6\36\u0110\n\36\r\36\16\36\u0111\3\36\3") + buf.write("\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37") + buf.write("\3 \3 \3 \7 \u0123\n \f \16 \u0126\13 \5 \u0128\n \3!") + buf.write("\3!\3!\7!\u012d\n!\f!\16!\u0130\13!\5!\u0132\n!\3\"\3") + buf.write("\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\5\"\u0140\n") + buf.write("\"\3\"\3\"\3\"\3\"\7\"\u0146\n\"\f\"\16\"\u0149\13\"\3") + buf.write("#\3#\3$\3$\3%\3%\3%\3%\3%\5%\u0154\n%\3%\2\4*B&\2\4\6") + buf.write("\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\66") + buf.write("8:<>@BDFH\2\b\3\2\f\17\3\2\20\21\3\2\37 \3\2\35\36\3\2") + buf.write("\"\'\3\2()\2\u0160\2J\3\2\2\2\4P\3\2\2\2\6T\3\2\2\2\b") + buf.write("f\3\2\2\2\nj\3\2\2\2\fl\3\2\2\2\16r\3\2\2\2\20|\3\2\2") + buf.write("\2\22\u0082\3\2\2\2\24\u0089\3\2\2\2\26\u008c\3\2\2\2") + buf.write("\30\u008e\3\2\2\2\32\u0090\3\2\2\2\34\u0092\3\2\2\2\36") + buf.write("\u00a1\3\2\2\2 \u00a6\3\2\2\2\"\u00ab\3\2\2\2$\u00ad\3") + buf.write("\2\2\2&\u00af\3\2\2\2(\u00b1\3\2\2\2*\u00cc\3\2\2\2,\u00db") + buf.write("\3\2\2\2.\u00e4\3\2\2\2\60\u00e7\3\2\2\2\62\u00ec\3\2") + buf.write("\2\2\64\u00f4\3\2\2\2\66\u00ff\3\2\2\28\u0101\3\2\2\2") + buf.write(":\u0108\3\2\2\2<\u0116\3\2\2\2>\u0127\3\2\2\2@\u0131\3") + buf.write("\2\2\2B\u013f\3\2\2\2D\u014a\3\2\2\2F\u014c\3\2\2\2H\u0153") + buf.write("\3\2\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2MO\5\b\5\2NM\3") + buf.write("\2\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2Q\5\3\2\2\2RP\3\2") + buf.write("\2\2SU\5\b\5\2TS\3\2\2\2UV\3\2\2\2VT\3\2\2\2VW\3\2\2\2") + buf.write("W\7\3\2\2\2Xg\5:\36\2Yg\5\36\20\2Zg\5 \21\2[g\5\n\6\2") + buf.write("\\g\5\20\t\2]g\5\24\13\2^g\5\30\r\2_g\5\22\n\2`g\5\32") + buf.write("\16\2ag\5,\27\2bg\5\62\32\2cg\5<\37\2dg\58\35\2eg\5(\25") + buf.write("\2fX\3\2\2\2fY\3\2\2\2fZ\3\2\2\2f[\3\2\2\2f\\\3\2\2\2") + buf.write("f]\3\2\2\2f^\3\2\2\2f_\3\2\2\2f`\3\2\2\2fa\3\2\2\2fb\3") + buf.write("\2\2\2fc\3\2\2\2fd\3\2\2\2fe\3\2\2\2g\t\3\2\2\2hk\5\f") + buf.write("\7\2ik\5\16\b\2jh\3\2\2\2ji\3\2\2\2k\13\3\2\2\2lm\7\3") + buf.write("\2\2mn\5B\"\2no\7\4\2\2op\5\6\4\2pq\7\5\2\2q\r\3\2\2\2") + buf.write("rs\7\3\2\2st\5B\"\2tu\7\4\2\2uv\5\6\4\2vw\7\5\2\2wx\7") + buf.write("\6\2\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2{\17\3\2\2\2|}\7\7") + buf.write("\2\2}~\5H%\2~\177\7\4\2\2\177\u0080\5\6\4\2\u0080\u0081") buf.write("\7\5\2\2\u0081\21\3\2\2\2\u0082\u0083\7\b\2\2\u0083\u0084") buf.write("\7\t\2\2\u0084\u0085\5*\26\2\u0085\u0086\7\n\2\2\u0086") buf.write("\u0087\5*\26\2\u0087\u0088\7\13\2\2\u0088\23\3\2\2\2\u0089") @@ -90,73 +90,73 @@ def serializedATN(): buf.write("\u00b7\u00b5\3\2\2\2\u00b7\u00b8\3\2\2\2\u00b8\u00bb\3") buf.write("\2\2\2\u00b9\u00b7\3\2\2\2\u00ba\u00b2\3\2\2\2\u00ba\u00bb") buf.write("\3\2\2\2\u00bb)\3\2\2\2\u00bc\u00bd\b\26\1\2\u00bd\u00be") - buf.write("\5&\24\2\u00be\u00bf\5*\26\b\u00bf\u00cc\3\2\2\2\u00c0") + buf.write("\5&\24\2\u00be\u00bf\5*\26\t\u00bf\u00cd\3\2\2\2\u00c0") buf.write("\u00c1\7\t\2\2\u00c1\u00c2\5*\26\2\u00c2\u00c3\7\13\2") - buf.write("\2\u00c3\u00cc\3\2\2\2\u00c4\u00cc\5H%\2\u00c5\u00c8\7") + buf.write("\2\u00c3\u00cd\3\2\2\2\u00c4\u00cd\5H%\2\u00c5\u00c8\7") buf.write("-\2\2\u00c6\u00c8\5\64\33\2\u00c7\u00c5\3\2\2\2\u00c7") buf.write("\u00c6\3\2\2\2\u00c8\u00c9\3\2\2\2\u00c9\u00ca\7\23\2") - buf.write("\2\u00ca\u00cc\5*\26\3\u00cb\u00bc\3\2\2\2\u00cb\u00c0") - buf.write("\3\2\2\2\u00cb\u00c4\3\2\2\2\u00cb\u00c7\3\2\2\2\u00cc") - buf.write("\u00d7\3\2\2\2\u00cd\u00ce\f\7\2\2\u00ce\u00cf\5\"\22") - buf.write("\2\u00cf\u00d0\5*\26\b\u00d0\u00d6\3\2\2\2\u00d1\u00d2") - buf.write("\f\6\2\2\u00d2\u00d3\5$\23\2\u00d3\u00d4\5*\26\7\u00d4") - buf.write("\u00d6\3\2\2\2\u00d5\u00cd\3\2\2\2\u00d5\u00d1\3\2\2\2") - buf.write("\u00d6\u00d9\3\2\2\2\u00d7\u00d5\3\2\2\2\u00d7\u00d8\3") - buf.write("\2\2\2\u00d8+\3\2\2\2\u00d9\u00d7\3\2\2\2\u00da\u00db") - buf.write("\7\26\2\2\u00db\u00dc\7-\2\2\u00dc\u00dd\7\27\2\2\u00dd") - buf.write("\u00de\5.\30\2\u00de\u00df\7\30\2\2\u00df-\3\2\2\2\u00e0") - buf.write("\u00e2\5\60\31\2\u00e1\u00e0\3\2\2\2\u00e2\u00e5\3\2\2") - buf.write("\2\u00e3\u00e1\3\2\2\2\u00e3\u00e4\3\2\2\2\u00e4/\3\2") - buf.write("\2\2\u00e5\u00e3\3\2\2\2\u00e6\u00e7\5\36\20\2\u00e7\u00e8") - buf.write("\7\31\2\2\u00e8\61\3\2\2\2\u00e9\u00ec\7-\2\2\u00ea\u00ec") - buf.write("\5\64\33\2\u00eb\u00e9\3\2\2\2\u00eb\u00ea\3\2\2\2\u00ec") - buf.write("\u00ed\3\2\2\2\u00ed\u00ee\7\23\2\2\u00ee\u00ef\7\32\2") - buf.write("\2\u00ef\u00f0\7-\2\2\u00f0\u00f1\7\t\2\2\u00f1\u00f2") - buf.write("\7\13\2\2\u00f2\63\3\2\2\2\u00f3\u00fa\5\66\34\2\u00f4") - buf.write("\u00f5\7\33\2\2\u00f5\u00fb\7-\2\2\u00f6\u00f7\7\4\2\2") - buf.write("\u00f7\u00f8\5*\26\2\u00f8\u00f9\7\5\2\2\u00f9\u00fb\3") - buf.write("\2\2\2\u00fa\u00f4\3\2\2\2\u00fa\u00f6\3\2\2\2\u00fb\u00fc") - buf.write("\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd") - buf.write("\65\3\2\2\2\u00fe\u00ff\7-\2\2\u00ff\67\3\2\2\2\u0100") - buf.write("\u0101\7.\2\2\u0101\u0102\7\t\2\2\u0102\u0103\5@!\2\u0103") - buf.write("\u0104\7\13\2\2\u01049\3\2\2\2\u0105\u0108\7-\2\2\u0106") - buf.write("\u0108\5\64\33\2\u0107\u0105\3\2\2\2\u0107\u0106\3\2\2") - buf.write("\2\u0108\u0110\3\2\2\2\u0109\u010c\7\n\2\2\u010a\u010d") - buf.write("\7-\2\2\u010b\u010d\5\64\33\2\u010c\u010a\3\2\2\2\u010c") - buf.write("\u010b\3\2\2\2\u010d\u010f\3\2\2\2\u010e\u0109\3\2\2\2") - buf.write("\u010f\u0112\3\2\2\2\u0110\u010e\3\2\2\2\u0110\u0111\3") - buf.write("\2\2\2\u0111\u0113\3\2\2\2\u0112\u0110\3\2\2\2\u0113\u0114") - buf.write("\7\23\2\2\u0114\u0115\58\35\2\u0115;\3\2\2\2\u0116\u0117") - buf.write("\7\34\2\2\u0117\u0118\7.\2\2\u0118\u0119\7\t\2\2\u0119") - buf.write("\u011a\5> \2\u011a\u011b\7\13\2\2\u011b\u011c\7\27\2\2") - buf.write("\u011c\u011d\5\6\4\2\u011d\u011e\7\30\2\2\u011e=\3\2\2") - buf.write("\2\u011f\u0124\7-\2\2\u0120\u0121\7\n\2\2\u0121\u0123") - buf.write("\7-\2\2\u0122\u0120\3\2\2\2\u0123\u0126\3\2\2\2\u0124") - buf.write("\u0122\3\2\2\2\u0124\u0125\3\2\2\2\u0125\u0128\3\2\2\2") - buf.write("\u0126\u0124\3\2\2\2\u0127\u011f\3\2\2\2\u0127\u0128\3") - buf.write("\2\2\2\u0128?\3\2\2\2\u0129\u012e\5*\26\2\u012a\u012b") - buf.write("\7\n\2\2\u012b\u012d\5*\26\2\u012c\u012a\3\2\2\2\u012d") - buf.write("\u0130\3\2\2\2\u012e\u012c\3\2\2\2\u012e\u012f\3\2\2\2") - buf.write("\u012f\u0132\3\2\2\2\u0130\u012e\3\2\2\2\u0131\u0129\3") - buf.write("\2\2\2\u0131\u0132\3\2\2\2\u0132A\3\2\2\2\u0133\u0134") - buf.write("\b\"\1\2\u0134\u0135\7*\2\2\u0135\u0140\5B\"\7\u0136\u0137") - buf.write("\5*\26\2\u0137\u0138\5D#\2\u0138\u0139\5*\26\2\u0139\u0140") - buf.write("\3\2\2\2\u013a\u0140\7!\2\2\u013b\u013c\7\t\2\2\u013c") - buf.write("\u013d\5B\"\2\u013d\u013e\7\13\2\2\u013e\u0140\3\2\2\2") - buf.write("\u013f\u0133\3\2\2\2\u013f\u0136\3\2\2\2\u013f\u013a\3") - buf.write("\2\2\2\u013f\u013b\3\2\2\2\u0140\u0147\3\2\2\2\u0141\u0142") - buf.write("\f\5\2\2\u0142\u0143\5F$\2\u0143\u0144\5B\"\6\u0144\u0146") - buf.write("\3\2\2\2\u0145\u0141\3\2\2\2\u0146\u0149\3\2\2\2\u0147") - buf.write("\u0145\3\2\2\2\u0147\u0148\3\2\2\2\u0148C\3\2\2\2\u0149") - buf.write("\u0147\3\2\2\2\u014a\u014b\t\6\2\2\u014bE\3\2\2\2\u014c") - buf.write("\u014d\t\7\2\2\u014dG\3\2\2\2\u014e\u0154\7+\2\2\u014f") - buf.write("\u0154\7-\2\2\u0150\u0154\5\34\17\2\u0151\u0154\5\64\33") - buf.write("\2\u0152\u0154\7,\2\2\u0153\u014e\3\2\2\2\u0153\u014f") - buf.write("\3\2\2\2\u0153\u0150\3\2\2\2\u0153\u0151\3\2\2\2\u0153") - buf.write("\u0152\3\2\2\2\u0154I\3\2\2\2\35PVfj\u0098\u009b\u00a1") - buf.write("\u00b7\u00ba\u00c7\u00cb\u00d5\u00d7\u00e3\u00eb\u00fa") - buf.write("\u00fc\u0107\u010c\u0110\u0124\u0127\u012e\u0131\u013f") - buf.write("\u0147\u0153") + buf.write("\2\u00ca\u00cd\5*\26\4\u00cb\u00cd\58\35\2\u00cc\u00bc") + buf.write("\3\2\2\2\u00cc\u00c0\3\2\2\2\u00cc\u00c4\3\2\2\2\u00cc") + buf.write("\u00c7\3\2\2\2\u00cc\u00cb\3\2\2\2\u00cd\u00d8\3\2\2\2") + buf.write("\u00ce\u00cf\f\b\2\2\u00cf\u00d0\5\"\22\2\u00d0\u00d1") + buf.write("\5*\26\t\u00d1\u00d7\3\2\2\2\u00d2\u00d3\f\7\2\2\u00d3") + buf.write("\u00d4\5$\23\2\u00d4\u00d5\5*\26\b\u00d5\u00d7\3\2\2\2") + buf.write("\u00d6\u00ce\3\2\2\2\u00d6\u00d2\3\2\2\2\u00d7\u00da\3") + buf.write("\2\2\2\u00d8\u00d6\3\2\2\2\u00d8\u00d9\3\2\2\2\u00d9+") + buf.write("\3\2\2\2\u00da\u00d8\3\2\2\2\u00db\u00dc\7\26\2\2\u00dc") + buf.write("\u00dd\7-\2\2\u00dd\u00de\7\27\2\2\u00de\u00df\5.\30\2") + buf.write("\u00df\u00e0\7\30\2\2\u00e0-\3\2\2\2\u00e1\u00e3\5\60") + buf.write("\31\2\u00e2\u00e1\3\2\2\2\u00e3\u00e6\3\2\2\2\u00e4\u00e2") + buf.write("\3\2\2\2\u00e4\u00e5\3\2\2\2\u00e5/\3\2\2\2\u00e6\u00e4") + buf.write("\3\2\2\2\u00e7\u00e8\5\36\20\2\u00e8\u00e9\7\31\2\2\u00e9") + buf.write("\61\3\2\2\2\u00ea\u00ed\7-\2\2\u00eb\u00ed\5\64\33\2\u00ec") + buf.write("\u00ea\3\2\2\2\u00ec\u00eb\3\2\2\2\u00ed\u00ee\3\2\2\2") + buf.write("\u00ee\u00ef\7\23\2\2\u00ef\u00f0\7\32\2\2\u00f0\u00f1") + buf.write("\7-\2\2\u00f1\u00f2\7\t\2\2\u00f2\u00f3\7\13\2\2\u00f3") + buf.write("\63\3\2\2\2\u00f4\u00fb\5\66\34\2\u00f5\u00f6\7\33\2\2") + buf.write("\u00f6\u00fc\7-\2\2\u00f7\u00f8\7\4\2\2\u00f8\u00f9\5") + buf.write("*\26\2\u00f9\u00fa\7\5\2\2\u00fa\u00fc\3\2\2\2\u00fb\u00f5") + buf.write("\3\2\2\2\u00fb\u00f7\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd") + buf.write("\u00fb\3\2\2\2\u00fd\u00fe\3\2\2\2\u00fe\65\3\2\2\2\u00ff") + buf.write("\u0100\7-\2\2\u0100\67\3\2\2\2\u0101\u0102\7.\2\2\u0102") + buf.write("\u0103\7\t\2\2\u0103\u0104\5@!\2\u0104\u0105\7\13\2\2") + buf.write("\u01059\3\2\2\2\u0106\u0109\7-\2\2\u0107\u0109\5\64\33") + buf.write("\2\u0108\u0106\3\2\2\2\u0108\u0107\3\2\2\2\u0109\u010f") + buf.write("\3\2\2\2\u010a\u010d\7\n\2\2\u010b\u010e\7-\2\2\u010c") + buf.write("\u010e\5\64\33\2\u010d\u010b\3\2\2\2\u010d\u010c\3\2\2") + buf.write("\2\u010e\u0110\3\2\2\2\u010f\u010a\3\2\2\2\u0110\u0111") + buf.write("\3\2\2\2\u0111\u010f\3\2\2\2\u0111\u0112\3\2\2\2\u0112") + buf.write("\u0113\3\2\2\2\u0113\u0114\7\23\2\2\u0114\u0115\58\35") + buf.write("\2\u0115;\3\2\2\2\u0116\u0117\7\34\2\2\u0117\u0118\7.") + buf.write("\2\2\u0118\u0119\7\t\2\2\u0119\u011a\5> \2\u011a\u011b") + buf.write("\7\13\2\2\u011b\u011c\7\27\2\2\u011c\u011d\5\6\4\2\u011d") + buf.write("\u011e\7\30\2\2\u011e=\3\2\2\2\u011f\u0124\7-\2\2\u0120") + buf.write("\u0121\7\n\2\2\u0121\u0123\7-\2\2\u0122\u0120\3\2\2\2") + buf.write("\u0123\u0126\3\2\2\2\u0124\u0122\3\2\2\2\u0124\u0125\3") + buf.write("\2\2\2\u0125\u0128\3\2\2\2\u0126\u0124\3\2\2\2\u0127\u011f") + buf.write("\3\2\2\2\u0127\u0128\3\2\2\2\u0128?\3\2\2\2\u0129\u012e") + buf.write("\5*\26\2\u012a\u012b\7\n\2\2\u012b\u012d\5*\26\2\u012c") + buf.write("\u012a\3\2\2\2\u012d\u0130\3\2\2\2\u012e\u012c\3\2\2\2") + buf.write("\u012e\u012f\3\2\2\2\u012f\u0132\3\2\2\2\u0130\u012e\3") + buf.write("\2\2\2\u0131\u0129\3\2\2\2\u0131\u0132\3\2\2\2\u0132A") + buf.write("\3\2\2\2\u0133\u0134\b\"\1\2\u0134\u0135\7*\2\2\u0135") + buf.write("\u0140\5B\"\7\u0136\u0137\5*\26\2\u0137\u0138\5D#\2\u0138") + buf.write("\u0139\5*\26\2\u0139\u0140\3\2\2\2\u013a\u0140\7!\2\2") + buf.write("\u013b\u013c\7\t\2\2\u013c\u013d\5B\"\2\u013d\u013e\7") + buf.write("\13\2\2\u013e\u0140\3\2\2\2\u013f\u0133\3\2\2\2\u013f") + buf.write("\u0136\3\2\2\2\u013f\u013a\3\2\2\2\u013f\u013b\3\2\2\2") + buf.write("\u0140\u0147\3\2\2\2\u0141\u0142\f\5\2\2\u0142\u0143\5") + buf.write("F$\2\u0143\u0144\5B\"\6\u0144\u0146\3\2\2\2\u0145\u0141") + buf.write("\3\2\2\2\u0146\u0149\3\2\2\2\u0147\u0145\3\2\2\2\u0147") + buf.write("\u0148\3\2\2\2\u0148C\3\2\2\2\u0149\u0147\3\2\2\2\u014a") + buf.write("\u014b\t\6\2\2\u014bE\3\2\2\2\u014c\u014d\t\7\2\2\u014d") + buf.write("G\3\2\2\2\u014e\u0154\7+\2\2\u014f\u0154\7-\2\2\u0150") + buf.write("\u0154\5\34\17\2\u0151\u0154\5\64\33\2\u0152\u0154\7,") + buf.write("\2\2\u0153\u014e\3\2\2\2\u0153\u014f\3\2\2\2\u0153\u0150") + buf.write("\3\2\2\2\u0153\u0151\3\2\2\2\u0153\u0152\3\2\2\2\u0154") + buf.write("I\3\2\2\2\35PVfj\u0098\u009b\u00a1\u00b7\u00ba\u00c7\u00cc") + buf.write("\u00d6\u00d8\u00e4\u00ec\u00fb\u00fd\u0108\u010d\u0111") + buf.write("\u0124\u0127\u012e\u0131\u013f\u0147\u0153") return buf.getvalue() @@ -447,6 +447,10 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + def functionCallWithReturnValues(self): + return self.getTypedRuleContext(tlangParser.FunctionCallWithReturnValuesContext,0) + + def assignment(self): return self.getTypedRuleContext(tlangParser.AssignmentContext,0) @@ -495,10 +499,6 @@ def functionCall(self): return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) - def functionCallWithReturnValues(self): - return self.getTypedRuleContext(tlangParser.FunctionCallWithReturnValuesContext,0) - - def returnStatement(self): return self.getTypedRuleContext(tlangParser.ReturnStatementContext,0) @@ -526,79 +526,79 @@ def instruction(self): if la_ == 1: self.enterOuterAlt(localctx, 1) self.state = 86 - self.assignment() + self.functionCallWithReturnValues() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) self.state = 87 - self.printStatement() + self.assignment() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) self.state = 88 - self.conditional() + self.printStatement() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) self.state = 89 - self.loop() + self.conditional() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) self.state = 90 - self.moveCommand() + self.loop() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) self.state = 91 - self.penCommand() + self.moveCommand() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) self.state = 92 - self.gotoCommand() + self.penCommand() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) self.state = 93 - self.pauseCommand() + self.gotoCommand() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) self.state = 94 - self.classDeclaration() + self.pauseCommand() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) self.state = 95 - self.objectInstantiation() + self.classDeclaration() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) self.state = 96 - self.functionDeclaration() + self.objectInstantiation() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) self.state = 97 - self.functionCall() + self.functionDeclaration() pass elif la_ == 13: self.enterOuterAlt(localctx, 13) self.state = 98 - self.functionCallWithReturnValues() + self.functionCall() pass elif la_ == 14: @@ -1091,7 +1091,7 @@ def array(self): self.state = 153 self._errHandler.sync(self) _la = self._input.LA(1) - if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR))) != 0): + if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): self.state = 145 self.expression(0) self.state = 150 @@ -1496,6 +1496,23 @@ def accept(self, visitor:ParseTreeVisitor): return visitor.visitChildren(self) + class FunctionCallExprContext(ExpressionContext): + + def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext + super().__init__(parser) + self.copyFrom(ctx) + + def functionCall(self): + return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) + + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitFunctionCallExpr" ): + return visitor.visitFunctionCallExpr(self) + else: + return visitor.visitChildren(self) + + class MulExprContext(ExpressionContext): def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext @@ -1568,7 +1585,7 @@ def expression(self, _p:int=0): self.enterRecursionRule(localctx, 40, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 201 + self.state = 202 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,10,self._ctx) if la_ == 1: @@ -1579,7 +1596,7 @@ def expression(self, _p:int=0): self.state = 187 self.unaryArithOp() self.state = 188 - self.expression(6) + self.expression(7) pass elif la_ == 2: @@ -1623,12 +1640,20 @@ def expression(self, _p:int=0): self.state = 199 self.match(tlangParser.T__16) self.state = 200 - self.expression(1) + self.expression(2) + pass + + elif la_ == 5: + localctx = tlangParser.FunctionCallExprContext(self, localctx) + self._ctx = localctx + _prevctx = localctx + self.state = 201 + self.functionCall() pass self._ctx.stop = self._input.LT(-1) - self.state = 213 + self.state = 214 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,12,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -1636,37 +1661,37 @@ def expression(self, _p:int=0): if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 211 + self.state = 212 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,11,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 203 - if not self.precpred(self._ctx, 5): - from antlr4.error.Errors import FailedPredicateException - raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") self.state = 204 - self.multiplicative() + if not self.precpred(self._ctx, 6): + from antlr4.error.Errors import FailedPredicateException + raise FailedPredicateException(self, "self.precpred(self._ctx, 6)") self.state = 205 - self.expression(6) + self.multiplicative() + self.state = 206 + self.expression(7) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 207 - if not self.precpred(self._ctx, 4): - from antlr4.error.Errors import FailedPredicateException - raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") self.state = 208 - self.additive() + if not self.precpred(self._ctx, 5): + from antlr4.error.Errors import FailedPredicateException + raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") self.state = 209 - self.expression(5) + self.additive() + self.state = 210 + self.expression(6) pass - self.state = 215 + self.state = 216 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,12,self._ctx) @@ -1710,15 +1735,15 @@ def classDeclaration(self): self.enterRule(localctx, 42, self.RULE_classDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 216 - self.match(tlangParser.T__19) self.state = 217 - self.match(tlangParser.VAR) + self.match(tlangParser.T__19) self.state = 218 - self.match(tlangParser.T__20) + self.match(tlangParser.VAR) self.state = 219 - self.classBody() + self.match(tlangParser.T__20) self.state = 220 + self.classBody() + self.state = 221 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -1761,13 +1786,13 @@ def classBody(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 225 + self.state = 226 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 222 + self.state = 223 self.classAttributeDeclaration() - self.state = 227 + self.state = 228 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1808,9 +1833,9 @@ def classAttributeDeclaration(self): self.enterRule(localctx, 46, self.RULE_classAttributeDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 228 - self.assignment() self.state = 229 + self.assignment() + self.state = 230 self.match(tlangParser.T__22) except RecognitionException as re: localctx.exception = re @@ -1855,29 +1880,29 @@ def objectInstantiation(self): self.enterRule(localctx, 48, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 233 + self.state = 234 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,14,self._ctx) if la_ == 1: - self.state = 231 + self.state = 232 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 232 + self.state = 233 self.objectOrArrayAccess() pass - self.state = 235 - self.match(tlangParser.T__16) self.state = 236 - self.match(tlangParser.T__23) + self.match(tlangParser.T__16) self.state = 237 - self.match(tlangParser.VAR) + self.match(tlangParser.T__23) self.state = 238 - self.match(tlangParser.T__6) + self.match(tlangParser.VAR) self.state = 239 + self.match(tlangParser.T__6) + self.state = 240 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1929,28 +1954,28 @@ def objectOrArrayAccess(self): self.enterRule(localctx, 50, self.RULE_objectOrArrayAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 241 + self.state = 242 self.baseAccess() - self.state = 248 + self.state = 249 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 248 + self.state = 249 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__24]: - self.state = 242 - self.match(tlangParser.T__24) self.state = 243 + self.match(tlangParser.T__24) + self.state = 244 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 244 - self.match(tlangParser.T__1) self.state = 245 - self.expression(0) + self.match(tlangParser.T__1) self.state = 246 + self.expression(0) + self.state = 247 self.match(tlangParser.T__2) pass else: @@ -1959,7 +1984,7 @@ def objectOrArrayAccess(self): else: raise NoViableAltException(self) - self.state = 250 + self.state = 251 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,16,self._ctx) @@ -1999,7 +2024,7 @@ def baseAccess(self): self.enterRule(localctx, 52, self.RULE_baseAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 252 + self.state = 253 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -2041,13 +2066,13 @@ def functionCall(self): self.enterRule(localctx, 54, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 254 - self.match(tlangParser.NAME) self.state = 255 - self.match(tlangParser.T__6) + self.match(tlangParser.NAME) self.state = 256 - self.arguments() + self.match(tlangParser.T__6) self.state = 257 + self.arguments() + self.state = 258 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2100,43 +2125,45 @@ def functionCallWithReturnValues(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 261 + self.state = 262 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,17,self._ctx) if la_ == 1: - self.state = 259 + self.state = 260 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 260 + self.state = 261 self.objectOrArrayAccess() pass - self.state = 270 + self.state = 269 self._errHandler.sync(self) _la = self._input.LA(1) - while _la==tlangParser.T__7: - self.state = 263 + while True: + self.state = 264 self.match(tlangParser.T__7) - self.state = 266 + self.state = 267 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,18,self._ctx) if la_ == 1: - self.state = 264 + self.state = 265 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 265 + self.state = 266 self.objectOrArrayAccess() pass - self.state = 272 + self.state = 271 self._errHandler.sync(self) _la = self._input.LA(1) + if not (_la==tlangParser.T__7): + break self.state = 273 self.match(tlangParser.T__16) @@ -2306,7 +2333,7 @@ def arguments(self): self.state = 303 self._errHandler.sync(self) _la = self._input.LA(1) - if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR))) != 0): + if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): self.state = 295 self.expression(0) self.state = 300 @@ -2655,11 +2682,11 @@ def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): def expression_sempred(self, localctx:ExpressionContext, predIndex:int): if predIndex == 0: - return self.precpred(self._ctx, 5) + return self.precpred(self._ctx, 6) if predIndex == 1: - return self.precpred(self._ctx, 4) + return self.precpred(self._ctx, 5) def condition_sempred(self, localctx:ConditionContext, predIndex:int): diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index 3a3448f..f3309e8 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -124,6 +124,11 @@ def visitAddExpr(self, ctx:tlangParser.AddExprContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#functionCallExpr. + def visitFunctionCallExpr(self, ctx:tlangParser.FunctionCallExprContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#mulExpr. def visitMulExpr(self, ctx:tlangParser.MulExprContext): return self.visitChildren(ctx) From 9cf55e9c2c6087f86be30962c37694414563287c Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Fri, 21 Feb 2025 02:24:10 +0530 Subject: [PATCH 11/47] all working --- ChironCore/ChironAST/builder.py | 38 +++++++++++++++++++++------------ ChironCore/example/example1.tl | 4 +++- ChironCore/example/exampleFC.tl | 8 +++---- ChironCore/example/issues.txt | 9 +++----- 4 files changed, 34 insertions(+), 25 deletions(-) diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 7ebb875..5ff24c5 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -16,6 +16,8 @@ class astGenPass(tlangVisitor): def __init__(self): self.repeatInstrCount = 0 # keeps count for no of 'repeat' instructions self.stmtList = [] + self.subStmtList = [] + self.virtualRegCount = 0 def getLval(self, ctx): @@ -34,7 +36,9 @@ def visitStart(self, ctx: tlangParser.StartContext): def visitInstruction_list(self, ctx: tlangParser.Instruction_listContext): instrList = [] for instr in ctx.instruction(): - self.stmtList.extend(self.visit(instr)) + self.stmtList.extend(self.subStmtList + self.visit(instr)) + self.subStmtList = [] + self.virtualRegCount = 0 return [] @@ -43,7 +47,9 @@ def visitStrict_ilist(self, ctx: tlangParser.Strict_ilistContext): instrList = [] for instr in ctx.instruction(): visvalue = self.visit(instr) - instrList.extend(visvalue) + instrList.extend(self.subStmtList + visvalue) + self.subStmtList = [] + self.virtualRegCount = 0 return instrList @@ -77,13 +83,6 @@ def visitAssignment(self, ctx: tlangParser.AssignmentContext): # print(ctx.VAR().getText(),ctx.expression().getText()) lval = self.getLval(ctx) rval = self.visit(ctx.expression()) - # print(rval) - if isinstance(rval, list): - print(rval[-1][0]) - rvaln = rval[-1][0].lvar # Get the last assigned variable as rval - return rval + [(ChironAST.AssignmentCommand(lval, rvaln), 1)] - - # Otherwise, just return a normal assignment return [(ChironAST.AssignmentCommand(lval, rval), 1)] def visitObjectOrArrayAccess(self, ctx: tlangParser.ObjectOrArrayAccessContext): @@ -158,14 +157,25 @@ def visitValue(self, ctx: tlangParser.ValueContext): print("entering heaven") return self.visitObjectOrArrayAccess(ctx.objectOrArrayAccess()) + def visitFunctionCallExpr(self, ctx: tlangParser.FunctionCallExprContext): + functionCallCtx = ctx.functionCall() + functionName = functionCallCtx.NAME().getText() + functionArgs = [self.visit(arg) for arg in functionCallCtx.arguments( + ).expression()] if functionCallCtx.arguments() is not None else None + returnLocation = ChironAST.Var(":__reg_" + str(self.virtualRegCount)) + self.virtualRegCount += 1 + currStmtList = [(ChironAST.FunctionCallCommand(functionName, functionArgs), 1)] + [(ChironAST.ReadReturnCommand([returnLocation]), 1)] + self.subStmtList.extend(currStmtList) + return returnLocation + def visitAssignExpr(self, ctx: tlangParser.AssignExprContext): print("Assignment Expr") - - list = self.visitAssignment(ctx) - self.stmtList.extend(list) - - return list[-1][0].lvar + lval = self.getLval(ctx) + rval = self.visit(ctx.expression()) + currentStmtList = [(ChironAST.AssignmentCommand(lval, rval), 1)] + self.subStmtList.extend(currentStmtList) + return lval # return "("+ ChironAST.AssignmentCommand(lval, rval) + ")" # return # Calls visitAssignment diff --git a/ChironCore/example/example1.tl b/ChironCore/example/example1.tl index 7d15f80..42c907e 100644 --- a/ChironCore/example/example1.tl +++ b/ChironCore/example/example1.tl @@ -1,5 +1,7 @@ pendown - +:y = 2 +:z = 4 +:p = 10 repeat 3 [ if (:x > :y) [ diff --git a/ChironCore/example/exampleFC.tl b/ChironCore/example/exampleFC.tl index da1b1c7..4933053 100644 --- a/ChironCore/example/exampleFC.tl +++ b/ChironCore/example/exampleFC.tl @@ -43,7 +43,7 @@ def drawCircle() left 45 ] penup - return + return :vara, :varb } def factorial(:n) @@ -51,9 +51,9 @@ def factorial(:n) if :n == 1 [ return 1 ] - :ret = factorial(:n - 1) - return :ret * :n + return :n * factorial(:n - 1) } drawRectangle(50, 50) -drawCircle() +:a, :b = drawCircle() +print(factorial(6)) diff --git a/ChironCore/example/issues.txt b/ChironCore/example/issues.txt index f2fce70..2d4efdc 100644 --- a/ChironCore/example/issues.txt +++ b/ChironCore/example/issues.txt @@ -1,6 +1,3 @@ -:n -1 -Syntax Error -Line : 54, Column : 24 -Report: (extraneous input '-1' expecting ')') - - +1. loop should have expression rather than just value +2. condition should be true for non zero values and not just true/false +3. \ No newline at end of file From f123b4b2cc2976a14080a4d2e9a173a2f720b4be Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Mon, 3 Mar 2025 15:37:13 +0530 Subject: [PATCH 12/47] object nesting --- ChironCore/ChironAST/ChironAST.py | 6 +- ChironCore/ChironAST/builder.py | 16 +- ChironCore/example/issues.txt | 4 +- ChironCore/example/kachuapur2.tl | 2 +- ChironCore/example/kachuapur3.tl | 18 +- ChironCore/example/rangoli.tl | 10 +- ChironCore/interpreter.py | 40 +- ChironCore/turtparse/tlang.g4 | 7 +- ChironCore/turtparse/tlang.interp | 6 +- ChironCore/turtparse/tlang.tokens | 26 +- ChironCore/turtparse/tlangLexer.interp | 8 +- ChironCore/turtparse/tlangLexer.py | 230 +++++------ ChironCore/turtparse/tlangLexer.tokens | 26 +- ChironCore/turtparse/tlangParser.py | 509 ++++++++++++++----------- 14 files changed, 496 insertions(+), 412 deletions(-) diff --git a/ChironCore/ChironAST/ChironAST.py b/ChironCore/ChironAST/ChironAST.py index 1d6b537..c0b2954 100644 --- a/ChironCore/ChironAST/ChironAST.py +++ b/ChironCore/ChironAST/ChironAST.py @@ -31,13 +31,15 @@ def __str__(self): class ClassDeclarationCommand(Instruction): - def __init__(self, className, attributes): + def __init__(self, className, attributes, objectAttributes): self.className = className # Class name as a string self.attributes = attributes # List of AssignmentCommand objects + self.objectAttributes = objectAttributes def __str__(self): attr_str = "\n ".join(str(attr) for attr in self.attributes) - return f"class {self.className} {{\n {attr_str if attr_str else ' // No attributes'}\n}}" + obj_attr_str = "\n ".join(str(attr[0]) for attr in self.objectAttributes) + return f"class {self.className} {{\n {attr_str if attr_str else ' // No attributes'}\n\n {obj_attr_str if obj_attr_str else ' // No object attributes'}\n}}" class ConditionCommand(Instruction): diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 5ff24c5..27611f6 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -125,16 +125,18 @@ def visitObjectInstantiation(self, ctx: tlangParser.ObjectInstantiationContext): def visitClassDeclaration(self, ctx: tlangParser.ClassDeclarationContext): className = ctx.VAR().getText() # Extract class name - attributes = [] + objectAttributes = [] if ctx.classBody(): for attrDecl in ctx.classBody().classAttributeDeclaration(): - assign_list = self.visitAssignment(attrDecl.assignment()) - attributes.extend(assign_list) - - print(className, attributes) - - return [(ChironAST.ClassDeclarationCommand(className, attributes), 1)] + if isinstance(attrDecl.assignment(), tlangParser.AssignmentContext): + assign_instr = self.visitAssignment(attrDecl.assignment()) + attributes.extend(assign_instr) + if isinstance(attrDecl.objectInstantiation(), tlangParser.ObjectInstantiationContext): + objectAttributes.extend(self.visitObjectInstantiation(attrDecl.objectInstantiation())) + + # Extract methods of the class + return [(ChironAST.ClassDeclarationCommand(className, attributes, objectAttributes), 1)] # def visitArrayAccess(self, ctx:tlangParser.ArrayAccessContext): # var = ctx.VAR().getText() diff --git a/ChironCore/example/issues.txt b/ChironCore/example/issues.txt index 2d4efdc..51a4696 100644 --- a/ChironCore/example/issues.txt +++ b/ChironCore/example/issues.txt @@ -1,3 +1,5 @@ 1. loop should have expression rather than just value 2. condition should be true for non zero values and not just true/false -3. \ No newline at end of file +3. class currently should have at least one member or python dynamic class initiation throw indentation error +4. Setting objects to N0ne in declaration is not done yet +5. instruction_list can contain both function declaration and classDeclaration this can cause problems diff --git a/ChironCore/example/kachuapur2.tl b/ChironCore/example/kachuapur2.tl index 67f7d0a..593b953 100644 --- a/ChironCore/example/kachuapur2.tl +++ b/ChironCore/example/kachuapur2.tl @@ -1,6 +1,6 @@ :b = 2 :e = 3 -:steps = (:c = :b) * (:d = 4) + :e * 5 +:steps = (:c = :b = :e) * (:d = 4) + :e * 5 print(:steps = 3) print(:steps ) print(2*4+5+:b) diff --git a/ChironCore/example/kachuapur3.tl b/ChironCore/example/kachuapur3.tl index fc4d4f8..cbd1d4c 100644 --- a/ChironCore/example/kachuapur3.tl +++ b/ChironCore/example/kachuapur3.tl @@ -1,6 +1,16 @@ class :Point { - :x = 6; - :y = 4; + :x = 6 + :y = 4 } -print(:Point.:x) -:point = new :Point() \ No newline at end of file + +class :Circle { + :point = new :Point() +} + +:point = new :Point() +:circle = new :Circle() +print(:circle.:point.:x) +:circle.:point.:x = :circle.:point.:y = 0 +print(:point.:x) +print(:circle.:point.:x) + diff --git a/ChironCore/example/rangoli.tl b/ChironCore/example/rangoli.tl index a1c006d..1f286ba 100644 --- a/ChironCore/example/rangoli.tl +++ b/ChironCore/example/rangoli.tl @@ -36,7 +36,6 @@ def sqroot(:n) def drawRangoli(:size) { - penup pendown forward :size left 90 @@ -56,5 +55,12 @@ def drawRangoli(:size) return } -goto (0, 0) +penup +class :Point { + :x = -300 + :y = -300 +} +:point = new :Point() +goto (:point.:x, :point.:y) + drawRangoli(:size) \ No newline at end of file diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index c3881ec..ab26b43 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -77,6 +77,9 @@ def initProgramContext(self, params): class ProgramContext: pass +class ClassList: + pass + # TODO: move to a different file class ConcreteInterpreter(Interpreter): # Ref: https://realpython.com/beginners-guide-python-turtle @@ -84,6 +87,7 @@ class ConcreteInterpreter(Interpreter): prg = None argument = None return_value = None + class_list = None # map of function name to their pc in the IR function_addresses = {} @@ -93,6 +97,7 @@ class ConcreteInterpreter(Interpreter): def __init__(self, irHandler, params): super().__init__(irHandler, params) self.prg = ProgramContext() + self.class_list = ClassList() # Hooks Object: if self.args is not None and self.args.hooks: self.chironhook = Chironhooks.ConcreteChironHooks() @@ -207,41 +212,50 @@ def handleParametersPassing(self, stmt, tgt): return 1 def handleClassDeclaration(self, stmt, tgt): - print(f" Class Declaration: {stmt.className}") + print(f"Class Declaration: {stmt.className}") - className = stmt.className.replace(":","") + className = stmt.className.replace(":", "") attributes = stmt.attributes # List of attribute assignments class_def = f"class {className}:\n" + # Handle normal attributes for attr in attributes: - attr, target= attr + attr, target = attr attr_name = str(attr.lvar).replace(":", "") attr_value = addContext(attr.rexpr) if attr.rexpr else None class_def += f" {attr_name} = {attr_value}\n" + # Handle object attributes (initialize to None first) + for objectAttr in stmt.objectAttributes: + objectAttr, target = objectAttr + lhs = str(objectAttr.target).replace(":", "") + class_def += f" {lhs} = None\n" # ✅ Set to None first + print(class_def, "Class Definition") - exec(class_def, globals(), self.prg.__dict__) # Define class dynamically + # Step 1: Execute the class definition + exec(class_def, globals(), self.class_list.__dict__) - return 1 + # Step 2: Assign object attributes after class creation + for objectAttr in stmt.objectAttributes: + objectAttr, target = objectAttr + lhs = str(objectAttr.target).replace(":", "") + rhs = addContext(objectAttr.class_name).replace("self.prg.", "self.class_list.") + # setattr(getattr(self.class_list, className), lhs, getattr(self.class_list, rhs)()) + exec(f"self.class_list.{className}.{lhs} = {rhs}()") + return 1 def handleObjectInstantiation(self, stmt, tgt): print(f"Creating new instance of {stmt.class_name} for {stmt.target}") - x= self.prg.a() - print(x) - - lhs = str(stmt.target).replace(":","") - rhs = addContext(stmt.class_name) + rhs = addContext(stmt.class_name).replace("self.prg.", "self.class_list.") - # Generate and execute Python class instantiation dynamically - instance_code = f"{lhs} = {rhs}()" - print(instance_code) # exec(instance_code, globals(), self.prg.__dict__) # Store in self.prg exec(f"self.prg.{lhs} = {rhs}()") + print(f"Instance created: {lhs} -> {getattr(self.prg, lhs)}") return 1 diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index 9a087bf..a009452 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -80,9 +80,9 @@ expression : classDeclaration : 'class' VAR '{' classBody '}' ; -classBody : (classAttributeDeclaration)* ; +classBody : (classAttributeDeclaration)* (functionDeclaration)*; -classAttributeDeclaration : assignment ';' ; +classAttributeDeclaration : assignment | objectInstantiation ; objectInstantiation : ( VAR | objectOrArrayAccess) '=' 'new' VAR '(' ')' ; @@ -98,9 +98,10 @@ functionCallWithReturnValues : ( VAR | objectOrArrayAccess) ( ',' ( VAR | object // function declaration functionDeclaration : 'def' NAME '(' parameters ')' '{' strict_ilist '}' ; -parameters : ( VAR ( ',' VAR )* )? ; +parameters : ( ( VAR | Self ) ( ',' VAR )* )? ; arguments : ( expression ( ',' expression )* )? ; +Self : 'self' ; // TODO : // procedure_declaration : 'to' NAME (VAR)+ strict_ilist 'end' ; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index 3465964..42e4ded 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -22,7 +22,6 @@ null 'class' '{' '}' -';' 'new' '.' 'def' @@ -30,6 +29,7 @@ null '-' '*' '/' +'self' 'pendown?' '<' '>' @@ -73,11 +73,11 @@ null null null null -null PLUS MINUS MUL DIV +Self PENCOND LT GT @@ -134,4 +134,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 342, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 79, 10, 3, 12, 3, 14, 3, 82, 11, 3, 3, 4, 6, 4, 85, 10, 4, 13, 4, 14, 4, 86, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 103, 10, 5, 3, 6, 3, 6, 5, 6, 107, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 151, 10, 15, 12, 15, 14, 15, 154, 11, 15, 5, 15, 156, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 162, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 182, 10, 21, 12, 21, 14, 21, 185, 11, 21, 5, 21, 187, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 200, 10, 22, 3, 22, 3, 22, 3, 22, 5, 22, 205, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 215, 10, 22, 12, 22, 14, 22, 218, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 227, 10, 24, 12, 24, 14, 24, 230, 11, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 5, 26, 237, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 252, 10, 27, 13, 27, 14, 27, 253, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 265, 10, 30, 3, 30, 3, 30, 3, 30, 5, 30, 270, 10, 30, 6, 30, 272, 10, 30, 13, 30, 14, 30, 273, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 7, 32, 291, 10, 32, 12, 32, 14, 32, 294, 11, 32, 5, 32, 296, 10, 32, 3, 33, 3, 33, 3, 33, 7, 33, 301, 10, 33, 12, 33, 14, 33, 304, 11, 33, 5, 33, 306, 10, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 320, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 7, 34, 326, 10, 34, 12, 34, 14, 34, 329, 11, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 340, 10, 37, 3, 37, 2, 4, 42, 66, 38, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 352, 2, 74, 3, 2, 2, 2, 4, 80, 3, 2, 2, 2, 6, 84, 3, 2, 2, 2, 8, 102, 3, 2, 2, 2, 10, 106, 3, 2, 2, 2, 12, 108, 3, 2, 2, 2, 14, 114, 3, 2, 2, 2, 16, 124, 3, 2, 2, 2, 18, 130, 3, 2, 2, 2, 20, 137, 3, 2, 2, 2, 22, 140, 3, 2, 2, 2, 24, 142, 3, 2, 2, 2, 26, 144, 3, 2, 2, 2, 28, 146, 3, 2, 2, 2, 30, 161, 3, 2, 2, 2, 32, 166, 3, 2, 2, 2, 34, 171, 3, 2, 2, 2, 36, 173, 3, 2, 2, 2, 38, 175, 3, 2, 2, 2, 40, 177, 3, 2, 2, 2, 42, 204, 3, 2, 2, 2, 44, 219, 3, 2, 2, 2, 46, 228, 3, 2, 2, 2, 48, 231, 3, 2, 2, 2, 50, 236, 3, 2, 2, 2, 52, 244, 3, 2, 2, 2, 54, 255, 3, 2, 2, 2, 56, 257, 3, 2, 2, 2, 58, 264, 3, 2, 2, 2, 60, 278, 3, 2, 2, 2, 62, 295, 3, 2, 2, 2, 64, 305, 3, 2, 2, 2, 66, 319, 3, 2, 2, 2, 68, 330, 3, 2, 2, 2, 70, 332, 3, 2, 2, 2, 72, 339, 3, 2, 2, 2, 74, 75, 5, 4, 3, 2, 75, 76, 7, 2, 2, 3, 76, 3, 3, 2, 2, 2, 77, 79, 5, 8, 5, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 5, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 85, 5, 8, 5, 2, 84, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 7, 3, 2, 2, 2, 88, 103, 5, 58, 30, 2, 89, 103, 5, 30, 16, 2, 90, 103, 5, 32, 17, 2, 91, 103, 5, 10, 6, 2, 92, 103, 5, 16, 9, 2, 93, 103, 5, 20, 11, 2, 94, 103, 5, 24, 13, 2, 95, 103, 5, 18, 10, 2, 96, 103, 5, 26, 14, 2, 97, 103, 5, 44, 23, 2, 98, 103, 5, 50, 26, 2, 99, 103, 5, 60, 31, 2, 100, 103, 5, 56, 29, 2, 101, 103, 5, 40, 21, 2, 102, 88, 3, 2, 2, 2, 102, 89, 3, 2, 2, 2, 102, 90, 3, 2, 2, 2, 102, 91, 3, 2, 2, 2, 102, 92, 3, 2, 2, 2, 102, 93, 3, 2, 2, 2, 102, 94, 3, 2, 2, 2, 102, 95, 3, 2, 2, 2, 102, 96, 3, 2, 2, 2, 102, 97, 3, 2, 2, 2, 102, 98, 3, 2, 2, 2, 102, 99, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 102, 101, 3, 2, 2, 2, 103, 9, 3, 2, 2, 2, 104, 107, 5, 12, 7, 2, 105, 107, 5, 14, 8, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 11, 3, 2, 2, 2, 108, 109, 7, 3, 2, 2, 109, 110, 5, 66, 34, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 13, 3, 2, 2, 2, 114, 115, 7, 3, 2, 2, 115, 116, 5, 66, 34, 2, 116, 117, 7, 4, 2, 2, 117, 118, 5, 6, 4, 2, 118, 119, 7, 5, 2, 2, 119, 120, 7, 6, 2, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 15, 3, 2, 2, 2, 124, 125, 7, 7, 2, 2, 125, 126, 5, 72, 37, 2, 126, 127, 7, 4, 2, 2, 127, 128, 5, 6, 4, 2, 128, 129, 7, 5, 2, 2, 129, 17, 3, 2, 2, 2, 130, 131, 7, 8, 2, 2, 131, 132, 7, 9, 2, 2, 132, 133, 5, 42, 22, 2, 133, 134, 7, 10, 2, 2, 134, 135, 5, 42, 22, 2, 135, 136, 7, 11, 2, 2, 136, 19, 3, 2, 2, 2, 137, 138, 5, 22, 12, 2, 138, 139, 5, 42, 22, 2, 139, 21, 3, 2, 2, 2, 140, 141, 9, 2, 2, 2, 141, 23, 3, 2, 2, 2, 142, 143, 9, 3, 2, 2, 143, 25, 3, 2, 2, 2, 144, 145, 7, 18, 2, 2, 145, 27, 3, 2, 2, 2, 146, 155, 7, 4, 2, 2, 147, 152, 5, 42, 22, 2, 148, 149, 7, 10, 2, 2, 149, 151, 5, 42, 22, 2, 150, 148, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 156, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 147, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 158, 7, 5, 2, 2, 158, 29, 3, 2, 2, 2, 159, 162, 7, 45, 2, 2, 160, 162, 5, 52, 27, 2, 161, 159, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 164, 7, 19, 2, 2, 164, 165, 5, 42, 22, 2, 165, 31, 3, 2, 2, 2, 166, 167, 7, 20, 2, 2, 167, 168, 7, 9, 2, 2, 168, 169, 5, 42, 22, 2, 169, 170, 7, 11, 2, 2, 170, 33, 3, 2, 2, 2, 171, 172, 9, 4, 2, 2, 172, 35, 3, 2, 2, 2, 173, 174, 9, 5, 2, 2, 174, 37, 3, 2, 2, 2, 175, 176, 7, 30, 2, 2, 176, 39, 3, 2, 2, 2, 177, 186, 7, 21, 2, 2, 178, 183, 5, 42, 22, 2, 179, 180, 7, 10, 2, 2, 180, 182, 5, 42, 22, 2, 181, 179, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 178, 3, 2, 2, 2, 186, 187, 3, 2, 2, 2, 187, 41, 3, 2, 2, 2, 188, 189, 8, 22, 1, 2, 189, 190, 5, 38, 20, 2, 190, 191, 5, 42, 22, 9, 191, 205, 3, 2, 2, 2, 192, 193, 7, 9, 2, 2, 193, 194, 5, 42, 22, 2, 194, 195, 7, 11, 2, 2, 195, 205, 3, 2, 2, 2, 196, 205, 5, 72, 37, 2, 197, 200, 7, 45, 2, 2, 198, 200, 5, 52, 27, 2, 199, 197, 3, 2, 2, 2, 199, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 7, 19, 2, 2, 202, 205, 5, 42, 22, 4, 203, 205, 5, 56, 29, 2, 204, 188, 3, 2, 2, 2, 204, 192, 3, 2, 2, 2, 204, 196, 3, 2, 2, 2, 204, 199, 3, 2, 2, 2, 204, 203, 3, 2, 2, 2, 205, 216, 3, 2, 2, 2, 206, 207, 12, 8, 2, 2, 207, 208, 5, 34, 18, 2, 208, 209, 5, 42, 22, 9, 209, 215, 3, 2, 2, 2, 210, 211, 12, 7, 2, 2, 211, 212, 5, 36, 19, 2, 212, 213, 5, 42, 22, 8, 213, 215, 3, 2, 2, 2, 214, 206, 3, 2, 2, 2, 214, 210, 3, 2, 2, 2, 215, 218, 3, 2, 2, 2, 216, 214, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 43, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 219, 220, 7, 22, 2, 2, 220, 221, 7, 45, 2, 2, 221, 222, 7, 23, 2, 2, 222, 223, 5, 46, 24, 2, 223, 224, 7, 24, 2, 2, 224, 45, 3, 2, 2, 2, 225, 227, 5, 48, 25, 2, 226, 225, 3, 2, 2, 2, 227, 230, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 47, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 231, 232, 5, 30, 16, 2, 232, 233, 7, 25, 2, 2, 233, 49, 3, 2, 2, 2, 234, 237, 7, 45, 2, 2, 235, 237, 5, 52, 27, 2, 236, 234, 3, 2, 2, 2, 236, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 239, 7, 19, 2, 2, 239, 240, 7, 26, 2, 2, 240, 241, 7, 45, 2, 2, 241, 242, 7, 9, 2, 2, 242, 243, 7, 11, 2, 2, 243, 51, 3, 2, 2, 2, 244, 251, 5, 54, 28, 2, 245, 246, 7, 27, 2, 2, 246, 252, 7, 45, 2, 2, 247, 248, 7, 4, 2, 2, 248, 249, 5, 42, 22, 2, 249, 250, 7, 5, 2, 2, 250, 252, 3, 2, 2, 2, 251, 245, 3, 2, 2, 2, 251, 247, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 253, 254, 3, 2, 2, 2, 254, 53, 3, 2, 2, 2, 255, 256, 7, 45, 2, 2, 256, 55, 3, 2, 2, 2, 257, 258, 7, 46, 2, 2, 258, 259, 7, 9, 2, 2, 259, 260, 5, 64, 33, 2, 260, 261, 7, 11, 2, 2, 261, 57, 3, 2, 2, 2, 262, 265, 7, 45, 2, 2, 263, 265, 5, 52, 27, 2, 264, 262, 3, 2, 2, 2, 264, 263, 3, 2, 2, 2, 265, 271, 3, 2, 2, 2, 266, 269, 7, 10, 2, 2, 267, 270, 7, 45, 2, 2, 268, 270, 5, 52, 27, 2, 269, 267, 3, 2, 2, 2, 269, 268, 3, 2, 2, 2, 270, 272, 3, 2, 2, 2, 271, 266, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 271, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 275, 3, 2, 2, 2, 275, 276, 7, 19, 2, 2, 276, 277, 5, 56, 29, 2, 277, 59, 3, 2, 2, 2, 278, 279, 7, 28, 2, 2, 279, 280, 7, 46, 2, 2, 280, 281, 7, 9, 2, 2, 281, 282, 5, 62, 32, 2, 282, 283, 7, 11, 2, 2, 283, 284, 7, 23, 2, 2, 284, 285, 5, 6, 4, 2, 285, 286, 7, 24, 2, 2, 286, 61, 3, 2, 2, 2, 287, 292, 7, 45, 2, 2, 288, 289, 7, 10, 2, 2, 289, 291, 7, 45, 2, 2, 290, 288, 3, 2, 2, 2, 291, 294, 3, 2, 2, 2, 292, 290, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 296, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 295, 287, 3, 2, 2, 2, 295, 296, 3, 2, 2, 2, 296, 63, 3, 2, 2, 2, 297, 302, 5, 42, 22, 2, 298, 299, 7, 10, 2, 2, 299, 301, 5, 42, 22, 2, 300, 298, 3, 2, 2, 2, 301, 304, 3, 2, 2, 2, 302, 300, 3, 2, 2, 2, 302, 303, 3, 2, 2, 2, 303, 306, 3, 2, 2, 2, 304, 302, 3, 2, 2, 2, 305, 297, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 65, 3, 2, 2, 2, 307, 308, 8, 34, 1, 2, 308, 309, 7, 42, 2, 2, 309, 320, 5, 66, 34, 7, 310, 311, 5, 42, 22, 2, 311, 312, 5, 68, 35, 2, 312, 313, 5, 42, 22, 2, 313, 320, 3, 2, 2, 2, 314, 320, 7, 33, 2, 2, 315, 316, 7, 9, 2, 2, 316, 317, 5, 66, 34, 2, 317, 318, 7, 11, 2, 2, 318, 320, 3, 2, 2, 2, 319, 307, 3, 2, 2, 2, 319, 310, 3, 2, 2, 2, 319, 314, 3, 2, 2, 2, 319, 315, 3, 2, 2, 2, 320, 327, 3, 2, 2, 2, 321, 322, 12, 5, 2, 2, 322, 323, 5, 70, 36, 2, 323, 324, 5, 66, 34, 6, 324, 326, 3, 2, 2, 2, 325, 321, 3, 2, 2, 2, 326, 329, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 327, 328, 3, 2, 2, 2, 328, 67, 3, 2, 2, 2, 329, 327, 3, 2, 2, 2, 330, 331, 9, 6, 2, 2, 331, 69, 3, 2, 2, 2, 332, 333, 9, 7, 2, 2, 333, 71, 3, 2, 2, 2, 334, 340, 7, 43, 2, 2, 335, 340, 7, 45, 2, 2, 336, 340, 5, 28, 15, 2, 337, 340, 5, 52, 27, 2, 338, 340, 7, 44, 2, 2, 339, 334, 3, 2, 2, 2, 339, 335, 3, 2, 2, 2, 339, 336, 3, 2, 2, 2, 339, 337, 3, 2, 2, 2, 339, 338, 3, 2, 2, 2, 340, 73, 3, 2, 2, 2, 29, 80, 86, 102, 106, 152, 155, 161, 183, 186, 199, 204, 214, 216, 228, 236, 251, 253, 264, 269, 273, 292, 295, 302, 305, 319, 327, 339] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 349, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 79, 10, 3, 12, 3, 14, 3, 82, 11, 3, 3, 4, 6, 4, 85, 10, 4, 13, 4, 14, 4, 86, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 103, 10, 5, 3, 6, 3, 6, 5, 6, 107, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 151, 10, 15, 12, 15, 14, 15, 154, 11, 15, 5, 15, 156, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 162, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 182, 10, 21, 12, 21, 14, 21, 185, 11, 21, 5, 21, 187, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 200, 10, 22, 3, 22, 3, 22, 3, 22, 5, 22, 205, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 215, 10, 22, 12, 22, 14, 22, 218, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 227, 10, 24, 12, 24, 14, 24, 230, 11, 24, 3, 24, 7, 24, 233, 10, 24, 12, 24, 14, 24, 236, 11, 24, 3, 25, 3, 25, 5, 25, 240, 10, 25, 3, 26, 3, 26, 5, 26, 244, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 259, 10, 27, 13, 27, 14, 27, 260, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 272, 10, 30, 3, 30, 3, 30, 3, 30, 5, 30, 277, 10, 30, 6, 30, 279, 10, 30, 13, 30, 14, 30, 280, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 7, 32, 298, 10, 32, 12, 32, 14, 32, 301, 11, 32, 5, 32, 303, 10, 32, 3, 33, 3, 33, 3, 33, 7, 33, 308, 10, 33, 12, 33, 14, 33, 311, 11, 33, 5, 33, 313, 10, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 327, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 7, 34, 333, 10, 34, 12, 34, 14, 34, 336, 11, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 347, 10, 37, 3, 37, 2, 4, 42, 66, 38, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 2, 9, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 4, 2, 32, 32, 45, 45, 3, 2, 34, 39, 3, 2, 40, 41, 2, 361, 2, 74, 3, 2, 2, 2, 4, 80, 3, 2, 2, 2, 6, 84, 3, 2, 2, 2, 8, 102, 3, 2, 2, 2, 10, 106, 3, 2, 2, 2, 12, 108, 3, 2, 2, 2, 14, 114, 3, 2, 2, 2, 16, 124, 3, 2, 2, 2, 18, 130, 3, 2, 2, 2, 20, 137, 3, 2, 2, 2, 22, 140, 3, 2, 2, 2, 24, 142, 3, 2, 2, 2, 26, 144, 3, 2, 2, 2, 28, 146, 3, 2, 2, 2, 30, 161, 3, 2, 2, 2, 32, 166, 3, 2, 2, 2, 34, 171, 3, 2, 2, 2, 36, 173, 3, 2, 2, 2, 38, 175, 3, 2, 2, 2, 40, 177, 3, 2, 2, 2, 42, 204, 3, 2, 2, 2, 44, 219, 3, 2, 2, 2, 46, 228, 3, 2, 2, 2, 48, 239, 3, 2, 2, 2, 50, 243, 3, 2, 2, 2, 52, 251, 3, 2, 2, 2, 54, 262, 3, 2, 2, 2, 56, 264, 3, 2, 2, 2, 58, 271, 3, 2, 2, 2, 60, 285, 3, 2, 2, 2, 62, 302, 3, 2, 2, 2, 64, 312, 3, 2, 2, 2, 66, 326, 3, 2, 2, 2, 68, 337, 3, 2, 2, 2, 70, 339, 3, 2, 2, 2, 72, 346, 3, 2, 2, 2, 74, 75, 5, 4, 3, 2, 75, 76, 7, 2, 2, 3, 76, 3, 3, 2, 2, 2, 77, 79, 5, 8, 5, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 5, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 85, 5, 8, 5, 2, 84, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 7, 3, 2, 2, 2, 88, 103, 5, 58, 30, 2, 89, 103, 5, 30, 16, 2, 90, 103, 5, 32, 17, 2, 91, 103, 5, 10, 6, 2, 92, 103, 5, 16, 9, 2, 93, 103, 5, 20, 11, 2, 94, 103, 5, 24, 13, 2, 95, 103, 5, 18, 10, 2, 96, 103, 5, 26, 14, 2, 97, 103, 5, 44, 23, 2, 98, 103, 5, 50, 26, 2, 99, 103, 5, 60, 31, 2, 100, 103, 5, 56, 29, 2, 101, 103, 5, 40, 21, 2, 102, 88, 3, 2, 2, 2, 102, 89, 3, 2, 2, 2, 102, 90, 3, 2, 2, 2, 102, 91, 3, 2, 2, 2, 102, 92, 3, 2, 2, 2, 102, 93, 3, 2, 2, 2, 102, 94, 3, 2, 2, 2, 102, 95, 3, 2, 2, 2, 102, 96, 3, 2, 2, 2, 102, 97, 3, 2, 2, 2, 102, 98, 3, 2, 2, 2, 102, 99, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 102, 101, 3, 2, 2, 2, 103, 9, 3, 2, 2, 2, 104, 107, 5, 12, 7, 2, 105, 107, 5, 14, 8, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 11, 3, 2, 2, 2, 108, 109, 7, 3, 2, 2, 109, 110, 5, 66, 34, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 13, 3, 2, 2, 2, 114, 115, 7, 3, 2, 2, 115, 116, 5, 66, 34, 2, 116, 117, 7, 4, 2, 2, 117, 118, 5, 6, 4, 2, 118, 119, 7, 5, 2, 2, 119, 120, 7, 6, 2, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 15, 3, 2, 2, 2, 124, 125, 7, 7, 2, 2, 125, 126, 5, 72, 37, 2, 126, 127, 7, 4, 2, 2, 127, 128, 5, 6, 4, 2, 128, 129, 7, 5, 2, 2, 129, 17, 3, 2, 2, 2, 130, 131, 7, 8, 2, 2, 131, 132, 7, 9, 2, 2, 132, 133, 5, 42, 22, 2, 133, 134, 7, 10, 2, 2, 134, 135, 5, 42, 22, 2, 135, 136, 7, 11, 2, 2, 136, 19, 3, 2, 2, 2, 137, 138, 5, 22, 12, 2, 138, 139, 5, 42, 22, 2, 139, 21, 3, 2, 2, 2, 140, 141, 9, 2, 2, 2, 141, 23, 3, 2, 2, 2, 142, 143, 9, 3, 2, 2, 143, 25, 3, 2, 2, 2, 144, 145, 7, 18, 2, 2, 145, 27, 3, 2, 2, 2, 146, 155, 7, 4, 2, 2, 147, 152, 5, 42, 22, 2, 148, 149, 7, 10, 2, 2, 149, 151, 5, 42, 22, 2, 150, 148, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 156, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 147, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 158, 7, 5, 2, 2, 158, 29, 3, 2, 2, 2, 159, 162, 7, 45, 2, 2, 160, 162, 5, 52, 27, 2, 161, 159, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 164, 7, 19, 2, 2, 164, 165, 5, 42, 22, 2, 165, 31, 3, 2, 2, 2, 166, 167, 7, 20, 2, 2, 167, 168, 7, 9, 2, 2, 168, 169, 5, 42, 22, 2, 169, 170, 7, 11, 2, 2, 170, 33, 3, 2, 2, 2, 171, 172, 9, 4, 2, 2, 172, 35, 3, 2, 2, 2, 173, 174, 9, 5, 2, 2, 174, 37, 3, 2, 2, 2, 175, 176, 7, 29, 2, 2, 176, 39, 3, 2, 2, 2, 177, 186, 7, 21, 2, 2, 178, 183, 5, 42, 22, 2, 179, 180, 7, 10, 2, 2, 180, 182, 5, 42, 22, 2, 181, 179, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 178, 3, 2, 2, 2, 186, 187, 3, 2, 2, 2, 187, 41, 3, 2, 2, 2, 188, 189, 8, 22, 1, 2, 189, 190, 5, 38, 20, 2, 190, 191, 5, 42, 22, 9, 191, 205, 3, 2, 2, 2, 192, 193, 7, 9, 2, 2, 193, 194, 5, 42, 22, 2, 194, 195, 7, 11, 2, 2, 195, 205, 3, 2, 2, 2, 196, 205, 5, 72, 37, 2, 197, 200, 7, 45, 2, 2, 198, 200, 5, 52, 27, 2, 199, 197, 3, 2, 2, 2, 199, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 7, 19, 2, 2, 202, 205, 5, 42, 22, 4, 203, 205, 5, 56, 29, 2, 204, 188, 3, 2, 2, 2, 204, 192, 3, 2, 2, 2, 204, 196, 3, 2, 2, 2, 204, 199, 3, 2, 2, 2, 204, 203, 3, 2, 2, 2, 205, 216, 3, 2, 2, 2, 206, 207, 12, 8, 2, 2, 207, 208, 5, 34, 18, 2, 208, 209, 5, 42, 22, 9, 209, 215, 3, 2, 2, 2, 210, 211, 12, 7, 2, 2, 211, 212, 5, 36, 19, 2, 212, 213, 5, 42, 22, 8, 213, 215, 3, 2, 2, 2, 214, 206, 3, 2, 2, 2, 214, 210, 3, 2, 2, 2, 215, 218, 3, 2, 2, 2, 216, 214, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 43, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 219, 220, 7, 22, 2, 2, 220, 221, 7, 45, 2, 2, 221, 222, 7, 23, 2, 2, 222, 223, 5, 46, 24, 2, 223, 224, 7, 24, 2, 2, 224, 45, 3, 2, 2, 2, 225, 227, 5, 48, 25, 2, 226, 225, 3, 2, 2, 2, 227, 230, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 234, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 231, 233, 5, 60, 31, 2, 232, 231, 3, 2, 2, 2, 233, 236, 3, 2, 2, 2, 234, 232, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 47, 3, 2, 2, 2, 236, 234, 3, 2, 2, 2, 237, 240, 5, 30, 16, 2, 238, 240, 5, 50, 26, 2, 239, 237, 3, 2, 2, 2, 239, 238, 3, 2, 2, 2, 240, 49, 3, 2, 2, 2, 241, 244, 7, 45, 2, 2, 242, 244, 5, 52, 27, 2, 243, 241, 3, 2, 2, 2, 243, 242, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 246, 7, 19, 2, 2, 246, 247, 7, 25, 2, 2, 247, 248, 7, 45, 2, 2, 248, 249, 7, 9, 2, 2, 249, 250, 7, 11, 2, 2, 250, 51, 3, 2, 2, 2, 251, 258, 5, 54, 28, 2, 252, 253, 7, 26, 2, 2, 253, 259, 7, 45, 2, 2, 254, 255, 7, 4, 2, 2, 255, 256, 5, 42, 22, 2, 256, 257, 7, 5, 2, 2, 257, 259, 3, 2, 2, 2, 258, 252, 3, 2, 2, 2, 258, 254, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 53, 3, 2, 2, 2, 262, 263, 7, 45, 2, 2, 263, 55, 3, 2, 2, 2, 264, 265, 7, 46, 2, 2, 265, 266, 7, 9, 2, 2, 266, 267, 5, 64, 33, 2, 267, 268, 7, 11, 2, 2, 268, 57, 3, 2, 2, 2, 269, 272, 7, 45, 2, 2, 270, 272, 5, 52, 27, 2, 271, 269, 3, 2, 2, 2, 271, 270, 3, 2, 2, 2, 272, 278, 3, 2, 2, 2, 273, 276, 7, 10, 2, 2, 274, 277, 7, 45, 2, 2, 275, 277, 5, 52, 27, 2, 276, 274, 3, 2, 2, 2, 276, 275, 3, 2, 2, 2, 277, 279, 3, 2, 2, 2, 278, 273, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 278, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 283, 7, 19, 2, 2, 283, 284, 5, 56, 29, 2, 284, 59, 3, 2, 2, 2, 285, 286, 7, 27, 2, 2, 286, 287, 7, 46, 2, 2, 287, 288, 7, 9, 2, 2, 288, 289, 5, 62, 32, 2, 289, 290, 7, 11, 2, 2, 290, 291, 7, 23, 2, 2, 291, 292, 5, 6, 4, 2, 292, 293, 7, 24, 2, 2, 293, 61, 3, 2, 2, 2, 294, 299, 9, 6, 2, 2, 295, 296, 7, 10, 2, 2, 296, 298, 7, 45, 2, 2, 297, 295, 3, 2, 2, 2, 298, 301, 3, 2, 2, 2, 299, 297, 3, 2, 2, 2, 299, 300, 3, 2, 2, 2, 300, 303, 3, 2, 2, 2, 301, 299, 3, 2, 2, 2, 302, 294, 3, 2, 2, 2, 302, 303, 3, 2, 2, 2, 303, 63, 3, 2, 2, 2, 304, 309, 5, 42, 22, 2, 305, 306, 7, 10, 2, 2, 306, 308, 5, 42, 22, 2, 307, 305, 3, 2, 2, 2, 308, 311, 3, 2, 2, 2, 309, 307, 3, 2, 2, 2, 309, 310, 3, 2, 2, 2, 310, 313, 3, 2, 2, 2, 311, 309, 3, 2, 2, 2, 312, 304, 3, 2, 2, 2, 312, 313, 3, 2, 2, 2, 313, 65, 3, 2, 2, 2, 314, 315, 8, 34, 1, 2, 315, 316, 7, 42, 2, 2, 316, 327, 5, 66, 34, 7, 317, 318, 5, 42, 22, 2, 318, 319, 5, 68, 35, 2, 319, 320, 5, 42, 22, 2, 320, 327, 3, 2, 2, 2, 321, 327, 7, 33, 2, 2, 322, 323, 7, 9, 2, 2, 323, 324, 5, 66, 34, 2, 324, 325, 7, 11, 2, 2, 325, 327, 3, 2, 2, 2, 326, 314, 3, 2, 2, 2, 326, 317, 3, 2, 2, 2, 326, 321, 3, 2, 2, 2, 326, 322, 3, 2, 2, 2, 327, 334, 3, 2, 2, 2, 328, 329, 12, 5, 2, 2, 329, 330, 5, 70, 36, 2, 330, 331, 5, 66, 34, 6, 331, 333, 3, 2, 2, 2, 332, 328, 3, 2, 2, 2, 333, 336, 3, 2, 2, 2, 334, 332, 3, 2, 2, 2, 334, 335, 3, 2, 2, 2, 335, 67, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 337, 338, 9, 7, 2, 2, 338, 69, 3, 2, 2, 2, 339, 340, 9, 8, 2, 2, 340, 71, 3, 2, 2, 2, 341, 347, 7, 43, 2, 2, 342, 347, 7, 45, 2, 2, 343, 347, 5, 28, 15, 2, 344, 347, 5, 52, 27, 2, 345, 347, 7, 44, 2, 2, 346, 341, 3, 2, 2, 2, 346, 342, 3, 2, 2, 2, 346, 343, 3, 2, 2, 2, 346, 344, 3, 2, 2, 2, 346, 345, 3, 2, 2, 2, 347, 73, 3, 2, 2, 2, 31, 80, 86, 102, 106, 152, 155, 161, 183, 186, 199, 204, 214, 216, 228, 234, 239, 243, 258, 260, 271, 276, 280, 299, 302, 309, 312, 326, 334, 346] \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.tokens b/ChironCore/turtparse/tlang.tokens index d855f44..ff286d6 100644 --- a/ChironCore/turtparse/tlang.tokens +++ b/ChironCore/turtparse/tlang.tokens @@ -23,11 +23,11 @@ T__21=22 T__22=23 T__23=24 T__24=25 -T__25=26 -PLUS=27 -MINUS=28 -MUL=29 -DIV=30 +PLUS=26 +MINUS=27 +MUL=28 +DIV=29 +Self=30 PENCOND=31 LT=32 GT=33 @@ -65,14 +65,14 @@ Whitespace=45 'class'=20 '{'=21 '}'=22 -';'=23 -'new'=24 -'.'=25 -'def'=26 -'+'=27 -'-'=28 -'*'=29 -'/'=30 +'new'=23 +'.'=24 +'def'=25 +'+'=26 +'-'=27 +'*'=28 +'/'=29 +'self'=30 'pendown?'=31 '<'=32 '>'=33 diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index aa43a61..2bd4d2f 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -22,7 +22,6 @@ null 'class' '{' '}' -';' 'new' '.' 'def' @@ -30,6 +29,7 @@ null '-' '*' '/' +'self' 'pendown?' '<' '>' @@ -73,11 +73,11 @@ null null null null -null PLUS MINUS MUL DIV +Self PENCOND LT GT @@ -120,11 +120,11 @@ T__21 T__22 T__23 T__24 -T__25 PLUS MINUS MUL DIV +Self PENCOND LT GT @@ -149,4 +149,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 47, 287, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 251, 10, 42, 13, 42, 14, 42, 252, 3, 43, 6, 43, 256, 10, 43, 13, 43, 14, 43, 257, 3, 43, 3, 43, 6, 43, 262, 10, 43, 13, 43, 14, 43, 263, 5, 43, 266, 10, 43, 3, 44, 3, 44, 3, 44, 7, 44, 271, 10, 44, 12, 44, 14, 44, 274, 11, 44, 3, 45, 6, 45, 277, 10, 45, 13, 45, 14, 45, 278, 3, 46, 6, 46, 282, 10, 46, 13, 46, 14, 46, 283, 3, 46, 3, 46, 2, 2, 47, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 293, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 3, 93, 3, 2, 2, 2, 5, 96, 3, 2, 2, 2, 7, 98, 3, 2, 2, 2, 9, 100, 3, 2, 2, 2, 11, 105, 3, 2, 2, 2, 13, 112, 3, 2, 2, 2, 15, 117, 3, 2, 2, 2, 17, 119, 3, 2, 2, 2, 19, 121, 3, 2, 2, 2, 21, 123, 3, 2, 2, 2, 23, 131, 3, 2, 2, 2, 25, 140, 3, 2, 2, 2, 27, 145, 3, 2, 2, 2, 29, 151, 3, 2, 2, 2, 31, 157, 3, 2, 2, 2, 33, 165, 3, 2, 2, 2, 35, 171, 3, 2, 2, 2, 37, 173, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 186, 3, 2, 2, 2, 43, 192, 3, 2, 2, 2, 45, 194, 3, 2, 2, 2, 47, 196, 3, 2, 2, 2, 49, 198, 3, 2, 2, 2, 51, 202, 3, 2, 2, 2, 53, 204, 3, 2, 2, 2, 55, 208, 3, 2, 2, 2, 57, 210, 3, 2, 2, 2, 59, 212, 3, 2, 2, 2, 61, 214, 3, 2, 2, 2, 63, 216, 3, 2, 2, 2, 65, 225, 3, 2, 2, 2, 67, 227, 3, 2, 2, 2, 69, 229, 3, 2, 2, 2, 71, 232, 3, 2, 2, 2, 73, 235, 3, 2, 2, 2, 75, 238, 3, 2, 2, 2, 77, 241, 3, 2, 2, 2, 79, 244, 3, 2, 2, 2, 81, 247, 3, 2, 2, 2, 83, 250, 3, 2, 2, 2, 85, 255, 3, 2, 2, 2, 87, 267, 3, 2, 2, 2, 89, 276, 3, 2, 2, 2, 91, 281, 3, 2, 2, 2, 93, 94, 7, 107, 2, 2, 94, 95, 7, 104, 2, 2, 95, 4, 3, 2, 2, 2, 96, 97, 7, 93, 2, 2, 97, 6, 3, 2, 2, 2, 98, 99, 7, 95, 2, 2, 99, 8, 3, 2, 2, 2, 100, 101, 7, 103, 2, 2, 101, 102, 7, 110, 2, 2, 102, 103, 7, 117, 2, 2, 103, 104, 7, 103, 2, 2, 104, 10, 3, 2, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 114, 2, 2, 108, 109, 7, 103, 2, 2, 109, 110, 7, 99, 2, 2, 110, 111, 7, 118, 2, 2, 111, 12, 3, 2, 2, 2, 112, 113, 7, 105, 2, 2, 113, 114, 7, 113, 2, 2, 114, 115, 7, 118, 2, 2, 115, 116, 7, 113, 2, 2, 116, 14, 3, 2, 2, 2, 117, 118, 7, 42, 2, 2, 118, 16, 3, 2, 2, 2, 119, 120, 7, 46, 2, 2, 120, 18, 3, 2, 2, 2, 121, 122, 7, 43, 2, 2, 122, 20, 3, 2, 2, 2, 123, 124, 7, 104, 2, 2, 124, 125, 7, 113, 2, 2, 125, 126, 7, 116, 2, 2, 126, 127, 7, 121, 2, 2, 127, 128, 7, 99, 2, 2, 128, 129, 7, 116, 2, 2, 129, 130, 7, 102, 2, 2, 130, 22, 3, 2, 2, 2, 131, 132, 7, 100, 2, 2, 132, 133, 7, 99, 2, 2, 133, 134, 7, 101, 2, 2, 134, 135, 7, 109, 2, 2, 135, 136, 7, 121, 2, 2, 136, 137, 7, 99, 2, 2, 137, 138, 7, 116, 2, 2, 138, 139, 7, 102, 2, 2, 139, 24, 3, 2, 2, 2, 140, 141, 7, 110, 2, 2, 141, 142, 7, 103, 2, 2, 142, 143, 7, 104, 2, 2, 143, 144, 7, 118, 2, 2, 144, 26, 3, 2, 2, 2, 145, 146, 7, 116, 2, 2, 146, 147, 7, 107, 2, 2, 147, 148, 7, 105, 2, 2, 148, 149, 7, 106, 2, 2, 149, 150, 7, 118, 2, 2, 150, 28, 3, 2, 2, 2, 151, 152, 7, 114, 2, 2, 152, 153, 7, 103, 2, 2, 153, 154, 7, 112, 2, 2, 154, 155, 7, 119, 2, 2, 155, 156, 7, 114, 2, 2, 156, 30, 3, 2, 2, 2, 157, 158, 7, 114, 2, 2, 158, 159, 7, 103, 2, 2, 159, 160, 7, 112, 2, 2, 160, 161, 7, 102, 2, 2, 161, 162, 7, 113, 2, 2, 162, 163, 7, 121, 2, 2, 163, 164, 7, 112, 2, 2, 164, 32, 3, 2, 2, 2, 165, 166, 7, 114, 2, 2, 166, 167, 7, 99, 2, 2, 167, 168, 7, 119, 2, 2, 168, 169, 7, 117, 2, 2, 169, 170, 7, 103, 2, 2, 170, 34, 3, 2, 2, 2, 171, 172, 7, 63, 2, 2, 172, 36, 3, 2, 2, 2, 173, 174, 7, 114, 2, 2, 174, 175, 7, 116, 2, 2, 175, 176, 7, 107, 2, 2, 176, 177, 7, 112, 2, 2, 177, 178, 7, 118, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 116, 2, 2, 180, 181, 7, 103, 2, 2, 181, 182, 7, 118, 2, 2, 182, 183, 7, 119, 2, 2, 183, 184, 7, 116, 2, 2, 184, 185, 7, 112, 2, 2, 185, 40, 3, 2, 2, 2, 186, 187, 7, 101, 2, 2, 187, 188, 7, 110, 2, 2, 188, 189, 7, 99, 2, 2, 189, 190, 7, 117, 2, 2, 190, 191, 7, 117, 2, 2, 191, 42, 3, 2, 2, 2, 192, 193, 7, 125, 2, 2, 193, 44, 3, 2, 2, 2, 194, 195, 7, 127, 2, 2, 195, 46, 3, 2, 2, 2, 196, 197, 7, 61, 2, 2, 197, 48, 3, 2, 2, 2, 198, 199, 7, 112, 2, 2, 199, 200, 7, 103, 2, 2, 200, 201, 7, 121, 2, 2, 201, 50, 3, 2, 2, 2, 202, 203, 7, 48, 2, 2, 203, 52, 3, 2, 2, 2, 204, 205, 7, 102, 2, 2, 205, 206, 7, 103, 2, 2, 206, 207, 7, 104, 2, 2, 207, 54, 3, 2, 2, 2, 208, 209, 7, 45, 2, 2, 209, 56, 3, 2, 2, 2, 210, 211, 7, 47, 2, 2, 211, 58, 3, 2, 2, 2, 212, 213, 7, 44, 2, 2, 213, 60, 3, 2, 2, 2, 214, 215, 7, 49, 2, 2, 215, 62, 3, 2, 2, 2, 216, 217, 7, 114, 2, 2, 217, 218, 7, 103, 2, 2, 218, 219, 7, 112, 2, 2, 219, 220, 7, 102, 2, 2, 220, 221, 7, 113, 2, 2, 221, 222, 7, 121, 2, 2, 222, 223, 7, 112, 2, 2, 223, 224, 7, 65, 2, 2, 224, 64, 3, 2, 2, 2, 225, 226, 7, 62, 2, 2, 226, 66, 3, 2, 2, 2, 227, 228, 7, 64, 2, 2, 228, 68, 3, 2, 2, 2, 229, 230, 7, 63, 2, 2, 230, 231, 7, 63, 2, 2, 231, 70, 3, 2, 2, 2, 232, 233, 7, 35, 2, 2, 233, 234, 7, 63, 2, 2, 234, 72, 3, 2, 2, 2, 235, 236, 7, 62, 2, 2, 236, 237, 7, 63, 2, 2, 237, 74, 3, 2, 2, 2, 238, 239, 7, 64, 2, 2, 239, 240, 7, 63, 2, 2, 240, 76, 3, 2, 2, 2, 241, 242, 7, 40, 2, 2, 242, 243, 7, 40, 2, 2, 243, 78, 3, 2, 2, 2, 244, 245, 7, 126, 2, 2, 245, 246, 7, 126, 2, 2, 246, 80, 3, 2, 2, 2, 247, 248, 7, 35, 2, 2, 248, 82, 3, 2, 2, 2, 249, 251, 9, 2, 2, 2, 250, 249, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 84, 3, 2, 2, 2, 254, 256, 9, 2, 2, 2, 255, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 265, 3, 2, 2, 2, 259, 261, 7, 48, 2, 2, 260, 262, 9, 2, 2, 2, 261, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 266, 3, 2, 2, 2, 265, 259, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 86, 3, 2, 2, 2, 267, 268, 7, 60, 2, 2, 268, 272, 9, 3, 2, 2, 269, 271, 9, 4, 2, 2, 270, 269, 3, 2, 2, 2, 271, 274, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 88, 3, 2, 2, 2, 274, 272, 3, 2, 2, 2, 275, 277, 9, 5, 2, 2, 276, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 276, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 90, 3, 2, 2, 2, 280, 282, 9, 6, 2, 2, 281, 280, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 286, 8, 46, 2, 2, 286, 92, 3, 2, 2, 2, 10, 2, 252, 257, 263, 265, 272, 278, 283, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 47, 290, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 254, 10, 42, 13, 42, 14, 42, 255, 3, 43, 6, 43, 259, 10, 43, 13, 43, 14, 43, 260, 3, 43, 3, 43, 6, 43, 265, 10, 43, 13, 43, 14, 43, 266, 5, 43, 269, 10, 43, 3, 44, 3, 44, 3, 44, 7, 44, 274, 10, 44, 12, 44, 14, 44, 277, 11, 44, 3, 45, 6, 45, 280, 10, 45, 13, 45, 14, 45, 281, 3, 46, 6, 46, 285, 10, 46, 13, 46, 14, 46, 286, 3, 46, 3, 46, 2, 2, 47, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 296, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 3, 93, 3, 2, 2, 2, 5, 96, 3, 2, 2, 2, 7, 98, 3, 2, 2, 2, 9, 100, 3, 2, 2, 2, 11, 105, 3, 2, 2, 2, 13, 112, 3, 2, 2, 2, 15, 117, 3, 2, 2, 2, 17, 119, 3, 2, 2, 2, 19, 121, 3, 2, 2, 2, 21, 123, 3, 2, 2, 2, 23, 131, 3, 2, 2, 2, 25, 140, 3, 2, 2, 2, 27, 145, 3, 2, 2, 2, 29, 151, 3, 2, 2, 2, 31, 157, 3, 2, 2, 2, 33, 165, 3, 2, 2, 2, 35, 171, 3, 2, 2, 2, 37, 173, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 186, 3, 2, 2, 2, 43, 192, 3, 2, 2, 2, 45, 194, 3, 2, 2, 2, 47, 196, 3, 2, 2, 2, 49, 200, 3, 2, 2, 2, 51, 202, 3, 2, 2, 2, 53, 206, 3, 2, 2, 2, 55, 208, 3, 2, 2, 2, 57, 210, 3, 2, 2, 2, 59, 212, 3, 2, 2, 2, 61, 214, 3, 2, 2, 2, 63, 219, 3, 2, 2, 2, 65, 228, 3, 2, 2, 2, 67, 230, 3, 2, 2, 2, 69, 232, 3, 2, 2, 2, 71, 235, 3, 2, 2, 2, 73, 238, 3, 2, 2, 2, 75, 241, 3, 2, 2, 2, 77, 244, 3, 2, 2, 2, 79, 247, 3, 2, 2, 2, 81, 250, 3, 2, 2, 2, 83, 253, 3, 2, 2, 2, 85, 258, 3, 2, 2, 2, 87, 270, 3, 2, 2, 2, 89, 279, 3, 2, 2, 2, 91, 284, 3, 2, 2, 2, 93, 94, 7, 107, 2, 2, 94, 95, 7, 104, 2, 2, 95, 4, 3, 2, 2, 2, 96, 97, 7, 93, 2, 2, 97, 6, 3, 2, 2, 2, 98, 99, 7, 95, 2, 2, 99, 8, 3, 2, 2, 2, 100, 101, 7, 103, 2, 2, 101, 102, 7, 110, 2, 2, 102, 103, 7, 117, 2, 2, 103, 104, 7, 103, 2, 2, 104, 10, 3, 2, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 114, 2, 2, 108, 109, 7, 103, 2, 2, 109, 110, 7, 99, 2, 2, 110, 111, 7, 118, 2, 2, 111, 12, 3, 2, 2, 2, 112, 113, 7, 105, 2, 2, 113, 114, 7, 113, 2, 2, 114, 115, 7, 118, 2, 2, 115, 116, 7, 113, 2, 2, 116, 14, 3, 2, 2, 2, 117, 118, 7, 42, 2, 2, 118, 16, 3, 2, 2, 2, 119, 120, 7, 46, 2, 2, 120, 18, 3, 2, 2, 2, 121, 122, 7, 43, 2, 2, 122, 20, 3, 2, 2, 2, 123, 124, 7, 104, 2, 2, 124, 125, 7, 113, 2, 2, 125, 126, 7, 116, 2, 2, 126, 127, 7, 121, 2, 2, 127, 128, 7, 99, 2, 2, 128, 129, 7, 116, 2, 2, 129, 130, 7, 102, 2, 2, 130, 22, 3, 2, 2, 2, 131, 132, 7, 100, 2, 2, 132, 133, 7, 99, 2, 2, 133, 134, 7, 101, 2, 2, 134, 135, 7, 109, 2, 2, 135, 136, 7, 121, 2, 2, 136, 137, 7, 99, 2, 2, 137, 138, 7, 116, 2, 2, 138, 139, 7, 102, 2, 2, 139, 24, 3, 2, 2, 2, 140, 141, 7, 110, 2, 2, 141, 142, 7, 103, 2, 2, 142, 143, 7, 104, 2, 2, 143, 144, 7, 118, 2, 2, 144, 26, 3, 2, 2, 2, 145, 146, 7, 116, 2, 2, 146, 147, 7, 107, 2, 2, 147, 148, 7, 105, 2, 2, 148, 149, 7, 106, 2, 2, 149, 150, 7, 118, 2, 2, 150, 28, 3, 2, 2, 2, 151, 152, 7, 114, 2, 2, 152, 153, 7, 103, 2, 2, 153, 154, 7, 112, 2, 2, 154, 155, 7, 119, 2, 2, 155, 156, 7, 114, 2, 2, 156, 30, 3, 2, 2, 2, 157, 158, 7, 114, 2, 2, 158, 159, 7, 103, 2, 2, 159, 160, 7, 112, 2, 2, 160, 161, 7, 102, 2, 2, 161, 162, 7, 113, 2, 2, 162, 163, 7, 121, 2, 2, 163, 164, 7, 112, 2, 2, 164, 32, 3, 2, 2, 2, 165, 166, 7, 114, 2, 2, 166, 167, 7, 99, 2, 2, 167, 168, 7, 119, 2, 2, 168, 169, 7, 117, 2, 2, 169, 170, 7, 103, 2, 2, 170, 34, 3, 2, 2, 2, 171, 172, 7, 63, 2, 2, 172, 36, 3, 2, 2, 2, 173, 174, 7, 114, 2, 2, 174, 175, 7, 116, 2, 2, 175, 176, 7, 107, 2, 2, 176, 177, 7, 112, 2, 2, 177, 178, 7, 118, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 116, 2, 2, 180, 181, 7, 103, 2, 2, 181, 182, 7, 118, 2, 2, 182, 183, 7, 119, 2, 2, 183, 184, 7, 116, 2, 2, 184, 185, 7, 112, 2, 2, 185, 40, 3, 2, 2, 2, 186, 187, 7, 101, 2, 2, 187, 188, 7, 110, 2, 2, 188, 189, 7, 99, 2, 2, 189, 190, 7, 117, 2, 2, 190, 191, 7, 117, 2, 2, 191, 42, 3, 2, 2, 2, 192, 193, 7, 125, 2, 2, 193, 44, 3, 2, 2, 2, 194, 195, 7, 127, 2, 2, 195, 46, 3, 2, 2, 2, 196, 197, 7, 112, 2, 2, 197, 198, 7, 103, 2, 2, 198, 199, 7, 121, 2, 2, 199, 48, 3, 2, 2, 2, 200, 201, 7, 48, 2, 2, 201, 50, 3, 2, 2, 2, 202, 203, 7, 102, 2, 2, 203, 204, 7, 103, 2, 2, 204, 205, 7, 104, 2, 2, 205, 52, 3, 2, 2, 2, 206, 207, 7, 45, 2, 2, 207, 54, 3, 2, 2, 2, 208, 209, 7, 47, 2, 2, 209, 56, 3, 2, 2, 2, 210, 211, 7, 44, 2, 2, 211, 58, 3, 2, 2, 2, 212, 213, 7, 49, 2, 2, 213, 60, 3, 2, 2, 2, 214, 215, 7, 117, 2, 2, 215, 216, 7, 103, 2, 2, 216, 217, 7, 110, 2, 2, 217, 218, 7, 104, 2, 2, 218, 62, 3, 2, 2, 2, 219, 220, 7, 114, 2, 2, 220, 221, 7, 103, 2, 2, 221, 222, 7, 112, 2, 2, 222, 223, 7, 102, 2, 2, 223, 224, 7, 113, 2, 2, 224, 225, 7, 121, 2, 2, 225, 226, 7, 112, 2, 2, 226, 227, 7, 65, 2, 2, 227, 64, 3, 2, 2, 2, 228, 229, 7, 62, 2, 2, 229, 66, 3, 2, 2, 2, 230, 231, 7, 64, 2, 2, 231, 68, 3, 2, 2, 2, 232, 233, 7, 63, 2, 2, 233, 234, 7, 63, 2, 2, 234, 70, 3, 2, 2, 2, 235, 236, 7, 35, 2, 2, 236, 237, 7, 63, 2, 2, 237, 72, 3, 2, 2, 2, 238, 239, 7, 62, 2, 2, 239, 240, 7, 63, 2, 2, 240, 74, 3, 2, 2, 2, 241, 242, 7, 64, 2, 2, 242, 243, 7, 63, 2, 2, 243, 76, 3, 2, 2, 2, 244, 245, 7, 40, 2, 2, 245, 246, 7, 40, 2, 2, 246, 78, 3, 2, 2, 2, 247, 248, 7, 126, 2, 2, 248, 249, 7, 126, 2, 2, 249, 80, 3, 2, 2, 2, 250, 251, 7, 35, 2, 2, 251, 82, 3, 2, 2, 2, 252, 254, 9, 2, 2, 2, 253, 252, 3, 2, 2, 2, 254, 255, 3, 2, 2, 2, 255, 253, 3, 2, 2, 2, 255, 256, 3, 2, 2, 2, 256, 84, 3, 2, 2, 2, 257, 259, 9, 2, 2, 2, 258, 257, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 268, 3, 2, 2, 2, 262, 264, 7, 48, 2, 2, 263, 265, 9, 2, 2, 2, 264, 263, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 269, 3, 2, 2, 2, 268, 262, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 86, 3, 2, 2, 2, 270, 271, 7, 60, 2, 2, 271, 275, 9, 3, 2, 2, 272, 274, 9, 4, 2, 2, 273, 272, 3, 2, 2, 2, 274, 277, 3, 2, 2, 2, 275, 273, 3, 2, 2, 2, 275, 276, 3, 2, 2, 2, 276, 88, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 278, 280, 9, 5, 2, 2, 279, 278, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 90, 3, 2, 2, 2, 283, 285, 9, 6, 2, 2, 284, 283, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 288, 3, 2, 2, 2, 288, 289, 8, 46, 2, 2, 289, 92, 3, 2, 2, 2, 10, 2, 255, 260, 266, 268, 275, 281, 286, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index 719f80c..6fcd0f6 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -9,7 +9,7 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2/") - buf.write("\u011f\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") + buf.write("\u0122\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") @@ -25,104 +25,106 @@ def serializedATN(): buf.write("\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23") buf.write("\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25") buf.write("\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30") - buf.write("\3\31\3\31\3\31\3\31\3\32\3\32\3\33\3\33\3\33\3\33\3\34") - buf.write("\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3 \3 \3 \3 \3 \3 ") - buf.write("\3 \3 \3 \3!\3!\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3&") - buf.write("\3&\3&\3\'\3\'\3\'\3(\3(\3(\3)\3)\3*\6*\u00fb\n*\r*\16") - buf.write("*\u00fc\3+\6+\u0100\n+\r+\16+\u0101\3+\3+\6+\u0106\n+") - buf.write("\r+\16+\u0107\5+\u010a\n+\3,\3,\3,\7,\u010f\n,\f,\16,") - buf.write("\u0112\13,\3-\6-\u0115\n-\r-\16-\u0116\3.\6.\u011a\n.") - buf.write("\r.\16.\u011b\3.\3.\2\2/\3\3\5\4\7\5\t\6\13\7\r\b\17\t") - buf.write("\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23") - buf.write("%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36") - buf.write(";\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/\3\2\7\3\2\62;\5") - buf.write("\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5\2\13\f\17\17\"\"\2\u0125") - buf.write("\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13") - buf.write("\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3") - buf.write("\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2") - buf.write("\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2") - buf.write("%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2") - buf.write("\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67") - buf.write("\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2") - buf.write("A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2") - buf.write("\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2") - buf.write("\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\3]\3\2") - buf.write("\2\2\5`\3\2\2\2\7b\3\2\2\2\td\3\2\2\2\13i\3\2\2\2\rp\3") - buf.write("\2\2\2\17u\3\2\2\2\21w\3\2\2\2\23y\3\2\2\2\25{\3\2\2\2") - buf.write("\27\u0083\3\2\2\2\31\u008c\3\2\2\2\33\u0091\3\2\2\2\35") - buf.write("\u0097\3\2\2\2\37\u009d\3\2\2\2!\u00a5\3\2\2\2#\u00ab") - buf.write("\3\2\2\2%\u00ad\3\2\2\2\'\u00b3\3\2\2\2)\u00ba\3\2\2\2") - buf.write("+\u00c0\3\2\2\2-\u00c2\3\2\2\2/\u00c4\3\2\2\2\61\u00c6") - buf.write("\3\2\2\2\63\u00ca\3\2\2\2\65\u00cc\3\2\2\2\67\u00d0\3") - buf.write("\2\2\29\u00d2\3\2\2\2;\u00d4\3\2\2\2=\u00d6\3\2\2\2?\u00d8") - buf.write("\3\2\2\2A\u00e1\3\2\2\2C\u00e3\3\2\2\2E\u00e5\3\2\2\2") - buf.write("G\u00e8\3\2\2\2I\u00eb\3\2\2\2K\u00ee\3\2\2\2M\u00f1\3") - buf.write("\2\2\2O\u00f4\3\2\2\2Q\u00f7\3\2\2\2S\u00fa\3\2\2\2U\u00ff") - buf.write("\3\2\2\2W\u010b\3\2\2\2Y\u0114\3\2\2\2[\u0119\3\2\2\2") - buf.write("]^\7k\2\2^_\7h\2\2_\4\3\2\2\2`a\7]\2\2a\6\3\2\2\2bc\7") - buf.write("_\2\2c\b\3\2\2\2de\7g\2\2ef\7n\2\2fg\7u\2\2gh\7g\2\2h") - buf.write("\n\3\2\2\2ij\7t\2\2jk\7g\2\2kl\7r\2\2lm\7g\2\2mn\7c\2") - buf.write("\2no\7v\2\2o\f\3\2\2\2pq\7i\2\2qr\7q\2\2rs\7v\2\2st\7") - buf.write("q\2\2t\16\3\2\2\2uv\7*\2\2v\20\3\2\2\2wx\7.\2\2x\22\3") - buf.write("\2\2\2yz\7+\2\2z\24\3\2\2\2{|\7h\2\2|}\7q\2\2}~\7t\2\2") - buf.write("~\177\7y\2\2\177\u0080\7c\2\2\u0080\u0081\7t\2\2\u0081") - buf.write("\u0082\7f\2\2\u0082\26\3\2\2\2\u0083\u0084\7d\2\2\u0084") - buf.write("\u0085\7c\2\2\u0085\u0086\7e\2\2\u0086\u0087\7m\2\2\u0087") - buf.write("\u0088\7y\2\2\u0088\u0089\7c\2\2\u0089\u008a\7t\2\2\u008a") - buf.write("\u008b\7f\2\2\u008b\30\3\2\2\2\u008c\u008d\7n\2\2\u008d") - buf.write("\u008e\7g\2\2\u008e\u008f\7h\2\2\u008f\u0090\7v\2\2\u0090") - buf.write("\32\3\2\2\2\u0091\u0092\7t\2\2\u0092\u0093\7k\2\2\u0093") - buf.write("\u0094\7i\2\2\u0094\u0095\7j\2\2\u0095\u0096\7v\2\2\u0096") - buf.write("\34\3\2\2\2\u0097\u0098\7r\2\2\u0098\u0099\7g\2\2\u0099") - buf.write("\u009a\7p\2\2\u009a\u009b\7w\2\2\u009b\u009c\7r\2\2\u009c") - buf.write("\36\3\2\2\2\u009d\u009e\7r\2\2\u009e\u009f\7g\2\2\u009f") - buf.write("\u00a0\7p\2\2\u00a0\u00a1\7f\2\2\u00a1\u00a2\7q\2\2\u00a2") - buf.write("\u00a3\7y\2\2\u00a3\u00a4\7p\2\2\u00a4 \3\2\2\2\u00a5") - buf.write("\u00a6\7r\2\2\u00a6\u00a7\7c\2\2\u00a7\u00a8\7w\2\2\u00a8") - buf.write("\u00a9\7u\2\2\u00a9\u00aa\7g\2\2\u00aa\"\3\2\2\2\u00ab") - buf.write("\u00ac\7?\2\2\u00ac$\3\2\2\2\u00ad\u00ae\7r\2\2\u00ae") - buf.write("\u00af\7t\2\2\u00af\u00b0\7k\2\2\u00b0\u00b1\7p\2\2\u00b1") - buf.write("\u00b2\7v\2\2\u00b2&\3\2\2\2\u00b3\u00b4\7t\2\2\u00b4") - buf.write("\u00b5\7g\2\2\u00b5\u00b6\7v\2\2\u00b6\u00b7\7w\2\2\u00b7") - buf.write("\u00b8\7t\2\2\u00b8\u00b9\7p\2\2\u00b9(\3\2\2\2\u00ba") - buf.write("\u00bb\7e\2\2\u00bb\u00bc\7n\2\2\u00bc\u00bd\7c\2\2\u00bd") - buf.write("\u00be\7u\2\2\u00be\u00bf\7u\2\2\u00bf*\3\2\2\2\u00c0") - buf.write("\u00c1\7}\2\2\u00c1,\3\2\2\2\u00c2\u00c3\7\177\2\2\u00c3") - buf.write(".\3\2\2\2\u00c4\u00c5\7=\2\2\u00c5\60\3\2\2\2\u00c6\u00c7") - buf.write("\7p\2\2\u00c7\u00c8\7g\2\2\u00c8\u00c9\7y\2\2\u00c9\62") - buf.write("\3\2\2\2\u00ca\u00cb\7\60\2\2\u00cb\64\3\2\2\2\u00cc\u00cd") - buf.write("\7f\2\2\u00cd\u00ce\7g\2\2\u00ce\u00cf\7h\2\2\u00cf\66") - buf.write("\3\2\2\2\u00d0\u00d1\7-\2\2\u00d18\3\2\2\2\u00d2\u00d3") - buf.write("\7/\2\2\u00d3:\3\2\2\2\u00d4\u00d5\7,\2\2\u00d5<\3\2\2") - buf.write("\2\u00d6\u00d7\7\61\2\2\u00d7>\3\2\2\2\u00d8\u00d9\7r") - buf.write("\2\2\u00d9\u00da\7g\2\2\u00da\u00db\7p\2\2\u00db\u00dc") - buf.write("\7f\2\2\u00dc\u00dd\7q\2\2\u00dd\u00de\7y\2\2\u00de\u00df") - buf.write("\7p\2\2\u00df\u00e0\7A\2\2\u00e0@\3\2\2\2\u00e1\u00e2") - buf.write("\7>\2\2\u00e2B\3\2\2\2\u00e3\u00e4\7@\2\2\u00e4D\3\2\2") - buf.write("\2\u00e5\u00e6\7?\2\2\u00e6\u00e7\7?\2\2\u00e7F\3\2\2") - buf.write("\2\u00e8\u00e9\7#\2\2\u00e9\u00ea\7?\2\2\u00eaH\3\2\2") - buf.write("\2\u00eb\u00ec\7>\2\2\u00ec\u00ed\7?\2\2\u00edJ\3\2\2") - buf.write("\2\u00ee\u00ef\7@\2\2\u00ef\u00f0\7?\2\2\u00f0L\3\2\2") - buf.write("\2\u00f1\u00f2\7(\2\2\u00f2\u00f3\7(\2\2\u00f3N\3\2\2") - buf.write("\2\u00f4\u00f5\7~\2\2\u00f5\u00f6\7~\2\2\u00f6P\3\2\2") - buf.write("\2\u00f7\u00f8\7#\2\2\u00f8R\3\2\2\2\u00f9\u00fb\t\2\2") - buf.write("\2\u00fa\u00f9\3\2\2\2\u00fb\u00fc\3\2\2\2\u00fc\u00fa") - buf.write("\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fdT\3\2\2\2\u00fe\u0100") - buf.write("\t\2\2\2\u00ff\u00fe\3\2\2\2\u0100\u0101\3\2\2\2\u0101") - buf.write("\u00ff\3\2\2\2\u0101\u0102\3\2\2\2\u0102\u0109\3\2\2\2") - buf.write("\u0103\u0105\7\60\2\2\u0104\u0106\t\2\2\2\u0105\u0104") - buf.write("\3\2\2\2\u0106\u0107\3\2\2\2\u0107\u0105\3\2\2\2\u0107") - buf.write("\u0108\3\2\2\2\u0108\u010a\3\2\2\2\u0109\u0103\3\2\2\2") - buf.write("\u0109\u010a\3\2\2\2\u010aV\3\2\2\2\u010b\u010c\7<\2\2") - buf.write("\u010c\u0110\t\3\2\2\u010d\u010f\t\4\2\2\u010e\u010d\3") - buf.write("\2\2\2\u010f\u0112\3\2\2\2\u0110\u010e\3\2\2\2\u0110\u0111") - buf.write("\3\2\2\2\u0111X\3\2\2\2\u0112\u0110\3\2\2\2\u0113\u0115") - buf.write("\t\5\2\2\u0114\u0113\3\2\2\2\u0115\u0116\3\2\2\2\u0116") - buf.write("\u0114\3\2\2\2\u0116\u0117\3\2\2\2\u0117Z\3\2\2\2\u0118") - buf.write("\u011a\t\6\2\2\u0119\u0118\3\2\2\2\u011a\u011b\3\2\2\2") - buf.write("\u011b\u0119\3\2\2\2\u011b\u011c\3\2\2\2\u011c\u011d\3") - buf.write("\2\2\2\u011d\u011e\b.\2\2\u011e\\\3\2\2\2\n\2\u00fc\u0101") - buf.write("\u0107\u0109\u0110\u0116\u011b\3\b\2\2") + buf.write("\3\30\3\30\3\31\3\31\3\32\3\32\3\32\3\32\3\33\3\33\3\34") + buf.write("\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3 ") + buf.write("\3 \3 \3 \3 \3 \3 \3 \3 \3!\3!\3\"\3\"\3#\3#\3#\3$\3$") + buf.write("\3$\3%\3%\3%\3&\3&\3&\3\'\3\'\3\'\3(\3(\3(\3)\3)\3*\6") + buf.write("*\u00fe\n*\r*\16*\u00ff\3+\6+\u0103\n+\r+\16+\u0104\3") + buf.write("+\3+\6+\u0109\n+\r+\16+\u010a\5+\u010d\n+\3,\3,\3,\7,") + buf.write("\u0112\n,\f,\16,\u0115\13,\3-\6-\u0118\n-\r-\16-\u0119") + buf.write("\3.\6.\u011d\n.\r.\16.\u011e\3.\3.\2\2/\3\3\5\4\7\5\t") + buf.write("\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20") + buf.write("\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65") + buf.write("\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/\3") + buf.write("\2\7\3\2\62;\5\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5\2\13\f") + buf.write("\17\17\"\"\2\u0128\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2") + buf.write("\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21") + buf.write("\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3") + buf.write("\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2") + buf.write("\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2") + buf.write("\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2") + buf.write("\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2") + buf.write("\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3") + buf.write("\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q") + buf.write("\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2") + buf.write("[\3\2\2\2\3]\3\2\2\2\5`\3\2\2\2\7b\3\2\2\2\td\3\2\2\2") + buf.write("\13i\3\2\2\2\rp\3\2\2\2\17u\3\2\2\2\21w\3\2\2\2\23y\3") + buf.write("\2\2\2\25{\3\2\2\2\27\u0083\3\2\2\2\31\u008c\3\2\2\2\33") + buf.write("\u0091\3\2\2\2\35\u0097\3\2\2\2\37\u009d\3\2\2\2!\u00a5") + buf.write("\3\2\2\2#\u00ab\3\2\2\2%\u00ad\3\2\2\2\'\u00b3\3\2\2\2") + buf.write(")\u00ba\3\2\2\2+\u00c0\3\2\2\2-\u00c2\3\2\2\2/\u00c4\3") + buf.write("\2\2\2\61\u00c8\3\2\2\2\63\u00ca\3\2\2\2\65\u00ce\3\2") + buf.write("\2\2\67\u00d0\3\2\2\29\u00d2\3\2\2\2;\u00d4\3\2\2\2=\u00d6") + buf.write("\3\2\2\2?\u00db\3\2\2\2A\u00e4\3\2\2\2C\u00e6\3\2\2\2") + buf.write("E\u00e8\3\2\2\2G\u00eb\3\2\2\2I\u00ee\3\2\2\2K\u00f1\3") + buf.write("\2\2\2M\u00f4\3\2\2\2O\u00f7\3\2\2\2Q\u00fa\3\2\2\2S\u00fd") + buf.write("\3\2\2\2U\u0102\3\2\2\2W\u010e\3\2\2\2Y\u0117\3\2\2\2") + buf.write("[\u011c\3\2\2\2]^\7k\2\2^_\7h\2\2_\4\3\2\2\2`a\7]\2\2") + buf.write("a\6\3\2\2\2bc\7_\2\2c\b\3\2\2\2de\7g\2\2ef\7n\2\2fg\7") + buf.write("u\2\2gh\7g\2\2h\n\3\2\2\2ij\7t\2\2jk\7g\2\2kl\7r\2\2l") + buf.write("m\7g\2\2mn\7c\2\2no\7v\2\2o\f\3\2\2\2pq\7i\2\2qr\7q\2") + buf.write("\2rs\7v\2\2st\7q\2\2t\16\3\2\2\2uv\7*\2\2v\20\3\2\2\2") + buf.write("wx\7.\2\2x\22\3\2\2\2yz\7+\2\2z\24\3\2\2\2{|\7h\2\2|}") + buf.write("\7q\2\2}~\7t\2\2~\177\7y\2\2\177\u0080\7c\2\2\u0080\u0081") + buf.write("\7t\2\2\u0081\u0082\7f\2\2\u0082\26\3\2\2\2\u0083\u0084") + buf.write("\7d\2\2\u0084\u0085\7c\2\2\u0085\u0086\7e\2\2\u0086\u0087") + buf.write("\7m\2\2\u0087\u0088\7y\2\2\u0088\u0089\7c\2\2\u0089\u008a") + buf.write("\7t\2\2\u008a\u008b\7f\2\2\u008b\30\3\2\2\2\u008c\u008d") + buf.write("\7n\2\2\u008d\u008e\7g\2\2\u008e\u008f\7h\2\2\u008f\u0090") + buf.write("\7v\2\2\u0090\32\3\2\2\2\u0091\u0092\7t\2\2\u0092\u0093") + buf.write("\7k\2\2\u0093\u0094\7i\2\2\u0094\u0095\7j\2\2\u0095\u0096") + buf.write("\7v\2\2\u0096\34\3\2\2\2\u0097\u0098\7r\2\2\u0098\u0099") + buf.write("\7g\2\2\u0099\u009a\7p\2\2\u009a\u009b\7w\2\2\u009b\u009c") + buf.write("\7r\2\2\u009c\36\3\2\2\2\u009d\u009e\7r\2\2\u009e\u009f") + buf.write("\7g\2\2\u009f\u00a0\7p\2\2\u00a0\u00a1\7f\2\2\u00a1\u00a2") + buf.write("\7q\2\2\u00a2\u00a3\7y\2\2\u00a3\u00a4\7p\2\2\u00a4 \3") + buf.write("\2\2\2\u00a5\u00a6\7r\2\2\u00a6\u00a7\7c\2\2\u00a7\u00a8") + buf.write("\7w\2\2\u00a8\u00a9\7u\2\2\u00a9\u00aa\7g\2\2\u00aa\"") + buf.write("\3\2\2\2\u00ab\u00ac\7?\2\2\u00ac$\3\2\2\2\u00ad\u00ae") + buf.write("\7r\2\2\u00ae\u00af\7t\2\2\u00af\u00b0\7k\2\2\u00b0\u00b1") + buf.write("\7p\2\2\u00b1\u00b2\7v\2\2\u00b2&\3\2\2\2\u00b3\u00b4") + buf.write("\7t\2\2\u00b4\u00b5\7g\2\2\u00b5\u00b6\7v\2\2\u00b6\u00b7") + buf.write("\7w\2\2\u00b7\u00b8\7t\2\2\u00b8\u00b9\7p\2\2\u00b9(\3") + buf.write("\2\2\2\u00ba\u00bb\7e\2\2\u00bb\u00bc\7n\2\2\u00bc\u00bd") + buf.write("\7c\2\2\u00bd\u00be\7u\2\2\u00be\u00bf\7u\2\2\u00bf*\3") + buf.write("\2\2\2\u00c0\u00c1\7}\2\2\u00c1,\3\2\2\2\u00c2\u00c3\7") + buf.write("\177\2\2\u00c3.\3\2\2\2\u00c4\u00c5\7p\2\2\u00c5\u00c6") + buf.write("\7g\2\2\u00c6\u00c7\7y\2\2\u00c7\60\3\2\2\2\u00c8\u00c9") + buf.write("\7\60\2\2\u00c9\62\3\2\2\2\u00ca\u00cb\7f\2\2\u00cb\u00cc") + buf.write("\7g\2\2\u00cc\u00cd\7h\2\2\u00cd\64\3\2\2\2\u00ce\u00cf") + buf.write("\7-\2\2\u00cf\66\3\2\2\2\u00d0\u00d1\7/\2\2\u00d18\3\2") + buf.write("\2\2\u00d2\u00d3\7,\2\2\u00d3:\3\2\2\2\u00d4\u00d5\7\61") + buf.write("\2\2\u00d5<\3\2\2\2\u00d6\u00d7\7u\2\2\u00d7\u00d8\7g") + buf.write("\2\2\u00d8\u00d9\7n\2\2\u00d9\u00da\7h\2\2\u00da>\3\2") + buf.write("\2\2\u00db\u00dc\7r\2\2\u00dc\u00dd\7g\2\2\u00dd\u00de") + buf.write("\7p\2\2\u00de\u00df\7f\2\2\u00df\u00e0\7q\2\2\u00e0\u00e1") + buf.write("\7y\2\2\u00e1\u00e2\7p\2\2\u00e2\u00e3\7A\2\2\u00e3@\3") + buf.write("\2\2\2\u00e4\u00e5\7>\2\2\u00e5B\3\2\2\2\u00e6\u00e7\7") + buf.write("@\2\2\u00e7D\3\2\2\2\u00e8\u00e9\7?\2\2\u00e9\u00ea\7") + buf.write("?\2\2\u00eaF\3\2\2\2\u00eb\u00ec\7#\2\2\u00ec\u00ed\7") + buf.write("?\2\2\u00edH\3\2\2\2\u00ee\u00ef\7>\2\2\u00ef\u00f0\7") + buf.write("?\2\2\u00f0J\3\2\2\2\u00f1\u00f2\7@\2\2\u00f2\u00f3\7") + buf.write("?\2\2\u00f3L\3\2\2\2\u00f4\u00f5\7(\2\2\u00f5\u00f6\7") + buf.write("(\2\2\u00f6N\3\2\2\2\u00f7\u00f8\7~\2\2\u00f8\u00f9\7") + buf.write("~\2\2\u00f9P\3\2\2\2\u00fa\u00fb\7#\2\2\u00fbR\3\2\2\2") + buf.write("\u00fc\u00fe\t\2\2\2\u00fd\u00fc\3\2\2\2\u00fe\u00ff\3") + buf.write("\2\2\2\u00ff\u00fd\3\2\2\2\u00ff\u0100\3\2\2\2\u0100T") + buf.write("\3\2\2\2\u0101\u0103\t\2\2\2\u0102\u0101\3\2\2\2\u0103") + buf.write("\u0104\3\2\2\2\u0104\u0102\3\2\2\2\u0104\u0105\3\2\2\2") + buf.write("\u0105\u010c\3\2\2\2\u0106\u0108\7\60\2\2\u0107\u0109") + buf.write("\t\2\2\2\u0108\u0107\3\2\2\2\u0109\u010a\3\2\2\2\u010a") + buf.write("\u0108\3\2\2\2\u010a\u010b\3\2\2\2\u010b\u010d\3\2\2\2") + buf.write("\u010c\u0106\3\2\2\2\u010c\u010d\3\2\2\2\u010dV\3\2\2") + buf.write("\2\u010e\u010f\7<\2\2\u010f\u0113\t\3\2\2\u0110\u0112") + buf.write("\t\4\2\2\u0111\u0110\3\2\2\2\u0112\u0115\3\2\2\2\u0113") + buf.write("\u0111\3\2\2\2\u0113\u0114\3\2\2\2\u0114X\3\2\2\2\u0115") + buf.write("\u0113\3\2\2\2\u0116\u0118\t\5\2\2\u0117\u0116\3\2\2\2") + buf.write("\u0118\u0119\3\2\2\2\u0119\u0117\3\2\2\2\u0119\u011a\3") + buf.write("\2\2\2\u011aZ\3\2\2\2\u011b\u011d\t\6\2\2\u011c\u011b") + buf.write("\3\2\2\2\u011d\u011e\3\2\2\2\u011e\u011c\3\2\2\2\u011e") + buf.write("\u011f\3\2\2\2\u011f\u0120\3\2\2\2\u0120\u0121\b.\2\2") + buf.write("\u0121\\\3\2\2\2\n\2\u00ff\u0104\u010a\u010c\u0113\u0119") + buf.write("\u011e\3\b\2\2") return buf.getvalue() @@ -157,11 +159,11 @@ class tlangLexer(Lexer): T__22 = 23 T__23 = 24 T__24 = 25 - T__25 = 26 - PLUS = 27 - MINUS = 28 - MUL = 29 - DIV = 30 + PLUS = 26 + MINUS = 27 + MUL = 28 + DIV = 29 + Self = 30 PENCOND = 31 LT = 32 GT = 33 @@ -186,22 +188,22 @@ class tlangLexer(Lexer): "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'return'", - "'class'", "'{'", "'}'", "';'", "'new'", "'.'", "'def'", "'+'", - "'-'", "'*'", "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", - "'<='", "'>='", "'&&'", "'||'", "'!'" ] + "'class'", "'{'", "'}'", "'new'", "'.'", "'def'", "'+'", "'-'", + "'*'", "'/'", "'self'", "'pendown?'", "'<'", "'>'", "'=='", + "'!='", "'<='", "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", - "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", - "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", - "NAME", "Whitespace" ] + "PLUS", "MINUS", "MUL", "DIV", "Self", "PENCOND", "LT", "GT", + "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", + "VAR", "NAME", "Whitespace" ] ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", - "T__20", "T__21", "T__22", "T__23", "T__24", "T__25", - "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", - "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", - "REAL", "VAR", "NAME", "Whitespace" ] + "T__20", "T__21", "T__22", "T__23", "T__24", "PLUS", "MINUS", + "MUL", "DIV", "Self", "PENCOND", "LT", "GT", "EQ", "NEQ", + "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", + "NAME", "Whitespace" ] grammarFileName = "tlang.g4" diff --git a/ChironCore/turtparse/tlangLexer.tokens b/ChironCore/turtparse/tlangLexer.tokens index d855f44..ff286d6 100644 --- a/ChironCore/turtparse/tlangLexer.tokens +++ b/ChironCore/turtparse/tlangLexer.tokens @@ -23,11 +23,11 @@ T__21=22 T__22=23 T__23=24 T__24=25 -T__25=26 -PLUS=27 -MINUS=28 -MUL=29 -DIV=30 +PLUS=26 +MINUS=27 +MUL=28 +DIV=29 +Self=30 PENCOND=31 LT=32 GT=33 @@ -65,14 +65,14 @@ Whitespace=45 'class'=20 '{'=21 '}'=22 -';'=23 -'new'=24 -'.'=25 -'def'=26 -'+'=27 -'-'=28 -'*'=29 -'/'=30 +'new'=23 +'.'=24 +'def'=25 +'+'=26 +'-'=27 +'*'=28 +'/'=29 +'self'=30 'pendown?'=31 '<'=32 '>'=33 diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index c9dff1e..fa9905e 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -9,7 +9,7 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3/") - buf.write("\u0156\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\u015d\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") @@ -29,134 +29,139 @@ def serializedATN(): buf.write("\26\3\26\3\26\5\26\u00c8\n\26\3\26\3\26\3\26\5\26\u00cd") buf.write("\n\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\7\26\u00d7") buf.write("\n\26\f\26\16\26\u00da\13\26\3\27\3\27\3\27\3\27\3\27") - buf.write("\3\27\3\30\7\30\u00e3\n\30\f\30\16\30\u00e6\13\30\3\31") - buf.write("\3\31\3\31\3\32\3\32\5\32\u00ed\n\32\3\32\3\32\3\32\3") + buf.write("\3\27\3\30\7\30\u00e3\n\30\f\30\16\30\u00e6\13\30\3\30") + buf.write("\7\30\u00e9\n\30\f\30\16\30\u00ec\13\30\3\31\3\31\5\31") + buf.write("\u00f0\n\31\3\32\3\32\5\32\u00f4\n\32\3\32\3\32\3\32\3") buf.write("\32\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\6\33") - buf.write("\u00fc\n\33\r\33\16\33\u00fd\3\34\3\34\3\35\3\35\3\35") - buf.write("\3\35\3\35\3\36\3\36\5\36\u0109\n\36\3\36\3\36\3\36\5") - buf.write("\36\u010e\n\36\6\36\u0110\n\36\r\36\16\36\u0111\3\36\3") + buf.write("\u0103\n\33\r\33\16\33\u0104\3\34\3\34\3\35\3\35\3\35") + buf.write("\3\35\3\35\3\36\3\36\5\36\u0110\n\36\3\36\3\36\3\36\5") + buf.write("\36\u0115\n\36\6\36\u0117\n\36\r\36\16\36\u0118\3\36\3") buf.write("\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37") - buf.write("\3 \3 \3 \7 \u0123\n \f \16 \u0126\13 \5 \u0128\n \3!") - buf.write("\3!\3!\7!\u012d\n!\f!\16!\u0130\13!\5!\u0132\n!\3\"\3") - buf.write("\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\5\"\u0140\n") - buf.write("\"\3\"\3\"\3\"\3\"\7\"\u0146\n\"\f\"\16\"\u0149\13\"\3") - buf.write("#\3#\3$\3$\3%\3%\3%\3%\3%\5%\u0154\n%\3%\2\4*B&\2\4\6") + buf.write("\3 \3 \3 \7 \u012a\n \f \16 \u012d\13 \5 \u012f\n \3!") + buf.write("\3!\3!\7!\u0134\n!\f!\16!\u0137\13!\5!\u0139\n!\3\"\3") + buf.write("\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\5\"\u0147\n") + buf.write("\"\3\"\3\"\3\"\3\"\7\"\u014d\n\"\f\"\16\"\u0150\13\"\3") + buf.write("#\3#\3$\3$\3%\3%\3%\3%\3%\5%\u015b\n%\3%\2\4*B&\2\4\6") buf.write("\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\66") - buf.write("8:<>@BDFH\2\b\3\2\f\17\3\2\20\21\3\2\37 \3\2\35\36\3\2") - buf.write("\"\'\3\2()\2\u0160\2J\3\2\2\2\4P\3\2\2\2\6T\3\2\2\2\b") - buf.write("f\3\2\2\2\nj\3\2\2\2\fl\3\2\2\2\16r\3\2\2\2\20|\3\2\2") - buf.write("\2\22\u0082\3\2\2\2\24\u0089\3\2\2\2\26\u008c\3\2\2\2") - buf.write("\30\u008e\3\2\2\2\32\u0090\3\2\2\2\34\u0092\3\2\2\2\36") - buf.write("\u00a1\3\2\2\2 \u00a6\3\2\2\2\"\u00ab\3\2\2\2$\u00ad\3") - buf.write("\2\2\2&\u00af\3\2\2\2(\u00b1\3\2\2\2*\u00cc\3\2\2\2,\u00db") - buf.write("\3\2\2\2.\u00e4\3\2\2\2\60\u00e7\3\2\2\2\62\u00ec\3\2") - buf.write("\2\2\64\u00f4\3\2\2\2\66\u00ff\3\2\2\28\u0101\3\2\2\2") - buf.write(":\u0108\3\2\2\2<\u0116\3\2\2\2>\u0127\3\2\2\2@\u0131\3") - buf.write("\2\2\2B\u013f\3\2\2\2D\u014a\3\2\2\2F\u014c\3\2\2\2H\u0153") - buf.write("\3\2\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2MO\5\b\5\2NM\3") - buf.write("\2\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2Q\5\3\2\2\2RP\3\2") - buf.write("\2\2SU\5\b\5\2TS\3\2\2\2UV\3\2\2\2VT\3\2\2\2VW\3\2\2\2") - buf.write("W\7\3\2\2\2Xg\5:\36\2Yg\5\36\20\2Zg\5 \21\2[g\5\n\6\2") - buf.write("\\g\5\20\t\2]g\5\24\13\2^g\5\30\r\2_g\5\22\n\2`g\5\32") - buf.write("\16\2ag\5,\27\2bg\5\62\32\2cg\5<\37\2dg\58\35\2eg\5(\25") - buf.write("\2fX\3\2\2\2fY\3\2\2\2fZ\3\2\2\2f[\3\2\2\2f\\\3\2\2\2") - buf.write("f]\3\2\2\2f^\3\2\2\2f_\3\2\2\2f`\3\2\2\2fa\3\2\2\2fb\3") - buf.write("\2\2\2fc\3\2\2\2fd\3\2\2\2fe\3\2\2\2g\t\3\2\2\2hk\5\f") - buf.write("\7\2ik\5\16\b\2jh\3\2\2\2ji\3\2\2\2k\13\3\2\2\2lm\7\3") - buf.write("\2\2mn\5B\"\2no\7\4\2\2op\5\6\4\2pq\7\5\2\2q\r\3\2\2\2") - buf.write("rs\7\3\2\2st\5B\"\2tu\7\4\2\2uv\5\6\4\2vw\7\5\2\2wx\7") - buf.write("\6\2\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2{\17\3\2\2\2|}\7\7") - buf.write("\2\2}~\5H%\2~\177\7\4\2\2\177\u0080\5\6\4\2\u0080\u0081") - buf.write("\7\5\2\2\u0081\21\3\2\2\2\u0082\u0083\7\b\2\2\u0083\u0084") - buf.write("\7\t\2\2\u0084\u0085\5*\26\2\u0085\u0086\7\n\2\2\u0086") - buf.write("\u0087\5*\26\2\u0087\u0088\7\13\2\2\u0088\23\3\2\2\2\u0089") - buf.write("\u008a\5\26\f\2\u008a\u008b\5*\26\2\u008b\25\3\2\2\2\u008c") - buf.write("\u008d\t\2\2\2\u008d\27\3\2\2\2\u008e\u008f\t\3\2\2\u008f") - buf.write("\31\3\2\2\2\u0090\u0091\7\22\2\2\u0091\33\3\2\2\2\u0092") - buf.write("\u009b\7\4\2\2\u0093\u0098\5*\26\2\u0094\u0095\7\n\2\2") - buf.write("\u0095\u0097\5*\26\2\u0096\u0094\3\2\2\2\u0097\u009a\3") - buf.write("\2\2\2\u0098\u0096\3\2\2\2\u0098\u0099\3\2\2\2\u0099\u009c") - buf.write("\3\2\2\2\u009a\u0098\3\2\2\2\u009b\u0093\3\2\2\2\u009b") - buf.write("\u009c\3\2\2\2\u009c\u009d\3\2\2\2\u009d\u009e\7\5\2\2") - buf.write("\u009e\35\3\2\2\2\u009f\u00a2\7-\2\2\u00a0\u00a2\5\64") - buf.write("\33\2\u00a1\u009f\3\2\2\2\u00a1\u00a0\3\2\2\2\u00a2\u00a3") - buf.write("\3\2\2\2\u00a3\u00a4\7\23\2\2\u00a4\u00a5\5*\26\2\u00a5") - buf.write("\37\3\2\2\2\u00a6\u00a7\7\24\2\2\u00a7\u00a8\7\t\2\2\u00a8") - buf.write("\u00a9\5*\26\2\u00a9\u00aa\7\13\2\2\u00aa!\3\2\2\2\u00ab") - buf.write("\u00ac\t\4\2\2\u00ac#\3\2\2\2\u00ad\u00ae\t\5\2\2\u00ae") - buf.write("%\3\2\2\2\u00af\u00b0\7\36\2\2\u00b0\'\3\2\2\2\u00b1\u00ba") - buf.write("\7\25\2\2\u00b2\u00b7\5*\26\2\u00b3\u00b4\7\n\2\2\u00b4") - buf.write("\u00b6\5*\26\2\u00b5\u00b3\3\2\2\2\u00b6\u00b9\3\2\2\2") - buf.write("\u00b7\u00b5\3\2\2\2\u00b7\u00b8\3\2\2\2\u00b8\u00bb\3") - buf.write("\2\2\2\u00b9\u00b7\3\2\2\2\u00ba\u00b2\3\2\2\2\u00ba\u00bb") - buf.write("\3\2\2\2\u00bb)\3\2\2\2\u00bc\u00bd\b\26\1\2\u00bd\u00be") - buf.write("\5&\24\2\u00be\u00bf\5*\26\t\u00bf\u00cd\3\2\2\2\u00c0") - buf.write("\u00c1\7\t\2\2\u00c1\u00c2\5*\26\2\u00c2\u00c3\7\13\2") - buf.write("\2\u00c3\u00cd\3\2\2\2\u00c4\u00cd\5H%\2\u00c5\u00c8\7") - buf.write("-\2\2\u00c6\u00c8\5\64\33\2\u00c7\u00c5\3\2\2\2\u00c7") - buf.write("\u00c6\3\2\2\2\u00c8\u00c9\3\2\2\2\u00c9\u00ca\7\23\2") - buf.write("\2\u00ca\u00cd\5*\26\4\u00cb\u00cd\58\35\2\u00cc\u00bc") - buf.write("\3\2\2\2\u00cc\u00c0\3\2\2\2\u00cc\u00c4\3\2\2\2\u00cc") - buf.write("\u00c7\3\2\2\2\u00cc\u00cb\3\2\2\2\u00cd\u00d8\3\2\2\2") - buf.write("\u00ce\u00cf\f\b\2\2\u00cf\u00d0\5\"\22\2\u00d0\u00d1") - buf.write("\5*\26\t\u00d1\u00d7\3\2\2\2\u00d2\u00d3\f\7\2\2\u00d3") - buf.write("\u00d4\5$\23\2\u00d4\u00d5\5*\26\b\u00d5\u00d7\3\2\2\2") - buf.write("\u00d6\u00ce\3\2\2\2\u00d6\u00d2\3\2\2\2\u00d7\u00da\3") - buf.write("\2\2\2\u00d8\u00d6\3\2\2\2\u00d8\u00d9\3\2\2\2\u00d9+") - buf.write("\3\2\2\2\u00da\u00d8\3\2\2\2\u00db\u00dc\7\26\2\2\u00dc") - buf.write("\u00dd\7-\2\2\u00dd\u00de\7\27\2\2\u00de\u00df\5.\30\2") - buf.write("\u00df\u00e0\7\30\2\2\u00e0-\3\2\2\2\u00e1\u00e3\5\60") - buf.write("\31\2\u00e2\u00e1\3\2\2\2\u00e3\u00e6\3\2\2\2\u00e4\u00e2") - buf.write("\3\2\2\2\u00e4\u00e5\3\2\2\2\u00e5/\3\2\2\2\u00e6\u00e4") - buf.write("\3\2\2\2\u00e7\u00e8\5\36\20\2\u00e8\u00e9\7\31\2\2\u00e9") - buf.write("\61\3\2\2\2\u00ea\u00ed\7-\2\2\u00eb\u00ed\5\64\33\2\u00ec") - buf.write("\u00ea\3\2\2\2\u00ec\u00eb\3\2\2\2\u00ed\u00ee\3\2\2\2") - buf.write("\u00ee\u00ef\7\23\2\2\u00ef\u00f0\7\32\2\2\u00f0\u00f1") - buf.write("\7-\2\2\u00f1\u00f2\7\t\2\2\u00f2\u00f3\7\13\2\2\u00f3") - buf.write("\63\3\2\2\2\u00f4\u00fb\5\66\34\2\u00f5\u00f6\7\33\2\2") - buf.write("\u00f6\u00fc\7-\2\2\u00f7\u00f8\7\4\2\2\u00f8\u00f9\5") - buf.write("*\26\2\u00f9\u00fa\7\5\2\2\u00fa\u00fc\3\2\2\2\u00fb\u00f5") - buf.write("\3\2\2\2\u00fb\u00f7\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd") - buf.write("\u00fb\3\2\2\2\u00fd\u00fe\3\2\2\2\u00fe\65\3\2\2\2\u00ff") - buf.write("\u0100\7-\2\2\u0100\67\3\2\2\2\u0101\u0102\7.\2\2\u0102") - buf.write("\u0103\7\t\2\2\u0103\u0104\5@!\2\u0104\u0105\7\13\2\2") - buf.write("\u01059\3\2\2\2\u0106\u0109\7-\2\2\u0107\u0109\5\64\33") - buf.write("\2\u0108\u0106\3\2\2\2\u0108\u0107\3\2\2\2\u0109\u010f") - buf.write("\3\2\2\2\u010a\u010d\7\n\2\2\u010b\u010e\7-\2\2\u010c") - buf.write("\u010e\5\64\33\2\u010d\u010b\3\2\2\2\u010d\u010c\3\2\2") - buf.write("\2\u010e\u0110\3\2\2\2\u010f\u010a\3\2\2\2\u0110\u0111") - buf.write("\3\2\2\2\u0111\u010f\3\2\2\2\u0111\u0112\3\2\2\2\u0112") - buf.write("\u0113\3\2\2\2\u0113\u0114\7\23\2\2\u0114\u0115\58\35") - buf.write("\2\u0115;\3\2\2\2\u0116\u0117\7\34\2\2\u0117\u0118\7.") - buf.write("\2\2\u0118\u0119\7\t\2\2\u0119\u011a\5> \2\u011a\u011b") - buf.write("\7\13\2\2\u011b\u011c\7\27\2\2\u011c\u011d\5\6\4\2\u011d") - buf.write("\u011e\7\30\2\2\u011e=\3\2\2\2\u011f\u0124\7-\2\2\u0120") - buf.write("\u0121\7\n\2\2\u0121\u0123\7-\2\2\u0122\u0120\3\2\2\2") - buf.write("\u0123\u0126\3\2\2\2\u0124\u0122\3\2\2\2\u0124\u0125\3") - buf.write("\2\2\2\u0125\u0128\3\2\2\2\u0126\u0124\3\2\2\2\u0127\u011f") - buf.write("\3\2\2\2\u0127\u0128\3\2\2\2\u0128?\3\2\2\2\u0129\u012e") - buf.write("\5*\26\2\u012a\u012b\7\n\2\2\u012b\u012d\5*\26\2\u012c") - buf.write("\u012a\3\2\2\2\u012d\u0130\3\2\2\2\u012e\u012c\3\2\2\2") - buf.write("\u012e\u012f\3\2\2\2\u012f\u0132\3\2\2\2\u0130\u012e\3") - buf.write("\2\2\2\u0131\u0129\3\2\2\2\u0131\u0132\3\2\2\2\u0132A") - buf.write("\3\2\2\2\u0133\u0134\b\"\1\2\u0134\u0135\7*\2\2\u0135") - buf.write("\u0140\5B\"\7\u0136\u0137\5*\26\2\u0137\u0138\5D#\2\u0138") - buf.write("\u0139\5*\26\2\u0139\u0140\3\2\2\2\u013a\u0140\7!\2\2") - buf.write("\u013b\u013c\7\t\2\2\u013c\u013d\5B\"\2\u013d\u013e\7") - buf.write("\13\2\2\u013e\u0140\3\2\2\2\u013f\u0133\3\2\2\2\u013f") - buf.write("\u0136\3\2\2\2\u013f\u013a\3\2\2\2\u013f\u013b\3\2\2\2") - buf.write("\u0140\u0147\3\2\2\2\u0141\u0142\f\5\2\2\u0142\u0143\5") - buf.write("F$\2\u0143\u0144\5B\"\6\u0144\u0146\3\2\2\2\u0145\u0141") - buf.write("\3\2\2\2\u0146\u0149\3\2\2\2\u0147\u0145\3\2\2\2\u0147") - buf.write("\u0148\3\2\2\2\u0148C\3\2\2\2\u0149\u0147\3\2\2\2\u014a") - buf.write("\u014b\t\6\2\2\u014bE\3\2\2\2\u014c\u014d\t\7\2\2\u014d") - buf.write("G\3\2\2\2\u014e\u0154\7+\2\2\u014f\u0154\7-\2\2\u0150") - buf.write("\u0154\5\34\17\2\u0151\u0154\5\64\33\2\u0152\u0154\7,") - buf.write("\2\2\u0153\u014e\3\2\2\2\u0153\u014f\3\2\2\2\u0153\u0150") - buf.write("\3\2\2\2\u0153\u0151\3\2\2\2\u0153\u0152\3\2\2\2\u0154") - buf.write("I\3\2\2\2\35PVfj\u0098\u009b\u00a1\u00b7\u00ba\u00c7\u00cc") - buf.write("\u00d6\u00d8\u00e4\u00ec\u00fb\u00fd\u0108\u010d\u0111") - buf.write("\u0124\u0127\u012e\u0131\u013f\u0147\u0153") + buf.write("8:<>@BDFH\2\t\3\2\f\17\3\2\20\21\3\2\36\37\3\2\34\35\4") + buf.write("\2 --\3\2\"\'\3\2()\2\u0169\2J\3\2\2\2\4P\3\2\2\2\6T") + buf.write("\3\2\2\2\bf\3\2\2\2\nj\3\2\2\2\fl\3\2\2\2\16r\3\2\2\2") + buf.write("\20|\3\2\2\2\22\u0082\3\2\2\2\24\u0089\3\2\2\2\26\u008c") + buf.write("\3\2\2\2\30\u008e\3\2\2\2\32\u0090\3\2\2\2\34\u0092\3") + buf.write("\2\2\2\36\u00a1\3\2\2\2 \u00a6\3\2\2\2\"\u00ab\3\2\2\2") + buf.write("$\u00ad\3\2\2\2&\u00af\3\2\2\2(\u00b1\3\2\2\2*\u00cc\3") + buf.write("\2\2\2,\u00db\3\2\2\2.\u00e4\3\2\2\2\60\u00ef\3\2\2\2") + buf.write("\62\u00f3\3\2\2\2\64\u00fb\3\2\2\2\66\u0106\3\2\2\28\u0108") + buf.write("\3\2\2\2:\u010f\3\2\2\2<\u011d\3\2\2\2>\u012e\3\2\2\2") + buf.write("@\u0138\3\2\2\2B\u0146\3\2\2\2D\u0151\3\2\2\2F\u0153\3") + buf.write("\2\2\2H\u015a\3\2\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2M") + buf.write("O\5\b\5\2NM\3\2\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2Q\5\3") + buf.write("\2\2\2RP\3\2\2\2SU\5\b\5\2TS\3\2\2\2UV\3\2\2\2VT\3\2\2") + buf.write("\2VW\3\2\2\2W\7\3\2\2\2Xg\5:\36\2Yg\5\36\20\2Zg\5 \21") + buf.write("\2[g\5\n\6\2\\g\5\20\t\2]g\5\24\13\2^g\5\30\r\2_g\5\22") + buf.write("\n\2`g\5\32\16\2ag\5,\27\2bg\5\62\32\2cg\5<\37\2dg\58") + buf.write("\35\2eg\5(\25\2fX\3\2\2\2fY\3\2\2\2fZ\3\2\2\2f[\3\2\2") + buf.write("\2f\\\3\2\2\2f]\3\2\2\2f^\3\2\2\2f_\3\2\2\2f`\3\2\2\2") + buf.write("fa\3\2\2\2fb\3\2\2\2fc\3\2\2\2fd\3\2\2\2fe\3\2\2\2g\t") + buf.write("\3\2\2\2hk\5\f\7\2ik\5\16\b\2jh\3\2\2\2ji\3\2\2\2k\13") + buf.write("\3\2\2\2lm\7\3\2\2mn\5B\"\2no\7\4\2\2op\5\6\4\2pq\7\5") + buf.write("\2\2q\r\3\2\2\2rs\7\3\2\2st\5B\"\2tu\7\4\2\2uv\5\6\4\2") + buf.write("vw\7\5\2\2wx\7\6\2\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2{\17") + buf.write("\3\2\2\2|}\7\7\2\2}~\5H%\2~\177\7\4\2\2\177\u0080\5\6") + buf.write("\4\2\u0080\u0081\7\5\2\2\u0081\21\3\2\2\2\u0082\u0083") + buf.write("\7\b\2\2\u0083\u0084\7\t\2\2\u0084\u0085\5*\26\2\u0085") + buf.write("\u0086\7\n\2\2\u0086\u0087\5*\26\2\u0087\u0088\7\13\2") + buf.write("\2\u0088\23\3\2\2\2\u0089\u008a\5\26\f\2\u008a\u008b\5") + buf.write("*\26\2\u008b\25\3\2\2\2\u008c\u008d\t\2\2\2\u008d\27\3") + buf.write("\2\2\2\u008e\u008f\t\3\2\2\u008f\31\3\2\2\2\u0090\u0091") + buf.write("\7\22\2\2\u0091\33\3\2\2\2\u0092\u009b\7\4\2\2\u0093\u0098") + buf.write("\5*\26\2\u0094\u0095\7\n\2\2\u0095\u0097\5*\26\2\u0096") + buf.write("\u0094\3\2\2\2\u0097\u009a\3\2\2\2\u0098\u0096\3\2\2\2") + buf.write("\u0098\u0099\3\2\2\2\u0099\u009c\3\2\2\2\u009a\u0098\3") + buf.write("\2\2\2\u009b\u0093\3\2\2\2\u009b\u009c\3\2\2\2\u009c\u009d") + buf.write("\3\2\2\2\u009d\u009e\7\5\2\2\u009e\35\3\2\2\2\u009f\u00a2") + buf.write("\7-\2\2\u00a0\u00a2\5\64\33\2\u00a1\u009f\3\2\2\2\u00a1") + buf.write("\u00a0\3\2\2\2\u00a2\u00a3\3\2\2\2\u00a3\u00a4\7\23\2") + buf.write("\2\u00a4\u00a5\5*\26\2\u00a5\37\3\2\2\2\u00a6\u00a7\7") + buf.write("\24\2\2\u00a7\u00a8\7\t\2\2\u00a8\u00a9\5*\26\2\u00a9") + buf.write("\u00aa\7\13\2\2\u00aa!\3\2\2\2\u00ab\u00ac\t\4\2\2\u00ac") + buf.write("#\3\2\2\2\u00ad\u00ae\t\5\2\2\u00ae%\3\2\2\2\u00af\u00b0") + buf.write("\7\35\2\2\u00b0\'\3\2\2\2\u00b1\u00ba\7\25\2\2\u00b2\u00b7") + buf.write("\5*\26\2\u00b3\u00b4\7\n\2\2\u00b4\u00b6\5*\26\2\u00b5") + buf.write("\u00b3\3\2\2\2\u00b6\u00b9\3\2\2\2\u00b7\u00b5\3\2\2\2") + buf.write("\u00b7\u00b8\3\2\2\2\u00b8\u00bb\3\2\2\2\u00b9\u00b7\3") + buf.write("\2\2\2\u00ba\u00b2\3\2\2\2\u00ba\u00bb\3\2\2\2\u00bb)") + buf.write("\3\2\2\2\u00bc\u00bd\b\26\1\2\u00bd\u00be\5&\24\2\u00be") + buf.write("\u00bf\5*\26\t\u00bf\u00cd\3\2\2\2\u00c0\u00c1\7\t\2\2") + buf.write("\u00c1\u00c2\5*\26\2\u00c2\u00c3\7\13\2\2\u00c3\u00cd") + buf.write("\3\2\2\2\u00c4\u00cd\5H%\2\u00c5\u00c8\7-\2\2\u00c6\u00c8") + buf.write("\5\64\33\2\u00c7\u00c5\3\2\2\2\u00c7\u00c6\3\2\2\2\u00c8") + buf.write("\u00c9\3\2\2\2\u00c9\u00ca\7\23\2\2\u00ca\u00cd\5*\26") + buf.write("\4\u00cb\u00cd\58\35\2\u00cc\u00bc\3\2\2\2\u00cc\u00c0") + buf.write("\3\2\2\2\u00cc\u00c4\3\2\2\2\u00cc\u00c7\3\2\2\2\u00cc") + buf.write("\u00cb\3\2\2\2\u00cd\u00d8\3\2\2\2\u00ce\u00cf\f\b\2\2") + buf.write("\u00cf\u00d0\5\"\22\2\u00d0\u00d1\5*\26\t\u00d1\u00d7") + buf.write("\3\2\2\2\u00d2\u00d3\f\7\2\2\u00d3\u00d4\5$\23\2\u00d4") + buf.write("\u00d5\5*\26\b\u00d5\u00d7\3\2\2\2\u00d6\u00ce\3\2\2\2") + buf.write("\u00d6\u00d2\3\2\2\2\u00d7\u00da\3\2\2\2\u00d8\u00d6\3") + buf.write("\2\2\2\u00d8\u00d9\3\2\2\2\u00d9+\3\2\2\2\u00da\u00d8") + buf.write("\3\2\2\2\u00db\u00dc\7\26\2\2\u00dc\u00dd\7-\2\2\u00dd") + buf.write("\u00de\7\27\2\2\u00de\u00df\5.\30\2\u00df\u00e0\7\30\2") + buf.write("\2\u00e0-\3\2\2\2\u00e1\u00e3\5\60\31\2\u00e2\u00e1\3") + buf.write("\2\2\2\u00e3\u00e6\3\2\2\2\u00e4\u00e2\3\2\2\2\u00e4\u00e5") + buf.write("\3\2\2\2\u00e5\u00ea\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e7") + buf.write("\u00e9\5<\37\2\u00e8\u00e7\3\2\2\2\u00e9\u00ec\3\2\2\2") + buf.write("\u00ea\u00e8\3\2\2\2\u00ea\u00eb\3\2\2\2\u00eb/\3\2\2") + buf.write("\2\u00ec\u00ea\3\2\2\2\u00ed\u00f0\5\36\20\2\u00ee\u00f0") + buf.write("\5\62\32\2\u00ef\u00ed\3\2\2\2\u00ef\u00ee\3\2\2\2\u00f0") + buf.write("\61\3\2\2\2\u00f1\u00f4\7-\2\2\u00f2\u00f4\5\64\33\2\u00f3") + buf.write("\u00f1\3\2\2\2\u00f3\u00f2\3\2\2\2\u00f4\u00f5\3\2\2\2") + buf.write("\u00f5\u00f6\7\23\2\2\u00f6\u00f7\7\31\2\2\u00f7\u00f8") + buf.write("\7-\2\2\u00f8\u00f9\7\t\2\2\u00f9\u00fa\7\13\2\2\u00fa") + buf.write("\63\3\2\2\2\u00fb\u0102\5\66\34\2\u00fc\u00fd\7\32\2\2") + buf.write("\u00fd\u0103\7-\2\2\u00fe\u00ff\7\4\2\2\u00ff\u0100\5") + buf.write("*\26\2\u0100\u0101\7\5\2\2\u0101\u0103\3\2\2\2\u0102\u00fc") + buf.write("\3\2\2\2\u0102\u00fe\3\2\2\2\u0103\u0104\3\2\2\2\u0104") + buf.write("\u0102\3\2\2\2\u0104\u0105\3\2\2\2\u0105\65\3\2\2\2\u0106") + buf.write("\u0107\7-\2\2\u0107\67\3\2\2\2\u0108\u0109\7.\2\2\u0109") + buf.write("\u010a\7\t\2\2\u010a\u010b\5@!\2\u010b\u010c\7\13\2\2") + buf.write("\u010c9\3\2\2\2\u010d\u0110\7-\2\2\u010e\u0110\5\64\33") + buf.write("\2\u010f\u010d\3\2\2\2\u010f\u010e\3\2\2\2\u0110\u0116") + buf.write("\3\2\2\2\u0111\u0114\7\n\2\2\u0112\u0115\7-\2\2\u0113") + buf.write("\u0115\5\64\33\2\u0114\u0112\3\2\2\2\u0114\u0113\3\2\2") + buf.write("\2\u0115\u0117\3\2\2\2\u0116\u0111\3\2\2\2\u0117\u0118") + buf.write("\3\2\2\2\u0118\u0116\3\2\2\2\u0118\u0119\3\2\2\2\u0119") + buf.write("\u011a\3\2\2\2\u011a\u011b\7\23\2\2\u011b\u011c\58\35") + buf.write("\2\u011c;\3\2\2\2\u011d\u011e\7\33\2\2\u011e\u011f\7.") + buf.write("\2\2\u011f\u0120\7\t\2\2\u0120\u0121\5> \2\u0121\u0122") + buf.write("\7\13\2\2\u0122\u0123\7\27\2\2\u0123\u0124\5\6\4\2\u0124") + buf.write("\u0125\7\30\2\2\u0125=\3\2\2\2\u0126\u012b\t\6\2\2\u0127") + buf.write("\u0128\7\n\2\2\u0128\u012a\7-\2\2\u0129\u0127\3\2\2\2") + buf.write("\u012a\u012d\3\2\2\2\u012b\u0129\3\2\2\2\u012b\u012c\3") + buf.write("\2\2\2\u012c\u012f\3\2\2\2\u012d\u012b\3\2\2\2\u012e\u0126") + buf.write("\3\2\2\2\u012e\u012f\3\2\2\2\u012f?\3\2\2\2\u0130\u0135") + buf.write("\5*\26\2\u0131\u0132\7\n\2\2\u0132\u0134\5*\26\2\u0133") + buf.write("\u0131\3\2\2\2\u0134\u0137\3\2\2\2\u0135\u0133\3\2\2\2") + buf.write("\u0135\u0136\3\2\2\2\u0136\u0139\3\2\2\2\u0137\u0135\3") + buf.write("\2\2\2\u0138\u0130\3\2\2\2\u0138\u0139\3\2\2\2\u0139A") + buf.write("\3\2\2\2\u013a\u013b\b\"\1\2\u013b\u013c\7*\2\2\u013c") + buf.write("\u0147\5B\"\7\u013d\u013e\5*\26\2\u013e\u013f\5D#\2\u013f") + buf.write("\u0140\5*\26\2\u0140\u0147\3\2\2\2\u0141\u0147\7!\2\2") + buf.write("\u0142\u0143\7\t\2\2\u0143\u0144\5B\"\2\u0144\u0145\7") + buf.write("\13\2\2\u0145\u0147\3\2\2\2\u0146\u013a\3\2\2\2\u0146") + buf.write("\u013d\3\2\2\2\u0146\u0141\3\2\2\2\u0146\u0142\3\2\2\2") + buf.write("\u0147\u014e\3\2\2\2\u0148\u0149\f\5\2\2\u0149\u014a\5") + buf.write("F$\2\u014a\u014b\5B\"\6\u014b\u014d\3\2\2\2\u014c\u0148") + buf.write("\3\2\2\2\u014d\u0150\3\2\2\2\u014e\u014c\3\2\2\2\u014e") + buf.write("\u014f\3\2\2\2\u014fC\3\2\2\2\u0150\u014e\3\2\2\2\u0151") + buf.write("\u0152\t\7\2\2\u0152E\3\2\2\2\u0153\u0154\t\b\2\2\u0154") + buf.write("G\3\2\2\2\u0155\u015b\7+\2\2\u0156\u015b\7-\2\2\u0157") + buf.write("\u015b\5\34\17\2\u0158\u015b\5\64\33\2\u0159\u015b\7,") + buf.write("\2\2\u015a\u0155\3\2\2\2\u015a\u0156\3\2\2\2\u015a\u0157") + buf.write("\3\2\2\2\u015a\u0158\3\2\2\2\u015a\u0159\3\2\2\2\u015b") + buf.write("I\3\2\2\2\37PVfj\u0098\u009b\u00a1\u00b7\u00ba\u00c7\u00cc") + buf.write("\u00d6\u00d8\u00e4\u00ea\u00ef\u00f3\u0102\u0104\u010f") + buf.write("\u0114\u0118\u012b\u012e\u0135\u0138\u0146\u014e\u015a") return buf.getvalue() @@ -174,8 +179,8 @@ class tlangParser ( Parser ): "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'return'", "'class'", "'{'", "'}'", - "';'", "'new'", "'.'", "'def'", "'+'", "'-'", "'*'", - "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", + "'new'", "'.'", "'def'", "'+'", "'-'", "'*'", "'/'", + "'self'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", "", "", "", @@ -184,8 +189,8 @@ class tlangParser ( Parser ): "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "PLUS", "MINUS", - "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", + "", "", "PLUS", "MINUS", "MUL", + "DIV", "Self", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", "NAME", "Whitespace" ] @@ -263,11 +268,11 @@ class tlangParser ( Parser ): T__22=23 T__23=24 T__24=25 - T__25=26 - PLUS=27 - MINUS=28 - MUL=29 - DIV=30 + PLUS=26 + MINUS=27 + MUL=28 + DIV=29 + Self=30 PENCOND=31 LT=32 GT=33 @@ -372,7 +377,7 @@ def instruction_list(self): self.state = 78 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__25) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): self.state = 75 self.instruction() self.state = 80 @@ -429,7 +434,7 @@ def strict_ilist(self): self.state = 84 self._errHandler.sync(self) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__25) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): break except RecognitionException as re: @@ -1767,6 +1772,13 @@ def classAttributeDeclaration(self, i:int=None): return self.getTypedRuleContext(tlangParser.ClassAttributeDeclarationContext,i) + def functionDeclaration(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.FunctionDeclarationContext) + else: + return self.getTypedRuleContext(tlangParser.FunctionDeclarationContext,i) + + def getRuleIndex(self): return tlangParser.RULE_classBody @@ -1796,6 +1808,16 @@ def classBody(self): self._errHandler.sync(self) _la = self._input.LA(1) + self.state = 232 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==tlangParser.T__24: + self.state = 229 + self.functionDeclaration() + self.state = 234 + self._errHandler.sync(self) + _la = self._input.LA(1) + except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -1815,6 +1837,10 @@ def assignment(self): return self.getTypedRuleContext(tlangParser.AssignmentContext,0) + def objectInstantiation(self): + return self.getTypedRuleContext(tlangParser.ObjectInstantiationContext,0) + + def getRuleIndex(self): return tlangParser.RULE_classAttributeDeclaration @@ -1832,11 +1858,22 @@ def classAttributeDeclaration(self): localctx = tlangParser.ClassAttributeDeclarationContext(self, self._ctx, self.state) self.enterRule(localctx, 46, self.RULE_classAttributeDeclaration) try: - self.enterOuterAlt(localctx, 1) - self.state = 229 - self.assignment() - self.state = 230 - self.match(tlangParser.T__22) + self.state = 237 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input,15,self._ctx) + if la_ == 1: + self.enterOuterAlt(localctx, 1) + self.state = 235 + self.assignment() + pass + + elif la_ == 2: + self.enterOuterAlt(localctx, 2) + self.state = 236 + self.objectInstantiation() + pass + + except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -1880,29 +1917,29 @@ def objectInstantiation(self): self.enterRule(localctx, 48, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 234 + self.state = 241 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,14,self._ctx) + la_ = self._interp.adaptivePredict(self._input,16,self._ctx) if la_ == 1: - self.state = 232 + self.state = 239 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 233 + self.state = 240 self.objectOrArrayAccess() pass - self.state = 236 + self.state = 243 self.match(tlangParser.T__16) - self.state = 237 - self.match(tlangParser.T__23) - self.state = 238 + self.state = 244 + self.match(tlangParser.T__22) + self.state = 245 self.match(tlangParser.VAR) - self.state = 239 + self.state = 246 self.match(tlangParser.T__6) - self.state = 240 + self.state = 247 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1954,28 +1991,28 @@ def objectOrArrayAccess(self): self.enterRule(localctx, 50, self.RULE_objectOrArrayAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 242 + self.state = 249 self.baseAccess() - self.state = 249 + self.state = 256 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 249 + self.state = 256 self._errHandler.sync(self) token = self._input.LA(1) - if token in [tlangParser.T__24]: - self.state = 243 - self.match(tlangParser.T__24) - self.state = 244 + if token in [tlangParser.T__23]: + self.state = 250 + self.match(tlangParser.T__23) + self.state = 251 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 245 + self.state = 252 self.match(tlangParser.T__1) - self.state = 246 + self.state = 253 self.expression(0) - self.state = 247 + self.state = 254 self.match(tlangParser.T__2) pass else: @@ -1984,9 +2021,9 @@ def objectOrArrayAccess(self): else: raise NoViableAltException(self) - self.state = 251 + self.state = 258 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,16,self._ctx) + _alt = self._interp.adaptivePredict(self._input,18,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2024,7 +2061,7 @@ def baseAccess(self): self.enterRule(localctx, 52, self.RULE_baseAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 253 + self.state = 260 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -2066,13 +2103,13 @@ def functionCall(self): self.enterRule(localctx, 54, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 255 + self.state = 262 self.match(tlangParser.NAME) - self.state = 256 + self.state = 263 self.match(tlangParser.T__6) - self.state = 257 + self.state = 264 self.arguments() - self.state = 258 + self.state = 265 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2125,49 +2162,49 @@ def functionCallWithReturnValues(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 262 + self.state = 269 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,17,self._ctx) + la_ = self._interp.adaptivePredict(self._input,19,self._ctx) if la_ == 1: - self.state = 260 + self.state = 267 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 261 + self.state = 268 self.objectOrArrayAccess() pass - self.state = 269 + self.state = 276 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 264 + self.state = 271 self.match(tlangParser.T__7) - self.state = 267 + self.state = 274 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,18,self._ctx) + la_ = self._interp.adaptivePredict(self._input,20,self._ctx) if la_ == 1: - self.state = 265 + self.state = 272 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 266 + self.state = 273 self.objectOrArrayAccess() pass - self.state = 271 + self.state = 278 self._errHandler.sync(self) _la = self._input.LA(1) if not (_la==tlangParser.T__7): break - self.state = 273 + self.state = 280 self.match(tlangParser.T__16) - self.state = 274 + self.state = 281 self.functionCall() except RecognitionException as re: localctx.exception = re @@ -2213,21 +2250,21 @@ def functionDeclaration(self): self.enterRule(localctx, 58, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 276 - self.match(tlangParser.T__25) - self.state = 277 + self.state = 283 + self.match(tlangParser.T__24) + self.state = 284 self.match(tlangParser.NAME) - self.state = 278 + self.state = 285 self.match(tlangParser.T__6) - self.state = 279 + self.state = 286 self.parameters() - self.state = 280 + self.state = 287 self.match(tlangParser.T__8) - self.state = 281 + self.state = 288 self.match(tlangParser.T__20) - self.state = 282 + self.state = 289 self.strict_ilist() - self.state = 283 + self.state = 290 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -2250,6 +2287,9 @@ def VAR(self, i:int=None): else: return self.getToken(tlangParser.VAR, i) + def Self(self): + return self.getToken(tlangParser.Self, 0) + def getRuleIndex(self): return tlangParser.RULE_parameters @@ -2269,21 +2309,26 @@ def parameters(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 293 + self.state = 300 self._errHandler.sync(self) _la = self._input.LA(1) - if _la==tlangParser.VAR: - self.state = 285 - self.match(tlangParser.VAR) - self.state = 290 + if _la==tlangParser.Self or _la==tlangParser.VAR: + self.state = 292 + _la = self._input.LA(1) + if not(_la==tlangParser.Self or _la==tlangParser.VAR): + self._errHandler.recoverInline(self) + else: + self._errHandler.reportMatch(self) + self.consume() + self.state = 297 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 286 + self.state = 293 self.match(tlangParser.T__7) - self.state = 287 + self.state = 294 self.match(tlangParser.VAR) - self.state = 292 + self.state = 299 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2330,21 +2375,21 @@ def arguments(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 303 + self.state = 310 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 295 + self.state = 302 self.expression(0) - self.state = 300 + self.state = 307 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 296 + self.state = 303 self.match(tlangParser.T__7) - self.state = 297 + self.state = 304 self.expression(0) - self.state = 302 + self.state = 309 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2413,44 +2458,44 @@ def condition(self, _p:int=0): self.enterRecursionRule(localctx, 64, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 317 + self.state = 324 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,24,self._ctx) + la_ = self._interp.adaptivePredict(self._input,26,self._ctx) if la_ == 1: - self.state = 306 + self.state = 313 self.match(tlangParser.NOT) - self.state = 307 + self.state = 314 self.condition(5) pass elif la_ == 2: - self.state = 308 + self.state = 315 self.expression(0) - self.state = 309 + self.state = 316 self.binCondOp() - self.state = 310 + self.state = 317 self.expression(0) pass elif la_ == 3: - self.state = 312 + self.state = 319 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 313 + self.state = 320 self.match(tlangParser.T__6) - self.state = 314 + self.state = 321 self.condition(0) - self.state = 315 + self.state = 322 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 325 + self.state = 332 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,25,self._ctx) + _alt = self._interp.adaptivePredict(self._input,27,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -2458,17 +2503,17 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 319 + self.state = 326 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 320 + self.state = 327 self.logicOp() - self.state = 321 + self.state = 328 self.condition(4) - self.state = 327 + self.state = 334 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,25,self._ctx) + _alt = self._interp.adaptivePredict(self._input,27,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2522,7 +2567,7 @@ def binCondOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 328 + self.state = 335 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2569,7 +2614,7 @@ def logicOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 330 + self.state = 337 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2625,36 +2670,36 @@ def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) self.enterRule(localctx, 70, self.RULE_value) try: - self.state = 337 + self.state = 344 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,26,self._ctx) + la_ = self._interp.adaptivePredict(self._input,28,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 332 + self.state = 339 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 333 + self.state = 340 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 334 + self.state = 341 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 335 + self.state = 342 self.objectOrArrayAccess() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 336 + self.state = 343 self.match(tlangParser.REAL) pass From 15ed55192f647ff1ff2e9f1d140e333734ea85d6 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Tue, 4 Mar 2025 12:49:25 +0530 Subject: [PATCH 13/47] inheritance on member variables and method call done! --- ChironCore/ChironAST/ChironAST.py | 24 +- ChironCore/ChironAST/builder.py | 64 +- ChironCore/example/kachuapur3.tl | 18 +- ChironCore/example/kachuapur4.tl | 26 + ChironCore/interpreter.py | 36 +- ChironCore/turtparse/tlang.g4 | 9 +- ChironCore/turtparse/tlang.interp | 5 +- ChironCore/turtparse/tlang.tokens | 52 +- ChironCore/turtparse/tlangLexer.interp | 5 +- ChironCore/turtparse/tlangLexer.py | 268 ++++--- ChironCore/turtparse/tlangLexer.tokens | 52 +- ChironCore/turtparse/tlangParser.py | 930 ++++++++++++++----------- ChironCore/turtparse/tlangVisitor.py | 5 + 13 files changed, 862 insertions(+), 632 deletions(-) create mode 100644 ChironCore/example/kachuapur4.tl diff --git a/ChironCore/ChironAST/ChironAST.py b/ChironCore/ChironAST/ChironAST.py index c0b2954..decb7b4 100644 --- a/ChironCore/ChironAST/ChironAST.py +++ b/ChironCore/ChironAST/ChironAST.py @@ -31,10 +31,11 @@ def __str__(self): class ClassDeclarationCommand(Instruction): - def __init__(self, className, attributes, objectAttributes): + def __init__(self, className, baseClasses, attributes, objectAttributes): self.className = className # Class name as a string self.attributes = attributes # List of AssignmentCommand objects self.objectAttributes = objectAttributes + self.baseClasses = baseClasses def __str__(self): attr_str = "\n ".join(str(attr) for attr in self.attributes) @@ -115,13 +116,17 @@ def __str__(self): class FunctionCallCommand(Instruction): - def __init__(self, fname, arguments=None): + def __init__(self, fname, arguments=None, caller = None): self.name = fname self.args = arguments if arguments is not None else [] + self.caller = caller def __str__(self): args_str = ", ".join(str(arg) for arg in self.args) - return f"{self.name}({args_str})" + if self.caller: + return f"{self.caller}.{self.name}({args_str})" + else: + return f"{self.name}({args_str})" class ReturnCommand(Instruction): @@ -348,6 +353,19 @@ def __str__(self): result += f".{access}" return result +class MethodCaller: + def __init__(self, caller): + self.caller = caller + + def __str__(self): + result = "" + for access in self.caller: + if isinstance(access, list): # Array indexing + indices_str = "".join(f"[{idx}]" for idx in access) + result += indices_str + else: # Object attribute access + result += f".{access}" + return result[1:] class ObjectInstantiationCommand(Instruction): def __init__(self, target, class_name): diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 27611f6..8cffce9 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -53,8 +53,11 @@ def visitStrict_ilist(self, ctx: tlangParser.Strict_ilistContext): return instrList - def visitFunctionDeclaration(self, ctx: tlangParser.FunctionDeclarationContext): - functionName = ctx.NAME().getText() + def visitFunctionDeclaration(self, ctx: tlangParser.FunctionDeclarationContext, className = None): + if className: + functionName = className + "@" + ctx.NAME().getText() + else: + functionName = ctx.NAME().getText() functionParams = [param.getText() for param in ctx.parameters( ).VAR()] if ctx.parameters() is not None else None functionBody = self.visit(ctx.strict_ilist()) @@ -62,9 +65,16 @@ def visitFunctionDeclaration(self, ctx: tlangParser.FunctionDeclarationContext): def visitFunctionCall(self, ctx: tlangParser.FunctionCallContext): functionName = ctx.NAME().getText() + print("######caller context", ctx.methodCaller()) + callerClass = self.visitMethodCaller(ctx.methodCaller()) if ctx.methodCaller().children is not None else None functionArgs = [self.visit(arg) for arg in ctx.arguments( - ).expression()] if ctx.arguments() is not None else None - return [(ChironAST.FunctionCallCommand(functionName, functionArgs), 1)] + ).expression()] if ctx.arguments() is not None else [] + if callerClass: + print("###Caller Class", str(callerClass)) + print("##########") + functionArgs.insert(0, callerClass) + print(functionArgs) + return [(ChironAST.FunctionCallCommand(functionName, functionArgs, callerClass), 1)] def visitFunctionCallWithReturnValues(self, ctx: tlangParser.FunctionCallWithReturnValuesContext): functionCallCommand = self.visitFunctionCall(ctx.functionCall()) @@ -83,11 +93,13 @@ def visitAssignment(self, ctx: tlangParser.AssignmentContext): # print(ctx.VAR().getText(),ctx.expression().getText()) lval = self.getLval(ctx) rval = self.visit(ctx.expression()) + print(lval, rval, "Inside assignment") return [(ChironAST.AssignmentCommand(lval, rval), 1)] def visitObjectOrArrayAccess(self, ctx: tlangParser.ObjectOrArrayAccessContext): - # Start with the base variable (first part of access) + base = ctx.baseAccess().VAR().getText() + # Traverse through the nested access ('.' for attributes, '[]' for indices) accesses = [] @@ -113,6 +125,32 @@ def visitObjectOrArrayAccess(self, ctx: tlangParser.ObjectOrArrayAccessContext): i += 1 # Move to the next child return ChironAST.ObjectOrArrayAccess(base, accesses) + + def visitMethodCaller(self, ctx: tlangParser.MethodCallerContext): + accesses = [] + i = 0 + + while i < len(ctx.children): + child = ctx.children[i] + + if isinstance(child, TerminalNodeImpl) : + # Current child must be a VAR (attribute access) + accesses.append(ctx.children[i].getText()) + i += 1 # skip '.' + + elif child.getText() == '[': + # Array access: Process the expression inside `[]` + i += 1 # Move to expression inside brackets + # Visit and evaluate expression + expr = self.visit(ctx.children[i]) + accesses.append([expr.val]) # Store index as a list + + i += 2 # Skip closing ']' + + i += 1 # Move to the next child + + print(accesses) + return ChironAST.MethodCaller(accesses) def visitObjectInstantiation(self, ctx: tlangParser.ObjectInstantiationContext): # Extract the left-hand side (target variable or object access) @@ -124,9 +162,11 @@ def visitObjectInstantiation(self, ctx: tlangParser.ObjectInstantiationContext): return [(ChironAST.ObjectInstantiationCommand(lval, class_name), 1)] def visitClassDeclaration(self, ctx: tlangParser.ClassDeclarationContext): - className = ctx.VAR().getText() # Extract class name + className = ctx.VAR()[0].getText() # Extract class name + baseClasses = [var.getText() for var in ctx.VAR()[1:]] if len(ctx.VAR()) > 1 else None # Extract base classes attributes = [] objectAttributes = [] + methods = [] if ctx.classBody(): for attrDecl in ctx.classBody().classAttributeDeclaration(): if isinstance(attrDecl.assignment(), tlangParser.AssignmentContext): @@ -134,9 +174,10 @@ def visitClassDeclaration(self, ctx: tlangParser.ClassDeclarationContext): attributes.extend(assign_instr) if isinstance(attrDecl.objectInstantiation(), tlangParser.ObjectInstantiationContext): objectAttributes.extend(self.visitObjectInstantiation(attrDecl.objectInstantiation())) - + for methodCtx in ctx.classBody().functionDeclaration(): + methods.extend(self.visitFunctionDeclaration(methodCtx, className)) # Extract methods of the class - return [(ChironAST.ClassDeclarationCommand(className, attributes, objectAttributes), 1)] + return [(ChironAST.ClassDeclarationCommand(className, baseClasses, attributes, objectAttributes), 1)] + methods # def visitArrayAccess(self, ctx:tlangParser.ArrayAccessContext): # var = ctx.VAR().getText() @@ -162,11 +203,14 @@ def visitValue(self, ctx: tlangParser.ValueContext): def visitFunctionCallExpr(self, ctx: tlangParser.FunctionCallExprContext): functionCallCtx = ctx.functionCall() functionName = functionCallCtx.NAME().getText() + callerClass = self.visitMethodCaller(functionCallCtx.methodCaller()) if functionCallCtx.methodCaller().children is not None else None functionArgs = [self.visit(arg) for arg in functionCallCtx.arguments( - ).expression()] if functionCallCtx.arguments() is not None else None + ).expression()] if functionCallCtx.arguments() is not None else [] + if callerClass: + functionArgs.insert(0, callerClass) returnLocation = ChironAST.Var(":__reg_" + str(self.virtualRegCount)) self.virtualRegCount += 1 - currStmtList = [(ChironAST.FunctionCallCommand(functionName, functionArgs), 1)] + [(ChironAST.ReadReturnCommand([returnLocation]), 1)] + currStmtList = [(ChironAST.FunctionCallCommand(functionName, functionArgs, callerClass), 1)] + [(ChironAST.ReadReturnCommand([returnLocation]), 1)] self.subStmtList.extend(currStmtList) return returnLocation diff --git a/ChironCore/example/kachuapur3.tl b/ChironCore/example/kachuapur3.tl index cbd1d4c..d137ae4 100644 --- a/ChironCore/example/kachuapur3.tl +++ b/ChironCore/example/kachuapur3.tl @@ -1,16 +1,32 @@ class :Point { :x = 6 :y = 4 + def draw(:self) + { + print(:self.:x) + return + } + def drawy(:self) + { + print(:self.:y) + return + } } class :Circle { :point = new :Point() + } :point = new :Point() :circle = new :Circle() +:circle1 = new :Circle() print(:circle.:point.:x) -:circle.:point.:x = :circle.:point.:y = 0 +:circle.:point.:x = :circle.:point.:y = -100 print(:point.:x) print(:circle.:point.:x) +print(:circle1.:point.:x) +:circle.:point.draw() + +:circle1.:point.drawy() \ No newline at end of file diff --git a/ChironCore/example/kachuapur4.tl b/ChironCore/example/kachuapur4.tl new file mode 100644 index 0000000..151500e --- /dev/null +++ b/ChironCore/example/kachuapur4.tl @@ -0,0 +1,26 @@ +class :Animal { + :tail = 1 +} + +class :Cat(:Animal) { + :legs = 4 + def printProperties(:self) + { + print(:self.:tail) + print(:self.:legs) + return + } + def incrementLegs(:self, :delta) + { + :self.:legs = :self.:legs + :delta + return :self.:legs + } +} + + +:whiskers2 = new :Cat() +:delta = 4 +:legs = :whiskers2.incrementLegs(:delta) +print(:legs) +print(:whiskers2.:legs) + diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index ab26b43..abfff5d 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -8,6 +8,7 @@ def addContext(s): s= re.sub(r'(?' @@ -77,7 +76,6 @@ PLUS MINUS MUL DIV -Self PENCOND LT GT @@ -123,6 +121,7 @@ objectInstantiation objectOrArrayAccess baseAccess functionCall +methodCaller functionCallWithReturnValues functionDeclaration parameters @@ -134,4 +133,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 349, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 79, 10, 3, 12, 3, 14, 3, 82, 11, 3, 3, 4, 6, 4, 85, 10, 4, 13, 4, 14, 4, 86, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 103, 10, 5, 3, 6, 3, 6, 5, 6, 107, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 151, 10, 15, 12, 15, 14, 15, 154, 11, 15, 5, 15, 156, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 162, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 182, 10, 21, 12, 21, 14, 21, 185, 11, 21, 5, 21, 187, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 200, 10, 22, 3, 22, 3, 22, 3, 22, 5, 22, 205, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 215, 10, 22, 12, 22, 14, 22, 218, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 227, 10, 24, 12, 24, 14, 24, 230, 11, 24, 3, 24, 7, 24, 233, 10, 24, 12, 24, 14, 24, 236, 11, 24, 3, 25, 3, 25, 5, 25, 240, 10, 25, 3, 26, 3, 26, 5, 26, 244, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 259, 10, 27, 13, 27, 14, 27, 260, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 272, 10, 30, 3, 30, 3, 30, 3, 30, 5, 30, 277, 10, 30, 6, 30, 279, 10, 30, 13, 30, 14, 30, 280, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 7, 32, 298, 10, 32, 12, 32, 14, 32, 301, 11, 32, 5, 32, 303, 10, 32, 3, 33, 3, 33, 3, 33, 7, 33, 308, 10, 33, 12, 33, 14, 33, 311, 11, 33, 5, 33, 313, 10, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 327, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 7, 34, 333, 10, 34, 12, 34, 14, 34, 336, 11, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 347, 10, 37, 3, 37, 2, 4, 42, 66, 38, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 2, 9, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 4, 2, 32, 32, 45, 45, 3, 2, 34, 39, 3, 2, 40, 41, 2, 361, 2, 74, 3, 2, 2, 2, 4, 80, 3, 2, 2, 2, 6, 84, 3, 2, 2, 2, 8, 102, 3, 2, 2, 2, 10, 106, 3, 2, 2, 2, 12, 108, 3, 2, 2, 2, 14, 114, 3, 2, 2, 2, 16, 124, 3, 2, 2, 2, 18, 130, 3, 2, 2, 2, 20, 137, 3, 2, 2, 2, 22, 140, 3, 2, 2, 2, 24, 142, 3, 2, 2, 2, 26, 144, 3, 2, 2, 2, 28, 146, 3, 2, 2, 2, 30, 161, 3, 2, 2, 2, 32, 166, 3, 2, 2, 2, 34, 171, 3, 2, 2, 2, 36, 173, 3, 2, 2, 2, 38, 175, 3, 2, 2, 2, 40, 177, 3, 2, 2, 2, 42, 204, 3, 2, 2, 2, 44, 219, 3, 2, 2, 2, 46, 228, 3, 2, 2, 2, 48, 239, 3, 2, 2, 2, 50, 243, 3, 2, 2, 2, 52, 251, 3, 2, 2, 2, 54, 262, 3, 2, 2, 2, 56, 264, 3, 2, 2, 2, 58, 271, 3, 2, 2, 2, 60, 285, 3, 2, 2, 2, 62, 302, 3, 2, 2, 2, 64, 312, 3, 2, 2, 2, 66, 326, 3, 2, 2, 2, 68, 337, 3, 2, 2, 2, 70, 339, 3, 2, 2, 2, 72, 346, 3, 2, 2, 2, 74, 75, 5, 4, 3, 2, 75, 76, 7, 2, 2, 3, 76, 3, 3, 2, 2, 2, 77, 79, 5, 8, 5, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 5, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 85, 5, 8, 5, 2, 84, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 7, 3, 2, 2, 2, 88, 103, 5, 58, 30, 2, 89, 103, 5, 30, 16, 2, 90, 103, 5, 32, 17, 2, 91, 103, 5, 10, 6, 2, 92, 103, 5, 16, 9, 2, 93, 103, 5, 20, 11, 2, 94, 103, 5, 24, 13, 2, 95, 103, 5, 18, 10, 2, 96, 103, 5, 26, 14, 2, 97, 103, 5, 44, 23, 2, 98, 103, 5, 50, 26, 2, 99, 103, 5, 60, 31, 2, 100, 103, 5, 56, 29, 2, 101, 103, 5, 40, 21, 2, 102, 88, 3, 2, 2, 2, 102, 89, 3, 2, 2, 2, 102, 90, 3, 2, 2, 2, 102, 91, 3, 2, 2, 2, 102, 92, 3, 2, 2, 2, 102, 93, 3, 2, 2, 2, 102, 94, 3, 2, 2, 2, 102, 95, 3, 2, 2, 2, 102, 96, 3, 2, 2, 2, 102, 97, 3, 2, 2, 2, 102, 98, 3, 2, 2, 2, 102, 99, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 102, 101, 3, 2, 2, 2, 103, 9, 3, 2, 2, 2, 104, 107, 5, 12, 7, 2, 105, 107, 5, 14, 8, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 11, 3, 2, 2, 2, 108, 109, 7, 3, 2, 2, 109, 110, 5, 66, 34, 2, 110, 111, 7, 4, 2, 2, 111, 112, 5, 6, 4, 2, 112, 113, 7, 5, 2, 2, 113, 13, 3, 2, 2, 2, 114, 115, 7, 3, 2, 2, 115, 116, 5, 66, 34, 2, 116, 117, 7, 4, 2, 2, 117, 118, 5, 6, 4, 2, 118, 119, 7, 5, 2, 2, 119, 120, 7, 6, 2, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 15, 3, 2, 2, 2, 124, 125, 7, 7, 2, 2, 125, 126, 5, 72, 37, 2, 126, 127, 7, 4, 2, 2, 127, 128, 5, 6, 4, 2, 128, 129, 7, 5, 2, 2, 129, 17, 3, 2, 2, 2, 130, 131, 7, 8, 2, 2, 131, 132, 7, 9, 2, 2, 132, 133, 5, 42, 22, 2, 133, 134, 7, 10, 2, 2, 134, 135, 5, 42, 22, 2, 135, 136, 7, 11, 2, 2, 136, 19, 3, 2, 2, 2, 137, 138, 5, 22, 12, 2, 138, 139, 5, 42, 22, 2, 139, 21, 3, 2, 2, 2, 140, 141, 9, 2, 2, 2, 141, 23, 3, 2, 2, 2, 142, 143, 9, 3, 2, 2, 143, 25, 3, 2, 2, 2, 144, 145, 7, 18, 2, 2, 145, 27, 3, 2, 2, 2, 146, 155, 7, 4, 2, 2, 147, 152, 5, 42, 22, 2, 148, 149, 7, 10, 2, 2, 149, 151, 5, 42, 22, 2, 150, 148, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 156, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 147, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 158, 7, 5, 2, 2, 158, 29, 3, 2, 2, 2, 159, 162, 7, 45, 2, 2, 160, 162, 5, 52, 27, 2, 161, 159, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 164, 7, 19, 2, 2, 164, 165, 5, 42, 22, 2, 165, 31, 3, 2, 2, 2, 166, 167, 7, 20, 2, 2, 167, 168, 7, 9, 2, 2, 168, 169, 5, 42, 22, 2, 169, 170, 7, 11, 2, 2, 170, 33, 3, 2, 2, 2, 171, 172, 9, 4, 2, 2, 172, 35, 3, 2, 2, 2, 173, 174, 9, 5, 2, 2, 174, 37, 3, 2, 2, 2, 175, 176, 7, 29, 2, 2, 176, 39, 3, 2, 2, 2, 177, 186, 7, 21, 2, 2, 178, 183, 5, 42, 22, 2, 179, 180, 7, 10, 2, 2, 180, 182, 5, 42, 22, 2, 181, 179, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 178, 3, 2, 2, 2, 186, 187, 3, 2, 2, 2, 187, 41, 3, 2, 2, 2, 188, 189, 8, 22, 1, 2, 189, 190, 5, 38, 20, 2, 190, 191, 5, 42, 22, 9, 191, 205, 3, 2, 2, 2, 192, 193, 7, 9, 2, 2, 193, 194, 5, 42, 22, 2, 194, 195, 7, 11, 2, 2, 195, 205, 3, 2, 2, 2, 196, 205, 5, 72, 37, 2, 197, 200, 7, 45, 2, 2, 198, 200, 5, 52, 27, 2, 199, 197, 3, 2, 2, 2, 199, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 7, 19, 2, 2, 202, 205, 5, 42, 22, 4, 203, 205, 5, 56, 29, 2, 204, 188, 3, 2, 2, 2, 204, 192, 3, 2, 2, 2, 204, 196, 3, 2, 2, 2, 204, 199, 3, 2, 2, 2, 204, 203, 3, 2, 2, 2, 205, 216, 3, 2, 2, 2, 206, 207, 12, 8, 2, 2, 207, 208, 5, 34, 18, 2, 208, 209, 5, 42, 22, 9, 209, 215, 3, 2, 2, 2, 210, 211, 12, 7, 2, 2, 211, 212, 5, 36, 19, 2, 212, 213, 5, 42, 22, 8, 213, 215, 3, 2, 2, 2, 214, 206, 3, 2, 2, 2, 214, 210, 3, 2, 2, 2, 215, 218, 3, 2, 2, 2, 216, 214, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 43, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 219, 220, 7, 22, 2, 2, 220, 221, 7, 45, 2, 2, 221, 222, 7, 23, 2, 2, 222, 223, 5, 46, 24, 2, 223, 224, 7, 24, 2, 2, 224, 45, 3, 2, 2, 2, 225, 227, 5, 48, 25, 2, 226, 225, 3, 2, 2, 2, 227, 230, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 234, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 231, 233, 5, 60, 31, 2, 232, 231, 3, 2, 2, 2, 233, 236, 3, 2, 2, 2, 234, 232, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 47, 3, 2, 2, 2, 236, 234, 3, 2, 2, 2, 237, 240, 5, 30, 16, 2, 238, 240, 5, 50, 26, 2, 239, 237, 3, 2, 2, 2, 239, 238, 3, 2, 2, 2, 240, 49, 3, 2, 2, 2, 241, 244, 7, 45, 2, 2, 242, 244, 5, 52, 27, 2, 243, 241, 3, 2, 2, 2, 243, 242, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 246, 7, 19, 2, 2, 246, 247, 7, 25, 2, 2, 247, 248, 7, 45, 2, 2, 248, 249, 7, 9, 2, 2, 249, 250, 7, 11, 2, 2, 250, 51, 3, 2, 2, 2, 251, 258, 5, 54, 28, 2, 252, 253, 7, 26, 2, 2, 253, 259, 7, 45, 2, 2, 254, 255, 7, 4, 2, 2, 255, 256, 5, 42, 22, 2, 256, 257, 7, 5, 2, 2, 257, 259, 3, 2, 2, 2, 258, 252, 3, 2, 2, 2, 258, 254, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 53, 3, 2, 2, 2, 262, 263, 7, 45, 2, 2, 263, 55, 3, 2, 2, 2, 264, 265, 7, 46, 2, 2, 265, 266, 7, 9, 2, 2, 266, 267, 5, 64, 33, 2, 267, 268, 7, 11, 2, 2, 268, 57, 3, 2, 2, 2, 269, 272, 7, 45, 2, 2, 270, 272, 5, 52, 27, 2, 271, 269, 3, 2, 2, 2, 271, 270, 3, 2, 2, 2, 272, 278, 3, 2, 2, 2, 273, 276, 7, 10, 2, 2, 274, 277, 7, 45, 2, 2, 275, 277, 5, 52, 27, 2, 276, 274, 3, 2, 2, 2, 276, 275, 3, 2, 2, 2, 277, 279, 3, 2, 2, 2, 278, 273, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 278, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 283, 7, 19, 2, 2, 283, 284, 5, 56, 29, 2, 284, 59, 3, 2, 2, 2, 285, 286, 7, 27, 2, 2, 286, 287, 7, 46, 2, 2, 287, 288, 7, 9, 2, 2, 288, 289, 5, 62, 32, 2, 289, 290, 7, 11, 2, 2, 290, 291, 7, 23, 2, 2, 291, 292, 5, 6, 4, 2, 292, 293, 7, 24, 2, 2, 293, 61, 3, 2, 2, 2, 294, 299, 9, 6, 2, 2, 295, 296, 7, 10, 2, 2, 296, 298, 7, 45, 2, 2, 297, 295, 3, 2, 2, 2, 298, 301, 3, 2, 2, 2, 299, 297, 3, 2, 2, 2, 299, 300, 3, 2, 2, 2, 300, 303, 3, 2, 2, 2, 301, 299, 3, 2, 2, 2, 302, 294, 3, 2, 2, 2, 302, 303, 3, 2, 2, 2, 303, 63, 3, 2, 2, 2, 304, 309, 5, 42, 22, 2, 305, 306, 7, 10, 2, 2, 306, 308, 5, 42, 22, 2, 307, 305, 3, 2, 2, 2, 308, 311, 3, 2, 2, 2, 309, 307, 3, 2, 2, 2, 309, 310, 3, 2, 2, 2, 310, 313, 3, 2, 2, 2, 311, 309, 3, 2, 2, 2, 312, 304, 3, 2, 2, 2, 312, 313, 3, 2, 2, 2, 313, 65, 3, 2, 2, 2, 314, 315, 8, 34, 1, 2, 315, 316, 7, 42, 2, 2, 316, 327, 5, 66, 34, 7, 317, 318, 5, 42, 22, 2, 318, 319, 5, 68, 35, 2, 319, 320, 5, 42, 22, 2, 320, 327, 3, 2, 2, 2, 321, 327, 7, 33, 2, 2, 322, 323, 7, 9, 2, 2, 323, 324, 5, 66, 34, 2, 324, 325, 7, 11, 2, 2, 325, 327, 3, 2, 2, 2, 326, 314, 3, 2, 2, 2, 326, 317, 3, 2, 2, 2, 326, 321, 3, 2, 2, 2, 326, 322, 3, 2, 2, 2, 327, 334, 3, 2, 2, 2, 328, 329, 12, 5, 2, 2, 329, 330, 5, 70, 36, 2, 330, 331, 5, 66, 34, 6, 331, 333, 3, 2, 2, 2, 332, 328, 3, 2, 2, 2, 333, 336, 3, 2, 2, 2, 334, 332, 3, 2, 2, 2, 334, 335, 3, 2, 2, 2, 335, 67, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 337, 338, 9, 7, 2, 2, 338, 69, 3, 2, 2, 2, 339, 340, 9, 8, 2, 2, 340, 71, 3, 2, 2, 2, 341, 347, 7, 43, 2, 2, 342, 347, 7, 45, 2, 2, 343, 347, 5, 28, 15, 2, 344, 347, 5, 52, 27, 2, 345, 347, 7, 44, 2, 2, 346, 341, 3, 2, 2, 2, 346, 342, 3, 2, 2, 2, 346, 343, 3, 2, 2, 2, 346, 344, 3, 2, 2, 2, 346, 345, 3, 2, 2, 2, 347, 73, 3, 2, 2, 2, 31, 80, 86, 102, 106, 152, 155, 161, 183, 186, 199, 204, 214, 216, 228, 234, 239, 243, 258, 260, 271, 276, 280, 299, 302, 309, 312, 326, 334, 346] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 375, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 81, 10, 3, 12, 3, 14, 3, 84, 11, 3, 3, 4, 6, 4, 87, 10, 4, 13, 4, 14, 4, 88, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 105, 10, 5, 3, 6, 3, 6, 5, 6, 109, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 153, 10, 15, 12, 15, 14, 15, 156, 11, 15, 5, 15, 158, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 164, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 184, 10, 21, 12, 21, 14, 21, 187, 11, 21, 5, 21, 189, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 202, 10, 22, 3, 22, 3, 22, 3, 22, 5, 22, 207, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 217, 10, 22, 12, 22, 14, 22, 220, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 226, 10, 23, 12, 23, 14, 23, 229, 11, 23, 3, 23, 5, 23, 232, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 239, 10, 24, 12, 24, 14, 24, 242, 11, 24, 3, 24, 7, 24, 245, 10, 24, 12, 24, 14, 24, 248, 11, 24, 3, 25, 3, 25, 5, 25, 252, 10, 25, 3, 26, 3, 26, 5, 26, 256, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 271, 10, 27, 13, 27, 14, 27, 272, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 288, 10, 30, 3, 30, 7, 30, 291, 10, 30, 12, 30, 14, 30, 294, 11, 30, 3, 31, 3, 31, 5, 31, 298, 10, 31, 3, 31, 3, 31, 3, 31, 5, 31, 303, 10, 31, 6, 31, 305, 10, 31, 13, 31, 14, 31, 306, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 7, 33, 324, 10, 33, 12, 33, 14, 33, 327, 11, 33, 5, 33, 329, 10, 33, 3, 34, 3, 34, 3, 34, 7, 34, 334, 10, 34, 12, 34, 14, 34, 337, 11, 34, 5, 34, 339, 10, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 353, 10, 35, 3, 35, 3, 35, 3, 35, 3, 35, 7, 35, 359, 10, 35, 12, 35, 14, 35, 362, 11, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 5, 38, 373, 10, 38, 3, 38, 2, 4, 42, 68, 39, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 3, 2, 33, 38, 3, 2, 39, 40, 2, 390, 2, 76, 3, 2, 2, 2, 4, 82, 3, 2, 2, 2, 6, 86, 3, 2, 2, 2, 8, 104, 3, 2, 2, 2, 10, 108, 3, 2, 2, 2, 12, 110, 3, 2, 2, 2, 14, 116, 3, 2, 2, 2, 16, 126, 3, 2, 2, 2, 18, 132, 3, 2, 2, 2, 20, 139, 3, 2, 2, 2, 22, 142, 3, 2, 2, 2, 24, 144, 3, 2, 2, 2, 26, 146, 3, 2, 2, 2, 28, 148, 3, 2, 2, 2, 30, 163, 3, 2, 2, 2, 32, 168, 3, 2, 2, 2, 34, 173, 3, 2, 2, 2, 36, 175, 3, 2, 2, 2, 38, 177, 3, 2, 2, 2, 40, 179, 3, 2, 2, 2, 42, 206, 3, 2, 2, 2, 44, 221, 3, 2, 2, 2, 46, 240, 3, 2, 2, 2, 48, 251, 3, 2, 2, 2, 50, 255, 3, 2, 2, 2, 52, 263, 3, 2, 2, 2, 54, 274, 3, 2, 2, 2, 56, 276, 3, 2, 2, 2, 58, 292, 3, 2, 2, 2, 60, 297, 3, 2, 2, 2, 62, 311, 3, 2, 2, 2, 64, 328, 3, 2, 2, 2, 66, 338, 3, 2, 2, 2, 68, 352, 3, 2, 2, 2, 70, 363, 3, 2, 2, 2, 72, 365, 3, 2, 2, 2, 74, 372, 3, 2, 2, 2, 76, 77, 5, 4, 3, 2, 77, 78, 7, 2, 2, 3, 78, 3, 3, 2, 2, 2, 79, 81, 5, 8, 5, 2, 80, 79, 3, 2, 2, 2, 81, 84, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 82, 83, 3, 2, 2, 2, 83, 5, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 85, 87, 5, 8, 5, 2, 86, 85, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 88, 89, 3, 2, 2, 2, 89, 7, 3, 2, 2, 2, 90, 105, 5, 60, 31, 2, 91, 105, 5, 30, 16, 2, 92, 105, 5, 32, 17, 2, 93, 105, 5, 10, 6, 2, 94, 105, 5, 16, 9, 2, 95, 105, 5, 20, 11, 2, 96, 105, 5, 24, 13, 2, 97, 105, 5, 18, 10, 2, 98, 105, 5, 26, 14, 2, 99, 105, 5, 44, 23, 2, 100, 105, 5, 50, 26, 2, 101, 105, 5, 62, 32, 2, 102, 105, 5, 56, 29, 2, 103, 105, 5, 40, 21, 2, 104, 90, 3, 2, 2, 2, 104, 91, 3, 2, 2, 2, 104, 92, 3, 2, 2, 2, 104, 93, 3, 2, 2, 2, 104, 94, 3, 2, 2, 2, 104, 95, 3, 2, 2, 2, 104, 96, 3, 2, 2, 2, 104, 97, 3, 2, 2, 2, 104, 98, 3, 2, 2, 2, 104, 99, 3, 2, 2, 2, 104, 100, 3, 2, 2, 2, 104, 101, 3, 2, 2, 2, 104, 102, 3, 2, 2, 2, 104, 103, 3, 2, 2, 2, 105, 9, 3, 2, 2, 2, 106, 109, 5, 12, 7, 2, 107, 109, 5, 14, 8, 2, 108, 106, 3, 2, 2, 2, 108, 107, 3, 2, 2, 2, 109, 11, 3, 2, 2, 2, 110, 111, 7, 3, 2, 2, 111, 112, 5, 68, 35, 2, 112, 113, 7, 4, 2, 2, 113, 114, 5, 6, 4, 2, 114, 115, 7, 5, 2, 2, 115, 13, 3, 2, 2, 2, 116, 117, 7, 3, 2, 2, 117, 118, 5, 68, 35, 2, 118, 119, 7, 4, 2, 2, 119, 120, 5, 6, 4, 2, 120, 121, 7, 5, 2, 2, 121, 122, 7, 6, 2, 2, 122, 123, 7, 4, 2, 2, 123, 124, 5, 6, 4, 2, 124, 125, 7, 5, 2, 2, 125, 15, 3, 2, 2, 2, 126, 127, 7, 7, 2, 2, 127, 128, 5, 74, 38, 2, 128, 129, 7, 4, 2, 2, 129, 130, 5, 6, 4, 2, 130, 131, 7, 5, 2, 2, 131, 17, 3, 2, 2, 2, 132, 133, 7, 8, 2, 2, 133, 134, 7, 9, 2, 2, 134, 135, 5, 42, 22, 2, 135, 136, 7, 10, 2, 2, 136, 137, 5, 42, 22, 2, 137, 138, 7, 11, 2, 2, 138, 19, 3, 2, 2, 2, 139, 140, 5, 22, 12, 2, 140, 141, 5, 42, 22, 2, 141, 21, 3, 2, 2, 2, 142, 143, 9, 2, 2, 2, 143, 23, 3, 2, 2, 2, 144, 145, 9, 3, 2, 2, 145, 25, 3, 2, 2, 2, 146, 147, 7, 18, 2, 2, 147, 27, 3, 2, 2, 2, 148, 157, 7, 4, 2, 2, 149, 154, 5, 42, 22, 2, 150, 151, 7, 10, 2, 2, 151, 153, 5, 42, 22, 2, 152, 150, 3, 2, 2, 2, 153, 156, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 154, 155, 3, 2, 2, 2, 155, 158, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 157, 149, 3, 2, 2, 2, 157, 158, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 160, 7, 5, 2, 2, 160, 29, 3, 2, 2, 2, 161, 164, 7, 44, 2, 2, 162, 164, 5, 52, 27, 2, 163, 161, 3, 2, 2, 2, 163, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 166, 7, 19, 2, 2, 166, 167, 5, 42, 22, 2, 167, 31, 3, 2, 2, 2, 168, 169, 7, 20, 2, 2, 169, 170, 7, 9, 2, 2, 170, 171, 5, 42, 22, 2, 171, 172, 7, 11, 2, 2, 172, 33, 3, 2, 2, 2, 173, 174, 9, 4, 2, 2, 174, 35, 3, 2, 2, 2, 175, 176, 9, 5, 2, 2, 176, 37, 3, 2, 2, 2, 177, 178, 7, 29, 2, 2, 178, 39, 3, 2, 2, 2, 179, 188, 7, 21, 2, 2, 180, 185, 5, 42, 22, 2, 181, 182, 7, 10, 2, 2, 182, 184, 5, 42, 22, 2, 183, 181, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 185, 186, 3, 2, 2, 2, 186, 189, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 188, 180, 3, 2, 2, 2, 188, 189, 3, 2, 2, 2, 189, 41, 3, 2, 2, 2, 190, 191, 8, 22, 1, 2, 191, 192, 5, 38, 20, 2, 192, 193, 5, 42, 22, 9, 193, 207, 3, 2, 2, 2, 194, 195, 7, 9, 2, 2, 195, 196, 5, 42, 22, 2, 196, 197, 7, 11, 2, 2, 197, 207, 3, 2, 2, 2, 198, 207, 5, 74, 38, 2, 199, 202, 7, 44, 2, 2, 200, 202, 5, 52, 27, 2, 201, 199, 3, 2, 2, 2, 201, 200, 3, 2, 2, 2, 202, 203, 3, 2, 2, 2, 203, 204, 7, 19, 2, 2, 204, 207, 5, 42, 22, 4, 205, 207, 5, 56, 29, 2, 206, 190, 3, 2, 2, 2, 206, 194, 3, 2, 2, 2, 206, 198, 3, 2, 2, 2, 206, 201, 3, 2, 2, 2, 206, 205, 3, 2, 2, 2, 207, 218, 3, 2, 2, 2, 208, 209, 12, 8, 2, 2, 209, 210, 5, 34, 18, 2, 210, 211, 5, 42, 22, 9, 211, 217, 3, 2, 2, 2, 212, 213, 12, 7, 2, 2, 213, 214, 5, 36, 19, 2, 214, 215, 5, 42, 22, 8, 215, 217, 3, 2, 2, 2, 216, 208, 3, 2, 2, 2, 216, 212, 3, 2, 2, 2, 217, 220, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 43, 3, 2, 2, 2, 220, 218, 3, 2, 2, 2, 221, 222, 7, 22, 2, 2, 222, 231, 7, 44, 2, 2, 223, 227, 7, 9, 2, 2, 224, 226, 7, 44, 2, 2, 225, 224, 3, 2, 2, 2, 226, 229, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 230, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 230, 232, 7, 11, 2, 2, 231, 223, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 233, 3, 2, 2, 2, 233, 234, 7, 23, 2, 2, 234, 235, 5, 46, 24, 2, 235, 236, 7, 24, 2, 2, 236, 45, 3, 2, 2, 2, 237, 239, 5, 48, 25, 2, 238, 237, 3, 2, 2, 2, 239, 242, 3, 2, 2, 2, 240, 238, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 246, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 243, 245, 5, 62, 32, 2, 244, 243, 3, 2, 2, 2, 245, 248, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 246, 247, 3, 2, 2, 2, 247, 47, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 249, 252, 5, 30, 16, 2, 250, 252, 5, 50, 26, 2, 251, 249, 3, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 49, 3, 2, 2, 2, 253, 256, 7, 44, 2, 2, 254, 256, 5, 52, 27, 2, 255, 253, 3, 2, 2, 2, 255, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 258, 7, 19, 2, 2, 258, 259, 7, 25, 2, 2, 259, 260, 7, 44, 2, 2, 260, 261, 7, 9, 2, 2, 261, 262, 7, 11, 2, 2, 262, 51, 3, 2, 2, 2, 263, 270, 5, 54, 28, 2, 264, 265, 7, 26, 2, 2, 265, 271, 7, 44, 2, 2, 266, 267, 7, 4, 2, 2, 267, 268, 5, 42, 22, 2, 268, 269, 7, 5, 2, 2, 269, 271, 3, 2, 2, 2, 270, 264, 3, 2, 2, 2, 270, 266, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 53, 3, 2, 2, 2, 274, 275, 7, 44, 2, 2, 275, 55, 3, 2, 2, 2, 276, 277, 5, 58, 30, 2, 277, 278, 7, 45, 2, 2, 278, 279, 7, 9, 2, 2, 279, 280, 5, 66, 34, 2, 280, 281, 7, 11, 2, 2, 281, 57, 3, 2, 2, 2, 282, 288, 7, 44, 2, 2, 283, 284, 7, 4, 2, 2, 284, 285, 5, 42, 22, 2, 285, 286, 7, 5, 2, 2, 286, 288, 3, 2, 2, 2, 287, 282, 3, 2, 2, 2, 287, 283, 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 289, 291, 7, 26, 2, 2, 290, 287, 3, 2, 2, 2, 291, 294, 3, 2, 2, 2, 292, 290, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 59, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 295, 298, 7, 44, 2, 2, 296, 298, 5, 52, 27, 2, 297, 295, 3, 2, 2, 2, 297, 296, 3, 2, 2, 2, 298, 304, 3, 2, 2, 2, 299, 302, 7, 10, 2, 2, 300, 303, 7, 44, 2, 2, 301, 303, 5, 52, 27, 2, 302, 300, 3, 2, 2, 2, 302, 301, 3, 2, 2, 2, 303, 305, 3, 2, 2, 2, 304, 299, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308, 309, 7, 19, 2, 2, 309, 310, 5, 56, 29, 2, 310, 61, 3, 2, 2, 2, 311, 312, 7, 27, 2, 2, 312, 313, 7, 45, 2, 2, 313, 314, 7, 9, 2, 2, 314, 315, 5, 64, 33, 2, 315, 316, 7, 11, 2, 2, 316, 317, 7, 23, 2, 2, 317, 318, 5, 6, 4, 2, 318, 319, 7, 24, 2, 2, 319, 63, 3, 2, 2, 2, 320, 325, 7, 44, 2, 2, 321, 322, 7, 10, 2, 2, 322, 324, 7, 44, 2, 2, 323, 321, 3, 2, 2, 2, 324, 327, 3, 2, 2, 2, 325, 323, 3, 2, 2, 2, 325, 326, 3, 2, 2, 2, 326, 329, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 328, 320, 3, 2, 2, 2, 328, 329, 3, 2, 2, 2, 329, 65, 3, 2, 2, 2, 330, 335, 5, 42, 22, 2, 331, 332, 7, 10, 2, 2, 332, 334, 5, 42, 22, 2, 333, 331, 3, 2, 2, 2, 334, 337, 3, 2, 2, 2, 335, 333, 3, 2, 2, 2, 335, 336, 3, 2, 2, 2, 336, 339, 3, 2, 2, 2, 337, 335, 3, 2, 2, 2, 338, 330, 3, 2, 2, 2, 338, 339, 3, 2, 2, 2, 339, 67, 3, 2, 2, 2, 340, 341, 8, 35, 1, 2, 341, 342, 7, 41, 2, 2, 342, 353, 5, 68, 35, 7, 343, 344, 5, 42, 22, 2, 344, 345, 5, 70, 36, 2, 345, 346, 5, 42, 22, 2, 346, 353, 3, 2, 2, 2, 347, 353, 7, 32, 2, 2, 348, 349, 7, 9, 2, 2, 349, 350, 5, 68, 35, 2, 350, 351, 7, 11, 2, 2, 351, 353, 3, 2, 2, 2, 352, 340, 3, 2, 2, 2, 352, 343, 3, 2, 2, 2, 352, 347, 3, 2, 2, 2, 352, 348, 3, 2, 2, 2, 353, 360, 3, 2, 2, 2, 354, 355, 12, 5, 2, 2, 355, 356, 5, 72, 37, 2, 356, 357, 5, 68, 35, 6, 357, 359, 3, 2, 2, 2, 358, 354, 3, 2, 2, 2, 359, 362, 3, 2, 2, 2, 360, 358, 3, 2, 2, 2, 360, 361, 3, 2, 2, 2, 361, 69, 3, 2, 2, 2, 362, 360, 3, 2, 2, 2, 363, 364, 9, 6, 2, 2, 364, 71, 3, 2, 2, 2, 365, 366, 9, 7, 2, 2, 366, 73, 3, 2, 2, 2, 367, 373, 7, 42, 2, 2, 368, 373, 7, 44, 2, 2, 369, 373, 5, 28, 15, 2, 370, 373, 5, 52, 27, 2, 371, 373, 7, 43, 2, 2, 372, 367, 3, 2, 2, 2, 372, 368, 3, 2, 2, 2, 372, 369, 3, 2, 2, 2, 372, 370, 3, 2, 2, 2, 372, 371, 3, 2, 2, 2, 373, 75, 3, 2, 2, 2, 35, 82, 88, 104, 108, 154, 157, 163, 185, 188, 201, 206, 216, 218, 227, 231, 240, 246, 251, 255, 270, 272, 287, 292, 297, 302, 306, 325, 328, 335, 338, 352, 360, 372] \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.tokens b/ChironCore/turtparse/tlang.tokens index ff286d6..71328b7 100644 --- a/ChironCore/turtparse/tlang.tokens +++ b/ChironCore/turtparse/tlang.tokens @@ -27,22 +27,21 @@ PLUS=26 MINUS=27 MUL=28 DIV=29 -Self=30 -PENCOND=31 -LT=32 -GT=33 -EQ=34 -NEQ=35 -LTE=36 -GTE=37 -AND=38 -OR=39 -NOT=40 -NUM=41 -REAL=42 -VAR=43 -NAME=44 -Whitespace=45 +PENCOND=30 +LT=31 +GT=32 +EQ=33 +NEQ=34 +LTE=35 +GTE=36 +AND=37 +OR=38 +NOT=39 +NUM=40 +REAL=41 +VAR=42 +NAME=43 +Whitespace=44 'if'=1 '['=2 ']'=3 @@ -72,14 +71,13 @@ Whitespace=45 '-'=27 '*'=28 '/'=29 -'self'=30 -'pendown?'=31 -'<'=32 -'>'=33 -'=='=34 -'!='=35 -'<='=36 -'>='=37 -'&&'=38 -'||'=39 -'!'=40 +'pendown?'=30 +'<'=31 +'>'=32 +'=='=33 +'!='=34 +'<='=35 +'>='=36 +'&&'=37 +'||'=38 +'!'=39 diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index 2bd4d2f..76f5a47 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -29,7 +29,6 @@ null '-' '*' '/' -'self' 'pendown?' '<' '>' @@ -77,7 +76,6 @@ PLUS MINUS MUL DIV -Self PENCOND LT GT @@ -124,7 +122,6 @@ PLUS MINUS MUL DIV -Self PENCOND LT GT @@ -149,4 +146,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 47, 290, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 254, 10, 42, 13, 42, 14, 42, 255, 3, 43, 6, 43, 259, 10, 43, 13, 43, 14, 43, 260, 3, 43, 3, 43, 6, 43, 265, 10, 43, 13, 43, 14, 43, 266, 5, 43, 269, 10, 43, 3, 44, 3, 44, 3, 44, 7, 44, 274, 10, 44, 12, 44, 14, 44, 277, 11, 44, 3, 45, 6, 45, 280, 10, 45, 13, 45, 14, 45, 281, 3, 46, 6, 46, 285, 10, 46, 13, 46, 14, 46, 286, 3, 46, 3, 46, 2, 2, 47, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 296, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 3, 93, 3, 2, 2, 2, 5, 96, 3, 2, 2, 2, 7, 98, 3, 2, 2, 2, 9, 100, 3, 2, 2, 2, 11, 105, 3, 2, 2, 2, 13, 112, 3, 2, 2, 2, 15, 117, 3, 2, 2, 2, 17, 119, 3, 2, 2, 2, 19, 121, 3, 2, 2, 2, 21, 123, 3, 2, 2, 2, 23, 131, 3, 2, 2, 2, 25, 140, 3, 2, 2, 2, 27, 145, 3, 2, 2, 2, 29, 151, 3, 2, 2, 2, 31, 157, 3, 2, 2, 2, 33, 165, 3, 2, 2, 2, 35, 171, 3, 2, 2, 2, 37, 173, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 186, 3, 2, 2, 2, 43, 192, 3, 2, 2, 2, 45, 194, 3, 2, 2, 2, 47, 196, 3, 2, 2, 2, 49, 200, 3, 2, 2, 2, 51, 202, 3, 2, 2, 2, 53, 206, 3, 2, 2, 2, 55, 208, 3, 2, 2, 2, 57, 210, 3, 2, 2, 2, 59, 212, 3, 2, 2, 2, 61, 214, 3, 2, 2, 2, 63, 219, 3, 2, 2, 2, 65, 228, 3, 2, 2, 2, 67, 230, 3, 2, 2, 2, 69, 232, 3, 2, 2, 2, 71, 235, 3, 2, 2, 2, 73, 238, 3, 2, 2, 2, 75, 241, 3, 2, 2, 2, 77, 244, 3, 2, 2, 2, 79, 247, 3, 2, 2, 2, 81, 250, 3, 2, 2, 2, 83, 253, 3, 2, 2, 2, 85, 258, 3, 2, 2, 2, 87, 270, 3, 2, 2, 2, 89, 279, 3, 2, 2, 2, 91, 284, 3, 2, 2, 2, 93, 94, 7, 107, 2, 2, 94, 95, 7, 104, 2, 2, 95, 4, 3, 2, 2, 2, 96, 97, 7, 93, 2, 2, 97, 6, 3, 2, 2, 2, 98, 99, 7, 95, 2, 2, 99, 8, 3, 2, 2, 2, 100, 101, 7, 103, 2, 2, 101, 102, 7, 110, 2, 2, 102, 103, 7, 117, 2, 2, 103, 104, 7, 103, 2, 2, 104, 10, 3, 2, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 114, 2, 2, 108, 109, 7, 103, 2, 2, 109, 110, 7, 99, 2, 2, 110, 111, 7, 118, 2, 2, 111, 12, 3, 2, 2, 2, 112, 113, 7, 105, 2, 2, 113, 114, 7, 113, 2, 2, 114, 115, 7, 118, 2, 2, 115, 116, 7, 113, 2, 2, 116, 14, 3, 2, 2, 2, 117, 118, 7, 42, 2, 2, 118, 16, 3, 2, 2, 2, 119, 120, 7, 46, 2, 2, 120, 18, 3, 2, 2, 2, 121, 122, 7, 43, 2, 2, 122, 20, 3, 2, 2, 2, 123, 124, 7, 104, 2, 2, 124, 125, 7, 113, 2, 2, 125, 126, 7, 116, 2, 2, 126, 127, 7, 121, 2, 2, 127, 128, 7, 99, 2, 2, 128, 129, 7, 116, 2, 2, 129, 130, 7, 102, 2, 2, 130, 22, 3, 2, 2, 2, 131, 132, 7, 100, 2, 2, 132, 133, 7, 99, 2, 2, 133, 134, 7, 101, 2, 2, 134, 135, 7, 109, 2, 2, 135, 136, 7, 121, 2, 2, 136, 137, 7, 99, 2, 2, 137, 138, 7, 116, 2, 2, 138, 139, 7, 102, 2, 2, 139, 24, 3, 2, 2, 2, 140, 141, 7, 110, 2, 2, 141, 142, 7, 103, 2, 2, 142, 143, 7, 104, 2, 2, 143, 144, 7, 118, 2, 2, 144, 26, 3, 2, 2, 2, 145, 146, 7, 116, 2, 2, 146, 147, 7, 107, 2, 2, 147, 148, 7, 105, 2, 2, 148, 149, 7, 106, 2, 2, 149, 150, 7, 118, 2, 2, 150, 28, 3, 2, 2, 2, 151, 152, 7, 114, 2, 2, 152, 153, 7, 103, 2, 2, 153, 154, 7, 112, 2, 2, 154, 155, 7, 119, 2, 2, 155, 156, 7, 114, 2, 2, 156, 30, 3, 2, 2, 2, 157, 158, 7, 114, 2, 2, 158, 159, 7, 103, 2, 2, 159, 160, 7, 112, 2, 2, 160, 161, 7, 102, 2, 2, 161, 162, 7, 113, 2, 2, 162, 163, 7, 121, 2, 2, 163, 164, 7, 112, 2, 2, 164, 32, 3, 2, 2, 2, 165, 166, 7, 114, 2, 2, 166, 167, 7, 99, 2, 2, 167, 168, 7, 119, 2, 2, 168, 169, 7, 117, 2, 2, 169, 170, 7, 103, 2, 2, 170, 34, 3, 2, 2, 2, 171, 172, 7, 63, 2, 2, 172, 36, 3, 2, 2, 2, 173, 174, 7, 114, 2, 2, 174, 175, 7, 116, 2, 2, 175, 176, 7, 107, 2, 2, 176, 177, 7, 112, 2, 2, 177, 178, 7, 118, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 116, 2, 2, 180, 181, 7, 103, 2, 2, 181, 182, 7, 118, 2, 2, 182, 183, 7, 119, 2, 2, 183, 184, 7, 116, 2, 2, 184, 185, 7, 112, 2, 2, 185, 40, 3, 2, 2, 2, 186, 187, 7, 101, 2, 2, 187, 188, 7, 110, 2, 2, 188, 189, 7, 99, 2, 2, 189, 190, 7, 117, 2, 2, 190, 191, 7, 117, 2, 2, 191, 42, 3, 2, 2, 2, 192, 193, 7, 125, 2, 2, 193, 44, 3, 2, 2, 2, 194, 195, 7, 127, 2, 2, 195, 46, 3, 2, 2, 2, 196, 197, 7, 112, 2, 2, 197, 198, 7, 103, 2, 2, 198, 199, 7, 121, 2, 2, 199, 48, 3, 2, 2, 2, 200, 201, 7, 48, 2, 2, 201, 50, 3, 2, 2, 2, 202, 203, 7, 102, 2, 2, 203, 204, 7, 103, 2, 2, 204, 205, 7, 104, 2, 2, 205, 52, 3, 2, 2, 2, 206, 207, 7, 45, 2, 2, 207, 54, 3, 2, 2, 2, 208, 209, 7, 47, 2, 2, 209, 56, 3, 2, 2, 2, 210, 211, 7, 44, 2, 2, 211, 58, 3, 2, 2, 2, 212, 213, 7, 49, 2, 2, 213, 60, 3, 2, 2, 2, 214, 215, 7, 117, 2, 2, 215, 216, 7, 103, 2, 2, 216, 217, 7, 110, 2, 2, 217, 218, 7, 104, 2, 2, 218, 62, 3, 2, 2, 2, 219, 220, 7, 114, 2, 2, 220, 221, 7, 103, 2, 2, 221, 222, 7, 112, 2, 2, 222, 223, 7, 102, 2, 2, 223, 224, 7, 113, 2, 2, 224, 225, 7, 121, 2, 2, 225, 226, 7, 112, 2, 2, 226, 227, 7, 65, 2, 2, 227, 64, 3, 2, 2, 2, 228, 229, 7, 62, 2, 2, 229, 66, 3, 2, 2, 2, 230, 231, 7, 64, 2, 2, 231, 68, 3, 2, 2, 2, 232, 233, 7, 63, 2, 2, 233, 234, 7, 63, 2, 2, 234, 70, 3, 2, 2, 2, 235, 236, 7, 35, 2, 2, 236, 237, 7, 63, 2, 2, 237, 72, 3, 2, 2, 2, 238, 239, 7, 62, 2, 2, 239, 240, 7, 63, 2, 2, 240, 74, 3, 2, 2, 2, 241, 242, 7, 64, 2, 2, 242, 243, 7, 63, 2, 2, 243, 76, 3, 2, 2, 2, 244, 245, 7, 40, 2, 2, 245, 246, 7, 40, 2, 2, 246, 78, 3, 2, 2, 2, 247, 248, 7, 126, 2, 2, 248, 249, 7, 126, 2, 2, 249, 80, 3, 2, 2, 2, 250, 251, 7, 35, 2, 2, 251, 82, 3, 2, 2, 2, 252, 254, 9, 2, 2, 2, 253, 252, 3, 2, 2, 2, 254, 255, 3, 2, 2, 2, 255, 253, 3, 2, 2, 2, 255, 256, 3, 2, 2, 2, 256, 84, 3, 2, 2, 2, 257, 259, 9, 2, 2, 2, 258, 257, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 268, 3, 2, 2, 2, 262, 264, 7, 48, 2, 2, 263, 265, 9, 2, 2, 2, 264, 263, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 269, 3, 2, 2, 2, 268, 262, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 86, 3, 2, 2, 2, 270, 271, 7, 60, 2, 2, 271, 275, 9, 3, 2, 2, 272, 274, 9, 4, 2, 2, 273, 272, 3, 2, 2, 2, 274, 277, 3, 2, 2, 2, 275, 273, 3, 2, 2, 2, 275, 276, 3, 2, 2, 2, 276, 88, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 278, 280, 9, 5, 2, 2, 279, 278, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 90, 3, 2, 2, 2, 283, 285, 9, 6, 2, 2, 284, 283, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 288, 3, 2, 2, 2, 288, 289, 8, 46, 2, 2, 289, 92, 3, 2, 2, 2, 10, 2, 255, 260, 266, 268, 275, 281, 286, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 46, 283, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 6, 41, 247, 10, 41, 13, 41, 14, 41, 248, 3, 42, 6, 42, 252, 10, 42, 13, 42, 14, 42, 253, 3, 42, 3, 42, 6, 42, 258, 10, 42, 13, 42, 14, 42, 259, 5, 42, 262, 10, 42, 3, 43, 3, 43, 3, 43, 7, 43, 267, 10, 43, 12, 43, 14, 43, 270, 11, 43, 3, 44, 6, 44, 273, 10, 44, 13, 44, 14, 44, 274, 3, 45, 6, 45, 278, 10, 45, 13, 45, 14, 45, 279, 3, 45, 3, 45, 2, 2, 46, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 289, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 3, 91, 3, 2, 2, 2, 5, 94, 3, 2, 2, 2, 7, 96, 3, 2, 2, 2, 9, 98, 3, 2, 2, 2, 11, 103, 3, 2, 2, 2, 13, 110, 3, 2, 2, 2, 15, 115, 3, 2, 2, 2, 17, 117, 3, 2, 2, 2, 19, 119, 3, 2, 2, 2, 21, 121, 3, 2, 2, 2, 23, 129, 3, 2, 2, 2, 25, 138, 3, 2, 2, 2, 27, 143, 3, 2, 2, 2, 29, 149, 3, 2, 2, 2, 31, 155, 3, 2, 2, 2, 33, 163, 3, 2, 2, 2, 35, 169, 3, 2, 2, 2, 37, 171, 3, 2, 2, 2, 39, 177, 3, 2, 2, 2, 41, 184, 3, 2, 2, 2, 43, 190, 3, 2, 2, 2, 45, 192, 3, 2, 2, 2, 47, 194, 3, 2, 2, 2, 49, 198, 3, 2, 2, 2, 51, 200, 3, 2, 2, 2, 53, 204, 3, 2, 2, 2, 55, 206, 3, 2, 2, 2, 57, 208, 3, 2, 2, 2, 59, 210, 3, 2, 2, 2, 61, 212, 3, 2, 2, 2, 63, 221, 3, 2, 2, 2, 65, 223, 3, 2, 2, 2, 67, 225, 3, 2, 2, 2, 69, 228, 3, 2, 2, 2, 71, 231, 3, 2, 2, 2, 73, 234, 3, 2, 2, 2, 75, 237, 3, 2, 2, 2, 77, 240, 3, 2, 2, 2, 79, 243, 3, 2, 2, 2, 81, 246, 3, 2, 2, 2, 83, 251, 3, 2, 2, 2, 85, 263, 3, 2, 2, 2, 87, 272, 3, 2, 2, 2, 89, 277, 3, 2, 2, 2, 91, 92, 7, 107, 2, 2, 92, 93, 7, 104, 2, 2, 93, 4, 3, 2, 2, 2, 94, 95, 7, 93, 2, 2, 95, 6, 3, 2, 2, 2, 96, 97, 7, 95, 2, 2, 97, 8, 3, 2, 2, 2, 98, 99, 7, 103, 2, 2, 99, 100, 7, 110, 2, 2, 100, 101, 7, 117, 2, 2, 101, 102, 7, 103, 2, 2, 102, 10, 3, 2, 2, 2, 103, 104, 7, 116, 2, 2, 104, 105, 7, 103, 2, 2, 105, 106, 7, 114, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 99, 2, 2, 108, 109, 7, 118, 2, 2, 109, 12, 3, 2, 2, 2, 110, 111, 7, 105, 2, 2, 111, 112, 7, 113, 2, 2, 112, 113, 7, 118, 2, 2, 113, 114, 7, 113, 2, 2, 114, 14, 3, 2, 2, 2, 115, 116, 7, 42, 2, 2, 116, 16, 3, 2, 2, 2, 117, 118, 7, 46, 2, 2, 118, 18, 3, 2, 2, 2, 119, 120, 7, 43, 2, 2, 120, 20, 3, 2, 2, 2, 121, 122, 7, 104, 2, 2, 122, 123, 7, 113, 2, 2, 123, 124, 7, 116, 2, 2, 124, 125, 7, 121, 2, 2, 125, 126, 7, 99, 2, 2, 126, 127, 7, 116, 2, 2, 127, 128, 7, 102, 2, 2, 128, 22, 3, 2, 2, 2, 129, 130, 7, 100, 2, 2, 130, 131, 7, 99, 2, 2, 131, 132, 7, 101, 2, 2, 132, 133, 7, 109, 2, 2, 133, 134, 7, 121, 2, 2, 134, 135, 7, 99, 2, 2, 135, 136, 7, 116, 2, 2, 136, 137, 7, 102, 2, 2, 137, 24, 3, 2, 2, 2, 138, 139, 7, 110, 2, 2, 139, 140, 7, 103, 2, 2, 140, 141, 7, 104, 2, 2, 141, 142, 7, 118, 2, 2, 142, 26, 3, 2, 2, 2, 143, 144, 7, 116, 2, 2, 144, 145, 7, 107, 2, 2, 145, 146, 7, 105, 2, 2, 146, 147, 7, 106, 2, 2, 147, 148, 7, 118, 2, 2, 148, 28, 3, 2, 2, 2, 149, 150, 7, 114, 2, 2, 150, 151, 7, 103, 2, 2, 151, 152, 7, 112, 2, 2, 152, 153, 7, 119, 2, 2, 153, 154, 7, 114, 2, 2, 154, 30, 3, 2, 2, 2, 155, 156, 7, 114, 2, 2, 156, 157, 7, 103, 2, 2, 157, 158, 7, 112, 2, 2, 158, 159, 7, 102, 2, 2, 159, 160, 7, 113, 2, 2, 160, 161, 7, 121, 2, 2, 161, 162, 7, 112, 2, 2, 162, 32, 3, 2, 2, 2, 163, 164, 7, 114, 2, 2, 164, 165, 7, 99, 2, 2, 165, 166, 7, 119, 2, 2, 166, 167, 7, 117, 2, 2, 167, 168, 7, 103, 2, 2, 168, 34, 3, 2, 2, 2, 169, 170, 7, 63, 2, 2, 170, 36, 3, 2, 2, 2, 171, 172, 7, 114, 2, 2, 172, 173, 7, 116, 2, 2, 173, 174, 7, 107, 2, 2, 174, 175, 7, 112, 2, 2, 175, 176, 7, 118, 2, 2, 176, 38, 3, 2, 2, 2, 177, 178, 7, 116, 2, 2, 178, 179, 7, 103, 2, 2, 179, 180, 7, 118, 2, 2, 180, 181, 7, 119, 2, 2, 181, 182, 7, 116, 2, 2, 182, 183, 7, 112, 2, 2, 183, 40, 3, 2, 2, 2, 184, 185, 7, 101, 2, 2, 185, 186, 7, 110, 2, 2, 186, 187, 7, 99, 2, 2, 187, 188, 7, 117, 2, 2, 188, 189, 7, 117, 2, 2, 189, 42, 3, 2, 2, 2, 190, 191, 7, 125, 2, 2, 191, 44, 3, 2, 2, 2, 192, 193, 7, 127, 2, 2, 193, 46, 3, 2, 2, 2, 194, 195, 7, 112, 2, 2, 195, 196, 7, 103, 2, 2, 196, 197, 7, 121, 2, 2, 197, 48, 3, 2, 2, 2, 198, 199, 7, 48, 2, 2, 199, 50, 3, 2, 2, 2, 200, 201, 7, 102, 2, 2, 201, 202, 7, 103, 2, 2, 202, 203, 7, 104, 2, 2, 203, 52, 3, 2, 2, 2, 204, 205, 7, 45, 2, 2, 205, 54, 3, 2, 2, 2, 206, 207, 7, 47, 2, 2, 207, 56, 3, 2, 2, 2, 208, 209, 7, 44, 2, 2, 209, 58, 3, 2, 2, 2, 210, 211, 7, 49, 2, 2, 211, 60, 3, 2, 2, 2, 212, 213, 7, 114, 2, 2, 213, 214, 7, 103, 2, 2, 214, 215, 7, 112, 2, 2, 215, 216, 7, 102, 2, 2, 216, 217, 7, 113, 2, 2, 217, 218, 7, 121, 2, 2, 218, 219, 7, 112, 2, 2, 219, 220, 7, 65, 2, 2, 220, 62, 3, 2, 2, 2, 221, 222, 7, 62, 2, 2, 222, 64, 3, 2, 2, 2, 223, 224, 7, 64, 2, 2, 224, 66, 3, 2, 2, 2, 225, 226, 7, 63, 2, 2, 226, 227, 7, 63, 2, 2, 227, 68, 3, 2, 2, 2, 228, 229, 7, 35, 2, 2, 229, 230, 7, 63, 2, 2, 230, 70, 3, 2, 2, 2, 231, 232, 7, 62, 2, 2, 232, 233, 7, 63, 2, 2, 233, 72, 3, 2, 2, 2, 234, 235, 7, 64, 2, 2, 235, 236, 7, 63, 2, 2, 236, 74, 3, 2, 2, 2, 237, 238, 7, 40, 2, 2, 238, 239, 7, 40, 2, 2, 239, 76, 3, 2, 2, 2, 240, 241, 7, 126, 2, 2, 241, 242, 7, 126, 2, 2, 242, 78, 3, 2, 2, 2, 243, 244, 7, 35, 2, 2, 244, 80, 3, 2, 2, 2, 245, 247, 9, 2, 2, 2, 246, 245, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 82, 3, 2, 2, 2, 250, 252, 9, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 253, 254, 3, 2, 2, 2, 254, 261, 3, 2, 2, 2, 255, 257, 7, 48, 2, 2, 256, 258, 9, 2, 2, 2, 257, 256, 3, 2, 2, 2, 258, 259, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 262, 3, 2, 2, 2, 261, 255, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 84, 3, 2, 2, 2, 263, 264, 7, 60, 2, 2, 264, 268, 9, 3, 2, 2, 265, 267, 9, 4, 2, 2, 266, 265, 3, 2, 2, 2, 267, 270, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 86, 3, 2, 2, 2, 270, 268, 3, 2, 2, 2, 271, 273, 9, 5, 2, 2, 272, 271, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 272, 3, 2, 2, 2, 274, 275, 3, 2, 2, 2, 275, 88, 3, 2, 2, 2, 276, 278, 9, 6, 2, 2, 277, 276, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 282, 8, 45, 2, 2, 282, 90, 3, 2, 2, 2, 10, 2, 248, 253, 259, 261, 268, 274, 279, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index 6fcd0f6..4785a31 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -8,123 +8,120 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2/") - buf.write("\u0122\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2.") + buf.write("\u011b\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") buf.write("\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36") buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%") - buf.write("\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\4.") - buf.write("\t.\3\2\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3") - buf.write("\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b") - buf.write("\3\t\3\t\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3") - buf.write("\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3") - buf.write("\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3") - buf.write("\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20") - buf.write("\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23") - buf.write("\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25") - buf.write("\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30") - buf.write("\3\30\3\30\3\31\3\31\3\32\3\32\3\32\3\32\3\33\3\33\3\34") - buf.write("\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3 ") - buf.write("\3 \3 \3 \3 \3 \3 \3 \3 \3!\3!\3\"\3\"\3#\3#\3#\3$\3$") - buf.write("\3$\3%\3%\3%\3&\3&\3&\3\'\3\'\3\'\3(\3(\3(\3)\3)\3*\6") - buf.write("*\u00fe\n*\r*\16*\u00ff\3+\6+\u0103\n+\r+\16+\u0104\3") - buf.write("+\3+\6+\u0109\n+\r+\16+\u010a\5+\u010d\n+\3,\3,\3,\7,") - buf.write("\u0112\n,\f,\16,\u0115\13,\3-\6-\u0118\n-\r-\16-\u0119") - buf.write("\3.\6.\u011d\n.\r.\16.\u011e\3.\3.\2\2/\3\3\5\4\7\5\t") - buf.write("\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20") - buf.write("\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65") - buf.write("\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/\3") - buf.write("\2\7\3\2\62;\5\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5\2\13\f") - buf.write("\17\17\"\"\2\u0128\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2") - buf.write("\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21") - buf.write("\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3") - buf.write("\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2") - buf.write("\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2") - buf.write("\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2") - buf.write("\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2") - buf.write("\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3") - buf.write("\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q") - buf.write("\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2") - buf.write("[\3\2\2\2\3]\3\2\2\2\5`\3\2\2\2\7b\3\2\2\2\td\3\2\2\2") - buf.write("\13i\3\2\2\2\rp\3\2\2\2\17u\3\2\2\2\21w\3\2\2\2\23y\3") - buf.write("\2\2\2\25{\3\2\2\2\27\u0083\3\2\2\2\31\u008c\3\2\2\2\33") - buf.write("\u0091\3\2\2\2\35\u0097\3\2\2\2\37\u009d\3\2\2\2!\u00a5") - buf.write("\3\2\2\2#\u00ab\3\2\2\2%\u00ad\3\2\2\2\'\u00b3\3\2\2\2") - buf.write(")\u00ba\3\2\2\2+\u00c0\3\2\2\2-\u00c2\3\2\2\2/\u00c4\3") - buf.write("\2\2\2\61\u00c8\3\2\2\2\63\u00ca\3\2\2\2\65\u00ce\3\2") - buf.write("\2\2\67\u00d0\3\2\2\29\u00d2\3\2\2\2;\u00d4\3\2\2\2=\u00d6") - buf.write("\3\2\2\2?\u00db\3\2\2\2A\u00e4\3\2\2\2C\u00e6\3\2\2\2") - buf.write("E\u00e8\3\2\2\2G\u00eb\3\2\2\2I\u00ee\3\2\2\2K\u00f1\3") - buf.write("\2\2\2M\u00f4\3\2\2\2O\u00f7\3\2\2\2Q\u00fa\3\2\2\2S\u00fd") - buf.write("\3\2\2\2U\u0102\3\2\2\2W\u010e\3\2\2\2Y\u0117\3\2\2\2") - buf.write("[\u011c\3\2\2\2]^\7k\2\2^_\7h\2\2_\4\3\2\2\2`a\7]\2\2") - buf.write("a\6\3\2\2\2bc\7_\2\2c\b\3\2\2\2de\7g\2\2ef\7n\2\2fg\7") - buf.write("u\2\2gh\7g\2\2h\n\3\2\2\2ij\7t\2\2jk\7g\2\2kl\7r\2\2l") - buf.write("m\7g\2\2mn\7c\2\2no\7v\2\2o\f\3\2\2\2pq\7i\2\2qr\7q\2") - buf.write("\2rs\7v\2\2st\7q\2\2t\16\3\2\2\2uv\7*\2\2v\20\3\2\2\2") - buf.write("wx\7.\2\2x\22\3\2\2\2yz\7+\2\2z\24\3\2\2\2{|\7h\2\2|}") - buf.write("\7q\2\2}~\7t\2\2~\177\7y\2\2\177\u0080\7c\2\2\u0080\u0081") - buf.write("\7t\2\2\u0081\u0082\7f\2\2\u0082\26\3\2\2\2\u0083\u0084") - buf.write("\7d\2\2\u0084\u0085\7c\2\2\u0085\u0086\7e\2\2\u0086\u0087") - buf.write("\7m\2\2\u0087\u0088\7y\2\2\u0088\u0089\7c\2\2\u0089\u008a") - buf.write("\7t\2\2\u008a\u008b\7f\2\2\u008b\30\3\2\2\2\u008c\u008d") - buf.write("\7n\2\2\u008d\u008e\7g\2\2\u008e\u008f\7h\2\2\u008f\u0090") - buf.write("\7v\2\2\u0090\32\3\2\2\2\u0091\u0092\7t\2\2\u0092\u0093") - buf.write("\7k\2\2\u0093\u0094\7i\2\2\u0094\u0095\7j\2\2\u0095\u0096") - buf.write("\7v\2\2\u0096\34\3\2\2\2\u0097\u0098\7r\2\2\u0098\u0099") - buf.write("\7g\2\2\u0099\u009a\7p\2\2\u009a\u009b\7w\2\2\u009b\u009c") - buf.write("\7r\2\2\u009c\36\3\2\2\2\u009d\u009e\7r\2\2\u009e\u009f") - buf.write("\7g\2\2\u009f\u00a0\7p\2\2\u00a0\u00a1\7f\2\2\u00a1\u00a2") - buf.write("\7q\2\2\u00a2\u00a3\7y\2\2\u00a3\u00a4\7p\2\2\u00a4 \3") - buf.write("\2\2\2\u00a5\u00a6\7r\2\2\u00a6\u00a7\7c\2\2\u00a7\u00a8") - buf.write("\7w\2\2\u00a8\u00a9\7u\2\2\u00a9\u00aa\7g\2\2\u00aa\"") - buf.write("\3\2\2\2\u00ab\u00ac\7?\2\2\u00ac$\3\2\2\2\u00ad\u00ae") - buf.write("\7r\2\2\u00ae\u00af\7t\2\2\u00af\u00b0\7k\2\2\u00b0\u00b1") - buf.write("\7p\2\2\u00b1\u00b2\7v\2\2\u00b2&\3\2\2\2\u00b3\u00b4") - buf.write("\7t\2\2\u00b4\u00b5\7g\2\2\u00b5\u00b6\7v\2\2\u00b6\u00b7") - buf.write("\7w\2\2\u00b7\u00b8\7t\2\2\u00b8\u00b9\7p\2\2\u00b9(\3") - buf.write("\2\2\2\u00ba\u00bb\7e\2\2\u00bb\u00bc\7n\2\2\u00bc\u00bd") - buf.write("\7c\2\2\u00bd\u00be\7u\2\2\u00be\u00bf\7u\2\2\u00bf*\3") - buf.write("\2\2\2\u00c0\u00c1\7}\2\2\u00c1,\3\2\2\2\u00c2\u00c3\7") - buf.write("\177\2\2\u00c3.\3\2\2\2\u00c4\u00c5\7p\2\2\u00c5\u00c6") - buf.write("\7g\2\2\u00c6\u00c7\7y\2\2\u00c7\60\3\2\2\2\u00c8\u00c9") - buf.write("\7\60\2\2\u00c9\62\3\2\2\2\u00ca\u00cb\7f\2\2\u00cb\u00cc") - buf.write("\7g\2\2\u00cc\u00cd\7h\2\2\u00cd\64\3\2\2\2\u00ce\u00cf") - buf.write("\7-\2\2\u00cf\66\3\2\2\2\u00d0\u00d1\7/\2\2\u00d18\3\2") - buf.write("\2\2\u00d2\u00d3\7,\2\2\u00d3:\3\2\2\2\u00d4\u00d5\7\61") - buf.write("\2\2\u00d5<\3\2\2\2\u00d6\u00d7\7u\2\2\u00d7\u00d8\7g") - buf.write("\2\2\u00d8\u00d9\7n\2\2\u00d9\u00da\7h\2\2\u00da>\3\2") - buf.write("\2\2\u00db\u00dc\7r\2\2\u00dc\u00dd\7g\2\2\u00dd\u00de") - buf.write("\7p\2\2\u00de\u00df\7f\2\2\u00df\u00e0\7q\2\2\u00e0\u00e1") - buf.write("\7y\2\2\u00e1\u00e2\7p\2\2\u00e2\u00e3\7A\2\2\u00e3@\3") - buf.write("\2\2\2\u00e4\u00e5\7>\2\2\u00e5B\3\2\2\2\u00e6\u00e7\7") - buf.write("@\2\2\u00e7D\3\2\2\2\u00e8\u00e9\7?\2\2\u00e9\u00ea\7") - buf.write("?\2\2\u00eaF\3\2\2\2\u00eb\u00ec\7#\2\2\u00ec\u00ed\7") - buf.write("?\2\2\u00edH\3\2\2\2\u00ee\u00ef\7>\2\2\u00ef\u00f0\7") - buf.write("?\2\2\u00f0J\3\2\2\2\u00f1\u00f2\7@\2\2\u00f2\u00f3\7") - buf.write("?\2\2\u00f3L\3\2\2\2\u00f4\u00f5\7(\2\2\u00f5\u00f6\7") - buf.write("(\2\2\u00f6N\3\2\2\2\u00f7\u00f8\7~\2\2\u00f8\u00f9\7") - buf.write("~\2\2\u00f9P\3\2\2\2\u00fa\u00fb\7#\2\2\u00fbR\3\2\2\2") - buf.write("\u00fc\u00fe\t\2\2\2\u00fd\u00fc\3\2\2\2\u00fe\u00ff\3") - buf.write("\2\2\2\u00ff\u00fd\3\2\2\2\u00ff\u0100\3\2\2\2\u0100T") - buf.write("\3\2\2\2\u0101\u0103\t\2\2\2\u0102\u0101\3\2\2\2\u0103") - buf.write("\u0104\3\2\2\2\u0104\u0102\3\2\2\2\u0104\u0105\3\2\2\2") - buf.write("\u0105\u010c\3\2\2\2\u0106\u0108\7\60\2\2\u0107\u0109") - buf.write("\t\2\2\2\u0108\u0107\3\2\2\2\u0109\u010a\3\2\2\2\u010a") - buf.write("\u0108\3\2\2\2\u010a\u010b\3\2\2\2\u010b\u010d\3\2\2\2") - buf.write("\u010c\u0106\3\2\2\2\u010c\u010d\3\2\2\2\u010dV\3\2\2") - buf.write("\2\u010e\u010f\7<\2\2\u010f\u0113\t\3\2\2\u0110\u0112") - buf.write("\t\4\2\2\u0111\u0110\3\2\2\2\u0112\u0115\3\2\2\2\u0113") - buf.write("\u0111\3\2\2\2\u0113\u0114\3\2\2\2\u0114X\3\2\2\2\u0115") - buf.write("\u0113\3\2\2\2\u0116\u0118\t\5\2\2\u0117\u0116\3\2\2\2") - buf.write("\u0118\u0119\3\2\2\2\u0119\u0117\3\2\2\2\u0119\u011a\3") - buf.write("\2\2\2\u011aZ\3\2\2\2\u011b\u011d\t\6\2\2\u011c\u011b") - buf.write("\3\2\2\2\u011d\u011e\3\2\2\2\u011e\u011c\3\2\2\2\u011e") - buf.write("\u011f\3\2\2\2\u011f\u0120\3\2\2\2\u0120\u0121\b.\2\2") - buf.write("\u0121\\\3\2\2\2\n\2\u00ff\u0104\u010a\u010c\u0113\u0119") - buf.write("\u011e\3\b\2\2") + buf.write("\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\3\2") + buf.write("\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3") + buf.write("\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\t\3\t") + buf.write("\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3") + buf.write("\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\16") + buf.write("\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17") + buf.write("\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21") + buf.write("\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23") + buf.write("\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25") + buf.write("\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30\3\30\3\30\3\31") + buf.write("\3\31\3\32\3\32\3\32\3\32\3\33\3\33\3\34\3\34\3\35\3\35") + buf.write("\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37") + buf.write("\3 \3 \3!\3!\3\"\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3") + buf.write("&\3&\3&\3\'\3\'\3\'\3(\3(\3)\6)\u00f7\n)\r)\16)\u00f8") + buf.write("\3*\6*\u00fc\n*\r*\16*\u00fd\3*\3*\6*\u0102\n*\r*\16*") + buf.write("\u0103\5*\u0106\n*\3+\3+\3+\7+\u010b\n+\f+\16+\u010e\13") + buf.write("+\3,\6,\u0111\n,\r,\16,\u0112\3-\6-\u0116\n-\r-\16-\u0117") + buf.write("\3-\3-\2\2.\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25") + buf.write("\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+") + buf.write("\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E") + buf.write("$G%I&K\'M(O)Q*S+U,W-Y.\3\2\7\3\2\62;\5\2C\\aac|\5\2\62") + buf.write(";C\\c|\4\2C\\c|\5\2\13\f\17\17\"\"\2\u0121\2\3\3\2\2\2") + buf.write("\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r") + buf.write("\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3") + buf.write("\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2") + buf.write("\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'") + buf.write("\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2") + buf.write("\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29") + buf.write("\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2") + buf.write("C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2") + buf.write("\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2") + buf.write("\2\2W\3\2\2\2\2Y\3\2\2\2\3[\3\2\2\2\5^\3\2\2\2\7`\3\2") + buf.write("\2\2\tb\3\2\2\2\13g\3\2\2\2\rn\3\2\2\2\17s\3\2\2\2\21") + buf.write("u\3\2\2\2\23w\3\2\2\2\25y\3\2\2\2\27\u0081\3\2\2\2\31") + buf.write("\u008a\3\2\2\2\33\u008f\3\2\2\2\35\u0095\3\2\2\2\37\u009b") + buf.write("\3\2\2\2!\u00a3\3\2\2\2#\u00a9\3\2\2\2%\u00ab\3\2\2\2") + buf.write("\'\u00b1\3\2\2\2)\u00b8\3\2\2\2+\u00be\3\2\2\2-\u00c0") + buf.write("\3\2\2\2/\u00c2\3\2\2\2\61\u00c6\3\2\2\2\63\u00c8\3\2") + buf.write("\2\2\65\u00cc\3\2\2\2\67\u00ce\3\2\2\29\u00d0\3\2\2\2") + buf.write(";\u00d2\3\2\2\2=\u00d4\3\2\2\2?\u00dd\3\2\2\2A\u00df\3") + buf.write("\2\2\2C\u00e1\3\2\2\2E\u00e4\3\2\2\2G\u00e7\3\2\2\2I\u00ea") + buf.write("\3\2\2\2K\u00ed\3\2\2\2M\u00f0\3\2\2\2O\u00f3\3\2\2\2") + buf.write("Q\u00f6\3\2\2\2S\u00fb\3\2\2\2U\u0107\3\2\2\2W\u0110\3") + buf.write("\2\2\2Y\u0115\3\2\2\2[\\\7k\2\2\\]\7h\2\2]\4\3\2\2\2^") + buf.write("_\7]\2\2_\6\3\2\2\2`a\7_\2\2a\b\3\2\2\2bc\7g\2\2cd\7n") + buf.write("\2\2de\7u\2\2ef\7g\2\2f\n\3\2\2\2gh\7t\2\2hi\7g\2\2ij") + buf.write("\7r\2\2jk\7g\2\2kl\7c\2\2lm\7v\2\2m\f\3\2\2\2no\7i\2\2") + buf.write("op\7q\2\2pq\7v\2\2qr\7q\2\2r\16\3\2\2\2st\7*\2\2t\20\3") + buf.write("\2\2\2uv\7.\2\2v\22\3\2\2\2wx\7+\2\2x\24\3\2\2\2yz\7h") + buf.write("\2\2z{\7q\2\2{|\7t\2\2|}\7y\2\2}~\7c\2\2~\177\7t\2\2\177") + buf.write("\u0080\7f\2\2\u0080\26\3\2\2\2\u0081\u0082\7d\2\2\u0082") + buf.write("\u0083\7c\2\2\u0083\u0084\7e\2\2\u0084\u0085\7m\2\2\u0085") + buf.write("\u0086\7y\2\2\u0086\u0087\7c\2\2\u0087\u0088\7t\2\2\u0088") + buf.write("\u0089\7f\2\2\u0089\30\3\2\2\2\u008a\u008b\7n\2\2\u008b") + buf.write("\u008c\7g\2\2\u008c\u008d\7h\2\2\u008d\u008e\7v\2\2\u008e") + buf.write("\32\3\2\2\2\u008f\u0090\7t\2\2\u0090\u0091\7k\2\2\u0091") + buf.write("\u0092\7i\2\2\u0092\u0093\7j\2\2\u0093\u0094\7v\2\2\u0094") + buf.write("\34\3\2\2\2\u0095\u0096\7r\2\2\u0096\u0097\7g\2\2\u0097") + buf.write("\u0098\7p\2\2\u0098\u0099\7w\2\2\u0099\u009a\7r\2\2\u009a") + buf.write("\36\3\2\2\2\u009b\u009c\7r\2\2\u009c\u009d\7g\2\2\u009d") + buf.write("\u009e\7p\2\2\u009e\u009f\7f\2\2\u009f\u00a0\7q\2\2\u00a0") + buf.write("\u00a1\7y\2\2\u00a1\u00a2\7p\2\2\u00a2 \3\2\2\2\u00a3") + buf.write("\u00a4\7r\2\2\u00a4\u00a5\7c\2\2\u00a5\u00a6\7w\2\2\u00a6") + buf.write("\u00a7\7u\2\2\u00a7\u00a8\7g\2\2\u00a8\"\3\2\2\2\u00a9") + buf.write("\u00aa\7?\2\2\u00aa$\3\2\2\2\u00ab\u00ac\7r\2\2\u00ac") + buf.write("\u00ad\7t\2\2\u00ad\u00ae\7k\2\2\u00ae\u00af\7p\2\2\u00af") + buf.write("\u00b0\7v\2\2\u00b0&\3\2\2\2\u00b1\u00b2\7t\2\2\u00b2") + buf.write("\u00b3\7g\2\2\u00b3\u00b4\7v\2\2\u00b4\u00b5\7w\2\2\u00b5") + buf.write("\u00b6\7t\2\2\u00b6\u00b7\7p\2\2\u00b7(\3\2\2\2\u00b8") + buf.write("\u00b9\7e\2\2\u00b9\u00ba\7n\2\2\u00ba\u00bb\7c\2\2\u00bb") + buf.write("\u00bc\7u\2\2\u00bc\u00bd\7u\2\2\u00bd*\3\2\2\2\u00be") + buf.write("\u00bf\7}\2\2\u00bf,\3\2\2\2\u00c0\u00c1\7\177\2\2\u00c1") + buf.write(".\3\2\2\2\u00c2\u00c3\7p\2\2\u00c3\u00c4\7g\2\2\u00c4") + buf.write("\u00c5\7y\2\2\u00c5\60\3\2\2\2\u00c6\u00c7\7\60\2\2\u00c7") + buf.write("\62\3\2\2\2\u00c8\u00c9\7f\2\2\u00c9\u00ca\7g\2\2\u00ca") + buf.write("\u00cb\7h\2\2\u00cb\64\3\2\2\2\u00cc\u00cd\7-\2\2\u00cd") + buf.write("\66\3\2\2\2\u00ce\u00cf\7/\2\2\u00cf8\3\2\2\2\u00d0\u00d1") + buf.write("\7,\2\2\u00d1:\3\2\2\2\u00d2\u00d3\7\61\2\2\u00d3<\3\2") + buf.write("\2\2\u00d4\u00d5\7r\2\2\u00d5\u00d6\7g\2\2\u00d6\u00d7") + buf.write("\7p\2\2\u00d7\u00d8\7f\2\2\u00d8\u00d9\7q\2\2\u00d9\u00da") + buf.write("\7y\2\2\u00da\u00db\7p\2\2\u00db\u00dc\7A\2\2\u00dc>\3") + buf.write("\2\2\2\u00dd\u00de\7>\2\2\u00de@\3\2\2\2\u00df\u00e0\7") + buf.write("@\2\2\u00e0B\3\2\2\2\u00e1\u00e2\7?\2\2\u00e2\u00e3\7") + buf.write("?\2\2\u00e3D\3\2\2\2\u00e4\u00e5\7#\2\2\u00e5\u00e6\7") + buf.write("?\2\2\u00e6F\3\2\2\2\u00e7\u00e8\7>\2\2\u00e8\u00e9\7") + buf.write("?\2\2\u00e9H\3\2\2\2\u00ea\u00eb\7@\2\2\u00eb\u00ec\7") + buf.write("?\2\2\u00ecJ\3\2\2\2\u00ed\u00ee\7(\2\2\u00ee\u00ef\7") + buf.write("(\2\2\u00efL\3\2\2\2\u00f0\u00f1\7~\2\2\u00f1\u00f2\7") + buf.write("~\2\2\u00f2N\3\2\2\2\u00f3\u00f4\7#\2\2\u00f4P\3\2\2\2") + buf.write("\u00f5\u00f7\t\2\2\2\u00f6\u00f5\3\2\2\2\u00f7\u00f8\3") + buf.write("\2\2\2\u00f8\u00f6\3\2\2\2\u00f8\u00f9\3\2\2\2\u00f9R") + buf.write("\3\2\2\2\u00fa\u00fc\t\2\2\2\u00fb\u00fa\3\2\2\2\u00fc") + buf.write("\u00fd\3\2\2\2\u00fd\u00fb\3\2\2\2\u00fd\u00fe\3\2\2\2") + buf.write("\u00fe\u0105\3\2\2\2\u00ff\u0101\7\60\2\2\u0100\u0102") + buf.write("\t\2\2\2\u0101\u0100\3\2\2\2\u0102\u0103\3\2\2\2\u0103") + buf.write("\u0101\3\2\2\2\u0103\u0104\3\2\2\2\u0104\u0106\3\2\2\2") + buf.write("\u0105\u00ff\3\2\2\2\u0105\u0106\3\2\2\2\u0106T\3\2\2") + buf.write("\2\u0107\u0108\7<\2\2\u0108\u010c\t\3\2\2\u0109\u010b") + buf.write("\t\4\2\2\u010a\u0109\3\2\2\2\u010b\u010e\3\2\2\2\u010c") + buf.write("\u010a\3\2\2\2\u010c\u010d\3\2\2\2\u010dV\3\2\2\2\u010e") + buf.write("\u010c\3\2\2\2\u010f\u0111\t\5\2\2\u0110\u010f\3\2\2\2") + buf.write("\u0111\u0112\3\2\2\2\u0112\u0110\3\2\2\2\u0112\u0113\3") + buf.write("\2\2\2\u0113X\3\2\2\2\u0114\u0116\t\6\2\2\u0115\u0114") + buf.write("\3\2\2\2\u0116\u0117\3\2\2\2\u0117\u0115\3\2\2\2\u0117") + buf.write("\u0118\3\2\2\2\u0118\u0119\3\2\2\2\u0119\u011a\b-\2\2") + buf.write("\u011aZ\3\2\2\2\n\2\u00f8\u00fd\u0103\u0105\u010c\u0112") + buf.write("\u0117\3\b\2\2") return buf.getvalue() @@ -163,22 +160,21 @@ class tlangLexer(Lexer): MINUS = 27 MUL = 28 DIV = 29 - Self = 30 - PENCOND = 31 - LT = 32 - GT = 33 - EQ = 34 - NEQ = 35 - LTE = 36 - GTE = 37 - AND = 38 - OR = 39 - NOT = 40 - NUM = 41 - REAL = 42 - VAR = 43 - NAME = 44 - Whitespace = 45 + PENCOND = 30 + LT = 31 + GT = 32 + EQ = 33 + NEQ = 34 + LTE = 35 + GTE = 36 + AND = 37 + OR = 38 + NOT = 39 + NUM = 40 + REAL = 41 + VAR = 42 + NAME = 43 + Whitespace = 44 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] @@ -189,21 +185,21 @@ class tlangLexer(Lexer): "','", "')'", "'forward'", "'backward'", "'left'", "'right'", "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'return'", "'class'", "'{'", "'}'", "'new'", "'.'", "'def'", "'+'", "'-'", - "'*'", "'/'", "'self'", "'pendown?'", "'<'", "'>'", "'=='", - "'!='", "'<='", "'>='", "'&&'", "'||'", "'!'" ] + "'*'", "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", + "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", - "PLUS", "MINUS", "MUL", "DIV", "Self", "PENCOND", "LT", "GT", - "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", - "VAR", "NAME", "Whitespace" ] + "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", + "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", + "NAME", "Whitespace" ] ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24", "PLUS", "MINUS", - "MUL", "DIV", "Self", "PENCOND", "LT", "GT", "EQ", "NEQ", - "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", - "NAME", "Whitespace" ] + "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", + "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", "NAME", + "Whitespace" ] grammarFileName = "tlang.g4" diff --git a/ChironCore/turtparse/tlangLexer.tokens b/ChironCore/turtparse/tlangLexer.tokens index ff286d6..71328b7 100644 --- a/ChironCore/turtparse/tlangLexer.tokens +++ b/ChironCore/turtparse/tlangLexer.tokens @@ -27,22 +27,21 @@ PLUS=26 MINUS=27 MUL=28 DIV=29 -Self=30 -PENCOND=31 -LT=32 -GT=33 -EQ=34 -NEQ=35 -LTE=36 -GTE=37 -AND=38 -OR=39 -NOT=40 -NUM=41 -REAL=42 -VAR=43 -NAME=44 -Whitespace=45 +PENCOND=30 +LT=31 +GT=32 +EQ=33 +NEQ=34 +LTE=35 +GTE=36 +AND=37 +OR=38 +NOT=39 +NUM=40 +REAL=41 +VAR=42 +NAME=43 +Whitespace=44 'if'=1 '['=2 ']'=3 @@ -72,14 +71,13 @@ Whitespace=45 '-'=27 '*'=28 '/'=29 -'self'=30 -'pendown?'=31 -'<'=32 -'>'=33 -'=='=34 -'!='=35 -'<='=36 -'>='=37 -'&&'=38 -'||'=39 -'!'=40 +'pendown?'=30 +'<'=31 +'>'=32 +'=='=33 +'!='=34 +'<='=35 +'>='=36 +'&&'=37 +'||'=38 +'!'=39 diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index fa9905e..6c3cf05 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -8,160 +8,173 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3/") - buf.write("\u015d\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3.") + buf.write("\u0177\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36") - buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\3\2\3") - buf.write("\2\3\2\3\3\7\3O\n\3\f\3\16\3R\13\3\3\4\6\4U\n\4\r\4\16") - buf.write("\4V\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3") - buf.write("\5\3\5\5\5g\n\5\3\6\3\6\5\6k\n\6\3\7\3\7\3\7\3\7\3\7\3") - buf.write("\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t") - buf.write("\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13") - buf.write("\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17\3\17\3\17\7\17\u0097") - buf.write("\n\17\f\17\16\17\u009a\13\17\5\17\u009c\n\17\3\17\3\17") - buf.write("\3\20\3\20\5\20\u00a2\n\20\3\20\3\20\3\20\3\21\3\21\3") - buf.write("\21\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25") - buf.write("\3\25\3\25\7\25\u00b6\n\25\f\25\16\25\u00b9\13\25\5\25") - buf.write("\u00bb\n\25\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3") - buf.write("\26\3\26\3\26\5\26\u00c8\n\26\3\26\3\26\3\26\5\26\u00cd") - buf.write("\n\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\7\26\u00d7") - buf.write("\n\26\f\26\16\26\u00da\13\26\3\27\3\27\3\27\3\27\3\27") - buf.write("\3\27\3\30\7\30\u00e3\n\30\f\30\16\30\u00e6\13\30\3\30") - buf.write("\7\30\u00e9\n\30\f\30\16\30\u00ec\13\30\3\31\3\31\5\31") - buf.write("\u00f0\n\31\3\32\3\32\5\32\u00f4\n\32\3\32\3\32\3\32\3") - buf.write("\32\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\6\33") - buf.write("\u0103\n\33\r\33\16\33\u0104\3\34\3\34\3\35\3\35\3\35") - buf.write("\3\35\3\35\3\36\3\36\5\36\u0110\n\36\3\36\3\36\3\36\5") - buf.write("\36\u0115\n\36\6\36\u0117\n\36\r\36\16\36\u0118\3\36\3") - buf.write("\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37") - buf.write("\3 \3 \3 \7 \u012a\n \f \16 \u012d\13 \5 \u012f\n \3!") - buf.write("\3!\3!\7!\u0134\n!\f!\16!\u0137\13!\5!\u0139\n!\3\"\3") - buf.write("\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\5\"\u0147\n") - buf.write("\"\3\"\3\"\3\"\3\"\7\"\u014d\n\"\f\"\16\"\u0150\13\"\3") - buf.write("#\3#\3$\3$\3%\3%\3%\3%\3%\5%\u015b\n%\3%\2\4*B&\2\4\6") - buf.write("\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\66") - buf.write("8:<>@BDFH\2\t\3\2\f\17\3\2\20\21\3\2\36\37\3\2\34\35\4") - buf.write("\2 --\3\2\"\'\3\2()\2\u0169\2J\3\2\2\2\4P\3\2\2\2\6T") - buf.write("\3\2\2\2\bf\3\2\2\2\nj\3\2\2\2\fl\3\2\2\2\16r\3\2\2\2") - buf.write("\20|\3\2\2\2\22\u0082\3\2\2\2\24\u0089\3\2\2\2\26\u008c") - buf.write("\3\2\2\2\30\u008e\3\2\2\2\32\u0090\3\2\2\2\34\u0092\3") - buf.write("\2\2\2\36\u00a1\3\2\2\2 \u00a6\3\2\2\2\"\u00ab\3\2\2\2") - buf.write("$\u00ad\3\2\2\2&\u00af\3\2\2\2(\u00b1\3\2\2\2*\u00cc\3") - buf.write("\2\2\2,\u00db\3\2\2\2.\u00e4\3\2\2\2\60\u00ef\3\2\2\2") - buf.write("\62\u00f3\3\2\2\2\64\u00fb\3\2\2\2\66\u0106\3\2\2\28\u0108") - buf.write("\3\2\2\2:\u010f\3\2\2\2<\u011d\3\2\2\2>\u012e\3\2\2\2") - buf.write("@\u0138\3\2\2\2B\u0146\3\2\2\2D\u0151\3\2\2\2F\u0153\3") - buf.write("\2\2\2H\u015a\3\2\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2M") - buf.write("O\5\b\5\2NM\3\2\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2Q\5\3") - buf.write("\2\2\2RP\3\2\2\2SU\5\b\5\2TS\3\2\2\2UV\3\2\2\2VT\3\2\2") - buf.write("\2VW\3\2\2\2W\7\3\2\2\2Xg\5:\36\2Yg\5\36\20\2Zg\5 \21") - buf.write("\2[g\5\n\6\2\\g\5\20\t\2]g\5\24\13\2^g\5\30\r\2_g\5\22") - buf.write("\n\2`g\5\32\16\2ag\5,\27\2bg\5\62\32\2cg\5<\37\2dg\58") - buf.write("\35\2eg\5(\25\2fX\3\2\2\2fY\3\2\2\2fZ\3\2\2\2f[\3\2\2") - buf.write("\2f\\\3\2\2\2f]\3\2\2\2f^\3\2\2\2f_\3\2\2\2f`\3\2\2\2") - buf.write("fa\3\2\2\2fb\3\2\2\2fc\3\2\2\2fd\3\2\2\2fe\3\2\2\2g\t") - buf.write("\3\2\2\2hk\5\f\7\2ik\5\16\b\2jh\3\2\2\2ji\3\2\2\2k\13") - buf.write("\3\2\2\2lm\7\3\2\2mn\5B\"\2no\7\4\2\2op\5\6\4\2pq\7\5") - buf.write("\2\2q\r\3\2\2\2rs\7\3\2\2st\5B\"\2tu\7\4\2\2uv\5\6\4\2") - buf.write("vw\7\5\2\2wx\7\6\2\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2{\17") - buf.write("\3\2\2\2|}\7\7\2\2}~\5H%\2~\177\7\4\2\2\177\u0080\5\6") - buf.write("\4\2\u0080\u0081\7\5\2\2\u0081\21\3\2\2\2\u0082\u0083") - buf.write("\7\b\2\2\u0083\u0084\7\t\2\2\u0084\u0085\5*\26\2\u0085") - buf.write("\u0086\7\n\2\2\u0086\u0087\5*\26\2\u0087\u0088\7\13\2") - buf.write("\2\u0088\23\3\2\2\2\u0089\u008a\5\26\f\2\u008a\u008b\5") - buf.write("*\26\2\u008b\25\3\2\2\2\u008c\u008d\t\2\2\2\u008d\27\3") - buf.write("\2\2\2\u008e\u008f\t\3\2\2\u008f\31\3\2\2\2\u0090\u0091") - buf.write("\7\22\2\2\u0091\33\3\2\2\2\u0092\u009b\7\4\2\2\u0093\u0098") - buf.write("\5*\26\2\u0094\u0095\7\n\2\2\u0095\u0097\5*\26\2\u0096") - buf.write("\u0094\3\2\2\2\u0097\u009a\3\2\2\2\u0098\u0096\3\2\2\2") - buf.write("\u0098\u0099\3\2\2\2\u0099\u009c\3\2\2\2\u009a\u0098\3") - buf.write("\2\2\2\u009b\u0093\3\2\2\2\u009b\u009c\3\2\2\2\u009c\u009d") - buf.write("\3\2\2\2\u009d\u009e\7\5\2\2\u009e\35\3\2\2\2\u009f\u00a2") - buf.write("\7-\2\2\u00a0\u00a2\5\64\33\2\u00a1\u009f\3\2\2\2\u00a1") - buf.write("\u00a0\3\2\2\2\u00a2\u00a3\3\2\2\2\u00a3\u00a4\7\23\2") - buf.write("\2\u00a4\u00a5\5*\26\2\u00a5\37\3\2\2\2\u00a6\u00a7\7") - buf.write("\24\2\2\u00a7\u00a8\7\t\2\2\u00a8\u00a9\5*\26\2\u00a9") - buf.write("\u00aa\7\13\2\2\u00aa!\3\2\2\2\u00ab\u00ac\t\4\2\2\u00ac") - buf.write("#\3\2\2\2\u00ad\u00ae\t\5\2\2\u00ae%\3\2\2\2\u00af\u00b0") - buf.write("\7\35\2\2\u00b0\'\3\2\2\2\u00b1\u00ba\7\25\2\2\u00b2\u00b7") - buf.write("\5*\26\2\u00b3\u00b4\7\n\2\2\u00b4\u00b6\5*\26\2\u00b5") - buf.write("\u00b3\3\2\2\2\u00b6\u00b9\3\2\2\2\u00b7\u00b5\3\2\2\2") - buf.write("\u00b7\u00b8\3\2\2\2\u00b8\u00bb\3\2\2\2\u00b9\u00b7\3") - buf.write("\2\2\2\u00ba\u00b2\3\2\2\2\u00ba\u00bb\3\2\2\2\u00bb)") - buf.write("\3\2\2\2\u00bc\u00bd\b\26\1\2\u00bd\u00be\5&\24\2\u00be") - buf.write("\u00bf\5*\26\t\u00bf\u00cd\3\2\2\2\u00c0\u00c1\7\t\2\2") - buf.write("\u00c1\u00c2\5*\26\2\u00c2\u00c3\7\13\2\2\u00c3\u00cd") - buf.write("\3\2\2\2\u00c4\u00cd\5H%\2\u00c5\u00c8\7-\2\2\u00c6\u00c8") - buf.write("\5\64\33\2\u00c7\u00c5\3\2\2\2\u00c7\u00c6\3\2\2\2\u00c8") - buf.write("\u00c9\3\2\2\2\u00c9\u00ca\7\23\2\2\u00ca\u00cd\5*\26") - buf.write("\4\u00cb\u00cd\58\35\2\u00cc\u00bc\3\2\2\2\u00cc\u00c0") - buf.write("\3\2\2\2\u00cc\u00c4\3\2\2\2\u00cc\u00c7\3\2\2\2\u00cc") - buf.write("\u00cb\3\2\2\2\u00cd\u00d8\3\2\2\2\u00ce\u00cf\f\b\2\2") - buf.write("\u00cf\u00d0\5\"\22\2\u00d0\u00d1\5*\26\t\u00d1\u00d7") - buf.write("\3\2\2\2\u00d2\u00d3\f\7\2\2\u00d3\u00d4\5$\23\2\u00d4") - buf.write("\u00d5\5*\26\b\u00d5\u00d7\3\2\2\2\u00d6\u00ce\3\2\2\2") - buf.write("\u00d6\u00d2\3\2\2\2\u00d7\u00da\3\2\2\2\u00d8\u00d6\3") - buf.write("\2\2\2\u00d8\u00d9\3\2\2\2\u00d9+\3\2\2\2\u00da\u00d8") - buf.write("\3\2\2\2\u00db\u00dc\7\26\2\2\u00dc\u00dd\7-\2\2\u00dd") - buf.write("\u00de\7\27\2\2\u00de\u00df\5.\30\2\u00df\u00e0\7\30\2") - buf.write("\2\u00e0-\3\2\2\2\u00e1\u00e3\5\60\31\2\u00e2\u00e1\3") - buf.write("\2\2\2\u00e3\u00e6\3\2\2\2\u00e4\u00e2\3\2\2\2\u00e4\u00e5") - buf.write("\3\2\2\2\u00e5\u00ea\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e7") - buf.write("\u00e9\5<\37\2\u00e8\u00e7\3\2\2\2\u00e9\u00ec\3\2\2\2") - buf.write("\u00ea\u00e8\3\2\2\2\u00ea\u00eb\3\2\2\2\u00eb/\3\2\2") - buf.write("\2\u00ec\u00ea\3\2\2\2\u00ed\u00f0\5\36\20\2\u00ee\u00f0") - buf.write("\5\62\32\2\u00ef\u00ed\3\2\2\2\u00ef\u00ee\3\2\2\2\u00f0") - buf.write("\61\3\2\2\2\u00f1\u00f4\7-\2\2\u00f2\u00f4\5\64\33\2\u00f3") - buf.write("\u00f1\3\2\2\2\u00f3\u00f2\3\2\2\2\u00f4\u00f5\3\2\2\2") - buf.write("\u00f5\u00f6\7\23\2\2\u00f6\u00f7\7\31\2\2\u00f7\u00f8") - buf.write("\7-\2\2\u00f8\u00f9\7\t\2\2\u00f9\u00fa\7\13\2\2\u00fa") - buf.write("\63\3\2\2\2\u00fb\u0102\5\66\34\2\u00fc\u00fd\7\32\2\2") - buf.write("\u00fd\u0103\7-\2\2\u00fe\u00ff\7\4\2\2\u00ff\u0100\5") - buf.write("*\26\2\u0100\u0101\7\5\2\2\u0101\u0103\3\2\2\2\u0102\u00fc") - buf.write("\3\2\2\2\u0102\u00fe\3\2\2\2\u0103\u0104\3\2\2\2\u0104") - buf.write("\u0102\3\2\2\2\u0104\u0105\3\2\2\2\u0105\65\3\2\2\2\u0106") - buf.write("\u0107\7-\2\2\u0107\67\3\2\2\2\u0108\u0109\7.\2\2\u0109") - buf.write("\u010a\7\t\2\2\u010a\u010b\5@!\2\u010b\u010c\7\13\2\2") - buf.write("\u010c9\3\2\2\2\u010d\u0110\7-\2\2\u010e\u0110\5\64\33") - buf.write("\2\u010f\u010d\3\2\2\2\u010f\u010e\3\2\2\2\u0110\u0116") - buf.write("\3\2\2\2\u0111\u0114\7\n\2\2\u0112\u0115\7-\2\2\u0113") - buf.write("\u0115\5\64\33\2\u0114\u0112\3\2\2\2\u0114\u0113\3\2\2") - buf.write("\2\u0115\u0117\3\2\2\2\u0116\u0111\3\2\2\2\u0117\u0118") - buf.write("\3\2\2\2\u0118\u0116\3\2\2\2\u0118\u0119\3\2\2\2\u0119") - buf.write("\u011a\3\2\2\2\u011a\u011b\7\23\2\2\u011b\u011c\58\35") - buf.write("\2\u011c;\3\2\2\2\u011d\u011e\7\33\2\2\u011e\u011f\7.") - buf.write("\2\2\u011f\u0120\7\t\2\2\u0120\u0121\5> \2\u0121\u0122") - buf.write("\7\13\2\2\u0122\u0123\7\27\2\2\u0123\u0124\5\6\4\2\u0124") - buf.write("\u0125\7\30\2\2\u0125=\3\2\2\2\u0126\u012b\t\6\2\2\u0127") - buf.write("\u0128\7\n\2\2\u0128\u012a\7-\2\2\u0129\u0127\3\2\2\2") - buf.write("\u012a\u012d\3\2\2\2\u012b\u0129\3\2\2\2\u012b\u012c\3") - buf.write("\2\2\2\u012c\u012f\3\2\2\2\u012d\u012b\3\2\2\2\u012e\u0126") - buf.write("\3\2\2\2\u012e\u012f\3\2\2\2\u012f?\3\2\2\2\u0130\u0135") - buf.write("\5*\26\2\u0131\u0132\7\n\2\2\u0132\u0134\5*\26\2\u0133") - buf.write("\u0131\3\2\2\2\u0134\u0137\3\2\2\2\u0135\u0133\3\2\2\2") - buf.write("\u0135\u0136\3\2\2\2\u0136\u0139\3\2\2\2\u0137\u0135\3") - buf.write("\2\2\2\u0138\u0130\3\2\2\2\u0138\u0139\3\2\2\2\u0139A") - buf.write("\3\2\2\2\u013a\u013b\b\"\1\2\u013b\u013c\7*\2\2\u013c") - buf.write("\u0147\5B\"\7\u013d\u013e\5*\26\2\u013e\u013f\5D#\2\u013f") - buf.write("\u0140\5*\26\2\u0140\u0147\3\2\2\2\u0141\u0147\7!\2\2") - buf.write("\u0142\u0143\7\t\2\2\u0143\u0144\5B\"\2\u0144\u0145\7") - buf.write("\13\2\2\u0145\u0147\3\2\2\2\u0146\u013a\3\2\2\2\u0146") - buf.write("\u013d\3\2\2\2\u0146\u0141\3\2\2\2\u0146\u0142\3\2\2\2") - buf.write("\u0147\u014e\3\2\2\2\u0148\u0149\f\5\2\2\u0149\u014a\5") - buf.write("F$\2\u014a\u014b\5B\"\6\u014b\u014d\3\2\2\2\u014c\u0148") - buf.write("\3\2\2\2\u014d\u0150\3\2\2\2\u014e\u014c\3\2\2\2\u014e") - buf.write("\u014f\3\2\2\2\u014fC\3\2\2\2\u0150\u014e\3\2\2\2\u0151") - buf.write("\u0152\t\7\2\2\u0152E\3\2\2\2\u0153\u0154\t\b\2\2\u0154") - buf.write("G\3\2\2\2\u0155\u015b\7+\2\2\u0156\u015b\7-\2\2\u0157") - buf.write("\u015b\5\34\17\2\u0158\u015b\5\64\33\2\u0159\u015b\7,") - buf.write("\2\2\u015a\u0155\3\2\2\2\u015a\u0156\3\2\2\2\u015a\u0157") - buf.write("\3\2\2\2\u015a\u0158\3\2\2\2\u015a\u0159\3\2\2\2\u015b") - buf.write("I\3\2\2\2\37PVfj\u0098\u009b\u00a1\u00b7\u00ba\u00c7\u00cc") - buf.write("\u00d6\u00d8\u00e4\u00ea\u00ef\u00f3\u0102\u0104\u010f") - buf.write("\u0114\u0118\u012b\u012e\u0135\u0138\u0146\u014e\u015a") + buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t") + buf.write("&\3\2\3\2\3\2\3\3\7\3Q\n\3\f\3\16\3T\13\3\3\4\6\4W\n\4") + buf.write("\r\4\16\4X\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5") + buf.write("\3\5\3\5\3\5\5\5i\n\5\3\6\3\6\5\6m\n\6\3\7\3\7\3\7\3\7") + buf.write("\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3") + buf.write("\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3") + buf.write("\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17\3\17\3\17") + buf.write("\7\17\u0099\n\17\f\17\16\17\u009c\13\17\5\17\u009e\n\17") + buf.write("\3\17\3\17\3\20\3\20\5\20\u00a4\n\20\3\20\3\20\3\20\3") + buf.write("\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24") + buf.write("\3\25\3\25\3\25\3\25\7\25\u00b8\n\25\f\25\16\25\u00bb") + buf.write("\13\25\5\25\u00bd\n\25\3\26\3\26\3\26\3\26\3\26\3\26\3") + buf.write("\26\3\26\3\26\3\26\3\26\5\26\u00ca\n\26\3\26\3\26\3\26") + buf.write("\5\26\u00cf\n\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3") + buf.write("\26\7\26\u00d9\n\26\f\26\16\26\u00dc\13\26\3\27\3\27\3") + buf.write("\27\3\27\7\27\u00e2\n\27\f\27\16\27\u00e5\13\27\3\27\5") + buf.write("\27\u00e8\n\27\3\27\3\27\3\27\3\27\3\30\7\30\u00ef\n\30") + buf.write("\f\30\16\30\u00f2\13\30\3\30\7\30\u00f5\n\30\f\30\16\30") + buf.write("\u00f8\13\30\3\31\3\31\5\31\u00fc\n\31\3\32\3\32\5\32") + buf.write("\u0100\n\32\3\32\3\32\3\32\3\32\3\32\3\32\3\33\3\33\3") + buf.write("\33\3\33\3\33\3\33\3\33\6\33\u010f\n\33\r\33\16\33\u0110") + buf.write("\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\36\3\36\3\36") + buf.write("\3\36\3\36\5\36\u0120\n\36\3\36\7\36\u0123\n\36\f\36\16") + buf.write("\36\u0126\13\36\3\37\3\37\5\37\u012a\n\37\3\37\3\37\3") + buf.write("\37\5\37\u012f\n\37\6\37\u0131\n\37\r\37\16\37\u0132\3") + buf.write("\37\3\37\3\37\3 \3 \3 \3 \3 \3 \3 \3 \3 \3!\3!\3!\7!\u0144") + buf.write("\n!\f!\16!\u0147\13!\5!\u0149\n!\3\"\3\"\3\"\7\"\u014e") + buf.write("\n\"\f\"\16\"\u0151\13\"\5\"\u0153\n\"\3#\3#\3#\3#\3#") + buf.write("\3#\3#\3#\3#\3#\3#\3#\5#\u0161\n#\3#\3#\3#\3#\7#\u0167") + buf.write("\n#\f#\16#\u016a\13#\3$\3$\3%\3%\3&\3&\3&\3&\3&\5&\u0175") + buf.write("\n&\3&\2\4*D\'\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36") + buf.write(" \"$&(*,.\60\62\64\668:<>@BDFHJ\2\b\3\2\f\17\3\2\20\21") + buf.write("\3\2\36\37\3\2\34\35\3\2!&\3\2\'(\2\u0186\2L\3\2\2\2\4") + buf.write("R\3\2\2\2\6V\3\2\2\2\bh\3\2\2\2\nl\3\2\2\2\fn\3\2\2\2") + buf.write("\16t\3\2\2\2\20~\3\2\2\2\22\u0084\3\2\2\2\24\u008b\3\2") + buf.write("\2\2\26\u008e\3\2\2\2\30\u0090\3\2\2\2\32\u0092\3\2\2") + buf.write("\2\34\u0094\3\2\2\2\36\u00a3\3\2\2\2 \u00a8\3\2\2\2\"") + buf.write("\u00ad\3\2\2\2$\u00af\3\2\2\2&\u00b1\3\2\2\2(\u00b3\3") + buf.write("\2\2\2*\u00ce\3\2\2\2,\u00dd\3\2\2\2.\u00f0\3\2\2\2\60") + buf.write("\u00fb\3\2\2\2\62\u00ff\3\2\2\2\64\u0107\3\2\2\2\66\u0112") + buf.write("\3\2\2\28\u0114\3\2\2\2:\u0124\3\2\2\2<\u0129\3\2\2\2") + buf.write(">\u0137\3\2\2\2@\u0148\3\2\2\2B\u0152\3\2\2\2D\u0160\3") + buf.write("\2\2\2F\u016b\3\2\2\2H\u016d\3\2\2\2J\u0174\3\2\2\2LM") + buf.write("\5\4\3\2MN\7\2\2\3N\3\3\2\2\2OQ\5\b\5\2PO\3\2\2\2QT\3") + buf.write("\2\2\2RP\3\2\2\2RS\3\2\2\2S\5\3\2\2\2TR\3\2\2\2UW\5\b") + buf.write("\5\2VU\3\2\2\2WX\3\2\2\2XV\3\2\2\2XY\3\2\2\2Y\7\3\2\2") + buf.write("\2Zi\5<\37\2[i\5\36\20\2\\i\5 \21\2]i\5\n\6\2^i\5\20\t") + buf.write("\2_i\5\24\13\2`i\5\30\r\2ai\5\22\n\2bi\5\32\16\2ci\5,") + buf.write("\27\2di\5\62\32\2ei\5> \2fi\58\35\2gi\5(\25\2hZ\3\2\2") + buf.write("\2h[\3\2\2\2h\\\3\2\2\2h]\3\2\2\2h^\3\2\2\2h_\3\2\2\2") + buf.write("h`\3\2\2\2ha\3\2\2\2hb\3\2\2\2hc\3\2\2\2hd\3\2\2\2he\3") + buf.write("\2\2\2hf\3\2\2\2hg\3\2\2\2i\t\3\2\2\2jm\5\f\7\2km\5\16") + buf.write("\b\2lj\3\2\2\2lk\3\2\2\2m\13\3\2\2\2no\7\3\2\2op\5D#\2") + buf.write("pq\7\4\2\2qr\5\6\4\2rs\7\5\2\2s\r\3\2\2\2tu\7\3\2\2uv") + buf.write("\5D#\2vw\7\4\2\2wx\5\6\4\2xy\7\5\2\2yz\7\6\2\2z{\7\4\2") + buf.write("\2{|\5\6\4\2|}\7\5\2\2}\17\3\2\2\2~\177\7\7\2\2\177\u0080") + buf.write("\5J&\2\u0080\u0081\7\4\2\2\u0081\u0082\5\6\4\2\u0082\u0083") + buf.write("\7\5\2\2\u0083\21\3\2\2\2\u0084\u0085\7\b\2\2\u0085\u0086") + buf.write("\7\t\2\2\u0086\u0087\5*\26\2\u0087\u0088\7\n\2\2\u0088") + buf.write("\u0089\5*\26\2\u0089\u008a\7\13\2\2\u008a\23\3\2\2\2\u008b") + buf.write("\u008c\5\26\f\2\u008c\u008d\5*\26\2\u008d\25\3\2\2\2\u008e") + buf.write("\u008f\t\2\2\2\u008f\27\3\2\2\2\u0090\u0091\t\3\2\2\u0091") + buf.write("\31\3\2\2\2\u0092\u0093\7\22\2\2\u0093\33\3\2\2\2\u0094") + buf.write("\u009d\7\4\2\2\u0095\u009a\5*\26\2\u0096\u0097\7\n\2\2") + buf.write("\u0097\u0099\5*\26\2\u0098\u0096\3\2\2\2\u0099\u009c\3") + buf.write("\2\2\2\u009a\u0098\3\2\2\2\u009a\u009b\3\2\2\2\u009b\u009e") + buf.write("\3\2\2\2\u009c\u009a\3\2\2\2\u009d\u0095\3\2\2\2\u009d") + buf.write("\u009e\3\2\2\2\u009e\u009f\3\2\2\2\u009f\u00a0\7\5\2\2") + buf.write("\u00a0\35\3\2\2\2\u00a1\u00a4\7,\2\2\u00a2\u00a4\5\64") + buf.write("\33\2\u00a3\u00a1\3\2\2\2\u00a3\u00a2\3\2\2\2\u00a4\u00a5") + buf.write("\3\2\2\2\u00a5\u00a6\7\23\2\2\u00a6\u00a7\5*\26\2\u00a7") + buf.write("\37\3\2\2\2\u00a8\u00a9\7\24\2\2\u00a9\u00aa\7\t\2\2\u00aa") + buf.write("\u00ab\5*\26\2\u00ab\u00ac\7\13\2\2\u00ac!\3\2\2\2\u00ad") + buf.write("\u00ae\t\4\2\2\u00ae#\3\2\2\2\u00af\u00b0\t\5\2\2\u00b0") + buf.write("%\3\2\2\2\u00b1\u00b2\7\35\2\2\u00b2\'\3\2\2\2\u00b3\u00bc") + buf.write("\7\25\2\2\u00b4\u00b9\5*\26\2\u00b5\u00b6\7\n\2\2\u00b6") + buf.write("\u00b8\5*\26\2\u00b7\u00b5\3\2\2\2\u00b8\u00bb\3\2\2\2") + buf.write("\u00b9\u00b7\3\2\2\2\u00b9\u00ba\3\2\2\2\u00ba\u00bd\3") + buf.write("\2\2\2\u00bb\u00b9\3\2\2\2\u00bc\u00b4\3\2\2\2\u00bc\u00bd") + buf.write("\3\2\2\2\u00bd)\3\2\2\2\u00be\u00bf\b\26\1\2\u00bf\u00c0") + buf.write("\5&\24\2\u00c0\u00c1\5*\26\t\u00c1\u00cf\3\2\2\2\u00c2") + buf.write("\u00c3\7\t\2\2\u00c3\u00c4\5*\26\2\u00c4\u00c5\7\13\2") + buf.write("\2\u00c5\u00cf\3\2\2\2\u00c6\u00cf\5J&\2\u00c7\u00ca\7") + buf.write(",\2\2\u00c8\u00ca\5\64\33\2\u00c9\u00c7\3\2\2\2\u00c9") + buf.write("\u00c8\3\2\2\2\u00ca\u00cb\3\2\2\2\u00cb\u00cc\7\23\2") + buf.write("\2\u00cc\u00cf\5*\26\4\u00cd\u00cf\58\35\2\u00ce\u00be") + buf.write("\3\2\2\2\u00ce\u00c2\3\2\2\2\u00ce\u00c6\3\2\2\2\u00ce") + buf.write("\u00c9\3\2\2\2\u00ce\u00cd\3\2\2\2\u00cf\u00da\3\2\2\2") + buf.write("\u00d0\u00d1\f\b\2\2\u00d1\u00d2\5\"\22\2\u00d2\u00d3") + buf.write("\5*\26\t\u00d3\u00d9\3\2\2\2\u00d4\u00d5\f\7\2\2\u00d5") + buf.write("\u00d6\5$\23\2\u00d6\u00d7\5*\26\b\u00d7\u00d9\3\2\2\2") + buf.write("\u00d8\u00d0\3\2\2\2\u00d8\u00d4\3\2\2\2\u00d9\u00dc\3") + buf.write("\2\2\2\u00da\u00d8\3\2\2\2\u00da\u00db\3\2\2\2\u00db+") + buf.write("\3\2\2\2\u00dc\u00da\3\2\2\2\u00dd\u00de\7\26\2\2\u00de") + buf.write("\u00e7\7,\2\2\u00df\u00e3\7\t\2\2\u00e0\u00e2\7,\2\2\u00e1") + buf.write("\u00e0\3\2\2\2\u00e2\u00e5\3\2\2\2\u00e3\u00e1\3\2\2\2") + buf.write("\u00e3\u00e4\3\2\2\2\u00e4\u00e6\3\2\2\2\u00e5\u00e3\3") + buf.write("\2\2\2\u00e6\u00e8\7\13\2\2\u00e7\u00df\3\2\2\2\u00e7") + buf.write("\u00e8\3\2\2\2\u00e8\u00e9\3\2\2\2\u00e9\u00ea\7\27\2") + buf.write("\2\u00ea\u00eb\5.\30\2\u00eb\u00ec\7\30\2\2\u00ec-\3\2") + buf.write("\2\2\u00ed\u00ef\5\60\31\2\u00ee\u00ed\3\2\2\2\u00ef\u00f2") + buf.write("\3\2\2\2\u00f0\u00ee\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1") + buf.write("\u00f6\3\2\2\2\u00f2\u00f0\3\2\2\2\u00f3\u00f5\5> \2\u00f4") + buf.write("\u00f3\3\2\2\2\u00f5\u00f8\3\2\2\2\u00f6\u00f4\3\2\2\2") + buf.write("\u00f6\u00f7\3\2\2\2\u00f7/\3\2\2\2\u00f8\u00f6\3\2\2") + buf.write("\2\u00f9\u00fc\5\36\20\2\u00fa\u00fc\5\62\32\2\u00fb\u00f9") + buf.write("\3\2\2\2\u00fb\u00fa\3\2\2\2\u00fc\61\3\2\2\2\u00fd\u0100") + buf.write("\7,\2\2\u00fe\u0100\5\64\33\2\u00ff\u00fd\3\2\2\2\u00ff") + buf.write("\u00fe\3\2\2\2\u0100\u0101\3\2\2\2\u0101\u0102\7\23\2") + buf.write("\2\u0102\u0103\7\31\2\2\u0103\u0104\7,\2\2\u0104\u0105") + buf.write("\7\t\2\2\u0105\u0106\7\13\2\2\u0106\63\3\2\2\2\u0107\u010e") + buf.write("\5\66\34\2\u0108\u0109\7\32\2\2\u0109\u010f\7,\2\2\u010a") + buf.write("\u010b\7\4\2\2\u010b\u010c\5*\26\2\u010c\u010d\7\5\2\2") + buf.write("\u010d\u010f\3\2\2\2\u010e\u0108\3\2\2\2\u010e\u010a\3") + buf.write("\2\2\2\u010f\u0110\3\2\2\2\u0110\u010e\3\2\2\2\u0110\u0111") + buf.write("\3\2\2\2\u0111\65\3\2\2\2\u0112\u0113\7,\2\2\u0113\67") + buf.write("\3\2\2\2\u0114\u0115\5:\36\2\u0115\u0116\7-\2\2\u0116") + buf.write("\u0117\7\t\2\2\u0117\u0118\5B\"\2\u0118\u0119\7\13\2\2") + buf.write("\u01199\3\2\2\2\u011a\u0120\7,\2\2\u011b\u011c\7\4\2\2") + buf.write("\u011c\u011d\5*\26\2\u011d\u011e\7\5\2\2\u011e\u0120\3") + buf.write("\2\2\2\u011f\u011a\3\2\2\2\u011f\u011b\3\2\2\2\u0120\u0121") + buf.write("\3\2\2\2\u0121\u0123\7\32\2\2\u0122\u011f\3\2\2\2\u0123") + buf.write("\u0126\3\2\2\2\u0124\u0122\3\2\2\2\u0124\u0125\3\2\2\2") + buf.write("\u0125;\3\2\2\2\u0126\u0124\3\2\2\2\u0127\u012a\7,\2\2") + buf.write("\u0128\u012a\5\64\33\2\u0129\u0127\3\2\2\2\u0129\u0128") + buf.write("\3\2\2\2\u012a\u0130\3\2\2\2\u012b\u012e\7\n\2\2\u012c") + buf.write("\u012f\7,\2\2\u012d\u012f\5\64\33\2\u012e\u012c\3\2\2") + buf.write("\2\u012e\u012d\3\2\2\2\u012f\u0131\3\2\2\2\u0130\u012b") + buf.write("\3\2\2\2\u0131\u0132\3\2\2\2\u0132\u0130\3\2\2\2\u0132") + buf.write("\u0133\3\2\2\2\u0133\u0134\3\2\2\2\u0134\u0135\7\23\2") + buf.write("\2\u0135\u0136\58\35\2\u0136=\3\2\2\2\u0137\u0138\7\33") + buf.write("\2\2\u0138\u0139\7-\2\2\u0139\u013a\7\t\2\2\u013a\u013b") + buf.write("\5@!\2\u013b\u013c\7\13\2\2\u013c\u013d\7\27\2\2\u013d") + buf.write("\u013e\5\6\4\2\u013e\u013f\7\30\2\2\u013f?\3\2\2\2\u0140") + buf.write("\u0145\7,\2\2\u0141\u0142\7\n\2\2\u0142\u0144\7,\2\2\u0143") + buf.write("\u0141\3\2\2\2\u0144\u0147\3\2\2\2\u0145\u0143\3\2\2\2") + buf.write("\u0145\u0146\3\2\2\2\u0146\u0149\3\2\2\2\u0147\u0145\3") + buf.write("\2\2\2\u0148\u0140\3\2\2\2\u0148\u0149\3\2\2\2\u0149A") + buf.write("\3\2\2\2\u014a\u014f\5*\26\2\u014b\u014c\7\n\2\2\u014c") + buf.write("\u014e\5*\26\2\u014d\u014b\3\2\2\2\u014e\u0151\3\2\2\2") + buf.write("\u014f\u014d\3\2\2\2\u014f\u0150\3\2\2\2\u0150\u0153\3") + buf.write("\2\2\2\u0151\u014f\3\2\2\2\u0152\u014a\3\2\2\2\u0152\u0153") + buf.write("\3\2\2\2\u0153C\3\2\2\2\u0154\u0155\b#\1\2\u0155\u0156") + buf.write("\7)\2\2\u0156\u0161\5D#\7\u0157\u0158\5*\26\2\u0158\u0159") + buf.write("\5F$\2\u0159\u015a\5*\26\2\u015a\u0161\3\2\2\2\u015b\u0161") + buf.write("\7 \2\2\u015c\u015d\7\t\2\2\u015d\u015e\5D#\2\u015e\u015f") + buf.write("\7\13\2\2\u015f\u0161\3\2\2\2\u0160\u0154\3\2\2\2\u0160") + buf.write("\u0157\3\2\2\2\u0160\u015b\3\2\2\2\u0160\u015c\3\2\2\2") + buf.write("\u0161\u0168\3\2\2\2\u0162\u0163\f\5\2\2\u0163\u0164\5") + buf.write("H%\2\u0164\u0165\5D#\6\u0165\u0167\3\2\2\2\u0166\u0162") + buf.write("\3\2\2\2\u0167\u016a\3\2\2\2\u0168\u0166\3\2\2\2\u0168") + buf.write("\u0169\3\2\2\2\u0169E\3\2\2\2\u016a\u0168\3\2\2\2\u016b") + buf.write("\u016c\t\6\2\2\u016cG\3\2\2\2\u016d\u016e\t\7\2\2\u016e") + buf.write("I\3\2\2\2\u016f\u0175\7*\2\2\u0170\u0175\7,\2\2\u0171") + buf.write("\u0175\5\34\17\2\u0172\u0175\5\64\33\2\u0173\u0175\7+") + buf.write("\2\2\u0174\u016f\3\2\2\2\u0174\u0170\3\2\2\2\u0174\u0171") + buf.write("\3\2\2\2\u0174\u0172\3\2\2\2\u0174\u0173\3\2\2\2\u0175") + buf.write("K\3\2\2\2#RXhl\u009a\u009d\u00a3\u00b9\u00bc\u00c9\u00ce") + buf.write("\u00d8\u00da\u00e3\u00e7\u00f0\u00f6\u00fb\u00ff\u010e") + buf.write("\u0110\u011f\u0124\u0129\u012e\u0132\u0145\u0148\u014f") + buf.write("\u0152\u0160\u0168\u0174") return buf.getvalue() @@ -180,8 +193,8 @@ class tlangParser ( Parser ): "'left'", "'right'", "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'return'", "'class'", "'{'", "'}'", "'new'", "'.'", "'def'", "'+'", "'-'", "'*'", "'/'", - "'self'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", - "'<='", "'>='", "'&&'", "'||'", "'!'" ] + "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", + "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", "", "", "", "", "", "", "", @@ -190,9 +203,9 @@ class tlangParser ( Parser ): "", "", "", "", "", "", "", "", "", "", "PLUS", "MINUS", "MUL", - "DIV", "Self", "PENCOND", "LT", "GT", "EQ", "NEQ", - "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", - "NAME", "Whitespace" ] + "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", + "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", "NAME", + "Whitespace" ] RULE_start = 0 RULE_instruction_list = 1 @@ -222,14 +235,15 @@ class tlangParser ( Parser ): RULE_objectOrArrayAccess = 25 RULE_baseAccess = 26 RULE_functionCall = 27 - RULE_functionCallWithReturnValues = 28 - RULE_functionDeclaration = 29 - RULE_parameters = 30 - RULE_arguments = 31 - RULE_condition = 32 - RULE_binCondOp = 33 - RULE_logicOp = 34 - RULE_value = 35 + RULE_methodCaller = 28 + RULE_functionCallWithReturnValues = 29 + RULE_functionDeclaration = 30 + RULE_parameters = 31 + RULE_arguments = 32 + RULE_condition = 33 + RULE_binCondOp = 34 + RULE_logicOp = 35 + RULE_value = 36 ruleNames = [ "start", "instruction_list", "strict_ilist", "instruction", "conditional", "ifConditional", "ifElseConditional", @@ -238,9 +252,9 @@ class tlangParser ( Parser ): "multiplicative", "additive", "unaryArithOp", "returnStatement", "expression", "classDeclaration", "classBody", "classAttributeDeclaration", "objectInstantiation", "objectOrArrayAccess", "baseAccess", - "functionCall", "functionCallWithReturnValues", "functionDeclaration", - "parameters", "arguments", "condition", "binCondOp", - "logicOp", "value" ] + "functionCall", "methodCaller", "functionCallWithReturnValues", + "functionDeclaration", "parameters", "arguments", "condition", + "binCondOp", "logicOp", "value" ] EOF = Token.EOF T__0=1 @@ -272,22 +286,21 @@ class tlangParser ( Parser ): MINUS=27 MUL=28 DIV=29 - Self=30 - PENCOND=31 - LT=32 - GT=33 - EQ=34 - NEQ=35 - LTE=36 - GTE=37 - AND=38 - OR=39 - NOT=40 - NUM=41 - REAL=42 - VAR=43 - NAME=44 - Whitespace=45 + PENCOND=30 + LT=31 + GT=32 + EQ=33 + NEQ=34 + LTE=35 + GTE=36 + AND=37 + OR=38 + NOT=39 + NUM=40 + REAL=41 + VAR=42 + NAME=43 + Whitespace=44 def __init__(self, input:TokenStream, output:TextIO = sys.stdout): super().__init__(input, output) @@ -329,9 +342,9 @@ def start(self): self.enterRule(localctx, 0, self.RULE_start) try: self.enterOuterAlt(localctx, 1) - self.state = 72 + self.state = 74 self.instruction_list() - self.state = 73 + self.state = 75 self.match(tlangParser.EOF) except RecognitionException as re: localctx.exception = re @@ -374,13 +387,13 @@ def instruction_list(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 78 + self.state = 80 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 75 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): + self.state = 77 self.instruction() - self.state = 80 + self.state = 82 self._errHandler.sync(self) _la = self._input.LA(1) @@ -425,16 +438,16 @@ def strict_ilist(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 82 + self.state = 84 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 81 + self.state = 83 self.instruction() - self.state = 84 + self.state = 86 self._errHandler.sync(self) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): break except RecognitionException as re: @@ -525,90 +538,90 @@ def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) self.enterRule(localctx, 6, self.RULE_instruction) try: - self.state = 100 + self.state = 102 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,2,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 86 + self.state = 88 self.functionCallWithReturnValues() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 87 + self.state = 89 self.assignment() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 88 + self.state = 90 self.printStatement() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 89 + self.state = 91 self.conditional() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 90 + self.state = 92 self.loop() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 91 + self.state = 93 self.moveCommand() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 92 + self.state = 94 self.penCommand() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 93 + self.state = 95 self.gotoCommand() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 94 + self.state = 96 self.pauseCommand() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 95 + self.state = 97 self.classDeclaration() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 96 + self.state = 98 self.objectInstantiation() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 97 + self.state = 99 self.functionDeclaration() pass elif la_ == 13: self.enterOuterAlt(localctx, 13) - self.state = 98 + self.state = 100 self.functionCall() pass elif la_ == 14: self.enterOuterAlt(localctx, 14) - self.state = 99 + self.state = 101 self.returnStatement() pass @@ -653,18 +666,18 @@ def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) self.enterRule(localctx, 8, self.RULE_conditional) try: - self.state = 104 + self.state = 106 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,3,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 102 + self.state = 104 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 103 + self.state = 105 self.ifElseConditional() pass @@ -710,15 +723,15 @@ def ifConditional(self): self.enterRule(localctx, 10, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 106 + self.state = 108 self.match(tlangParser.T__0) - self.state = 107 + self.state = 109 self.condition(0) - self.state = 108 + self.state = 110 self.match(tlangParser.T__1) - self.state = 109 + self.state = 111 self.strict_ilist() - self.state = 110 + self.state = 112 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -764,23 +777,23 @@ def ifElseConditional(self): self.enterRule(localctx, 12, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 112 + self.state = 114 self.match(tlangParser.T__0) - self.state = 113 + self.state = 115 self.condition(0) - self.state = 114 + self.state = 116 self.match(tlangParser.T__1) - self.state = 115 + self.state = 117 self.strict_ilist() - self.state = 116 + self.state = 118 self.match(tlangParser.T__2) - self.state = 117 + self.state = 119 self.match(tlangParser.T__3) - self.state = 118 + self.state = 120 self.match(tlangParser.T__1) - self.state = 119 + self.state = 121 self.strict_ilist() - self.state = 120 + self.state = 122 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -823,15 +836,15 @@ def loop(self): self.enterRule(localctx, 14, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 122 + self.state = 124 self.match(tlangParser.T__4) - self.state = 123 + self.state = 125 self.value() - self.state = 124 + self.state = 126 self.match(tlangParser.T__1) - self.state = 125 + self.state = 127 self.strict_ilist() - self.state = 126 + self.state = 128 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -873,17 +886,17 @@ def gotoCommand(self): self.enterRule(localctx, 16, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 128 - self.match(tlangParser.T__5) - self.state = 129 - self.match(tlangParser.T__6) self.state = 130 - self.expression(0) + self.match(tlangParser.T__5) self.state = 131 - self.match(tlangParser.T__7) + self.match(tlangParser.T__6) self.state = 132 self.expression(0) self.state = 133 + self.match(tlangParser.T__7) + self.state = 134 + self.expression(0) + self.state = 135 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -926,9 +939,9 @@ def moveCommand(self): self.enterRule(localctx, 18, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 135 + self.state = 137 self.moveOp() - self.state = 136 + self.state = 138 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -965,7 +978,7 @@ def moveOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 138 + self.state = 140 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -1007,7 +1020,7 @@ def penCommand(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 140 + self.state = 142 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -1048,7 +1061,7 @@ def pauseCommand(self): self.enterRule(localctx, 24, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 142 + self.state = 144 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -1091,29 +1104,29 @@ def array(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 144 + self.state = 146 self.match(tlangParser.T__1) - self.state = 153 + self.state = 155 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 145 + self.state = 147 self.expression(0) - self.state = 150 + self.state = 152 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 146 + self.state = 148 self.match(tlangParser.T__7) - self.state = 147 + self.state = 149 self.expression(0) - self.state = 152 + self.state = 154 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 155 + self.state = 157 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -1159,23 +1172,23 @@ def assignment(self): self.enterRule(localctx, 28, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 159 + self.state = 161 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,6,self._ctx) if la_ == 1: - self.state = 157 + self.state = 159 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 158 + self.state = 160 self.objectOrArrayAccess() pass - self.state = 161 + self.state = 163 self.match(tlangParser.T__16) - self.state = 162 + self.state = 164 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1214,13 +1227,13 @@ def printStatement(self): self.enterRule(localctx, 30, self.RULE_printStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 164 + self.state = 166 self.match(tlangParser.T__17) - self.state = 165 + self.state = 167 self.match(tlangParser.T__6) - self.state = 166 + self.state = 168 self.expression(0) - self.state = 167 + self.state = 169 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1262,7 +1275,7 @@ def multiplicative(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 169 + self.state = 171 _la = self._input.LA(1) if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) @@ -1309,7 +1322,7 @@ def additive(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 171 + self.state = 173 _la = self._input.LA(1) if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) @@ -1352,7 +1365,7 @@ def unaryArithOp(self): self.enterRule(localctx, 36, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 173 + self.state = 175 self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re @@ -1395,23 +1408,23 @@ def returnStatement(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 175 + self.state = 177 self.match(tlangParser.T__18) - self.state = 184 + self.state = 186 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,8,self._ctx) if la_ == 1: - self.state = 176 + self.state = 178 self.expression(0) - self.state = 181 + self.state = 183 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 177 + self.state = 179 self.match(tlangParser.T__7) - self.state = 178 + self.state = 180 self.expression(0) - self.state = 183 + self.state = 185 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1590,7 +1603,7 @@ def expression(self, _p:int=0): self.enterRecursionRule(localctx, 40, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 202 + self.state = 204 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,10,self._ctx) if la_ == 1: @@ -1598,9 +1611,9 @@ def expression(self, _p:int=0): self._ctx = localctx _prevctx = localctx - self.state = 187 + self.state = 189 self.unaryArithOp() - self.state = 188 + self.state = 190 self.expression(7) pass @@ -1608,11 +1621,11 @@ def expression(self, _p:int=0): localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 190 + self.state = 192 self.match(tlangParser.T__6) - self.state = 191 + self.state = 193 self.expression(0) - self.state = 192 + self.state = 194 self.match(tlangParser.T__8) pass @@ -1620,7 +1633,7 @@ def expression(self, _p:int=0): localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 194 + self.state = 196 self.value() pass @@ -1628,23 +1641,23 @@ def expression(self, _p:int=0): localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 197 + self.state = 199 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,9,self._ctx) if la_ == 1: - self.state = 195 + self.state = 197 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 196 + self.state = 198 self.objectOrArrayAccess() pass - self.state = 199 + self.state = 201 self.match(tlangParser.T__16) - self.state = 200 + self.state = 202 self.expression(2) pass @@ -1652,13 +1665,13 @@ def expression(self, _p:int=0): localctx = tlangParser.FunctionCallExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 201 + self.state = 203 self.functionCall() pass self._ctx.stop = self._input.LT(-1) - self.state = 214 + self.state = 216 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,12,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -1666,37 +1679,37 @@ def expression(self, _p:int=0): if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 212 + self.state = 214 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,11,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 204 + self.state = 206 if not self.precpred(self._ctx, 6): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 6)") - self.state = 205 + self.state = 207 self.multiplicative() - self.state = 206 + self.state = 208 self.expression(7) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 208 + self.state = 210 if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 209 + self.state = 211 self.additive() - self.state = 210 + self.state = 212 self.expression(6) pass - self.state = 216 + self.state = 218 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,12,self._ctx) @@ -1715,8 +1728,11 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def VAR(self): - return self.getToken(tlangParser.VAR, 0) + def VAR(self, i:int=None): + if i is None: + return self.getTokens(tlangParser.VAR) + else: + return self.getToken(tlangParser.VAR, i) def classBody(self): return self.getTypedRuleContext(tlangParser.ClassBodyContext,0) @@ -1738,17 +1754,38 @@ def classDeclaration(self): localctx = tlangParser.ClassDeclarationContext(self, self._ctx, self.state) self.enterRule(localctx, 42, self.RULE_classDeclaration) + self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 217 + self.state = 219 self.match(tlangParser.T__19) - self.state = 218 + self.state = 220 self.match(tlangParser.VAR) - self.state = 219 + self.state = 229 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==tlangParser.T__6: + self.state = 221 + self.match(tlangParser.T__6) + self.state = 225 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==tlangParser.VAR: + self.state = 222 + self.match(tlangParser.VAR) + self.state = 227 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 228 + self.match(tlangParser.T__8) + + + self.state = 231 self.match(tlangParser.T__20) - self.state = 220 + self.state = 232 self.classBody() - self.state = 221 + self.state = 233 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -1798,23 +1835,23 @@ def classBody(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 226 + self.state = 238 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 223 + self.state = 235 self.classAttributeDeclaration() - self.state = 228 + self.state = 240 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 232 + self.state = 244 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__24: - self.state = 229 + self.state = 241 self.functionDeclaration() - self.state = 234 + self.state = 246 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1858,18 +1895,18 @@ def classAttributeDeclaration(self): localctx = tlangParser.ClassAttributeDeclarationContext(self, self._ctx, self.state) self.enterRule(localctx, 46, self.RULE_classAttributeDeclaration) try: - self.state = 237 + self.state = 249 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,15,self._ctx) + la_ = self._interp.adaptivePredict(self._input,17,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 235 + self.state = 247 self.assignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 236 + self.state = 248 self.objectInstantiation() pass @@ -1917,29 +1954,29 @@ def objectInstantiation(self): self.enterRule(localctx, 48, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 241 + self.state = 253 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,16,self._ctx) + la_ = self._interp.adaptivePredict(self._input,18,self._ctx) if la_ == 1: - self.state = 239 + self.state = 251 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 240 + self.state = 252 self.objectOrArrayAccess() pass - self.state = 243 + self.state = 255 self.match(tlangParser.T__16) - self.state = 244 + self.state = 256 self.match(tlangParser.T__22) - self.state = 245 + self.state = 257 self.match(tlangParser.VAR) - self.state = 246 + self.state = 258 self.match(tlangParser.T__6) - self.state = 247 + self.state = 259 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1991,28 +2028,28 @@ def objectOrArrayAccess(self): self.enterRule(localctx, 50, self.RULE_objectOrArrayAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 249 + self.state = 261 self.baseAccess() - self.state = 256 + self.state = 268 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 256 + self.state = 268 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__23]: - self.state = 250 + self.state = 262 self.match(tlangParser.T__23) - self.state = 251 + self.state = 263 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 252 + self.state = 264 self.match(tlangParser.T__1) - self.state = 253 + self.state = 265 self.expression(0) - self.state = 254 + self.state = 266 self.match(tlangParser.T__2) pass else: @@ -2021,9 +2058,9 @@ def objectOrArrayAccess(self): else: raise NoViableAltException(self) - self.state = 258 + self.state = 270 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,18,self._ctx) + _alt = self._interp.adaptivePredict(self._input,20,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2061,7 +2098,7 @@ def baseAccess(self): self.enterRule(localctx, 52, self.RULE_baseAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 260 + self.state = 272 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -2078,6 +2115,10 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + def methodCaller(self): + return self.getTypedRuleContext(tlangParser.MethodCallerContext,0) + + def NAME(self): return self.getToken(tlangParser.NAME, 0) @@ -2103,13 +2144,15 @@ def functionCall(self): self.enterRule(localctx, 54, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 262 + self.state = 274 + self.methodCaller() + self.state = 275 self.match(tlangParser.NAME) - self.state = 263 + self.state = 276 self.match(tlangParser.T__6) - self.state = 264 + self.state = 277 self.arguments() - self.state = 265 + self.state = 278 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2120,6 +2163,81 @@ def functionCall(self): return localctx + class MethodCallerContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def VAR(self, i:int=None): + if i is None: + return self.getTokens(tlangParser.VAR) + else: + return self.getToken(tlangParser.VAR, i) + + def expression(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.ExpressionContext) + else: + return self.getTypedRuleContext(tlangParser.ExpressionContext,i) + + + def getRuleIndex(self): + return tlangParser.RULE_methodCaller + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitMethodCaller" ): + return visitor.visitMethodCaller(self) + else: + return visitor.visitChildren(self) + + + + + def methodCaller(self): + + localctx = tlangParser.MethodCallerContext(self, self._ctx, self.state) + self.enterRule(localctx, 56, self.RULE_methodCaller) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 290 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==tlangParser.T__1 or _la==tlangParser.VAR: + self.state = 285 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [tlangParser.VAR]: + self.state = 280 + self.match(tlangParser.VAR) + pass + elif token in [tlangParser.T__1]: + self.state = 281 + self.match(tlangParser.T__1) + self.state = 282 + self.expression(0) + self.state = 283 + self.match(tlangParser.T__2) + pass + else: + raise NoViableAltException(self) + + self.state = 287 + self.match(tlangParser.T__23) + self.state = 292 + self._errHandler.sync(self) + _la = self._input.LA(1) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class FunctionCallWithReturnValuesContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -2158,53 +2276,53 @@ def accept(self, visitor:ParseTreeVisitor): def functionCallWithReturnValues(self): localctx = tlangParser.FunctionCallWithReturnValuesContext(self, self._ctx, self.state) - self.enterRule(localctx, 56, self.RULE_functionCallWithReturnValues) + self.enterRule(localctx, 58, self.RULE_functionCallWithReturnValues) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 269 + self.state = 295 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,19,self._ctx) + la_ = self._interp.adaptivePredict(self._input,23,self._ctx) if la_ == 1: - self.state = 267 + self.state = 293 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 268 + self.state = 294 self.objectOrArrayAccess() pass - self.state = 276 + self.state = 302 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 271 + self.state = 297 self.match(tlangParser.T__7) - self.state = 274 + self.state = 300 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,20,self._ctx) + la_ = self._interp.adaptivePredict(self._input,24,self._ctx) if la_ == 1: - self.state = 272 + self.state = 298 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 273 + self.state = 299 self.objectOrArrayAccess() pass - self.state = 278 + self.state = 304 self._errHandler.sync(self) _la = self._input.LA(1) if not (_la==tlangParser.T__7): break - self.state = 280 + self.state = 306 self.match(tlangParser.T__16) - self.state = 281 + self.state = 307 self.functionCall() except RecognitionException as re: localctx.exception = re @@ -2247,24 +2365,24 @@ def accept(self, visitor:ParseTreeVisitor): def functionDeclaration(self): localctx = tlangParser.FunctionDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 58, self.RULE_functionDeclaration) + self.enterRule(localctx, 60, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 283 + self.state = 309 self.match(tlangParser.T__24) - self.state = 284 + self.state = 310 self.match(tlangParser.NAME) - self.state = 285 + self.state = 311 self.match(tlangParser.T__6) - self.state = 286 + self.state = 312 self.parameters() - self.state = 287 + self.state = 313 self.match(tlangParser.T__8) - self.state = 288 + self.state = 314 self.match(tlangParser.T__20) - self.state = 289 + self.state = 315 self.strict_ilist() - self.state = 290 + self.state = 316 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -2287,9 +2405,6 @@ def VAR(self, i:int=None): else: return self.getToken(tlangParser.VAR, i) - def Self(self): - return self.getToken(tlangParser.Self, 0) - def getRuleIndex(self): return tlangParser.RULE_parameters @@ -2305,30 +2420,25 @@ def accept(self, visitor:ParseTreeVisitor): def parameters(self): localctx = tlangParser.ParametersContext(self, self._ctx, self.state) - self.enterRule(localctx, 60, self.RULE_parameters) + self.enterRule(localctx, 62, self.RULE_parameters) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 300 + self.state = 326 self._errHandler.sync(self) _la = self._input.LA(1) - if _la==tlangParser.Self or _la==tlangParser.VAR: - self.state = 292 - _la = self._input.LA(1) - if not(_la==tlangParser.Self or _la==tlangParser.VAR): - self._errHandler.recoverInline(self) - else: - self._errHandler.reportMatch(self) - self.consume() - self.state = 297 + if _la==tlangParser.VAR: + self.state = 318 + self.match(tlangParser.VAR) + self.state = 323 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 293 + self.state = 319 self.match(tlangParser.T__7) - self.state = 294 + self.state = 320 self.match(tlangParser.VAR) - self.state = 299 + self.state = 325 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2371,25 +2481,25 @@ def accept(self, visitor:ParseTreeVisitor): def arguments(self): localctx = tlangParser.ArgumentsContext(self, self._ctx, self.state) - self.enterRule(localctx, 62, self.RULE_arguments) + self.enterRule(localctx, 64, self.RULE_arguments) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 310 + self.state = 336 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 302 + self.state = 328 self.expression(0) - self.state = 307 + self.state = 333 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 303 + self.state = 329 self.match(tlangParser.T__7) - self.state = 304 + self.state = 330 self.expression(0) - self.state = 309 + self.state = 335 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2454,48 +2564,48 @@ def condition(self, _p:int=0): _parentState = self.state localctx = tlangParser.ConditionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 64 - self.enterRecursionRule(localctx, 64, self.RULE_condition, _p) + _startState = 66 + self.enterRecursionRule(localctx, 66, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 324 + self.state = 350 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,26,self._ctx) + la_ = self._interp.adaptivePredict(self._input,30,self._ctx) if la_ == 1: - self.state = 313 + self.state = 339 self.match(tlangParser.NOT) - self.state = 314 + self.state = 340 self.condition(5) pass elif la_ == 2: - self.state = 315 + self.state = 341 self.expression(0) - self.state = 316 + self.state = 342 self.binCondOp() - self.state = 317 + self.state = 343 self.expression(0) pass elif la_ == 3: - self.state = 319 + self.state = 345 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 320 + self.state = 346 self.match(tlangParser.T__6) - self.state = 321 + self.state = 347 self.condition(0) - self.state = 322 + self.state = 348 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 332 + self.state = 358 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,27,self._ctx) + _alt = self._interp.adaptivePredict(self._input,31,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -2503,17 +2613,17 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 326 + self.state = 352 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 327 + self.state = 353 self.logicOp() - self.state = 328 + self.state = 354 self.condition(4) - self.state = 334 + self.state = 360 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,27,self._ctx) + _alt = self._interp.adaptivePredict(self._input,31,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2563,11 +2673,11 @@ def accept(self, visitor:ParseTreeVisitor): def binCondOp(self): localctx = tlangParser.BinCondOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 66, self.RULE_binCondOp) + self.enterRule(localctx, 68, self.RULE_binCondOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 335 + self.state = 361 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2610,11 +2720,11 @@ def accept(self, visitor:ParseTreeVisitor): def logicOp(self): localctx = tlangParser.LogicOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 68, self.RULE_logicOp) + self.enterRule(localctx, 70, self.RULE_logicOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 337 + self.state = 363 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2668,38 +2778,38 @@ def accept(self, visitor:ParseTreeVisitor): def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) - self.enterRule(localctx, 70, self.RULE_value) + self.enterRule(localctx, 72, self.RULE_value) try: - self.state = 344 + self.state = 370 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,28,self._ctx) + la_ = self._interp.adaptivePredict(self._input,32,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 339 + self.state = 365 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 340 + self.state = 366 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 341 + self.state = 367 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 342 + self.state = 368 self.objectOrArrayAccess() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 343 + self.state = 369 self.match(tlangParser.REAL) pass @@ -2718,7 +2828,7 @@ def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): if self._predicates == None: self._predicates = dict() self._predicates[20] = self.expression_sempred - self._predicates[32] = self.condition_sempred + self._predicates[33] = self.condition_sempred pred = self._predicates.get(ruleIndex, None) if pred is None: raise Exception("No predicate with index:" + str(ruleIndex)) diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index f3309e8..3bc78c1 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -179,6 +179,11 @@ def visitFunctionCall(self, ctx:tlangParser.FunctionCallContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#methodCaller. + def visitMethodCaller(self, ctx:tlangParser.MethodCallerContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#functionCallWithReturnValues. def visitFunctionCallWithReturnValues(self, ctx:tlangParser.FunctionCallWithReturnValuesContext): return self.visitChildren(ctx) From cfe287a945d962a943b664febc6d9ebb0f9612d9 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Mon, 17 Mar 2025 10:24:12 +0530 Subject: [PATCH 14/47] inheritance now supported --- ChironCore/example/issues.txt | 4 ++ ChironCore/example/kachuapur4.tl | 21 +++++++ ChironCore/interpreter.py | 97 ++++++++++++++++++++------------ 3 files changed, 86 insertions(+), 36 deletions(-) diff --git a/ChironCore/example/issues.txt b/ChironCore/example/issues.txt index 51a4696..9523a31 100644 --- a/ChironCore/example/issues.txt +++ b/ChironCore/example/issues.txt @@ -3,3 +3,7 @@ 3. class currently should have at least one member or python dynamic class initiation throw indentation error 4. Setting objects to N0ne in declaration is not done yet 5. instruction_list can contain both function declaration and classDeclaration this can cause problems +6. Multiple class inheritance is not yet supported! +7. return is compulsory in function declaration +8. Solution to Avoid Unexpected Changes in Mutable Class Variables: use __init__ method during class declaration +9. \ No newline at end of file diff --git a/ChironCore/example/kachuapur4.tl b/ChironCore/example/kachuapur4.tl index 151500e..3d8c396 100644 --- a/ChironCore/example/kachuapur4.tl +++ b/ChironCore/example/kachuapur4.tl @@ -1,9 +1,18 @@ class :Animal { :tail = 1 + :legs = 2 + + def inheritTheMethod(:self) + { + print(:self.:tail) + print(:self.:legs) + return + } } class :Cat(:Animal) { :legs = 4 + :tail = 1 def printProperties(:self) { print(:self.:tail) @@ -17,10 +26,22 @@ class :Cat(:Animal) { } } +class :dummy{ + :test = 1 +} :whiskers2 = new :Cat() :delta = 4 :legs = :whiskers2.incrementLegs(:delta) +:whiskers2.:tail = 2 print(:legs) print(:whiskers2.:legs) +:whiskers2.printProperties() +:whiskers2.inheritTheMethod() + +print(:whiskers2.:legs) +print(:whiskers2.:tail) +:whisker = new :Cat() +print(:whisker.:legs) +print(:whisker.:tail) diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index abfff5d..3efd058 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -3,11 +3,12 @@ from ChironHooks import Chironhooks import turtle import re -Release="Chiron v5.3" +Release = "Chiron v5.3" + def addContext(s): - s= re.sub(r'(? {getattr(self.prg, lhs)}") + print("Printing function addresses:[][][] ", self.function_addresses) return 1 - def handleObjectInstantiation(self, stmt, tgt): print(f"Creating new instance of {stmt.class_name} for {stmt.target}") - lhs = str(stmt.target).replace(":","") - rhs = addContext(stmt.class_name).replace("self.prg.", "self.class_list.") + lhs = str(stmt.target).replace(":", "") + rhs = addContext(stmt.class_name).replace( + "self.prg.", "self.class_list.") # exec(instance_code, globals(), self.prg.__dict__) # Store in self.prg exec(f"self.prg.{lhs} = {rhs}()") @@ -283,19 +312,17 @@ def handleObjectInstantiation(self, stmt, tgt): return 1 - - def handleAssignment(self, stmt, tgt): print(" Assignment Statement") - lhs = str(stmt.lvar).replace(":","") + lhs = str(stmt.lvar).replace(":", "") rhs = addContext(stmt.rexpr) - print(lhs,rhs,"Assignment") + print(lhs, rhs, "Assignment") # exec("setattr(self.prg,\"%s\",%s)" % (lhs,rhs)) exec(f"self.prg.{lhs} = {rhs}") return 1 - - def handlePrint(self,stmt,tgt): - print( " PrintCommand") + + def handlePrint(self, stmt, tgt): + print(" PrintCommand") expr = addContext(stmt.expr) print("Executing print with expression:", expr) exec("print(%s)" % expr) @@ -309,10 +336,8 @@ def handleCondition(self, stmt, tgt): def handleMove(self, stmt, tgt): print(" MoveCommand") - exec("self.trtl.%s(%s)" % (stmt.direction,addContext(stmt.expr))) + exec("self.trtl.%s(%s)" % (stmt.direction, addContext(stmt.expr))) return 1 - - def handleNoOpCommand(self, stmt, tgt): print(" No-Op Command") @@ -320,7 +345,7 @@ def handleNoOpCommand(self, stmt, tgt): def handlePen(self, stmt, tgt): print(" PenCommand") - exec("self.trtl.%s()"%(stmt.status)) + exec("self.trtl.%s()" % (stmt.status)) return 1 def handleGotoCommand(self, stmt, tgt): From f7a0f51fdc9d9022fc8c1a380ee98d6c357fcedd Mon Sep 17 00:00:00 2001 From: Yash Pratap Singh Date: Wed, 19 Mar 2025 16:59:28 +0530 Subject: [PATCH 15/47] Add demo test cases for functions, class methods, and inheritance --- ChironCore/example/demo/class_inheritance.tl | 15 +++++++++ .../example/demo/class_inheritance_2.tl | 17 ++++++++++ ChironCore/example/demo/class_methods.tl | 15 +++++++++ ChironCore/example/demo/functions.tl | 11 +++++++ ChironCore/example/demo/general.tl | 31 +++++++++++++++++++ 5 files changed, 89 insertions(+) create mode 100644 ChironCore/example/demo/class_inheritance.tl create mode 100644 ChironCore/example/demo/class_inheritance_2.tl create mode 100644 ChironCore/example/demo/class_methods.tl create mode 100644 ChironCore/example/demo/functions.tl create mode 100644 ChironCore/example/demo/general.tl diff --git a/ChironCore/example/demo/class_inheritance.tl b/ChironCore/example/demo/class_inheritance.tl new file mode 100644 index 0000000..de87c24 --- /dev/null +++ b/ChironCore/example/demo/class_inheritance.tl @@ -0,0 +1,15 @@ +class :Shape { + :length = 250 +} + +class :Triangle(:Shape) { + :sides = 3 +} + +:tri = new :Triangle() +:count = 0 +repeat :tri.:sides [ + forward :tri.:length + right 120 + :count = :count + 1 +] diff --git a/ChironCore/example/demo/class_inheritance_2.tl b/ChironCore/example/demo/class_inheritance_2.tl new file mode 100644 index 0000000..40799e8 --- /dev/null +++ b/ChironCore/example/demo/class_inheritance_2.tl @@ -0,0 +1,17 @@ +class :Shape { + :length = 250 +} + +class :Hexagon(:Shape) { + :sides = 6 + def drawHex(:self) { + repeat :self.:sides [ + forward :self.:length + right 60 + ] + return + } +} + +:hex = new :Hexagon() +:hex.drawHex() diff --git a/ChironCore/example/demo/class_methods.tl b/ChironCore/example/demo/class_methods.tl new file mode 100644 index 0000000..ba185be --- /dev/null +++ b/ChironCore/example/demo/class_methods.tl @@ -0,0 +1,15 @@ +class :Pentagon { + :sides = 5 + :length = 250 + def drawShape(:self) { + :angle = 360 / :self.:sides + repeat :self.:sides [ + forward :self.:length + right :angle + ] + return + } +} + +:pent = new :Pentagon() +:pent.drawShape() diff --git a/ChironCore/example/demo/functions.tl b/ChironCore/example/demo/functions.tl new file mode 100644 index 0000000..cccb6eb --- /dev/null +++ b/ChironCore/example/demo/functions.tl @@ -0,0 +1,11 @@ +def drawSide(:length) { + forward :length + right 90 + return +} + +:length = 250 +drawSide(:length) +drawSide(:length) +drawSide(:length) +drawSide(:length) diff --git a/ChironCore/example/demo/general.tl b/ChironCore/example/demo/general.tl new file mode 100644 index 0000000..a1ff8a3 --- /dev/null +++ b/ChironCore/example/demo/general.tl @@ -0,0 +1,31 @@ +class :Shape { + :length = 250 +} + +class :Star(:Shape) { + :points = 5 + def drawStar(:self) { + :angle = 144 + repeat :self.:points [ + forward :self.:length + right :angle + ] + return + } +} + +def drawSquare(:size) { + repeat 4 [ + forward :size + right 90 + ] + return +} + +:star = new :Star() +:star.drawStar() +penup +goto(-25, 100) +pendown +:size = 300 +drawSquare(:size) From 82018228f4bb0adaa078e8dd1824b65b8bf402c0 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Wed, 19 Mar 2025 18:15:06 +0530 Subject: [PATCH 16/47] [bug fix for method call] --- ChironCore/example/demo/class_inheritance_2.tl | 8 ++++++-- ChironCore/example/{ => demo}/rangoli.tl | 0 ChironCore/interpreter.py | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) rename ChironCore/example/{ => demo}/rangoli.tl (100%) diff --git a/ChironCore/example/demo/class_inheritance_2.tl b/ChironCore/example/demo/class_inheritance_2.tl index 40799e8..e3fa250 100644 --- a/ChironCore/example/demo/class_inheritance_2.tl +++ b/ChironCore/example/demo/class_inheritance_2.tl @@ -1,12 +1,16 @@ class :Shape { :length = 250 + def moveForward(:self) { + forward :self.:length + return + } } class :Hexagon(:Shape) { :sides = 6 def drawHex(:self) { repeat :self.:sides [ - forward :self.:length + :self.moveForward() right 60 ] return @@ -14,4 +18,4 @@ class :Hexagon(:Shape) { } :hex = new :Hexagon() -:hex.drawHex() +:hex.drawHex() \ No newline at end of file diff --git a/ChironCore/example/rangoli.tl b/ChironCore/example/demo/rangoli.tl similarity index 100% rename from ChironCore/example/rangoli.tl rename to ChironCore/example/demo/rangoli.tl diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 3efd058..2cea89e 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -185,9 +185,10 @@ def handleFunctionCall(self, stmt, tgt): if stmt.caller: print("FINDING CLASS NAME!###################") print("Caller: ", stmt.caller) + print(stmt.name) caller_class = eval(addContext(stmt.caller)).__class__.__name__ print(caller_class) - stmt.name = ":" + str(caller_class) + "@" + str(stmt.name) + method_name = ":" + str(caller_class) + "@" + str(stmt.name) self.call_stack.append(self.pc + 1) # Save the current program context self.call_stack.append(self.prg) @@ -197,7 +198,10 @@ def handleFunctionCall(self, stmt, tgt): exec(f"self.argument = {arg_value}") self.call_stack.append(self.argument) self.prg = ProgramContext() - self.pc = self.function_addresses[stmt.name] + if stmt.caller: + self.pc = self.function_addresses[method_name] + else: + self.pc = self.function_addresses[stmt.name] return 0 def handleReturnRead(self, stmt, tgt): From d81aa5b4ce9e8ba382527397be3e8792eeccf3b0 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Wed, 19 Mar 2025 20:13:25 +0530 Subject: [PATCH 17/47] updated grammar --- ChironCore/ChironAST/builder.py | 9 +- ChironCore/example/kachuapur4.tl | 53 +- ChironCore/turtparse/tlang.g4 | 13 +- ChironCore/turtparse/tlang.interp | 3 +- ChironCore/turtparse/tlangParser.py | 861 ++++++++++++++------------- ChironCore/turtparse/tlangVisitor.py | 5 + 6 files changed, 474 insertions(+), 470 deletions(-) diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 8cffce9..9df551d 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -19,7 +19,7 @@ def __init__(self): self.subStmtList = [] self.virtualRegCount = 0 - def getLval(self, ctx): + def getLval(self, ctx:tlangParser.LvalueContext): if ctx.VAR(): if isinstance(ctx.VAR(), list): @@ -154,10 +154,10 @@ def visitMethodCaller(self, ctx: tlangParser.MethodCallerContext): def visitObjectInstantiation(self, ctx: tlangParser.ObjectInstantiationContext): # Extract the left-hand side (target variable or object access) - lval = self.getLval(ctx) + lval = self.getLval(ctx.lvalue()) # Extract the class name # The last VAR is the class being instantiated - class_name = ctx.VAR()[-1].getText() + class_name = ctx.VAR().getText() return [(ChironAST.ObjectInstantiationCommand(lval, class_name), 1)] @@ -214,10 +214,11 @@ def visitFunctionCallExpr(self, ctx: tlangParser.FunctionCallExprContext): self.subStmtList.extend(currStmtList) return returnLocation + def visitAssignExpr(self, ctx: tlangParser.AssignExprContext): print("Assignment Expr") - lval = self.getLval(ctx) + lval = self.getLval(ctx.lvalue()) rval = self.visit(ctx.expression()) currentStmtList = [(ChironAST.AssignmentCommand(lval, rval), 1)] self.subStmtList.extend(currentStmtList) diff --git a/ChironCore/example/kachuapur4.tl b/ChironCore/example/kachuapur4.tl index 3d8c396..7a4bb3b 100644 --- a/ChironCore/example/kachuapur4.tl +++ b/ChironCore/example/kachuapur4.tl @@ -1,47 +1,12 @@ -class :Animal { - :tail = 1 - :legs = 2 - - def inheritTheMethod(:self) - { - print(:self.:tail) - print(:self.:legs) - return - } -} - -class :Cat(:Animal) { - :legs = 4 - :tail = 1 - def printProperties(:self) - { - print(:self.:tail) - print(:self.:legs) - return - } - def incrementLegs(:self, :delta) - { - :self.:legs = :self.:legs + :delta - return :self.:legs - } +def add(:a, :b) +{ + return :a + :b } - -class :dummy{ - :test = 1 +def increment(:val) +{ + return add(:val, 1) } -:whiskers2 = new :Cat() -:delta = 4 -:legs = :whiskers2.incrementLegs(:delta) -:whiskers2.:tail = 2 -print(:legs) -print(:whiskers2.:legs) -:whiskers2.printProperties() -:whiskers2.inheritTheMethod() - -print(:whiskers2.:legs) -print(:whiskers2.:tail) -:whisker = new :Cat() -print(:whisker.:legs) -print(:whisker.:tail) - +:val = 1 +:val = increment(:val) +print(:val) \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index d004aef..a36959c 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -70,26 +70,31 @@ expression : unaryArithOp expression #unaryExpr | expression multiplicative expression #mulExpr | expression additive expression #addExpr + | lvalue '=' expression #assignExpr + | functionCall #functionCallExpr | '(' expression ')' #parenExpr | value #valueExpr - | ( VAR | objectOrArrayAccess) '=' expression #assignExpr - | functionCall #functionCallExpr - ; + classDeclaration : 'class' VAR ('(' (VAR)* ')')? '{' classBody '}' ; classBody : (classAttributeDeclaration)* (functionDeclaration)*; classAttributeDeclaration : assignment | objectInstantiation ; -objectInstantiation : ( VAR | objectOrArrayAccess) '=' 'new' VAR '(' ')' ; +objectInstantiation : lvalue '=' 'new' VAR '(' ')' ; objectOrArrayAccess : baseAccess ('.' VAR | '[' expression ']')+ ; baseAccess : VAR ; +lvalue + : VAR + | objectOrArrayAccess + ; + // function call functionCall : methodCaller NAME '(' arguments ')' ; methodCaller : ((VAR | '[' expression ']') '.')* ; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index 88e69e6..b713ee1 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -120,6 +120,7 @@ classAttributeDeclaration objectInstantiation objectOrArrayAccess baseAccess +lvalue functionCall methodCaller functionCallWithReturnValues @@ -133,4 +134,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 375, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 81, 10, 3, 12, 3, 14, 3, 84, 11, 3, 3, 4, 6, 4, 87, 10, 4, 13, 4, 14, 4, 88, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 105, 10, 5, 3, 6, 3, 6, 5, 6, 109, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 153, 10, 15, 12, 15, 14, 15, 156, 11, 15, 5, 15, 158, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 164, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 184, 10, 21, 12, 21, 14, 21, 187, 11, 21, 5, 21, 189, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 202, 10, 22, 3, 22, 3, 22, 3, 22, 5, 22, 207, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 217, 10, 22, 12, 22, 14, 22, 220, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 226, 10, 23, 12, 23, 14, 23, 229, 11, 23, 3, 23, 5, 23, 232, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 239, 10, 24, 12, 24, 14, 24, 242, 11, 24, 3, 24, 7, 24, 245, 10, 24, 12, 24, 14, 24, 248, 11, 24, 3, 25, 3, 25, 5, 25, 252, 10, 25, 3, 26, 3, 26, 5, 26, 256, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 271, 10, 27, 13, 27, 14, 27, 272, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 288, 10, 30, 3, 30, 7, 30, 291, 10, 30, 12, 30, 14, 30, 294, 11, 30, 3, 31, 3, 31, 5, 31, 298, 10, 31, 3, 31, 3, 31, 3, 31, 5, 31, 303, 10, 31, 6, 31, 305, 10, 31, 13, 31, 14, 31, 306, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 7, 33, 324, 10, 33, 12, 33, 14, 33, 327, 11, 33, 5, 33, 329, 10, 33, 3, 34, 3, 34, 3, 34, 7, 34, 334, 10, 34, 12, 34, 14, 34, 337, 11, 34, 5, 34, 339, 10, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 353, 10, 35, 3, 35, 3, 35, 3, 35, 3, 35, 7, 35, 359, 10, 35, 12, 35, 14, 35, 362, 11, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 5, 38, 373, 10, 38, 3, 38, 2, 4, 42, 68, 39, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 3, 2, 33, 38, 3, 2, 39, 40, 2, 390, 2, 76, 3, 2, 2, 2, 4, 82, 3, 2, 2, 2, 6, 86, 3, 2, 2, 2, 8, 104, 3, 2, 2, 2, 10, 108, 3, 2, 2, 2, 12, 110, 3, 2, 2, 2, 14, 116, 3, 2, 2, 2, 16, 126, 3, 2, 2, 2, 18, 132, 3, 2, 2, 2, 20, 139, 3, 2, 2, 2, 22, 142, 3, 2, 2, 2, 24, 144, 3, 2, 2, 2, 26, 146, 3, 2, 2, 2, 28, 148, 3, 2, 2, 2, 30, 163, 3, 2, 2, 2, 32, 168, 3, 2, 2, 2, 34, 173, 3, 2, 2, 2, 36, 175, 3, 2, 2, 2, 38, 177, 3, 2, 2, 2, 40, 179, 3, 2, 2, 2, 42, 206, 3, 2, 2, 2, 44, 221, 3, 2, 2, 2, 46, 240, 3, 2, 2, 2, 48, 251, 3, 2, 2, 2, 50, 255, 3, 2, 2, 2, 52, 263, 3, 2, 2, 2, 54, 274, 3, 2, 2, 2, 56, 276, 3, 2, 2, 2, 58, 292, 3, 2, 2, 2, 60, 297, 3, 2, 2, 2, 62, 311, 3, 2, 2, 2, 64, 328, 3, 2, 2, 2, 66, 338, 3, 2, 2, 2, 68, 352, 3, 2, 2, 2, 70, 363, 3, 2, 2, 2, 72, 365, 3, 2, 2, 2, 74, 372, 3, 2, 2, 2, 76, 77, 5, 4, 3, 2, 77, 78, 7, 2, 2, 3, 78, 3, 3, 2, 2, 2, 79, 81, 5, 8, 5, 2, 80, 79, 3, 2, 2, 2, 81, 84, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 82, 83, 3, 2, 2, 2, 83, 5, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 85, 87, 5, 8, 5, 2, 86, 85, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 88, 89, 3, 2, 2, 2, 89, 7, 3, 2, 2, 2, 90, 105, 5, 60, 31, 2, 91, 105, 5, 30, 16, 2, 92, 105, 5, 32, 17, 2, 93, 105, 5, 10, 6, 2, 94, 105, 5, 16, 9, 2, 95, 105, 5, 20, 11, 2, 96, 105, 5, 24, 13, 2, 97, 105, 5, 18, 10, 2, 98, 105, 5, 26, 14, 2, 99, 105, 5, 44, 23, 2, 100, 105, 5, 50, 26, 2, 101, 105, 5, 62, 32, 2, 102, 105, 5, 56, 29, 2, 103, 105, 5, 40, 21, 2, 104, 90, 3, 2, 2, 2, 104, 91, 3, 2, 2, 2, 104, 92, 3, 2, 2, 2, 104, 93, 3, 2, 2, 2, 104, 94, 3, 2, 2, 2, 104, 95, 3, 2, 2, 2, 104, 96, 3, 2, 2, 2, 104, 97, 3, 2, 2, 2, 104, 98, 3, 2, 2, 2, 104, 99, 3, 2, 2, 2, 104, 100, 3, 2, 2, 2, 104, 101, 3, 2, 2, 2, 104, 102, 3, 2, 2, 2, 104, 103, 3, 2, 2, 2, 105, 9, 3, 2, 2, 2, 106, 109, 5, 12, 7, 2, 107, 109, 5, 14, 8, 2, 108, 106, 3, 2, 2, 2, 108, 107, 3, 2, 2, 2, 109, 11, 3, 2, 2, 2, 110, 111, 7, 3, 2, 2, 111, 112, 5, 68, 35, 2, 112, 113, 7, 4, 2, 2, 113, 114, 5, 6, 4, 2, 114, 115, 7, 5, 2, 2, 115, 13, 3, 2, 2, 2, 116, 117, 7, 3, 2, 2, 117, 118, 5, 68, 35, 2, 118, 119, 7, 4, 2, 2, 119, 120, 5, 6, 4, 2, 120, 121, 7, 5, 2, 2, 121, 122, 7, 6, 2, 2, 122, 123, 7, 4, 2, 2, 123, 124, 5, 6, 4, 2, 124, 125, 7, 5, 2, 2, 125, 15, 3, 2, 2, 2, 126, 127, 7, 7, 2, 2, 127, 128, 5, 74, 38, 2, 128, 129, 7, 4, 2, 2, 129, 130, 5, 6, 4, 2, 130, 131, 7, 5, 2, 2, 131, 17, 3, 2, 2, 2, 132, 133, 7, 8, 2, 2, 133, 134, 7, 9, 2, 2, 134, 135, 5, 42, 22, 2, 135, 136, 7, 10, 2, 2, 136, 137, 5, 42, 22, 2, 137, 138, 7, 11, 2, 2, 138, 19, 3, 2, 2, 2, 139, 140, 5, 22, 12, 2, 140, 141, 5, 42, 22, 2, 141, 21, 3, 2, 2, 2, 142, 143, 9, 2, 2, 2, 143, 23, 3, 2, 2, 2, 144, 145, 9, 3, 2, 2, 145, 25, 3, 2, 2, 2, 146, 147, 7, 18, 2, 2, 147, 27, 3, 2, 2, 2, 148, 157, 7, 4, 2, 2, 149, 154, 5, 42, 22, 2, 150, 151, 7, 10, 2, 2, 151, 153, 5, 42, 22, 2, 152, 150, 3, 2, 2, 2, 153, 156, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 154, 155, 3, 2, 2, 2, 155, 158, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 157, 149, 3, 2, 2, 2, 157, 158, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 160, 7, 5, 2, 2, 160, 29, 3, 2, 2, 2, 161, 164, 7, 44, 2, 2, 162, 164, 5, 52, 27, 2, 163, 161, 3, 2, 2, 2, 163, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 166, 7, 19, 2, 2, 166, 167, 5, 42, 22, 2, 167, 31, 3, 2, 2, 2, 168, 169, 7, 20, 2, 2, 169, 170, 7, 9, 2, 2, 170, 171, 5, 42, 22, 2, 171, 172, 7, 11, 2, 2, 172, 33, 3, 2, 2, 2, 173, 174, 9, 4, 2, 2, 174, 35, 3, 2, 2, 2, 175, 176, 9, 5, 2, 2, 176, 37, 3, 2, 2, 2, 177, 178, 7, 29, 2, 2, 178, 39, 3, 2, 2, 2, 179, 188, 7, 21, 2, 2, 180, 185, 5, 42, 22, 2, 181, 182, 7, 10, 2, 2, 182, 184, 5, 42, 22, 2, 183, 181, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 185, 186, 3, 2, 2, 2, 186, 189, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 188, 180, 3, 2, 2, 2, 188, 189, 3, 2, 2, 2, 189, 41, 3, 2, 2, 2, 190, 191, 8, 22, 1, 2, 191, 192, 5, 38, 20, 2, 192, 193, 5, 42, 22, 9, 193, 207, 3, 2, 2, 2, 194, 195, 7, 9, 2, 2, 195, 196, 5, 42, 22, 2, 196, 197, 7, 11, 2, 2, 197, 207, 3, 2, 2, 2, 198, 207, 5, 74, 38, 2, 199, 202, 7, 44, 2, 2, 200, 202, 5, 52, 27, 2, 201, 199, 3, 2, 2, 2, 201, 200, 3, 2, 2, 2, 202, 203, 3, 2, 2, 2, 203, 204, 7, 19, 2, 2, 204, 207, 5, 42, 22, 4, 205, 207, 5, 56, 29, 2, 206, 190, 3, 2, 2, 2, 206, 194, 3, 2, 2, 2, 206, 198, 3, 2, 2, 2, 206, 201, 3, 2, 2, 2, 206, 205, 3, 2, 2, 2, 207, 218, 3, 2, 2, 2, 208, 209, 12, 8, 2, 2, 209, 210, 5, 34, 18, 2, 210, 211, 5, 42, 22, 9, 211, 217, 3, 2, 2, 2, 212, 213, 12, 7, 2, 2, 213, 214, 5, 36, 19, 2, 214, 215, 5, 42, 22, 8, 215, 217, 3, 2, 2, 2, 216, 208, 3, 2, 2, 2, 216, 212, 3, 2, 2, 2, 217, 220, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 43, 3, 2, 2, 2, 220, 218, 3, 2, 2, 2, 221, 222, 7, 22, 2, 2, 222, 231, 7, 44, 2, 2, 223, 227, 7, 9, 2, 2, 224, 226, 7, 44, 2, 2, 225, 224, 3, 2, 2, 2, 226, 229, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 230, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 230, 232, 7, 11, 2, 2, 231, 223, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 233, 3, 2, 2, 2, 233, 234, 7, 23, 2, 2, 234, 235, 5, 46, 24, 2, 235, 236, 7, 24, 2, 2, 236, 45, 3, 2, 2, 2, 237, 239, 5, 48, 25, 2, 238, 237, 3, 2, 2, 2, 239, 242, 3, 2, 2, 2, 240, 238, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 246, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 243, 245, 5, 62, 32, 2, 244, 243, 3, 2, 2, 2, 245, 248, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 246, 247, 3, 2, 2, 2, 247, 47, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 249, 252, 5, 30, 16, 2, 250, 252, 5, 50, 26, 2, 251, 249, 3, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 49, 3, 2, 2, 2, 253, 256, 7, 44, 2, 2, 254, 256, 5, 52, 27, 2, 255, 253, 3, 2, 2, 2, 255, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 258, 7, 19, 2, 2, 258, 259, 7, 25, 2, 2, 259, 260, 7, 44, 2, 2, 260, 261, 7, 9, 2, 2, 261, 262, 7, 11, 2, 2, 262, 51, 3, 2, 2, 2, 263, 270, 5, 54, 28, 2, 264, 265, 7, 26, 2, 2, 265, 271, 7, 44, 2, 2, 266, 267, 7, 4, 2, 2, 267, 268, 5, 42, 22, 2, 268, 269, 7, 5, 2, 2, 269, 271, 3, 2, 2, 2, 270, 264, 3, 2, 2, 2, 270, 266, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 53, 3, 2, 2, 2, 274, 275, 7, 44, 2, 2, 275, 55, 3, 2, 2, 2, 276, 277, 5, 58, 30, 2, 277, 278, 7, 45, 2, 2, 278, 279, 7, 9, 2, 2, 279, 280, 5, 66, 34, 2, 280, 281, 7, 11, 2, 2, 281, 57, 3, 2, 2, 2, 282, 288, 7, 44, 2, 2, 283, 284, 7, 4, 2, 2, 284, 285, 5, 42, 22, 2, 285, 286, 7, 5, 2, 2, 286, 288, 3, 2, 2, 2, 287, 282, 3, 2, 2, 2, 287, 283, 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 289, 291, 7, 26, 2, 2, 290, 287, 3, 2, 2, 2, 291, 294, 3, 2, 2, 2, 292, 290, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 59, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 295, 298, 7, 44, 2, 2, 296, 298, 5, 52, 27, 2, 297, 295, 3, 2, 2, 2, 297, 296, 3, 2, 2, 2, 298, 304, 3, 2, 2, 2, 299, 302, 7, 10, 2, 2, 300, 303, 7, 44, 2, 2, 301, 303, 5, 52, 27, 2, 302, 300, 3, 2, 2, 2, 302, 301, 3, 2, 2, 2, 303, 305, 3, 2, 2, 2, 304, 299, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308, 309, 7, 19, 2, 2, 309, 310, 5, 56, 29, 2, 310, 61, 3, 2, 2, 2, 311, 312, 7, 27, 2, 2, 312, 313, 7, 45, 2, 2, 313, 314, 7, 9, 2, 2, 314, 315, 5, 64, 33, 2, 315, 316, 7, 11, 2, 2, 316, 317, 7, 23, 2, 2, 317, 318, 5, 6, 4, 2, 318, 319, 7, 24, 2, 2, 319, 63, 3, 2, 2, 2, 320, 325, 7, 44, 2, 2, 321, 322, 7, 10, 2, 2, 322, 324, 7, 44, 2, 2, 323, 321, 3, 2, 2, 2, 324, 327, 3, 2, 2, 2, 325, 323, 3, 2, 2, 2, 325, 326, 3, 2, 2, 2, 326, 329, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 328, 320, 3, 2, 2, 2, 328, 329, 3, 2, 2, 2, 329, 65, 3, 2, 2, 2, 330, 335, 5, 42, 22, 2, 331, 332, 7, 10, 2, 2, 332, 334, 5, 42, 22, 2, 333, 331, 3, 2, 2, 2, 334, 337, 3, 2, 2, 2, 335, 333, 3, 2, 2, 2, 335, 336, 3, 2, 2, 2, 336, 339, 3, 2, 2, 2, 337, 335, 3, 2, 2, 2, 338, 330, 3, 2, 2, 2, 338, 339, 3, 2, 2, 2, 339, 67, 3, 2, 2, 2, 340, 341, 8, 35, 1, 2, 341, 342, 7, 41, 2, 2, 342, 353, 5, 68, 35, 7, 343, 344, 5, 42, 22, 2, 344, 345, 5, 70, 36, 2, 345, 346, 5, 42, 22, 2, 346, 353, 3, 2, 2, 2, 347, 353, 7, 32, 2, 2, 348, 349, 7, 9, 2, 2, 349, 350, 5, 68, 35, 2, 350, 351, 7, 11, 2, 2, 351, 353, 3, 2, 2, 2, 352, 340, 3, 2, 2, 2, 352, 343, 3, 2, 2, 2, 352, 347, 3, 2, 2, 2, 352, 348, 3, 2, 2, 2, 353, 360, 3, 2, 2, 2, 354, 355, 12, 5, 2, 2, 355, 356, 5, 72, 37, 2, 356, 357, 5, 68, 35, 6, 357, 359, 3, 2, 2, 2, 358, 354, 3, 2, 2, 2, 359, 362, 3, 2, 2, 2, 360, 358, 3, 2, 2, 2, 360, 361, 3, 2, 2, 2, 361, 69, 3, 2, 2, 2, 362, 360, 3, 2, 2, 2, 363, 364, 9, 6, 2, 2, 364, 71, 3, 2, 2, 2, 365, 366, 9, 7, 2, 2, 366, 73, 3, 2, 2, 2, 367, 373, 7, 42, 2, 2, 368, 373, 7, 44, 2, 2, 369, 373, 5, 28, 15, 2, 370, 373, 5, 52, 27, 2, 371, 373, 7, 43, 2, 2, 372, 367, 3, 2, 2, 2, 372, 368, 3, 2, 2, 2, 372, 369, 3, 2, 2, 2, 372, 370, 3, 2, 2, 2, 372, 371, 3, 2, 2, 2, 373, 75, 3, 2, 2, 2, 35, 82, 88, 104, 108, 154, 157, 163, 185, 188, 201, 206, 216, 218, 227, 231, 240, 246, 251, 255, 270, 272, 287, 292, 297, 302, 306, 325, 328, 335, 338, 352, 360, 372] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 376, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 83, 10, 3, 12, 3, 14, 3, 86, 11, 3, 3, 4, 6, 4, 89, 10, 4, 13, 4, 14, 4, 90, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 107, 10, 5, 3, 6, 3, 6, 5, 6, 111, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 155, 10, 15, 12, 15, 14, 15, 158, 11, 15, 5, 15, 160, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 166, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 186, 10, 21, 12, 21, 14, 21, 189, 11, 21, 5, 21, 191, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 207, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 217, 10, 22, 12, 22, 14, 22, 220, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 226, 10, 23, 12, 23, 14, 23, 229, 11, 23, 3, 23, 5, 23, 232, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 239, 10, 24, 12, 24, 14, 24, 242, 11, 24, 3, 24, 7, 24, 245, 10, 24, 12, 24, 14, 24, 248, 11, 24, 3, 25, 3, 25, 5, 25, 252, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 268, 10, 27, 13, 27, 14, 27, 269, 3, 28, 3, 28, 3, 29, 3, 29, 5, 29, 276, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 289, 10, 31, 3, 31, 7, 31, 292, 10, 31, 12, 31, 14, 31, 295, 11, 31, 3, 32, 3, 32, 5, 32, 299, 10, 32, 3, 32, 3, 32, 3, 32, 5, 32, 304, 10, 32, 6, 32, 306, 10, 32, 13, 32, 14, 32, 307, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 7, 34, 325, 10, 34, 12, 34, 14, 34, 328, 11, 34, 5, 34, 330, 10, 34, 3, 35, 3, 35, 3, 35, 7, 35, 335, 10, 35, 12, 35, 14, 35, 338, 11, 35, 5, 35, 340, 10, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 354, 10, 36, 3, 36, 3, 36, 3, 36, 3, 36, 7, 36, 360, 10, 36, 12, 36, 14, 36, 363, 11, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 5, 39, 374, 10, 39, 3, 39, 2, 4, 42, 70, 40, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 3, 2, 33, 38, 3, 2, 39, 40, 2, 389, 2, 78, 3, 2, 2, 2, 4, 84, 3, 2, 2, 2, 6, 88, 3, 2, 2, 2, 8, 106, 3, 2, 2, 2, 10, 110, 3, 2, 2, 2, 12, 112, 3, 2, 2, 2, 14, 118, 3, 2, 2, 2, 16, 128, 3, 2, 2, 2, 18, 134, 3, 2, 2, 2, 20, 141, 3, 2, 2, 2, 22, 144, 3, 2, 2, 2, 24, 146, 3, 2, 2, 2, 26, 148, 3, 2, 2, 2, 28, 150, 3, 2, 2, 2, 30, 165, 3, 2, 2, 2, 32, 170, 3, 2, 2, 2, 34, 175, 3, 2, 2, 2, 36, 177, 3, 2, 2, 2, 38, 179, 3, 2, 2, 2, 40, 181, 3, 2, 2, 2, 42, 206, 3, 2, 2, 2, 44, 221, 3, 2, 2, 2, 46, 240, 3, 2, 2, 2, 48, 251, 3, 2, 2, 2, 50, 253, 3, 2, 2, 2, 52, 260, 3, 2, 2, 2, 54, 271, 3, 2, 2, 2, 56, 275, 3, 2, 2, 2, 58, 277, 3, 2, 2, 2, 60, 293, 3, 2, 2, 2, 62, 298, 3, 2, 2, 2, 64, 312, 3, 2, 2, 2, 66, 329, 3, 2, 2, 2, 68, 339, 3, 2, 2, 2, 70, 353, 3, 2, 2, 2, 72, 364, 3, 2, 2, 2, 74, 366, 3, 2, 2, 2, 76, 373, 3, 2, 2, 2, 78, 79, 5, 4, 3, 2, 79, 80, 7, 2, 2, 3, 80, 3, 3, 2, 2, 2, 81, 83, 5, 8, 5, 2, 82, 81, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 5, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 87, 89, 5, 8, 5, 2, 88, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 7, 3, 2, 2, 2, 92, 107, 5, 62, 32, 2, 93, 107, 5, 30, 16, 2, 94, 107, 5, 32, 17, 2, 95, 107, 5, 10, 6, 2, 96, 107, 5, 16, 9, 2, 97, 107, 5, 20, 11, 2, 98, 107, 5, 24, 13, 2, 99, 107, 5, 18, 10, 2, 100, 107, 5, 26, 14, 2, 101, 107, 5, 44, 23, 2, 102, 107, 5, 50, 26, 2, 103, 107, 5, 64, 33, 2, 104, 107, 5, 58, 30, 2, 105, 107, 5, 40, 21, 2, 106, 92, 3, 2, 2, 2, 106, 93, 3, 2, 2, 2, 106, 94, 3, 2, 2, 2, 106, 95, 3, 2, 2, 2, 106, 96, 3, 2, 2, 2, 106, 97, 3, 2, 2, 2, 106, 98, 3, 2, 2, 2, 106, 99, 3, 2, 2, 2, 106, 100, 3, 2, 2, 2, 106, 101, 3, 2, 2, 2, 106, 102, 3, 2, 2, 2, 106, 103, 3, 2, 2, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 9, 3, 2, 2, 2, 108, 111, 5, 12, 7, 2, 109, 111, 5, 14, 8, 2, 110, 108, 3, 2, 2, 2, 110, 109, 3, 2, 2, 2, 111, 11, 3, 2, 2, 2, 112, 113, 7, 3, 2, 2, 113, 114, 5, 70, 36, 2, 114, 115, 7, 4, 2, 2, 115, 116, 5, 6, 4, 2, 116, 117, 7, 5, 2, 2, 117, 13, 3, 2, 2, 2, 118, 119, 7, 3, 2, 2, 119, 120, 5, 70, 36, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 124, 7, 6, 2, 2, 124, 125, 7, 4, 2, 2, 125, 126, 5, 6, 4, 2, 126, 127, 7, 5, 2, 2, 127, 15, 3, 2, 2, 2, 128, 129, 7, 7, 2, 2, 129, 130, 5, 76, 39, 2, 130, 131, 7, 4, 2, 2, 131, 132, 5, 6, 4, 2, 132, 133, 7, 5, 2, 2, 133, 17, 3, 2, 2, 2, 134, 135, 7, 8, 2, 2, 135, 136, 7, 9, 2, 2, 136, 137, 5, 42, 22, 2, 137, 138, 7, 10, 2, 2, 138, 139, 5, 42, 22, 2, 139, 140, 7, 11, 2, 2, 140, 19, 3, 2, 2, 2, 141, 142, 5, 22, 12, 2, 142, 143, 5, 42, 22, 2, 143, 21, 3, 2, 2, 2, 144, 145, 9, 2, 2, 2, 145, 23, 3, 2, 2, 2, 146, 147, 9, 3, 2, 2, 147, 25, 3, 2, 2, 2, 148, 149, 7, 18, 2, 2, 149, 27, 3, 2, 2, 2, 150, 159, 7, 4, 2, 2, 151, 156, 5, 42, 22, 2, 152, 153, 7, 10, 2, 2, 153, 155, 5, 42, 22, 2, 154, 152, 3, 2, 2, 2, 155, 158, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 159, 151, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 162, 7, 5, 2, 2, 162, 29, 3, 2, 2, 2, 163, 166, 7, 44, 2, 2, 164, 166, 5, 52, 27, 2, 165, 163, 3, 2, 2, 2, 165, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 7, 19, 2, 2, 168, 169, 5, 42, 22, 2, 169, 31, 3, 2, 2, 2, 170, 171, 7, 20, 2, 2, 171, 172, 7, 9, 2, 2, 172, 173, 5, 42, 22, 2, 173, 174, 7, 11, 2, 2, 174, 33, 3, 2, 2, 2, 175, 176, 9, 4, 2, 2, 176, 35, 3, 2, 2, 2, 177, 178, 9, 5, 2, 2, 178, 37, 3, 2, 2, 2, 179, 180, 7, 29, 2, 2, 180, 39, 3, 2, 2, 2, 181, 190, 7, 21, 2, 2, 182, 187, 5, 42, 22, 2, 183, 184, 7, 10, 2, 2, 184, 186, 5, 42, 22, 2, 185, 183, 3, 2, 2, 2, 186, 189, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188, 191, 3, 2, 2, 2, 189, 187, 3, 2, 2, 2, 190, 182, 3, 2, 2, 2, 190, 191, 3, 2, 2, 2, 191, 41, 3, 2, 2, 2, 192, 193, 8, 22, 1, 2, 193, 194, 5, 38, 20, 2, 194, 195, 5, 42, 22, 9, 195, 207, 3, 2, 2, 2, 196, 197, 5, 56, 29, 2, 197, 198, 7, 19, 2, 2, 198, 199, 5, 42, 22, 6, 199, 207, 3, 2, 2, 2, 200, 207, 5, 58, 30, 2, 201, 202, 7, 9, 2, 2, 202, 203, 5, 42, 22, 2, 203, 204, 7, 11, 2, 2, 204, 207, 3, 2, 2, 2, 205, 207, 5, 76, 39, 2, 206, 192, 3, 2, 2, 2, 206, 196, 3, 2, 2, 2, 206, 200, 3, 2, 2, 2, 206, 201, 3, 2, 2, 2, 206, 205, 3, 2, 2, 2, 207, 218, 3, 2, 2, 2, 208, 209, 12, 8, 2, 2, 209, 210, 5, 34, 18, 2, 210, 211, 5, 42, 22, 9, 211, 217, 3, 2, 2, 2, 212, 213, 12, 7, 2, 2, 213, 214, 5, 36, 19, 2, 214, 215, 5, 42, 22, 8, 215, 217, 3, 2, 2, 2, 216, 208, 3, 2, 2, 2, 216, 212, 3, 2, 2, 2, 217, 220, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 43, 3, 2, 2, 2, 220, 218, 3, 2, 2, 2, 221, 222, 7, 22, 2, 2, 222, 231, 7, 44, 2, 2, 223, 227, 7, 9, 2, 2, 224, 226, 7, 44, 2, 2, 225, 224, 3, 2, 2, 2, 226, 229, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 230, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 230, 232, 7, 11, 2, 2, 231, 223, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 233, 3, 2, 2, 2, 233, 234, 7, 23, 2, 2, 234, 235, 5, 46, 24, 2, 235, 236, 7, 24, 2, 2, 236, 45, 3, 2, 2, 2, 237, 239, 5, 48, 25, 2, 238, 237, 3, 2, 2, 2, 239, 242, 3, 2, 2, 2, 240, 238, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 246, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 243, 245, 5, 64, 33, 2, 244, 243, 3, 2, 2, 2, 245, 248, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 246, 247, 3, 2, 2, 2, 247, 47, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 249, 252, 5, 30, 16, 2, 250, 252, 5, 50, 26, 2, 251, 249, 3, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 49, 3, 2, 2, 2, 253, 254, 5, 56, 29, 2, 254, 255, 7, 19, 2, 2, 255, 256, 7, 25, 2, 2, 256, 257, 7, 44, 2, 2, 257, 258, 7, 9, 2, 2, 258, 259, 7, 11, 2, 2, 259, 51, 3, 2, 2, 2, 260, 267, 5, 54, 28, 2, 261, 262, 7, 26, 2, 2, 262, 268, 7, 44, 2, 2, 263, 264, 7, 4, 2, 2, 264, 265, 5, 42, 22, 2, 265, 266, 7, 5, 2, 2, 266, 268, 3, 2, 2, 2, 267, 261, 3, 2, 2, 2, 267, 263, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 267, 3, 2, 2, 2, 269, 270, 3, 2, 2, 2, 270, 53, 3, 2, 2, 2, 271, 272, 7, 44, 2, 2, 272, 55, 3, 2, 2, 2, 273, 276, 7, 44, 2, 2, 274, 276, 5, 52, 27, 2, 275, 273, 3, 2, 2, 2, 275, 274, 3, 2, 2, 2, 276, 57, 3, 2, 2, 2, 277, 278, 5, 60, 31, 2, 278, 279, 7, 45, 2, 2, 279, 280, 7, 9, 2, 2, 280, 281, 5, 68, 35, 2, 281, 282, 7, 11, 2, 2, 282, 59, 3, 2, 2, 2, 283, 289, 7, 44, 2, 2, 284, 285, 7, 4, 2, 2, 285, 286, 5, 42, 22, 2, 286, 287, 7, 5, 2, 2, 287, 289, 3, 2, 2, 2, 288, 283, 3, 2, 2, 2, 288, 284, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 292, 7, 26, 2, 2, 291, 288, 3, 2, 2, 2, 292, 295, 3, 2, 2, 2, 293, 291, 3, 2, 2, 2, 293, 294, 3, 2, 2, 2, 294, 61, 3, 2, 2, 2, 295, 293, 3, 2, 2, 2, 296, 299, 7, 44, 2, 2, 297, 299, 5, 52, 27, 2, 298, 296, 3, 2, 2, 2, 298, 297, 3, 2, 2, 2, 299, 305, 3, 2, 2, 2, 300, 303, 7, 10, 2, 2, 301, 304, 7, 44, 2, 2, 302, 304, 5, 52, 27, 2, 303, 301, 3, 2, 2, 2, 303, 302, 3, 2, 2, 2, 304, 306, 3, 2, 2, 2, 305, 300, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 305, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308, 309, 3, 2, 2, 2, 309, 310, 7, 19, 2, 2, 310, 311, 5, 58, 30, 2, 311, 63, 3, 2, 2, 2, 312, 313, 7, 27, 2, 2, 313, 314, 7, 45, 2, 2, 314, 315, 7, 9, 2, 2, 315, 316, 5, 66, 34, 2, 316, 317, 7, 11, 2, 2, 317, 318, 7, 23, 2, 2, 318, 319, 5, 6, 4, 2, 319, 320, 7, 24, 2, 2, 320, 65, 3, 2, 2, 2, 321, 326, 7, 44, 2, 2, 322, 323, 7, 10, 2, 2, 323, 325, 7, 44, 2, 2, 324, 322, 3, 2, 2, 2, 325, 328, 3, 2, 2, 2, 326, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 330, 3, 2, 2, 2, 328, 326, 3, 2, 2, 2, 329, 321, 3, 2, 2, 2, 329, 330, 3, 2, 2, 2, 330, 67, 3, 2, 2, 2, 331, 336, 5, 42, 22, 2, 332, 333, 7, 10, 2, 2, 333, 335, 5, 42, 22, 2, 334, 332, 3, 2, 2, 2, 335, 338, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 336, 337, 3, 2, 2, 2, 337, 340, 3, 2, 2, 2, 338, 336, 3, 2, 2, 2, 339, 331, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 69, 3, 2, 2, 2, 341, 342, 8, 36, 1, 2, 342, 343, 7, 41, 2, 2, 343, 354, 5, 70, 36, 7, 344, 345, 5, 42, 22, 2, 345, 346, 5, 72, 37, 2, 346, 347, 5, 42, 22, 2, 347, 354, 3, 2, 2, 2, 348, 354, 7, 32, 2, 2, 349, 350, 7, 9, 2, 2, 350, 351, 5, 70, 36, 2, 351, 352, 7, 11, 2, 2, 352, 354, 3, 2, 2, 2, 353, 341, 3, 2, 2, 2, 353, 344, 3, 2, 2, 2, 353, 348, 3, 2, 2, 2, 353, 349, 3, 2, 2, 2, 354, 361, 3, 2, 2, 2, 355, 356, 12, 5, 2, 2, 356, 357, 5, 74, 38, 2, 357, 358, 5, 70, 36, 6, 358, 360, 3, 2, 2, 2, 359, 355, 3, 2, 2, 2, 360, 363, 3, 2, 2, 2, 361, 359, 3, 2, 2, 2, 361, 362, 3, 2, 2, 2, 362, 71, 3, 2, 2, 2, 363, 361, 3, 2, 2, 2, 364, 365, 9, 6, 2, 2, 365, 73, 3, 2, 2, 2, 366, 367, 9, 7, 2, 2, 367, 75, 3, 2, 2, 2, 368, 374, 7, 42, 2, 2, 369, 374, 7, 44, 2, 2, 370, 374, 5, 28, 15, 2, 371, 374, 5, 52, 27, 2, 372, 374, 7, 43, 2, 2, 373, 368, 3, 2, 2, 2, 373, 369, 3, 2, 2, 2, 373, 370, 3, 2, 2, 2, 373, 371, 3, 2, 2, 2, 373, 372, 3, 2, 2, 2, 374, 77, 3, 2, 2, 2, 34, 84, 90, 106, 110, 156, 159, 165, 187, 190, 206, 216, 218, 227, 231, 240, 246, 251, 267, 269, 275, 288, 293, 298, 303, 307, 326, 329, 336, 339, 353, 361, 373] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index 6c3cf05..adb33c7 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -9,172 +9,172 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3.") - buf.write("\u0177\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\u0178\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36") buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t") - buf.write("&\3\2\3\2\3\2\3\3\7\3Q\n\3\f\3\16\3T\13\3\3\4\6\4W\n\4") - buf.write("\r\4\16\4X\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5") - buf.write("\3\5\3\5\3\5\5\5i\n\5\3\6\3\6\5\6m\n\6\3\7\3\7\3\7\3\7") - buf.write("\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3") - buf.write("\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3") - buf.write("\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17\3\17\3\17") - buf.write("\7\17\u0099\n\17\f\17\16\17\u009c\13\17\5\17\u009e\n\17") - buf.write("\3\17\3\17\3\20\3\20\5\20\u00a4\n\20\3\20\3\20\3\20\3") - buf.write("\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24") - buf.write("\3\25\3\25\3\25\3\25\7\25\u00b8\n\25\f\25\16\25\u00bb") - buf.write("\13\25\5\25\u00bd\n\25\3\26\3\26\3\26\3\26\3\26\3\26\3") - buf.write("\26\3\26\3\26\3\26\3\26\5\26\u00ca\n\26\3\26\3\26\3\26") - buf.write("\5\26\u00cf\n\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3") - buf.write("\26\7\26\u00d9\n\26\f\26\16\26\u00dc\13\26\3\27\3\27\3") - buf.write("\27\3\27\7\27\u00e2\n\27\f\27\16\27\u00e5\13\27\3\27\5") - buf.write("\27\u00e8\n\27\3\27\3\27\3\27\3\27\3\30\7\30\u00ef\n\30") - buf.write("\f\30\16\30\u00f2\13\30\3\30\7\30\u00f5\n\30\f\30\16\30") - buf.write("\u00f8\13\30\3\31\3\31\5\31\u00fc\n\31\3\32\3\32\5\32") - buf.write("\u0100\n\32\3\32\3\32\3\32\3\32\3\32\3\32\3\33\3\33\3") - buf.write("\33\3\33\3\33\3\33\3\33\6\33\u010f\n\33\r\33\16\33\u0110") - buf.write("\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\36\3\36\3\36") - buf.write("\3\36\3\36\5\36\u0120\n\36\3\36\7\36\u0123\n\36\f\36\16") - buf.write("\36\u0126\13\36\3\37\3\37\5\37\u012a\n\37\3\37\3\37\3") - buf.write("\37\5\37\u012f\n\37\6\37\u0131\n\37\r\37\16\37\u0132\3") - buf.write("\37\3\37\3\37\3 \3 \3 \3 \3 \3 \3 \3 \3 \3!\3!\3!\7!\u0144") - buf.write("\n!\f!\16!\u0147\13!\5!\u0149\n!\3\"\3\"\3\"\7\"\u014e") - buf.write("\n\"\f\"\16\"\u0151\13\"\5\"\u0153\n\"\3#\3#\3#\3#\3#") - buf.write("\3#\3#\3#\3#\3#\3#\3#\5#\u0161\n#\3#\3#\3#\3#\7#\u0167") - buf.write("\n#\f#\16#\u016a\13#\3$\3$\3%\3%\3&\3&\3&\3&\3&\5&\u0175") - buf.write("\n&\3&\2\4*D\'\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36") - buf.write(" \"$&(*,.\60\62\64\668:<>@BDFHJ\2\b\3\2\f\17\3\2\20\21") - buf.write("\3\2\36\37\3\2\34\35\3\2!&\3\2\'(\2\u0186\2L\3\2\2\2\4") - buf.write("R\3\2\2\2\6V\3\2\2\2\bh\3\2\2\2\nl\3\2\2\2\fn\3\2\2\2") - buf.write("\16t\3\2\2\2\20~\3\2\2\2\22\u0084\3\2\2\2\24\u008b\3\2") - buf.write("\2\2\26\u008e\3\2\2\2\30\u0090\3\2\2\2\32\u0092\3\2\2") - buf.write("\2\34\u0094\3\2\2\2\36\u00a3\3\2\2\2 \u00a8\3\2\2\2\"") - buf.write("\u00ad\3\2\2\2$\u00af\3\2\2\2&\u00b1\3\2\2\2(\u00b3\3") - buf.write("\2\2\2*\u00ce\3\2\2\2,\u00dd\3\2\2\2.\u00f0\3\2\2\2\60") - buf.write("\u00fb\3\2\2\2\62\u00ff\3\2\2\2\64\u0107\3\2\2\2\66\u0112") - buf.write("\3\2\2\28\u0114\3\2\2\2:\u0124\3\2\2\2<\u0129\3\2\2\2") - buf.write(">\u0137\3\2\2\2@\u0148\3\2\2\2B\u0152\3\2\2\2D\u0160\3") - buf.write("\2\2\2F\u016b\3\2\2\2H\u016d\3\2\2\2J\u0174\3\2\2\2LM") - buf.write("\5\4\3\2MN\7\2\2\3N\3\3\2\2\2OQ\5\b\5\2PO\3\2\2\2QT\3") - buf.write("\2\2\2RP\3\2\2\2RS\3\2\2\2S\5\3\2\2\2TR\3\2\2\2UW\5\b") - buf.write("\5\2VU\3\2\2\2WX\3\2\2\2XV\3\2\2\2XY\3\2\2\2Y\7\3\2\2") - buf.write("\2Zi\5<\37\2[i\5\36\20\2\\i\5 \21\2]i\5\n\6\2^i\5\20\t") - buf.write("\2_i\5\24\13\2`i\5\30\r\2ai\5\22\n\2bi\5\32\16\2ci\5,") - buf.write("\27\2di\5\62\32\2ei\5> \2fi\58\35\2gi\5(\25\2hZ\3\2\2") - buf.write("\2h[\3\2\2\2h\\\3\2\2\2h]\3\2\2\2h^\3\2\2\2h_\3\2\2\2") - buf.write("h`\3\2\2\2ha\3\2\2\2hb\3\2\2\2hc\3\2\2\2hd\3\2\2\2he\3") - buf.write("\2\2\2hf\3\2\2\2hg\3\2\2\2i\t\3\2\2\2jm\5\f\7\2km\5\16") - buf.write("\b\2lj\3\2\2\2lk\3\2\2\2m\13\3\2\2\2no\7\3\2\2op\5D#\2") - buf.write("pq\7\4\2\2qr\5\6\4\2rs\7\5\2\2s\r\3\2\2\2tu\7\3\2\2uv") - buf.write("\5D#\2vw\7\4\2\2wx\5\6\4\2xy\7\5\2\2yz\7\6\2\2z{\7\4\2") - buf.write("\2{|\5\6\4\2|}\7\5\2\2}\17\3\2\2\2~\177\7\7\2\2\177\u0080") - buf.write("\5J&\2\u0080\u0081\7\4\2\2\u0081\u0082\5\6\4\2\u0082\u0083") - buf.write("\7\5\2\2\u0083\21\3\2\2\2\u0084\u0085\7\b\2\2\u0085\u0086") - buf.write("\7\t\2\2\u0086\u0087\5*\26\2\u0087\u0088\7\n\2\2\u0088") - buf.write("\u0089\5*\26\2\u0089\u008a\7\13\2\2\u008a\23\3\2\2\2\u008b") - buf.write("\u008c\5\26\f\2\u008c\u008d\5*\26\2\u008d\25\3\2\2\2\u008e") - buf.write("\u008f\t\2\2\2\u008f\27\3\2\2\2\u0090\u0091\t\3\2\2\u0091") - buf.write("\31\3\2\2\2\u0092\u0093\7\22\2\2\u0093\33\3\2\2\2\u0094") - buf.write("\u009d\7\4\2\2\u0095\u009a\5*\26\2\u0096\u0097\7\n\2\2") - buf.write("\u0097\u0099\5*\26\2\u0098\u0096\3\2\2\2\u0099\u009c\3") - buf.write("\2\2\2\u009a\u0098\3\2\2\2\u009a\u009b\3\2\2\2\u009b\u009e") - buf.write("\3\2\2\2\u009c\u009a\3\2\2\2\u009d\u0095\3\2\2\2\u009d") - buf.write("\u009e\3\2\2\2\u009e\u009f\3\2\2\2\u009f\u00a0\7\5\2\2") - buf.write("\u00a0\35\3\2\2\2\u00a1\u00a4\7,\2\2\u00a2\u00a4\5\64") - buf.write("\33\2\u00a3\u00a1\3\2\2\2\u00a3\u00a2\3\2\2\2\u00a4\u00a5") - buf.write("\3\2\2\2\u00a5\u00a6\7\23\2\2\u00a6\u00a7\5*\26\2\u00a7") - buf.write("\37\3\2\2\2\u00a8\u00a9\7\24\2\2\u00a9\u00aa\7\t\2\2\u00aa") - buf.write("\u00ab\5*\26\2\u00ab\u00ac\7\13\2\2\u00ac!\3\2\2\2\u00ad") - buf.write("\u00ae\t\4\2\2\u00ae#\3\2\2\2\u00af\u00b0\t\5\2\2\u00b0") - buf.write("%\3\2\2\2\u00b1\u00b2\7\35\2\2\u00b2\'\3\2\2\2\u00b3\u00bc") - buf.write("\7\25\2\2\u00b4\u00b9\5*\26\2\u00b5\u00b6\7\n\2\2\u00b6") - buf.write("\u00b8\5*\26\2\u00b7\u00b5\3\2\2\2\u00b8\u00bb\3\2\2\2") - buf.write("\u00b9\u00b7\3\2\2\2\u00b9\u00ba\3\2\2\2\u00ba\u00bd\3") - buf.write("\2\2\2\u00bb\u00b9\3\2\2\2\u00bc\u00b4\3\2\2\2\u00bc\u00bd") - buf.write("\3\2\2\2\u00bd)\3\2\2\2\u00be\u00bf\b\26\1\2\u00bf\u00c0") - buf.write("\5&\24\2\u00c0\u00c1\5*\26\t\u00c1\u00cf\3\2\2\2\u00c2") - buf.write("\u00c3\7\t\2\2\u00c3\u00c4\5*\26\2\u00c4\u00c5\7\13\2") - buf.write("\2\u00c5\u00cf\3\2\2\2\u00c6\u00cf\5J&\2\u00c7\u00ca\7") - buf.write(",\2\2\u00c8\u00ca\5\64\33\2\u00c9\u00c7\3\2\2\2\u00c9") - buf.write("\u00c8\3\2\2\2\u00ca\u00cb\3\2\2\2\u00cb\u00cc\7\23\2") - buf.write("\2\u00cc\u00cf\5*\26\4\u00cd\u00cf\58\35\2\u00ce\u00be") - buf.write("\3\2\2\2\u00ce\u00c2\3\2\2\2\u00ce\u00c6\3\2\2\2\u00ce") - buf.write("\u00c9\3\2\2\2\u00ce\u00cd\3\2\2\2\u00cf\u00da\3\2\2\2") - buf.write("\u00d0\u00d1\f\b\2\2\u00d1\u00d2\5\"\22\2\u00d2\u00d3") - buf.write("\5*\26\t\u00d3\u00d9\3\2\2\2\u00d4\u00d5\f\7\2\2\u00d5") - buf.write("\u00d6\5$\23\2\u00d6\u00d7\5*\26\b\u00d7\u00d9\3\2\2\2") - buf.write("\u00d8\u00d0\3\2\2\2\u00d8\u00d4\3\2\2\2\u00d9\u00dc\3") - buf.write("\2\2\2\u00da\u00d8\3\2\2\2\u00da\u00db\3\2\2\2\u00db+") - buf.write("\3\2\2\2\u00dc\u00da\3\2\2\2\u00dd\u00de\7\26\2\2\u00de") - buf.write("\u00e7\7,\2\2\u00df\u00e3\7\t\2\2\u00e0\u00e2\7,\2\2\u00e1") - buf.write("\u00e0\3\2\2\2\u00e2\u00e5\3\2\2\2\u00e3\u00e1\3\2\2\2") - buf.write("\u00e3\u00e4\3\2\2\2\u00e4\u00e6\3\2\2\2\u00e5\u00e3\3") - buf.write("\2\2\2\u00e6\u00e8\7\13\2\2\u00e7\u00df\3\2\2\2\u00e7") - buf.write("\u00e8\3\2\2\2\u00e8\u00e9\3\2\2\2\u00e9\u00ea\7\27\2") - buf.write("\2\u00ea\u00eb\5.\30\2\u00eb\u00ec\7\30\2\2\u00ec-\3\2") - buf.write("\2\2\u00ed\u00ef\5\60\31\2\u00ee\u00ed\3\2\2\2\u00ef\u00f2") - buf.write("\3\2\2\2\u00f0\u00ee\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1") - buf.write("\u00f6\3\2\2\2\u00f2\u00f0\3\2\2\2\u00f3\u00f5\5> \2\u00f4") - buf.write("\u00f3\3\2\2\2\u00f5\u00f8\3\2\2\2\u00f6\u00f4\3\2\2\2") - buf.write("\u00f6\u00f7\3\2\2\2\u00f7/\3\2\2\2\u00f8\u00f6\3\2\2") - buf.write("\2\u00f9\u00fc\5\36\20\2\u00fa\u00fc\5\62\32\2\u00fb\u00f9") - buf.write("\3\2\2\2\u00fb\u00fa\3\2\2\2\u00fc\61\3\2\2\2\u00fd\u0100") - buf.write("\7,\2\2\u00fe\u0100\5\64\33\2\u00ff\u00fd\3\2\2\2\u00ff") - buf.write("\u00fe\3\2\2\2\u0100\u0101\3\2\2\2\u0101\u0102\7\23\2") - buf.write("\2\u0102\u0103\7\31\2\2\u0103\u0104\7,\2\2\u0104\u0105") - buf.write("\7\t\2\2\u0105\u0106\7\13\2\2\u0106\63\3\2\2\2\u0107\u010e") - buf.write("\5\66\34\2\u0108\u0109\7\32\2\2\u0109\u010f\7,\2\2\u010a") - buf.write("\u010b\7\4\2\2\u010b\u010c\5*\26\2\u010c\u010d\7\5\2\2") - buf.write("\u010d\u010f\3\2\2\2\u010e\u0108\3\2\2\2\u010e\u010a\3") - buf.write("\2\2\2\u010f\u0110\3\2\2\2\u0110\u010e\3\2\2\2\u0110\u0111") - buf.write("\3\2\2\2\u0111\65\3\2\2\2\u0112\u0113\7,\2\2\u0113\67") - buf.write("\3\2\2\2\u0114\u0115\5:\36\2\u0115\u0116\7-\2\2\u0116") - buf.write("\u0117\7\t\2\2\u0117\u0118\5B\"\2\u0118\u0119\7\13\2\2") - buf.write("\u01199\3\2\2\2\u011a\u0120\7,\2\2\u011b\u011c\7\4\2\2") - buf.write("\u011c\u011d\5*\26\2\u011d\u011e\7\5\2\2\u011e\u0120\3") - buf.write("\2\2\2\u011f\u011a\3\2\2\2\u011f\u011b\3\2\2\2\u0120\u0121") - buf.write("\3\2\2\2\u0121\u0123\7\32\2\2\u0122\u011f\3\2\2\2\u0123") - buf.write("\u0126\3\2\2\2\u0124\u0122\3\2\2\2\u0124\u0125\3\2\2\2") - buf.write("\u0125;\3\2\2\2\u0126\u0124\3\2\2\2\u0127\u012a\7,\2\2") - buf.write("\u0128\u012a\5\64\33\2\u0129\u0127\3\2\2\2\u0129\u0128") - buf.write("\3\2\2\2\u012a\u0130\3\2\2\2\u012b\u012e\7\n\2\2\u012c") - buf.write("\u012f\7,\2\2\u012d\u012f\5\64\33\2\u012e\u012c\3\2\2") - buf.write("\2\u012e\u012d\3\2\2\2\u012f\u0131\3\2\2\2\u0130\u012b") - buf.write("\3\2\2\2\u0131\u0132\3\2\2\2\u0132\u0130\3\2\2\2\u0132") - buf.write("\u0133\3\2\2\2\u0133\u0134\3\2\2\2\u0134\u0135\7\23\2") - buf.write("\2\u0135\u0136\58\35\2\u0136=\3\2\2\2\u0137\u0138\7\33") - buf.write("\2\2\u0138\u0139\7-\2\2\u0139\u013a\7\t\2\2\u013a\u013b") - buf.write("\5@!\2\u013b\u013c\7\13\2\2\u013c\u013d\7\27\2\2\u013d") - buf.write("\u013e\5\6\4\2\u013e\u013f\7\30\2\2\u013f?\3\2\2\2\u0140") - buf.write("\u0145\7,\2\2\u0141\u0142\7\n\2\2\u0142\u0144\7,\2\2\u0143") - buf.write("\u0141\3\2\2\2\u0144\u0147\3\2\2\2\u0145\u0143\3\2\2\2") - buf.write("\u0145\u0146\3\2\2\2\u0146\u0149\3\2\2\2\u0147\u0145\3") - buf.write("\2\2\2\u0148\u0140\3\2\2\2\u0148\u0149\3\2\2\2\u0149A") - buf.write("\3\2\2\2\u014a\u014f\5*\26\2\u014b\u014c\7\n\2\2\u014c") - buf.write("\u014e\5*\26\2\u014d\u014b\3\2\2\2\u014e\u0151\3\2\2\2") - buf.write("\u014f\u014d\3\2\2\2\u014f\u0150\3\2\2\2\u0150\u0153\3") - buf.write("\2\2\2\u0151\u014f\3\2\2\2\u0152\u014a\3\2\2\2\u0152\u0153") - buf.write("\3\2\2\2\u0153C\3\2\2\2\u0154\u0155\b#\1\2\u0155\u0156") - buf.write("\7)\2\2\u0156\u0161\5D#\7\u0157\u0158\5*\26\2\u0158\u0159") - buf.write("\5F$\2\u0159\u015a\5*\26\2\u015a\u0161\3\2\2\2\u015b\u0161") - buf.write("\7 \2\2\u015c\u015d\7\t\2\2\u015d\u015e\5D#\2\u015e\u015f") - buf.write("\7\13\2\2\u015f\u0161\3\2\2\2\u0160\u0154\3\2\2\2\u0160") - buf.write("\u0157\3\2\2\2\u0160\u015b\3\2\2\2\u0160\u015c\3\2\2\2") - buf.write("\u0161\u0168\3\2\2\2\u0162\u0163\f\5\2\2\u0163\u0164\5") - buf.write("H%\2\u0164\u0165\5D#\6\u0165\u0167\3\2\2\2\u0166\u0162") - buf.write("\3\2\2\2\u0167\u016a\3\2\2\2\u0168\u0166\3\2\2\2\u0168") - buf.write("\u0169\3\2\2\2\u0169E\3\2\2\2\u016a\u0168\3\2\2\2\u016b") - buf.write("\u016c\t\6\2\2\u016cG\3\2\2\2\u016d\u016e\t\7\2\2\u016e") - buf.write("I\3\2\2\2\u016f\u0175\7*\2\2\u0170\u0175\7,\2\2\u0171") - buf.write("\u0175\5\34\17\2\u0172\u0175\5\64\33\2\u0173\u0175\7+") - buf.write("\2\2\u0174\u016f\3\2\2\2\u0174\u0170\3\2\2\2\u0174\u0171") - buf.write("\3\2\2\2\u0174\u0172\3\2\2\2\u0174\u0173\3\2\2\2\u0175") - buf.write("K\3\2\2\2#RXhl\u009a\u009d\u00a3\u00b9\u00bc\u00c9\u00ce") - buf.write("\u00d8\u00da\u00e3\u00e7\u00f0\u00f6\u00fb\u00ff\u010e") - buf.write("\u0110\u011f\u0124\u0129\u012e\u0132\u0145\u0148\u014f") - buf.write("\u0152\u0160\u0168\u0174") + buf.write("&\4\'\t\'\3\2\3\2\3\2\3\3\7\3S\n\3\f\3\16\3V\13\3\3\4") + buf.write("\6\4Y\n\4\r\4\16\4Z\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3") + buf.write("\5\3\5\3\5\3\5\3\5\3\5\5\5k\n\5\3\6\3\6\5\6o\n\6\3\7\3") + buf.write("\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b") + buf.write("\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3") + buf.write("\n\3\13\3\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17") + buf.write("\3\17\3\17\7\17\u009b\n\17\f\17\16\17\u009e\13\17\5\17") + buf.write("\u00a0\n\17\3\17\3\17\3\20\3\20\5\20\u00a6\n\20\3\20\3") + buf.write("\20\3\20\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23") + buf.write("\3\24\3\24\3\25\3\25\3\25\3\25\7\25\u00ba\n\25\f\25\16") + buf.write("\25\u00bd\13\25\5\25\u00bf\n\25\3\26\3\26\3\26\3\26\3") + buf.write("\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\5\26") + buf.write("\u00cf\n\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\7") + buf.write("\26\u00d9\n\26\f\26\16\26\u00dc\13\26\3\27\3\27\3\27\3") + buf.write("\27\7\27\u00e2\n\27\f\27\16\27\u00e5\13\27\3\27\5\27\u00e8") + buf.write("\n\27\3\27\3\27\3\27\3\27\3\30\7\30\u00ef\n\30\f\30\16") + buf.write("\30\u00f2\13\30\3\30\7\30\u00f5\n\30\f\30\16\30\u00f8") + buf.write("\13\30\3\31\3\31\5\31\u00fc\n\31\3\32\3\32\3\32\3\32\3") + buf.write("\32\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\6\33") + buf.write("\u010c\n\33\r\33\16\33\u010d\3\34\3\34\3\35\3\35\5\35") + buf.write("\u0114\n\35\3\36\3\36\3\36\3\36\3\36\3\36\3\37\3\37\3") + buf.write("\37\3\37\3\37\5\37\u0121\n\37\3\37\7\37\u0124\n\37\f\37") + buf.write("\16\37\u0127\13\37\3 \3 \5 \u012b\n \3 \3 \3 \5 \u0130") + buf.write("\n \6 \u0132\n \r \16 \u0133\3 \3 \3 \3!\3!\3!\3!\3!\3") + buf.write("!\3!\3!\3!\3\"\3\"\3\"\7\"\u0145\n\"\f\"\16\"\u0148\13") + buf.write("\"\5\"\u014a\n\"\3#\3#\3#\7#\u014f\n#\f#\16#\u0152\13") + buf.write("#\5#\u0154\n#\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\5$\u0162") + buf.write("\n$\3$\3$\3$\3$\7$\u0168\n$\f$\16$\u016b\13$\3%\3%\3&") + buf.write("\3&\3\'\3\'\3\'\3\'\3\'\5\'\u0176\n\'\3\'\2\4*F(\2\4\6") + buf.write("\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\66") + buf.write("8:<>@BDFHJL\2\b\3\2\f\17\3\2\20\21\3\2\36\37\3\2\34\35") + buf.write("\3\2!&\3\2\'(\2\u0185\2N\3\2\2\2\4T\3\2\2\2\6X\3\2\2\2") + buf.write("\bj\3\2\2\2\nn\3\2\2\2\fp\3\2\2\2\16v\3\2\2\2\20\u0080") + buf.write("\3\2\2\2\22\u0086\3\2\2\2\24\u008d\3\2\2\2\26\u0090\3") + buf.write("\2\2\2\30\u0092\3\2\2\2\32\u0094\3\2\2\2\34\u0096\3\2") + buf.write("\2\2\36\u00a5\3\2\2\2 \u00aa\3\2\2\2\"\u00af\3\2\2\2$") + buf.write("\u00b1\3\2\2\2&\u00b3\3\2\2\2(\u00b5\3\2\2\2*\u00ce\3") + buf.write("\2\2\2,\u00dd\3\2\2\2.\u00f0\3\2\2\2\60\u00fb\3\2\2\2") + buf.write("\62\u00fd\3\2\2\2\64\u0104\3\2\2\2\66\u010f\3\2\2\28\u0113") + buf.write("\3\2\2\2:\u0115\3\2\2\2<\u0125\3\2\2\2>\u012a\3\2\2\2") + buf.write("@\u0138\3\2\2\2B\u0149\3\2\2\2D\u0153\3\2\2\2F\u0161\3") + buf.write("\2\2\2H\u016c\3\2\2\2J\u016e\3\2\2\2L\u0175\3\2\2\2NO") + buf.write("\5\4\3\2OP\7\2\2\3P\3\3\2\2\2QS\5\b\5\2RQ\3\2\2\2SV\3") + buf.write("\2\2\2TR\3\2\2\2TU\3\2\2\2U\5\3\2\2\2VT\3\2\2\2WY\5\b") + buf.write("\5\2XW\3\2\2\2YZ\3\2\2\2ZX\3\2\2\2Z[\3\2\2\2[\7\3\2\2") + buf.write("\2\\k\5> \2]k\5\36\20\2^k\5 \21\2_k\5\n\6\2`k\5\20\t\2") + buf.write("ak\5\24\13\2bk\5\30\r\2ck\5\22\n\2dk\5\32\16\2ek\5,\27") + buf.write("\2fk\5\62\32\2gk\5@!\2hk\5:\36\2ik\5(\25\2j\\\3\2\2\2") + buf.write("j]\3\2\2\2j^\3\2\2\2j_\3\2\2\2j`\3\2\2\2ja\3\2\2\2jb\3") + buf.write("\2\2\2jc\3\2\2\2jd\3\2\2\2je\3\2\2\2jf\3\2\2\2jg\3\2\2") + buf.write("\2jh\3\2\2\2ji\3\2\2\2k\t\3\2\2\2lo\5\f\7\2mo\5\16\b\2") + buf.write("nl\3\2\2\2nm\3\2\2\2o\13\3\2\2\2pq\7\3\2\2qr\5F$\2rs\7") + buf.write("\4\2\2st\5\6\4\2tu\7\5\2\2u\r\3\2\2\2vw\7\3\2\2wx\5F$") + buf.write("\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2{|\7\6\2\2|}\7\4\2\2}") + buf.write("~\5\6\4\2~\177\7\5\2\2\177\17\3\2\2\2\u0080\u0081\7\7") + buf.write("\2\2\u0081\u0082\5L\'\2\u0082\u0083\7\4\2\2\u0083\u0084") + buf.write("\5\6\4\2\u0084\u0085\7\5\2\2\u0085\21\3\2\2\2\u0086\u0087") + buf.write("\7\b\2\2\u0087\u0088\7\t\2\2\u0088\u0089\5*\26\2\u0089") + buf.write("\u008a\7\n\2\2\u008a\u008b\5*\26\2\u008b\u008c\7\13\2") + buf.write("\2\u008c\23\3\2\2\2\u008d\u008e\5\26\f\2\u008e\u008f\5") + buf.write("*\26\2\u008f\25\3\2\2\2\u0090\u0091\t\2\2\2\u0091\27\3") + buf.write("\2\2\2\u0092\u0093\t\3\2\2\u0093\31\3\2\2\2\u0094\u0095") + buf.write("\7\22\2\2\u0095\33\3\2\2\2\u0096\u009f\7\4\2\2\u0097\u009c") + buf.write("\5*\26\2\u0098\u0099\7\n\2\2\u0099\u009b\5*\26\2\u009a") + buf.write("\u0098\3\2\2\2\u009b\u009e\3\2\2\2\u009c\u009a\3\2\2\2") + buf.write("\u009c\u009d\3\2\2\2\u009d\u00a0\3\2\2\2\u009e\u009c\3") + buf.write("\2\2\2\u009f\u0097\3\2\2\2\u009f\u00a0\3\2\2\2\u00a0\u00a1") + buf.write("\3\2\2\2\u00a1\u00a2\7\5\2\2\u00a2\35\3\2\2\2\u00a3\u00a6") + buf.write("\7,\2\2\u00a4\u00a6\5\64\33\2\u00a5\u00a3\3\2\2\2\u00a5") + buf.write("\u00a4\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7\u00a8\7\23\2") + buf.write("\2\u00a8\u00a9\5*\26\2\u00a9\37\3\2\2\2\u00aa\u00ab\7") + buf.write("\24\2\2\u00ab\u00ac\7\t\2\2\u00ac\u00ad\5*\26\2\u00ad") + buf.write("\u00ae\7\13\2\2\u00ae!\3\2\2\2\u00af\u00b0\t\4\2\2\u00b0") + buf.write("#\3\2\2\2\u00b1\u00b2\t\5\2\2\u00b2%\3\2\2\2\u00b3\u00b4") + buf.write("\7\35\2\2\u00b4\'\3\2\2\2\u00b5\u00be\7\25\2\2\u00b6\u00bb") + buf.write("\5*\26\2\u00b7\u00b8\7\n\2\2\u00b8\u00ba\5*\26\2\u00b9") + buf.write("\u00b7\3\2\2\2\u00ba\u00bd\3\2\2\2\u00bb\u00b9\3\2\2\2") + buf.write("\u00bb\u00bc\3\2\2\2\u00bc\u00bf\3\2\2\2\u00bd\u00bb\3") + buf.write("\2\2\2\u00be\u00b6\3\2\2\2\u00be\u00bf\3\2\2\2\u00bf)") + buf.write("\3\2\2\2\u00c0\u00c1\b\26\1\2\u00c1\u00c2\5&\24\2\u00c2") + buf.write("\u00c3\5*\26\t\u00c3\u00cf\3\2\2\2\u00c4\u00c5\58\35\2") + buf.write("\u00c5\u00c6\7\23\2\2\u00c6\u00c7\5*\26\6\u00c7\u00cf") + buf.write("\3\2\2\2\u00c8\u00cf\5:\36\2\u00c9\u00ca\7\t\2\2\u00ca") + buf.write("\u00cb\5*\26\2\u00cb\u00cc\7\13\2\2\u00cc\u00cf\3\2\2") + buf.write("\2\u00cd\u00cf\5L\'\2\u00ce\u00c0\3\2\2\2\u00ce\u00c4") + buf.write("\3\2\2\2\u00ce\u00c8\3\2\2\2\u00ce\u00c9\3\2\2\2\u00ce") + buf.write("\u00cd\3\2\2\2\u00cf\u00da\3\2\2\2\u00d0\u00d1\f\b\2\2") + buf.write("\u00d1\u00d2\5\"\22\2\u00d2\u00d3\5*\26\t\u00d3\u00d9") + buf.write("\3\2\2\2\u00d4\u00d5\f\7\2\2\u00d5\u00d6\5$\23\2\u00d6") + buf.write("\u00d7\5*\26\b\u00d7\u00d9\3\2\2\2\u00d8\u00d0\3\2\2\2") + buf.write("\u00d8\u00d4\3\2\2\2\u00d9\u00dc\3\2\2\2\u00da\u00d8\3") + buf.write("\2\2\2\u00da\u00db\3\2\2\2\u00db+\3\2\2\2\u00dc\u00da") + buf.write("\3\2\2\2\u00dd\u00de\7\26\2\2\u00de\u00e7\7,\2\2\u00df") + buf.write("\u00e3\7\t\2\2\u00e0\u00e2\7,\2\2\u00e1\u00e0\3\2\2\2") + buf.write("\u00e2\u00e5\3\2\2\2\u00e3\u00e1\3\2\2\2\u00e3\u00e4\3") + buf.write("\2\2\2\u00e4\u00e6\3\2\2\2\u00e5\u00e3\3\2\2\2\u00e6\u00e8") + buf.write("\7\13\2\2\u00e7\u00df\3\2\2\2\u00e7\u00e8\3\2\2\2\u00e8") + buf.write("\u00e9\3\2\2\2\u00e9\u00ea\7\27\2\2\u00ea\u00eb\5.\30") + buf.write("\2\u00eb\u00ec\7\30\2\2\u00ec-\3\2\2\2\u00ed\u00ef\5\60") + buf.write("\31\2\u00ee\u00ed\3\2\2\2\u00ef\u00f2\3\2\2\2\u00f0\u00ee") + buf.write("\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f6\3\2\2\2\u00f2") + buf.write("\u00f0\3\2\2\2\u00f3\u00f5\5@!\2\u00f4\u00f3\3\2\2\2\u00f5") + buf.write("\u00f8\3\2\2\2\u00f6\u00f4\3\2\2\2\u00f6\u00f7\3\2\2\2") + buf.write("\u00f7/\3\2\2\2\u00f8\u00f6\3\2\2\2\u00f9\u00fc\5\36\20") + buf.write("\2\u00fa\u00fc\5\62\32\2\u00fb\u00f9\3\2\2\2\u00fb\u00fa") + buf.write("\3\2\2\2\u00fc\61\3\2\2\2\u00fd\u00fe\58\35\2\u00fe\u00ff") + buf.write("\7\23\2\2\u00ff\u0100\7\31\2\2\u0100\u0101\7,\2\2\u0101") + buf.write("\u0102\7\t\2\2\u0102\u0103\7\13\2\2\u0103\63\3\2\2\2\u0104") + buf.write("\u010b\5\66\34\2\u0105\u0106\7\32\2\2\u0106\u010c\7,\2") + buf.write("\2\u0107\u0108\7\4\2\2\u0108\u0109\5*\26\2\u0109\u010a") + buf.write("\7\5\2\2\u010a\u010c\3\2\2\2\u010b\u0105\3\2\2\2\u010b") + buf.write("\u0107\3\2\2\2\u010c\u010d\3\2\2\2\u010d\u010b\3\2\2\2") + buf.write("\u010d\u010e\3\2\2\2\u010e\65\3\2\2\2\u010f\u0110\7,\2") + buf.write("\2\u0110\67\3\2\2\2\u0111\u0114\7,\2\2\u0112\u0114\5\64") + buf.write("\33\2\u0113\u0111\3\2\2\2\u0113\u0112\3\2\2\2\u01149\3") + buf.write("\2\2\2\u0115\u0116\5<\37\2\u0116\u0117\7-\2\2\u0117\u0118") + buf.write("\7\t\2\2\u0118\u0119\5D#\2\u0119\u011a\7\13\2\2\u011a") + buf.write(";\3\2\2\2\u011b\u0121\7,\2\2\u011c\u011d\7\4\2\2\u011d") + buf.write("\u011e\5*\26\2\u011e\u011f\7\5\2\2\u011f\u0121\3\2\2\2") + buf.write("\u0120\u011b\3\2\2\2\u0120\u011c\3\2\2\2\u0121\u0122\3") + buf.write("\2\2\2\u0122\u0124\7\32\2\2\u0123\u0120\3\2\2\2\u0124") + buf.write("\u0127\3\2\2\2\u0125\u0123\3\2\2\2\u0125\u0126\3\2\2\2") + buf.write("\u0126=\3\2\2\2\u0127\u0125\3\2\2\2\u0128\u012b\7,\2\2") + buf.write("\u0129\u012b\5\64\33\2\u012a\u0128\3\2\2\2\u012a\u0129") + buf.write("\3\2\2\2\u012b\u0131\3\2\2\2\u012c\u012f\7\n\2\2\u012d") + buf.write("\u0130\7,\2\2\u012e\u0130\5\64\33\2\u012f\u012d\3\2\2") + buf.write("\2\u012f\u012e\3\2\2\2\u0130\u0132\3\2\2\2\u0131\u012c") + buf.write("\3\2\2\2\u0132\u0133\3\2\2\2\u0133\u0131\3\2\2\2\u0133") + buf.write("\u0134\3\2\2\2\u0134\u0135\3\2\2\2\u0135\u0136\7\23\2") + buf.write("\2\u0136\u0137\5:\36\2\u0137?\3\2\2\2\u0138\u0139\7\33") + buf.write("\2\2\u0139\u013a\7-\2\2\u013a\u013b\7\t\2\2\u013b\u013c") + buf.write("\5B\"\2\u013c\u013d\7\13\2\2\u013d\u013e\7\27\2\2\u013e") + buf.write("\u013f\5\6\4\2\u013f\u0140\7\30\2\2\u0140A\3\2\2\2\u0141") + buf.write("\u0146\7,\2\2\u0142\u0143\7\n\2\2\u0143\u0145\7,\2\2\u0144") + buf.write("\u0142\3\2\2\2\u0145\u0148\3\2\2\2\u0146\u0144\3\2\2\2") + buf.write("\u0146\u0147\3\2\2\2\u0147\u014a\3\2\2\2\u0148\u0146\3") + buf.write("\2\2\2\u0149\u0141\3\2\2\2\u0149\u014a\3\2\2\2\u014aC") + buf.write("\3\2\2\2\u014b\u0150\5*\26\2\u014c\u014d\7\n\2\2\u014d") + buf.write("\u014f\5*\26\2\u014e\u014c\3\2\2\2\u014f\u0152\3\2\2\2") + buf.write("\u0150\u014e\3\2\2\2\u0150\u0151\3\2\2\2\u0151\u0154\3") + buf.write("\2\2\2\u0152\u0150\3\2\2\2\u0153\u014b\3\2\2\2\u0153\u0154") + buf.write("\3\2\2\2\u0154E\3\2\2\2\u0155\u0156\b$\1\2\u0156\u0157") + buf.write("\7)\2\2\u0157\u0162\5F$\7\u0158\u0159\5*\26\2\u0159\u015a") + buf.write("\5H%\2\u015a\u015b\5*\26\2\u015b\u0162\3\2\2\2\u015c\u0162") + buf.write("\7 \2\2\u015d\u015e\7\t\2\2\u015e\u015f\5F$\2\u015f\u0160") + buf.write("\7\13\2\2\u0160\u0162\3\2\2\2\u0161\u0155\3\2\2\2\u0161") + buf.write("\u0158\3\2\2\2\u0161\u015c\3\2\2\2\u0161\u015d\3\2\2\2") + buf.write("\u0162\u0169\3\2\2\2\u0163\u0164\f\5\2\2\u0164\u0165\5") + buf.write("J&\2\u0165\u0166\5F$\6\u0166\u0168\3\2\2\2\u0167\u0163") + buf.write("\3\2\2\2\u0168\u016b\3\2\2\2\u0169\u0167\3\2\2\2\u0169") + buf.write("\u016a\3\2\2\2\u016aG\3\2\2\2\u016b\u0169\3\2\2\2\u016c") + buf.write("\u016d\t\6\2\2\u016dI\3\2\2\2\u016e\u016f\t\7\2\2\u016f") + buf.write("K\3\2\2\2\u0170\u0176\7*\2\2\u0171\u0176\7,\2\2\u0172") + buf.write("\u0176\5\34\17\2\u0173\u0176\5\64\33\2\u0174\u0176\7+") + buf.write("\2\2\u0175\u0170\3\2\2\2\u0175\u0171\3\2\2\2\u0175\u0172") + buf.write("\3\2\2\2\u0175\u0173\3\2\2\2\u0175\u0174\3\2\2\2\u0176") + buf.write("M\3\2\2\2\"TZjn\u009c\u009f\u00a5\u00bb\u00be\u00ce\u00d8") + buf.write("\u00da\u00e3\u00e7\u00f0\u00f6\u00fb\u010b\u010d\u0113") + buf.write("\u0120\u0125\u012a\u012f\u0133\u0146\u0149\u0150\u0153") + buf.write("\u0161\u0169\u0175") return buf.getvalue() @@ -234,16 +234,17 @@ class tlangParser ( Parser ): RULE_objectInstantiation = 24 RULE_objectOrArrayAccess = 25 RULE_baseAccess = 26 - RULE_functionCall = 27 - RULE_methodCaller = 28 - RULE_functionCallWithReturnValues = 29 - RULE_functionDeclaration = 30 - RULE_parameters = 31 - RULE_arguments = 32 - RULE_condition = 33 - RULE_binCondOp = 34 - RULE_logicOp = 35 - RULE_value = 36 + RULE_lvalue = 27 + RULE_functionCall = 28 + RULE_methodCaller = 29 + RULE_functionCallWithReturnValues = 30 + RULE_functionDeclaration = 31 + RULE_parameters = 32 + RULE_arguments = 33 + RULE_condition = 34 + RULE_binCondOp = 35 + RULE_logicOp = 36 + RULE_value = 37 ruleNames = [ "start", "instruction_list", "strict_ilist", "instruction", "conditional", "ifConditional", "ifElseConditional", @@ -252,7 +253,7 @@ class tlangParser ( Parser ): "multiplicative", "additive", "unaryArithOp", "returnStatement", "expression", "classDeclaration", "classBody", "classAttributeDeclaration", "objectInstantiation", "objectOrArrayAccess", "baseAccess", - "functionCall", "methodCaller", "functionCallWithReturnValues", + "lvalue", "functionCall", "methodCaller", "functionCallWithReturnValues", "functionDeclaration", "parameters", "arguments", "condition", "binCondOp", "logicOp", "value" ] @@ -342,9 +343,9 @@ def start(self): self.enterRule(localctx, 0, self.RULE_start) try: self.enterOuterAlt(localctx, 1) - self.state = 74 + self.state = 76 self.instruction_list() - self.state = 75 + self.state = 77 self.match(tlangParser.EOF) except RecognitionException as re: localctx.exception = re @@ -387,13 +388,13 @@ def instruction_list(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 80 + self.state = 82 self._errHandler.sync(self) _la = self._input.LA(1) while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 77 + self.state = 79 self.instruction() - self.state = 82 + self.state = 84 self._errHandler.sync(self) _la = self._input.LA(1) @@ -438,13 +439,13 @@ def strict_ilist(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 84 + self.state = 86 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 83 + self.state = 85 self.instruction() - self.state = 86 + self.state = 88 self._errHandler.sync(self) _la = self._input.LA(1) if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): @@ -538,90 +539,90 @@ def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) self.enterRule(localctx, 6, self.RULE_instruction) try: - self.state = 102 + self.state = 104 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,2,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 88 + self.state = 90 self.functionCallWithReturnValues() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 89 + self.state = 91 self.assignment() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 90 + self.state = 92 self.printStatement() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 91 + self.state = 93 self.conditional() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 92 + self.state = 94 self.loop() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 93 + self.state = 95 self.moveCommand() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 94 + self.state = 96 self.penCommand() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 95 + self.state = 97 self.gotoCommand() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 96 + self.state = 98 self.pauseCommand() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 97 + self.state = 99 self.classDeclaration() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 98 + self.state = 100 self.objectInstantiation() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 99 + self.state = 101 self.functionDeclaration() pass elif la_ == 13: self.enterOuterAlt(localctx, 13) - self.state = 100 + self.state = 102 self.functionCall() pass elif la_ == 14: self.enterOuterAlt(localctx, 14) - self.state = 101 + self.state = 103 self.returnStatement() pass @@ -666,18 +667,18 @@ def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) self.enterRule(localctx, 8, self.RULE_conditional) try: - self.state = 106 + self.state = 108 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,3,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 104 + self.state = 106 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 105 + self.state = 107 self.ifElseConditional() pass @@ -723,15 +724,15 @@ def ifConditional(self): self.enterRule(localctx, 10, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 108 + self.state = 110 self.match(tlangParser.T__0) - self.state = 109 + self.state = 111 self.condition(0) - self.state = 110 + self.state = 112 self.match(tlangParser.T__1) - self.state = 111 + self.state = 113 self.strict_ilist() - self.state = 112 + self.state = 114 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -777,23 +778,23 @@ def ifElseConditional(self): self.enterRule(localctx, 12, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 114 + self.state = 116 self.match(tlangParser.T__0) - self.state = 115 + self.state = 117 self.condition(0) - self.state = 116 + self.state = 118 self.match(tlangParser.T__1) - self.state = 117 + self.state = 119 self.strict_ilist() - self.state = 118 + self.state = 120 self.match(tlangParser.T__2) - self.state = 119 + self.state = 121 self.match(tlangParser.T__3) - self.state = 120 + self.state = 122 self.match(tlangParser.T__1) - self.state = 121 + self.state = 123 self.strict_ilist() - self.state = 122 + self.state = 124 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -836,15 +837,15 @@ def loop(self): self.enterRule(localctx, 14, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 124 + self.state = 126 self.match(tlangParser.T__4) - self.state = 125 + self.state = 127 self.value() - self.state = 126 + self.state = 128 self.match(tlangParser.T__1) - self.state = 127 + self.state = 129 self.strict_ilist() - self.state = 128 + self.state = 130 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -886,17 +887,17 @@ def gotoCommand(self): self.enterRule(localctx, 16, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 130 - self.match(tlangParser.T__5) - self.state = 131 - self.match(tlangParser.T__6) self.state = 132 - self.expression(0) + self.match(tlangParser.T__5) self.state = 133 - self.match(tlangParser.T__7) + self.match(tlangParser.T__6) self.state = 134 self.expression(0) self.state = 135 + self.match(tlangParser.T__7) + self.state = 136 + self.expression(0) + self.state = 137 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -939,9 +940,9 @@ def moveCommand(self): self.enterRule(localctx, 18, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 137 + self.state = 139 self.moveOp() - self.state = 138 + self.state = 140 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -978,7 +979,7 @@ def moveOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 140 + self.state = 142 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -1020,7 +1021,7 @@ def penCommand(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 142 + self.state = 144 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -1061,7 +1062,7 @@ def pauseCommand(self): self.enterRule(localctx, 24, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 144 + self.state = 146 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -1104,29 +1105,29 @@ def array(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 146 + self.state = 148 self.match(tlangParser.T__1) - self.state = 155 + self.state = 157 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 147 + self.state = 149 self.expression(0) - self.state = 152 + self.state = 154 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 148 + self.state = 150 self.match(tlangParser.T__7) - self.state = 149 + self.state = 151 self.expression(0) - self.state = 154 + self.state = 156 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 157 + self.state = 159 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -1172,23 +1173,23 @@ def assignment(self): self.enterRule(localctx, 28, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 161 + self.state = 163 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,6,self._ctx) if la_ == 1: - self.state = 159 + self.state = 161 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 160 + self.state = 162 self.objectOrArrayAccess() pass - self.state = 163 + self.state = 165 self.match(tlangParser.T__16) - self.state = 164 + self.state = 166 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1227,13 +1228,13 @@ def printStatement(self): self.enterRule(localctx, 30, self.RULE_printStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 166 + self.state = 168 self.match(tlangParser.T__17) - self.state = 167 + self.state = 169 self.match(tlangParser.T__6) - self.state = 168 + self.state = 170 self.expression(0) - self.state = 169 + self.state = 171 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1275,7 +1276,7 @@ def multiplicative(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 171 + self.state = 173 _la = self._input.LA(1) if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) @@ -1322,7 +1323,7 @@ def additive(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 173 + self.state = 175 _la = self._input.LA(1) if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) @@ -1365,7 +1366,7 @@ def unaryArithOp(self): self.enterRule(localctx, 36, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 175 + self.state = 177 self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re @@ -1408,23 +1409,23 @@ def returnStatement(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 177 + self.state = 179 self.match(tlangParser.T__18) - self.state = 186 + self.state = 188 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,8,self._ctx) if la_ == 1: - self.state = 178 + self.state = 180 self.expression(0) - self.state = 183 + self.state = 185 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 179 + self.state = 181 self.match(tlangParser.T__7) - self.state = 180 + self.state = 182 self.expression(0) - self.state = 185 + self.state = 187 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1560,14 +1561,12 @@ def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.Expr super().__init__(parser) self.copyFrom(ctx) + def lvalue(self): + return self.getTypedRuleContext(tlangParser.LvalueContext,0) + def expression(self): return self.getTypedRuleContext(tlangParser.ExpressionContext,0) - def VAR(self): - return self.getToken(tlangParser.VAR, 0) - def objectOrArrayAccess(self): - return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,0) - def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAssignExpr" ): @@ -1605,75 +1604,63 @@ def expression(self, _p:int=0): self.enterOuterAlt(localctx, 1) self.state = 204 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,10,self._ctx) + la_ = self._interp.adaptivePredict(self._input,9,self._ctx) if la_ == 1: localctx = tlangParser.UnaryExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 189 + self.state = 191 self.unaryArithOp() - self.state = 190 + self.state = 192 self.expression(7) pass elif la_ == 2: - localctx = tlangParser.ParenExprContext(self, localctx) + localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 192 - self.match(tlangParser.T__6) - self.state = 193 - self.expression(0) self.state = 194 - self.match(tlangParser.T__8) + self.lvalue() + self.state = 195 + self.match(tlangParser.T__16) + self.state = 196 + self.expression(4) pass elif la_ == 3: - localctx = tlangParser.ValueExprContext(self, localctx) + localctx = tlangParser.FunctionCallExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 196 - self.value() + self.state = 198 + self.functionCall() pass elif la_ == 4: - localctx = tlangParser.AssignExprContext(self, localctx) + localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx self.state = 199 - self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,9,self._ctx) - if la_ == 1: - self.state = 197 - self.match(tlangParser.VAR) - pass - - elif la_ == 2: - self.state = 198 - self.objectOrArrayAccess() - pass - - + self.match(tlangParser.T__6) + self.state = 200 + self.expression(0) self.state = 201 - self.match(tlangParser.T__16) - self.state = 202 - self.expression(2) + self.match(tlangParser.T__8) pass elif la_ == 5: - localctx = tlangParser.FunctionCallExprContext(self, localctx) + localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx self.state = 203 - self.functionCall() + self.value() pass self._ctx.stop = self._input.LT(-1) self.state = 216 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,12,self._ctx) + _alt = self._interp.adaptivePredict(self._input,11,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -1681,7 +1668,7 @@ def expression(self, _p:int=0): _prevctx = localctx self.state = 214 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,11,self._ctx) + la_ = self._interp.adaptivePredict(self._input,10,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) @@ -1711,7 +1698,7 @@ def expression(self, _p:int=0): self.state = 218 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,12,self._ctx) + _alt = self._interp.adaptivePredict(self._input,11,self._ctx) except RecognitionException as re: localctx.exception = re @@ -1897,7 +1884,7 @@ def classAttributeDeclaration(self): try: self.state = 249 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,17,self._ctx) + la_ = self._interp.adaptivePredict(self._input,16,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) self.state = 247 @@ -1926,15 +1913,12 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def VAR(self, i:int=None): - if i is None: - return self.getTokens(tlangParser.VAR) - else: - return self.getToken(tlangParser.VAR, i) + def lvalue(self): + return self.getTypedRuleContext(tlangParser.LvalueContext,0) - def objectOrArrayAccess(self): - return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,0) + def VAR(self): + return self.getToken(tlangParser.VAR, 0) def getRuleIndex(self): return tlangParser.RULE_objectInstantiation @@ -1954,29 +1938,17 @@ def objectInstantiation(self): self.enterRule(localctx, 48, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 253 - self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,18,self._ctx) - if la_ == 1: - self.state = 251 - self.match(tlangParser.VAR) - pass - - elif la_ == 2: - self.state = 252 - self.objectOrArrayAccess() - pass - - - self.state = 255 + self.state = 251 + self.lvalue() + self.state = 252 self.match(tlangParser.T__16) - self.state = 256 + self.state = 253 self.match(tlangParser.T__22) - self.state = 257 + self.state = 254 self.match(tlangParser.VAR) - self.state = 258 + self.state = 255 self.match(tlangParser.T__6) - self.state = 259 + self.state = 256 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2028,28 +2000,28 @@ def objectOrArrayAccess(self): self.enterRule(localctx, 50, self.RULE_objectOrArrayAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 261 + self.state = 258 self.baseAccess() - self.state = 268 + self.state = 265 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 268 + self.state = 265 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__23]: - self.state = 262 + self.state = 259 self.match(tlangParser.T__23) - self.state = 263 + self.state = 260 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 264 + self.state = 261 self.match(tlangParser.T__1) - self.state = 265 + self.state = 262 self.expression(0) - self.state = 266 + self.state = 263 self.match(tlangParser.T__2) pass else: @@ -2058,9 +2030,9 @@ def objectOrArrayAccess(self): else: raise NoViableAltException(self) - self.state = 270 + self.state = 267 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,20,self._ctx) + _alt = self._interp.adaptivePredict(self._input,18,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2098,7 +2070,7 @@ def baseAccess(self): self.enterRule(localctx, 52, self.RULE_baseAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 272 + self.state = 269 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -2109,6 +2081,61 @@ def baseAccess(self): return localctx + class LvalueContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def VAR(self): + return self.getToken(tlangParser.VAR, 0) + + def objectOrArrayAccess(self): + return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,0) + + + def getRuleIndex(self): + return tlangParser.RULE_lvalue + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitLvalue" ): + return visitor.visitLvalue(self) + else: + return visitor.visitChildren(self) + + + + + def lvalue(self): + + localctx = tlangParser.LvalueContext(self, self._ctx, self.state) + self.enterRule(localctx, 54, self.RULE_lvalue) + try: + self.state = 273 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input,19,self._ctx) + if la_ == 1: + self.enterOuterAlt(localctx, 1) + self.state = 271 + self.match(tlangParser.VAR) + pass + + elif la_ == 2: + self.enterOuterAlt(localctx, 2) + self.state = 272 + self.objectOrArrayAccess() + pass + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class FunctionCallContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -2141,18 +2168,18 @@ def accept(self, visitor:ParseTreeVisitor): def functionCall(self): localctx = tlangParser.FunctionCallContext(self, self._ctx, self.state) - self.enterRule(localctx, 54, self.RULE_functionCall) + self.enterRule(localctx, 56, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 274 - self.methodCaller() self.state = 275 - self.match(tlangParser.NAME) + self.methodCaller() self.state = 276 - self.match(tlangParser.T__6) + self.match(tlangParser.NAME) self.state = 277 - self.arguments() + self.match(tlangParser.T__6) self.state = 278 + self.arguments() + self.state = 279 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2197,35 +2224,35 @@ def accept(self, visitor:ParseTreeVisitor): def methodCaller(self): localctx = tlangParser.MethodCallerContext(self, self._ctx, self.state) - self.enterRule(localctx, 56, self.RULE_methodCaller) + self.enterRule(localctx, 58, self.RULE_methodCaller) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 290 + self.state = 291 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__1 or _la==tlangParser.VAR: - self.state = 285 + self.state = 286 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.VAR]: - self.state = 280 + self.state = 281 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 281 - self.match(tlangParser.T__1) self.state = 282 - self.expression(0) + self.match(tlangParser.T__1) self.state = 283 + self.expression(0) + self.state = 284 self.match(tlangParser.T__2) pass else: raise NoViableAltException(self) - self.state = 287 + self.state = 288 self.match(tlangParser.T__23) - self.state = 292 + self.state = 293 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2276,53 +2303,53 @@ def accept(self, visitor:ParseTreeVisitor): def functionCallWithReturnValues(self): localctx = tlangParser.FunctionCallWithReturnValuesContext(self, self._ctx, self.state) - self.enterRule(localctx, 58, self.RULE_functionCallWithReturnValues) + self.enterRule(localctx, 60, self.RULE_functionCallWithReturnValues) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 295 + self.state = 296 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,23,self._ctx) + la_ = self._interp.adaptivePredict(self._input,22,self._ctx) if la_ == 1: - self.state = 293 + self.state = 294 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 294 + self.state = 295 self.objectOrArrayAccess() pass - self.state = 302 + self.state = 303 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 297 + self.state = 298 self.match(tlangParser.T__7) - self.state = 300 + self.state = 301 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,24,self._ctx) + la_ = self._interp.adaptivePredict(self._input,23,self._ctx) if la_ == 1: - self.state = 298 + self.state = 299 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 299 + self.state = 300 self.objectOrArrayAccess() pass - self.state = 304 + self.state = 305 self._errHandler.sync(self) _la = self._input.LA(1) if not (_la==tlangParser.T__7): break - self.state = 306 - self.match(tlangParser.T__16) self.state = 307 + self.match(tlangParser.T__16) + self.state = 308 self.functionCall() except RecognitionException as re: localctx.exception = re @@ -2365,24 +2392,24 @@ def accept(self, visitor:ParseTreeVisitor): def functionDeclaration(self): localctx = tlangParser.FunctionDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 60, self.RULE_functionDeclaration) + self.enterRule(localctx, 62, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 309 - self.match(tlangParser.T__24) self.state = 310 - self.match(tlangParser.NAME) + self.match(tlangParser.T__24) self.state = 311 - self.match(tlangParser.T__6) + self.match(tlangParser.NAME) self.state = 312 - self.parameters() + self.match(tlangParser.T__6) self.state = 313 - self.match(tlangParser.T__8) + self.parameters() self.state = 314 - self.match(tlangParser.T__20) + self.match(tlangParser.T__8) self.state = 315 - self.strict_ilist() + self.match(tlangParser.T__20) self.state = 316 + self.strict_ilist() + self.state = 317 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -2420,25 +2447,25 @@ def accept(self, visitor:ParseTreeVisitor): def parameters(self): localctx = tlangParser.ParametersContext(self, self._ctx, self.state) - self.enterRule(localctx, 62, self.RULE_parameters) + self.enterRule(localctx, 64, self.RULE_parameters) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 326 + self.state = 327 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.VAR: - self.state = 318 + self.state = 319 self.match(tlangParser.VAR) - self.state = 323 + self.state = 324 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 319 - self.match(tlangParser.T__7) self.state = 320 + self.match(tlangParser.T__7) + self.state = 321 self.match(tlangParser.VAR) - self.state = 325 + self.state = 326 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2481,25 +2508,25 @@ def accept(self, visitor:ParseTreeVisitor): def arguments(self): localctx = tlangParser.ArgumentsContext(self, self._ctx, self.state) - self.enterRule(localctx, 64, self.RULE_arguments) + self.enterRule(localctx, 66, self.RULE_arguments) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 336 + self.state = 337 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 328 + self.state = 329 self.expression(0) - self.state = 333 + self.state = 334 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 329 - self.match(tlangParser.T__7) self.state = 330 + self.match(tlangParser.T__7) + self.state = 331 self.expression(0) - self.state = 335 + self.state = 336 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2564,48 +2591,48 @@ def condition(self, _p:int=0): _parentState = self.state localctx = tlangParser.ConditionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 66 - self.enterRecursionRule(localctx, 66, self.RULE_condition, _p) + _startState = 68 + self.enterRecursionRule(localctx, 68, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 350 + self.state = 351 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,30,self._ctx) + la_ = self._interp.adaptivePredict(self._input,29,self._ctx) if la_ == 1: - self.state = 339 - self.match(tlangParser.NOT) self.state = 340 + self.match(tlangParser.NOT) + self.state = 341 self.condition(5) pass elif la_ == 2: - self.state = 341 - self.expression(0) self.state = 342 - self.binCondOp() + self.expression(0) self.state = 343 + self.binCondOp() + self.state = 344 self.expression(0) pass elif la_ == 3: - self.state = 345 + self.state = 346 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 346 - self.match(tlangParser.T__6) self.state = 347 - self.condition(0) + self.match(tlangParser.T__6) self.state = 348 + self.condition(0) + self.state = 349 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 358 + self.state = 359 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,31,self._ctx) + _alt = self._interp.adaptivePredict(self._input,30,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -2613,17 +2640,17 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 352 + self.state = 353 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 353 - self.logicOp() self.state = 354 + self.logicOp() + self.state = 355 self.condition(4) - self.state = 360 + self.state = 361 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,31,self._ctx) + _alt = self._interp.adaptivePredict(self._input,30,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2673,11 +2700,11 @@ def accept(self, visitor:ParseTreeVisitor): def binCondOp(self): localctx = tlangParser.BinCondOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 68, self.RULE_binCondOp) + self.enterRule(localctx, 70, self.RULE_binCondOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 361 + self.state = 362 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2720,11 +2747,11 @@ def accept(self, visitor:ParseTreeVisitor): def logicOp(self): localctx = tlangParser.LogicOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 70, self.RULE_logicOp) + self.enterRule(localctx, 72, self.RULE_logicOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 363 + self.state = 364 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2778,38 +2805,38 @@ def accept(self, visitor:ParseTreeVisitor): def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) - self.enterRule(localctx, 72, self.RULE_value) + self.enterRule(localctx, 74, self.RULE_value) try: - self.state = 370 + self.state = 371 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,32,self._ctx) + la_ = self._interp.adaptivePredict(self._input,31,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 365 + self.state = 366 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 366 + self.state = 367 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 367 + self.state = 368 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 368 + self.state = 369 self.objectOrArrayAccess() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 369 + self.state = 370 self.match(tlangParser.REAL) pass @@ -2828,7 +2855,7 @@ def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): if self._predicates == None: self._predicates = dict() self._predicates[20] = self.expression_sempred - self._predicates[33] = self.condition_sempred + self._predicates[34] = self.condition_sempred pred = self._predicates.get(ruleIndex, None) if pred is None: raise Exception("No predicate with index:" + str(ruleIndex)) diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index 3bc78c1..9a882a1 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -174,6 +174,11 @@ def visitBaseAccess(self, ctx:tlangParser.BaseAccessContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#lvalue. + def visitLvalue(self, ctx:tlangParser.LvalueContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#functionCall. def visitFunctionCall(self, ctx:tlangParser.FunctionCallContext): return self.visitChildren(ctx) From 2886a5b084769208853a8e6a46f52832a7d75a18 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Thu, 20 Mar 2025 15:20:24 +0530 Subject: [PATCH 18/47] [bug fix] class with no attribute --- ChironCore/ChironAST/builder.py | 14 +- ChironCore/example/issues.txt | 3 +- ChironCore/example/kachuapur4.tl | 10 +- ChironCore/interpreter.py | 2 +- ChironCore/turtparse/tlang.g4 | 2 +- ChironCore/turtparse/tlang.interp | 2 +- ChironCore/turtparse/tlangParser.py | 591 +++++++++++++-------------- ChironCore/turtparse/tlangVisitor.py | 5 - 8 files changed, 307 insertions(+), 322 deletions(-) diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 9df551d..b0b581c 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -197,15 +197,15 @@ def visitValue(self, ctx: tlangParser.ValueContext): elif ctx.array(): return ChironAST.Array(ctx.array().getText()) elif ctx.objectOrArrayAccess(): - print("entering heaven") return self.visitObjectOrArrayAccess(ctx.objectOrArrayAccess()) + elif ctx.functionCall(): + return self.visitFunctionCallExpr(ctx.functionCall()) - def visitFunctionCallExpr(self, ctx: tlangParser.FunctionCallExprContext): - functionCallCtx = ctx.functionCall() - functionName = functionCallCtx.NAME().getText() - callerClass = self.visitMethodCaller(functionCallCtx.methodCaller()) if functionCallCtx.methodCaller().children is not None else None - functionArgs = [self.visit(arg) for arg in functionCallCtx.arguments( - ).expression()] if functionCallCtx.arguments() is not None else [] + def visitFunctionCallExpr(self, ctx: tlangParser.FunctionCallContext): + functionName = ctx.NAME().getText() + callerClass = self.visitMethodCaller(ctx.methodCaller()) if ctx.methodCaller().children is not None else None + functionArgs = [self.visit(arg) for arg in ctx.arguments( + ).expression()] if ctx.arguments() is not None else [] if callerClass: functionArgs.insert(0, callerClass) returnLocation = ChironAST.Var(":__reg_" + str(self.virtualRegCount)) diff --git a/ChironCore/example/issues.txt b/ChironCore/example/issues.txt index 9523a31..6661a2e 100644 --- a/ChironCore/example/issues.txt +++ b/ChironCore/example/issues.txt @@ -6,4 +6,5 @@ 6. Multiple class inheritance is not yet supported! 7. return is compulsory in function declaration 8. Solution to Avoid Unexpected Changes in Mutable Class Variables: use __init__ method during class declaration -9. \ No newline at end of file +9. Writing self is compulsory in methods of class parameters +10. class must have at least one assignment statement [fixed] \ No newline at end of file diff --git a/ChironCore/example/kachuapur4.tl b/ChironCore/example/kachuapur4.tl index 7a4bb3b..da91dd6 100644 --- a/ChironCore/example/kachuapur4.tl +++ b/ChironCore/example/kachuapur4.tl @@ -2,11 +2,15 @@ def add(:a, :b) { return :a + :b } -def increment(:val) +class :Test { - return add(:val, 1) +def increment(:self, :val) +{ + return add(2, 3) +} } +:test = new :Test() :val = 1 -:val = increment(:val) +:val = :test.increment(:val) * 2 print(:val) \ No newline at end of file diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 2cea89e..e942f48 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -253,7 +253,7 @@ def handleClassDeclaration(self, stmt, tgt): else: class_header = f"class {className}:\n" - class_def = class_header + class_def = class_header + " pass\n" # Ensure class has a valid body if no attributes # Handle normal attributes for attr in attributes: diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index a36959c..64cd921 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -71,7 +71,6 @@ expression : | expression multiplicative expression #mulExpr | expression additive expression #addExpr | lvalue '=' expression #assignExpr - | functionCall #functionCallExpr | '(' expression ')' #parenExpr | value #valueExpr ; @@ -138,6 +137,7 @@ value : NUM | VAR | array | objectOrArrayAccess + | functionCall | REAL ; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index b713ee1..275d099 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -134,4 +134,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 376, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 83, 10, 3, 12, 3, 14, 3, 86, 11, 3, 3, 4, 6, 4, 89, 10, 4, 13, 4, 14, 4, 90, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 107, 10, 5, 3, 6, 3, 6, 5, 6, 111, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 155, 10, 15, 12, 15, 14, 15, 158, 11, 15, 5, 15, 160, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 166, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 186, 10, 21, 12, 21, 14, 21, 189, 11, 21, 5, 21, 191, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 207, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 217, 10, 22, 12, 22, 14, 22, 220, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 226, 10, 23, 12, 23, 14, 23, 229, 11, 23, 3, 23, 5, 23, 232, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 239, 10, 24, 12, 24, 14, 24, 242, 11, 24, 3, 24, 7, 24, 245, 10, 24, 12, 24, 14, 24, 248, 11, 24, 3, 25, 3, 25, 5, 25, 252, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 268, 10, 27, 13, 27, 14, 27, 269, 3, 28, 3, 28, 3, 29, 3, 29, 5, 29, 276, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 289, 10, 31, 3, 31, 7, 31, 292, 10, 31, 12, 31, 14, 31, 295, 11, 31, 3, 32, 3, 32, 5, 32, 299, 10, 32, 3, 32, 3, 32, 3, 32, 5, 32, 304, 10, 32, 6, 32, 306, 10, 32, 13, 32, 14, 32, 307, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 7, 34, 325, 10, 34, 12, 34, 14, 34, 328, 11, 34, 5, 34, 330, 10, 34, 3, 35, 3, 35, 3, 35, 7, 35, 335, 10, 35, 12, 35, 14, 35, 338, 11, 35, 5, 35, 340, 10, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 354, 10, 36, 3, 36, 3, 36, 3, 36, 3, 36, 7, 36, 360, 10, 36, 12, 36, 14, 36, 363, 11, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 5, 39, 374, 10, 39, 3, 39, 2, 4, 42, 70, 40, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 3, 2, 33, 38, 3, 2, 39, 40, 2, 389, 2, 78, 3, 2, 2, 2, 4, 84, 3, 2, 2, 2, 6, 88, 3, 2, 2, 2, 8, 106, 3, 2, 2, 2, 10, 110, 3, 2, 2, 2, 12, 112, 3, 2, 2, 2, 14, 118, 3, 2, 2, 2, 16, 128, 3, 2, 2, 2, 18, 134, 3, 2, 2, 2, 20, 141, 3, 2, 2, 2, 22, 144, 3, 2, 2, 2, 24, 146, 3, 2, 2, 2, 26, 148, 3, 2, 2, 2, 28, 150, 3, 2, 2, 2, 30, 165, 3, 2, 2, 2, 32, 170, 3, 2, 2, 2, 34, 175, 3, 2, 2, 2, 36, 177, 3, 2, 2, 2, 38, 179, 3, 2, 2, 2, 40, 181, 3, 2, 2, 2, 42, 206, 3, 2, 2, 2, 44, 221, 3, 2, 2, 2, 46, 240, 3, 2, 2, 2, 48, 251, 3, 2, 2, 2, 50, 253, 3, 2, 2, 2, 52, 260, 3, 2, 2, 2, 54, 271, 3, 2, 2, 2, 56, 275, 3, 2, 2, 2, 58, 277, 3, 2, 2, 2, 60, 293, 3, 2, 2, 2, 62, 298, 3, 2, 2, 2, 64, 312, 3, 2, 2, 2, 66, 329, 3, 2, 2, 2, 68, 339, 3, 2, 2, 2, 70, 353, 3, 2, 2, 2, 72, 364, 3, 2, 2, 2, 74, 366, 3, 2, 2, 2, 76, 373, 3, 2, 2, 2, 78, 79, 5, 4, 3, 2, 79, 80, 7, 2, 2, 3, 80, 3, 3, 2, 2, 2, 81, 83, 5, 8, 5, 2, 82, 81, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 5, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 87, 89, 5, 8, 5, 2, 88, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 7, 3, 2, 2, 2, 92, 107, 5, 62, 32, 2, 93, 107, 5, 30, 16, 2, 94, 107, 5, 32, 17, 2, 95, 107, 5, 10, 6, 2, 96, 107, 5, 16, 9, 2, 97, 107, 5, 20, 11, 2, 98, 107, 5, 24, 13, 2, 99, 107, 5, 18, 10, 2, 100, 107, 5, 26, 14, 2, 101, 107, 5, 44, 23, 2, 102, 107, 5, 50, 26, 2, 103, 107, 5, 64, 33, 2, 104, 107, 5, 58, 30, 2, 105, 107, 5, 40, 21, 2, 106, 92, 3, 2, 2, 2, 106, 93, 3, 2, 2, 2, 106, 94, 3, 2, 2, 2, 106, 95, 3, 2, 2, 2, 106, 96, 3, 2, 2, 2, 106, 97, 3, 2, 2, 2, 106, 98, 3, 2, 2, 2, 106, 99, 3, 2, 2, 2, 106, 100, 3, 2, 2, 2, 106, 101, 3, 2, 2, 2, 106, 102, 3, 2, 2, 2, 106, 103, 3, 2, 2, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 9, 3, 2, 2, 2, 108, 111, 5, 12, 7, 2, 109, 111, 5, 14, 8, 2, 110, 108, 3, 2, 2, 2, 110, 109, 3, 2, 2, 2, 111, 11, 3, 2, 2, 2, 112, 113, 7, 3, 2, 2, 113, 114, 5, 70, 36, 2, 114, 115, 7, 4, 2, 2, 115, 116, 5, 6, 4, 2, 116, 117, 7, 5, 2, 2, 117, 13, 3, 2, 2, 2, 118, 119, 7, 3, 2, 2, 119, 120, 5, 70, 36, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 124, 7, 6, 2, 2, 124, 125, 7, 4, 2, 2, 125, 126, 5, 6, 4, 2, 126, 127, 7, 5, 2, 2, 127, 15, 3, 2, 2, 2, 128, 129, 7, 7, 2, 2, 129, 130, 5, 76, 39, 2, 130, 131, 7, 4, 2, 2, 131, 132, 5, 6, 4, 2, 132, 133, 7, 5, 2, 2, 133, 17, 3, 2, 2, 2, 134, 135, 7, 8, 2, 2, 135, 136, 7, 9, 2, 2, 136, 137, 5, 42, 22, 2, 137, 138, 7, 10, 2, 2, 138, 139, 5, 42, 22, 2, 139, 140, 7, 11, 2, 2, 140, 19, 3, 2, 2, 2, 141, 142, 5, 22, 12, 2, 142, 143, 5, 42, 22, 2, 143, 21, 3, 2, 2, 2, 144, 145, 9, 2, 2, 2, 145, 23, 3, 2, 2, 2, 146, 147, 9, 3, 2, 2, 147, 25, 3, 2, 2, 2, 148, 149, 7, 18, 2, 2, 149, 27, 3, 2, 2, 2, 150, 159, 7, 4, 2, 2, 151, 156, 5, 42, 22, 2, 152, 153, 7, 10, 2, 2, 153, 155, 5, 42, 22, 2, 154, 152, 3, 2, 2, 2, 155, 158, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 159, 151, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 162, 7, 5, 2, 2, 162, 29, 3, 2, 2, 2, 163, 166, 7, 44, 2, 2, 164, 166, 5, 52, 27, 2, 165, 163, 3, 2, 2, 2, 165, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 7, 19, 2, 2, 168, 169, 5, 42, 22, 2, 169, 31, 3, 2, 2, 2, 170, 171, 7, 20, 2, 2, 171, 172, 7, 9, 2, 2, 172, 173, 5, 42, 22, 2, 173, 174, 7, 11, 2, 2, 174, 33, 3, 2, 2, 2, 175, 176, 9, 4, 2, 2, 176, 35, 3, 2, 2, 2, 177, 178, 9, 5, 2, 2, 178, 37, 3, 2, 2, 2, 179, 180, 7, 29, 2, 2, 180, 39, 3, 2, 2, 2, 181, 190, 7, 21, 2, 2, 182, 187, 5, 42, 22, 2, 183, 184, 7, 10, 2, 2, 184, 186, 5, 42, 22, 2, 185, 183, 3, 2, 2, 2, 186, 189, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188, 191, 3, 2, 2, 2, 189, 187, 3, 2, 2, 2, 190, 182, 3, 2, 2, 2, 190, 191, 3, 2, 2, 2, 191, 41, 3, 2, 2, 2, 192, 193, 8, 22, 1, 2, 193, 194, 5, 38, 20, 2, 194, 195, 5, 42, 22, 9, 195, 207, 3, 2, 2, 2, 196, 197, 5, 56, 29, 2, 197, 198, 7, 19, 2, 2, 198, 199, 5, 42, 22, 6, 199, 207, 3, 2, 2, 2, 200, 207, 5, 58, 30, 2, 201, 202, 7, 9, 2, 2, 202, 203, 5, 42, 22, 2, 203, 204, 7, 11, 2, 2, 204, 207, 3, 2, 2, 2, 205, 207, 5, 76, 39, 2, 206, 192, 3, 2, 2, 2, 206, 196, 3, 2, 2, 2, 206, 200, 3, 2, 2, 2, 206, 201, 3, 2, 2, 2, 206, 205, 3, 2, 2, 2, 207, 218, 3, 2, 2, 2, 208, 209, 12, 8, 2, 2, 209, 210, 5, 34, 18, 2, 210, 211, 5, 42, 22, 9, 211, 217, 3, 2, 2, 2, 212, 213, 12, 7, 2, 2, 213, 214, 5, 36, 19, 2, 214, 215, 5, 42, 22, 8, 215, 217, 3, 2, 2, 2, 216, 208, 3, 2, 2, 2, 216, 212, 3, 2, 2, 2, 217, 220, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 43, 3, 2, 2, 2, 220, 218, 3, 2, 2, 2, 221, 222, 7, 22, 2, 2, 222, 231, 7, 44, 2, 2, 223, 227, 7, 9, 2, 2, 224, 226, 7, 44, 2, 2, 225, 224, 3, 2, 2, 2, 226, 229, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 230, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 230, 232, 7, 11, 2, 2, 231, 223, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 233, 3, 2, 2, 2, 233, 234, 7, 23, 2, 2, 234, 235, 5, 46, 24, 2, 235, 236, 7, 24, 2, 2, 236, 45, 3, 2, 2, 2, 237, 239, 5, 48, 25, 2, 238, 237, 3, 2, 2, 2, 239, 242, 3, 2, 2, 2, 240, 238, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 246, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 243, 245, 5, 64, 33, 2, 244, 243, 3, 2, 2, 2, 245, 248, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 246, 247, 3, 2, 2, 2, 247, 47, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 249, 252, 5, 30, 16, 2, 250, 252, 5, 50, 26, 2, 251, 249, 3, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 49, 3, 2, 2, 2, 253, 254, 5, 56, 29, 2, 254, 255, 7, 19, 2, 2, 255, 256, 7, 25, 2, 2, 256, 257, 7, 44, 2, 2, 257, 258, 7, 9, 2, 2, 258, 259, 7, 11, 2, 2, 259, 51, 3, 2, 2, 2, 260, 267, 5, 54, 28, 2, 261, 262, 7, 26, 2, 2, 262, 268, 7, 44, 2, 2, 263, 264, 7, 4, 2, 2, 264, 265, 5, 42, 22, 2, 265, 266, 7, 5, 2, 2, 266, 268, 3, 2, 2, 2, 267, 261, 3, 2, 2, 2, 267, 263, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 267, 3, 2, 2, 2, 269, 270, 3, 2, 2, 2, 270, 53, 3, 2, 2, 2, 271, 272, 7, 44, 2, 2, 272, 55, 3, 2, 2, 2, 273, 276, 7, 44, 2, 2, 274, 276, 5, 52, 27, 2, 275, 273, 3, 2, 2, 2, 275, 274, 3, 2, 2, 2, 276, 57, 3, 2, 2, 2, 277, 278, 5, 60, 31, 2, 278, 279, 7, 45, 2, 2, 279, 280, 7, 9, 2, 2, 280, 281, 5, 68, 35, 2, 281, 282, 7, 11, 2, 2, 282, 59, 3, 2, 2, 2, 283, 289, 7, 44, 2, 2, 284, 285, 7, 4, 2, 2, 285, 286, 5, 42, 22, 2, 286, 287, 7, 5, 2, 2, 287, 289, 3, 2, 2, 2, 288, 283, 3, 2, 2, 2, 288, 284, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 292, 7, 26, 2, 2, 291, 288, 3, 2, 2, 2, 292, 295, 3, 2, 2, 2, 293, 291, 3, 2, 2, 2, 293, 294, 3, 2, 2, 2, 294, 61, 3, 2, 2, 2, 295, 293, 3, 2, 2, 2, 296, 299, 7, 44, 2, 2, 297, 299, 5, 52, 27, 2, 298, 296, 3, 2, 2, 2, 298, 297, 3, 2, 2, 2, 299, 305, 3, 2, 2, 2, 300, 303, 7, 10, 2, 2, 301, 304, 7, 44, 2, 2, 302, 304, 5, 52, 27, 2, 303, 301, 3, 2, 2, 2, 303, 302, 3, 2, 2, 2, 304, 306, 3, 2, 2, 2, 305, 300, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 305, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308, 309, 3, 2, 2, 2, 309, 310, 7, 19, 2, 2, 310, 311, 5, 58, 30, 2, 311, 63, 3, 2, 2, 2, 312, 313, 7, 27, 2, 2, 313, 314, 7, 45, 2, 2, 314, 315, 7, 9, 2, 2, 315, 316, 5, 66, 34, 2, 316, 317, 7, 11, 2, 2, 317, 318, 7, 23, 2, 2, 318, 319, 5, 6, 4, 2, 319, 320, 7, 24, 2, 2, 320, 65, 3, 2, 2, 2, 321, 326, 7, 44, 2, 2, 322, 323, 7, 10, 2, 2, 323, 325, 7, 44, 2, 2, 324, 322, 3, 2, 2, 2, 325, 328, 3, 2, 2, 2, 326, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 330, 3, 2, 2, 2, 328, 326, 3, 2, 2, 2, 329, 321, 3, 2, 2, 2, 329, 330, 3, 2, 2, 2, 330, 67, 3, 2, 2, 2, 331, 336, 5, 42, 22, 2, 332, 333, 7, 10, 2, 2, 333, 335, 5, 42, 22, 2, 334, 332, 3, 2, 2, 2, 335, 338, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 336, 337, 3, 2, 2, 2, 337, 340, 3, 2, 2, 2, 338, 336, 3, 2, 2, 2, 339, 331, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 69, 3, 2, 2, 2, 341, 342, 8, 36, 1, 2, 342, 343, 7, 41, 2, 2, 343, 354, 5, 70, 36, 7, 344, 345, 5, 42, 22, 2, 345, 346, 5, 72, 37, 2, 346, 347, 5, 42, 22, 2, 347, 354, 3, 2, 2, 2, 348, 354, 7, 32, 2, 2, 349, 350, 7, 9, 2, 2, 350, 351, 5, 70, 36, 2, 351, 352, 7, 11, 2, 2, 352, 354, 3, 2, 2, 2, 353, 341, 3, 2, 2, 2, 353, 344, 3, 2, 2, 2, 353, 348, 3, 2, 2, 2, 353, 349, 3, 2, 2, 2, 354, 361, 3, 2, 2, 2, 355, 356, 12, 5, 2, 2, 356, 357, 5, 74, 38, 2, 357, 358, 5, 70, 36, 6, 358, 360, 3, 2, 2, 2, 359, 355, 3, 2, 2, 2, 360, 363, 3, 2, 2, 2, 361, 359, 3, 2, 2, 2, 361, 362, 3, 2, 2, 2, 362, 71, 3, 2, 2, 2, 363, 361, 3, 2, 2, 2, 364, 365, 9, 6, 2, 2, 365, 73, 3, 2, 2, 2, 366, 367, 9, 7, 2, 2, 367, 75, 3, 2, 2, 2, 368, 374, 7, 42, 2, 2, 369, 374, 7, 44, 2, 2, 370, 374, 5, 28, 15, 2, 371, 374, 5, 52, 27, 2, 372, 374, 7, 43, 2, 2, 373, 368, 3, 2, 2, 2, 373, 369, 3, 2, 2, 2, 373, 370, 3, 2, 2, 2, 373, 371, 3, 2, 2, 2, 373, 372, 3, 2, 2, 2, 374, 77, 3, 2, 2, 2, 34, 84, 90, 106, 110, 156, 159, 165, 187, 190, 206, 216, 218, 227, 231, 240, 246, 251, 267, 269, 275, 288, 293, 298, 303, 307, 326, 329, 336, 339, 353, 361, 373] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 376, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 83, 10, 3, 12, 3, 14, 3, 86, 11, 3, 3, 4, 6, 4, 89, 10, 4, 13, 4, 14, 4, 90, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 107, 10, 5, 3, 6, 3, 6, 5, 6, 111, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 155, 10, 15, 12, 15, 14, 15, 158, 11, 15, 5, 15, 160, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 166, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 186, 10, 21, 12, 21, 14, 21, 189, 11, 21, 5, 21, 191, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 206, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 216, 10, 22, 12, 22, 14, 22, 219, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 225, 10, 23, 12, 23, 14, 23, 228, 11, 23, 3, 23, 5, 23, 231, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 238, 10, 24, 12, 24, 14, 24, 241, 11, 24, 3, 24, 7, 24, 244, 10, 24, 12, 24, 14, 24, 247, 11, 24, 3, 25, 3, 25, 5, 25, 251, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 267, 10, 27, 13, 27, 14, 27, 268, 3, 28, 3, 28, 3, 29, 3, 29, 5, 29, 275, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 288, 10, 31, 3, 31, 7, 31, 291, 10, 31, 12, 31, 14, 31, 294, 11, 31, 3, 32, 3, 32, 5, 32, 298, 10, 32, 3, 32, 3, 32, 3, 32, 5, 32, 303, 10, 32, 6, 32, 305, 10, 32, 13, 32, 14, 32, 306, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 7, 34, 324, 10, 34, 12, 34, 14, 34, 327, 11, 34, 5, 34, 329, 10, 34, 3, 35, 3, 35, 3, 35, 7, 35, 334, 10, 35, 12, 35, 14, 35, 337, 11, 35, 5, 35, 339, 10, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 353, 10, 36, 3, 36, 3, 36, 3, 36, 3, 36, 7, 36, 359, 10, 36, 12, 36, 14, 36, 362, 11, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 5, 39, 374, 10, 39, 3, 39, 2, 4, 42, 70, 40, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 3, 2, 33, 38, 3, 2, 39, 40, 2, 389, 2, 78, 3, 2, 2, 2, 4, 84, 3, 2, 2, 2, 6, 88, 3, 2, 2, 2, 8, 106, 3, 2, 2, 2, 10, 110, 3, 2, 2, 2, 12, 112, 3, 2, 2, 2, 14, 118, 3, 2, 2, 2, 16, 128, 3, 2, 2, 2, 18, 134, 3, 2, 2, 2, 20, 141, 3, 2, 2, 2, 22, 144, 3, 2, 2, 2, 24, 146, 3, 2, 2, 2, 26, 148, 3, 2, 2, 2, 28, 150, 3, 2, 2, 2, 30, 165, 3, 2, 2, 2, 32, 170, 3, 2, 2, 2, 34, 175, 3, 2, 2, 2, 36, 177, 3, 2, 2, 2, 38, 179, 3, 2, 2, 2, 40, 181, 3, 2, 2, 2, 42, 205, 3, 2, 2, 2, 44, 220, 3, 2, 2, 2, 46, 239, 3, 2, 2, 2, 48, 250, 3, 2, 2, 2, 50, 252, 3, 2, 2, 2, 52, 259, 3, 2, 2, 2, 54, 270, 3, 2, 2, 2, 56, 274, 3, 2, 2, 2, 58, 276, 3, 2, 2, 2, 60, 292, 3, 2, 2, 2, 62, 297, 3, 2, 2, 2, 64, 311, 3, 2, 2, 2, 66, 328, 3, 2, 2, 2, 68, 338, 3, 2, 2, 2, 70, 352, 3, 2, 2, 2, 72, 363, 3, 2, 2, 2, 74, 365, 3, 2, 2, 2, 76, 373, 3, 2, 2, 2, 78, 79, 5, 4, 3, 2, 79, 80, 7, 2, 2, 3, 80, 3, 3, 2, 2, 2, 81, 83, 5, 8, 5, 2, 82, 81, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 5, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 87, 89, 5, 8, 5, 2, 88, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 7, 3, 2, 2, 2, 92, 107, 5, 62, 32, 2, 93, 107, 5, 30, 16, 2, 94, 107, 5, 32, 17, 2, 95, 107, 5, 10, 6, 2, 96, 107, 5, 16, 9, 2, 97, 107, 5, 20, 11, 2, 98, 107, 5, 24, 13, 2, 99, 107, 5, 18, 10, 2, 100, 107, 5, 26, 14, 2, 101, 107, 5, 44, 23, 2, 102, 107, 5, 50, 26, 2, 103, 107, 5, 64, 33, 2, 104, 107, 5, 58, 30, 2, 105, 107, 5, 40, 21, 2, 106, 92, 3, 2, 2, 2, 106, 93, 3, 2, 2, 2, 106, 94, 3, 2, 2, 2, 106, 95, 3, 2, 2, 2, 106, 96, 3, 2, 2, 2, 106, 97, 3, 2, 2, 2, 106, 98, 3, 2, 2, 2, 106, 99, 3, 2, 2, 2, 106, 100, 3, 2, 2, 2, 106, 101, 3, 2, 2, 2, 106, 102, 3, 2, 2, 2, 106, 103, 3, 2, 2, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 9, 3, 2, 2, 2, 108, 111, 5, 12, 7, 2, 109, 111, 5, 14, 8, 2, 110, 108, 3, 2, 2, 2, 110, 109, 3, 2, 2, 2, 111, 11, 3, 2, 2, 2, 112, 113, 7, 3, 2, 2, 113, 114, 5, 70, 36, 2, 114, 115, 7, 4, 2, 2, 115, 116, 5, 6, 4, 2, 116, 117, 7, 5, 2, 2, 117, 13, 3, 2, 2, 2, 118, 119, 7, 3, 2, 2, 119, 120, 5, 70, 36, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 124, 7, 6, 2, 2, 124, 125, 7, 4, 2, 2, 125, 126, 5, 6, 4, 2, 126, 127, 7, 5, 2, 2, 127, 15, 3, 2, 2, 2, 128, 129, 7, 7, 2, 2, 129, 130, 5, 76, 39, 2, 130, 131, 7, 4, 2, 2, 131, 132, 5, 6, 4, 2, 132, 133, 7, 5, 2, 2, 133, 17, 3, 2, 2, 2, 134, 135, 7, 8, 2, 2, 135, 136, 7, 9, 2, 2, 136, 137, 5, 42, 22, 2, 137, 138, 7, 10, 2, 2, 138, 139, 5, 42, 22, 2, 139, 140, 7, 11, 2, 2, 140, 19, 3, 2, 2, 2, 141, 142, 5, 22, 12, 2, 142, 143, 5, 42, 22, 2, 143, 21, 3, 2, 2, 2, 144, 145, 9, 2, 2, 2, 145, 23, 3, 2, 2, 2, 146, 147, 9, 3, 2, 2, 147, 25, 3, 2, 2, 2, 148, 149, 7, 18, 2, 2, 149, 27, 3, 2, 2, 2, 150, 159, 7, 4, 2, 2, 151, 156, 5, 42, 22, 2, 152, 153, 7, 10, 2, 2, 153, 155, 5, 42, 22, 2, 154, 152, 3, 2, 2, 2, 155, 158, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 159, 151, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 162, 7, 5, 2, 2, 162, 29, 3, 2, 2, 2, 163, 166, 7, 44, 2, 2, 164, 166, 5, 52, 27, 2, 165, 163, 3, 2, 2, 2, 165, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 7, 19, 2, 2, 168, 169, 5, 42, 22, 2, 169, 31, 3, 2, 2, 2, 170, 171, 7, 20, 2, 2, 171, 172, 7, 9, 2, 2, 172, 173, 5, 42, 22, 2, 173, 174, 7, 11, 2, 2, 174, 33, 3, 2, 2, 2, 175, 176, 9, 4, 2, 2, 176, 35, 3, 2, 2, 2, 177, 178, 9, 5, 2, 2, 178, 37, 3, 2, 2, 2, 179, 180, 7, 29, 2, 2, 180, 39, 3, 2, 2, 2, 181, 190, 7, 21, 2, 2, 182, 187, 5, 42, 22, 2, 183, 184, 7, 10, 2, 2, 184, 186, 5, 42, 22, 2, 185, 183, 3, 2, 2, 2, 186, 189, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188, 191, 3, 2, 2, 2, 189, 187, 3, 2, 2, 2, 190, 182, 3, 2, 2, 2, 190, 191, 3, 2, 2, 2, 191, 41, 3, 2, 2, 2, 192, 193, 8, 22, 1, 2, 193, 194, 5, 38, 20, 2, 194, 195, 5, 42, 22, 8, 195, 206, 3, 2, 2, 2, 196, 197, 5, 56, 29, 2, 197, 198, 7, 19, 2, 2, 198, 199, 5, 42, 22, 5, 199, 206, 3, 2, 2, 2, 200, 201, 7, 9, 2, 2, 201, 202, 5, 42, 22, 2, 202, 203, 7, 11, 2, 2, 203, 206, 3, 2, 2, 2, 204, 206, 5, 76, 39, 2, 205, 192, 3, 2, 2, 2, 205, 196, 3, 2, 2, 2, 205, 200, 3, 2, 2, 2, 205, 204, 3, 2, 2, 2, 206, 217, 3, 2, 2, 2, 207, 208, 12, 7, 2, 2, 208, 209, 5, 34, 18, 2, 209, 210, 5, 42, 22, 8, 210, 216, 3, 2, 2, 2, 211, 212, 12, 6, 2, 2, 212, 213, 5, 36, 19, 2, 213, 214, 5, 42, 22, 7, 214, 216, 3, 2, 2, 2, 215, 207, 3, 2, 2, 2, 215, 211, 3, 2, 2, 2, 216, 219, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 43, 3, 2, 2, 2, 219, 217, 3, 2, 2, 2, 220, 221, 7, 22, 2, 2, 221, 230, 7, 44, 2, 2, 222, 226, 7, 9, 2, 2, 223, 225, 7, 44, 2, 2, 224, 223, 3, 2, 2, 2, 225, 228, 3, 2, 2, 2, 226, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 229, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 229, 231, 7, 11, 2, 2, 230, 222, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 233, 7, 23, 2, 2, 233, 234, 5, 46, 24, 2, 234, 235, 7, 24, 2, 2, 235, 45, 3, 2, 2, 2, 236, 238, 5, 48, 25, 2, 237, 236, 3, 2, 2, 2, 238, 241, 3, 2, 2, 2, 239, 237, 3, 2, 2, 2, 239, 240, 3, 2, 2, 2, 240, 245, 3, 2, 2, 2, 241, 239, 3, 2, 2, 2, 242, 244, 5, 64, 33, 2, 243, 242, 3, 2, 2, 2, 244, 247, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 245, 246, 3, 2, 2, 2, 246, 47, 3, 2, 2, 2, 247, 245, 3, 2, 2, 2, 248, 251, 5, 30, 16, 2, 249, 251, 5, 50, 26, 2, 250, 248, 3, 2, 2, 2, 250, 249, 3, 2, 2, 2, 251, 49, 3, 2, 2, 2, 252, 253, 5, 56, 29, 2, 253, 254, 7, 19, 2, 2, 254, 255, 7, 25, 2, 2, 255, 256, 7, 44, 2, 2, 256, 257, 7, 9, 2, 2, 257, 258, 7, 11, 2, 2, 258, 51, 3, 2, 2, 2, 259, 266, 5, 54, 28, 2, 260, 261, 7, 26, 2, 2, 261, 267, 7, 44, 2, 2, 262, 263, 7, 4, 2, 2, 263, 264, 5, 42, 22, 2, 264, 265, 7, 5, 2, 2, 265, 267, 3, 2, 2, 2, 266, 260, 3, 2, 2, 2, 266, 262, 3, 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 53, 3, 2, 2, 2, 270, 271, 7, 44, 2, 2, 271, 55, 3, 2, 2, 2, 272, 275, 7, 44, 2, 2, 273, 275, 5, 52, 27, 2, 274, 272, 3, 2, 2, 2, 274, 273, 3, 2, 2, 2, 275, 57, 3, 2, 2, 2, 276, 277, 5, 60, 31, 2, 277, 278, 7, 45, 2, 2, 278, 279, 7, 9, 2, 2, 279, 280, 5, 68, 35, 2, 280, 281, 7, 11, 2, 2, 281, 59, 3, 2, 2, 2, 282, 288, 7, 44, 2, 2, 283, 284, 7, 4, 2, 2, 284, 285, 5, 42, 22, 2, 285, 286, 7, 5, 2, 2, 286, 288, 3, 2, 2, 2, 287, 282, 3, 2, 2, 2, 287, 283, 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 289, 291, 7, 26, 2, 2, 290, 287, 3, 2, 2, 2, 291, 294, 3, 2, 2, 2, 292, 290, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 61, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 295, 298, 7, 44, 2, 2, 296, 298, 5, 52, 27, 2, 297, 295, 3, 2, 2, 2, 297, 296, 3, 2, 2, 2, 298, 304, 3, 2, 2, 2, 299, 302, 7, 10, 2, 2, 300, 303, 7, 44, 2, 2, 301, 303, 5, 52, 27, 2, 302, 300, 3, 2, 2, 2, 302, 301, 3, 2, 2, 2, 303, 305, 3, 2, 2, 2, 304, 299, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308, 309, 7, 19, 2, 2, 309, 310, 5, 58, 30, 2, 310, 63, 3, 2, 2, 2, 311, 312, 7, 27, 2, 2, 312, 313, 7, 45, 2, 2, 313, 314, 7, 9, 2, 2, 314, 315, 5, 66, 34, 2, 315, 316, 7, 11, 2, 2, 316, 317, 7, 23, 2, 2, 317, 318, 5, 6, 4, 2, 318, 319, 7, 24, 2, 2, 319, 65, 3, 2, 2, 2, 320, 325, 7, 44, 2, 2, 321, 322, 7, 10, 2, 2, 322, 324, 7, 44, 2, 2, 323, 321, 3, 2, 2, 2, 324, 327, 3, 2, 2, 2, 325, 323, 3, 2, 2, 2, 325, 326, 3, 2, 2, 2, 326, 329, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 328, 320, 3, 2, 2, 2, 328, 329, 3, 2, 2, 2, 329, 67, 3, 2, 2, 2, 330, 335, 5, 42, 22, 2, 331, 332, 7, 10, 2, 2, 332, 334, 5, 42, 22, 2, 333, 331, 3, 2, 2, 2, 334, 337, 3, 2, 2, 2, 335, 333, 3, 2, 2, 2, 335, 336, 3, 2, 2, 2, 336, 339, 3, 2, 2, 2, 337, 335, 3, 2, 2, 2, 338, 330, 3, 2, 2, 2, 338, 339, 3, 2, 2, 2, 339, 69, 3, 2, 2, 2, 340, 341, 8, 36, 1, 2, 341, 342, 7, 41, 2, 2, 342, 353, 5, 70, 36, 7, 343, 344, 5, 42, 22, 2, 344, 345, 5, 72, 37, 2, 345, 346, 5, 42, 22, 2, 346, 353, 3, 2, 2, 2, 347, 353, 7, 32, 2, 2, 348, 349, 7, 9, 2, 2, 349, 350, 5, 70, 36, 2, 350, 351, 7, 11, 2, 2, 351, 353, 3, 2, 2, 2, 352, 340, 3, 2, 2, 2, 352, 343, 3, 2, 2, 2, 352, 347, 3, 2, 2, 2, 352, 348, 3, 2, 2, 2, 353, 360, 3, 2, 2, 2, 354, 355, 12, 5, 2, 2, 355, 356, 5, 74, 38, 2, 356, 357, 5, 70, 36, 6, 357, 359, 3, 2, 2, 2, 358, 354, 3, 2, 2, 2, 359, 362, 3, 2, 2, 2, 360, 358, 3, 2, 2, 2, 360, 361, 3, 2, 2, 2, 361, 71, 3, 2, 2, 2, 362, 360, 3, 2, 2, 2, 363, 364, 9, 6, 2, 2, 364, 73, 3, 2, 2, 2, 365, 366, 9, 7, 2, 2, 366, 75, 3, 2, 2, 2, 367, 374, 7, 42, 2, 2, 368, 374, 7, 44, 2, 2, 369, 374, 5, 28, 15, 2, 370, 374, 5, 52, 27, 2, 371, 374, 5, 58, 30, 2, 372, 374, 7, 43, 2, 2, 373, 367, 3, 2, 2, 2, 373, 368, 3, 2, 2, 2, 373, 369, 3, 2, 2, 2, 373, 370, 3, 2, 2, 2, 373, 371, 3, 2, 2, 2, 373, 372, 3, 2, 2, 2, 374, 77, 3, 2, 2, 2, 34, 84, 90, 106, 110, 156, 159, 165, 187, 190, 205, 215, 217, 226, 230, 239, 245, 250, 266, 268, 274, 287, 292, 297, 302, 306, 325, 328, 335, 338, 352, 360, 373] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index adb33c7..513d565 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -26,155 +26,155 @@ def serializedATN(): buf.write("\20\3\20\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23") buf.write("\3\24\3\24\3\25\3\25\3\25\3\25\7\25\u00ba\n\25\f\25\16") buf.write("\25\u00bd\13\25\5\25\u00bf\n\25\3\26\3\26\3\26\3\26\3") - buf.write("\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\5\26") - buf.write("\u00cf\n\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\7") - buf.write("\26\u00d9\n\26\f\26\16\26\u00dc\13\26\3\27\3\27\3\27\3") - buf.write("\27\7\27\u00e2\n\27\f\27\16\27\u00e5\13\27\3\27\5\27\u00e8") - buf.write("\n\27\3\27\3\27\3\27\3\27\3\30\7\30\u00ef\n\30\f\30\16") - buf.write("\30\u00f2\13\30\3\30\7\30\u00f5\n\30\f\30\16\30\u00f8") - buf.write("\13\30\3\31\3\31\5\31\u00fc\n\31\3\32\3\32\3\32\3\32\3") - buf.write("\32\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\6\33") - buf.write("\u010c\n\33\r\33\16\33\u010d\3\34\3\34\3\35\3\35\5\35") - buf.write("\u0114\n\35\3\36\3\36\3\36\3\36\3\36\3\36\3\37\3\37\3") - buf.write("\37\3\37\3\37\5\37\u0121\n\37\3\37\7\37\u0124\n\37\f\37") - buf.write("\16\37\u0127\13\37\3 \3 \5 \u012b\n \3 \3 \3 \5 \u0130") - buf.write("\n \6 \u0132\n \r \16 \u0133\3 \3 \3 \3!\3!\3!\3!\3!\3") - buf.write("!\3!\3!\3!\3\"\3\"\3\"\7\"\u0145\n\"\f\"\16\"\u0148\13") - buf.write("\"\5\"\u014a\n\"\3#\3#\3#\7#\u014f\n#\f#\16#\u0152\13") - buf.write("#\5#\u0154\n#\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\5$\u0162") - buf.write("\n$\3$\3$\3$\3$\7$\u0168\n$\f$\16$\u016b\13$\3%\3%\3&") - buf.write("\3&\3\'\3\'\3\'\3\'\3\'\5\'\u0176\n\'\3\'\2\4*F(\2\4\6") - buf.write("\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\66") - buf.write("8:<>@BDFHJL\2\b\3\2\f\17\3\2\20\21\3\2\36\37\3\2\34\35") - buf.write("\3\2!&\3\2\'(\2\u0185\2N\3\2\2\2\4T\3\2\2\2\6X\3\2\2\2") - buf.write("\bj\3\2\2\2\nn\3\2\2\2\fp\3\2\2\2\16v\3\2\2\2\20\u0080") - buf.write("\3\2\2\2\22\u0086\3\2\2\2\24\u008d\3\2\2\2\26\u0090\3") - buf.write("\2\2\2\30\u0092\3\2\2\2\32\u0094\3\2\2\2\34\u0096\3\2") - buf.write("\2\2\36\u00a5\3\2\2\2 \u00aa\3\2\2\2\"\u00af\3\2\2\2$") - buf.write("\u00b1\3\2\2\2&\u00b3\3\2\2\2(\u00b5\3\2\2\2*\u00ce\3") - buf.write("\2\2\2,\u00dd\3\2\2\2.\u00f0\3\2\2\2\60\u00fb\3\2\2\2") - buf.write("\62\u00fd\3\2\2\2\64\u0104\3\2\2\2\66\u010f\3\2\2\28\u0113") - buf.write("\3\2\2\2:\u0115\3\2\2\2<\u0125\3\2\2\2>\u012a\3\2\2\2") - buf.write("@\u0138\3\2\2\2B\u0149\3\2\2\2D\u0153\3\2\2\2F\u0161\3") - buf.write("\2\2\2H\u016c\3\2\2\2J\u016e\3\2\2\2L\u0175\3\2\2\2NO") - buf.write("\5\4\3\2OP\7\2\2\3P\3\3\2\2\2QS\5\b\5\2RQ\3\2\2\2SV\3") - buf.write("\2\2\2TR\3\2\2\2TU\3\2\2\2U\5\3\2\2\2VT\3\2\2\2WY\5\b") - buf.write("\5\2XW\3\2\2\2YZ\3\2\2\2ZX\3\2\2\2Z[\3\2\2\2[\7\3\2\2") - buf.write("\2\\k\5> \2]k\5\36\20\2^k\5 \21\2_k\5\n\6\2`k\5\20\t\2") - buf.write("ak\5\24\13\2bk\5\30\r\2ck\5\22\n\2dk\5\32\16\2ek\5,\27") - buf.write("\2fk\5\62\32\2gk\5@!\2hk\5:\36\2ik\5(\25\2j\\\3\2\2\2") - buf.write("j]\3\2\2\2j^\3\2\2\2j_\3\2\2\2j`\3\2\2\2ja\3\2\2\2jb\3") - buf.write("\2\2\2jc\3\2\2\2jd\3\2\2\2je\3\2\2\2jf\3\2\2\2jg\3\2\2") - buf.write("\2jh\3\2\2\2ji\3\2\2\2k\t\3\2\2\2lo\5\f\7\2mo\5\16\b\2") - buf.write("nl\3\2\2\2nm\3\2\2\2o\13\3\2\2\2pq\7\3\2\2qr\5F$\2rs\7") - buf.write("\4\2\2st\5\6\4\2tu\7\5\2\2u\r\3\2\2\2vw\7\3\2\2wx\5F$") - buf.write("\2xy\7\4\2\2yz\5\6\4\2z{\7\5\2\2{|\7\6\2\2|}\7\4\2\2}") - buf.write("~\5\6\4\2~\177\7\5\2\2\177\17\3\2\2\2\u0080\u0081\7\7") - buf.write("\2\2\u0081\u0082\5L\'\2\u0082\u0083\7\4\2\2\u0083\u0084") - buf.write("\5\6\4\2\u0084\u0085\7\5\2\2\u0085\21\3\2\2\2\u0086\u0087") - buf.write("\7\b\2\2\u0087\u0088\7\t\2\2\u0088\u0089\5*\26\2\u0089") - buf.write("\u008a\7\n\2\2\u008a\u008b\5*\26\2\u008b\u008c\7\13\2") - buf.write("\2\u008c\23\3\2\2\2\u008d\u008e\5\26\f\2\u008e\u008f\5") - buf.write("*\26\2\u008f\25\3\2\2\2\u0090\u0091\t\2\2\2\u0091\27\3") - buf.write("\2\2\2\u0092\u0093\t\3\2\2\u0093\31\3\2\2\2\u0094\u0095") - buf.write("\7\22\2\2\u0095\33\3\2\2\2\u0096\u009f\7\4\2\2\u0097\u009c") - buf.write("\5*\26\2\u0098\u0099\7\n\2\2\u0099\u009b\5*\26\2\u009a") - buf.write("\u0098\3\2\2\2\u009b\u009e\3\2\2\2\u009c\u009a\3\2\2\2") - buf.write("\u009c\u009d\3\2\2\2\u009d\u00a0\3\2\2\2\u009e\u009c\3") - buf.write("\2\2\2\u009f\u0097\3\2\2\2\u009f\u00a0\3\2\2\2\u00a0\u00a1") - buf.write("\3\2\2\2\u00a1\u00a2\7\5\2\2\u00a2\35\3\2\2\2\u00a3\u00a6") - buf.write("\7,\2\2\u00a4\u00a6\5\64\33\2\u00a5\u00a3\3\2\2\2\u00a5") - buf.write("\u00a4\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7\u00a8\7\23\2") - buf.write("\2\u00a8\u00a9\5*\26\2\u00a9\37\3\2\2\2\u00aa\u00ab\7") - buf.write("\24\2\2\u00ab\u00ac\7\t\2\2\u00ac\u00ad\5*\26\2\u00ad") - buf.write("\u00ae\7\13\2\2\u00ae!\3\2\2\2\u00af\u00b0\t\4\2\2\u00b0") - buf.write("#\3\2\2\2\u00b1\u00b2\t\5\2\2\u00b2%\3\2\2\2\u00b3\u00b4") - buf.write("\7\35\2\2\u00b4\'\3\2\2\2\u00b5\u00be\7\25\2\2\u00b6\u00bb") - buf.write("\5*\26\2\u00b7\u00b8\7\n\2\2\u00b8\u00ba\5*\26\2\u00b9") - buf.write("\u00b7\3\2\2\2\u00ba\u00bd\3\2\2\2\u00bb\u00b9\3\2\2\2") - buf.write("\u00bb\u00bc\3\2\2\2\u00bc\u00bf\3\2\2\2\u00bd\u00bb\3") - buf.write("\2\2\2\u00be\u00b6\3\2\2\2\u00be\u00bf\3\2\2\2\u00bf)") - buf.write("\3\2\2\2\u00c0\u00c1\b\26\1\2\u00c1\u00c2\5&\24\2\u00c2") - buf.write("\u00c3\5*\26\t\u00c3\u00cf\3\2\2\2\u00c4\u00c5\58\35\2") - buf.write("\u00c5\u00c6\7\23\2\2\u00c6\u00c7\5*\26\6\u00c7\u00cf") - buf.write("\3\2\2\2\u00c8\u00cf\5:\36\2\u00c9\u00ca\7\t\2\2\u00ca") - buf.write("\u00cb\5*\26\2\u00cb\u00cc\7\13\2\2\u00cc\u00cf\3\2\2") - buf.write("\2\u00cd\u00cf\5L\'\2\u00ce\u00c0\3\2\2\2\u00ce\u00c4") - buf.write("\3\2\2\2\u00ce\u00c8\3\2\2\2\u00ce\u00c9\3\2\2\2\u00ce") - buf.write("\u00cd\3\2\2\2\u00cf\u00da\3\2\2\2\u00d0\u00d1\f\b\2\2") - buf.write("\u00d1\u00d2\5\"\22\2\u00d2\u00d3\5*\26\t\u00d3\u00d9") - buf.write("\3\2\2\2\u00d4\u00d5\f\7\2\2\u00d5\u00d6\5$\23\2\u00d6") - buf.write("\u00d7\5*\26\b\u00d7\u00d9\3\2\2\2\u00d8\u00d0\3\2\2\2") - buf.write("\u00d8\u00d4\3\2\2\2\u00d9\u00dc\3\2\2\2\u00da\u00d8\3") - buf.write("\2\2\2\u00da\u00db\3\2\2\2\u00db+\3\2\2\2\u00dc\u00da") - buf.write("\3\2\2\2\u00dd\u00de\7\26\2\2\u00de\u00e7\7,\2\2\u00df") - buf.write("\u00e3\7\t\2\2\u00e0\u00e2\7,\2\2\u00e1\u00e0\3\2\2\2") - buf.write("\u00e2\u00e5\3\2\2\2\u00e3\u00e1\3\2\2\2\u00e3\u00e4\3") - buf.write("\2\2\2\u00e4\u00e6\3\2\2\2\u00e5\u00e3\3\2\2\2\u00e6\u00e8") - buf.write("\7\13\2\2\u00e7\u00df\3\2\2\2\u00e7\u00e8\3\2\2\2\u00e8") - buf.write("\u00e9\3\2\2\2\u00e9\u00ea\7\27\2\2\u00ea\u00eb\5.\30") - buf.write("\2\u00eb\u00ec\7\30\2\2\u00ec-\3\2\2\2\u00ed\u00ef\5\60") - buf.write("\31\2\u00ee\u00ed\3\2\2\2\u00ef\u00f2\3\2\2\2\u00f0\u00ee") - buf.write("\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f6\3\2\2\2\u00f2") - buf.write("\u00f0\3\2\2\2\u00f3\u00f5\5@!\2\u00f4\u00f3\3\2\2\2\u00f5") - buf.write("\u00f8\3\2\2\2\u00f6\u00f4\3\2\2\2\u00f6\u00f7\3\2\2\2") - buf.write("\u00f7/\3\2\2\2\u00f8\u00f6\3\2\2\2\u00f9\u00fc\5\36\20") - buf.write("\2\u00fa\u00fc\5\62\32\2\u00fb\u00f9\3\2\2\2\u00fb\u00fa") - buf.write("\3\2\2\2\u00fc\61\3\2\2\2\u00fd\u00fe\58\35\2\u00fe\u00ff") - buf.write("\7\23\2\2\u00ff\u0100\7\31\2\2\u0100\u0101\7,\2\2\u0101") - buf.write("\u0102\7\t\2\2\u0102\u0103\7\13\2\2\u0103\63\3\2\2\2\u0104") - buf.write("\u010b\5\66\34\2\u0105\u0106\7\32\2\2\u0106\u010c\7,\2") - buf.write("\2\u0107\u0108\7\4\2\2\u0108\u0109\5*\26\2\u0109\u010a") - buf.write("\7\5\2\2\u010a\u010c\3\2\2\2\u010b\u0105\3\2\2\2\u010b") - buf.write("\u0107\3\2\2\2\u010c\u010d\3\2\2\2\u010d\u010b\3\2\2\2") - buf.write("\u010d\u010e\3\2\2\2\u010e\65\3\2\2\2\u010f\u0110\7,\2") - buf.write("\2\u0110\67\3\2\2\2\u0111\u0114\7,\2\2\u0112\u0114\5\64") - buf.write("\33\2\u0113\u0111\3\2\2\2\u0113\u0112\3\2\2\2\u01149\3") - buf.write("\2\2\2\u0115\u0116\5<\37\2\u0116\u0117\7-\2\2\u0117\u0118") - buf.write("\7\t\2\2\u0118\u0119\5D#\2\u0119\u011a\7\13\2\2\u011a") - buf.write(";\3\2\2\2\u011b\u0121\7,\2\2\u011c\u011d\7\4\2\2\u011d") - buf.write("\u011e\5*\26\2\u011e\u011f\7\5\2\2\u011f\u0121\3\2\2\2") - buf.write("\u0120\u011b\3\2\2\2\u0120\u011c\3\2\2\2\u0121\u0122\3") - buf.write("\2\2\2\u0122\u0124\7\32\2\2\u0123\u0120\3\2\2\2\u0124") - buf.write("\u0127\3\2\2\2\u0125\u0123\3\2\2\2\u0125\u0126\3\2\2\2") - buf.write("\u0126=\3\2\2\2\u0127\u0125\3\2\2\2\u0128\u012b\7,\2\2") - buf.write("\u0129\u012b\5\64\33\2\u012a\u0128\3\2\2\2\u012a\u0129") - buf.write("\3\2\2\2\u012b\u0131\3\2\2\2\u012c\u012f\7\n\2\2\u012d") - buf.write("\u0130\7,\2\2\u012e\u0130\5\64\33\2\u012f\u012d\3\2\2") - buf.write("\2\u012f\u012e\3\2\2\2\u0130\u0132\3\2\2\2\u0131\u012c") - buf.write("\3\2\2\2\u0132\u0133\3\2\2\2\u0133\u0131\3\2\2\2\u0133") - buf.write("\u0134\3\2\2\2\u0134\u0135\3\2\2\2\u0135\u0136\7\23\2") - buf.write("\2\u0136\u0137\5:\36\2\u0137?\3\2\2\2\u0138\u0139\7\33") - buf.write("\2\2\u0139\u013a\7-\2\2\u013a\u013b\7\t\2\2\u013b\u013c") - buf.write("\5B\"\2\u013c\u013d\7\13\2\2\u013d\u013e\7\27\2\2\u013e") - buf.write("\u013f\5\6\4\2\u013f\u0140\7\30\2\2\u0140A\3\2\2\2\u0141") - buf.write("\u0146\7,\2\2\u0142\u0143\7\n\2\2\u0143\u0145\7,\2\2\u0144") - buf.write("\u0142\3\2\2\2\u0145\u0148\3\2\2\2\u0146\u0144\3\2\2\2") - buf.write("\u0146\u0147\3\2\2\2\u0147\u014a\3\2\2\2\u0148\u0146\3") - buf.write("\2\2\2\u0149\u0141\3\2\2\2\u0149\u014a\3\2\2\2\u014aC") - buf.write("\3\2\2\2\u014b\u0150\5*\26\2\u014c\u014d\7\n\2\2\u014d") - buf.write("\u014f\5*\26\2\u014e\u014c\3\2\2\2\u014f\u0152\3\2\2\2") - buf.write("\u0150\u014e\3\2\2\2\u0150\u0151\3\2\2\2\u0151\u0154\3") - buf.write("\2\2\2\u0152\u0150\3\2\2\2\u0153\u014b\3\2\2\2\u0153\u0154") - buf.write("\3\2\2\2\u0154E\3\2\2\2\u0155\u0156\b$\1\2\u0156\u0157") - buf.write("\7)\2\2\u0157\u0162\5F$\7\u0158\u0159\5*\26\2\u0159\u015a") - buf.write("\5H%\2\u015a\u015b\5*\26\2\u015b\u0162\3\2\2\2\u015c\u0162") - buf.write("\7 \2\2\u015d\u015e\7\t\2\2\u015e\u015f\5F$\2\u015f\u0160") - buf.write("\7\13\2\2\u0160\u0162\3\2\2\2\u0161\u0155\3\2\2\2\u0161") - buf.write("\u0158\3\2\2\2\u0161\u015c\3\2\2\2\u0161\u015d\3\2\2\2") - buf.write("\u0162\u0169\3\2\2\2\u0163\u0164\f\5\2\2\u0164\u0165\5") - buf.write("J&\2\u0165\u0166\5F$\6\u0166\u0168\3\2\2\2\u0167\u0163") - buf.write("\3\2\2\2\u0168\u016b\3\2\2\2\u0169\u0167\3\2\2\2\u0169") - buf.write("\u016a\3\2\2\2\u016aG\3\2\2\2\u016b\u0169\3\2\2\2\u016c") - buf.write("\u016d\t\6\2\2\u016dI\3\2\2\2\u016e\u016f\t\7\2\2\u016f") - buf.write("K\3\2\2\2\u0170\u0176\7*\2\2\u0171\u0176\7,\2\2\u0172") - buf.write("\u0176\5\34\17\2\u0173\u0176\5\64\33\2\u0174\u0176\7+") - buf.write("\2\2\u0175\u0170\3\2\2\2\u0175\u0171\3\2\2\2\u0175\u0172") - buf.write("\3\2\2\2\u0175\u0173\3\2\2\2\u0175\u0174\3\2\2\2\u0176") - buf.write("M\3\2\2\2\"TZjn\u009c\u009f\u00a5\u00bb\u00be\u00ce\u00d8") - buf.write("\u00da\u00e3\u00e7\u00f0\u00f6\u00fb\u010b\u010d\u0113") - buf.write("\u0120\u0125\u012a\u012f\u0133\u0146\u0149\u0150\u0153") - buf.write("\u0161\u0169\u0175") + buf.write("\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u00ce") + buf.write("\n\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\7\26\u00d8") + buf.write("\n\26\f\26\16\26\u00db\13\26\3\27\3\27\3\27\3\27\7\27") + buf.write("\u00e1\n\27\f\27\16\27\u00e4\13\27\3\27\5\27\u00e7\n\27") + buf.write("\3\27\3\27\3\27\3\27\3\30\7\30\u00ee\n\30\f\30\16\30\u00f1") + buf.write("\13\30\3\30\7\30\u00f4\n\30\f\30\16\30\u00f7\13\30\3\31") + buf.write("\3\31\5\31\u00fb\n\31\3\32\3\32\3\32\3\32\3\32\3\32\3") + buf.write("\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\6\33\u010b\n\33") + buf.write("\r\33\16\33\u010c\3\34\3\34\3\35\3\35\5\35\u0113\n\35") + buf.write("\3\36\3\36\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37") + buf.write("\5\37\u0120\n\37\3\37\7\37\u0123\n\37\f\37\16\37\u0126") + buf.write("\13\37\3 \3 \5 \u012a\n \3 \3 \3 \5 \u012f\n \6 \u0131") + buf.write("\n \r \16 \u0132\3 \3 \3 \3!\3!\3!\3!\3!\3!\3!\3!\3!\3") + buf.write("\"\3\"\3\"\7\"\u0144\n\"\f\"\16\"\u0147\13\"\5\"\u0149") + buf.write("\n\"\3#\3#\3#\7#\u014e\n#\f#\16#\u0151\13#\5#\u0153\n") + buf.write("#\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\5$\u0161\n$\3$\3") + buf.write("$\3$\3$\7$\u0167\n$\f$\16$\u016a\13$\3%\3%\3&\3&\3\'\3") + buf.write("\'\3\'\3\'\3\'\3\'\5\'\u0176\n\'\3\'\2\4*F(\2\4\6\b\n") + buf.write("\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<") + buf.write(">@BDFHJL\2\b\3\2\f\17\3\2\20\21\3\2\36\37\3\2\34\35\3") + buf.write("\2!&\3\2\'(\2\u0185\2N\3\2\2\2\4T\3\2\2\2\6X\3\2\2\2\b") + buf.write("j\3\2\2\2\nn\3\2\2\2\fp\3\2\2\2\16v\3\2\2\2\20\u0080\3") + buf.write("\2\2\2\22\u0086\3\2\2\2\24\u008d\3\2\2\2\26\u0090\3\2") + buf.write("\2\2\30\u0092\3\2\2\2\32\u0094\3\2\2\2\34\u0096\3\2\2") + buf.write("\2\36\u00a5\3\2\2\2 \u00aa\3\2\2\2\"\u00af\3\2\2\2$\u00b1") + buf.write("\3\2\2\2&\u00b3\3\2\2\2(\u00b5\3\2\2\2*\u00cd\3\2\2\2") + buf.write(",\u00dc\3\2\2\2.\u00ef\3\2\2\2\60\u00fa\3\2\2\2\62\u00fc") + buf.write("\3\2\2\2\64\u0103\3\2\2\2\66\u010e\3\2\2\28\u0112\3\2") + buf.write("\2\2:\u0114\3\2\2\2<\u0124\3\2\2\2>\u0129\3\2\2\2@\u0137") + buf.write("\3\2\2\2B\u0148\3\2\2\2D\u0152\3\2\2\2F\u0160\3\2\2\2") + buf.write("H\u016b\3\2\2\2J\u016d\3\2\2\2L\u0175\3\2\2\2NO\5\4\3") + buf.write("\2OP\7\2\2\3P\3\3\2\2\2QS\5\b\5\2RQ\3\2\2\2SV\3\2\2\2") + buf.write("TR\3\2\2\2TU\3\2\2\2U\5\3\2\2\2VT\3\2\2\2WY\5\b\5\2XW") + buf.write("\3\2\2\2YZ\3\2\2\2ZX\3\2\2\2Z[\3\2\2\2[\7\3\2\2\2\\k\5") + buf.write("> \2]k\5\36\20\2^k\5 \21\2_k\5\n\6\2`k\5\20\t\2ak\5\24") + buf.write("\13\2bk\5\30\r\2ck\5\22\n\2dk\5\32\16\2ek\5,\27\2fk\5") + buf.write("\62\32\2gk\5@!\2hk\5:\36\2ik\5(\25\2j\\\3\2\2\2j]\3\2") + buf.write("\2\2j^\3\2\2\2j_\3\2\2\2j`\3\2\2\2ja\3\2\2\2jb\3\2\2\2") + buf.write("jc\3\2\2\2jd\3\2\2\2je\3\2\2\2jf\3\2\2\2jg\3\2\2\2jh\3") + buf.write("\2\2\2ji\3\2\2\2k\t\3\2\2\2lo\5\f\7\2mo\5\16\b\2nl\3\2") + buf.write("\2\2nm\3\2\2\2o\13\3\2\2\2pq\7\3\2\2qr\5F$\2rs\7\4\2\2") + buf.write("st\5\6\4\2tu\7\5\2\2u\r\3\2\2\2vw\7\3\2\2wx\5F$\2xy\7") + buf.write("\4\2\2yz\5\6\4\2z{\7\5\2\2{|\7\6\2\2|}\7\4\2\2}~\5\6\4") + buf.write("\2~\177\7\5\2\2\177\17\3\2\2\2\u0080\u0081\7\7\2\2\u0081") + buf.write("\u0082\5L\'\2\u0082\u0083\7\4\2\2\u0083\u0084\5\6\4\2") + buf.write("\u0084\u0085\7\5\2\2\u0085\21\3\2\2\2\u0086\u0087\7\b") + buf.write("\2\2\u0087\u0088\7\t\2\2\u0088\u0089\5*\26\2\u0089\u008a") + buf.write("\7\n\2\2\u008a\u008b\5*\26\2\u008b\u008c\7\13\2\2\u008c") + buf.write("\23\3\2\2\2\u008d\u008e\5\26\f\2\u008e\u008f\5*\26\2\u008f") + buf.write("\25\3\2\2\2\u0090\u0091\t\2\2\2\u0091\27\3\2\2\2\u0092") + buf.write("\u0093\t\3\2\2\u0093\31\3\2\2\2\u0094\u0095\7\22\2\2\u0095") + buf.write("\33\3\2\2\2\u0096\u009f\7\4\2\2\u0097\u009c\5*\26\2\u0098") + buf.write("\u0099\7\n\2\2\u0099\u009b\5*\26\2\u009a\u0098\3\2\2\2") + buf.write("\u009b\u009e\3\2\2\2\u009c\u009a\3\2\2\2\u009c\u009d\3") + buf.write("\2\2\2\u009d\u00a0\3\2\2\2\u009e\u009c\3\2\2\2\u009f\u0097") + buf.write("\3\2\2\2\u009f\u00a0\3\2\2\2\u00a0\u00a1\3\2\2\2\u00a1") + buf.write("\u00a2\7\5\2\2\u00a2\35\3\2\2\2\u00a3\u00a6\7,\2\2\u00a4") + buf.write("\u00a6\5\64\33\2\u00a5\u00a3\3\2\2\2\u00a5\u00a4\3\2\2") + buf.write("\2\u00a6\u00a7\3\2\2\2\u00a7\u00a8\7\23\2\2\u00a8\u00a9") + buf.write("\5*\26\2\u00a9\37\3\2\2\2\u00aa\u00ab\7\24\2\2\u00ab\u00ac") + buf.write("\7\t\2\2\u00ac\u00ad\5*\26\2\u00ad\u00ae\7\13\2\2\u00ae") + buf.write("!\3\2\2\2\u00af\u00b0\t\4\2\2\u00b0#\3\2\2\2\u00b1\u00b2") + buf.write("\t\5\2\2\u00b2%\3\2\2\2\u00b3\u00b4\7\35\2\2\u00b4\'\3") + buf.write("\2\2\2\u00b5\u00be\7\25\2\2\u00b6\u00bb\5*\26\2\u00b7") + buf.write("\u00b8\7\n\2\2\u00b8\u00ba\5*\26\2\u00b9\u00b7\3\2\2\2") + buf.write("\u00ba\u00bd\3\2\2\2\u00bb\u00b9\3\2\2\2\u00bb\u00bc\3") + buf.write("\2\2\2\u00bc\u00bf\3\2\2\2\u00bd\u00bb\3\2\2\2\u00be\u00b6") + buf.write("\3\2\2\2\u00be\u00bf\3\2\2\2\u00bf)\3\2\2\2\u00c0\u00c1") + buf.write("\b\26\1\2\u00c1\u00c2\5&\24\2\u00c2\u00c3\5*\26\b\u00c3") + buf.write("\u00ce\3\2\2\2\u00c4\u00c5\58\35\2\u00c5\u00c6\7\23\2") + buf.write("\2\u00c6\u00c7\5*\26\5\u00c7\u00ce\3\2\2\2\u00c8\u00c9") + buf.write("\7\t\2\2\u00c9\u00ca\5*\26\2\u00ca\u00cb\7\13\2\2\u00cb") + buf.write("\u00ce\3\2\2\2\u00cc\u00ce\5L\'\2\u00cd\u00c0\3\2\2\2") + buf.write("\u00cd\u00c4\3\2\2\2\u00cd\u00c8\3\2\2\2\u00cd\u00cc\3") + buf.write("\2\2\2\u00ce\u00d9\3\2\2\2\u00cf\u00d0\f\7\2\2\u00d0\u00d1") + buf.write("\5\"\22\2\u00d1\u00d2\5*\26\b\u00d2\u00d8\3\2\2\2\u00d3") + buf.write("\u00d4\f\6\2\2\u00d4\u00d5\5$\23\2\u00d5\u00d6\5*\26\7") + buf.write("\u00d6\u00d8\3\2\2\2\u00d7\u00cf\3\2\2\2\u00d7\u00d3\3") + buf.write("\2\2\2\u00d8\u00db\3\2\2\2\u00d9\u00d7\3\2\2\2\u00d9\u00da") + buf.write("\3\2\2\2\u00da+\3\2\2\2\u00db\u00d9\3\2\2\2\u00dc\u00dd") + buf.write("\7\26\2\2\u00dd\u00e6\7,\2\2\u00de\u00e2\7\t\2\2\u00df") + buf.write("\u00e1\7,\2\2\u00e0\u00df\3\2\2\2\u00e1\u00e4\3\2\2\2") + buf.write("\u00e2\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3\u00e5\3") + buf.write("\2\2\2\u00e4\u00e2\3\2\2\2\u00e5\u00e7\7\13\2\2\u00e6") + buf.write("\u00de\3\2\2\2\u00e6\u00e7\3\2\2\2\u00e7\u00e8\3\2\2\2") + buf.write("\u00e8\u00e9\7\27\2\2\u00e9\u00ea\5.\30\2\u00ea\u00eb") + buf.write("\7\30\2\2\u00eb-\3\2\2\2\u00ec\u00ee\5\60\31\2\u00ed\u00ec") + buf.write("\3\2\2\2\u00ee\u00f1\3\2\2\2\u00ef\u00ed\3\2\2\2\u00ef") + buf.write("\u00f0\3\2\2\2\u00f0\u00f5\3\2\2\2\u00f1\u00ef\3\2\2\2") + buf.write("\u00f2\u00f4\5@!\2\u00f3\u00f2\3\2\2\2\u00f4\u00f7\3\2") + buf.write("\2\2\u00f5\u00f3\3\2\2\2\u00f5\u00f6\3\2\2\2\u00f6/\3") + buf.write("\2\2\2\u00f7\u00f5\3\2\2\2\u00f8\u00fb\5\36\20\2\u00f9") + buf.write("\u00fb\5\62\32\2\u00fa\u00f8\3\2\2\2\u00fa\u00f9\3\2\2") + buf.write("\2\u00fb\61\3\2\2\2\u00fc\u00fd\58\35\2\u00fd\u00fe\7") + buf.write("\23\2\2\u00fe\u00ff\7\31\2\2\u00ff\u0100\7,\2\2\u0100") + buf.write("\u0101\7\t\2\2\u0101\u0102\7\13\2\2\u0102\63\3\2\2\2\u0103") + buf.write("\u010a\5\66\34\2\u0104\u0105\7\32\2\2\u0105\u010b\7,\2") + buf.write("\2\u0106\u0107\7\4\2\2\u0107\u0108\5*\26\2\u0108\u0109") + buf.write("\7\5\2\2\u0109\u010b\3\2\2\2\u010a\u0104\3\2\2\2\u010a") + buf.write("\u0106\3\2\2\2\u010b\u010c\3\2\2\2\u010c\u010a\3\2\2\2") + buf.write("\u010c\u010d\3\2\2\2\u010d\65\3\2\2\2\u010e\u010f\7,\2") + buf.write("\2\u010f\67\3\2\2\2\u0110\u0113\7,\2\2\u0111\u0113\5\64") + buf.write("\33\2\u0112\u0110\3\2\2\2\u0112\u0111\3\2\2\2\u01139\3") + buf.write("\2\2\2\u0114\u0115\5<\37\2\u0115\u0116\7-\2\2\u0116\u0117") + buf.write("\7\t\2\2\u0117\u0118\5D#\2\u0118\u0119\7\13\2\2\u0119") + buf.write(";\3\2\2\2\u011a\u0120\7,\2\2\u011b\u011c\7\4\2\2\u011c") + buf.write("\u011d\5*\26\2\u011d\u011e\7\5\2\2\u011e\u0120\3\2\2\2") + buf.write("\u011f\u011a\3\2\2\2\u011f\u011b\3\2\2\2\u0120\u0121\3") + buf.write("\2\2\2\u0121\u0123\7\32\2\2\u0122\u011f\3\2\2\2\u0123") + buf.write("\u0126\3\2\2\2\u0124\u0122\3\2\2\2\u0124\u0125\3\2\2\2") + buf.write("\u0125=\3\2\2\2\u0126\u0124\3\2\2\2\u0127\u012a\7,\2\2") + buf.write("\u0128\u012a\5\64\33\2\u0129\u0127\3\2\2\2\u0129\u0128") + buf.write("\3\2\2\2\u012a\u0130\3\2\2\2\u012b\u012e\7\n\2\2\u012c") + buf.write("\u012f\7,\2\2\u012d\u012f\5\64\33\2\u012e\u012c\3\2\2") + buf.write("\2\u012e\u012d\3\2\2\2\u012f\u0131\3\2\2\2\u0130\u012b") + buf.write("\3\2\2\2\u0131\u0132\3\2\2\2\u0132\u0130\3\2\2\2\u0132") + buf.write("\u0133\3\2\2\2\u0133\u0134\3\2\2\2\u0134\u0135\7\23\2") + buf.write("\2\u0135\u0136\5:\36\2\u0136?\3\2\2\2\u0137\u0138\7\33") + buf.write("\2\2\u0138\u0139\7-\2\2\u0139\u013a\7\t\2\2\u013a\u013b") + buf.write("\5B\"\2\u013b\u013c\7\13\2\2\u013c\u013d\7\27\2\2\u013d") + buf.write("\u013e\5\6\4\2\u013e\u013f\7\30\2\2\u013fA\3\2\2\2\u0140") + buf.write("\u0145\7,\2\2\u0141\u0142\7\n\2\2\u0142\u0144\7,\2\2\u0143") + buf.write("\u0141\3\2\2\2\u0144\u0147\3\2\2\2\u0145\u0143\3\2\2\2") + buf.write("\u0145\u0146\3\2\2\2\u0146\u0149\3\2\2\2\u0147\u0145\3") + buf.write("\2\2\2\u0148\u0140\3\2\2\2\u0148\u0149\3\2\2\2\u0149C") + buf.write("\3\2\2\2\u014a\u014f\5*\26\2\u014b\u014c\7\n\2\2\u014c") + buf.write("\u014e\5*\26\2\u014d\u014b\3\2\2\2\u014e\u0151\3\2\2\2") + buf.write("\u014f\u014d\3\2\2\2\u014f\u0150\3\2\2\2\u0150\u0153\3") + buf.write("\2\2\2\u0151\u014f\3\2\2\2\u0152\u014a\3\2\2\2\u0152\u0153") + buf.write("\3\2\2\2\u0153E\3\2\2\2\u0154\u0155\b$\1\2\u0155\u0156") + buf.write("\7)\2\2\u0156\u0161\5F$\7\u0157\u0158\5*\26\2\u0158\u0159") + buf.write("\5H%\2\u0159\u015a\5*\26\2\u015a\u0161\3\2\2\2\u015b\u0161") + buf.write("\7 \2\2\u015c\u015d\7\t\2\2\u015d\u015e\5F$\2\u015e\u015f") + buf.write("\7\13\2\2\u015f\u0161\3\2\2\2\u0160\u0154\3\2\2\2\u0160") + buf.write("\u0157\3\2\2\2\u0160\u015b\3\2\2\2\u0160\u015c\3\2\2\2") + buf.write("\u0161\u0168\3\2\2\2\u0162\u0163\f\5\2\2\u0163\u0164\5") + buf.write("J&\2\u0164\u0165\5F$\6\u0165\u0167\3\2\2\2\u0166\u0162") + buf.write("\3\2\2\2\u0167\u016a\3\2\2\2\u0168\u0166\3\2\2\2\u0168") + buf.write("\u0169\3\2\2\2\u0169G\3\2\2\2\u016a\u0168\3\2\2\2\u016b") + buf.write("\u016c\t\6\2\2\u016cI\3\2\2\2\u016d\u016e\t\7\2\2\u016e") + buf.write("K\3\2\2\2\u016f\u0176\7*\2\2\u0170\u0176\7,\2\2\u0171") + buf.write("\u0176\5\34\17\2\u0172\u0176\5\64\33\2\u0173\u0176\5:") + buf.write("\36\2\u0174\u0176\7+\2\2\u0175\u016f\3\2\2\2\u0175\u0170") + buf.write("\3\2\2\2\u0175\u0171\3\2\2\2\u0175\u0172\3\2\2\2\u0175") + buf.write("\u0173\3\2\2\2\u0175\u0174\3\2\2\2\u0176M\3\2\2\2\"TZ") + buf.write("jn\u009c\u009f\u00a5\u00bb\u00be\u00cd\u00d7\u00d9\u00e2") + buf.write("\u00e6\u00ef\u00f5\u00fa\u010a\u010c\u0112\u011f\u0124") + buf.write("\u0129\u012e\u0132\u0145\u0148\u014f\u0152\u0160\u0168") + buf.write("\u0175") return buf.getvalue() @@ -1515,23 +1515,6 @@ def accept(self, visitor:ParseTreeVisitor): return visitor.visitChildren(self) - class FunctionCallExprContext(ExpressionContext): - - def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext - super().__init__(parser) - self.copyFrom(ctx) - - def functionCall(self): - return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) - - - def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitFunctionCallExpr" ): - return visitor.visitFunctionCallExpr(self) - else: - return visitor.visitChildren(self) - - class MulExprContext(ExpressionContext): def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext @@ -1602,7 +1585,7 @@ def expression(self, _p:int=0): self.enterRecursionRule(localctx, 40, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 204 + self.state = 203 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,9,self._ctx) if la_ == 1: @@ -1613,7 +1596,7 @@ def expression(self, _p:int=0): self.state = 191 self.unaryArithOp() self.state = 192 - self.expression(7) + self.expression(6) pass elif la_ == 2: @@ -1625,40 +1608,32 @@ def expression(self, _p:int=0): self.state = 195 self.match(tlangParser.T__16) self.state = 196 - self.expression(4) + self.expression(3) pass elif la_ == 3: - localctx = tlangParser.FunctionCallExprContext(self, localctx) - self._ctx = localctx - _prevctx = localctx - self.state = 198 - self.functionCall() - pass - - elif la_ == 4: localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 199 + self.state = 198 self.match(tlangParser.T__6) - self.state = 200 + self.state = 199 self.expression(0) - self.state = 201 + self.state = 200 self.match(tlangParser.T__8) pass - elif la_ == 5: + elif la_ == 4: localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 203 + self.state = 202 self.value() pass self._ctx.stop = self._input.LT(-1) - self.state = 216 + self.state = 215 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,11,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -1666,37 +1641,37 @@ def expression(self, _p:int=0): if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 214 + self.state = 213 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,10,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 206 - if not self.precpred(self._ctx, 6): + self.state = 205 + if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException - raise FailedPredicateException(self, "self.precpred(self._ctx, 6)") - self.state = 207 + raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") + self.state = 206 self.multiplicative() - self.state = 208 - self.expression(7) + self.state = 207 + self.expression(6) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 210 - if not self.precpred(self._ctx, 5): + self.state = 209 + if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException - raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 211 + raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") + self.state = 210 self.additive() - self.state = 212 - self.expression(6) + self.state = 211 + self.expression(5) pass - self.state = 218 + self.state = 217 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,11,self._ctx) @@ -1744,35 +1719,35 @@ def classDeclaration(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 219 + self.state = 218 self.match(tlangParser.T__19) - self.state = 220 + self.state = 219 self.match(tlangParser.VAR) - self.state = 229 + self.state = 228 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.T__6: - self.state = 221 + self.state = 220 self.match(tlangParser.T__6) - self.state = 225 + self.state = 224 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 222 + self.state = 221 self.match(tlangParser.VAR) - self.state = 227 + self.state = 226 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 228 + self.state = 227 self.match(tlangParser.T__8) - self.state = 231 + self.state = 230 self.match(tlangParser.T__20) - self.state = 232 + self.state = 231 self.classBody() - self.state = 233 + self.state = 232 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -1822,23 +1797,23 @@ def classBody(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 238 + self.state = 237 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 235 + self.state = 234 self.classAttributeDeclaration() - self.state = 240 + self.state = 239 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 244 + self.state = 243 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__24: - self.state = 241 + self.state = 240 self.functionDeclaration() - self.state = 246 + self.state = 245 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1882,18 +1857,18 @@ def classAttributeDeclaration(self): localctx = tlangParser.ClassAttributeDeclarationContext(self, self._ctx, self.state) self.enterRule(localctx, 46, self.RULE_classAttributeDeclaration) try: - self.state = 249 + self.state = 248 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,16,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 247 + self.state = 246 self.assignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 248 + self.state = 247 self.objectInstantiation() pass @@ -1938,17 +1913,17 @@ def objectInstantiation(self): self.enterRule(localctx, 48, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 251 + self.state = 250 self.lvalue() - self.state = 252 + self.state = 251 self.match(tlangParser.T__16) - self.state = 253 + self.state = 252 self.match(tlangParser.T__22) - self.state = 254 + self.state = 253 self.match(tlangParser.VAR) - self.state = 255 + self.state = 254 self.match(tlangParser.T__6) - self.state = 256 + self.state = 255 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2000,28 +1975,28 @@ def objectOrArrayAccess(self): self.enterRule(localctx, 50, self.RULE_objectOrArrayAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 258 + self.state = 257 self.baseAccess() - self.state = 265 + self.state = 264 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 265 + self.state = 264 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__23]: - self.state = 259 + self.state = 258 self.match(tlangParser.T__23) - self.state = 260 + self.state = 259 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 261 + self.state = 260 self.match(tlangParser.T__1) - self.state = 262 + self.state = 261 self.expression(0) - self.state = 263 + self.state = 262 self.match(tlangParser.T__2) pass else: @@ -2030,7 +2005,7 @@ def objectOrArrayAccess(self): else: raise NoViableAltException(self) - self.state = 267 + self.state = 266 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,18,self._ctx) @@ -2070,7 +2045,7 @@ def baseAccess(self): self.enterRule(localctx, 52, self.RULE_baseAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 269 + self.state = 268 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -2111,18 +2086,18 @@ def lvalue(self): localctx = tlangParser.LvalueContext(self, self._ctx, self.state) self.enterRule(localctx, 54, self.RULE_lvalue) try: - self.state = 273 + self.state = 272 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,19,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 271 + self.state = 270 self.match(tlangParser.VAR) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 272 + self.state = 271 self.objectOrArrayAccess() pass @@ -2171,15 +2146,15 @@ def functionCall(self): self.enterRule(localctx, 56, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 275 + self.state = 274 self.methodCaller() - self.state = 276 + self.state = 275 self.match(tlangParser.NAME) - self.state = 277 + self.state = 276 self.match(tlangParser.T__6) - self.state = 278 + self.state = 277 self.arguments() - self.state = 279 + self.state = 278 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2228,31 +2203,31 @@ def methodCaller(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 291 + self.state = 290 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__1 or _la==tlangParser.VAR: - self.state = 286 + self.state = 285 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.VAR]: - self.state = 281 + self.state = 280 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 282 + self.state = 281 self.match(tlangParser.T__1) - self.state = 283 + self.state = 282 self.expression(0) - self.state = 284 + self.state = 283 self.match(tlangParser.T__2) pass else: raise NoViableAltException(self) - self.state = 288 + self.state = 287 self.match(tlangParser.T__23) - self.state = 293 + self.state = 292 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2307,49 +2282,49 @@ def functionCallWithReturnValues(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 296 + self.state = 295 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,22,self._ctx) if la_ == 1: - self.state = 294 + self.state = 293 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 295 + self.state = 294 self.objectOrArrayAccess() pass - self.state = 303 + self.state = 302 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 298 + self.state = 297 self.match(tlangParser.T__7) - self.state = 301 + self.state = 300 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,23,self._ctx) if la_ == 1: - self.state = 299 + self.state = 298 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 300 + self.state = 299 self.objectOrArrayAccess() pass - self.state = 305 + self.state = 304 self._errHandler.sync(self) _la = self._input.LA(1) if not (_la==tlangParser.T__7): break - self.state = 307 + self.state = 306 self.match(tlangParser.T__16) - self.state = 308 + self.state = 307 self.functionCall() except RecognitionException as re: localctx.exception = re @@ -2395,21 +2370,21 @@ def functionDeclaration(self): self.enterRule(localctx, 62, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 310 + self.state = 309 self.match(tlangParser.T__24) - self.state = 311 + self.state = 310 self.match(tlangParser.NAME) - self.state = 312 + self.state = 311 self.match(tlangParser.T__6) - self.state = 313 + self.state = 312 self.parameters() - self.state = 314 + self.state = 313 self.match(tlangParser.T__8) - self.state = 315 + self.state = 314 self.match(tlangParser.T__20) - self.state = 316 + self.state = 315 self.strict_ilist() - self.state = 317 + self.state = 316 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -2451,21 +2426,21 @@ def parameters(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 327 + self.state = 326 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.VAR: - self.state = 319 + self.state = 318 self.match(tlangParser.VAR) - self.state = 324 + self.state = 323 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 320 + self.state = 319 self.match(tlangParser.T__7) - self.state = 321 + self.state = 320 self.match(tlangParser.VAR) - self.state = 326 + self.state = 325 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2512,21 +2487,21 @@ def arguments(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 337 + self.state = 336 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 329 + self.state = 328 self.expression(0) - self.state = 334 + self.state = 333 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 330 + self.state = 329 self.match(tlangParser.T__7) - self.state = 331 + self.state = 330 self.expression(0) - self.state = 336 + self.state = 335 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2595,42 +2570,42 @@ def condition(self, _p:int=0): self.enterRecursionRule(localctx, 68, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 351 + self.state = 350 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,29,self._ctx) if la_ == 1: - self.state = 340 + self.state = 339 self.match(tlangParser.NOT) - self.state = 341 + self.state = 340 self.condition(5) pass elif la_ == 2: - self.state = 342 + self.state = 341 self.expression(0) - self.state = 343 + self.state = 342 self.binCondOp() - self.state = 344 + self.state = 343 self.expression(0) pass elif la_ == 3: - self.state = 346 + self.state = 345 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 347 + self.state = 346 self.match(tlangParser.T__6) - self.state = 348 + self.state = 347 self.condition(0) - self.state = 349 + self.state = 348 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 359 + self.state = 358 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,30,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -2640,15 +2615,15 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 353 + self.state = 352 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 354 + self.state = 353 self.logicOp() - self.state = 355 + self.state = 354 self.condition(4) - self.state = 361 + self.state = 360 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,30,self._ctx) @@ -2704,7 +2679,7 @@ def binCondOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 362 + self.state = 361 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2751,7 +2726,7 @@ def logicOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 364 + self.state = 363 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2787,6 +2762,10 @@ def objectOrArrayAccess(self): return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,0) + def functionCall(self): + return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) + + def REAL(self): return self.getToken(tlangParser.REAL, 0) @@ -2812,30 +2791,36 @@ def value(self): la_ = self._interp.adaptivePredict(self._input,31,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 366 + self.state = 365 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 367 + self.state = 366 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 368 + self.state = 367 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 369 + self.state = 368 self.objectOrArrayAccess() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) + self.state = 369 + self.functionCall() + pass + + elif la_ == 6: + self.enterOuterAlt(localctx, 6) self.state = 370 self.match(tlangParser.REAL) pass @@ -2864,11 +2849,11 @@ def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): def expression_sempred(self, localctx:ExpressionContext, predIndex:int): if predIndex == 0: - return self.precpred(self._ctx, 6) + return self.precpred(self._ctx, 5) if predIndex == 1: - return self.precpred(self._ctx, 5) + return self.precpred(self._ctx, 4) def condition_sempred(self, localctx:ConditionContext, predIndex:int): diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index 9a882a1..a127fdd 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -124,11 +124,6 @@ def visitAddExpr(self, ctx:tlangParser.AddExprContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#functionCallExpr. - def visitFunctionCallExpr(self, ctx:tlangParser.FunctionCallExprContext): - return self.visitChildren(ctx) - - # Visit a parse tree produced by tlangParser#mulExpr. def visitMulExpr(self, ctx:tlangParser.MulExprContext): return self.visitChildren(ctx) From 36a50be55d7e5d0272f22acdd4f5e442f37b1da4 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Fri, 21 Mar 2025 12:34:51 +0530 Subject: [PATCH 19/47] [bug fix] instance level attributes --- ChironCore/example/issues.txt | 2 +- ChironCore/interpreter.py | 42 ++- ChironCore/turtparse/tlang.g4 | 2 +- ChironCore/turtparse/tlang.interp | 2 +- ChironCore/turtparse/tlangParser.py | 536 ++++++++++++++-------------- 5 files changed, 300 insertions(+), 284 deletions(-) diff --git a/ChironCore/example/issues.txt b/ChironCore/example/issues.txt index 6661a2e..db982fb 100644 --- a/ChironCore/example/issues.txt +++ b/ChironCore/example/issues.txt @@ -5,6 +5,6 @@ 5. instruction_list can contain both function declaration and classDeclaration this can cause problems 6. Multiple class inheritance is not yet supported! 7. return is compulsory in function declaration -8. Solution to Avoid Unexpected Changes in Mutable Class Variables: use __init__ method during class declaration +8. Solution to Avoid Unexpected Changes in Mutable Class Variables: use __init__ method during class declaration [fixed] 9. Writing self is compulsory in methods of class parameters 10. class must have at least one assignment statement [fixed] \ No newline at end of file diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index e942f48..36940f6 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -243,30 +243,43 @@ def handleClassDeclaration(self, stmt, tgt): # Handle inheritance if base classes exist if hasattr(stmt, "baseClasses") and stmt.baseClasses: - # Build a comma-separated list of base classes. - # We assume the base classes are already stored in self.class_list. base_classes = [getattr(self.class_list, str( b).replace(":", "")) for b in stmt.baseClasses] base_str = ", ".join([b.__name__ for b in base_classes]) class_header = f"class {className}({base_str}):\n" - else: class_header = f"class {className}:\n" - class_def = class_header + " pass\n" # Ensure class has a valid body if no attributes + class_def = class_header + init_method = " def __init__(self" # Start of __init__ + init_body = "" + has_init_content = False # Track if __init__ has any assignments + + # Inherit instance attributes from base classes (left to right order) + if stmt.baseClasses: + init_body += " super().__init__()\n" + has_init_content = True - # Handle normal attributes + # Handle normal attributes (instance attributes) for attr in attributes: attr, target = attr attr_name = str(attr.lvar).replace(":", "") - attr_value = addContext(attr.rexpr) if attr.rexpr else None - class_def += f" {attr_name} = {attr_value}\n" + attr_value = addContext(attr.rexpr) if attr.rexpr else "None" + init_body += f" self.{attr_name} = {attr_value}\n" + has_init_content = True - # Handle object attributes (initialize to None first) + # Handle object attributes for objectAttr in stmt.objectAttributes: objectAttr, target = objectAttr lhs = str(objectAttr.target).replace(":", "") - class_def += f" {lhs} = None\n" + init_body += f" self.{lhs} = None\n" + has_init_content = True + + + + init_method += "):\n" # Close the __init__ method signature + class_def += init_method + class_def += init_body if has_init_content else " pass\n" print(class_def, "Class Definition") @@ -281,25 +294,16 @@ def handleClassDeclaration(self, stmt, tgt): "self.prg.", "self.class_list.") exec(f"self.class_list.{className}.{lhs} = {rhs}()") - # go through the function addresses dict and inherit the methods of base classes from right to left (order of inheritance) - # this is done by copying the function addresses of the base classes to the current class - # the name of the method should be the `className`+ @ + `methodName`. This can be achieved by first finding all the methods whose name - # starts with each of the base classes and only removing the classname part and updating it to the current class and creating one extra - # entry with the current class name and the method name + # Inherit methods from base classes (right to left order) temp_function_addresses = {} if stmt.baseClasses: for key, value in self.function_addresses.items(): key_parts = key.split("@") - print("Printing key parts: ", key_parts) - print("printing class name and base classes: ", - stmt.className, stmt.baseClasses) if key_parts[0] in reversed(stmt.baseClasses): new_key = stmt.className + "@" + key_parts[1] - print("Printing new key############################: ", new_key) temp_function_addresses[new_key] = value self.function_addresses.update(temp_function_addresses) - # print(f"Instance created: {lhs} -> {getattr(self.prg, lhs)}") print("Printing function addresses:[][][] ", self.function_addresses) return 1 diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index 64cd921..0b9ca91 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -77,7 +77,7 @@ expression : -classDeclaration : 'class' VAR ('(' (VAR)* ')')? '{' classBody '}' ; +classDeclaration : 'class' VAR ('(' VAR (',' (VAR)*)? ')')? '{' classBody '}' ; classBody : (classAttributeDeclaration)* (functionDeclaration)*; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index 275d099..6b9e0e0 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -134,4 +134,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 376, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 83, 10, 3, 12, 3, 14, 3, 86, 11, 3, 3, 4, 6, 4, 89, 10, 4, 13, 4, 14, 4, 90, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 107, 10, 5, 3, 6, 3, 6, 5, 6, 111, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 155, 10, 15, 12, 15, 14, 15, 158, 11, 15, 5, 15, 160, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 166, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 186, 10, 21, 12, 21, 14, 21, 189, 11, 21, 5, 21, 191, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 206, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 216, 10, 22, 12, 22, 14, 22, 219, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 225, 10, 23, 12, 23, 14, 23, 228, 11, 23, 3, 23, 5, 23, 231, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 238, 10, 24, 12, 24, 14, 24, 241, 11, 24, 3, 24, 7, 24, 244, 10, 24, 12, 24, 14, 24, 247, 11, 24, 3, 25, 3, 25, 5, 25, 251, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 267, 10, 27, 13, 27, 14, 27, 268, 3, 28, 3, 28, 3, 29, 3, 29, 5, 29, 275, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 288, 10, 31, 3, 31, 7, 31, 291, 10, 31, 12, 31, 14, 31, 294, 11, 31, 3, 32, 3, 32, 5, 32, 298, 10, 32, 3, 32, 3, 32, 3, 32, 5, 32, 303, 10, 32, 6, 32, 305, 10, 32, 13, 32, 14, 32, 306, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 7, 34, 324, 10, 34, 12, 34, 14, 34, 327, 11, 34, 5, 34, 329, 10, 34, 3, 35, 3, 35, 3, 35, 7, 35, 334, 10, 35, 12, 35, 14, 35, 337, 11, 35, 5, 35, 339, 10, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 353, 10, 36, 3, 36, 3, 36, 3, 36, 3, 36, 7, 36, 359, 10, 36, 12, 36, 14, 36, 362, 11, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 5, 39, 374, 10, 39, 3, 39, 2, 4, 42, 70, 40, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 3, 2, 33, 38, 3, 2, 39, 40, 2, 389, 2, 78, 3, 2, 2, 2, 4, 84, 3, 2, 2, 2, 6, 88, 3, 2, 2, 2, 8, 106, 3, 2, 2, 2, 10, 110, 3, 2, 2, 2, 12, 112, 3, 2, 2, 2, 14, 118, 3, 2, 2, 2, 16, 128, 3, 2, 2, 2, 18, 134, 3, 2, 2, 2, 20, 141, 3, 2, 2, 2, 22, 144, 3, 2, 2, 2, 24, 146, 3, 2, 2, 2, 26, 148, 3, 2, 2, 2, 28, 150, 3, 2, 2, 2, 30, 165, 3, 2, 2, 2, 32, 170, 3, 2, 2, 2, 34, 175, 3, 2, 2, 2, 36, 177, 3, 2, 2, 2, 38, 179, 3, 2, 2, 2, 40, 181, 3, 2, 2, 2, 42, 205, 3, 2, 2, 2, 44, 220, 3, 2, 2, 2, 46, 239, 3, 2, 2, 2, 48, 250, 3, 2, 2, 2, 50, 252, 3, 2, 2, 2, 52, 259, 3, 2, 2, 2, 54, 270, 3, 2, 2, 2, 56, 274, 3, 2, 2, 2, 58, 276, 3, 2, 2, 2, 60, 292, 3, 2, 2, 2, 62, 297, 3, 2, 2, 2, 64, 311, 3, 2, 2, 2, 66, 328, 3, 2, 2, 2, 68, 338, 3, 2, 2, 2, 70, 352, 3, 2, 2, 2, 72, 363, 3, 2, 2, 2, 74, 365, 3, 2, 2, 2, 76, 373, 3, 2, 2, 2, 78, 79, 5, 4, 3, 2, 79, 80, 7, 2, 2, 3, 80, 3, 3, 2, 2, 2, 81, 83, 5, 8, 5, 2, 82, 81, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 5, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 87, 89, 5, 8, 5, 2, 88, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 7, 3, 2, 2, 2, 92, 107, 5, 62, 32, 2, 93, 107, 5, 30, 16, 2, 94, 107, 5, 32, 17, 2, 95, 107, 5, 10, 6, 2, 96, 107, 5, 16, 9, 2, 97, 107, 5, 20, 11, 2, 98, 107, 5, 24, 13, 2, 99, 107, 5, 18, 10, 2, 100, 107, 5, 26, 14, 2, 101, 107, 5, 44, 23, 2, 102, 107, 5, 50, 26, 2, 103, 107, 5, 64, 33, 2, 104, 107, 5, 58, 30, 2, 105, 107, 5, 40, 21, 2, 106, 92, 3, 2, 2, 2, 106, 93, 3, 2, 2, 2, 106, 94, 3, 2, 2, 2, 106, 95, 3, 2, 2, 2, 106, 96, 3, 2, 2, 2, 106, 97, 3, 2, 2, 2, 106, 98, 3, 2, 2, 2, 106, 99, 3, 2, 2, 2, 106, 100, 3, 2, 2, 2, 106, 101, 3, 2, 2, 2, 106, 102, 3, 2, 2, 2, 106, 103, 3, 2, 2, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 9, 3, 2, 2, 2, 108, 111, 5, 12, 7, 2, 109, 111, 5, 14, 8, 2, 110, 108, 3, 2, 2, 2, 110, 109, 3, 2, 2, 2, 111, 11, 3, 2, 2, 2, 112, 113, 7, 3, 2, 2, 113, 114, 5, 70, 36, 2, 114, 115, 7, 4, 2, 2, 115, 116, 5, 6, 4, 2, 116, 117, 7, 5, 2, 2, 117, 13, 3, 2, 2, 2, 118, 119, 7, 3, 2, 2, 119, 120, 5, 70, 36, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 124, 7, 6, 2, 2, 124, 125, 7, 4, 2, 2, 125, 126, 5, 6, 4, 2, 126, 127, 7, 5, 2, 2, 127, 15, 3, 2, 2, 2, 128, 129, 7, 7, 2, 2, 129, 130, 5, 76, 39, 2, 130, 131, 7, 4, 2, 2, 131, 132, 5, 6, 4, 2, 132, 133, 7, 5, 2, 2, 133, 17, 3, 2, 2, 2, 134, 135, 7, 8, 2, 2, 135, 136, 7, 9, 2, 2, 136, 137, 5, 42, 22, 2, 137, 138, 7, 10, 2, 2, 138, 139, 5, 42, 22, 2, 139, 140, 7, 11, 2, 2, 140, 19, 3, 2, 2, 2, 141, 142, 5, 22, 12, 2, 142, 143, 5, 42, 22, 2, 143, 21, 3, 2, 2, 2, 144, 145, 9, 2, 2, 2, 145, 23, 3, 2, 2, 2, 146, 147, 9, 3, 2, 2, 147, 25, 3, 2, 2, 2, 148, 149, 7, 18, 2, 2, 149, 27, 3, 2, 2, 2, 150, 159, 7, 4, 2, 2, 151, 156, 5, 42, 22, 2, 152, 153, 7, 10, 2, 2, 153, 155, 5, 42, 22, 2, 154, 152, 3, 2, 2, 2, 155, 158, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 159, 151, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 162, 7, 5, 2, 2, 162, 29, 3, 2, 2, 2, 163, 166, 7, 44, 2, 2, 164, 166, 5, 52, 27, 2, 165, 163, 3, 2, 2, 2, 165, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 7, 19, 2, 2, 168, 169, 5, 42, 22, 2, 169, 31, 3, 2, 2, 2, 170, 171, 7, 20, 2, 2, 171, 172, 7, 9, 2, 2, 172, 173, 5, 42, 22, 2, 173, 174, 7, 11, 2, 2, 174, 33, 3, 2, 2, 2, 175, 176, 9, 4, 2, 2, 176, 35, 3, 2, 2, 2, 177, 178, 9, 5, 2, 2, 178, 37, 3, 2, 2, 2, 179, 180, 7, 29, 2, 2, 180, 39, 3, 2, 2, 2, 181, 190, 7, 21, 2, 2, 182, 187, 5, 42, 22, 2, 183, 184, 7, 10, 2, 2, 184, 186, 5, 42, 22, 2, 185, 183, 3, 2, 2, 2, 186, 189, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188, 191, 3, 2, 2, 2, 189, 187, 3, 2, 2, 2, 190, 182, 3, 2, 2, 2, 190, 191, 3, 2, 2, 2, 191, 41, 3, 2, 2, 2, 192, 193, 8, 22, 1, 2, 193, 194, 5, 38, 20, 2, 194, 195, 5, 42, 22, 8, 195, 206, 3, 2, 2, 2, 196, 197, 5, 56, 29, 2, 197, 198, 7, 19, 2, 2, 198, 199, 5, 42, 22, 5, 199, 206, 3, 2, 2, 2, 200, 201, 7, 9, 2, 2, 201, 202, 5, 42, 22, 2, 202, 203, 7, 11, 2, 2, 203, 206, 3, 2, 2, 2, 204, 206, 5, 76, 39, 2, 205, 192, 3, 2, 2, 2, 205, 196, 3, 2, 2, 2, 205, 200, 3, 2, 2, 2, 205, 204, 3, 2, 2, 2, 206, 217, 3, 2, 2, 2, 207, 208, 12, 7, 2, 2, 208, 209, 5, 34, 18, 2, 209, 210, 5, 42, 22, 8, 210, 216, 3, 2, 2, 2, 211, 212, 12, 6, 2, 2, 212, 213, 5, 36, 19, 2, 213, 214, 5, 42, 22, 7, 214, 216, 3, 2, 2, 2, 215, 207, 3, 2, 2, 2, 215, 211, 3, 2, 2, 2, 216, 219, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 43, 3, 2, 2, 2, 219, 217, 3, 2, 2, 2, 220, 221, 7, 22, 2, 2, 221, 230, 7, 44, 2, 2, 222, 226, 7, 9, 2, 2, 223, 225, 7, 44, 2, 2, 224, 223, 3, 2, 2, 2, 225, 228, 3, 2, 2, 2, 226, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 229, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 229, 231, 7, 11, 2, 2, 230, 222, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 233, 7, 23, 2, 2, 233, 234, 5, 46, 24, 2, 234, 235, 7, 24, 2, 2, 235, 45, 3, 2, 2, 2, 236, 238, 5, 48, 25, 2, 237, 236, 3, 2, 2, 2, 238, 241, 3, 2, 2, 2, 239, 237, 3, 2, 2, 2, 239, 240, 3, 2, 2, 2, 240, 245, 3, 2, 2, 2, 241, 239, 3, 2, 2, 2, 242, 244, 5, 64, 33, 2, 243, 242, 3, 2, 2, 2, 244, 247, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 245, 246, 3, 2, 2, 2, 246, 47, 3, 2, 2, 2, 247, 245, 3, 2, 2, 2, 248, 251, 5, 30, 16, 2, 249, 251, 5, 50, 26, 2, 250, 248, 3, 2, 2, 2, 250, 249, 3, 2, 2, 2, 251, 49, 3, 2, 2, 2, 252, 253, 5, 56, 29, 2, 253, 254, 7, 19, 2, 2, 254, 255, 7, 25, 2, 2, 255, 256, 7, 44, 2, 2, 256, 257, 7, 9, 2, 2, 257, 258, 7, 11, 2, 2, 258, 51, 3, 2, 2, 2, 259, 266, 5, 54, 28, 2, 260, 261, 7, 26, 2, 2, 261, 267, 7, 44, 2, 2, 262, 263, 7, 4, 2, 2, 263, 264, 5, 42, 22, 2, 264, 265, 7, 5, 2, 2, 265, 267, 3, 2, 2, 2, 266, 260, 3, 2, 2, 2, 266, 262, 3, 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 53, 3, 2, 2, 2, 270, 271, 7, 44, 2, 2, 271, 55, 3, 2, 2, 2, 272, 275, 7, 44, 2, 2, 273, 275, 5, 52, 27, 2, 274, 272, 3, 2, 2, 2, 274, 273, 3, 2, 2, 2, 275, 57, 3, 2, 2, 2, 276, 277, 5, 60, 31, 2, 277, 278, 7, 45, 2, 2, 278, 279, 7, 9, 2, 2, 279, 280, 5, 68, 35, 2, 280, 281, 7, 11, 2, 2, 281, 59, 3, 2, 2, 2, 282, 288, 7, 44, 2, 2, 283, 284, 7, 4, 2, 2, 284, 285, 5, 42, 22, 2, 285, 286, 7, 5, 2, 2, 286, 288, 3, 2, 2, 2, 287, 282, 3, 2, 2, 2, 287, 283, 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 289, 291, 7, 26, 2, 2, 290, 287, 3, 2, 2, 2, 291, 294, 3, 2, 2, 2, 292, 290, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 61, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 295, 298, 7, 44, 2, 2, 296, 298, 5, 52, 27, 2, 297, 295, 3, 2, 2, 2, 297, 296, 3, 2, 2, 2, 298, 304, 3, 2, 2, 2, 299, 302, 7, 10, 2, 2, 300, 303, 7, 44, 2, 2, 301, 303, 5, 52, 27, 2, 302, 300, 3, 2, 2, 2, 302, 301, 3, 2, 2, 2, 303, 305, 3, 2, 2, 2, 304, 299, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308, 309, 7, 19, 2, 2, 309, 310, 5, 58, 30, 2, 310, 63, 3, 2, 2, 2, 311, 312, 7, 27, 2, 2, 312, 313, 7, 45, 2, 2, 313, 314, 7, 9, 2, 2, 314, 315, 5, 66, 34, 2, 315, 316, 7, 11, 2, 2, 316, 317, 7, 23, 2, 2, 317, 318, 5, 6, 4, 2, 318, 319, 7, 24, 2, 2, 319, 65, 3, 2, 2, 2, 320, 325, 7, 44, 2, 2, 321, 322, 7, 10, 2, 2, 322, 324, 7, 44, 2, 2, 323, 321, 3, 2, 2, 2, 324, 327, 3, 2, 2, 2, 325, 323, 3, 2, 2, 2, 325, 326, 3, 2, 2, 2, 326, 329, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 328, 320, 3, 2, 2, 2, 328, 329, 3, 2, 2, 2, 329, 67, 3, 2, 2, 2, 330, 335, 5, 42, 22, 2, 331, 332, 7, 10, 2, 2, 332, 334, 5, 42, 22, 2, 333, 331, 3, 2, 2, 2, 334, 337, 3, 2, 2, 2, 335, 333, 3, 2, 2, 2, 335, 336, 3, 2, 2, 2, 336, 339, 3, 2, 2, 2, 337, 335, 3, 2, 2, 2, 338, 330, 3, 2, 2, 2, 338, 339, 3, 2, 2, 2, 339, 69, 3, 2, 2, 2, 340, 341, 8, 36, 1, 2, 341, 342, 7, 41, 2, 2, 342, 353, 5, 70, 36, 7, 343, 344, 5, 42, 22, 2, 344, 345, 5, 72, 37, 2, 345, 346, 5, 42, 22, 2, 346, 353, 3, 2, 2, 2, 347, 353, 7, 32, 2, 2, 348, 349, 7, 9, 2, 2, 349, 350, 5, 70, 36, 2, 350, 351, 7, 11, 2, 2, 351, 353, 3, 2, 2, 2, 352, 340, 3, 2, 2, 2, 352, 343, 3, 2, 2, 2, 352, 347, 3, 2, 2, 2, 352, 348, 3, 2, 2, 2, 353, 360, 3, 2, 2, 2, 354, 355, 12, 5, 2, 2, 355, 356, 5, 74, 38, 2, 356, 357, 5, 70, 36, 6, 357, 359, 3, 2, 2, 2, 358, 354, 3, 2, 2, 2, 359, 362, 3, 2, 2, 2, 360, 358, 3, 2, 2, 2, 360, 361, 3, 2, 2, 2, 361, 71, 3, 2, 2, 2, 362, 360, 3, 2, 2, 2, 363, 364, 9, 6, 2, 2, 364, 73, 3, 2, 2, 2, 365, 366, 9, 7, 2, 2, 366, 75, 3, 2, 2, 2, 367, 374, 7, 42, 2, 2, 368, 374, 7, 44, 2, 2, 369, 374, 5, 28, 15, 2, 370, 374, 5, 52, 27, 2, 371, 374, 5, 58, 30, 2, 372, 374, 7, 43, 2, 2, 373, 367, 3, 2, 2, 2, 373, 368, 3, 2, 2, 2, 373, 369, 3, 2, 2, 2, 373, 370, 3, 2, 2, 2, 373, 371, 3, 2, 2, 2, 373, 372, 3, 2, 2, 2, 374, 77, 3, 2, 2, 2, 34, 84, 90, 106, 110, 156, 159, 165, 187, 190, 205, 215, 217, 226, 230, 239, 245, 250, 266, 268, 274, 287, 292, 297, 302, 306, 325, 328, 335, 338, 352, 360, 373] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 380, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 83, 10, 3, 12, 3, 14, 3, 86, 11, 3, 3, 4, 6, 4, 89, 10, 4, 13, 4, 14, 4, 90, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 107, 10, 5, 3, 6, 3, 6, 5, 6, 111, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 155, 10, 15, 12, 15, 14, 15, 158, 11, 15, 5, 15, 160, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 166, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 186, 10, 21, 12, 21, 14, 21, 189, 11, 21, 5, 21, 191, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 206, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 216, 10, 22, 12, 22, 14, 22, 219, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 227, 10, 23, 12, 23, 14, 23, 230, 11, 23, 5, 23, 232, 10, 23, 3, 23, 5, 23, 235, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 242, 10, 24, 12, 24, 14, 24, 245, 11, 24, 3, 24, 7, 24, 248, 10, 24, 12, 24, 14, 24, 251, 11, 24, 3, 25, 3, 25, 5, 25, 255, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 271, 10, 27, 13, 27, 14, 27, 272, 3, 28, 3, 28, 3, 29, 3, 29, 5, 29, 279, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 292, 10, 31, 3, 31, 7, 31, 295, 10, 31, 12, 31, 14, 31, 298, 11, 31, 3, 32, 3, 32, 5, 32, 302, 10, 32, 3, 32, 3, 32, 3, 32, 5, 32, 307, 10, 32, 6, 32, 309, 10, 32, 13, 32, 14, 32, 310, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 7, 34, 328, 10, 34, 12, 34, 14, 34, 331, 11, 34, 5, 34, 333, 10, 34, 3, 35, 3, 35, 3, 35, 7, 35, 338, 10, 35, 12, 35, 14, 35, 341, 11, 35, 5, 35, 343, 10, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 357, 10, 36, 3, 36, 3, 36, 3, 36, 3, 36, 7, 36, 363, 10, 36, 12, 36, 14, 36, 366, 11, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 5, 39, 378, 10, 39, 3, 39, 2, 4, 42, 70, 40, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 3, 2, 33, 38, 3, 2, 39, 40, 2, 394, 2, 78, 3, 2, 2, 2, 4, 84, 3, 2, 2, 2, 6, 88, 3, 2, 2, 2, 8, 106, 3, 2, 2, 2, 10, 110, 3, 2, 2, 2, 12, 112, 3, 2, 2, 2, 14, 118, 3, 2, 2, 2, 16, 128, 3, 2, 2, 2, 18, 134, 3, 2, 2, 2, 20, 141, 3, 2, 2, 2, 22, 144, 3, 2, 2, 2, 24, 146, 3, 2, 2, 2, 26, 148, 3, 2, 2, 2, 28, 150, 3, 2, 2, 2, 30, 165, 3, 2, 2, 2, 32, 170, 3, 2, 2, 2, 34, 175, 3, 2, 2, 2, 36, 177, 3, 2, 2, 2, 38, 179, 3, 2, 2, 2, 40, 181, 3, 2, 2, 2, 42, 205, 3, 2, 2, 2, 44, 220, 3, 2, 2, 2, 46, 243, 3, 2, 2, 2, 48, 254, 3, 2, 2, 2, 50, 256, 3, 2, 2, 2, 52, 263, 3, 2, 2, 2, 54, 274, 3, 2, 2, 2, 56, 278, 3, 2, 2, 2, 58, 280, 3, 2, 2, 2, 60, 296, 3, 2, 2, 2, 62, 301, 3, 2, 2, 2, 64, 315, 3, 2, 2, 2, 66, 332, 3, 2, 2, 2, 68, 342, 3, 2, 2, 2, 70, 356, 3, 2, 2, 2, 72, 367, 3, 2, 2, 2, 74, 369, 3, 2, 2, 2, 76, 377, 3, 2, 2, 2, 78, 79, 5, 4, 3, 2, 79, 80, 7, 2, 2, 3, 80, 3, 3, 2, 2, 2, 81, 83, 5, 8, 5, 2, 82, 81, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 5, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 87, 89, 5, 8, 5, 2, 88, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 7, 3, 2, 2, 2, 92, 107, 5, 62, 32, 2, 93, 107, 5, 30, 16, 2, 94, 107, 5, 32, 17, 2, 95, 107, 5, 10, 6, 2, 96, 107, 5, 16, 9, 2, 97, 107, 5, 20, 11, 2, 98, 107, 5, 24, 13, 2, 99, 107, 5, 18, 10, 2, 100, 107, 5, 26, 14, 2, 101, 107, 5, 44, 23, 2, 102, 107, 5, 50, 26, 2, 103, 107, 5, 64, 33, 2, 104, 107, 5, 58, 30, 2, 105, 107, 5, 40, 21, 2, 106, 92, 3, 2, 2, 2, 106, 93, 3, 2, 2, 2, 106, 94, 3, 2, 2, 2, 106, 95, 3, 2, 2, 2, 106, 96, 3, 2, 2, 2, 106, 97, 3, 2, 2, 2, 106, 98, 3, 2, 2, 2, 106, 99, 3, 2, 2, 2, 106, 100, 3, 2, 2, 2, 106, 101, 3, 2, 2, 2, 106, 102, 3, 2, 2, 2, 106, 103, 3, 2, 2, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 9, 3, 2, 2, 2, 108, 111, 5, 12, 7, 2, 109, 111, 5, 14, 8, 2, 110, 108, 3, 2, 2, 2, 110, 109, 3, 2, 2, 2, 111, 11, 3, 2, 2, 2, 112, 113, 7, 3, 2, 2, 113, 114, 5, 70, 36, 2, 114, 115, 7, 4, 2, 2, 115, 116, 5, 6, 4, 2, 116, 117, 7, 5, 2, 2, 117, 13, 3, 2, 2, 2, 118, 119, 7, 3, 2, 2, 119, 120, 5, 70, 36, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 124, 7, 6, 2, 2, 124, 125, 7, 4, 2, 2, 125, 126, 5, 6, 4, 2, 126, 127, 7, 5, 2, 2, 127, 15, 3, 2, 2, 2, 128, 129, 7, 7, 2, 2, 129, 130, 5, 76, 39, 2, 130, 131, 7, 4, 2, 2, 131, 132, 5, 6, 4, 2, 132, 133, 7, 5, 2, 2, 133, 17, 3, 2, 2, 2, 134, 135, 7, 8, 2, 2, 135, 136, 7, 9, 2, 2, 136, 137, 5, 42, 22, 2, 137, 138, 7, 10, 2, 2, 138, 139, 5, 42, 22, 2, 139, 140, 7, 11, 2, 2, 140, 19, 3, 2, 2, 2, 141, 142, 5, 22, 12, 2, 142, 143, 5, 42, 22, 2, 143, 21, 3, 2, 2, 2, 144, 145, 9, 2, 2, 2, 145, 23, 3, 2, 2, 2, 146, 147, 9, 3, 2, 2, 147, 25, 3, 2, 2, 2, 148, 149, 7, 18, 2, 2, 149, 27, 3, 2, 2, 2, 150, 159, 7, 4, 2, 2, 151, 156, 5, 42, 22, 2, 152, 153, 7, 10, 2, 2, 153, 155, 5, 42, 22, 2, 154, 152, 3, 2, 2, 2, 155, 158, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 159, 151, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 162, 7, 5, 2, 2, 162, 29, 3, 2, 2, 2, 163, 166, 7, 44, 2, 2, 164, 166, 5, 52, 27, 2, 165, 163, 3, 2, 2, 2, 165, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 7, 19, 2, 2, 168, 169, 5, 42, 22, 2, 169, 31, 3, 2, 2, 2, 170, 171, 7, 20, 2, 2, 171, 172, 7, 9, 2, 2, 172, 173, 5, 42, 22, 2, 173, 174, 7, 11, 2, 2, 174, 33, 3, 2, 2, 2, 175, 176, 9, 4, 2, 2, 176, 35, 3, 2, 2, 2, 177, 178, 9, 5, 2, 2, 178, 37, 3, 2, 2, 2, 179, 180, 7, 29, 2, 2, 180, 39, 3, 2, 2, 2, 181, 190, 7, 21, 2, 2, 182, 187, 5, 42, 22, 2, 183, 184, 7, 10, 2, 2, 184, 186, 5, 42, 22, 2, 185, 183, 3, 2, 2, 2, 186, 189, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188, 191, 3, 2, 2, 2, 189, 187, 3, 2, 2, 2, 190, 182, 3, 2, 2, 2, 190, 191, 3, 2, 2, 2, 191, 41, 3, 2, 2, 2, 192, 193, 8, 22, 1, 2, 193, 194, 5, 38, 20, 2, 194, 195, 5, 42, 22, 8, 195, 206, 3, 2, 2, 2, 196, 197, 5, 56, 29, 2, 197, 198, 7, 19, 2, 2, 198, 199, 5, 42, 22, 5, 199, 206, 3, 2, 2, 2, 200, 201, 7, 9, 2, 2, 201, 202, 5, 42, 22, 2, 202, 203, 7, 11, 2, 2, 203, 206, 3, 2, 2, 2, 204, 206, 5, 76, 39, 2, 205, 192, 3, 2, 2, 2, 205, 196, 3, 2, 2, 2, 205, 200, 3, 2, 2, 2, 205, 204, 3, 2, 2, 2, 206, 217, 3, 2, 2, 2, 207, 208, 12, 7, 2, 2, 208, 209, 5, 34, 18, 2, 209, 210, 5, 42, 22, 8, 210, 216, 3, 2, 2, 2, 211, 212, 12, 6, 2, 2, 212, 213, 5, 36, 19, 2, 213, 214, 5, 42, 22, 7, 214, 216, 3, 2, 2, 2, 215, 207, 3, 2, 2, 2, 215, 211, 3, 2, 2, 2, 216, 219, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 43, 3, 2, 2, 2, 219, 217, 3, 2, 2, 2, 220, 221, 7, 22, 2, 2, 221, 234, 7, 44, 2, 2, 222, 223, 7, 9, 2, 2, 223, 231, 7, 44, 2, 2, 224, 228, 7, 10, 2, 2, 225, 227, 7, 44, 2, 2, 226, 225, 3, 2, 2, 2, 227, 230, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 232, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 231, 224, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 233, 3, 2, 2, 2, 233, 235, 7, 11, 2, 2, 234, 222, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 236, 3, 2, 2, 2, 236, 237, 7, 23, 2, 2, 237, 238, 5, 46, 24, 2, 238, 239, 7, 24, 2, 2, 239, 45, 3, 2, 2, 2, 240, 242, 5, 48, 25, 2, 241, 240, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 249, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 246, 248, 5, 64, 33, 2, 247, 246, 3, 2, 2, 2, 248, 251, 3, 2, 2, 2, 249, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 47, 3, 2, 2, 2, 251, 249, 3, 2, 2, 2, 252, 255, 5, 30, 16, 2, 253, 255, 5, 50, 26, 2, 254, 252, 3, 2, 2, 2, 254, 253, 3, 2, 2, 2, 255, 49, 3, 2, 2, 2, 256, 257, 5, 56, 29, 2, 257, 258, 7, 19, 2, 2, 258, 259, 7, 25, 2, 2, 259, 260, 7, 44, 2, 2, 260, 261, 7, 9, 2, 2, 261, 262, 7, 11, 2, 2, 262, 51, 3, 2, 2, 2, 263, 270, 5, 54, 28, 2, 264, 265, 7, 26, 2, 2, 265, 271, 7, 44, 2, 2, 266, 267, 7, 4, 2, 2, 267, 268, 5, 42, 22, 2, 268, 269, 7, 5, 2, 2, 269, 271, 3, 2, 2, 2, 270, 264, 3, 2, 2, 2, 270, 266, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 53, 3, 2, 2, 2, 274, 275, 7, 44, 2, 2, 275, 55, 3, 2, 2, 2, 276, 279, 7, 44, 2, 2, 277, 279, 5, 52, 27, 2, 278, 276, 3, 2, 2, 2, 278, 277, 3, 2, 2, 2, 279, 57, 3, 2, 2, 2, 280, 281, 5, 60, 31, 2, 281, 282, 7, 45, 2, 2, 282, 283, 7, 9, 2, 2, 283, 284, 5, 68, 35, 2, 284, 285, 7, 11, 2, 2, 285, 59, 3, 2, 2, 2, 286, 292, 7, 44, 2, 2, 287, 288, 7, 4, 2, 2, 288, 289, 5, 42, 22, 2, 289, 290, 7, 5, 2, 2, 290, 292, 3, 2, 2, 2, 291, 286, 3, 2, 2, 2, 291, 287, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 295, 7, 26, 2, 2, 294, 291, 3, 2, 2, 2, 295, 298, 3, 2, 2, 2, 296, 294, 3, 2, 2, 2, 296, 297, 3, 2, 2, 2, 297, 61, 3, 2, 2, 2, 298, 296, 3, 2, 2, 2, 299, 302, 7, 44, 2, 2, 300, 302, 5, 52, 27, 2, 301, 299, 3, 2, 2, 2, 301, 300, 3, 2, 2, 2, 302, 308, 3, 2, 2, 2, 303, 306, 7, 10, 2, 2, 304, 307, 7, 44, 2, 2, 305, 307, 5, 52, 27, 2, 306, 304, 3, 2, 2, 2, 306, 305, 3, 2, 2, 2, 307, 309, 3, 2, 2, 2, 308, 303, 3, 2, 2, 2, 309, 310, 3, 2, 2, 2, 310, 308, 3, 2, 2, 2, 310, 311, 3, 2, 2, 2, 311, 312, 3, 2, 2, 2, 312, 313, 7, 19, 2, 2, 313, 314, 5, 58, 30, 2, 314, 63, 3, 2, 2, 2, 315, 316, 7, 27, 2, 2, 316, 317, 7, 45, 2, 2, 317, 318, 7, 9, 2, 2, 318, 319, 5, 66, 34, 2, 319, 320, 7, 11, 2, 2, 320, 321, 7, 23, 2, 2, 321, 322, 5, 6, 4, 2, 322, 323, 7, 24, 2, 2, 323, 65, 3, 2, 2, 2, 324, 329, 7, 44, 2, 2, 325, 326, 7, 10, 2, 2, 326, 328, 7, 44, 2, 2, 327, 325, 3, 2, 2, 2, 328, 331, 3, 2, 2, 2, 329, 327, 3, 2, 2, 2, 329, 330, 3, 2, 2, 2, 330, 333, 3, 2, 2, 2, 331, 329, 3, 2, 2, 2, 332, 324, 3, 2, 2, 2, 332, 333, 3, 2, 2, 2, 333, 67, 3, 2, 2, 2, 334, 339, 5, 42, 22, 2, 335, 336, 7, 10, 2, 2, 336, 338, 5, 42, 22, 2, 337, 335, 3, 2, 2, 2, 338, 341, 3, 2, 2, 2, 339, 337, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 343, 3, 2, 2, 2, 341, 339, 3, 2, 2, 2, 342, 334, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 69, 3, 2, 2, 2, 344, 345, 8, 36, 1, 2, 345, 346, 7, 41, 2, 2, 346, 357, 5, 70, 36, 7, 347, 348, 5, 42, 22, 2, 348, 349, 5, 72, 37, 2, 349, 350, 5, 42, 22, 2, 350, 357, 3, 2, 2, 2, 351, 357, 7, 32, 2, 2, 352, 353, 7, 9, 2, 2, 353, 354, 5, 70, 36, 2, 354, 355, 7, 11, 2, 2, 355, 357, 3, 2, 2, 2, 356, 344, 3, 2, 2, 2, 356, 347, 3, 2, 2, 2, 356, 351, 3, 2, 2, 2, 356, 352, 3, 2, 2, 2, 357, 364, 3, 2, 2, 2, 358, 359, 12, 5, 2, 2, 359, 360, 5, 74, 38, 2, 360, 361, 5, 70, 36, 6, 361, 363, 3, 2, 2, 2, 362, 358, 3, 2, 2, 2, 363, 366, 3, 2, 2, 2, 364, 362, 3, 2, 2, 2, 364, 365, 3, 2, 2, 2, 365, 71, 3, 2, 2, 2, 366, 364, 3, 2, 2, 2, 367, 368, 9, 6, 2, 2, 368, 73, 3, 2, 2, 2, 369, 370, 9, 7, 2, 2, 370, 75, 3, 2, 2, 2, 371, 378, 7, 42, 2, 2, 372, 378, 7, 44, 2, 2, 373, 378, 5, 28, 15, 2, 374, 378, 5, 52, 27, 2, 375, 378, 5, 58, 30, 2, 376, 378, 7, 43, 2, 2, 377, 371, 3, 2, 2, 2, 377, 372, 3, 2, 2, 2, 377, 373, 3, 2, 2, 2, 377, 374, 3, 2, 2, 2, 377, 375, 3, 2, 2, 2, 377, 376, 3, 2, 2, 2, 378, 77, 3, 2, 2, 2, 35, 84, 90, 106, 110, 156, 159, 165, 187, 190, 205, 215, 217, 228, 231, 234, 243, 249, 254, 270, 272, 278, 291, 296, 301, 306, 310, 329, 332, 339, 342, 356, 364, 377] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index 513d565..7f90d2a 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -9,7 +9,7 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3.") - buf.write("\u0178\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\u017c\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") @@ -28,153 +28,155 @@ def serializedATN(): buf.write("\25\u00bd\13\25\5\25\u00bf\n\25\3\26\3\26\3\26\3\26\3") buf.write("\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u00ce") buf.write("\n\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\7\26\u00d8") - buf.write("\n\26\f\26\16\26\u00db\13\26\3\27\3\27\3\27\3\27\7\27") - buf.write("\u00e1\n\27\f\27\16\27\u00e4\13\27\3\27\5\27\u00e7\n\27") - buf.write("\3\27\3\27\3\27\3\27\3\30\7\30\u00ee\n\30\f\30\16\30\u00f1") - buf.write("\13\30\3\30\7\30\u00f4\n\30\f\30\16\30\u00f7\13\30\3\31") - buf.write("\3\31\5\31\u00fb\n\31\3\32\3\32\3\32\3\32\3\32\3\32\3") - buf.write("\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\6\33\u010b\n\33") - buf.write("\r\33\16\33\u010c\3\34\3\34\3\35\3\35\5\35\u0113\n\35") - buf.write("\3\36\3\36\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37") - buf.write("\5\37\u0120\n\37\3\37\7\37\u0123\n\37\f\37\16\37\u0126") - buf.write("\13\37\3 \3 \5 \u012a\n \3 \3 \3 \5 \u012f\n \6 \u0131") - buf.write("\n \r \16 \u0132\3 \3 \3 \3!\3!\3!\3!\3!\3!\3!\3!\3!\3") - buf.write("\"\3\"\3\"\7\"\u0144\n\"\f\"\16\"\u0147\13\"\5\"\u0149") - buf.write("\n\"\3#\3#\3#\7#\u014e\n#\f#\16#\u0151\13#\5#\u0153\n") - buf.write("#\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\5$\u0161\n$\3$\3") - buf.write("$\3$\3$\7$\u0167\n$\f$\16$\u016a\13$\3%\3%\3&\3&\3\'\3") - buf.write("\'\3\'\3\'\3\'\3\'\5\'\u0176\n\'\3\'\2\4*F(\2\4\6\b\n") - buf.write("\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<") - buf.write(">@BDFHJL\2\b\3\2\f\17\3\2\20\21\3\2\36\37\3\2\34\35\3") - buf.write("\2!&\3\2\'(\2\u0185\2N\3\2\2\2\4T\3\2\2\2\6X\3\2\2\2\b") - buf.write("j\3\2\2\2\nn\3\2\2\2\fp\3\2\2\2\16v\3\2\2\2\20\u0080\3") - buf.write("\2\2\2\22\u0086\3\2\2\2\24\u008d\3\2\2\2\26\u0090\3\2") - buf.write("\2\2\30\u0092\3\2\2\2\32\u0094\3\2\2\2\34\u0096\3\2\2") - buf.write("\2\36\u00a5\3\2\2\2 \u00aa\3\2\2\2\"\u00af\3\2\2\2$\u00b1") - buf.write("\3\2\2\2&\u00b3\3\2\2\2(\u00b5\3\2\2\2*\u00cd\3\2\2\2") - buf.write(",\u00dc\3\2\2\2.\u00ef\3\2\2\2\60\u00fa\3\2\2\2\62\u00fc") - buf.write("\3\2\2\2\64\u0103\3\2\2\2\66\u010e\3\2\2\28\u0112\3\2") - buf.write("\2\2:\u0114\3\2\2\2<\u0124\3\2\2\2>\u0129\3\2\2\2@\u0137") - buf.write("\3\2\2\2B\u0148\3\2\2\2D\u0152\3\2\2\2F\u0160\3\2\2\2") - buf.write("H\u016b\3\2\2\2J\u016d\3\2\2\2L\u0175\3\2\2\2NO\5\4\3") - buf.write("\2OP\7\2\2\3P\3\3\2\2\2QS\5\b\5\2RQ\3\2\2\2SV\3\2\2\2") - buf.write("TR\3\2\2\2TU\3\2\2\2U\5\3\2\2\2VT\3\2\2\2WY\5\b\5\2XW") - buf.write("\3\2\2\2YZ\3\2\2\2ZX\3\2\2\2Z[\3\2\2\2[\7\3\2\2\2\\k\5") - buf.write("> \2]k\5\36\20\2^k\5 \21\2_k\5\n\6\2`k\5\20\t\2ak\5\24") - buf.write("\13\2bk\5\30\r\2ck\5\22\n\2dk\5\32\16\2ek\5,\27\2fk\5") - buf.write("\62\32\2gk\5@!\2hk\5:\36\2ik\5(\25\2j\\\3\2\2\2j]\3\2") - buf.write("\2\2j^\3\2\2\2j_\3\2\2\2j`\3\2\2\2ja\3\2\2\2jb\3\2\2\2") - buf.write("jc\3\2\2\2jd\3\2\2\2je\3\2\2\2jf\3\2\2\2jg\3\2\2\2jh\3") - buf.write("\2\2\2ji\3\2\2\2k\t\3\2\2\2lo\5\f\7\2mo\5\16\b\2nl\3\2") - buf.write("\2\2nm\3\2\2\2o\13\3\2\2\2pq\7\3\2\2qr\5F$\2rs\7\4\2\2") - buf.write("st\5\6\4\2tu\7\5\2\2u\r\3\2\2\2vw\7\3\2\2wx\5F$\2xy\7") - buf.write("\4\2\2yz\5\6\4\2z{\7\5\2\2{|\7\6\2\2|}\7\4\2\2}~\5\6\4") - buf.write("\2~\177\7\5\2\2\177\17\3\2\2\2\u0080\u0081\7\7\2\2\u0081") - buf.write("\u0082\5L\'\2\u0082\u0083\7\4\2\2\u0083\u0084\5\6\4\2") - buf.write("\u0084\u0085\7\5\2\2\u0085\21\3\2\2\2\u0086\u0087\7\b") - buf.write("\2\2\u0087\u0088\7\t\2\2\u0088\u0089\5*\26\2\u0089\u008a") - buf.write("\7\n\2\2\u008a\u008b\5*\26\2\u008b\u008c\7\13\2\2\u008c") - buf.write("\23\3\2\2\2\u008d\u008e\5\26\f\2\u008e\u008f\5*\26\2\u008f") - buf.write("\25\3\2\2\2\u0090\u0091\t\2\2\2\u0091\27\3\2\2\2\u0092") - buf.write("\u0093\t\3\2\2\u0093\31\3\2\2\2\u0094\u0095\7\22\2\2\u0095") - buf.write("\33\3\2\2\2\u0096\u009f\7\4\2\2\u0097\u009c\5*\26\2\u0098") - buf.write("\u0099\7\n\2\2\u0099\u009b\5*\26\2\u009a\u0098\3\2\2\2") - buf.write("\u009b\u009e\3\2\2\2\u009c\u009a\3\2\2\2\u009c\u009d\3") - buf.write("\2\2\2\u009d\u00a0\3\2\2\2\u009e\u009c\3\2\2\2\u009f\u0097") - buf.write("\3\2\2\2\u009f\u00a0\3\2\2\2\u00a0\u00a1\3\2\2\2\u00a1") - buf.write("\u00a2\7\5\2\2\u00a2\35\3\2\2\2\u00a3\u00a6\7,\2\2\u00a4") - buf.write("\u00a6\5\64\33\2\u00a5\u00a3\3\2\2\2\u00a5\u00a4\3\2\2") - buf.write("\2\u00a6\u00a7\3\2\2\2\u00a7\u00a8\7\23\2\2\u00a8\u00a9") - buf.write("\5*\26\2\u00a9\37\3\2\2\2\u00aa\u00ab\7\24\2\2\u00ab\u00ac") - buf.write("\7\t\2\2\u00ac\u00ad\5*\26\2\u00ad\u00ae\7\13\2\2\u00ae") - buf.write("!\3\2\2\2\u00af\u00b0\t\4\2\2\u00b0#\3\2\2\2\u00b1\u00b2") - buf.write("\t\5\2\2\u00b2%\3\2\2\2\u00b3\u00b4\7\35\2\2\u00b4\'\3") - buf.write("\2\2\2\u00b5\u00be\7\25\2\2\u00b6\u00bb\5*\26\2\u00b7") - buf.write("\u00b8\7\n\2\2\u00b8\u00ba\5*\26\2\u00b9\u00b7\3\2\2\2") - buf.write("\u00ba\u00bd\3\2\2\2\u00bb\u00b9\3\2\2\2\u00bb\u00bc\3") - buf.write("\2\2\2\u00bc\u00bf\3\2\2\2\u00bd\u00bb\3\2\2\2\u00be\u00b6") - buf.write("\3\2\2\2\u00be\u00bf\3\2\2\2\u00bf)\3\2\2\2\u00c0\u00c1") - buf.write("\b\26\1\2\u00c1\u00c2\5&\24\2\u00c2\u00c3\5*\26\b\u00c3") - buf.write("\u00ce\3\2\2\2\u00c4\u00c5\58\35\2\u00c5\u00c6\7\23\2") - buf.write("\2\u00c6\u00c7\5*\26\5\u00c7\u00ce\3\2\2\2\u00c8\u00c9") - buf.write("\7\t\2\2\u00c9\u00ca\5*\26\2\u00ca\u00cb\7\13\2\2\u00cb") - buf.write("\u00ce\3\2\2\2\u00cc\u00ce\5L\'\2\u00cd\u00c0\3\2\2\2") - buf.write("\u00cd\u00c4\3\2\2\2\u00cd\u00c8\3\2\2\2\u00cd\u00cc\3") - buf.write("\2\2\2\u00ce\u00d9\3\2\2\2\u00cf\u00d0\f\7\2\2\u00d0\u00d1") - buf.write("\5\"\22\2\u00d1\u00d2\5*\26\b\u00d2\u00d8\3\2\2\2\u00d3") - buf.write("\u00d4\f\6\2\2\u00d4\u00d5\5$\23\2\u00d5\u00d6\5*\26\7") - buf.write("\u00d6\u00d8\3\2\2\2\u00d7\u00cf\3\2\2\2\u00d7\u00d3\3") - buf.write("\2\2\2\u00d8\u00db\3\2\2\2\u00d9\u00d7\3\2\2\2\u00d9\u00da") - buf.write("\3\2\2\2\u00da+\3\2\2\2\u00db\u00d9\3\2\2\2\u00dc\u00dd") - buf.write("\7\26\2\2\u00dd\u00e6\7,\2\2\u00de\u00e2\7\t\2\2\u00df") - buf.write("\u00e1\7,\2\2\u00e0\u00df\3\2\2\2\u00e1\u00e4\3\2\2\2") - buf.write("\u00e2\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3\u00e5\3") - buf.write("\2\2\2\u00e4\u00e2\3\2\2\2\u00e5\u00e7\7\13\2\2\u00e6") - buf.write("\u00de\3\2\2\2\u00e6\u00e7\3\2\2\2\u00e7\u00e8\3\2\2\2") - buf.write("\u00e8\u00e9\7\27\2\2\u00e9\u00ea\5.\30\2\u00ea\u00eb") - buf.write("\7\30\2\2\u00eb-\3\2\2\2\u00ec\u00ee\5\60\31\2\u00ed\u00ec") - buf.write("\3\2\2\2\u00ee\u00f1\3\2\2\2\u00ef\u00ed\3\2\2\2\u00ef") - buf.write("\u00f0\3\2\2\2\u00f0\u00f5\3\2\2\2\u00f1\u00ef\3\2\2\2") - buf.write("\u00f2\u00f4\5@!\2\u00f3\u00f2\3\2\2\2\u00f4\u00f7\3\2") - buf.write("\2\2\u00f5\u00f3\3\2\2\2\u00f5\u00f6\3\2\2\2\u00f6/\3") - buf.write("\2\2\2\u00f7\u00f5\3\2\2\2\u00f8\u00fb\5\36\20\2\u00f9") - buf.write("\u00fb\5\62\32\2\u00fa\u00f8\3\2\2\2\u00fa\u00f9\3\2\2") - buf.write("\2\u00fb\61\3\2\2\2\u00fc\u00fd\58\35\2\u00fd\u00fe\7") - buf.write("\23\2\2\u00fe\u00ff\7\31\2\2\u00ff\u0100\7,\2\2\u0100") - buf.write("\u0101\7\t\2\2\u0101\u0102\7\13\2\2\u0102\63\3\2\2\2\u0103") - buf.write("\u010a\5\66\34\2\u0104\u0105\7\32\2\2\u0105\u010b\7,\2") - buf.write("\2\u0106\u0107\7\4\2\2\u0107\u0108\5*\26\2\u0108\u0109") - buf.write("\7\5\2\2\u0109\u010b\3\2\2\2\u010a\u0104\3\2\2\2\u010a") - buf.write("\u0106\3\2\2\2\u010b\u010c\3\2\2\2\u010c\u010a\3\2\2\2") - buf.write("\u010c\u010d\3\2\2\2\u010d\65\3\2\2\2\u010e\u010f\7,\2") - buf.write("\2\u010f\67\3\2\2\2\u0110\u0113\7,\2\2\u0111\u0113\5\64") - buf.write("\33\2\u0112\u0110\3\2\2\2\u0112\u0111\3\2\2\2\u01139\3") - buf.write("\2\2\2\u0114\u0115\5<\37\2\u0115\u0116\7-\2\2\u0116\u0117") - buf.write("\7\t\2\2\u0117\u0118\5D#\2\u0118\u0119\7\13\2\2\u0119") - buf.write(";\3\2\2\2\u011a\u0120\7,\2\2\u011b\u011c\7\4\2\2\u011c") - buf.write("\u011d\5*\26\2\u011d\u011e\7\5\2\2\u011e\u0120\3\2\2\2") - buf.write("\u011f\u011a\3\2\2\2\u011f\u011b\3\2\2\2\u0120\u0121\3") - buf.write("\2\2\2\u0121\u0123\7\32\2\2\u0122\u011f\3\2\2\2\u0123") - buf.write("\u0126\3\2\2\2\u0124\u0122\3\2\2\2\u0124\u0125\3\2\2\2") - buf.write("\u0125=\3\2\2\2\u0126\u0124\3\2\2\2\u0127\u012a\7,\2\2") - buf.write("\u0128\u012a\5\64\33\2\u0129\u0127\3\2\2\2\u0129\u0128") - buf.write("\3\2\2\2\u012a\u0130\3\2\2\2\u012b\u012e\7\n\2\2\u012c") - buf.write("\u012f\7,\2\2\u012d\u012f\5\64\33\2\u012e\u012c\3\2\2") - buf.write("\2\u012e\u012d\3\2\2\2\u012f\u0131\3\2\2\2\u0130\u012b") - buf.write("\3\2\2\2\u0131\u0132\3\2\2\2\u0132\u0130\3\2\2\2\u0132") - buf.write("\u0133\3\2\2\2\u0133\u0134\3\2\2\2\u0134\u0135\7\23\2") - buf.write("\2\u0135\u0136\5:\36\2\u0136?\3\2\2\2\u0137\u0138\7\33") - buf.write("\2\2\u0138\u0139\7-\2\2\u0139\u013a\7\t\2\2\u013a\u013b") - buf.write("\5B\"\2\u013b\u013c\7\13\2\2\u013c\u013d\7\27\2\2\u013d") - buf.write("\u013e\5\6\4\2\u013e\u013f\7\30\2\2\u013fA\3\2\2\2\u0140") - buf.write("\u0145\7,\2\2\u0141\u0142\7\n\2\2\u0142\u0144\7,\2\2\u0143") - buf.write("\u0141\3\2\2\2\u0144\u0147\3\2\2\2\u0145\u0143\3\2\2\2") - buf.write("\u0145\u0146\3\2\2\2\u0146\u0149\3\2\2\2\u0147\u0145\3") - buf.write("\2\2\2\u0148\u0140\3\2\2\2\u0148\u0149\3\2\2\2\u0149C") - buf.write("\3\2\2\2\u014a\u014f\5*\26\2\u014b\u014c\7\n\2\2\u014c") - buf.write("\u014e\5*\26\2\u014d\u014b\3\2\2\2\u014e\u0151\3\2\2\2") - buf.write("\u014f\u014d\3\2\2\2\u014f\u0150\3\2\2\2\u0150\u0153\3") - buf.write("\2\2\2\u0151\u014f\3\2\2\2\u0152\u014a\3\2\2\2\u0152\u0153") - buf.write("\3\2\2\2\u0153E\3\2\2\2\u0154\u0155\b$\1\2\u0155\u0156") - buf.write("\7)\2\2\u0156\u0161\5F$\7\u0157\u0158\5*\26\2\u0158\u0159") - buf.write("\5H%\2\u0159\u015a\5*\26\2\u015a\u0161\3\2\2\2\u015b\u0161") - buf.write("\7 \2\2\u015c\u015d\7\t\2\2\u015d\u015e\5F$\2\u015e\u015f") - buf.write("\7\13\2\2\u015f\u0161\3\2\2\2\u0160\u0154\3\2\2\2\u0160") - buf.write("\u0157\3\2\2\2\u0160\u015b\3\2\2\2\u0160\u015c\3\2\2\2") - buf.write("\u0161\u0168\3\2\2\2\u0162\u0163\f\5\2\2\u0163\u0164\5") - buf.write("J&\2\u0164\u0165\5F$\6\u0165\u0167\3\2\2\2\u0166\u0162") - buf.write("\3\2\2\2\u0167\u016a\3\2\2\2\u0168\u0166\3\2\2\2\u0168") - buf.write("\u0169\3\2\2\2\u0169G\3\2\2\2\u016a\u0168\3\2\2\2\u016b") - buf.write("\u016c\t\6\2\2\u016cI\3\2\2\2\u016d\u016e\t\7\2\2\u016e") - buf.write("K\3\2\2\2\u016f\u0176\7*\2\2\u0170\u0176\7,\2\2\u0171") - buf.write("\u0176\5\34\17\2\u0172\u0176\5\64\33\2\u0173\u0176\5:") - buf.write("\36\2\u0174\u0176\7+\2\2\u0175\u016f\3\2\2\2\u0175\u0170") - buf.write("\3\2\2\2\u0175\u0171\3\2\2\2\u0175\u0172\3\2\2\2\u0175") - buf.write("\u0173\3\2\2\2\u0175\u0174\3\2\2\2\u0176M\3\2\2\2\"TZ") - buf.write("jn\u009c\u009f\u00a5\u00bb\u00be\u00cd\u00d7\u00d9\u00e2") - buf.write("\u00e6\u00ef\u00f5\u00fa\u010a\u010c\u0112\u011f\u0124") - buf.write("\u0129\u012e\u0132\u0145\u0148\u014f\u0152\u0160\u0168") - buf.write("\u0175") + buf.write("\n\26\f\26\16\26\u00db\13\26\3\27\3\27\3\27\3\27\3\27") + buf.write("\3\27\7\27\u00e3\n\27\f\27\16\27\u00e6\13\27\5\27\u00e8") + buf.write("\n\27\3\27\5\27\u00eb\n\27\3\27\3\27\3\27\3\27\3\30\7") + buf.write("\30\u00f2\n\30\f\30\16\30\u00f5\13\30\3\30\7\30\u00f8") + buf.write("\n\30\f\30\16\30\u00fb\13\30\3\31\3\31\5\31\u00ff\n\31") + buf.write("\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\33") + buf.write("\3\33\3\33\3\33\6\33\u010f\n\33\r\33\16\33\u0110\3\34") + buf.write("\3\34\3\35\3\35\5\35\u0117\n\35\3\36\3\36\3\36\3\36\3") + buf.write("\36\3\36\3\37\3\37\3\37\3\37\3\37\5\37\u0124\n\37\3\37") + buf.write("\7\37\u0127\n\37\f\37\16\37\u012a\13\37\3 \3 \5 \u012e") + buf.write("\n \3 \3 \3 \5 \u0133\n \6 \u0135\n \r \16 \u0136\3 \3") + buf.write(" \3 \3!\3!\3!\3!\3!\3!\3!\3!\3!\3\"\3\"\3\"\7\"\u0148") + buf.write("\n\"\f\"\16\"\u014b\13\"\5\"\u014d\n\"\3#\3#\3#\7#\u0152") + buf.write("\n#\f#\16#\u0155\13#\5#\u0157\n#\3$\3$\3$\3$\3$\3$\3$") + buf.write("\3$\3$\3$\3$\3$\5$\u0165\n$\3$\3$\3$\3$\7$\u016b\n$\f") + buf.write("$\16$\u016e\13$\3%\3%\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\5") + buf.write("\'\u017a\n\'\3\'\2\4*F(\2\4\6\b\n\f\16\20\22\24\26\30") + buf.write("\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJL\2\b\3\2\f\17") + buf.write("\3\2\20\21\3\2\36\37\3\2\34\35\3\2!&\3\2\'(\2\u018a\2") + buf.write("N\3\2\2\2\4T\3\2\2\2\6X\3\2\2\2\bj\3\2\2\2\nn\3\2\2\2") + buf.write("\fp\3\2\2\2\16v\3\2\2\2\20\u0080\3\2\2\2\22\u0086\3\2") + buf.write("\2\2\24\u008d\3\2\2\2\26\u0090\3\2\2\2\30\u0092\3\2\2") + buf.write("\2\32\u0094\3\2\2\2\34\u0096\3\2\2\2\36\u00a5\3\2\2\2") + buf.write(" \u00aa\3\2\2\2\"\u00af\3\2\2\2$\u00b1\3\2\2\2&\u00b3") + buf.write("\3\2\2\2(\u00b5\3\2\2\2*\u00cd\3\2\2\2,\u00dc\3\2\2\2") + buf.write(".\u00f3\3\2\2\2\60\u00fe\3\2\2\2\62\u0100\3\2\2\2\64\u0107") + buf.write("\3\2\2\2\66\u0112\3\2\2\28\u0116\3\2\2\2:\u0118\3\2\2") + buf.write("\2<\u0128\3\2\2\2>\u012d\3\2\2\2@\u013b\3\2\2\2B\u014c") + buf.write("\3\2\2\2D\u0156\3\2\2\2F\u0164\3\2\2\2H\u016f\3\2\2\2") + buf.write("J\u0171\3\2\2\2L\u0179\3\2\2\2NO\5\4\3\2OP\7\2\2\3P\3") + buf.write("\3\2\2\2QS\5\b\5\2RQ\3\2\2\2SV\3\2\2\2TR\3\2\2\2TU\3\2") + buf.write("\2\2U\5\3\2\2\2VT\3\2\2\2WY\5\b\5\2XW\3\2\2\2YZ\3\2\2") + buf.write("\2ZX\3\2\2\2Z[\3\2\2\2[\7\3\2\2\2\\k\5> \2]k\5\36\20\2") + buf.write("^k\5 \21\2_k\5\n\6\2`k\5\20\t\2ak\5\24\13\2bk\5\30\r\2") + buf.write("ck\5\22\n\2dk\5\32\16\2ek\5,\27\2fk\5\62\32\2gk\5@!\2") + buf.write("hk\5:\36\2ik\5(\25\2j\\\3\2\2\2j]\3\2\2\2j^\3\2\2\2j_") + buf.write("\3\2\2\2j`\3\2\2\2ja\3\2\2\2jb\3\2\2\2jc\3\2\2\2jd\3\2") + buf.write("\2\2je\3\2\2\2jf\3\2\2\2jg\3\2\2\2jh\3\2\2\2ji\3\2\2\2") + buf.write("k\t\3\2\2\2lo\5\f\7\2mo\5\16\b\2nl\3\2\2\2nm\3\2\2\2o") + buf.write("\13\3\2\2\2pq\7\3\2\2qr\5F$\2rs\7\4\2\2st\5\6\4\2tu\7") + buf.write("\5\2\2u\r\3\2\2\2vw\7\3\2\2wx\5F$\2xy\7\4\2\2yz\5\6\4") + buf.write("\2z{\7\5\2\2{|\7\6\2\2|}\7\4\2\2}~\5\6\4\2~\177\7\5\2") + buf.write("\2\177\17\3\2\2\2\u0080\u0081\7\7\2\2\u0081\u0082\5L\'") + buf.write("\2\u0082\u0083\7\4\2\2\u0083\u0084\5\6\4\2\u0084\u0085") + buf.write("\7\5\2\2\u0085\21\3\2\2\2\u0086\u0087\7\b\2\2\u0087\u0088") + buf.write("\7\t\2\2\u0088\u0089\5*\26\2\u0089\u008a\7\n\2\2\u008a") + buf.write("\u008b\5*\26\2\u008b\u008c\7\13\2\2\u008c\23\3\2\2\2\u008d") + buf.write("\u008e\5\26\f\2\u008e\u008f\5*\26\2\u008f\25\3\2\2\2\u0090") + buf.write("\u0091\t\2\2\2\u0091\27\3\2\2\2\u0092\u0093\t\3\2\2\u0093") + buf.write("\31\3\2\2\2\u0094\u0095\7\22\2\2\u0095\33\3\2\2\2\u0096") + buf.write("\u009f\7\4\2\2\u0097\u009c\5*\26\2\u0098\u0099\7\n\2\2") + buf.write("\u0099\u009b\5*\26\2\u009a\u0098\3\2\2\2\u009b\u009e\3") + buf.write("\2\2\2\u009c\u009a\3\2\2\2\u009c\u009d\3\2\2\2\u009d\u00a0") + buf.write("\3\2\2\2\u009e\u009c\3\2\2\2\u009f\u0097\3\2\2\2\u009f") + buf.write("\u00a0\3\2\2\2\u00a0\u00a1\3\2\2\2\u00a1\u00a2\7\5\2\2") + buf.write("\u00a2\35\3\2\2\2\u00a3\u00a6\7,\2\2\u00a4\u00a6\5\64") + buf.write("\33\2\u00a5\u00a3\3\2\2\2\u00a5\u00a4\3\2\2\2\u00a6\u00a7") + buf.write("\3\2\2\2\u00a7\u00a8\7\23\2\2\u00a8\u00a9\5*\26\2\u00a9") + buf.write("\37\3\2\2\2\u00aa\u00ab\7\24\2\2\u00ab\u00ac\7\t\2\2\u00ac") + buf.write("\u00ad\5*\26\2\u00ad\u00ae\7\13\2\2\u00ae!\3\2\2\2\u00af") + buf.write("\u00b0\t\4\2\2\u00b0#\3\2\2\2\u00b1\u00b2\t\5\2\2\u00b2") + buf.write("%\3\2\2\2\u00b3\u00b4\7\35\2\2\u00b4\'\3\2\2\2\u00b5\u00be") + buf.write("\7\25\2\2\u00b6\u00bb\5*\26\2\u00b7\u00b8\7\n\2\2\u00b8") + buf.write("\u00ba\5*\26\2\u00b9\u00b7\3\2\2\2\u00ba\u00bd\3\2\2\2") + buf.write("\u00bb\u00b9\3\2\2\2\u00bb\u00bc\3\2\2\2\u00bc\u00bf\3") + buf.write("\2\2\2\u00bd\u00bb\3\2\2\2\u00be\u00b6\3\2\2\2\u00be\u00bf") + buf.write("\3\2\2\2\u00bf)\3\2\2\2\u00c0\u00c1\b\26\1\2\u00c1\u00c2") + buf.write("\5&\24\2\u00c2\u00c3\5*\26\b\u00c3\u00ce\3\2\2\2\u00c4") + buf.write("\u00c5\58\35\2\u00c5\u00c6\7\23\2\2\u00c6\u00c7\5*\26") + buf.write("\5\u00c7\u00ce\3\2\2\2\u00c8\u00c9\7\t\2\2\u00c9\u00ca") + buf.write("\5*\26\2\u00ca\u00cb\7\13\2\2\u00cb\u00ce\3\2\2\2\u00cc") + buf.write("\u00ce\5L\'\2\u00cd\u00c0\3\2\2\2\u00cd\u00c4\3\2\2\2") + buf.write("\u00cd\u00c8\3\2\2\2\u00cd\u00cc\3\2\2\2\u00ce\u00d9\3") + buf.write("\2\2\2\u00cf\u00d0\f\7\2\2\u00d0\u00d1\5\"\22\2\u00d1") + buf.write("\u00d2\5*\26\b\u00d2\u00d8\3\2\2\2\u00d3\u00d4\f\6\2\2") + buf.write("\u00d4\u00d5\5$\23\2\u00d5\u00d6\5*\26\7\u00d6\u00d8\3") + buf.write("\2\2\2\u00d7\u00cf\3\2\2\2\u00d7\u00d3\3\2\2\2\u00d8\u00db") + buf.write("\3\2\2\2\u00d9\u00d7\3\2\2\2\u00d9\u00da\3\2\2\2\u00da") + buf.write("+\3\2\2\2\u00db\u00d9\3\2\2\2\u00dc\u00dd\7\26\2\2\u00dd") + buf.write("\u00ea\7,\2\2\u00de\u00df\7\t\2\2\u00df\u00e7\7,\2\2\u00e0") + buf.write("\u00e4\7\n\2\2\u00e1\u00e3\7,\2\2\u00e2\u00e1\3\2\2\2") + buf.write("\u00e3\u00e6\3\2\2\2\u00e4\u00e2\3\2\2\2\u00e4\u00e5\3") + buf.write("\2\2\2\u00e5\u00e8\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e7\u00e0") + buf.write("\3\2\2\2\u00e7\u00e8\3\2\2\2\u00e8\u00e9\3\2\2\2\u00e9") + buf.write("\u00eb\7\13\2\2\u00ea\u00de\3\2\2\2\u00ea\u00eb\3\2\2") + buf.write("\2\u00eb\u00ec\3\2\2\2\u00ec\u00ed\7\27\2\2\u00ed\u00ee") + buf.write("\5.\30\2\u00ee\u00ef\7\30\2\2\u00ef-\3\2\2\2\u00f0\u00f2") + buf.write("\5\60\31\2\u00f1\u00f0\3\2\2\2\u00f2\u00f5\3\2\2\2\u00f3") + buf.write("\u00f1\3\2\2\2\u00f3\u00f4\3\2\2\2\u00f4\u00f9\3\2\2\2") + buf.write("\u00f5\u00f3\3\2\2\2\u00f6\u00f8\5@!\2\u00f7\u00f6\3\2") + buf.write("\2\2\u00f8\u00fb\3\2\2\2\u00f9\u00f7\3\2\2\2\u00f9\u00fa") + buf.write("\3\2\2\2\u00fa/\3\2\2\2\u00fb\u00f9\3\2\2\2\u00fc\u00ff") + buf.write("\5\36\20\2\u00fd\u00ff\5\62\32\2\u00fe\u00fc\3\2\2\2\u00fe") + buf.write("\u00fd\3\2\2\2\u00ff\61\3\2\2\2\u0100\u0101\58\35\2\u0101") + buf.write("\u0102\7\23\2\2\u0102\u0103\7\31\2\2\u0103\u0104\7,\2") + buf.write("\2\u0104\u0105\7\t\2\2\u0105\u0106\7\13\2\2\u0106\63\3") + buf.write("\2\2\2\u0107\u010e\5\66\34\2\u0108\u0109\7\32\2\2\u0109") + buf.write("\u010f\7,\2\2\u010a\u010b\7\4\2\2\u010b\u010c\5*\26\2") + buf.write("\u010c\u010d\7\5\2\2\u010d\u010f\3\2\2\2\u010e\u0108\3") + buf.write("\2\2\2\u010e\u010a\3\2\2\2\u010f\u0110\3\2\2\2\u0110\u010e") + buf.write("\3\2\2\2\u0110\u0111\3\2\2\2\u0111\65\3\2\2\2\u0112\u0113") + buf.write("\7,\2\2\u0113\67\3\2\2\2\u0114\u0117\7,\2\2\u0115\u0117") + buf.write("\5\64\33\2\u0116\u0114\3\2\2\2\u0116\u0115\3\2\2\2\u0117") + buf.write("9\3\2\2\2\u0118\u0119\5<\37\2\u0119\u011a\7-\2\2\u011a") + buf.write("\u011b\7\t\2\2\u011b\u011c\5D#\2\u011c\u011d\7\13\2\2") + buf.write("\u011d;\3\2\2\2\u011e\u0124\7,\2\2\u011f\u0120\7\4\2\2") + buf.write("\u0120\u0121\5*\26\2\u0121\u0122\7\5\2\2\u0122\u0124\3") + buf.write("\2\2\2\u0123\u011e\3\2\2\2\u0123\u011f\3\2\2\2\u0124\u0125") + buf.write("\3\2\2\2\u0125\u0127\7\32\2\2\u0126\u0123\3\2\2\2\u0127") + buf.write("\u012a\3\2\2\2\u0128\u0126\3\2\2\2\u0128\u0129\3\2\2\2") + buf.write("\u0129=\3\2\2\2\u012a\u0128\3\2\2\2\u012b\u012e\7,\2\2") + buf.write("\u012c\u012e\5\64\33\2\u012d\u012b\3\2\2\2\u012d\u012c") + buf.write("\3\2\2\2\u012e\u0134\3\2\2\2\u012f\u0132\7\n\2\2\u0130") + buf.write("\u0133\7,\2\2\u0131\u0133\5\64\33\2\u0132\u0130\3\2\2") + buf.write("\2\u0132\u0131\3\2\2\2\u0133\u0135\3\2\2\2\u0134\u012f") + buf.write("\3\2\2\2\u0135\u0136\3\2\2\2\u0136\u0134\3\2\2\2\u0136") + buf.write("\u0137\3\2\2\2\u0137\u0138\3\2\2\2\u0138\u0139\7\23\2") + buf.write("\2\u0139\u013a\5:\36\2\u013a?\3\2\2\2\u013b\u013c\7\33") + buf.write("\2\2\u013c\u013d\7-\2\2\u013d\u013e\7\t\2\2\u013e\u013f") + buf.write("\5B\"\2\u013f\u0140\7\13\2\2\u0140\u0141\7\27\2\2\u0141") + buf.write("\u0142\5\6\4\2\u0142\u0143\7\30\2\2\u0143A\3\2\2\2\u0144") + buf.write("\u0149\7,\2\2\u0145\u0146\7\n\2\2\u0146\u0148\7,\2\2\u0147") + buf.write("\u0145\3\2\2\2\u0148\u014b\3\2\2\2\u0149\u0147\3\2\2\2") + buf.write("\u0149\u014a\3\2\2\2\u014a\u014d\3\2\2\2\u014b\u0149\3") + buf.write("\2\2\2\u014c\u0144\3\2\2\2\u014c\u014d\3\2\2\2\u014dC") + buf.write("\3\2\2\2\u014e\u0153\5*\26\2\u014f\u0150\7\n\2\2\u0150") + buf.write("\u0152\5*\26\2\u0151\u014f\3\2\2\2\u0152\u0155\3\2\2\2") + buf.write("\u0153\u0151\3\2\2\2\u0153\u0154\3\2\2\2\u0154\u0157\3") + buf.write("\2\2\2\u0155\u0153\3\2\2\2\u0156\u014e\3\2\2\2\u0156\u0157") + buf.write("\3\2\2\2\u0157E\3\2\2\2\u0158\u0159\b$\1\2\u0159\u015a") + buf.write("\7)\2\2\u015a\u0165\5F$\7\u015b\u015c\5*\26\2\u015c\u015d") + buf.write("\5H%\2\u015d\u015e\5*\26\2\u015e\u0165\3\2\2\2\u015f\u0165") + buf.write("\7 \2\2\u0160\u0161\7\t\2\2\u0161\u0162\5F$\2\u0162\u0163") + buf.write("\7\13\2\2\u0163\u0165\3\2\2\2\u0164\u0158\3\2\2\2\u0164") + buf.write("\u015b\3\2\2\2\u0164\u015f\3\2\2\2\u0164\u0160\3\2\2\2") + buf.write("\u0165\u016c\3\2\2\2\u0166\u0167\f\5\2\2\u0167\u0168\5") + buf.write("J&\2\u0168\u0169\5F$\6\u0169\u016b\3\2\2\2\u016a\u0166") + buf.write("\3\2\2\2\u016b\u016e\3\2\2\2\u016c\u016a\3\2\2\2\u016c") + buf.write("\u016d\3\2\2\2\u016dG\3\2\2\2\u016e\u016c\3\2\2\2\u016f") + buf.write("\u0170\t\6\2\2\u0170I\3\2\2\2\u0171\u0172\t\7\2\2\u0172") + buf.write("K\3\2\2\2\u0173\u017a\7*\2\2\u0174\u017a\7,\2\2\u0175") + buf.write("\u017a\5\34\17\2\u0176\u017a\5\64\33\2\u0177\u017a\5:") + buf.write("\36\2\u0178\u017a\7+\2\2\u0179\u0173\3\2\2\2\u0179\u0174") + buf.write("\3\2\2\2\u0179\u0175\3\2\2\2\u0179\u0176\3\2\2\2\u0179") + buf.write("\u0177\3\2\2\2\u0179\u0178\3\2\2\2\u017aM\3\2\2\2#TZj") + buf.write("n\u009c\u009f\u00a5\u00bb\u00be\u00cd\u00d7\u00d9\u00e4") + buf.write("\u00e7\u00ea\u00f3\u00f9\u00fe\u010e\u0110\u0116\u0123") + buf.write("\u0128\u012d\u0132\u0136\u0149\u014c\u0153\u0156\u0164") + buf.write("\u016c\u0179") return buf.getvalue() @@ -1723,31 +1725,41 @@ def classDeclaration(self): self.match(tlangParser.T__19) self.state = 219 self.match(tlangParser.VAR) - self.state = 228 + self.state = 232 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.T__6: self.state = 220 self.match(tlangParser.T__6) - self.state = 224 + self.state = 221 + self.match(tlangParser.VAR) + self.state = 229 self._errHandler.sync(self) _la = self._input.LA(1) - while _la==tlangParser.VAR: - self.state = 221 - self.match(tlangParser.VAR) + if _la==tlangParser.T__7: + self.state = 222 + self.match(tlangParser.T__7) self.state = 226 self._errHandler.sync(self) _la = self._input.LA(1) + while _la==tlangParser.VAR: + self.state = 223 + self.match(tlangParser.VAR) + self.state = 228 + self._errHandler.sync(self) + _la = self._input.LA(1) + + - self.state = 227 + self.state = 231 self.match(tlangParser.T__8) - self.state = 230 + self.state = 234 self.match(tlangParser.T__20) - self.state = 231 + self.state = 235 self.classBody() - self.state = 232 + self.state = 236 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -1797,23 +1809,23 @@ def classBody(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 237 + self.state = 241 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 234 + self.state = 238 self.classAttributeDeclaration() - self.state = 239 + self.state = 243 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 243 + self.state = 247 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__24: - self.state = 240 + self.state = 244 self.functionDeclaration() - self.state = 245 + self.state = 249 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1857,18 +1869,18 @@ def classAttributeDeclaration(self): localctx = tlangParser.ClassAttributeDeclarationContext(self, self._ctx, self.state) self.enterRule(localctx, 46, self.RULE_classAttributeDeclaration) try: - self.state = 248 + self.state = 252 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,16,self._ctx) + la_ = self._interp.adaptivePredict(self._input,17,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 246 + self.state = 250 self.assignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 247 + self.state = 251 self.objectInstantiation() pass @@ -1913,17 +1925,17 @@ def objectInstantiation(self): self.enterRule(localctx, 48, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 250 + self.state = 254 self.lvalue() - self.state = 251 + self.state = 255 self.match(tlangParser.T__16) - self.state = 252 + self.state = 256 self.match(tlangParser.T__22) - self.state = 253 + self.state = 257 self.match(tlangParser.VAR) - self.state = 254 + self.state = 258 self.match(tlangParser.T__6) - self.state = 255 + self.state = 259 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1975,28 +1987,28 @@ def objectOrArrayAccess(self): self.enterRule(localctx, 50, self.RULE_objectOrArrayAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 257 + self.state = 261 self.baseAccess() - self.state = 264 + self.state = 268 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 264 + self.state = 268 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__23]: - self.state = 258 + self.state = 262 self.match(tlangParser.T__23) - self.state = 259 + self.state = 263 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 260 + self.state = 264 self.match(tlangParser.T__1) - self.state = 261 + self.state = 265 self.expression(0) - self.state = 262 + self.state = 266 self.match(tlangParser.T__2) pass else: @@ -2005,9 +2017,9 @@ def objectOrArrayAccess(self): else: raise NoViableAltException(self) - self.state = 266 + self.state = 270 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,18,self._ctx) + _alt = self._interp.adaptivePredict(self._input,19,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2045,7 +2057,7 @@ def baseAccess(self): self.enterRule(localctx, 52, self.RULE_baseAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 268 + self.state = 272 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -2086,18 +2098,18 @@ def lvalue(self): localctx = tlangParser.LvalueContext(self, self._ctx, self.state) self.enterRule(localctx, 54, self.RULE_lvalue) try: - self.state = 272 + self.state = 276 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,19,self._ctx) + la_ = self._interp.adaptivePredict(self._input,20,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 270 + self.state = 274 self.match(tlangParser.VAR) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 271 + self.state = 275 self.objectOrArrayAccess() pass @@ -2146,15 +2158,15 @@ def functionCall(self): self.enterRule(localctx, 56, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 274 + self.state = 278 self.methodCaller() - self.state = 275 + self.state = 279 self.match(tlangParser.NAME) - self.state = 276 + self.state = 280 self.match(tlangParser.T__6) - self.state = 277 + self.state = 281 self.arguments() - self.state = 278 + self.state = 282 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2203,31 +2215,31 @@ def methodCaller(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 290 + self.state = 294 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__1 or _la==tlangParser.VAR: - self.state = 285 + self.state = 289 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.VAR]: - self.state = 280 + self.state = 284 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 281 + self.state = 285 self.match(tlangParser.T__1) - self.state = 282 + self.state = 286 self.expression(0) - self.state = 283 + self.state = 287 self.match(tlangParser.T__2) pass else: raise NoViableAltException(self) - self.state = 287 + self.state = 291 self.match(tlangParser.T__23) - self.state = 292 + self.state = 296 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2282,49 +2294,49 @@ def functionCallWithReturnValues(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 295 + self.state = 299 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,22,self._ctx) + la_ = self._interp.adaptivePredict(self._input,23,self._ctx) if la_ == 1: - self.state = 293 + self.state = 297 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 294 + self.state = 298 self.objectOrArrayAccess() pass - self.state = 302 + self.state = 306 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 297 + self.state = 301 self.match(tlangParser.T__7) - self.state = 300 + self.state = 304 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,23,self._ctx) + la_ = self._interp.adaptivePredict(self._input,24,self._ctx) if la_ == 1: - self.state = 298 + self.state = 302 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 299 + self.state = 303 self.objectOrArrayAccess() pass - self.state = 304 + self.state = 308 self._errHandler.sync(self) _la = self._input.LA(1) if not (_la==tlangParser.T__7): break - self.state = 306 + self.state = 310 self.match(tlangParser.T__16) - self.state = 307 + self.state = 311 self.functionCall() except RecognitionException as re: localctx.exception = re @@ -2370,21 +2382,21 @@ def functionDeclaration(self): self.enterRule(localctx, 62, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 309 + self.state = 313 self.match(tlangParser.T__24) - self.state = 310 + self.state = 314 self.match(tlangParser.NAME) - self.state = 311 + self.state = 315 self.match(tlangParser.T__6) - self.state = 312 + self.state = 316 self.parameters() - self.state = 313 + self.state = 317 self.match(tlangParser.T__8) - self.state = 314 + self.state = 318 self.match(tlangParser.T__20) - self.state = 315 + self.state = 319 self.strict_ilist() - self.state = 316 + self.state = 320 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -2426,21 +2438,21 @@ def parameters(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 326 + self.state = 330 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.VAR: - self.state = 318 + self.state = 322 self.match(tlangParser.VAR) - self.state = 323 + self.state = 327 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 319 + self.state = 323 self.match(tlangParser.T__7) - self.state = 320 + self.state = 324 self.match(tlangParser.VAR) - self.state = 325 + self.state = 329 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2487,21 +2499,21 @@ def arguments(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 336 + self.state = 340 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 328 + self.state = 332 self.expression(0) - self.state = 333 + self.state = 337 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 329 + self.state = 333 self.match(tlangParser.T__7) - self.state = 330 + self.state = 334 self.expression(0) - self.state = 335 + self.state = 339 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2570,44 +2582,44 @@ def condition(self, _p:int=0): self.enterRecursionRule(localctx, 68, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 350 + self.state = 354 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,29,self._ctx) + la_ = self._interp.adaptivePredict(self._input,30,self._ctx) if la_ == 1: - self.state = 339 + self.state = 343 self.match(tlangParser.NOT) - self.state = 340 + self.state = 344 self.condition(5) pass elif la_ == 2: - self.state = 341 + self.state = 345 self.expression(0) - self.state = 342 + self.state = 346 self.binCondOp() - self.state = 343 + self.state = 347 self.expression(0) pass elif la_ == 3: - self.state = 345 + self.state = 349 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 346 + self.state = 350 self.match(tlangParser.T__6) - self.state = 347 + self.state = 351 self.condition(0) - self.state = 348 + self.state = 352 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 358 + self.state = 362 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,30,self._ctx) + _alt = self._interp.adaptivePredict(self._input,31,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -2615,17 +2627,17 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 352 + self.state = 356 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 353 + self.state = 357 self.logicOp() - self.state = 354 + self.state = 358 self.condition(4) - self.state = 360 + self.state = 364 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,30,self._ctx) + _alt = self._interp.adaptivePredict(self._input,31,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2679,7 +2691,7 @@ def binCondOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 361 + self.state = 365 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2726,7 +2738,7 @@ def logicOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 363 + self.state = 367 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2786,42 +2798,42 @@ def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) self.enterRule(localctx, 74, self.RULE_value) try: - self.state = 371 + self.state = 375 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,31,self._ctx) + la_ = self._interp.adaptivePredict(self._input,32,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 365 + self.state = 369 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 366 + self.state = 370 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 367 + self.state = 371 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 368 + self.state = 372 self.objectOrArrayAccess() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 369 + self.state = 373 self.functionCall() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 370 + self.state = 374 self.match(tlangParser.REAL) pass From 48a3ac0946dbdb6d2640749ee8ba53b7b82b866b Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Fri, 21 Mar 2025 14:46:45 +0530 Subject: [PATCH 20/47] Encapsulation with MRO --- ChironCore/ChironAST/builder.py | 10 +- ChironCore/interpreter.py | 13 +- ChironCore/turtparse/tlang.g4 | 2 +- ChironCore/turtparse/tlangLexer.interp | 2 +- ChironCore/turtparse/tlangLexer.py | 188 +++++++++++++------------ 5 files changed, 107 insertions(+), 108 deletions(-) diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index b0b581c..88ca615 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -18,6 +18,7 @@ def __init__(self): self.stmtList = [] self.subStmtList = [] self.virtualRegCount = 0 + self.class_register = "" def getLval(self, ctx:tlangParser.LvalueContext): @@ -100,7 +101,6 @@ def visitObjectOrArrayAccess(self, ctx: tlangParser.ObjectOrArrayAccessContext): base = ctx.baseAccess().VAR().getText() - # Traverse through the nested access ('.' for attributes, '[]' for indices) accesses = [] i = 1 # Start from second child (skip baseAccess) @@ -111,7 +111,10 @@ def visitObjectOrArrayAccess(self, ctx: tlangParser.ObjectOrArrayAccessContext): if isinstance(child, TerminalNodeImpl) and child.getText() == '.': # Next child must be a VAR (attribute access) i += 1 # Move to VAR - accesses.append(ctx.children[i].getText()) + mangled_name = ctx.children[i].getText() + if base == ":self" and i==2 and ctx.children[i].getText().startswith(":__"): + mangled_name = f":_{self.class_register}{mangled_name.replace(":","")}" + accesses.append(mangled_name) elif child.getText() == '[': # Array access: Process the expression inside `[]` @@ -156,13 +159,14 @@ def visitObjectInstantiation(self, ctx: tlangParser.ObjectInstantiationContext): # Extract the left-hand side (target variable or object access) lval = self.getLval(ctx.lvalue()) # Extract the class name - # The last VAR is the class being instantiated + # The last VAR is the clazss being instantiated class_name = ctx.VAR().getText() return [(ChironAST.ObjectInstantiationCommand(lval, class_name), 1)] def visitClassDeclaration(self, ctx: tlangParser.ClassDeclarationContext): className = ctx.VAR()[0].getText() # Extract class name + self.class_register = className.replace(":","") baseClasses = [var.getText() for var in ctx.VAR()[1:]] if len(ctx.VAR()) > 1 else None # Extract base classes attributes = [] objectAttributes = [] diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 36940f6..88be0be 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -252,13 +252,7 @@ def handleClassDeclaration(self, stmt, tgt): class_def = class_header init_method = " def __init__(self" # Start of __init__ - init_body = "" - has_init_content = False # Track if __init__ has any assignments - - # Inherit instance attributes from base classes (left to right order) - if stmt.baseClasses: - init_body += " super().__init__()\n" - has_init_content = True + init_body = " super().__init__()\n" # Handle normal attributes (instance attributes) for attr in attributes: @@ -266,20 +260,19 @@ def handleClassDeclaration(self, stmt, tgt): attr_name = str(attr.lvar).replace(":", "") attr_value = addContext(attr.rexpr) if attr.rexpr else "None" init_body += f" self.{attr_name} = {attr_value}\n" - has_init_content = True # Handle object attributes for objectAttr in stmt.objectAttributes: objectAttr, target = objectAttr lhs = str(objectAttr.target).replace(":", "") init_body += f" self.{lhs} = None\n" - has_init_content = True + init_method += "):\n" # Close the __init__ method signature class_def += init_method - class_def += init_body if has_init_content else " pass\n" + class_def += init_body print(class_def, "Class Definition") diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index 0b9ca91..cbccfc2 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -143,7 +143,7 @@ value : NUM NUM : [0-9]+ ; REAL : [0-9]+('.'[0-9]+)?; -VAR : ':'[a-zA-Z_] [a-zA-Z0-9]* ; +VAR : ':''__'?[a-zA-Z_] [a-zA-Z0-9]* ; NAME : [a-zA-Z]+ ; diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index 76f5a47..7609c09 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -146,4 +146,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 46, 283, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 6, 41, 247, 10, 41, 13, 41, 14, 41, 248, 3, 42, 6, 42, 252, 10, 42, 13, 42, 14, 42, 253, 3, 42, 3, 42, 6, 42, 258, 10, 42, 13, 42, 14, 42, 259, 5, 42, 262, 10, 42, 3, 43, 3, 43, 3, 43, 7, 43, 267, 10, 43, 12, 43, 14, 43, 270, 11, 43, 3, 44, 6, 44, 273, 10, 44, 13, 44, 14, 44, 274, 3, 45, 6, 45, 278, 10, 45, 13, 45, 14, 45, 279, 3, 45, 3, 45, 2, 2, 46, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 289, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 3, 91, 3, 2, 2, 2, 5, 94, 3, 2, 2, 2, 7, 96, 3, 2, 2, 2, 9, 98, 3, 2, 2, 2, 11, 103, 3, 2, 2, 2, 13, 110, 3, 2, 2, 2, 15, 115, 3, 2, 2, 2, 17, 117, 3, 2, 2, 2, 19, 119, 3, 2, 2, 2, 21, 121, 3, 2, 2, 2, 23, 129, 3, 2, 2, 2, 25, 138, 3, 2, 2, 2, 27, 143, 3, 2, 2, 2, 29, 149, 3, 2, 2, 2, 31, 155, 3, 2, 2, 2, 33, 163, 3, 2, 2, 2, 35, 169, 3, 2, 2, 2, 37, 171, 3, 2, 2, 2, 39, 177, 3, 2, 2, 2, 41, 184, 3, 2, 2, 2, 43, 190, 3, 2, 2, 2, 45, 192, 3, 2, 2, 2, 47, 194, 3, 2, 2, 2, 49, 198, 3, 2, 2, 2, 51, 200, 3, 2, 2, 2, 53, 204, 3, 2, 2, 2, 55, 206, 3, 2, 2, 2, 57, 208, 3, 2, 2, 2, 59, 210, 3, 2, 2, 2, 61, 212, 3, 2, 2, 2, 63, 221, 3, 2, 2, 2, 65, 223, 3, 2, 2, 2, 67, 225, 3, 2, 2, 2, 69, 228, 3, 2, 2, 2, 71, 231, 3, 2, 2, 2, 73, 234, 3, 2, 2, 2, 75, 237, 3, 2, 2, 2, 77, 240, 3, 2, 2, 2, 79, 243, 3, 2, 2, 2, 81, 246, 3, 2, 2, 2, 83, 251, 3, 2, 2, 2, 85, 263, 3, 2, 2, 2, 87, 272, 3, 2, 2, 2, 89, 277, 3, 2, 2, 2, 91, 92, 7, 107, 2, 2, 92, 93, 7, 104, 2, 2, 93, 4, 3, 2, 2, 2, 94, 95, 7, 93, 2, 2, 95, 6, 3, 2, 2, 2, 96, 97, 7, 95, 2, 2, 97, 8, 3, 2, 2, 2, 98, 99, 7, 103, 2, 2, 99, 100, 7, 110, 2, 2, 100, 101, 7, 117, 2, 2, 101, 102, 7, 103, 2, 2, 102, 10, 3, 2, 2, 2, 103, 104, 7, 116, 2, 2, 104, 105, 7, 103, 2, 2, 105, 106, 7, 114, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 99, 2, 2, 108, 109, 7, 118, 2, 2, 109, 12, 3, 2, 2, 2, 110, 111, 7, 105, 2, 2, 111, 112, 7, 113, 2, 2, 112, 113, 7, 118, 2, 2, 113, 114, 7, 113, 2, 2, 114, 14, 3, 2, 2, 2, 115, 116, 7, 42, 2, 2, 116, 16, 3, 2, 2, 2, 117, 118, 7, 46, 2, 2, 118, 18, 3, 2, 2, 2, 119, 120, 7, 43, 2, 2, 120, 20, 3, 2, 2, 2, 121, 122, 7, 104, 2, 2, 122, 123, 7, 113, 2, 2, 123, 124, 7, 116, 2, 2, 124, 125, 7, 121, 2, 2, 125, 126, 7, 99, 2, 2, 126, 127, 7, 116, 2, 2, 127, 128, 7, 102, 2, 2, 128, 22, 3, 2, 2, 2, 129, 130, 7, 100, 2, 2, 130, 131, 7, 99, 2, 2, 131, 132, 7, 101, 2, 2, 132, 133, 7, 109, 2, 2, 133, 134, 7, 121, 2, 2, 134, 135, 7, 99, 2, 2, 135, 136, 7, 116, 2, 2, 136, 137, 7, 102, 2, 2, 137, 24, 3, 2, 2, 2, 138, 139, 7, 110, 2, 2, 139, 140, 7, 103, 2, 2, 140, 141, 7, 104, 2, 2, 141, 142, 7, 118, 2, 2, 142, 26, 3, 2, 2, 2, 143, 144, 7, 116, 2, 2, 144, 145, 7, 107, 2, 2, 145, 146, 7, 105, 2, 2, 146, 147, 7, 106, 2, 2, 147, 148, 7, 118, 2, 2, 148, 28, 3, 2, 2, 2, 149, 150, 7, 114, 2, 2, 150, 151, 7, 103, 2, 2, 151, 152, 7, 112, 2, 2, 152, 153, 7, 119, 2, 2, 153, 154, 7, 114, 2, 2, 154, 30, 3, 2, 2, 2, 155, 156, 7, 114, 2, 2, 156, 157, 7, 103, 2, 2, 157, 158, 7, 112, 2, 2, 158, 159, 7, 102, 2, 2, 159, 160, 7, 113, 2, 2, 160, 161, 7, 121, 2, 2, 161, 162, 7, 112, 2, 2, 162, 32, 3, 2, 2, 2, 163, 164, 7, 114, 2, 2, 164, 165, 7, 99, 2, 2, 165, 166, 7, 119, 2, 2, 166, 167, 7, 117, 2, 2, 167, 168, 7, 103, 2, 2, 168, 34, 3, 2, 2, 2, 169, 170, 7, 63, 2, 2, 170, 36, 3, 2, 2, 2, 171, 172, 7, 114, 2, 2, 172, 173, 7, 116, 2, 2, 173, 174, 7, 107, 2, 2, 174, 175, 7, 112, 2, 2, 175, 176, 7, 118, 2, 2, 176, 38, 3, 2, 2, 2, 177, 178, 7, 116, 2, 2, 178, 179, 7, 103, 2, 2, 179, 180, 7, 118, 2, 2, 180, 181, 7, 119, 2, 2, 181, 182, 7, 116, 2, 2, 182, 183, 7, 112, 2, 2, 183, 40, 3, 2, 2, 2, 184, 185, 7, 101, 2, 2, 185, 186, 7, 110, 2, 2, 186, 187, 7, 99, 2, 2, 187, 188, 7, 117, 2, 2, 188, 189, 7, 117, 2, 2, 189, 42, 3, 2, 2, 2, 190, 191, 7, 125, 2, 2, 191, 44, 3, 2, 2, 2, 192, 193, 7, 127, 2, 2, 193, 46, 3, 2, 2, 2, 194, 195, 7, 112, 2, 2, 195, 196, 7, 103, 2, 2, 196, 197, 7, 121, 2, 2, 197, 48, 3, 2, 2, 2, 198, 199, 7, 48, 2, 2, 199, 50, 3, 2, 2, 2, 200, 201, 7, 102, 2, 2, 201, 202, 7, 103, 2, 2, 202, 203, 7, 104, 2, 2, 203, 52, 3, 2, 2, 2, 204, 205, 7, 45, 2, 2, 205, 54, 3, 2, 2, 2, 206, 207, 7, 47, 2, 2, 207, 56, 3, 2, 2, 2, 208, 209, 7, 44, 2, 2, 209, 58, 3, 2, 2, 2, 210, 211, 7, 49, 2, 2, 211, 60, 3, 2, 2, 2, 212, 213, 7, 114, 2, 2, 213, 214, 7, 103, 2, 2, 214, 215, 7, 112, 2, 2, 215, 216, 7, 102, 2, 2, 216, 217, 7, 113, 2, 2, 217, 218, 7, 121, 2, 2, 218, 219, 7, 112, 2, 2, 219, 220, 7, 65, 2, 2, 220, 62, 3, 2, 2, 2, 221, 222, 7, 62, 2, 2, 222, 64, 3, 2, 2, 2, 223, 224, 7, 64, 2, 2, 224, 66, 3, 2, 2, 2, 225, 226, 7, 63, 2, 2, 226, 227, 7, 63, 2, 2, 227, 68, 3, 2, 2, 2, 228, 229, 7, 35, 2, 2, 229, 230, 7, 63, 2, 2, 230, 70, 3, 2, 2, 2, 231, 232, 7, 62, 2, 2, 232, 233, 7, 63, 2, 2, 233, 72, 3, 2, 2, 2, 234, 235, 7, 64, 2, 2, 235, 236, 7, 63, 2, 2, 236, 74, 3, 2, 2, 2, 237, 238, 7, 40, 2, 2, 238, 239, 7, 40, 2, 2, 239, 76, 3, 2, 2, 2, 240, 241, 7, 126, 2, 2, 241, 242, 7, 126, 2, 2, 242, 78, 3, 2, 2, 2, 243, 244, 7, 35, 2, 2, 244, 80, 3, 2, 2, 2, 245, 247, 9, 2, 2, 2, 246, 245, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 82, 3, 2, 2, 2, 250, 252, 9, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 253, 254, 3, 2, 2, 2, 254, 261, 3, 2, 2, 2, 255, 257, 7, 48, 2, 2, 256, 258, 9, 2, 2, 2, 257, 256, 3, 2, 2, 2, 258, 259, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 262, 3, 2, 2, 2, 261, 255, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 84, 3, 2, 2, 2, 263, 264, 7, 60, 2, 2, 264, 268, 9, 3, 2, 2, 265, 267, 9, 4, 2, 2, 266, 265, 3, 2, 2, 2, 267, 270, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 86, 3, 2, 2, 2, 270, 268, 3, 2, 2, 2, 271, 273, 9, 5, 2, 2, 272, 271, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 272, 3, 2, 2, 2, 274, 275, 3, 2, 2, 2, 275, 88, 3, 2, 2, 2, 276, 278, 9, 6, 2, 2, 277, 276, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 282, 8, 45, 2, 2, 282, 90, 3, 2, 2, 2, 10, 2, 248, 253, 259, 261, 268, 274, 279, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 46, 287, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 6, 41, 247, 10, 41, 13, 41, 14, 41, 248, 3, 42, 6, 42, 252, 10, 42, 13, 42, 14, 42, 253, 3, 42, 3, 42, 6, 42, 258, 10, 42, 13, 42, 14, 42, 259, 5, 42, 262, 10, 42, 3, 43, 3, 43, 3, 43, 5, 43, 267, 10, 43, 3, 43, 3, 43, 7, 43, 271, 10, 43, 12, 43, 14, 43, 274, 11, 43, 3, 44, 6, 44, 277, 10, 44, 13, 44, 14, 44, 278, 3, 45, 6, 45, 282, 10, 45, 13, 45, 14, 45, 283, 3, 45, 3, 45, 2, 2, 46, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 294, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 3, 91, 3, 2, 2, 2, 5, 94, 3, 2, 2, 2, 7, 96, 3, 2, 2, 2, 9, 98, 3, 2, 2, 2, 11, 103, 3, 2, 2, 2, 13, 110, 3, 2, 2, 2, 15, 115, 3, 2, 2, 2, 17, 117, 3, 2, 2, 2, 19, 119, 3, 2, 2, 2, 21, 121, 3, 2, 2, 2, 23, 129, 3, 2, 2, 2, 25, 138, 3, 2, 2, 2, 27, 143, 3, 2, 2, 2, 29, 149, 3, 2, 2, 2, 31, 155, 3, 2, 2, 2, 33, 163, 3, 2, 2, 2, 35, 169, 3, 2, 2, 2, 37, 171, 3, 2, 2, 2, 39, 177, 3, 2, 2, 2, 41, 184, 3, 2, 2, 2, 43, 190, 3, 2, 2, 2, 45, 192, 3, 2, 2, 2, 47, 194, 3, 2, 2, 2, 49, 198, 3, 2, 2, 2, 51, 200, 3, 2, 2, 2, 53, 204, 3, 2, 2, 2, 55, 206, 3, 2, 2, 2, 57, 208, 3, 2, 2, 2, 59, 210, 3, 2, 2, 2, 61, 212, 3, 2, 2, 2, 63, 221, 3, 2, 2, 2, 65, 223, 3, 2, 2, 2, 67, 225, 3, 2, 2, 2, 69, 228, 3, 2, 2, 2, 71, 231, 3, 2, 2, 2, 73, 234, 3, 2, 2, 2, 75, 237, 3, 2, 2, 2, 77, 240, 3, 2, 2, 2, 79, 243, 3, 2, 2, 2, 81, 246, 3, 2, 2, 2, 83, 251, 3, 2, 2, 2, 85, 263, 3, 2, 2, 2, 87, 276, 3, 2, 2, 2, 89, 281, 3, 2, 2, 2, 91, 92, 7, 107, 2, 2, 92, 93, 7, 104, 2, 2, 93, 4, 3, 2, 2, 2, 94, 95, 7, 93, 2, 2, 95, 6, 3, 2, 2, 2, 96, 97, 7, 95, 2, 2, 97, 8, 3, 2, 2, 2, 98, 99, 7, 103, 2, 2, 99, 100, 7, 110, 2, 2, 100, 101, 7, 117, 2, 2, 101, 102, 7, 103, 2, 2, 102, 10, 3, 2, 2, 2, 103, 104, 7, 116, 2, 2, 104, 105, 7, 103, 2, 2, 105, 106, 7, 114, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 99, 2, 2, 108, 109, 7, 118, 2, 2, 109, 12, 3, 2, 2, 2, 110, 111, 7, 105, 2, 2, 111, 112, 7, 113, 2, 2, 112, 113, 7, 118, 2, 2, 113, 114, 7, 113, 2, 2, 114, 14, 3, 2, 2, 2, 115, 116, 7, 42, 2, 2, 116, 16, 3, 2, 2, 2, 117, 118, 7, 46, 2, 2, 118, 18, 3, 2, 2, 2, 119, 120, 7, 43, 2, 2, 120, 20, 3, 2, 2, 2, 121, 122, 7, 104, 2, 2, 122, 123, 7, 113, 2, 2, 123, 124, 7, 116, 2, 2, 124, 125, 7, 121, 2, 2, 125, 126, 7, 99, 2, 2, 126, 127, 7, 116, 2, 2, 127, 128, 7, 102, 2, 2, 128, 22, 3, 2, 2, 2, 129, 130, 7, 100, 2, 2, 130, 131, 7, 99, 2, 2, 131, 132, 7, 101, 2, 2, 132, 133, 7, 109, 2, 2, 133, 134, 7, 121, 2, 2, 134, 135, 7, 99, 2, 2, 135, 136, 7, 116, 2, 2, 136, 137, 7, 102, 2, 2, 137, 24, 3, 2, 2, 2, 138, 139, 7, 110, 2, 2, 139, 140, 7, 103, 2, 2, 140, 141, 7, 104, 2, 2, 141, 142, 7, 118, 2, 2, 142, 26, 3, 2, 2, 2, 143, 144, 7, 116, 2, 2, 144, 145, 7, 107, 2, 2, 145, 146, 7, 105, 2, 2, 146, 147, 7, 106, 2, 2, 147, 148, 7, 118, 2, 2, 148, 28, 3, 2, 2, 2, 149, 150, 7, 114, 2, 2, 150, 151, 7, 103, 2, 2, 151, 152, 7, 112, 2, 2, 152, 153, 7, 119, 2, 2, 153, 154, 7, 114, 2, 2, 154, 30, 3, 2, 2, 2, 155, 156, 7, 114, 2, 2, 156, 157, 7, 103, 2, 2, 157, 158, 7, 112, 2, 2, 158, 159, 7, 102, 2, 2, 159, 160, 7, 113, 2, 2, 160, 161, 7, 121, 2, 2, 161, 162, 7, 112, 2, 2, 162, 32, 3, 2, 2, 2, 163, 164, 7, 114, 2, 2, 164, 165, 7, 99, 2, 2, 165, 166, 7, 119, 2, 2, 166, 167, 7, 117, 2, 2, 167, 168, 7, 103, 2, 2, 168, 34, 3, 2, 2, 2, 169, 170, 7, 63, 2, 2, 170, 36, 3, 2, 2, 2, 171, 172, 7, 114, 2, 2, 172, 173, 7, 116, 2, 2, 173, 174, 7, 107, 2, 2, 174, 175, 7, 112, 2, 2, 175, 176, 7, 118, 2, 2, 176, 38, 3, 2, 2, 2, 177, 178, 7, 116, 2, 2, 178, 179, 7, 103, 2, 2, 179, 180, 7, 118, 2, 2, 180, 181, 7, 119, 2, 2, 181, 182, 7, 116, 2, 2, 182, 183, 7, 112, 2, 2, 183, 40, 3, 2, 2, 2, 184, 185, 7, 101, 2, 2, 185, 186, 7, 110, 2, 2, 186, 187, 7, 99, 2, 2, 187, 188, 7, 117, 2, 2, 188, 189, 7, 117, 2, 2, 189, 42, 3, 2, 2, 2, 190, 191, 7, 125, 2, 2, 191, 44, 3, 2, 2, 2, 192, 193, 7, 127, 2, 2, 193, 46, 3, 2, 2, 2, 194, 195, 7, 112, 2, 2, 195, 196, 7, 103, 2, 2, 196, 197, 7, 121, 2, 2, 197, 48, 3, 2, 2, 2, 198, 199, 7, 48, 2, 2, 199, 50, 3, 2, 2, 2, 200, 201, 7, 102, 2, 2, 201, 202, 7, 103, 2, 2, 202, 203, 7, 104, 2, 2, 203, 52, 3, 2, 2, 2, 204, 205, 7, 45, 2, 2, 205, 54, 3, 2, 2, 2, 206, 207, 7, 47, 2, 2, 207, 56, 3, 2, 2, 2, 208, 209, 7, 44, 2, 2, 209, 58, 3, 2, 2, 2, 210, 211, 7, 49, 2, 2, 211, 60, 3, 2, 2, 2, 212, 213, 7, 114, 2, 2, 213, 214, 7, 103, 2, 2, 214, 215, 7, 112, 2, 2, 215, 216, 7, 102, 2, 2, 216, 217, 7, 113, 2, 2, 217, 218, 7, 121, 2, 2, 218, 219, 7, 112, 2, 2, 219, 220, 7, 65, 2, 2, 220, 62, 3, 2, 2, 2, 221, 222, 7, 62, 2, 2, 222, 64, 3, 2, 2, 2, 223, 224, 7, 64, 2, 2, 224, 66, 3, 2, 2, 2, 225, 226, 7, 63, 2, 2, 226, 227, 7, 63, 2, 2, 227, 68, 3, 2, 2, 2, 228, 229, 7, 35, 2, 2, 229, 230, 7, 63, 2, 2, 230, 70, 3, 2, 2, 2, 231, 232, 7, 62, 2, 2, 232, 233, 7, 63, 2, 2, 233, 72, 3, 2, 2, 2, 234, 235, 7, 64, 2, 2, 235, 236, 7, 63, 2, 2, 236, 74, 3, 2, 2, 2, 237, 238, 7, 40, 2, 2, 238, 239, 7, 40, 2, 2, 239, 76, 3, 2, 2, 2, 240, 241, 7, 126, 2, 2, 241, 242, 7, 126, 2, 2, 242, 78, 3, 2, 2, 2, 243, 244, 7, 35, 2, 2, 244, 80, 3, 2, 2, 2, 245, 247, 9, 2, 2, 2, 246, 245, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 82, 3, 2, 2, 2, 250, 252, 9, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 253, 254, 3, 2, 2, 2, 254, 261, 3, 2, 2, 2, 255, 257, 7, 48, 2, 2, 256, 258, 9, 2, 2, 2, 257, 256, 3, 2, 2, 2, 258, 259, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 262, 3, 2, 2, 2, 261, 255, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 84, 3, 2, 2, 2, 263, 266, 7, 60, 2, 2, 264, 265, 7, 97, 2, 2, 265, 267, 7, 97, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 272, 9, 3, 2, 2, 269, 271, 9, 4, 2, 2, 270, 269, 3, 2, 2, 2, 271, 274, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 86, 3, 2, 2, 2, 274, 272, 3, 2, 2, 2, 275, 277, 9, 5, 2, 2, 276, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 276, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 88, 3, 2, 2, 2, 280, 282, 9, 6, 2, 2, 281, 280, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 286, 8, 45, 2, 2, 286, 90, 3, 2, 2, 2, 11, 2, 248, 253, 259, 261, 266, 272, 278, 283, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index 4785a31..b9f3f11 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -9,7 +9,7 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2.") - buf.write("\u011b\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") + buf.write("\u011f\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") @@ -30,98 +30,100 @@ def serializedATN(): buf.write("\3 \3 \3!\3!\3\"\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3") buf.write("&\3&\3&\3\'\3\'\3\'\3(\3(\3)\6)\u00f7\n)\r)\16)\u00f8") buf.write("\3*\6*\u00fc\n*\r*\16*\u00fd\3*\3*\6*\u0102\n*\r*\16*") - buf.write("\u0103\5*\u0106\n*\3+\3+\3+\7+\u010b\n+\f+\16+\u010e\13") - buf.write("+\3,\6,\u0111\n,\r,\16,\u0112\3-\6-\u0116\n-\r-\16-\u0117") - buf.write("\3-\3-\2\2.\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25") - buf.write("\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+") - buf.write("\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E") - buf.write("$G%I&K\'M(O)Q*S+U,W-Y.\3\2\7\3\2\62;\5\2C\\aac|\5\2\62") - buf.write(";C\\c|\4\2C\\c|\5\2\13\f\17\17\"\"\2\u0121\2\3\3\2\2\2") - buf.write("\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r") - buf.write("\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3") - buf.write("\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2") - buf.write("\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'") - buf.write("\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2") - buf.write("\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29") - buf.write("\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2") - buf.write("C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2") - buf.write("\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2") - buf.write("\2\2W\3\2\2\2\2Y\3\2\2\2\3[\3\2\2\2\5^\3\2\2\2\7`\3\2") - buf.write("\2\2\tb\3\2\2\2\13g\3\2\2\2\rn\3\2\2\2\17s\3\2\2\2\21") - buf.write("u\3\2\2\2\23w\3\2\2\2\25y\3\2\2\2\27\u0081\3\2\2\2\31") - buf.write("\u008a\3\2\2\2\33\u008f\3\2\2\2\35\u0095\3\2\2\2\37\u009b") - buf.write("\3\2\2\2!\u00a3\3\2\2\2#\u00a9\3\2\2\2%\u00ab\3\2\2\2") - buf.write("\'\u00b1\3\2\2\2)\u00b8\3\2\2\2+\u00be\3\2\2\2-\u00c0") - buf.write("\3\2\2\2/\u00c2\3\2\2\2\61\u00c6\3\2\2\2\63\u00c8\3\2") - buf.write("\2\2\65\u00cc\3\2\2\2\67\u00ce\3\2\2\29\u00d0\3\2\2\2") - buf.write(";\u00d2\3\2\2\2=\u00d4\3\2\2\2?\u00dd\3\2\2\2A\u00df\3") - buf.write("\2\2\2C\u00e1\3\2\2\2E\u00e4\3\2\2\2G\u00e7\3\2\2\2I\u00ea") - buf.write("\3\2\2\2K\u00ed\3\2\2\2M\u00f0\3\2\2\2O\u00f3\3\2\2\2") - buf.write("Q\u00f6\3\2\2\2S\u00fb\3\2\2\2U\u0107\3\2\2\2W\u0110\3") - buf.write("\2\2\2Y\u0115\3\2\2\2[\\\7k\2\2\\]\7h\2\2]\4\3\2\2\2^") - buf.write("_\7]\2\2_\6\3\2\2\2`a\7_\2\2a\b\3\2\2\2bc\7g\2\2cd\7n") - buf.write("\2\2de\7u\2\2ef\7g\2\2f\n\3\2\2\2gh\7t\2\2hi\7g\2\2ij") - buf.write("\7r\2\2jk\7g\2\2kl\7c\2\2lm\7v\2\2m\f\3\2\2\2no\7i\2\2") - buf.write("op\7q\2\2pq\7v\2\2qr\7q\2\2r\16\3\2\2\2st\7*\2\2t\20\3") - buf.write("\2\2\2uv\7.\2\2v\22\3\2\2\2wx\7+\2\2x\24\3\2\2\2yz\7h") - buf.write("\2\2z{\7q\2\2{|\7t\2\2|}\7y\2\2}~\7c\2\2~\177\7t\2\2\177") - buf.write("\u0080\7f\2\2\u0080\26\3\2\2\2\u0081\u0082\7d\2\2\u0082") - buf.write("\u0083\7c\2\2\u0083\u0084\7e\2\2\u0084\u0085\7m\2\2\u0085") - buf.write("\u0086\7y\2\2\u0086\u0087\7c\2\2\u0087\u0088\7t\2\2\u0088") - buf.write("\u0089\7f\2\2\u0089\30\3\2\2\2\u008a\u008b\7n\2\2\u008b") - buf.write("\u008c\7g\2\2\u008c\u008d\7h\2\2\u008d\u008e\7v\2\2\u008e") - buf.write("\32\3\2\2\2\u008f\u0090\7t\2\2\u0090\u0091\7k\2\2\u0091") - buf.write("\u0092\7i\2\2\u0092\u0093\7j\2\2\u0093\u0094\7v\2\2\u0094") - buf.write("\34\3\2\2\2\u0095\u0096\7r\2\2\u0096\u0097\7g\2\2\u0097") - buf.write("\u0098\7p\2\2\u0098\u0099\7w\2\2\u0099\u009a\7r\2\2\u009a") - buf.write("\36\3\2\2\2\u009b\u009c\7r\2\2\u009c\u009d\7g\2\2\u009d") - buf.write("\u009e\7p\2\2\u009e\u009f\7f\2\2\u009f\u00a0\7q\2\2\u00a0") - buf.write("\u00a1\7y\2\2\u00a1\u00a2\7p\2\2\u00a2 \3\2\2\2\u00a3") - buf.write("\u00a4\7r\2\2\u00a4\u00a5\7c\2\2\u00a5\u00a6\7w\2\2\u00a6") - buf.write("\u00a7\7u\2\2\u00a7\u00a8\7g\2\2\u00a8\"\3\2\2\2\u00a9") - buf.write("\u00aa\7?\2\2\u00aa$\3\2\2\2\u00ab\u00ac\7r\2\2\u00ac") - buf.write("\u00ad\7t\2\2\u00ad\u00ae\7k\2\2\u00ae\u00af\7p\2\2\u00af") - buf.write("\u00b0\7v\2\2\u00b0&\3\2\2\2\u00b1\u00b2\7t\2\2\u00b2") - buf.write("\u00b3\7g\2\2\u00b3\u00b4\7v\2\2\u00b4\u00b5\7w\2\2\u00b5") - buf.write("\u00b6\7t\2\2\u00b6\u00b7\7p\2\2\u00b7(\3\2\2\2\u00b8") - buf.write("\u00b9\7e\2\2\u00b9\u00ba\7n\2\2\u00ba\u00bb\7c\2\2\u00bb") - buf.write("\u00bc\7u\2\2\u00bc\u00bd\7u\2\2\u00bd*\3\2\2\2\u00be") - buf.write("\u00bf\7}\2\2\u00bf,\3\2\2\2\u00c0\u00c1\7\177\2\2\u00c1") - buf.write(".\3\2\2\2\u00c2\u00c3\7p\2\2\u00c3\u00c4\7g\2\2\u00c4") - buf.write("\u00c5\7y\2\2\u00c5\60\3\2\2\2\u00c6\u00c7\7\60\2\2\u00c7") - buf.write("\62\3\2\2\2\u00c8\u00c9\7f\2\2\u00c9\u00ca\7g\2\2\u00ca") - buf.write("\u00cb\7h\2\2\u00cb\64\3\2\2\2\u00cc\u00cd\7-\2\2\u00cd") - buf.write("\66\3\2\2\2\u00ce\u00cf\7/\2\2\u00cf8\3\2\2\2\u00d0\u00d1") - buf.write("\7,\2\2\u00d1:\3\2\2\2\u00d2\u00d3\7\61\2\2\u00d3<\3\2") - buf.write("\2\2\u00d4\u00d5\7r\2\2\u00d5\u00d6\7g\2\2\u00d6\u00d7") - buf.write("\7p\2\2\u00d7\u00d8\7f\2\2\u00d8\u00d9\7q\2\2\u00d9\u00da") - buf.write("\7y\2\2\u00da\u00db\7p\2\2\u00db\u00dc\7A\2\2\u00dc>\3") - buf.write("\2\2\2\u00dd\u00de\7>\2\2\u00de@\3\2\2\2\u00df\u00e0\7") - buf.write("@\2\2\u00e0B\3\2\2\2\u00e1\u00e2\7?\2\2\u00e2\u00e3\7") - buf.write("?\2\2\u00e3D\3\2\2\2\u00e4\u00e5\7#\2\2\u00e5\u00e6\7") - buf.write("?\2\2\u00e6F\3\2\2\2\u00e7\u00e8\7>\2\2\u00e8\u00e9\7") - buf.write("?\2\2\u00e9H\3\2\2\2\u00ea\u00eb\7@\2\2\u00eb\u00ec\7") - buf.write("?\2\2\u00ecJ\3\2\2\2\u00ed\u00ee\7(\2\2\u00ee\u00ef\7") - buf.write("(\2\2\u00efL\3\2\2\2\u00f0\u00f1\7~\2\2\u00f1\u00f2\7") - buf.write("~\2\2\u00f2N\3\2\2\2\u00f3\u00f4\7#\2\2\u00f4P\3\2\2\2") - buf.write("\u00f5\u00f7\t\2\2\2\u00f6\u00f5\3\2\2\2\u00f7\u00f8\3") - buf.write("\2\2\2\u00f8\u00f6\3\2\2\2\u00f8\u00f9\3\2\2\2\u00f9R") - buf.write("\3\2\2\2\u00fa\u00fc\t\2\2\2\u00fb\u00fa\3\2\2\2\u00fc") - buf.write("\u00fd\3\2\2\2\u00fd\u00fb\3\2\2\2\u00fd\u00fe\3\2\2\2") - buf.write("\u00fe\u0105\3\2\2\2\u00ff\u0101\7\60\2\2\u0100\u0102") - buf.write("\t\2\2\2\u0101\u0100\3\2\2\2\u0102\u0103\3\2\2\2\u0103") - buf.write("\u0101\3\2\2\2\u0103\u0104\3\2\2\2\u0104\u0106\3\2\2\2") - buf.write("\u0105\u00ff\3\2\2\2\u0105\u0106\3\2\2\2\u0106T\3\2\2") - buf.write("\2\u0107\u0108\7<\2\2\u0108\u010c\t\3\2\2\u0109\u010b") - buf.write("\t\4\2\2\u010a\u0109\3\2\2\2\u010b\u010e\3\2\2\2\u010c") - buf.write("\u010a\3\2\2\2\u010c\u010d\3\2\2\2\u010dV\3\2\2\2\u010e") - buf.write("\u010c\3\2\2\2\u010f\u0111\t\5\2\2\u0110\u010f\3\2\2\2") - buf.write("\u0111\u0112\3\2\2\2\u0112\u0110\3\2\2\2\u0112\u0113\3") - buf.write("\2\2\2\u0113X\3\2\2\2\u0114\u0116\t\6\2\2\u0115\u0114") - buf.write("\3\2\2\2\u0116\u0117\3\2\2\2\u0117\u0115\3\2\2\2\u0117") - buf.write("\u0118\3\2\2\2\u0118\u0119\3\2\2\2\u0119\u011a\b-\2\2") - buf.write("\u011aZ\3\2\2\2\n\2\u00f8\u00fd\u0103\u0105\u010c\u0112") - buf.write("\u0117\3\b\2\2") + buf.write("\u0103\5*\u0106\n*\3+\3+\3+\5+\u010b\n+\3+\3+\7+\u010f") + buf.write("\n+\f+\16+\u0112\13+\3,\6,\u0115\n,\r,\16,\u0116\3-\6") + buf.write("-\u011a\n-\r-\16-\u011b\3-\3-\2\2.\3\3\5\4\7\5\t\6\13") + buf.write("\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37") + buf.write("\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34") + buf.write("\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.\3\2\7\3") + buf.write("\2\62;\5\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5\2\13\f\17\17") + buf.write("\"\"\2\u0126\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3") + buf.write("\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2") + buf.write("\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2") + buf.write("\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2") + buf.write("#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2") + buf.write("\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65") + buf.write("\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2") + buf.write("\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2") + buf.write("\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2") + buf.write("\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\3[\3") + buf.write("\2\2\2\5^\3\2\2\2\7`\3\2\2\2\tb\3\2\2\2\13g\3\2\2\2\r") + buf.write("n\3\2\2\2\17s\3\2\2\2\21u\3\2\2\2\23w\3\2\2\2\25y\3\2") + buf.write("\2\2\27\u0081\3\2\2\2\31\u008a\3\2\2\2\33\u008f\3\2\2") + buf.write("\2\35\u0095\3\2\2\2\37\u009b\3\2\2\2!\u00a3\3\2\2\2#\u00a9") + buf.write("\3\2\2\2%\u00ab\3\2\2\2\'\u00b1\3\2\2\2)\u00b8\3\2\2\2") + buf.write("+\u00be\3\2\2\2-\u00c0\3\2\2\2/\u00c2\3\2\2\2\61\u00c6") + buf.write("\3\2\2\2\63\u00c8\3\2\2\2\65\u00cc\3\2\2\2\67\u00ce\3") + buf.write("\2\2\29\u00d0\3\2\2\2;\u00d2\3\2\2\2=\u00d4\3\2\2\2?\u00dd") + buf.write("\3\2\2\2A\u00df\3\2\2\2C\u00e1\3\2\2\2E\u00e4\3\2\2\2") + buf.write("G\u00e7\3\2\2\2I\u00ea\3\2\2\2K\u00ed\3\2\2\2M\u00f0\3") + buf.write("\2\2\2O\u00f3\3\2\2\2Q\u00f6\3\2\2\2S\u00fb\3\2\2\2U\u0107") + buf.write("\3\2\2\2W\u0114\3\2\2\2Y\u0119\3\2\2\2[\\\7k\2\2\\]\7") + buf.write("h\2\2]\4\3\2\2\2^_\7]\2\2_\6\3\2\2\2`a\7_\2\2a\b\3\2\2") + buf.write("\2bc\7g\2\2cd\7n\2\2de\7u\2\2ef\7g\2\2f\n\3\2\2\2gh\7") + buf.write("t\2\2hi\7g\2\2ij\7r\2\2jk\7g\2\2kl\7c\2\2lm\7v\2\2m\f") + buf.write("\3\2\2\2no\7i\2\2op\7q\2\2pq\7v\2\2qr\7q\2\2r\16\3\2\2") + buf.write("\2st\7*\2\2t\20\3\2\2\2uv\7.\2\2v\22\3\2\2\2wx\7+\2\2") + buf.write("x\24\3\2\2\2yz\7h\2\2z{\7q\2\2{|\7t\2\2|}\7y\2\2}~\7c") + buf.write("\2\2~\177\7t\2\2\177\u0080\7f\2\2\u0080\26\3\2\2\2\u0081") + buf.write("\u0082\7d\2\2\u0082\u0083\7c\2\2\u0083\u0084\7e\2\2\u0084") + buf.write("\u0085\7m\2\2\u0085\u0086\7y\2\2\u0086\u0087\7c\2\2\u0087") + buf.write("\u0088\7t\2\2\u0088\u0089\7f\2\2\u0089\30\3\2\2\2\u008a") + buf.write("\u008b\7n\2\2\u008b\u008c\7g\2\2\u008c\u008d\7h\2\2\u008d") + buf.write("\u008e\7v\2\2\u008e\32\3\2\2\2\u008f\u0090\7t\2\2\u0090") + buf.write("\u0091\7k\2\2\u0091\u0092\7i\2\2\u0092\u0093\7j\2\2\u0093") + buf.write("\u0094\7v\2\2\u0094\34\3\2\2\2\u0095\u0096\7r\2\2\u0096") + buf.write("\u0097\7g\2\2\u0097\u0098\7p\2\2\u0098\u0099\7w\2\2\u0099") + buf.write("\u009a\7r\2\2\u009a\36\3\2\2\2\u009b\u009c\7r\2\2\u009c") + buf.write("\u009d\7g\2\2\u009d\u009e\7p\2\2\u009e\u009f\7f\2\2\u009f") + buf.write("\u00a0\7q\2\2\u00a0\u00a1\7y\2\2\u00a1\u00a2\7p\2\2\u00a2") + buf.write(" \3\2\2\2\u00a3\u00a4\7r\2\2\u00a4\u00a5\7c\2\2\u00a5") + buf.write("\u00a6\7w\2\2\u00a6\u00a7\7u\2\2\u00a7\u00a8\7g\2\2\u00a8") + buf.write("\"\3\2\2\2\u00a9\u00aa\7?\2\2\u00aa$\3\2\2\2\u00ab\u00ac") + buf.write("\7r\2\2\u00ac\u00ad\7t\2\2\u00ad\u00ae\7k\2\2\u00ae\u00af") + buf.write("\7p\2\2\u00af\u00b0\7v\2\2\u00b0&\3\2\2\2\u00b1\u00b2") + buf.write("\7t\2\2\u00b2\u00b3\7g\2\2\u00b3\u00b4\7v\2\2\u00b4\u00b5") + buf.write("\7w\2\2\u00b5\u00b6\7t\2\2\u00b6\u00b7\7p\2\2\u00b7(\3") + buf.write("\2\2\2\u00b8\u00b9\7e\2\2\u00b9\u00ba\7n\2\2\u00ba\u00bb") + buf.write("\7c\2\2\u00bb\u00bc\7u\2\2\u00bc\u00bd\7u\2\2\u00bd*\3") + buf.write("\2\2\2\u00be\u00bf\7}\2\2\u00bf,\3\2\2\2\u00c0\u00c1\7") + buf.write("\177\2\2\u00c1.\3\2\2\2\u00c2\u00c3\7p\2\2\u00c3\u00c4") + buf.write("\7g\2\2\u00c4\u00c5\7y\2\2\u00c5\60\3\2\2\2\u00c6\u00c7") + buf.write("\7\60\2\2\u00c7\62\3\2\2\2\u00c8\u00c9\7f\2\2\u00c9\u00ca") + buf.write("\7g\2\2\u00ca\u00cb\7h\2\2\u00cb\64\3\2\2\2\u00cc\u00cd") + buf.write("\7-\2\2\u00cd\66\3\2\2\2\u00ce\u00cf\7/\2\2\u00cf8\3\2") + buf.write("\2\2\u00d0\u00d1\7,\2\2\u00d1:\3\2\2\2\u00d2\u00d3\7\61") + buf.write("\2\2\u00d3<\3\2\2\2\u00d4\u00d5\7r\2\2\u00d5\u00d6\7g") + buf.write("\2\2\u00d6\u00d7\7p\2\2\u00d7\u00d8\7f\2\2\u00d8\u00d9") + buf.write("\7q\2\2\u00d9\u00da\7y\2\2\u00da\u00db\7p\2\2\u00db\u00dc") + buf.write("\7A\2\2\u00dc>\3\2\2\2\u00dd\u00de\7>\2\2\u00de@\3\2\2") + buf.write("\2\u00df\u00e0\7@\2\2\u00e0B\3\2\2\2\u00e1\u00e2\7?\2") + buf.write("\2\u00e2\u00e3\7?\2\2\u00e3D\3\2\2\2\u00e4\u00e5\7#\2") + buf.write("\2\u00e5\u00e6\7?\2\2\u00e6F\3\2\2\2\u00e7\u00e8\7>\2") + buf.write("\2\u00e8\u00e9\7?\2\2\u00e9H\3\2\2\2\u00ea\u00eb\7@\2") + buf.write("\2\u00eb\u00ec\7?\2\2\u00ecJ\3\2\2\2\u00ed\u00ee\7(\2") + buf.write("\2\u00ee\u00ef\7(\2\2\u00efL\3\2\2\2\u00f0\u00f1\7~\2") + buf.write("\2\u00f1\u00f2\7~\2\2\u00f2N\3\2\2\2\u00f3\u00f4\7#\2") + buf.write("\2\u00f4P\3\2\2\2\u00f5\u00f7\t\2\2\2\u00f6\u00f5\3\2") + buf.write("\2\2\u00f7\u00f8\3\2\2\2\u00f8\u00f6\3\2\2\2\u00f8\u00f9") + buf.write("\3\2\2\2\u00f9R\3\2\2\2\u00fa\u00fc\t\2\2\2\u00fb\u00fa") + buf.write("\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\u00fb\3\2\2\2\u00fd") + buf.write("\u00fe\3\2\2\2\u00fe\u0105\3\2\2\2\u00ff\u0101\7\60\2") + buf.write("\2\u0100\u0102\t\2\2\2\u0101\u0100\3\2\2\2\u0102\u0103") + buf.write("\3\2\2\2\u0103\u0101\3\2\2\2\u0103\u0104\3\2\2\2\u0104") + buf.write("\u0106\3\2\2\2\u0105\u00ff\3\2\2\2\u0105\u0106\3\2\2\2") + buf.write("\u0106T\3\2\2\2\u0107\u010a\7<\2\2\u0108\u0109\7a\2\2") + buf.write("\u0109\u010b\7a\2\2\u010a\u0108\3\2\2\2\u010a\u010b\3") + buf.write("\2\2\2\u010b\u010c\3\2\2\2\u010c\u0110\t\3\2\2\u010d\u010f") + buf.write("\t\4\2\2\u010e\u010d\3\2\2\2\u010f\u0112\3\2\2\2\u0110") + buf.write("\u010e\3\2\2\2\u0110\u0111\3\2\2\2\u0111V\3\2\2\2\u0112") + buf.write("\u0110\3\2\2\2\u0113\u0115\t\5\2\2\u0114\u0113\3\2\2\2") + buf.write("\u0115\u0116\3\2\2\2\u0116\u0114\3\2\2\2\u0116\u0117\3") + buf.write("\2\2\2\u0117X\3\2\2\2\u0118\u011a\t\6\2\2\u0119\u0118") + buf.write("\3\2\2\2\u011a\u011b\3\2\2\2\u011b\u0119\3\2\2\2\u011b") + buf.write("\u011c\3\2\2\2\u011c\u011d\3\2\2\2\u011d\u011e\b-\2\2") + buf.write("\u011eZ\3\2\2\2\13\2\u00f8\u00fd\u0103\u0105\u010a\u0110") + buf.write("\u0116\u011b\3\b\2\2") return buf.getvalue() From a74cae5dff2a03bebac3aaf044e2d03ff9dd4156 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Fri, 21 Mar 2025 14:47:27 +0530 Subject: [PATCH 21/47] example on encapuslation --- ChironCore/example/test.tl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ChironCore/example/test.tl diff --git a/ChironCore/example/test.tl b/ChironCore/example/test.tl new file mode 100644 index 0000000..d9e16ba --- /dev/null +++ b/ChironCore/example/test.tl @@ -0,0 +1,27 @@ +class :Shape { + :__length = 250 + def moveForward(:self) { + forward :self.:length + return + } +} + +class :Polygon { + :sides = 4 + :length = 100 +} + +class :Hexagon(:Polygon, :Shape) { + :__sides = 6 + def drawHex(:self) { + repeat :self.:__sides [ + :self.moveForward() + right 60 + ] + return + } +} + +:hex = new :Hexagon() +:hex.drawHex() +:pol = new :Polygon() \ No newline at end of file From 39e4aa96d3e3c61b3c9e173f8efd8d0fd9a9b29a Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Fri, 21 Mar 2025 18:19:39 +0530 Subject: [PATCH 22/47] adding comments --- ChironCore/example/test.tl | 3 +- ChironCore/interpreter.py | 82 +++++++++++++------------------------- 2 files changed, 28 insertions(+), 57 deletions(-) diff --git a/ChironCore/example/test.tl b/ChironCore/example/test.tl index d9e16ba..c22e585 100644 --- a/ChironCore/example/test.tl +++ b/ChironCore/example/test.tl @@ -23,5 +23,4 @@ class :Hexagon(:Polygon, :Shape) { } :hex = new :Hexagon() -:hex.drawHex() -:pol = new :Polygon() \ No newline at end of file +:hex.drawHex() \ No newline at end of file diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 88be0be..5741c4d 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -92,11 +92,14 @@ class ConcreteInterpreter(Interpreter): # Ref: https://realpython.com/beginners-guide-python-turtle cond_eval = None # used as a temporary variable within the embedded program interpreter prg = None + # virtual argument register argument = None + # virtual return value register return_value = None + # list of user-defined classes class_list = None - # map of function name to their pc in the IR + # map from name of functions to their pc function_addresses = {} # stack for handling function calls call_stack = [] @@ -109,9 +112,6 @@ def __init__(self, irHandler, params): if self.args is not None and self.args.hooks: self.chironhook = Chironhooks.ConcreteChironHooks() self.pc = 0 - print("###########################Intermediate Representation (IR):#############") - for index, instruction in enumerate(self.ir): - print(f"{index}: {instruction} | {instruction[0]}") def interpret(self): print("Program counter : ", self.pc) @@ -176,43 +176,41 @@ def initProgramContext(self, params): exec("setattr(self.prg,\"%s\",%s)" % (var, val)) def handleFunctionDeclaration(self, stmt, tgt): - print(f"Function Declaration: {stmt.name}") + # body of the function starts from next instruction self.function_addresses[stmt.name] = self.pc + 1 return tgt def handleFunctionCall(self, stmt, tgt): - print("[1]", stmt, "printing stmt") - if stmt.caller: - print("FINDING CLASS NAME!###################") - print("Caller: ", stmt.caller) - print(stmt.name) - caller_class = eval(addContext(stmt.caller)).__class__.__name__ - print(caller_class) - method_name = ":" + str(caller_class) + "@" + str(stmt.name) + # Handling call stack + # Save the return address on the call stack self.call_stack.append(self.pc + 1) - # Save the current program context + # Save the current program context on the call stack self.call_stack.append(self.prg) - # Initialize a new program context for the function call + # Save the arguments on the call stack for arg in stmt.args: arg_value = addContext(arg) exec(f"self.argument = {arg_value}") self.call_stack.append(self.argument) - self.prg = ProgramContext() + # Jump to the function address + # If the function is a method, the name will be in the form of "caller@method" if stmt.caller: - self.pc = self.function_addresses[method_name] + caller_class = eval(addContext(stmt.caller)).__class__.__name__ + method_name = ":" + str(caller_class) + "@" + str(stmt.name) + self.pc = self.function_addresses[method_name] else: self.pc = self.function_addresses[stmt.name] + # Initialize a new program context for the new activation record + self.prg = ProgramContext() return 0 + # Copying the return values in their respective placeholders def handleReturnRead(self, stmt, tgt): - print(f"Read Return: {stmt.returnValues}") for rval in reversed(stmt.returnValues): rval = str(rval).replace(":", "") exec(f"self.prg.{rval} = self.call_stack.pop()") return 1 def handleFunctionReturn(self, stmt, tgt): - print(f"Function Return: {stmt}") # Restore the previous program context rval_list = [] for rval in stmt.returnValues: @@ -224,23 +222,17 @@ def handleFunctionReturn(self, stmt, tgt): self.call_stack.extend(rval_list) return 0 + # Copying the parameters in their respective placeholders def handleParametersPassing(self, stmt, tgt): - print(f"Parameters Passing: {stmt.params}") for param in reversed(stmt.params): param = str(param).replace(":", "") param_value = self.call_stack.pop() - print("PRINTING PARAM VALUE###############", param_value, param) setattr(self.prg, param, param_value) - print("PRINTING PARAM VALUE###############", - getattr(self.prg, param)) return 1 def handleClassDeclaration(self, stmt, tgt): - print(f"Class Declaration: {stmt.className}") - className = stmt.className.replace(":", "") attributes = stmt.attributes # List of attribute assignments - # Handle inheritance if base classes exist if hasattr(stmt, "baseClasses") and stmt.baseClasses: base_classes = [getattr(self.class_list, str( @@ -249,36 +241,25 @@ def handleClassDeclaration(self, stmt, tgt): class_header = f"class {className}({base_str}):\n" else: class_header = f"class {className}:\n" - class_def = class_header init_method = " def __init__(self" # Start of __init__ init_body = " super().__init__()\n" - - # Handle normal attributes (instance attributes) + # Handle normal attributes (non-object attributes) for attr in attributes: attr, target = attr attr_name = str(attr.lvar).replace(":", "") attr_value = addContext(attr.rexpr) if attr.rexpr else "None" init_body += f" self.{attr_name} = {attr_value}\n" - # Handle object attributes for objectAttr in stmt.objectAttributes: objectAttr, target = objectAttr lhs = str(objectAttr.target).replace(":", "") init_body += f" self.{lhs} = None\n" - - - - init_method += "):\n" # Close the __init__ method signature class_def += init_method class_def += init_body - - print(class_def, "Class Definition") - # Step 1: Execute the class definition (store it inside self.class_list) exec(class_def, globals(), self.class_list.__dict__) - # Step 2: Assign object attributes after class creation for objectAttr in stmt.objectAttributes: objectAttr, target = objectAttr @@ -286,31 +267,22 @@ def handleClassDeclaration(self, stmt, tgt): rhs = addContext(objectAttr.class_name).replace( "self.prg.", "self.class_list.") exec(f"self.class_list.{className}.{lhs} = {rhs}()") - - # Inherit methods from base classes (right to left order) - temp_function_addresses = {} + # Inherit methods from base classes + inherited_function_addresses = {} if stmt.baseClasses: - for key, value in self.function_addresses.items(): - key_parts = key.split("@") - if key_parts[0] in reversed(stmt.baseClasses): - new_key = stmt.className + "@" + key_parts[1] - temp_function_addresses[new_key] = value - self.function_addresses.update(temp_function_addresses) - - print("Printing function addresses:[][][] ", self.function_addresses) + for function_name, address in self.function_addresses.items(): + class_name, method_name = function_name.split("@") + if class_name in reversed(stmt.baseClasses): + new_function_name = f"{stmt.className}@{method_name}" + inherited_function_addresses[new_function_name] = address + self.function_addresses.update(inherited_function_addresses) return 1 def handleObjectInstantiation(self, stmt, tgt): - print(f"Creating new instance of {stmt.class_name} for {stmt.target}") - lhs = str(stmt.target).replace(":", "") rhs = addContext(stmt.class_name).replace( "self.prg.", "self.class_list.") - - # exec(instance_code, globals(), self.prg.__dict__) # Store in self.prg exec(f"self.prg.{lhs} = {rhs}()") - print(f"Instance created: {lhs} -> {getattr(self.prg, lhs)}") - return 1 def handleAssignment(self, stmt, tgt): From cbd0c53a5d7ab7e934e5af92c4ff3bf24c0b2e4d Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Thu, 3 Apr 2025 19:59:30 +0530 Subject: [PATCH 23/47] diamond problem example added --- ChironCore/example/test.tl | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/ChironCore/example/test.tl b/ChironCore/example/test.tl index c22e585..d227211 100644 --- a/ChironCore/example/test.tl +++ b/ChironCore/example/test.tl @@ -1,26 +1,5 @@ -class :Shape { - :__length = 250 - def moveForward(:self) { - forward :self.:length - return - } +def add(:a, :b) +{ + return :a + :b } - -class :Polygon { - :sides = 4 - :length = 100 -} - -class :Hexagon(:Polygon, :Shape) { - :__sides = 6 - def drawHex(:self) { - repeat :self.:__sides [ - :self.moveForward() - right 60 - ] - return - } -} - -:hex = new :Hexagon() -:hex.drawHex() \ No newline at end of file +print(add(add(2, 3), 4)) From d939e4489959c410d5a44c78c3ad28d8e29bc74b Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Fri, 4 Apr 2025 15:20:49 +0530 Subject: [PATCH 24/47] instruction and declaration separated --- ChironCore/ChironAST/builder.py | 8 +- ChironCore/example/demo/rangoli.tl | 2 +- ChironCore/example/test.tl | 7 +- ChironCore/turtparse/tlang.g4 | 8 +- ChironCore/turtparse/tlang.interp | 3 +- ChironCore/turtparse/tlangParser.py | 1039 ++++++++++++++------------ ChironCore/turtparse/tlangVisitor.py | 5 + 7 files changed, 574 insertions(+), 498 deletions(-) diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 88ca615..1bbd9bc 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -36,13 +36,19 @@ def visitStart(self, ctx: tlangParser.StartContext): def visitInstruction_list(self, ctx: tlangParser.Instruction_listContext): instrList = [] + + for declr in ctx.declaration(): + self.stmtList.extend(self.subStmtList + self.visit(declr)) + self.subStmtList = [] + self.virtualRegCount = 0 + for instr in ctx.instruction(): self.stmtList.extend(self.subStmtList + self.visit(instr)) self.subStmtList = [] self.virtualRegCount = 0 return [] - + def visitStrict_ilist(self, ctx: tlangParser.Strict_ilistContext): # TODO: code refactoring. visitInstruction_list and visitStrict_ilist have same body instrList = [] diff --git a/ChironCore/example/demo/rangoli.tl b/ChironCore/example/demo/rangoli.tl index 1f286ba..66c5a5e 100644 --- a/ChironCore/example/demo/rangoli.tl +++ b/ChironCore/example/demo/rangoli.tl @@ -55,11 +55,11 @@ def drawRangoli(:size) return } -penup class :Point { :x = -300 :y = -300 } +penup :point = new :Point() goto (:point.:x, :point.:y) diff --git a/ChironCore/example/test.tl b/ChironCore/example/test.tl index d227211..1a0b1da 100644 --- a/ChironCore/example/test.tl +++ b/ChironCore/example/test.tl @@ -1,5 +1,10 @@ + def add(:a, :b) { return :a + :b } -print(add(add(2, 3), 4)) +def increment(:a) +{ + return add(:a, 1) +} +print(increment(4)) diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index cbccfc2..fa2cb60 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -4,12 +4,16 @@ grammar tlang; start : instruction_list EOF ; -instruction_list : (instruction)* +instruction_list : (instruction | declaration)* ; strict_ilist : (instruction)+ ; +declaration : classDeclaration + | functionDeclaration + ; + instruction : functionCallWithReturnValues | assignment | printStatement @@ -19,9 +23,7 @@ instruction : functionCallWithReturnValues | penCommand | gotoCommand | pauseCommand - | classDeclaration | objectInstantiation - | functionDeclaration | functionCall | returnStatement ; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index 6b9e0e0..ee42b4b 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -96,6 +96,7 @@ rule names: start instruction_list strict_ilist +declaration instruction conditional ifConditional @@ -134,4 +135,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 380, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 83, 10, 3, 12, 3, 14, 3, 86, 11, 3, 3, 4, 6, 4, 89, 10, 4, 13, 4, 14, 4, 90, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 107, 10, 5, 3, 6, 3, 6, 5, 6, 111, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 155, 10, 15, 12, 15, 14, 15, 158, 11, 15, 5, 15, 160, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 166, 10, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 186, 10, 21, 12, 21, 14, 21, 189, 11, 21, 5, 21, 191, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 206, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 216, 10, 22, 12, 22, 14, 22, 219, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 227, 10, 23, 12, 23, 14, 23, 230, 11, 23, 5, 23, 232, 10, 23, 3, 23, 5, 23, 235, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 7, 24, 242, 10, 24, 12, 24, 14, 24, 245, 11, 24, 3, 24, 7, 24, 248, 10, 24, 12, 24, 14, 24, 251, 11, 24, 3, 25, 3, 25, 5, 25, 255, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 6, 27, 271, 10, 27, 13, 27, 14, 27, 272, 3, 28, 3, 28, 3, 29, 3, 29, 5, 29, 279, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 292, 10, 31, 3, 31, 7, 31, 295, 10, 31, 12, 31, 14, 31, 298, 11, 31, 3, 32, 3, 32, 5, 32, 302, 10, 32, 3, 32, 3, 32, 3, 32, 5, 32, 307, 10, 32, 6, 32, 309, 10, 32, 13, 32, 14, 32, 310, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 7, 34, 328, 10, 34, 12, 34, 14, 34, 331, 11, 34, 5, 34, 333, 10, 34, 3, 35, 3, 35, 3, 35, 7, 35, 338, 10, 35, 12, 35, 14, 35, 341, 11, 35, 5, 35, 343, 10, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 357, 10, 36, 3, 36, 3, 36, 3, 36, 3, 36, 7, 36, 363, 10, 36, 12, 36, 14, 36, 366, 11, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 5, 39, 378, 10, 39, 3, 39, 2, 4, 42, 70, 40, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 3, 2, 33, 38, 3, 2, 39, 40, 2, 394, 2, 78, 3, 2, 2, 2, 4, 84, 3, 2, 2, 2, 6, 88, 3, 2, 2, 2, 8, 106, 3, 2, 2, 2, 10, 110, 3, 2, 2, 2, 12, 112, 3, 2, 2, 2, 14, 118, 3, 2, 2, 2, 16, 128, 3, 2, 2, 2, 18, 134, 3, 2, 2, 2, 20, 141, 3, 2, 2, 2, 22, 144, 3, 2, 2, 2, 24, 146, 3, 2, 2, 2, 26, 148, 3, 2, 2, 2, 28, 150, 3, 2, 2, 2, 30, 165, 3, 2, 2, 2, 32, 170, 3, 2, 2, 2, 34, 175, 3, 2, 2, 2, 36, 177, 3, 2, 2, 2, 38, 179, 3, 2, 2, 2, 40, 181, 3, 2, 2, 2, 42, 205, 3, 2, 2, 2, 44, 220, 3, 2, 2, 2, 46, 243, 3, 2, 2, 2, 48, 254, 3, 2, 2, 2, 50, 256, 3, 2, 2, 2, 52, 263, 3, 2, 2, 2, 54, 274, 3, 2, 2, 2, 56, 278, 3, 2, 2, 2, 58, 280, 3, 2, 2, 2, 60, 296, 3, 2, 2, 2, 62, 301, 3, 2, 2, 2, 64, 315, 3, 2, 2, 2, 66, 332, 3, 2, 2, 2, 68, 342, 3, 2, 2, 2, 70, 356, 3, 2, 2, 2, 72, 367, 3, 2, 2, 2, 74, 369, 3, 2, 2, 2, 76, 377, 3, 2, 2, 2, 78, 79, 5, 4, 3, 2, 79, 80, 7, 2, 2, 3, 80, 3, 3, 2, 2, 2, 81, 83, 5, 8, 5, 2, 82, 81, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 5, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 87, 89, 5, 8, 5, 2, 88, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 7, 3, 2, 2, 2, 92, 107, 5, 62, 32, 2, 93, 107, 5, 30, 16, 2, 94, 107, 5, 32, 17, 2, 95, 107, 5, 10, 6, 2, 96, 107, 5, 16, 9, 2, 97, 107, 5, 20, 11, 2, 98, 107, 5, 24, 13, 2, 99, 107, 5, 18, 10, 2, 100, 107, 5, 26, 14, 2, 101, 107, 5, 44, 23, 2, 102, 107, 5, 50, 26, 2, 103, 107, 5, 64, 33, 2, 104, 107, 5, 58, 30, 2, 105, 107, 5, 40, 21, 2, 106, 92, 3, 2, 2, 2, 106, 93, 3, 2, 2, 2, 106, 94, 3, 2, 2, 2, 106, 95, 3, 2, 2, 2, 106, 96, 3, 2, 2, 2, 106, 97, 3, 2, 2, 2, 106, 98, 3, 2, 2, 2, 106, 99, 3, 2, 2, 2, 106, 100, 3, 2, 2, 2, 106, 101, 3, 2, 2, 2, 106, 102, 3, 2, 2, 2, 106, 103, 3, 2, 2, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, 2, 107, 9, 3, 2, 2, 2, 108, 111, 5, 12, 7, 2, 109, 111, 5, 14, 8, 2, 110, 108, 3, 2, 2, 2, 110, 109, 3, 2, 2, 2, 111, 11, 3, 2, 2, 2, 112, 113, 7, 3, 2, 2, 113, 114, 5, 70, 36, 2, 114, 115, 7, 4, 2, 2, 115, 116, 5, 6, 4, 2, 116, 117, 7, 5, 2, 2, 117, 13, 3, 2, 2, 2, 118, 119, 7, 3, 2, 2, 119, 120, 5, 70, 36, 2, 120, 121, 7, 4, 2, 2, 121, 122, 5, 6, 4, 2, 122, 123, 7, 5, 2, 2, 123, 124, 7, 6, 2, 2, 124, 125, 7, 4, 2, 2, 125, 126, 5, 6, 4, 2, 126, 127, 7, 5, 2, 2, 127, 15, 3, 2, 2, 2, 128, 129, 7, 7, 2, 2, 129, 130, 5, 76, 39, 2, 130, 131, 7, 4, 2, 2, 131, 132, 5, 6, 4, 2, 132, 133, 7, 5, 2, 2, 133, 17, 3, 2, 2, 2, 134, 135, 7, 8, 2, 2, 135, 136, 7, 9, 2, 2, 136, 137, 5, 42, 22, 2, 137, 138, 7, 10, 2, 2, 138, 139, 5, 42, 22, 2, 139, 140, 7, 11, 2, 2, 140, 19, 3, 2, 2, 2, 141, 142, 5, 22, 12, 2, 142, 143, 5, 42, 22, 2, 143, 21, 3, 2, 2, 2, 144, 145, 9, 2, 2, 2, 145, 23, 3, 2, 2, 2, 146, 147, 9, 3, 2, 2, 147, 25, 3, 2, 2, 2, 148, 149, 7, 18, 2, 2, 149, 27, 3, 2, 2, 2, 150, 159, 7, 4, 2, 2, 151, 156, 5, 42, 22, 2, 152, 153, 7, 10, 2, 2, 153, 155, 5, 42, 22, 2, 154, 152, 3, 2, 2, 2, 155, 158, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 159, 151, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 162, 7, 5, 2, 2, 162, 29, 3, 2, 2, 2, 163, 166, 7, 44, 2, 2, 164, 166, 5, 52, 27, 2, 165, 163, 3, 2, 2, 2, 165, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 7, 19, 2, 2, 168, 169, 5, 42, 22, 2, 169, 31, 3, 2, 2, 2, 170, 171, 7, 20, 2, 2, 171, 172, 7, 9, 2, 2, 172, 173, 5, 42, 22, 2, 173, 174, 7, 11, 2, 2, 174, 33, 3, 2, 2, 2, 175, 176, 9, 4, 2, 2, 176, 35, 3, 2, 2, 2, 177, 178, 9, 5, 2, 2, 178, 37, 3, 2, 2, 2, 179, 180, 7, 29, 2, 2, 180, 39, 3, 2, 2, 2, 181, 190, 7, 21, 2, 2, 182, 187, 5, 42, 22, 2, 183, 184, 7, 10, 2, 2, 184, 186, 5, 42, 22, 2, 185, 183, 3, 2, 2, 2, 186, 189, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188, 191, 3, 2, 2, 2, 189, 187, 3, 2, 2, 2, 190, 182, 3, 2, 2, 2, 190, 191, 3, 2, 2, 2, 191, 41, 3, 2, 2, 2, 192, 193, 8, 22, 1, 2, 193, 194, 5, 38, 20, 2, 194, 195, 5, 42, 22, 8, 195, 206, 3, 2, 2, 2, 196, 197, 5, 56, 29, 2, 197, 198, 7, 19, 2, 2, 198, 199, 5, 42, 22, 5, 199, 206, 3, 2, 2, 2, 200, 201, 7, 9, 2, 2, 201, 202, 5, 42, 22, 2, 202, 203, 7, 11, 2, 2, 203, 206, 3, 2, 2, 2, 204, 206, 5, 76, 39, 2, 205, 192, 3, 2, 2, 2, 205, 196, 3, 2, 2, 2, 205, 200, 3, 2, 2, 2, 205, 204, 3, 2, 2, 2, 206, 217, 3, 2, 2, 2, 207, 208, 12, 7, 2, 2, 208, 209, 5, 34, 18, 2, 209, 210, 5, 42, 22, 8, 210, 216, 3, 2, 2, 2, 211, 212, 12, 6, 2, 2, 212, 213, 5, 36, 19, 2, 213, 214, 5, 42, 22, 7, 214, 216, 3, 2, 2, 2, 215, 207, 3, 2, 2, 2, 215, 211, 3, 2, 2, 2, 216, 219, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 43, 3, 2, 2, 2, 219, 217, 3, 2, 2, 2, 220, 221, 7, 22, 2, 2, 221, 234, 7, 44, 2, 2, 222, 223, 7, 9, 2, 2, 223, 231, 7, 44, 2, 2, 224, 228, 7, 10, 2, 2, 225, 227, 7, 44, 2, 2, 226, 225, 3, 2, 2, 2, 227, 230, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 232, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 231, 224, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 233, 3, 2, 2, 2, 233, 235, 7, 11, 2, 2, 234, 222, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 236, 3, 2, 2, 2, 236, 237, 7, 23, 2, 2, 237, 238, 5, 46, 24, 2, 238, 239, 7, 24, 2, 2, 239, 45, 3, 2, 2, 2, 240, 242, 5, 48, 25, 2, 241, 240, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 249, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 246, 248, 5, 64, 33, 2, 247, 246, 3, 2, 2, 2, 248, 251, 3, 2, 2, 2, 249, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 47, 3, 2, 2, 2, 251, 249, 3, 2, 2, 2, 252, 255, 5, 30, 16, 2, 253, 255, 5, 50, 26, 2, 254, 252, 3, 2, 2, 2, 254, 253, 3, 2, 2, 2, 255, 49, 3, 2, 2, 2, 256, 257, 5, 56, 29, 2, 257, 258, 7, 19, 2, 2, 258, 259, 7, 25, 2, 2, 259, 260, 7, 44, 2, 2, 260, 261, 7, 9, 2, 2, 261, 262, 7, 11, 2, 2, 262, 51, 3, 2, 2, 2, 263, 270, 5, 54, 28, 2, 264, 265, 7, 26, 2, 2, 265, 271, 7, 44, 2, 2, 266, 267, 7, 4, 2, 2, 267, 268, 5, 42, 22, 2, 268, 269, 7, 5, 2, 2, 269, 271, 3, 2, 2, 2, 270, 264, 3, 2, 2, 2, 270, 266, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 53, 3, 2, 2, 2, 274, 275, 7, 44, 2, 2, 275, 55, 3, 2, 2, 2, 276, 279, 7, 44, 2, 2, 277, 279, 5, 52, 27, 2, 278, 276, 3, 2, 2, 2, 278, 277, 3, 2, 2, 2, 279, 57, 3, 2, 2, 2, 280, 281, 5, 60, 31, 2, 281, 282, 7, 45, 2, 2, 282, 283, 7, 9, 2, 2, 283, 284, 5, 68, 35, 2, 284, 285, 7, 11, 2, 2, 285, 59, 3, 2, 2, 2, 286, 292, 7, 44, 2, 2, 287, 288, 7, 4, 2, 2, 288, 289, 5, 42, 22, 2, 289, 290, 7, 5, 2, 2, 290, 292, 3, 2, 2, 2, 291, 286, 3, 2, 2, 2, 291, 287, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 295, 7, 26, 2, 2, 294, 291, 3, 2, 2, 2, 295, 298, 3, 2, 2, 2, 296, 294, 3, 2, 2, 2, 296, 297, 3, 2, 2, 2, 297, 61, 3, 2, 2, 2, 298, 296, 3, 2, 2, 2, 299, 302, 7, 44, 2, 2, 300, 302, 5, 52, 27, 2, 301, 299, 3, 2, 2, 2, 301, 300, 3, 2, 2, 2, 302, 308, 3, 2, 2, 2, 303, 306, 7, 10, 2, 2, 304, 307, 7, 44, 2, 2, 305, 307, 5, 52, 27, 2, 306, 304, 3, 2, 2, 2, 306, 305, 3, 2, 2, 2, 307, 309, 3, 2, 2, 2, 308, 303, 3, 2, 2, 2, 309, 310, 3, 2, 2, 2, 310, 308, 3, 2, 2, 2, 310, 311, 3, 2, 2, 2, 311, 312, 3, 2, 2, 2, 312, 313, 7, 19, 2, 2, 313, 314, 5, 58, 30, 2, 314, 63, 3, 2, 2, 2, 315, 316, 7, 27, 2, 2, 316, 317, 7, 45, 2, 2, 317, 318, 7, 9, 2, 2, 318, 319, 5, 66, 34, 2, 319, 320, 7, 11, 2, 2, 320, 321, 7, 23, 2, 2, 321, 322, 5, 6, 4, 2, 322, 323, 7, 24, 2, 2, 323, 65, 3, 2, 2, 2, 324, 329, 7, 44, 2, 2, 325, 326, 7, 10, 2, 2, 326, 328, 7, 44, 2, 2, 327, 325, 3, 2, 2, 2, 328, 331, 3, 2, 2, 2, 329, 327, 3, 2, 2, 2, 329, 330, 3, 2, 2, 2, 330, 333, 3, 2, 2, 2, 331, 329, 3, 2, 2, 2, 332, 324, 3, 2, 2, 2, 332, 333, 3, 2, 2, 2, 333, 67, 3, 2, 2, 2, 334, 339, 5, 42, 22, 2, 335, 336, 7, 10, 2, 2, 336, 338, 5, 42, 22, 2, 337, 335, 3, 2, 2, 2, 338, 341, 3, 2, 2, 2, 339, 337, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 343, 3, 2, 2, 2, 341, 339, 3, 2, 2, 2, 342, 334, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 69, 3, 2, 2, 2, 344, 345, 8, 36, 1, 2, 345, 346, 7, 41, 2, 2, 346, 357, 5, 70, 36, 7, 347, 348, 5, 42, 22, 2, 348, 349, 5, 72, 37, 2, 349, 350, 5, 42, 22, 2, 350, 357, 3, 2, 2, 2, 351, 357, 7, 32, 2, 2, 352, 353, 7, 9, 2, 2, 353, 354, 5, 70, 36, 2, 354, 355, 7, 11, 2, 2, 355, 357, 3, 2, 2, 2, 356, 344, 3, 2, 2, 2, 356, 347, 3, 2, 2, 2, 356, 351, 3, 2, 2, 2, 356, 352, 3, 2, 2, 2, 357, 364, 3, 2, 2, 2, 358, 359, 12, 5, 2, 2, 359, 360, 5, 74, 38, 2, 360, 361, 5, 70, 36, 6, 361, 363, 3, 2, 2, 2, 362, 358, 3, 2, 2, 2, 363, 366, 3, 2, 2, 2, 364, 362, 3, 2, 2, 2, 364, 365, 3, 2, 2, 2, 365, 71, 3, 2, 2, 2, 366, 364, 3, 2, 2, 2, 367, 368, 9, 6, 2, 2, 368, 73, 3, 2, 2, 2, 369, 370, 9, 7, 2, 2, 370, 75, 3, 2, 2, 2, 371, 378, 7, 42, 2, 2, 372, 378, 7, 44, 2, 2, 373, 378, 5, 28, 15, 2, 374, 378, 5, 52, 27, 2, 375, 378, 5, 58, 30, 2, 376, 378, 7, 43, 2, 2, 377, 371, 3, 2, 2, 2, 377, 372, 3, 2, 2, 2, 377, 373, 3, 2, 2, 2, 377, 374, 3, 2, 2, 2, 377, 375, 3, 2, 2, 2, 377, 376, 3, 2, 2, 2, 378, 77, 3, 2, 2, 2, 35, 84, 90, 106, 110, 156, 159, 165, 187, 190, 205, 215, 217, 228, 231, 234, 243, 249, 254, 270, 272, 278, 291, 296, 301, 306, 310, 329, 332, 339, 342, 356, 364, 377] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 385, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 7, 3, 86, 10, 3, 12, 3, 14, 3, 89, 11, 3, 3, 4, 6, 4, 92, 10, 4, 13, 4, 14, 4, 93, 3, 5, 3, 5, 5, 5, 98, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 112, 10, 6, 3, 7, 3, 7, 5, 7, 116, 10, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 7, 16, 160, 10, 16, 12, 16, 14, 16, 163, 11, 16, 5, 16, 165, 10, 16, 3, 16, 3, 16, 3, 17, 3, 17, 5, 17, 171, 10, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 191, 10, 22, 12, 22, 14, 22, 194, 11, 22, 5, 22, 196, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 211, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 221, 10, 23, 12, 23, 14, 23, 224, 11, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 232, 10, 24, 12, 24, 14, 24, 235, 11, 24, 5, 24, 237, 10, 24, 3, 24, 5, 24, 240, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 7, 25, 247, 10, 25, 12, 25, 14, 25, 250, 11, 25, 3, 25, 7, 25, 253, 10, 25, 12, 25, 14, 25, 256, 11, 25, 3, 26, 3, 26, 5, 26, 260, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 6, 28, 276, 10, 28, 13, 28, 14, 28, 277, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 284, 10, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 297, 10, 32, 3, 32, 7, 32, 300, 10, 32, 12, 32, 14, 32, 303, 11, 32, 3, 33, 3, 33, 5, 33, 307, 10, 33, 3, 33, 3, 33, 3, 33, 5, 33, 312, 10, 33, 6, 33, 314, 10, 33, 13, 33, 14, 33, 315, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 7, 35, 333, 10, 35, 12, 35, 14, 35, 336, 11, 35, 5, 35, 338, 10, 35, 3, 36, 3, 36, 3, 36, 7, 36, 343, 10, 36, 12, 36, 14, 36, 346, 11, 36, 5, 36, 348, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 362, 10, 37, 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 368, 10, 37, 12, 37, 14, 37, 371, 11, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 5, 40, 383, 10, 40, 3, 40, 2, 4, 44, 72, 41, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 3, 2, 33, 38, 3, 2, 39, 40, 2, 398, 2, 80, 3, 2, 2, 2, 4, 87, 3, 2, 2, 2, 6, 91, 3, 2, 2, 2, 8, 97, 3, 2, 2, 2, 10, 111, 3, 2, 2, 2, 12, 115, 3, 2, 2, 2, 14, 117, 3, 2, 2, 2, 16, 123, 3, 2, 2, 2, 18, 133, 3, 2, 2, 2, 20, 139, 3, 2, 2, 2, 22, 146, 3, 2, 2, 2, 24, 149, 3, 2, 2, 2, 26, 151, 3, 2, 2, 2, 28, 153, 3, 2, 2, 2, 30, 155, 3, 2, 2, 2, 32, 170, 3, 2, 2, 2, 34, 175, 3, 2, 2, 2, 36, 180, 3, 2, 2, 2, 38, 182, 3, 2, 2, 2, 40, 184, 3, 2, 2, 2, 42, 186, 3, 2, 2, 2, 44, 210, 3, 2, 2, 2, 46, 225, 3, 2, 2, 2, 48, 248, 3, 2, 2, 2, 50, 259, 3, 2, 2, 2, 52, 261, 3, 2, 2, 2, 54, 268, 3, 2, 2, 2, 56, 279, 3, 2, 2, 2, 58, 283, 3, 2, 2, 2, 60, 285, 3, 2, 2, 2, 62, 301, 3, 2, 2, 2, 64, 306, 3, 2, 2, 2, 66, 320, 3, 2, 2, 2, 68, 337, 3, 2, 2, 2, 70, 347, 3, 2, 2, 2, 72, 361, 3, 2, 2, 2, 74, 372, 3, 2, 2, 2, 76, 374, 3, 2, 2, 2, 78, 382, 3, 2, 2, 2, 80, 81, 5, 4, 3, 2, 81, 82, 7, 2, 2, 3, 82, 3, 3, 2, 2, 2, 83, 86, 5, 10, 6, 2, 84, 86, 5, 8, 5, 2, 85, 83, 3, 2, 2, 2, 85, 84, 3, 2, 2, 2, 86, 89, 3, 2, 2, 2, 87, 85, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 5, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 90, 92, 5, 10, 6, 2, 91, 90, 3, 2, 2, 2, 92, 93, 3, 2, 2, 2, 93, 91, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 7, 3, 2, 2, 2, 95, 98, 5, 46, 24, 2, 96, 98, 5, 66, 34, 2, 97, 95, 3, 2, 2, 2, 97, 96, 3, 2, 2, 2, 98, 9, 3, 2, 2, 2, 99, 112, 5, 64, 33, 2, 100, 112, 5, 32, 17, 2, 101, 112, 5, 34, 18, 2, 102, 112, 5, 12, 7, 2, 103, 112, 5, 18, 10, 2, 104, 112, 5, 22, 12, 2, 105, 112, 5, 26, 14, 2, 106, 112, 5, 20, 11, 2, 107, 112, 5, 28, 15, 2, 108, 112, 5, 52, 27, 2, 109, 112, 5, 60, 31, 2, 110, 112, 5, 42, 22, 2, 111, 99, 3, 2, 2, 2, 111, 100, 3, 2, 2, 2, 111, 101, 3, 2, 2, 2, 111, 102, 3, 2, 2, 2, 111, 103, 3, 2, 2, 2, 111, 104, 3, 2, 2, 2, 111, 105, 3, 2, 2, 2, 111, 106, 3, 2, 2, 2, 111, 107, 3, 2, 2, 2, 111, 108, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 111, 110, 3, 2, 2, 2, 112, 11, 3, 2, 2, 2, 113, 116, 5, 14, 8, 2, 114, 116, 5, 16, 9, 2, 115, 113, 3, 2, 2, 2, 115, 114, 3, 2, 2, 2, 116, 13, 3, 2, 2, 2, 117, 118, 7, 3, 2, 2, 118, 119, 5, 72, 37, 2, 119, 120, 7, 4, 2, 2, 120, 121, 5, 6, 4, 2, 121, 122, 7, 5, 2, 2, 122, 15, 3, 2, 2, 2, 123, 124, 7, 3, 2, 2, 124, 125, 5, 72, 37, 2, 125, 126, 7, 4, 2, 2, 126, 127, 5, 6, 4, 2, 127, 128, 7, 5, 2, 2, 128, 129, 7, 6, 2, 2, 129, 130, 7, 4, 2, 2, 130, 131, 5, 6, 4, 2, 131, 132, 7, 5, 2, 2, 132, 17, 3, 2, 2, 2, 133, 134, 7, 7, 2, 2, 134, 135, 5, 78, 40, 2, 135, 136, 7, 4, 2, 2, 136, 137, 5, 6, 4, 2, 137, 138, 7, 5, 2, 2, 138, 19, 3, 2, 2, 2, 139, 140, 7, 8, 2, 2, 140, 141, 7, 9, 2, 2, 141, 142, 5, 44, 23, 2, 142, 143, 7, 10, 2, 2, 143, 144, 5, 44, 23, 2, 144, 145, 7, 11, 2, 2, 145, 21, 3, 2, 2, 2, 146, 147, 5, 24, 13, 2, 147, 148, 5, 44, 23, 2, 148, 23, 3, 2, 2, 2, 149, 150, 9, 2, 2, 2, 150, 25, 3, 2, 2, 2, 151, 152, 9, 3, 2, 2, 152, 27, 3, 2, 2, 2, 153, 154, 7, 18, 2, 2, 154, 29, 3, 2, 2, 2, 155, 164, 7, 4, 2, 2, 156, 161, 5, 44, 23, 2, 157, 158, 7, 10, 2, 2, 158, 160, 5, 44, 23, 2, 159, 157, 3, 2, 2, 2, 160, 163, 3, 2, 2, 2, 161, 159, 3, 2, 2, 2, 161, 162, 3, 2, 2, 2, 162, 165, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 164, 156, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 167, 7, 5, 2, 2, 167, 31, 3, 2, 2, 2, 168, 171, 7, 44, 2, 2, 169, 171, 5, 54, 28, 2, 170, 168, 3, 2, 2, 2, 170, 169, 3, 2, 2, 2, 171, 172, 3, 2, 2, 2, 172, 173, 7, 19, 2, 2, 173, 174, 5, 44, 23, 2, 174, 33, 3, 2, 2, 2, 175, 176, 7, 20, 2, 2, 176, 177, 7, 9, 2, 2, 177, 178, 5, 44, 23, 2, 178, 179, 7, 11, 2, 2, 179, 35, 3, 2, 2, 2, 180, 181, 9, 4, 2, 2, 181, 37, 3, 2, 2, 2, 182, 183, 9, 5, 2, 2, 183, 39, 3, 2, 2, 2, 184, 185, 7, 29, 2, 2, 185, 41, 3, 2, 2, 2, 186, 195, 7, 21, 2, 2, 187, 192, 5, 44, 23, 2, 188, 189, 7, 10, 2, 2, 189, 191, 5, 44, 23, 2, 190, 188, 3, 2, 2, 2, 191, 194, 3, 2, 2, 2, 192, 190, 3, 2, 2, 2, 192, 193, 3, 2, 2, 2, 193, 196, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 195, 187, 3, 2, 2, 2, 195, 196, 3, 2, 2, 2, 196, 43, 3, 2, 2, 2, 197, 198, 8, 23, 1, 2, 198, 199, 5, 40, 21, 2, 199, 200, 5, 44, 23, 8, 200, 211, 3, 2, 2, 2, 201, 202, 5, 58, 30, 2, 202, 203, 7, 19, 2, 2, 203, 204, 5, 44, 23, 5, 204, 211, 3, 2, 2, 2, 205, 206, 7, 9, 2, 2, 206, 207, 5, 44, 23, 2, 207, 208, 7, 11, 2, 2, 208, 211, 3, 2, 2, 2, 209, 211, 5, 78, 40, 2, 210, 197, 3, 2, 2, 2, 210, 201, 3, 2, 2, 2, 210, 205, 3, 2, 2, 2, 210, 209, 3, 2, 2, 2, 211, 222, 3, 2, 2, 2, 212, 213, 12, 7, 2, 2, 213, 214, 5, 36, 19, 2, 214, 215, 5, 44, 23, 8, 215, 221, 3, 2, 2, 2, 216, 217, 12, 6, 2, 2, 217, 218, 5, 38, 20, 2, 218, 219, 5, 44, 23, 7, 219, 221, 3, 2, 2, 2, 220, 212, 3, 2, 2, 2, 220, 216, 3, 2, 2, 2, 221, 224, 3, 2, 2, 2, 222, 220, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 45, 3, 2, 2, 2, 224, 222, 3, 2, 2, 2, 225, 226, 7, 22, 2, 2, 226, 239, 7, 44, 2, 2, 227, 228, 7, 9, 2, 2, 228, 236, 7, 44, 2, 2, 229, 233, 7, 10, 2, 2, 230, 232, 7, 44, 2, 2, 231, 230, 3, 2, 2, 2, 232, 235, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 233, 234, 3, 2, 2, 2, 234, 237, 3, 2, 2, 2, 235, 233, 3, 2, 2, 2, 236, 229, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 240, 7, 11, 2, 2, 239, 227, 3, 2, 2, 2, 239, 240, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 242, 7, 23, 2, 2, 242, 243, 5, 48, 25, 2, 243, 244, 7, 24, 2, 2, 244, 47, 3, 2, 2, 2, 245, 247, 5, 50, 26, 2, 246, 245, 3, 2, 2, 2, 247, 250, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 254, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 251, 253, 5, 66, 34, 2, 252, 251, 3, 2, 2, 2, 253, 256, 3, 2, 2, 2, 254, 252, 3, 2, 2, 2, 254, 255, 3, 2, 2, 2, 255, 49, 3, 2, 2, 2, 256, 254, 3, 2, 2, 2, 257, 260, 5, 32, 17, 2, 258, 260, 5, 52, 27, 2, 259, 257, 3, 2, 2, 2, 259, 258, 3, 2, 2, 2, 260, 51, 3, 2, 2, 2, 261, 262, 5, 58, 30, 2, 262, 263, 7, 19, 2, 2, 263, 264, 7, 25, 2, 2, 264, 265, 7, 44, 2, 2, 265, 266, 7, 9, 2, 2, 266, 267, 7, 11, 2, 2, 267, 53, 3, 2, 2, 2, 268, 275, 5, 56, 29, 2, 269, 270, 7, 26, 2, 2, 270, 276, 7, 44, 2, 2, 271, 272, 7, 4, 2, 2, 272, 273, 5, 44, 23, 2, 273, 274, 7, 5, 2, 2, 274, 276, 3, 2, 2, 2, 275, 269, 3, 2, 2, 2, 275, 271, 3, 2, 2, 2, 276, 277, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 55, 3, 2, 2, 2, 279, 280, 7, 44, 2, 2, 280, 57, 3, 2, 2, 2, 281, 284, 7, 44, 2, 2, 282, 284, 5, 54, 28, 2, 283, 281, 3, 2, 2, 2, 283, 282, 3, 2, 2, 2, 284, 59, 3, 2, 2, 2, 285, 286, 5, 62, 32, 2, 286, 287, 7, 45, 2, 2, 287, 288, 7, 9, 2, 2, 288, 289, 5, 70, 36, 2, 289, 290, 7, 11, 2, 2, 290, 61, 3, 2, 2, 2, 291, 297, 7, 44, 2, 2, 292, 293, 7, 4, 2, 2, 293, 294, 5, 44, 23, 2, 294, 295, 7, 5, 2, 2, 295, 297, 3, 2, 2, 2, 296, 291, 3, 2, 2, 2, 296, 292, 3, 2, 2, 2, 297, 298, 3, 2, 2, 2, 298, 300, 7, 26, 2, 2, 299, 296, 3, 2, 2, 2, 300, 303, 3, 2, 2, 2, 301, 299, 3, 2, 2, 2, 301, 302, 3, 2, 2, 2, 302, 63, 3, 2, 2, 2, 303, 301, 3, 2, 2, 2, 304, 307, 7, 44, 2, 2, 305, 307, 5, 54, 28, 2, 306, 304, 3, 2, 2, 2, 306, 305, 3, 2, 2, 2, 307, 313, 3, 2, 2, 2, 308, 311, 7, 10, 2, 2, 309, 312, 7, 44, 2, 2, 310, 312, 5, 54, 28, 2, 311, 309, 3, 2, 2, 2, 311, 310, 3, 2, 2, 2, 312, 314, 3, 2, 2, 2, 313, 308, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 313, 3, 2, 2, 2, 315, 316, 3, 2, 2, 2, 316, 317, 3, 2, 2, 2, 317, 318, 7, 19, 2, 2, 318, 319, 5, 60, 31, 2, 319, 65, 3, 2, 2, 2, 320, 321, 7, 27, 2, 2, 321, 322, 7, 45, 2, 2, 322, 323, 7, 9, 2, 2, 323, 324, 5, 68, 35, 2, 324, 325, 7, 11, 2, 2, 325, 326, 7, 23, 2, 2, 326, 327, 5, 6, 4, 2, 327, 328, 7, 24, 2, 2, 328, 67, 3, 2, 2, 2, 329, 334, 7, 44, 2, 2, 330, 331, 7, 10, 2, 2, 331, 333, 7, 44, 2, 2, 332, 330, 3, 2, 2, 2, 333, 336, 3, 2, 2, 2, 334, 332, 3, 2, 2, 2, 334, 335, 3, 2, 2, 2, 335, 338, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 337, 329, 3, 2, 2, 2, 337, 338, 3, 2, 2, 2, 338, 69, 3, 2, 2, 2, 339, 344, 5, 44, 23, 2, 340, 341, 7, 10, 2, 2, 341, 343, 5, 44, 23, 2, 342, 340, 3, 2, 2, 2, 343, 346, 3, 2, 2, 2, 344, 342, 3, 2, 2, 2, 344, 345, 3, 2, 2, 2, 345, 348, 3, 2, 2, 2, 346, 344, 3, 2, 2, 2, 347, 339, 3, 2, 2, 2, 347, 348, 3, 2, 2, 2, 348, 71, 3, 2, 2, 2, 349, 350, 8, 37, 1, 2, 350, 351, 7, 41, 2, 2, 351, 362, 5, 72, 37, 7, 352, 353, 5, 44, 23, 2, 353, 354, 5, 74, 38, 2, 354, 355, 5, 44, 23, 2, 355, 362, 3, 2, 2, 2, 356, 362, 7, 32, 2, 2, 357, 358, 7, 9, 2, 2, 358, 359, 5, 72, 37, 2, 359, 360, 7, 11, 2, 2, 360, 362, 3, 2, 2, 2, 361, 349, 3, 2, 2, 2, 361, 352, 3, 2, 2, 2, 361, 356, 3, 2, 2, 2, 361, 357, 3, 2, 2, 2, 362, 369, 3, 2, 2, 2, 363, 364, 12, 5, 2, 2, 364, 365, 5, 76, 39, 2, 365, 366, 5, 72, 37, 6, 366, 368, 3, 2, 2, 2, 367, 363, 3, 2, 2, 2, 368, 371, 3, 2, 2, 2, 369, 367, 3, 2, 2, 2, 369, 370, 3, 2, 2, 2, 370, 73, 3, 2, 2, 2, 371, 369, 3, 2, 2, 2, 372, 373, 9, 6, 2, 2, 373, 75, 3, 2, 2, 2, 374, 375, 9, 7, 2, 2, 375, 77, 3, 2, 2, 2, 376, 383, 7, 42, 2, 2, 377, 383, 7, 44, 2, 2, 378, 383, 5, 30, 16, 2, 379, 383, 5, 54, 28, 2, 380, 383, 5, 60, 31, 2, 381, 383, 7, 43, 2, 2, 382, 376, 3, 2, 2, 2, 382, 377, 3, 2, 2, 2, 382, 378, 3, 2, 2, 2, 382, 379, 3, 2, 2, 2, 382, 380, 3, 2, 2, 2, 382, 381, 3, 2, 2, 2, 383, 79, 3, 2, 2, 2, 37, 85, 87, 93, 97, 111, 115, 161, 164, 170, 192, 195, 210, 220, 222, 233, 236, 239, 248, 254, 259, 275, 277, 283, 296, 301, 306, 311, 315, 334, 337, 344, 347, 361, 369, 382] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index 7f90d2a..3582691 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -9,174 +9,175 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3.") - buf.write("\u017c\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\u0181\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36") buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t") - buf.write("&\4\'\t\'\3\2\3\2\3\2\3\3\7\3S\n\3\f\3\16\3V\13\3\3\4") - buf.write("\6\4Y\n\4\r\4\16\4Z\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3") - buf.write("\5\3\5\3\5\3\5\3\5\3\5\5\5k\n\5\3\6\3\6\5\6o\n\6\3\7\3") - buf.write("\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b") - buf.write("\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3") - buf.write("\n\3\13\3\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17") - buf.write("\3\17\3\17\7\17\u009b\n\17\f\17\16\17\u009e\13\17\5\17") - buf.write("\u00a0\n\17\3\17\3\17\3\20\3\20\5\20\u00a6\n\20\3\20\3") - buf.write("\20\3\20\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23") - buf.write("\3\24\3\24\3\25\3\25\3\25\3\25\7\25\u00ba\n\25\f\25\16") - buf.write("\25\u00bd\13\25\5\25\u00bf\n\25\3\26\3\26\3\26\3\26\3") - buf.write("\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u00ce") - buf.write("\n\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\7\26\u00d8") - buf.write("\n\26\f\26\16\26\u00db\13\26\3\27\3\27\3\27\3\27\3\27") - buf.write("\3\27\7\27\u00e3\n\27\f\27\16\27\u00e6\13\27\5\27\u00e8") - buf.write("\n\27\3\27\5\27\u00eb\n\27\3\27\3\27\3\27\3\27\3\30\7") - buf.write("\30\u00f2\n\30\f\30\16\30\u00f5\13\30\3\30\7\30\u00f8") - buf.write("\n\30\f\30\16\30\u00fb\13\30\3\31\3\31\5\31\u00ff\n\31") - buf.write("\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\33") - buf.write("\3\33\3\33\3\33\6\33\u010f\n\33\r\33\16\33\u0110\3\34") - buf.write("\3\34\3\35\3\35\5\35\u0117\n\35\3\36\3\36\3\36\3\36\3") - buf.write("\36\3\36\3\37\3\37\3\37\3\37\3\37\5\37\u0124\n\37\3\37") - buf.write("\7\37\u0127\n\37\f\37\16\37\u012a\13\37\3 \3 \5 \u012e") - buf.write("\n \3 \3 \3 \5 \u0133\n \6 \u0135\n \r \16 \u0136\3 \3") - buf.write(" \3 \3!\3!\3!\3!\3!\3!\3!\3!\3!\3\"\3\"\3\"\7\"\u0148") - buf.write("\n\"\f\"\16\"\u014b\13\"\5\"\u014d\n\"\3#\3#\3#\7#\u0152") - buf.write("\n#\f#\16#\u0155\13#\5#\u0157\n#\3$\3$\3$\3$\3$\3$\3$") - buf.write("\3$\3$\3$\3$\3$\5$\u0165\n$\3$\3$\3$\3$\7$\u016b\n$\f") - buf.write("$\16$\u016e\13$\3%\3%\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\5") - buf.write("\'\u017a\n\'\3\'\2\4*F(\2\4\6\b\n\f\16\20\22\24\26\30") - buf.write("\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJL\2\b\3\2\f\17") - buf.write("\3\2\20\21\3\2\36\37\3\2\34\35\3\2!&\3\2\'(\2\u018a\2") - buf.write("N\3\2\2\2\4T\3\2\2\2\6X\3\2\2\2\bj\3\2\2\2\nn\3\2\2\2") - buf.write("\fp\3\2\2\2\16v\3\2\2\2\20\u0080\3\2\2\2\22\u0086\3\2") - buf.write("\2\2\24\u008d\3\2\2\2\26\u0090\3\2\2\2\30\u0092\3\2\2") - buf.write("\2\32\u0094\3\2\2\2\34\u0096\3\2\2\2\36\u00a5\3\2\2\2") - buf.write(" \u00aa\3\2\2\2\"\u00af\3\2\2\2$\u00b1\3\2\2\2&\u00b3") - buf.write("\3\2\2\2(\u00b5\3\2\2\2*\u00cd\3\2\2\2,\u00dc\3\2\2\2") - buf.write(".\u00f3\3\2\2\2\60\u00fe\3\2\2\2\62\u0100\3\2\2\2\64\u0107") - buf.write("\3\2\2\2\66\u0112\3\2\2\28\u0116\3\2\2\2:\u0118\3\2\2") - buf.write("\2<\u0128\3\2\2\2>\u012d\3\2\2\2@\u013b\3\2\2\2B\u014c") - buf.write("\3\2\2\2D\u0156\3\2\2\2F\u0164\3\2\2\2H\u016f\3\2\2\2") - buf.write("J\u0171\3\2\2\2L\u0179\3\2\2\2NO\5\4\3\2OP\7\2\2\3P\3") - buf.write("\3\2\2\2QS\5\b\5\2RQ\3\2\2\2SV\3\2\2\2TR\3\2\2\2TU\3\2") - buf.write("\2\2U\5\3\2\2\2VT\3\2\2\2WY\5\b\5\2XW\3\2\2\2YZ\3\2\2") - buf.write("\2ZX\3\2\2\2Z[\3\2\2\2[\7\3\2\2\2\\k\5> \2]k\5\36\20\2") - buf.write("^k\5 \21\2_k\5\n\6\2`k\5\20\t\2ak\5\24\13\2bk\5\30\r\2") - buf.write("ck\5\22\n\2dk\5\32\16\2ek\5,\27\2fk\5\62\32\2gk\5@!\2") - buf.write("hk\5:\36\2ik\5(\25\2j\\\3\2\2\2j]\3\2\2\2j^\3\2\2\2j_") - buf.write("\3\2\2\2j`\3\2\2\2ja\3\2\2\2jb\3\2\2\2jc\3\2\2\2jd\3\2") - buf.write("\2\2je\3\2\2\2jf\3\2\2\2jg\3\2\2\2jh\3\2\2\2ji\3\2\2\2") - buf.write("k\t\3\2\2\2lo\5\f\7\2mo\5\16\b\2nl\3\2\2\2nm\3\2\2\2o") - buf.write("\13\3\2\2\2pq\7\3\2\2qr\5F$\2rs\7\4\2\2st\5\6\4\2tu\7") - buf.write("\5\2\2u\r\3\2\2\2vw\7\3\2\2wx\5F$\2xy\7\4\2\2yz\5\6\4") - buf.write("\2z{\7\5\2\2{|\7\6\2\2|}\7\4\2\2}~\5\6\4\2~\177\7\5\2") - buf.write("\2\177\17\3\2\2\2\u0080\u0081\7\7\2\2\u0081\u0082\5L\'") - buf.write("\2\u0082\u0083\7\4\2\2\u0083\u0084\5\6\4\2\u0084\u0085") - buf.write("\7\5\2\2\u0085\21\3\2\2\2\u0086\u0087\7\b\2\2\u0087\u0088") - buf.write("\7\t\2\2\u0088\u0089\5*\26\2\u0089\u008a\7\n\2\2\u008a") - buf.write("\u008b\5*\26\2\u008b\u008c\7\13\2\2\u008c\23\3\2\2\2\u008d") - buf.write("\u008e\5\26\f\2\u008e\u008f\5*\26\2\u008f\25\3\2\2\2\u0090") - buf.write("\u0091\t\2\2\2\u0091\27\3\2\2\2\u0092\u0093\t\3\2\2\u0093") - buf.write("\31\3\2\2\2\u0094\u0095\7\22\2\2\u0095\33\3\2\2\2\u0096") - buf.write("\u009f\7\4\2\2\u0097\u009c\5*\26\2\u0098\u0099\7\n\2\2") - buf.write("\u0099\u009b\5*\26\2\u009a\u0098\3\2\2\2\u009b\u009e\3") - buf.write("\2\2\2\u009c\u009a\3\2\2\2\u009c\u009d\3\2\2\2\u009d\u00a0") - buf.write("\3\2\2\2\u009e\u009c\3\2\2\2\u009f\u0097\3\2\2\2\u009f") - buf.write("\u00a0\3\2\2\2\u00a0\u00a1\3\2\2\2\u00a1\u00a2\7\5\2\2") - buf.write("\u00a2\35\3\2\2\2\u00a3\u00a6\7,\2\2\u00a4\u00a6\5\64") - buf.write("\33\2\u00a5\u00a3\3\2\2\2\u00a5\u00a4\3\2\2\2\u00a6\u00a7") - buf.write("\3\2\2\2\u00a7\u00a8\7\23\2\2\u00a8\u00a9\5*\26\2\u00a9") - buf.write("\37\3\2\2\2\u00aa\u00ab\7\24\2\2\u00ab\u00ac\7\t\2\2\u00ac") - buf.write("\u00ad\5*\26\2\u00ad\u00ae\7\13\2\2\u00ae!\3\2\2\2\u00af") - buf.write("\u00b0\t\4\2\2\u00b0#\3\2\2\2\u00b1\u00b2\t\5\2\2\u00b2") - buf.write("%\3\2\2\2\u00b3\u00b4\7\35\2\2\u00b4\'\3\2\2\2\u00b5\u00be") - buf.write("\7\25\2\2\u00b6\u00bb\5*\26\2\u00b7\u00b8\7\n\2\2\u00b8") - buf.write("\u00ba\5*\26\2\u00b9\u00b7\3\2\2\2\u00ba\u00bd\3\2\2\2") - buf.write("\u00bb\u00b9\3\2\2\2\u00bb\u00bc\3\2\2\2\u00bc\u00bf\3") - buf.write("\2\2\2\u00bd\u00bb\3\2\2\2\u00be\u00b6\3\2\2\2\u00be\u00bf") - buf.write("\3\2\2\2\u00bf)\3\2\2\2\u00c0\u00c1\b\26\1\2\u00c1\u00c2") - buf.write("\5&\24\2\u00c2\u00c3\5*\26\b\u00c3\u00ce\3\2\2\2\u00c4") - buf.write("\u00c5\58\35\2\u00c5\u00c6\7\23\2\2\u00c6\u00c7\5*\26") - buf.write("\5\u00c7\u00ce\3\2\2\2\u00c8\u00c9\7\t\2\2\u00c9\u00ca") - buf.write("\5*\26\2\u00ca\u00cb\7\13\2\2\u00cb\u00ce\3\2\2\2\u00cc") - buf.write("\u00ce\5L\'\2\u00cd\u00c0\3\2\2\2\u00cd\u00c4\3\2\2\2") - buf.write("\u00cd\u00c8\3\2\2\2\u00cd\u00cc\3\2\2\2\u00ce\u00d9\3") - buf.write("\2\2\2\u00cf\u00d0\f\7\2\2\u00d0\u00d1\5\"\22\2\u00d1") - buf.write("\u00d2\5*\26\b\u00d2\u00d8\3\2\2\2\u00d3\u00d4\f\6\2\2") - buf.write("\u00d4\u00d5\5$\23\2\u00d5\u00d6\5*\26\7\u00d6\u00d8\3") - buf.write("\2\2\2\u00d7\u00cf\3\2\2\2\u00d7\u00d3\3\2\2\2\u00d8\u00db") - buf.write("\3\2\2\2\u00d9\u00d7\3\2\2\2\u00d9\u00da\3\2\2\2\u00da") - buf.write("+\3\2\2\2\u00db\u00d9\3\2\2\2\u00dc\u00dd\7\26\2\2\u00dd") - buf.write("\u00ea\7,\2\2\u00de\u00df\7\t\2\2\u00df\u00e7\7,\2\2\u00e0") - buf.write("\u00e4\7\n\2\2\u00e1\u00e3\7,\2\2\u00e2\u00e1\3\2\2\2") - buf.write("\u00e3\u00e6\3\2\2\2\u00e4\u00e2\3\2\2\2\u00e4\u00e5\3") - buf.write("\2\2\2\u00e5\u00e8\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e7\u00e0") - buf.write("\3\2\2\2\u00e7\u00e8\3\2\2\2\u00e8\u00e9\3\2\2\2\u00e9") - buf.write("\u00eb\7\13\2\2\u00ea\u00de\3\2\2\2\u00ea\u00eb\3\2\2") - buf.write("\2\u00eb\u00ec\3\2\2\2\u00ec\u00ed\7\27\2\2\u00ed\u00ee") - buf.write("\5.\30\2\u00ee\u00ef\7\30\2\2\u00ef-\3\2\2\2\u00f0\u00f2") - buf.write("\5\60\31\2\u00f1\u00f0\3\2\2\2\u00f2\u00f5\3\2\2\2\u00f3") - buf.write("\u00f1\3\2\2\2\u00f3\u00f4\3\2\2\2\u00f4\u00f9\3\2\2\2") - buf.write("\u00f5\u00f3\3\2\2\2\u00f6\u00f8\5@!\2\u00f7\u00f6\3\2") - buf.write("\2\2\u00f8\u00fb\3\2\2\2\u00f9\u00f7\3\2\2\2\u00f9\u00fa") - buf.write("\3\2\2\2\u00fa/\3\2\2\2\u00fb\u00f9\3\2\2\2\u00fc\u00ff") - buf.write("\5\36\20\2\u00fd\u00ff\5\62\32\2\u00fe\u00fc\3\2\2\2\u00fe") - buf.write("\u00fd\3\2\2\2\u00ff\61\3\2\2\2\u0100\u0101\58\35\2\u0101") - buf.write("\u0102\7\23\2\2\u0102\u0103\7\31\2\2\u0103\u0104\7,\2") - buf.write("\2\u0104\u0105\7\t\2\2\u0105\u0106\7\13\2\2\u0106\63\3") - buf.write("\2\2\2\u0107\u010e\5\66\34\2\u0108\u0109\7\32\2\2\u0109") - buf.write("\u010f\7,\2\2\u010a\u010b\7\4\2\2\u010b\u010c\5*\26\2") - buf.write("\u010c\u010d\7\5\2\2\u010d\u010f\3\2\2\2\u010e\u0108\3") - buf.write("\2\2\2\u010e\u010a\3\2\2\2\u010f\u0110\3\2\2\2\u0110\u010e") - buf.write("\3\2\2\2\u0110\u0111\3\2\2\2\u0111\65\3\2\2\2\u0112\u0113") - buf.write("\7,\2\2\u0113\67\3\2\2\2\u0114\u0117\7,\2\2\u0115\u0117") - buf.write("\5\64\33\2\u0116\u0114\3\2\2\2\u0116\u0115\3\2\2\2\u0117") - buf.write("9\3\2\2\2\u0118\u0119\5<\37\2\u0119\u011a\7-\2\2\u011a") - buf.write("\u011b\7\t\2\2\u011b\u011c\5D#\2\u011c\u011d\7\13\2\2") - buf.write("\u011d;\3\2\2\2\u011e\u0124\7,\2\2\u011f\u0120\7\4\2\2") - buf.write("\u0120\u0121\5*\26\2\u0121\u0122\7\5\2\2\u0122\u0124\3") - buf.write("\2\2\2\u0123\u011e\3\2\2\2\u0123\u011f\3\2\2\2\u0124\u0125") - buf.write("\3\2\2\2\u0125\u0127\7\32\2\2\u0126\u0123\3\2\2\2\u0127") - buf.write("\u012a\3\2\2\2\u0128\u0126\3\2\2\2\u0128\u0129\3\2\2\2") - buf.write("\u0129=\3\2\2\2\u012a\u0128\3\2\2\2\u012b\u012e\7,\2\2") - buf.write("\u012c\u012e\5\64\33\2\u012d\u012b\3\2\2\2\u012d\u012c") - buf.write("\3\2\2\2\u012e\u0134\3\2\2\2\u012f\u0132\7\n\2\2\u0130") - buf.write("\u0133\7,\2\2\u0131\u0133\5\64\33\2\u0132\u0130\3\2\2") - buf.write("\2\u0132\u0131\3\2\2\2\u0133\u0135\3\2\2\2\u0134\u012f") - buf.write("\3\2\2\2\u0135\u0136\3\2\2\2\u0136\u0134\3\2\2\2\u0136") - buf.write("\u0137\3\2\2\2\u0137\u0138\3\2\2\2\u0138\u0139\7\23\2") - buf.write("\2\u0139\u013a\5:\36\2\u013a?\3\2\2\2\u013b\u013c\7\33") - buf.write("\2\2\u013c\u013d\7-\2\2\u013d\u013e\7\t\2\2\u013e\u013f") - buf.write("\5B\"\2\u013f\u0140\7\13\2\2\u0140\u0141\7\27\2\2\u0141") - buf.write("\u0142\5\6\4\2\u0142\u0143\7\30\2\2\u0143A\3\2\2\2\u0144") - buf.write("\u0149\7,\2\2\u0145\u0146\7\n\2\2\u0146\u0148\7,\2\2\u0147") - buf.write("\u0145\3\2\2\2\u0148\u014b\3\2\2\2\u0149\u0147\3\2\2\2") - buf.write("\u0149\u014a\3\2\2\2\u014a\u014d\3\2\2\2\u014b\u0149\3") - buf.write("\2\2\2\u014c\u0144\3\2\2\2\u014c\u014d\3\2\2\2\u014dC") - buf.write("\3\2\2\2\u014e\u0153\5*\26\2\u014f\u0150\7\n\2\2\u0150") - buf.write("\u0152\5*\26\2\u0151\u014f\3\2\2\2\u0152\u0155\3\2\2\2") - buf.write("\u0153\u0151\3\2\2\2\u0153\u0154\3\2\2\2\u0154\u0157\3") - buf.write("\2\2\2\u0155\u0153\3\2\2\2\u0156\u014e\3\2\2\2\u0156\u0157") - buf.write("\3\2\2\2\u0157E\3\2\2\2\u0158\u0159\b$\1\2\u0159\u015a") - buf.write("\7)\2\2\u015a\u0165\5F$\7\u015b\u015c\5*\26\2\u015c\u015d") - buf.write("\5H%\2\u015d\u015e\5*\26\2\u015e\u0165\3\2\2\2\u015f\u0165") - buf.write("\7 \2\2\u0160\u0161\7\t\2\2\u0161\u0162\5F$\2\u0162\u0163") - buf.write("\7\13\2\2\u0163\u0165\3\2\2\2\u0164\u0158\3\2\2\2\u0164") - buf.write("\u015b\3\2\2\2\u0164\u015f\3\2\2\2\u0164\u0160\3\2\2\2") - buf.write("\u0165\u016c\3\2\2\2\u0166\u0167\f\5\2\2\u0167\u0168\5") - buf.write("J&\2\u0168\u0169\5F$\6\u0169\u016b\3\2\2\2\u016a\u0166") - buf.write("\3\2\2\2\u016b\u016e\3\2\2\2\u016c\u016a\3\2\2\2\u016c") - buf.write("\u016d\3\2\2\2\u016dG\3\2\2\2\u016e\u016c\3\2\2\2\u016f") - buf.write("\u0170\t\6\2\2\u0170I\3\2\2\2\u0171\u0172\t\7\2\2\u0172") - buf.write("K\3\2\2\2\u0173\u017a\7*\2\2\u0174\u017a\7,\2\2\u0175") - buf.write("\u017a\5\34\17\2\u0176\u017a\5\64\33\2\u0177\u017a\5:") - buf.write("\36\2\u0178\u017a\7+\2\2\u0179\u0173\3\2\2\2\u0179\u0174") - buf.write("\3\2\2\2\u0179\u0175\3\2\2\2\u0179\u0176\3\2\2\2\u0179") - buf.write("\u0177\3\2\2\2\u0179\u0178\3\2\2\2\u017aM\3\2\2\2#TZj") - buf.write("n\u009c\u009f\u00a5\u00bb\u00be\u00cd\u00d7\u00d9\u00e4") - buf.write("\u00e7\u00ea\u00f3\u00f9\u00fe\u010e\u0110\u0116\u0123") - buf.write("\u0128\u012d\u0132\u0136\u0149\u014c\u0153\u0156\u0164") - buf.write("\u016c\u0179") + buf.write("&\4\'\t\'\4(\t(\3\2\3\2\3\2\3\3\3\3\7\3V\n\3\f\3\16\3") + buf.write("Y\13\3\3\4\6\4\\\n\4\r\4\16\4]\3\5\3\5\5\5b\n\5\3\6\3") + buf.write("\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\5\6p\n\6\3") + buf.write("\7\3\7\5\7t\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3") + buf.write("\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\13") + buf.write("\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\r\3\r\3\16") + buf.write("\3\16\3\17\3\17\3\20\3\20\3\20\3\20\7\20\u00a0\n\20\f") + buf.write("\20\16\20\u00a3\13\20\5\20\u00a5\n\20\3\20\3\20\3\21\3") + buf.write("\21\5\21\u00ab\n\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22") + buf.write("\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\26\3\26") + buf.write("\7\26\u00bf\n\26\f\26\16\26\u00c2\13\26\5\26\u00c4\n\26") + buf.write("\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27") + buf.write("\3\27\3\27\5\27\u00d3\n\27\3\27\3\27\3\27\3\27\3\27\3") + buf.write("\27\3\27\3\27\7\27\u00dd\n\27\f\27\16\27\u00e0\13\27\3") + buf.write("\30\3\30\3\30\3\30\3\30\3\30\7\30\u00e8\n\30\f\30\16\30") + buf.write("\u00eb\13\30\5\30\u00ed\n\30\3\30\5\30\u00f0\n\30\3\30") + buf.write("\3\30\3\30\3\30\3\31\7\31\u00f7\n\31\f\31\16\31\u00fa") + buf.write("\13\31\3\31\7\31\u00fd\n\31\f\31\16\31\u0100\13\31\3\32") + buf.write("\3\32\5\32\u0104\n\32\3\33\3\33\3\33\3\33\3\33\3\33\3") + buf.write("\33\3\34\3\34\3\34\3\34\3\34\3\34\3\34\6\34\u0114\n\34") + buf.write("\r\34\16\34\u0115\3\35\3\35\3\36\3\36\5\36\u011c\n\36") + buf.write("\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3 \5 \u0129") + buf.write("\n \3 \7 \u012c\n \f \16 \u012f\13 \3!\3!\5!\u0133\n!") + buf.write("\3!\3!\3!\5!\u0138\n!\6!\u013a\n!\r!\16!\u013b\3!\3!\3") + buf.write("!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\7#\u014d") + buf.write("\n#\f#\16#\u0150\13#\5#\u0152\n#\3$\3$\3$\7$\u0157\n$") + buf.write("\f$\16$\u015a\13$\5$\u015c\n$\3%\3%\3%\3%\3%\3%\3%\3%") + buf.write("\3%\3%\3%\3%\5%\u016a\n%\3%\3%\3%\3%\7%\u0170\n%\f%\16") + buf.write("%\u0173\13%\3&\3&\3\'\3\'\3(\3(\3(\3(\3(\3(\5(\u017f\n") + buf.write("(\3(\2\4,H)\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"") + buf.write("$&(*,.\60\62\64\668:<>@BDFHJLN\2\b\3\2\f\17\3\2\20\21") + buf.write("\3\2\36\37\3\2\34\35\3\2!&\3\2\'(\2\u018e\2P\3\2\2\2\4") + buf.write("W\3\2\2\2\6[\3\2\2\2\ba\3\2\2\2\no\3\2\2\2\fs\3\2\2\2") + buf.write("\16u\3\2\2\2\20{\3\2\2\2\22\u0085\3\2\2\2\24\u008b\3\2") + buf.write("\2\2\26\u0092\3\2\2\2\30\u0095\3\2\2\2\32\u0097\3\2\2") + buf.write("\2\34\u0099\3\2\2\2\36\u009b\3\2\2\2 \u00aa\3\2\2\2\"") + buf.write("\u00af\3\2\2\2$\u00b4\3\2\2\2&\u00b6\3\2\2\2(\u00b8\3") + buf.write("\2\2\2*\u00ba\3\2\2\2,\u00d2\3\2\2\2.\u00e1\3\2\2\2\60") + buf.write("\u00f8\3\2\2\2\62\u0103\3\2\2\2\64\u0105\3\2\2\2\66\u010c") + buf.write("\3\2\2\28\u0117\3\2\2\2:\u011b\3\2\2\2<\u011d\3\2\2\2") + buf.write(">\u012d\3\2\2\2@\u0132\3\2\2\2B\u0140\3\2\2\2D\u0151\3") + buf.write("\2\2\2F\u015b\3\2\2\2H\u0169\3\2\2\2J\u0174\3\2\2\2L\u0176") + buf.write("\3\2\2\2N\u017e\3\2\2\2PQ\5\4\3\2QR\7\2\2\3R\3\3\2\2\2") + buf.write("SV\5\n\6\2TV\5\b\5\2US\3\2\2\2UT\3\2\2\2VY\3\2\2\2WU\3") + buf.write("\2\2\2WX\3\2\2\2X\5\3\2\2\2YW\3\2\2\2Z\\\5\n\6\2[Z\3\2") + buf.write("\2\2\\]\3\2\2\2][\3\2\2\2]^\3\2\2\2^\7\3\2\2\2_b\5.\30") + buf.write("\2`b\5B\"\2a_\3\2\2\2a`\3\2\2\2b\t\3\2\2\2cp\5@!\2dp\5") + buf.write(" \21\2ep\5\"\22\2fp\5\f\7\2gp\5\22\n\2hp\5\26\f\2ip\5") + buf.write("\32\16\2jp\5\24\13\2kp\5\34\17\2lp\5\64\33\2mp\5<\37\2") + buf.write("np\5*\26\2oc\3\2\2\2od\3\2\2\2oe\3\2\2\2of\3\2\2\2og\3") + buf.write("\2\2\2oh\3\2\2\2oi\3\2\2\2oj\3\2\2\2ok\3\2\2\2ol\3\2\2") + buf.write("\2om\3\2\2\2on\3\2\2\2p\13\3\2\2\2qt\5\16\b\2rt\5\20\t") + buf.write("\2sq\3\2\2\2sr\3\2\2\2t\r\3\2\2\2uv\7\3\2\2vw\5H%\2wx") + buf.write("\7\4\2\2xy\5\6\4\2yz\7\5\2\2z\17\3\2\2\2{|\7\3\2\2|}\5") + buf.write("H%\2}~\7\4\2\2~\177\5\6\4\2\177\u0080\7\5\2\2\u0080\u0081") + buf.write("\7\6\2\2\u0081\u0082\7\4\2\2\u0082\u0083\5\6\4\2\u0083") + buf.write("\u0084\7\5\2\2\u0084\21\3\2\2\2\u0085\u0086\7\7\2\2\u0086") + buf.write("\u0087\5N(\2\u0087\u0088\7\4\2\2\u0088\u0089\5\6\4\2\u0089") + buf.write("\u008a\7\5\2\2\u008a\23\3\2\2\2\u008b\u008c\7\b\2\2\u008c") + buf.write("\u008d\7\t\2\2\u008d\u008e\5,\27\2\u008e\u008f\7\n\2\2") + buf.write("\u008f\u0090\5,\27\2\u0090\u0091\7\13\2\2\u0091\25\3\2") + buf.write("\2\2\u0092\u0093\5\30\r\2\u0093\u0094\5,\27\2\u0094\27") + buf.write("\3\2\2\2\u0095\u0096\t\2\2\2\u0096\31\3\2\2\2\u0097\u0098") + buf.write("\t\3\2\2\u0098\33\3\2\2\2\u0099\u009a\7\22\2\2\u009a\35") + buf.write("\3\2\2\2\u009b\u00a4\7\4\2\2\u009c\u00a1\5,\27\2\u009d") + buf.write("\u009e\7\n\2\2\u009e\u00a0\5,\27\2\u009f\u009d\3\2\2\2") + buf.write("\u00a0\u00a3\3\2\2\2\u00a1\u009f\3\2\2\2\u00a1\u00a2\3") + buf.write("\2\2\2\u00a2\u00a5\3\2\2\2\u00a3\u00a1\3\2\2\2\u00a4\u009c") + buf.write("\3\2\2\2\u00a4\u00a5\3\2\2\2\u00a5\u00a6\3\2\2\2\u00a6") + buf.write("\u00a7\7\5\2\2\u00a7\37\3\2\2\2\u00a8\u00ab\7,\2\2\u00a9") + buf.write("\u00ab\5\66\34\2\u00aa\u00a8\3\2\2\2\u00aa\u00a9\3\2\2") + buf.write("\2\u00ab\u00ac\3\2\2\2\u00ac\u00ad\7\23\2\2\u00ad\u00ae") + buf.write("\5,\27\2\u00ae!\3\2\2\2\u00af\u00b0\7\24\2\2\u00b0\u00b1") + buf.write("\7\t\2\2\u00b1\u00b2\5,\27\2\u00b2\u00b3\7\13\2\2\u00b3") + buf.write("#\3\2\2\2\u00b4\u00b5\t\4\2\2\u00b5%\3\2\2\2\u00b6\u00b7") + buf.write("\t\5\2\2\u00b7\'\3\2\2\2\u00b8\u00b9\7\35\2\2\u00b9)\3") + buf.write("\2\2\2\u00ba\u00c3\7\25\2\2\u00bb\u00c0\5,\27\2\u00bc") + buf.write("\u00bd\7\n\2\2\u00bd\u00bf\5,\27\2\u00be\u00bc\3\2\2\2") + buf.write("\u00bf\u00c2\3\2\2\2\u00c0\u00be\3\2\2\2\u00c0\u00c1\3") + buf.write("\2\2\2\u00c1\u00c4\3\2\2\2\u00c2\u00c0\3\2\2\2\u00c3\u00bb") + buf.write("\3\2\2\2\u00c3\u00c4\3\2\2\2\u00c4+\3\2\2\2\u00c5\u00c6") + buf.write("\b\27\1\2\u00c6\u00c7\5(\25\2\u00c7\u00c8\5,\27\b\u00c8") + buf.write("\u00d3\3\2\2\2\u00c9\u00ca\5:\36\2\u00ca\u00cb\7\23\2") + buf.write("\2\u00cb\u00cc\5,\27\5\u00cc\u00d3\3\2\2\2\u00cd\u00ce") + buf.write("\7\t\2\2\u00ce\u00cf\5,\27\2\u00cf\u00d0\7\13\2\2\u00d0") + buf.write("\u00d3\3\2\2\2\u00d1\u00d3\5N(\2\u00d2\u00c5\3\2\2\2\u00d2") + buf.write("\u00c9\3\2\2\2\u00d2\u00cd\3\2\2\2\u00d2\u00d1\3\2\2\2") + buf.write("\u00d3\u00de\3\2\2\2\u00d4\u00d5\f\7\2\2\u00d5\u00d6\5") + buf.write("$\23\2\u00d6\u00d7\5,\27\b\u00d7\u00dd\3\2\2\2\u00d8\u00d9") + buf.write("\f\6\2\2\u00d9\u00da\5&\24\2\u00da\u00db\5,\27\7\u00db") + buf.write("\u00dd\3\2\2\2\u00dc\u00d4\3\2\2\2\u00dc\u00d8\3\2\2\2") + buf.write("\u00dd\u00e0\3\2\2\2\u00de\u00dc\3\2\2\2\u00de\u00df\3") + buf.write("\2\2\2\u00df-\3\2\2\2\u00e0\u00de\3\2\2\2\u00e1\u00e2") + buf.write("\7\26\2\2\u00e2\u00ef\7,\2\2\u00e3\u00e4\7\t\2\2\u00e4") + buf.write("\u00ec\7,\2\2\u00e5\u00e9\7\n\2\2\u00e6\u00e8\7,\2\2\u00e7") + buf.write("\u00e6\3\2\2\2\u00e8\u00eb\3\2\2\2\u00e9\u00e7\3\2\2\2") + buf.write("\u00e9\u00ea\3\2\2\2\u00ea\u00ed\3\2\2\2\u00eb\u00e9\3") + buf.write("\2\2\2\u00ec\u00e5\3\2\2\2\u00ec\u00ed\3\2\2\2\u00ed\u00ee") + buf.write("\3\2\2\2\u00ee\u00f0\7\13\2\2\u00ef\u00e3\3\2\2\2\u00ef") + buf.write("\u00f0\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f2\7\27\2") + buf.write("\2\u00f2\u00f3\5\60\31\2\u00f3\u00f4\7\30\2\2\u00f4/\3") + buf.write("\2\2\2\u00f5\u00f7\5\62\32\2\u00f6\u00f5\3\2\2\2\u00f7") + buf.write("\u00fa\3\2\2\2\u00f8\u00f6\3\2\2\2\u00f8\u00f9\3\2\2\2") + buf.write("\u00f9\u00fe\3\2\2\2\u00fa\u00f8\3\2\2\2\u00fb\u00fd\5") + buf.write("B\"\2\u00fc\u00fb\3\2\2\2\u00fd\u0100\3\2\2\2\u00fe\u00fc") + buf.write("\3\2\2\2\u00fe\u00ff\3\2\2\2\u00ff\61\3\2\2\2\u0100\u00fe") + buf.write("\3\2\2\2\u0101\u0104\5 \21\2\u0102\u0104\5\64\33\2\u0103") + buf.write("\u0101\3\2\2\2\u0103\u0102\3\2\2\2\u0104\63\3\2\2\2\u0105") + buf.write("\u0106\5:\36\2\u0106\u0107\7\23\2\2\u0107\u0108\7\31\2") + buf.write("\2\u0108\u0109\7,\2\2\u0109\u010a\7\t\2\2\u010a\u010b") + buf.write("\7\13\2\2\u010b\65\3\2\2\2\u010c\u0113\58\35\2\u010d\u010e") + buf.write("\7\32\2\2\u010e\u0114\7,\2\2\u010f\u0110\7\4\2\2\u0110") + buf.write("\u0111\5,\27\2\u0111\u0112\7\5\2\2\u0112\u0114\3\2\2\2") + buf.write("\u0113\u010d\3\2\2\2\u0113\u010f\3\2\2\2\u0114\u0115\3") + buf.write("\2\2\2\u0115\u0113\3\2\2\2\u0115\u0116\3\2\2\2\u0116\67") + buf.write("\3\2\2\2\u0117\u0118\7,\2\2\u01189\3\2\2\2\u0119\u011c") + buf.write("\7,\2\2\u011a\u011c\5\66\34\2\u011b\u0119\3\2\2\2\u011b") + buf.write("\u011a\3\2\2\2\u011c;\3\2\2\2\u011d\u011e\5> \2\u011e") + buf.write("\u011f\7-\2\2\u011f\u0120\7\t\2\2\u0120\u0121\5F$\2\u0121") + buf.write("\u0122\7\13\2\2\u0122=\3\2\2\2\u0123\u0129\7,\2\2\u0124") + buf.write("\u0125\7\4\2\2\u0125\u0126\5,\27\2\u0126\u0127\7\5\2\2") + buf.write("\u0127\u0129\3\2\2\2\u0128\u0123\3\2\2\2\u0128\u0124\3") + buf.write("\2\2\2\u0129\u012a\3\2\2\2\u012a\u012c\7\32\2\2\u012b") + buf.write("\u0128\3\2\2\2\u012c\u012f\3\2\2\2\u012d\u012b\3\2\2\2") + buf.write("\u012d\u012e\3\2\2\2\u012e?\3\2\2\2\u012f\u012d\3\2\2") + buf.write("\2\u0130\u0133\7,\2\2\u0131\u0133\5\66\34\2\u0132\u0130") + buf.write("\3\2\2\2\u0132\u0131\3\2\2\2\u0133\u0139\3\2\2\2\u0134") + buf.write("\u0137\7\n\2\2\u0135\u0138\7,\2\2\u0136\u0138\5\66\34") + buf.write("\2\u0137\u0135\3\2\2\2\u0137\u0136\3\2\2\2\u0138\u013a") + buf.write("\3\2\2\2\u0139\u0134\3\2\2\2\u013a\u013b\3\2\2\2\u013b") + buf.write("\u0139\3\2\2\2\u013b\u013c\3\2\2\2\u013c\u013d\3\2\2\2") + buf.write("\u013d\u013e\7\23\2\2\u013e\u013f\5<\37\2\u013fA\3\2\2") + buf.write("\2\u0140\u0141\7\33\2\2\u0141\u0142\7-\2\2\u0142\u0143") + buf.write("\7\t\2\2\u0143\u0144\5D#\2\u0144\u0145\7\13\2\2\u0145") + buf.write("\u0146\7\27\2\2\u0146\u0147\5\6\4\2\u0147\u0148\7\30\2") + buf.write("\2\u0148C\3\2\2\2\u0149\u014e\7,\2\2\u014a\u014b\7\n\2") + buf.write("\2\u014b\u014d\7,\2\2\u014c\u014a\3\2\2\2\u014d\u0150") + buf.write("\3\2\2\2\u014e\u014c\3\2\2\2\u014e\u014f\3\2\2\2\u014f") + buf.write("\u0152\3\2\2\2\u0150\u014e\3\2\2\2\u0151\u0149\3\2\2\2") + buf.write("\u0151\u0152\3\2\2\2\u0152E\3\2\2\2\u0153\u0158\5,\27") + buf.write("\2\u0154\u0155\7\n\2\2\u0155\u0157\5,\27\2\u0156\u0154") + buf.write("\3\2\2\2\u0157\u015a\3\2\2\2\u0158\u0156\3\2\2\2\u0158") + buf.write("\u0159\3\2\2\2\u0159\u015c\3\2\2\2\u015a\u0158\3\2\2\2") + buf.write("\u015b\u0153\3\2\2\2\u015b\u015c\3\2\2\2\u015cG\3\2\2") + buf.write("\2\u015d\u015e\b%\1\2\u015e\u015f\7)\2\2\u015f\u016a\5") + buf.write("H%\7\u0160\u0161\5,\27\2\u0161\u0162\5J&\2\u0162\u0163") + buf.write("\5,\27\2\u0163\u016a\3\2\2\2\u0164\u016a\7 \2\2\u0165") + buf.write("\u0166\7\t\2\2\u0166\u0167\5H%\2\u0167\u0168\7\13\2\2") + buf.write("\u0168\u016a\3\2\2\2\u0169\u015d\3\2\2\2\u0169\u0160\3") + buf.write("\2\2\2\u0169\u0164\3\2\2\2\u0169\u0165\3\2\2\2\u016a\u0171") + buf.write("\3\2\2\2\u016b\u016c\f\5\2\2\u016c\u016d\5L\'\2\u016d") + buf.write("\u016e\5H%\6\u016e\u0170\3\2\2\2\u016f\u016b\3\2\2\2\u0170") + buf.write("\u0173\3\2\2\2\u0171\u016f\3\2\2\2\u0171\u0172\3\2\2\2") + buf.write("\u0172I\3\2\2\2\u0173\u0171\3\2\2\2\u0174\u0175\t\6\2") + buf.write("\2\u0175K\3\2\2\2\u0176\u0177\t\7\2\2\u0177M\3\2\2\2\u0178") + buf.write("\u017f\7*\2\2\u0179\u017f\7,\2\2\u017a\u017f\5\36\20\2") + buf.write("\u017b\u017f\5\66\34\2\u017c\u017f\5<\37\2\u017d\u017f") + buf.write("\7+\2\2\u017e\u0178\3\2\2\2\u017e\u0179\3\2\2\2\u017e") + buf.write("\u017a\3\2\2\2\u017e\u017b\3\2\2\2\u017e\u017c\3\2\2\2") + buf.write("\u017e\u017d\3\2\2\2\u017fO\3\2\2\2%UW]aos\u00a1\u00a4") + buf.write("\u00aa\u00c0\u00c3\u00d2\u00dc\u00de\u00e9\u00ec\u00ef") + buf.write("\u00f8\u00fe\u0103\u0113\u0115\u011b\u0128\u012d\u0132") + buf.write("\u0137\u013b\u014e\u0151\u0158\u015b\u0169\u0171\u017e") return buf.getvalue() @@ -212,44 +213,45 @@ class tlangParser ( Parser ): RULE_start = 0 RULE_instruction_list = 1 RULE_strict_ilist = 2 - RULE_instruction = 3 - RULE_conditional = 4 - RULE_ifConditional = 5 - RULE_ifElseConditional = 6 - RULE_loop = 7 - RULE_gotoCommand = 8 - RULE_moveCommand = 9 - RULE_moveOp = 10 - RULE_penCommand = 11 - RULE_pauseCommand = 12 - RULE_array = 13 - RULE_assignment = 14 - RULE_printStatement = 15 - RULE_multiplicative = 16 - RULE_additive = 17 - RULE_unaryArithOp = 18 - RULE_returnStatement = 19 - RULE_expression = 20 - RULE_classDeclaration = 21 - RULE_classBody = 22 - RULE_classAttributeDeclaration = 23 - RULE_objectInstantiation = 24 - RULE_objectOrArrayAccess = 25 - RULE_baseAccess = 26 - RULE_lvalue = 27 - RULE_functionCall = 28 - RULE_methodCaller = 29 - RULE_functionCallWithReturnValues = 30 - RULE_functionDeclaration = 31 - RULE_parameters = 32 - RULE_arguments = 33 - RULE_condition = 34 - RULE_binCondOp = 35 - RULE_logicOp = 36 - RULE_value = 37 - - ruleNames = [ "start", "instruction_list", "strict_ilist", "instruction", - "conditional", "ifConditional", "ifElseConditional", + RULE_declaration = 3 + RULE_instruction = 4 + RULE_conditional = 5 + RULE_ifConditional = 6 + RULE_ifElseConditional = 7 + RULE_loop = 8 + RULE_gotoCommand = 9 + RULE_moveCommand = 10 + RULE_moveOp = 11 + RULE_penCommand = 12 + RULE_pauseCommand = 13 + RULE_array = 14 + RULE_assignment = 15 + RULE_printStatement = 16 + RULE_multiplicative = 17 + RULE_additive = 18 + RULE_unaryArithOp = 19 + RULE_returnStatement = 20 + RULE_expression = 21 + RULE_classDeclaration = 22 + RULE_classBody = 23 + RULE_classAttributeDeclaration = 24 + RULE_objectInstantiation = 25 + RULE_objectOrArrayAccess = 26 + RULE_baseAccess = 27 + RULE_lvalue = 28 + RULE_functionCall = 29 + RULE_methodCaller = 30 + RULE_functionCallWithReturnValues = 31 + RULE_functionDeclaration = 32 + RULE_parameters = 33 + RULE_arguments = 34 + RULE_condition = 35 + RULE_binCondOp = 36 + RULE_logicOp = 37 + RULE_value = 38 + + ruleNames = [ "start", "instruction_list", "strict_ilist", "declaration", + "instruction", "conditional", "ifConditional", "ifElseConditional", "loop", "gotoCommand", "moveCommand", "moveOp", "penCommand", "pauseCommand", "array", "assignment", "printStatement", "multiplicative", "additive", "unaryArithOp", "returnStatement", @@ -345,9 +347,9 @@ def start(self): self.enterRule(localctx, 0, self.RULE_start) try: self.enterOuterAlt(localctx, 1) - self.state = 76 + self.state = 78 self.instruction_list() - self.state = 77 + self.state = 79 self.match(tlangParser.EOF) except RecognitionException as re: localctx.exception = re @@ -371,6 +373,13 @@ def instruction(self, i:int=None): return self.getTypedRuleContext(tlangParser.InstructionContext,i) + def declaration(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.DeclarationContext) + else: + return self.getTypedRuleContext(tlangParser.DeclarationContext,i) + + def getRuleIndex(self): return tlangParser.RULE_instruction_list @@ -390,13 +399,25 @@ def instruction_list(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 82 + self.state = 85 self._errHandler.sync(self) _la = self._input.LA(1) while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 79 - self.instruction() - self.state = 84 + self.state = 83 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [tlangParser.T__0, tlangParser.T__1, tlangParser.T__4, tlangParser.T__5, tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12, tlangParser.T__13, tlangParser.T__14, tlangParser.T__15, tlangParser.T__17, tlangParser.T__18, tlangParser.VAR, tlangParser.NAME]: + self.state = 81 + self.instruction() + pass + elif token in [tlangParser.T__19, tlangParser.T__24]: + self.state = 82 + self.declaration() + pass + else: + raise NoViableAltException(self) + + self.state = 87 self._errHandler.sync(self) _la = self._input.LA(1) @@ -441,16 +462,16 @@ def strict_ilist(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 86 + self.state = 89 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 85 + self.state = 88 self.instruction() - self.state = 88 + self.state = 91 self._errHandler.sync(self) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): break except RecognitionException as re: @@ -462,6 +483,62 @@ def strict_ilist(self): return localctx + class DeclarationContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def classDeclaration(self): + return self.getTypedRuleContext(tlangParser.ClassDeclarationContext,0) + + + def functionDeclaration(self): + return self.getTypedRuleContext(tlangParser.FunctionDeclarationContext,0) + + + def getRuleIndex(self): + return tlangParser.RULE_declaration + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitDeclaration" ): + return visitor.visitDeclaration(self) + else: + return visitor.visitChildren(self) + + + + + def declaration(self): + + localctx = tlangParser.DeclarationContext(self, self._ctx, self.state) + self.enterRule(localctx, 6, self.RULE_declaration) + try: + self.state = 95 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [tlangParser.T__19]: + self.enterOuterAlt(localctx, 1) + self.state = 93 + self.classDeclaration() + pass + elif token in [tlangParser.T__24]: + self.enterOuterAlt(localctx, 2) + self.state = 94 + self.functionDeclaration() + pass + else: + raise NoViableAltException(self) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class InstructionContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -504,18 +581,10 @@ def pauseCommand(self): return self.getTypedRuleContext(tlangParser.PauseCommandContext,0) - def classDeclaration(self): - return self.getTypedRuleContext(tlangParser.ClassDeclarationContext,0) - - def objectInstantiation(self): return self.getTypedRuleContext(tlangParser.ObjectInstantiationContext,0) - def functionDeclaration(self): - return self.getTypedRuleContext(tlangParser.FunctionDeclarationContext,0) - - def functionCall(self): return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) @@ -539,92 +608,80 @@ def accept(self, visitor:ParseTreeVisitor): def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) - self.enterRule(localctx, 6, self.RULE_instruction) + self.enterRule(localctx, 8, self.RULE_instruction) try: - self.state = 104 + self.state = 109 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,2,self._ctx) + la_ = self._interp.adaptivePredict(self._input,4,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 90 + self.state = 97 self.functionCallWithReturnValues() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 91 + self.state = 98 self.assignment() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 92 + self.state = 99 self.printStatement() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 93 + self.state = 100 self.conditional() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 94 + self.state = 101 self.loop() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 95 + self.state = 102 self.moveCommand() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 96 + self.state = 103 self.penCommand() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 97 + self.state = 104 self.gotoCommand() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 98 + self.state = 105 self.pauseCommand() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 99 - self.classDeclaration() + self.state = 106 + self.objectInstantiation() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 100 - self.objectInstantiation() + self.state = 107 + self.functionCall() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 101 - self.functionDeclaration() - pass - - elif la_ == 13: - self.enterOuterAlt(localctx, 13) - self.state = 102 - self.functionCall() - pass - - elif la_ == 14: - self.enterOuterAlt(localctx, 14) - self.state = 103 + self.state = 108 self.returnStatement() pass @@ -667,20 +724,20 @@ def accept(self, visitor:ParseTreeVisitor): def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) - self.enterRule(localctx, 8, self.RULE_conditional) + self.enterRule(localctx, 10, self.RULE_conditional) try: - self.state = 108 + self.state = 113 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,3,self._ctx) + la_ = self._interp.adaptivePredict(self._input,5,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 106 + self.state = 111 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 107 + self.state = 112 self.ifElseConditional() pass @@ -723,18 +780,18 @@ def accept(self, visitor:ParseTreeVisitor): def ifConditional(self): localctx = tlangParser.IfConditionalContext(self, self._ctx, self.state) - self.enterRule(localctx, 10, self.RULE_ifConditional) + self.enterRule(localctx, 12, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 110 + self.state = 115 self.match(tlangParser.T__0) - self.state = 111 + self.state = 116 self.condition(0) - self.state = 112 + self.state = 117 self.match(tlangParser.T__1) - self.state = 113 + self.state = 118 self.strict_ilist() - self.state = 114 + self.state = 119 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -777,26 +834,26 @@ def accept(self, visitor:ParseTreeVisitor): def ifElseConditional(self): localctx = tlangParser.IfElseConditionalContext(self, self._ctx, self.state) - self.enterRule(localctx, 12, self.RULE_ifElseConditional) + self.enterRule(localctx, 14, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 116 + self.state = 121 self.match(tlangParser.T__0) - self.state = 117 + self.state = 122 self.condition(0) - self.state = 118 + self.state = 123 self.match(tlangParser.T__1) - self.state = 119 + self.state = 124 self.strict_ilist() - self.state = 120 + self.state = 125 self.match(tlangParser.T__2) - self.state = 121 + self.state = 126 self.match(tlangParser.T__3) - self.state = 122 + self.state = 127 self.match(tlangParser.T__1) - self.state = 123 + self.state = 128 self.strict_ilist() - self.state = 124 + self.state = 129 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -836,18 +893,18 @@ def accept(self, visitor:ParseTreeVisitor): def loop(self): localctx = tlangParser.LoopContext(self, self._ctx, self.state) - self.enterRule(localctx, 14, self.RULE_loop) + self.enterRule(localctx, 16, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 126 + self.state = 131 self.match(tlangParser.T__4) - self.state = 127 + self.state = 132 self.value() - self.state = 128 + self.state = 133 self.match(tlangParser.T__1) - self.state = 129 + self.state = 134 self.strict_ilist() - self.state = 130 + self.state = 135 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -886,20 +943,20 @@ def accept(self, visitor:ParseTreeVisitor): def gotoCommand(self): localctx = tlangParser.GotoCommandContext(self, self._ctx, self.state) - self.enterRule(localctx, 16, self.RULE_gotoCommand) + self.enterRule(localctx, 18, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 132 + self.state = 137 self.match(tlangParser.T__5) - self.state = 133 + self.state = 138 self.match(tlangParser.T__6) - self.state = 134 + self.state = 139 self.expression(0) - self.state = 135 + self.state = 140 self.match(tlangParser.T__7) - self.state = 136 + self.state = 141 self.expression(0) - self.state = 137 + self.state = 142 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -939,12 +996,12 @@ def accept(self, visitor:ParseTreeVisitor): def moveCommand(self): localctx = tlangParser.MoveCommandContext(self, self._ctx, self.state) - self.enterRule(localctx, 18, self.RULE_moveCommand) + self.enterRule(localctx, 20, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 139 + self.state = 144 self.moveOp() - self.state = 140 + self.state = 145 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -977,11 +1034,11 @@ def accept(self, visitor:ParseTreeVisitor): def moveOp(self): localctx = tlangParser.MoveOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 20, self.RULE_moveOp) + self.enterRule(localctx, 22, self.RULE_moveOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 142 + self.state = 147 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -1019,11 +1076,11 @@ def accept(self, visitor:ParseTreeVisitor): def penCommand(self): localctx = tlangParser.PenCommandContext(self, self._ctx, self.state) - self.enterRule(localctx, 22, self.RULE_penCommand) + self.enterRule(localctx, 24, self.RULE_penCommand) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 144 + self.state = 149 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -1061,10 +1118,10 @@ def accept(self, visitor:ParseTreeVisitor): def pauseCommand(self): localctx = tlangParser.PauseCommandContext(self, self._ctx, self.state) - self.enterRule(localctx, 24, self.RULE_pauseCommand) + self.enterRule(localctx, 26, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 146 + self.state = 151 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -1103,33 +1160,33 @@ def accept(self, visitor:ParseTreeVisitor): def array(self): localctx = tlangParser.ArrayContext(self, self._ctx, self.state) - self.enterRule(localctx, 26, self.RULE_array) + self.enterRule(localctx, 28, self.RULE_array) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 148 + self.state = 153 self.match(tlangParser.T__1) - self.state = 157 + self.state = 162 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 149 - self.expression(0) self.state = 154 + self.expression(0) + self.state = 159 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 150 + self.state = 155 self.match(tlangParser.T__7) - self.state = 151 - self.expression(0) self.state = 156 + self.expression(0) + self.state = 161 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 159 + self.state = 164 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -1172,26 +1229,26 @@ def accept(self, visitor:ParseTreeVisitor): def assignment(self): localctx = tlangParser.AssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 28, self.RULE_assignment) + self.enterRule(localctx, 30, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 163 + self.state = 168 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,6,self._ctx) + la_ = self._interp.adaptivePredict(self._input,8,self._ctx) if la_ == 1: - self.state = 161 + self.state = 166 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 162 + self.state = 167 self.objectOrArrayAccess() pass - self.state = 165 + self.state = 170 self.match(tlangParser.T__16) - self.state = 166 + self.state = 171 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1227,16 +1284,16 @@ def accept(self, visitor:ParseTreeVisitor): def printStatement(self): localctx = tlangParser.PrintStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 30, self.RULE_printStatement) + self.enterRule(localctx, 32, self.RULE_printStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 168 + self.state = 173 self.match(tlangParser.T__17) - self.state = 169 + self.state = 174 self.match(tlangParser.T__6) - self.state = 170 + self.state = 175 self.expression(0) - self.state = 171 + self.state = 176 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1274,11 +1331,11 @@ def accept(self, visitor:ParseTreeVisitor): def multiplicative(self): localctx = tlangParser.MultiplicativeContext(self, self._ctx, self.state) - self.enterRule(localctx, 32, self.RULE_multiplicative) + self.enterRule(localctx, 34, self.RULE_multiplicative) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 173 + self.state = 178 _la = self._input.LA(1) if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) @@ -1321,11 +1378,11 @@ def accept(self, visitor:ParseTreeVisitor): def additive(self): localctx = tlangParser.AdditiveContext(self, self._ctx, self.state) - self.enterRule(localctx, 34, self.RULE_additive) + self.enterRule(localctx, 36, self.RULE_additive) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 175 + self.state = 180 _la = self._input.LA(1) if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) @@ -1365,10 +1422,10 @@ def accept(self, visitor:ParseTreeVisitor): def unaryArithOp(self): localctx = tlangParser.UnaryArithOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 36, self.RULE_unaryArithOp) + self.enterRule(localctx, 38, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 177 + self.state = 182 self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re @@ -1407,27 +1464,27 @@ def accept(self, visitor:ParseTreeVisitor): def returnStatement(self): localctx = tlangParser.ReturnStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 38, self.RULE_returnStatement) + self.enterRule(localctx, 40, self.RULE_returnStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 179 + self.state = 184 self.match(tlangParser.T__18) - self.state = 188 + self.state = 193 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,8,self._ctx) + la_ = self._interp.adaptivePredict(self._input,10,self._ctx) if la_ == 1: - self.state = 180 - self.expression(0) self.state = 185 + self.expression(0) + self.state = 190 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 181 + self.state = 186 self.match(tlangParser.T__7) - self.state = 182 - self.expression(0) self.state = 187 + self.expression(0) + self.state = 192 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1583,21 +1640,21 @@ def expression(self, _p:int=0): _parentState = self.state localctx = tlangParser.ExpressionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 40 - self.enterRecursionRule(localctx, 40, self.RULE_expression, _p) + _startState = 42 + self.enterRecursionRule(localctx, 42, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 203 + self.state = 208 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,9,self._ctx) + la_ = self._interp.adaptivePredict(self._input,11,self._ctx) if la_ == 1: localctx = tlangParser.UnaryExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 191 + self.state = 196 self.unaryArithOp() - self.state = 192 + self.state = 197 self.expression(6) pass @@ -1605,11 +1662,11 @@ def expression(self, _p:int=0): localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 194 + self.state = 199 self.lvalue() - self.state = 195 + self.state = 200 self.match(tlangParser.T__16) - self.state = 196 + self.state = 201 self.expression(3) pass @@ -1617,11 +1674,11 @@ def expression(self, _p:int=0): localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 198 + self.state = 203 self.match(tlangParser.T__6) - self.state = 199 + self.state = 204 self.expression(0) - self.state = 200 + self.state = 205 self.match(tlangParser.T__8) pass @@ -1629,53 +1686,53 @@ def expression(self, _p:int=0): localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 202 + self.state = 207 self.value() pass self._ctx.stop = self._input.LT(-1) - self.state = 215 + self.state = 220 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,11,self._ctx) + _alt = self._interp.adaptivePredict(self._input,13,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 213 + self.state = 218 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,10,self._ctx) + la_ = self._interp.adaptivePredict(self._input,12,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 205 + self.state = 210 if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 206 + self.state = 211 self.multiplicative() - self.state = 207 + self.state = 212 self.expression(6) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 209 + self.state = 214 if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") - self.state = 210 + self.state = 215 self.additive() - self.state = 211 + self.state = 216 self.expression(5) pass - self.state = 217 + self.state = 222 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,11,self._ctx) + _alt = self._interp.adaptivePredict(self._input,13,self._ctx) except RecognitionException as re: localctx.exception = re @@ -1717,49 +1774,49 @@ def accept(self, visitor:ParseTreeVisitor): def classDeclaration(self): localctx = tlangParser.ClassDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 42, self.RULE_classDeclaration) + self.enterRule(localctx, 44, self.RULE_classDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 218 + self.state = 223 self.match(tlangParser.T__19) - self.state = 219 + self.state = 224 self.match(tlangParser.VAR) - self.state = 232 + self.state = 237 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.T__6: - self.state = 220 + self.state = 225 self.match(tlangParser.T__6) - self.state = 221 + self.state = 226 self.match(tlangParser.VAR) - self.state = 229 + self.state = 234 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.T__7: - self.state = 222 + self.state = 227 self.match(tlangParser.T__7) - self.state = 226 + self.state = 231 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 223 - self.match(tlangParser.VAR) self.state = 228 + self.match(tlangParser.VAR) + self.state = 233 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 231 + self.state = 236 self.match(tlangParser.T__8) - self.state = 234 + self.state = 239 self.match(tlangParser.T__20) - self.state = 235 + self.state = 240 self.classBody() - self.state = 236 + self.state = 241 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -1805,27 +1862,27 @@ def accept(self, visitor:ParseTreeVisitor): def classBody(self): localctx = tlangParser.ClassBodyContext(self, self._ctx, self.state) - self.enterRule(localctx, 44, self.RULE_classBody) + self.enterRule(localctx, 46, self.RULE_classBody) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 241 + self.state = 246 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 238 - self.classAttributeDeclaration() self.state = 243 + self.classAttributeDeclaration() + self.state = 248 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 247 + self.state = 252 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__24: - self.state = 244 - self.functionDeclaration() self.state = 249 + self.functionDeclaration() + self.state = 254 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1867,20 +1924,20 @@ def accept(self, visitor:ParseTreeVisitor): def classAttributeDeclaration(self): localctx = tlangParser.ClassAttributeDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 46, self.RULE_classAttributeDeclaration) + self.enterRule(localctx, 48, self.RULE_classAttributeDeclaration) try: - self.state = 252 + self.state = 257 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,17,self._ctx) + la_ = self._interp.adaptivePredict(self._input,19,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 250 + self.state = 255 self.assignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 251 + self.state = 256 self.objectInstantiation() pass @@ -1922,20 +1979,20 @@ def accept(self, visitor:ParseTreeVisitor): def objectInstantiation(self): localctx = tlangParser.ObjectInstantiationContext(self, self._ctx, self.state) - self.enterRule(localctx, 48, self.RULE_objectInstantiation) + self.enterRule(localctx, 50, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 254 + self.state = 259 self.lvalue() - self.state = 255 + self.state = 260 self.match(tlangParser.T__16) - self.state = 256 + self.state = 261 self.match(tlangParser.T__22) - self.state = 257 + self.state = 262 self.match(tlangParser.VAR) - self.state = 258 + self.state = 263 self.match(tlangParser.T__6) - self.state = 259 + self.state = 264 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1984,31 +2041,31 @@ def accept(self, visitor:ParseTreeVisitor): def objectOrArrayAccess(self): localctx = tlangParser.ObjectOrArrayAccessContext(self, self._ctx, self.state) - self.enterRule(localctx, 50, self.RULE_objectOrArrayAccess) + self.enterRule(localctx, 52, self.RULE_objectOrArrayAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 261 + self.state = 266 self.baseAccess() - self.state = 268 + self.state = 273 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 268 + self.state = 273 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__23]: - self.state = 262 + self.state = 267 self.match(tlangParser.T__23) - self.state = 263 + self.state = 268 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 264 + self.state = 269 self.match(tlangParser.T__1) - self.state = 265 + self.state = 270 self.expression(0) - self.state = 266 + self.state = 271 self.match(tlangParser.T__2) pass else: @@ -2017,9 +2074,9 @@ def objectOrArrayAccess(self): else: raise NoViableAltException(self) - self.state = 270 + self.state = 275 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,19,self._ctx) + _alt = self._interp.adaptivePredict(self._input,21,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2054,10 +2111,10 @@ def accept(self, visitor:ParseTreeVisitor): def baseAccess(self): localctx = tlangParser.BaseAccessContext(self, self._ctx, self.state) - self.enterRule(localctx, 52, self.RULE_baseAccess) + self.enterRule(localctx, 54, self.RULE_baseAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 272 + self.state = 277 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -2096,20 +2153,20 @@ def accept(self, visitor:ParseTreeVisitor): def lvalue(self): localctx = tlangParser.LvalueContext(self, self._ctx, self.state) - self.enterRule(localctx, 54, self.RULE_lvalue) + self.enterRule(localctx, 56, self.RULE_lvalue) try: - self.state = 276 + self.state = 281 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,20,self._ctx) + la_ = self._interp.adaptivePredict(self._input,22,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 274 + self.state = 279 self.match(tlangParser.VAR) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 275 + self.state = 280 self.objectOrArrayAccess() pass @@ -2155,18 +2212,18 @@ def accept(self, visitor:ParseTreeVisitor): def functionCall(self): localctx = tlangParser.FunctionCallContext(self, self._ctx, self.state) - self.enterRule(localctx, 56, self.RULE_functionCall) + self.enterRule(localctx, 58, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 278 + self.state = 283 self.methodCaller() - self.state = 279 + self.state = 284 self.match(tlangParser.NAME) - self.state = 280 + self.state = 285 self.match(tlangParser.T__6) - self.state = 281 + self.state = 286 self.arguments() - self.state = 282 + self.state = 287 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2211,35 +2268,35 @@ def accept(self, visitor:ParseTreeVisitor): def methodCaller(self): localctx = tlangParser.MethodCallerContext(self, self._ctx, self.state) - self.enterRule(localctx, 58, self.RULE_methodCaller) + self.enterRule(localctx, 60, self.RULE_methodCaller) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 294 + self.state = 299 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__1 or _la==tlangParser.VAR: - self.state = 289 + self.state = 294 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.VAR]: - self.state = 284 + self.state = 289 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 285 + self.state = 290 self.match(tlangParser.T__1) - self.state = 286 + self.state = 291 self.expression(0) - self.state = 287 + self.state = 292 self.match(tlangParser.T__2) pass else: raise NoViableAltException(self) - self.state = 291 - self.match(tlangParser.T__23) self.state = 296 + self.match(tlangParser.T__23) + self.state = 301 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2290,53 +2347,53 @@ def accept(self, visitor:ParseTreeVisitor): def functionCallWithReturnValues(self): localctx = tlangParser.FunctionCallWithReturnValuesContext(self, self._ctx, self.state) - self.enterRule(localctx, 60, self.RULE_functionCallWithReturnValues) + self.enterRule(localctx, 62, self.RULE_functionCallWithReturnValues) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 299 + self.state = 304 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,23,self._ctx) + la_ = self._interp.adaptivePredict(self._input,25,self._ctx) if la_ == 1: - self.state = 297 + self.state = 302 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 298 + self.state = 303 self.objectOrArrayAccess() pass - self.state = 306 + self.state = 311 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 301 + self.state = 306 self.match(tlangParser.T__7) - self.state = 304 + self.state = 309 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,24,self._ctx) + la_ = self._interp.adaptivePredict(self._input,26,self._ctx) if la_ == 1: - self.state = 302 + self.state = 307 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 303 + self.state = 308 self.objectOrArrayAccess() pass - self.state = 308 + self.state = 313 self._errHandler.sync(self) _la = self._input.LA(1) if not (_la==tlangParser.T__7): break - self.state = 310 + self.state = 315 self.match(tlangParser.T__16) - self.state = 311 + self.state = 316 self.functionCall() except RecognitionException as re: localctx.exception = re @@ -2379,24 +2436,24 @@ def accept(self, visitor:ParseTreeVisitor): def functionDeclaration(self): localctx = tlangParser.FunctionDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 62, self.RULE_functionDeclaration) + self.enterRule(localctx, 64, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 313 + self.state = 318 self.match(tlangParser.T__24) - self.state = 314 + self.state = 319 self.match(tlangParser.NAME) - self.state = 315 + self.state = 320 self.match(tlangParser.T__6) - self.state = 316 + self.state = 321 self.parameters() - self.state = 317 + self.state = 322 self.match(tlangParser.T__8) - self.state = 318 + self.state = 323 self.match(tlangParser.T__20) - self.state = 319 + self.state = 324 self.strict_ilist() - self.state = 320 + self.state = 325 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -2434,25 +2491,25 @@ def accept(self, visitor:ParseTreeVisitor): def parameters(self): localctx = tlangParser.ParametersContext(self, self._ctx, self.state) - self.enterRule(localctx, 64, self.RULE_parameters) + self.enterRule(localctx, 66, self.RULE_parameters) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 330 + self.state = 335 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.VAR: - self.state = 322 - self.match(tlangParser.VAR) self.state = 327 + self.match(tlangParser.VAR) + self.state = 332 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 323 + self.state = 328 self.match(tlangParser.T__7) - self.state = 324 - self.match(tlangParser.VAR) self.state = 329 + self.match(tlangParser.VAR) + self.state = 334 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2495,25 +2552,25 @@ def accept(self, visitor:ParseTreeVisitor): def arguments(self): localctx = tlangParser.ArgumentsContext(self, self._ctx, self.state) - self.enterRule(localctx, 66, self.RULE_arguments) + self.enterRule(localctx, 68, self.RULE_arguments) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 340 + self.state = 345 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 332 - self.expression(0) self.state = 337 + self.expression(0) + self.state = 342 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 333 + self.state = 338 self.match(tlangParser.T__7) - self.state = 334 - self.expression(0) self.state = 339 + self.expression(0) + self.state = 344 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2578,48 +2635,48 @@ def condition(self, _p:int=0): _parentState = self.state localctx = tlangParser.ConditionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 68 - self.enterRecursionRule(localctx, 68, self.RULE_condition, _p) + _startState = 70 + self.enterRecursionRule(localctx, 70, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 354 + self.state = 359 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,30,self._ctx) + la_ = self._interp.adaptivePredict(self._input,32,self._ctx) if la_ == 1: - self.state = 343 + self.state = 348 self.match(tlangParser.NOT) - self.state = 344 + self.state = 349 self.condition(5) pass elif la_ == 2: - self.state = 345 + self.state = 350 self.expression(0) - self.state = 346 + self.state = 351 self.binCondOp() - self.state = 347 + self.state = 352 self.expression(0) pass elif la_ == 3: - self.state = 349 + self.state = 354 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 350 + self.state = 355 self.match(tlangParser.T__6) - self.state = 351 + self.state = 356 self.condition(0) - self.state = 352 + self.state = 357 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 362 + self.state = 367 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,31,self._ctx) + _alt = self._interp.adaptivePredict(self._input,33,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -2627,17 +2684,17 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 356 + self.state = 361 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 357 + self.state = 362 self.logicOp() - self.state = 358 + self.state = 363 self.condition(4) - self.state = 364 + self.state = 369 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,31,self._ctx) + _alt = self._interp.adaptivePredict(self._input,33,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2687,11 +2744,11 @@ def accept(self, visitor:ParseTreeVisitor): def binCondOp(self): localctx = tlangParser.BinCondOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 70, self.RULE_binCondOp) + self.enterRule(localctx, 72, self.RULE_binCondOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 365 + self.state = 370 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2734,11 +2791,11 @@ def accept(self, visitor:ParseTreeVisitor): def logicOp(self): localctx = tlangParser.LogicOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 72, self.RULE_logicOp) + self.enterRule(localctx, 74, self.RULE_logicOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 367 + self.state = 372 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2796,44 +2853,44 @@ def accept(self, visitor:ParseTreeVisitor): def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) - self.enterRule(localctx, 74, self.RULE_value) + self.enterRule(localctx, 76, self.RULE_value) try: - self.state = 375 + self.state = 380 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,32,self._ctx) + la_ = self._interp.adaptivePredict(self._input,34,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 369 + self.state = 374 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 370 + self.state = 375 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 371 + self.state = 376 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 372 + self.state = 377 self.objectOrArrayAccess() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 373 + self.state = 378 self.functionCall() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 374 + self.state = 379 self.match(tlangParser.REAL) pass @@ -2851,8 +2908,8 @@ def value(self): def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): if self._predicates == None: self._predicates = dict() - self._predicates[20] = self.expression_sempred - self._predicates[34] = self.condition_sempred + self._predicates[21] = self.expression_sempred + self._predicates[35] = self.condition_sempred pred = self._predicates.get(ruleIndex, None) if pred is None: raise Exception("No predicate with index:" + str(ruleIndex)) diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index a127fdd..aa36a0b 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -24,6 +24,11 @@ def visitStrict_ilist(self, ctx:tlangParser.Strict_ilistContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#declaration. + def visitDeclaration(self, ctx:tlangParser.DeclarationContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#instruction. def visitInstruction(self, ctx:tlangParser.InstructionContext): return self.visitChildren(ctx) From bd709bac8c4eaf3141a85f6d4231adcdc702ba3f Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Sat, 5 Apr 2025 17:57:46 +0530 Subject: [PATCH 25/47] function overloading now supported --- .../example/demo/class_inheritance_2.tl | 4 +++ ChironCore/example/demo/diamond_problem.tl | 25 +++++++++++++++++++ ChironCore/example/issues.txt | 14 ++++++++--- ChironCore/interpreter.py | 6 ++--- 4 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 ChironCore/example/demo/diamond_problem.tl diff --git a/ChironCore/example/demo/class_inheritance_2.tl b/ChironCore/example/demo/class_inheritance_2.tl index e3fa250..de5ad1d 100644 --- a/ChironCore/example/demo/class_inheritance_2.tl +++ b/ChironCore/example/demo/class_inheritance_2.tl @@ -15,6 +15,10 @@ class :Hexagon(:Shape) { ] return } + def moveForward(:self) { + forward 100 + return + } } :hex = new :Hexagon() diff --git a/ChironCore/example/demo/diamond_problem.tl b/ChironCore/example/demo/diamond_problem.tl new file mode 100644 index 0000000..e19681a --- /dev/null +++ b/ChironCore/example/demo/diamond_problem.tl @@ -0,0 +1,25 @@ +class :Animal { + :walk = 1 + def walk(:self) + { + print(:self.:walk) + return + } +} + +class :Lion(:Animal) +{ + +} +class :Tiger(:Animal) +{ + +} + +class :Liger(:Lion, :Tiger) +{ +} + +:liger = new :Liger() +:liger.:walk = 2 +:liger.walk() \ No newline at end of file diff --git a/ChironCore/example/issues.txt b/ChironCore/example/issues.txt index db982fb..535b049 100644 --- a/ChironCore/example/issues.txt +++ b/ChironCore/example/issues.txt @@ -3,8 +3,16 @@ 3. class currently should have at least one member or python dynamic class initiation throw indentation error 4. Setting objects to N0ne in declaration is not done yet 5. instruction_list can contain both function declaration and classDeclaration this can cause problems -6. Multiple class inheritance is not yet supported! -7. return is compulsory in function declaration +6. Multiple class inheritance is not yet supported! [fixed] +7. return is compulsory in function declaration 8. Solution to Avoid Unexpected Changes in Mutable Class Variables: use __init__ method during class declaration [fixed] 9. Writing self is compulsory in methods of class parameters -10. class must have at least one assignment statement [fixed] \ No newline at end of file +10. class must have at least one assignment statement [fixed] +11. Function overloading with number of arguments [fixed] +12. print the CHA + + + + +Details on interpreter.py +1. Function address in the address-map can be searched by forming a string with the function name and number of parameters \ No newline at end of file diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 5741c4d..8b5ce75 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -177,7 +177,7 @@ def initProgramContext(self, params): def handleFunctionDeclaration(self, stmt, tgt): # body of the function starts from next instruction - self.function_addresses[stmt.name] = self.pc + 1 + self.function_addresses[stmt.name + "_" + str(len(stmt.params))] = self.pc + 1 return tgt def handleFunctionCall(self, stmt, tgt): @@ -195,10 +195,10 @@ def handleFunctionCall(self, stmt, tgt): # If the function is a method, the name will be in the form of "caller@method" if stmt.caller: caller_class = eval(addContext(stmt.caller)).__class__.__name__ - method_name = ":" + str(caller_class) + "@" + str(stmt.name) + method_name = ":" + str(caller_class) + "@" + str(stmt.name) + "_" + str(len(stmt.args)) self.pc = self.function_addresses[method_name] else: - self.pc = self.function_addresses[stmt.name] + self.pc = self.function_addresses[stmt.name + "_" + str(len(stmt.args))] # Initialize a new program context for the new activation record self.prg = ProgramContext() return 0 From 44c9cbcb4fcd19ca18058c5a684dba1f0a9df976 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Sat, 5 Apr 2025 18:00:32 +0530 Subject: [PATCH 26/47] example on function overloading --- ChironCore/example/demo/class_inheritance_2.tl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChironCore/example/demo/class_inheritance_2.tl b/ChironCore/example/demo/class_inheritance_2.tl index de5ad1d..6e591c9 100644 --- a/ChironCore/example/demo/class_inheritance_2.tl +++ b/ChironCore/example/demo/class_inheritance_2.tl @@ -10,13 +10,13 @@ class :Hexagon(:Shape) { :sides = 6 def drawHex(:self) { repeat :self.:sides [ - :self.moveForward() + :self.moveForward(1000) right 60 ] return } - def moveForward(:self) { - forward 100 + def moveForward(:self, :distance) { + forward :distance return } } From 0cdb1464f333fb9e6b030039c46db34b9533d69d Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Sat, 5 Apr 2025 19:43:52 +0530 Subject: [PATCH 27/47] code commenting supported and private method supported --- ChironCore/ChironAST/builder.py | 3 + .../example/demo/class_inheritance_2.tl | 11 +- ChironCore/example/issues.txt | 5 + ChironCore/interpreter.py | 11 +- ChironCore/turtparse/tlang.g4 | 7 +- ChironCore/turtparse/tlang.interp | 5 +- ChironCore/turtparse/tlang.tokens | 68 +- ChironCore/turtparse/tlangLexer.interp | 5 +- ChironCore/turtparse/tlangLexer.py | 279 +++--- ChironCore/turtparse/tlangLexer.tokens | 68 +- ChironCore/turtparse/tlangParser.py | 903 ++++++++++-------- ChironCore/turtparse/tlangVisitor.py | 5 + 12 files changed, 741 insertions(+), 629 deletions(-) diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 1bbd9bc..344322f 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -80,6 +80,9 @@ def visitFunctionCall(self, ctx: tlangParser.FunctionCallContext): print("###Caller Class", str(callerClass)) print("##########") functionArgs.insert(0, callerClass) + # call the private method with mangled name + if len(callerClass.caller) == 1 and functionName.startswith("__") and callerClass.caller[0] == ":self": + functionName = f"_{self.class_register}{functionName}" print(functionArgs) return [(ChironAST.FunctionCallCommand(functionName, functionArgs, callerClass), 1)] diff --git a/ChironCore/example/demo/class_inheritance_2.tl b/ChironCore/example/demo/class_inheritance_2.tl index 6e591c9..e976955 100644 --- a/ChironCore/example/demo/class_inheritance_2.tl +++ b/ChironCore/example/demo/class_inheritance_2.tl @@ -1,6 +1,7 @@ class :Shape { :length = 250 - def moveForward(:self) { + def moveForward(:self) + { forward :self.:length return } @@ -10,16 +11,18 @@ class :Hexagon(:Shape) { :sides = 6 def drawHex(:self) { repeat :self.:sides [ - :self.moveForward(1000) + :self.__moveForward(100) right 60 ] return } - def moveForward(:self, :distance) { + def __moveForward(:self, :distance) { forward :distance return } } :hex = new :Hexagon() -:hex.drawHex() \ No newline at end of file +:hex.drawHex() +# This does not work # +:hex.__moveForward(100) \ No newline at end of file diff --git a/ChironCore/example/issues.txt b/ChironCore/example/issues.txt index 535b049..7b665fe 100644 --- a/ChironCore/example/issues.txt +++ b/ChironCore/example/issues.txt @@ -10,6 +10,11 @@ 10. class must have at least one assignment statement [fixed] 11. Function overloading with number of arguments [fixed] 12. print the CHA +13. Regular variables can also start with __ !! +14. Raise error when the normal function name start with __. semantic analysis. allow only private method in classes +15. :self can only come in the first position in the object access of method call chain +16. commenting now supported [fixed] +17. first all the declaration will be processed and then the instructions! diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 8b5ce75..c8c8393 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -176,8 +176,15 @@ def initProgramContext(self, params): exec("setattr(self.prg,\"%s\",%s)" % (var, val)) def handleFunctionDeclaration(self, stmt, tgt): - # body of the function starts from next instruction - self.function_addresses[stmt.name + "_" + str(len(stmt.params))] = self.pc + 1 + # mangle the name of private method as _ClassName__methodName + if "@" in stmt.name and stmt.name.split("@")[1].startswith("__"): + class_name, method_name = stmt.name.split("@") + function_name = class_name+ "@" + "_" + class_name.replace(":","") + method_name + print("[DEBUGGING] FUNCTION NAME MANGLED TO: ", function_name) + else: + function_name = stmt.name + + self.function_addresses[function_name + "_" + str(len(stmt.params))] = self.pc + 1 # body of the function starts from next instruction return tgt def handleFunctionCall(self, stmt, tgt): diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index fa2cb60..c0cc96d 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -4,10 +4,10 @@ grammar tlang; start : instruction_list EOF ; -instruction_list : (instruction | declaration)* +instruction_list : (instruction | declaration | comment)* ; -strict_ilist : (instruction)+ +strict_ilist : (instruction | comment)+ ; declaration : classDeclaration @@ -118,6 +118,7 @@ condition : NOT condition | '(' condition ')' ; +comment : '#' (NAME)* '#' ; binCondOp : EQ | NEQ | LT | GT | LTE | GTE ; @@ -147,6 +148,6 @@ NUM : [0-9]+ ; REAL : [0-9]+('.'[0-9]+)?; VAR : ':''__'?[a-zA-Z_] [a-zA-Z0-9]* ; -NAME : [a-zA-Z]+ ; +NAME : '__'?[a-zA-Z]+ ; Whitespace: [ \t\n\r]+ -> skip; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index ee42b4b..2fe52e4 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -25,6 +25,7 @@ null 'new' '.' 'def' +'#' '+' '-' '*' @@ -72,6 +73,7 @@ null null null null +null PLUS MINUS MUL @@ -129,10 +131,11 @@ functionDeclaration parameters arguments condition +comment binCondOp logicOp value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 385, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 7, 3, 86, 10, 3, 12, 3, 14, 3, 89, 11, 3, 3, 4, 6, 4, 92, 10, 4, 13, 4, 14, 4, 93, 3, 5, 3, 5, 5, 5, 98, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 112, 10, 6, 3, 7, 3, 7, 5, 7, 116, 10, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 7, 16, 160, 10, 16, 12, 16, 14, 16, 163, 11, 16, 5, 16, 165, 10, 16, 3, 16, 3, 16, 3, 17, 3, 17, 5, 17, 171, 10, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 191, 10, 22, 12, 22, 14, 22, 194, 11, 22, 5, 22, 196, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 211, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 221, 10, 23, 12, 23, 14, 23, 224, 11, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 232, 10, 24, 12, 24, 14, 24, 235, 11, 24, 5, 24, 237, 10, 24, 3, 24, 5, 24, 240, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 7, 25, 247, 10, 25, 12, 25, 14, 25, 250, 11, 25, 3, 25, 7, 25, 253, 10, 25, 12, 25, 14, 25, 256, 11, 25, 3, 26, 3, 26, 5, 26, 260, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 6, 28, 276, 10, 28, 13, 28, 14, 28, 277, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 284, 10, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 297, 10, 32, 3, 32, 7, 32, 300, 10, 32, 12, 32, 14, 32, 303, 11, 32, 3, 33, 3, 33, 5, 33, 307, 10, 33, 3, 33, 3, 33, 3, 33, 5, 33, 312, 10, 33, 6, 33, 314, 10, 33, 13, 33, 14, 33, 315, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 7, 35, 333, 10, 35, 12, 35, 14, 35, 336, 11, 35, 5, 35, 338, 10, 35, 3, 36, 3, 36, 3, 36, 7, 36, 343, 10, 36, 12, 36, 14, 36, 346, 11, 36, 5, 36, 348, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 362, 10, 37, 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 368, 10, 37, 12, 37, 14, 37, 371, 11, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 5, 40, 383, 10, 40, 3, 40, 2, 4, 44, 72, 41, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 30, 31, 3, 2, 28, 29, 3, 2, 33, 38, 3, 2, 39, 40, 2, 398, 2, 80, 3, 2, 2, 2, 4, 87, 3, 2, 2, 2, 6, 91, 3, 2, 2, 2, 8, 97, 3, 2, 2, 2, 10, 111, 3, 2, 2, 2, 12, 115, 3, 2, 2, 2, 14, 117, 3, 2, 2, 2, 16, 123, 3, 2, 2, 2, 18, 133, 3, 2, 2, 2, 20, 139, 3, 2, 2, 2, 22, 146, 3, 2, 2, 2, 24, 149, 3, 2, 2, 2, 26, 151, 3, 2, 2, 2, 28, 153, 3, 2, 2, 2, 30, 155, 3, 2, 2, 2, 32, 170, 3, 2, 2, 2, 34, 175, 3, 2, 2, 2, 36, 180, 3, 2, 2, 2, 38, 182, 3, 2, 2, 2, 40, 184, 3, 2, 2, 2, 42, 186, 3, 2, 2, 2, 44, 210, 3, 2, 2, 2, 46, 225, 3, 2, 2, 2, 48, 248, 3, 2, 2, 2, 50, 259, 3, 2, 2, 2, 52, 261, 3, 2, 2, 2, 54, 268, 3, 2, 2, 2, 56, 279, 3, 2, 2, 2, 58, 283, 3, 2, 2, 2, 60, 285, 3, 2, 2, 2, 62, 301, 3, 2, 2, 2, 64, 306, 3, 2, 2, 2, 66, 320, 3, 2, 2, 2, 68, 337, 3, 2, 2, 2, 70, 347, 3, 2, 2, 2, 72, 361, 3, 2, 2, 2, 74, 372, 3, 2, 2, 2, 76, 374, 3, 2, 2, 2, 78, 382, 3, 2, 2, 2, 80, 81, 5, 4, 3, 2, 81, 82, 7, 2, 2, 3, 82, 3, 3, 2, 2, 2, 83, 86, 5, 10, 6, 2, 84, 86, 5, 8, 5, 2, 85, 83, 3, 2, 2, 2, 85, 84, 3, 2, 2, 2, 86, 89, 3, 2, 2, 2, 87, 85, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 5, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 90, 92, 5, 10, 6, 2, 91, 90, 3, 2, 2, 2, 92, 93, 3, 2, 2, 2, 93, 91, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 7, 3, 2, 2, 2, 95, 98, 5, 46, 24, 2, 96, 98, 5, 66, 34, 2, 97, 95, 3, 2, 2, 2, 97, 96, 3, 2, 2, 2, 98, 9, 3, 2, 2, 2, 99, 112, 5, 64, 33, 2, 100, 112, 5, 32, 17, 2, 101, 112, 5, 34, 18, 2, 102, 112, 5, 12, 7, 2, 103, 112, 5, 18, 10, 2, 104, 112, 5, 22, 12, 2, 105, 112, 5, 26, 14, 2, 106, 112, 5, 20, 11, 2, 107, 112, 5, 28, 15, 2, 108, 112, 5, 52, 27, 2, 109, 112, 5, 60, 31, 2, 110, 112, 5, 42, 22, 2, 111, 99, 3, 2, 2, 2, 111, 100, 3, 2, 2, 2, 111, 101, 3, 2, 2, 2, 111, 102, 3, 2, 2, 2, 111, 103, 3, 2, 2, 2, 111, 104, 3, 2, 2, 2, 111, 105, 3, 2, 2, 2, 111, 106, 3, 2, 2, 2, 111, 107, 3, 2, 2, 2, 111, 108, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 111, 110, 3, 2, 2, 2, 112, 11, 3, 2, 2, 2, 113, 116, 5, 14, 8, 2, 114, 116, 5, 16, 9, 2, 115, 113, 3, 2, 2, 2, 115, 114, 3, 2, 2, 2, 116, 13, 3, 2, 2, 2, 117, 118, 7, 3, 2, 2, 118, 119, 5, 72, 37, 2, 119, 120, 7, 4, 2, 2, 120, 121, 5, 6, 4, 2, 121, 122, 7, 5, 2, 2, 122, 15, 3, 2, 2, 2, 123, 124, 7, 3, 2, 2, 124, 125, 5, 72, 37, 2, 125, 126, 7, 4, 2, 2, 126, 127, 5, 6, 4, 2, 127, 128, 7, 5, 2, 2, 128, 129, 7, 6, 2, 2, 129, 130, 7, 4, 2, 2, 130, 131, 5, 6, 4, 2, 131, 132, 7, 5, 2, 2, 132, 17, 3, 2, 2, 2, 133, 134, 7, 7, 2, 2, 134, 135, 5, 78, 40, 2, 135, 136, 7, 4, 2, 2, 136, 137, 5, 6, 4, 2, 137, 138, 7, 5, 2, 2, 138, 19, 3, 2, 2, 2, 139, 140, 7, 8, 2, 2, 140, 141, 7, 9, 2, 2, 141, 142, 5, 44, 23, 2, 142, 143, 7, 10, 2, 2, 143, 144, 5, 44, 23, 2, 144, 145, 7, 11, 2, 2, 145, 21, 3, 2, 2, 2, 146, 147, 5, 24, 13, 2, 147, 148, 5, 44, 23, 2, 148, 23, 3, 2, 2, 2, 149, 150, 9, 2, 2, 2, 150, 25, 3, 2, 2, 2, 151, 152, 9, 3, 2, 2, 152, 27, 3, 2, 2, 2, 153, 154, 7, 18, 2, 2, 154, 29, 3, 2, 2, 2, 155, 164, 7, 4, 2, 2, 156, 161, 5, 44, 23, 2, 157, 158, 7, 10, 2, 2, 158, 160, 5, 44, 23, 2, 159, 157, 3, 2, 2, 2, 160, 163, 3, 2, 2, 2, 161, 159, 3, 2, 2, 2, 161, 162, 3, 2, 2, 2, 162, 165, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 164, 156, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 167, 7, 5, 2, 2, 167, 31, 3, 2, 2, 2, 168, 171, 7, 44, 2, 2, 169, 171, 5, 54, 28, 2, 170, 168, 3, 2, 2, 2, 170, 169, 3, 2, 2, 2, 171, 172, 3, 2, 2, 2, 172, 173, 7, 19, 2, 2, 173, 174, 5, 44, 23, 2, 174, 33, 3, 2, 2, 2, 175, 176, 7, 20, 2, 2, 176, 177, 7, 9, 2, 2, 177, 178, 5, 44, 23, 2, 178, 179, 7, 11, 2, 2, 179, 35, 3, 2, 2, 2, 180, 181, 9, 4, 2, 2, 181, 37, 3, 2, 2, 2, 182, 183, 9, 5, 2, 2, 183, 39, 3, 2, 2, 2, 184, 185, 7, 29, 2, 2, 185, 41, 3, 2, 2, 2, 186, 195, 7, 21, 2, 2, 187, 192, 5, 44, 23, 2, 188, 189, 7, 10, 2, 2, 189, 191, 5, 44, 23, 2, 190, 188, 3, 2, 2, 2, 191, 194, 3, 2, 2, 2, 192, 190, 3, 2, 2, 2, 192, 193, 3, 2, 2, 2, 193, 196, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 195, 187, 3, 2, 2, 2, 195, 196, 3, 2, 2, 2, 196, 43, 3, 2, 2, 2, 197, 198, 8, 23, 1, 2, 198, 199, 5, 40, 21, 2, 199, 200, 5, 44, 23, 8, 200, 211, 3, 2, 2, 2, 201, 202, 5, 58, 30, 2, 202, 203, 7, 19, 2, 2, 203, 204, 5, 44, 23, 5, 204, 211, 3, 2, 2, 2, 205, 206, 7, 9, 2, 2, 206, 207, 5, 44, 23, 2, 207, 208, 7, 11, 2, 2, 208, 211, 3, 2, 2, 2, 209, 211, 5, 78, 40, 2, 210, 197, 3, 2, 2, 2, 210, 201, 3, 2, 2, 2, 210, 205, 3, 2, 2, 2, 210, 209, 3, 2, 2, 2, 211, 222, 3, 2, 2, 2, 212, 213, 12, 7, 2, 2, 213, 214, 5, 36, 19, 2, 214, 215, 5, 44, 23, 8, 215, 221, 3, 2, 2, 2, 216, 217, 12, 6, 2, 2, 217, 218, 5, 38, 20, 2, 218, 219, 5, 44, 23, 7, 219, 221, 3, 2, 2, 2, 220, 212, 3, 2, 2, 2, 220, 216, 3, 2, 2, 2, 221, 224, 3, 2, 2, 2, 222, 220, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 45, 3, 2, 2, 2, 224, 222, 3, 2, 2, 2, 225, 226, 7, 22, 2, 2, 226, 239, 7, 44, 2, 2, 227, 228, 7, 9, 2, 2, 228, 236, 7, 44, 2, 2, 229, 233, 7, 10, 2, 2, 230, 232, 7, 44, 2, 2, 231, 230, 3, 2, 2, 2, 232, 235, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 233, 234, 3, 2, 2, 2, 234, 237, 3, 2, 2, 2, 235, 233, 3, 2, 2, 2, 236, 229, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 240, 7, 11, 2, 2, 239, 227, 3, 2, 2, 2, 239, 240, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 242, 7, 23, 2, 2, 242, 243, 5, 48, 25, 2, 243, 244, 7, 24, 2, 2, 244, 47, 3, 2, 2, 2, 245, 247, 5, 50, 26, 2, 246, 245, 3, 2, 2, 2, 247, 250, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 254, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 251, 253, 5, 66, 34, 2, 252, 251, 3, 2, 2, 2, 253, 256, 3, 2, 2, 2, 254, 252, 3, 2, 2, 2, 254, 255, 3, 2, 2, 2, 255, 49, 3, 2, 2, 2, 256, 254, 3, 2, 2, 2, 257, 260, 5, 32, 17, 2, 258, 260, 5, 52, 27, 2, 259, 257, 3, 2, 2, 2, 259, 258, 3, 2, 2, 2, 260, 51, 3, 2, 2, 2, 261, 262, 5, 58, 30, 2, 262, 263, 7, 19, 2, 2, 263, 264, 7, 25, 2, 2, 264, 265, 7, 44, 2, 2, 265, 266, 7, 9, 2, 2, 266, 267, 7, 11, 2, 2, 267, 53, 3, 2, 2, 2, 268, 275, 5, 56, 29, 2, 269, 270, 7, 26, 2, 2, 270, 276, 7, 44, 2, 2, 271, 272, 7, 4, 2, 2, 272, 273, 5, 44, 23, 2, 273, 274, 7, 5, 2, 2, 274, 276, 3, 2, 2, 2, 275, 269, 3, 2, 2, 2, 275, 271, 3, 2, 2, 2, 276, 277, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 55, 3, 2, 2, 2, 279, 280, 7, 44, 2, 2, 280, 57, 3, 2, 2, 2, 281, 284, 7, 44, 2, 2, 282, 284, 5, 54, 28, 2, 283, 281, 3, 2, 2, 2, 283, 282, 3, 2, 2, 2, 284, 59, 3, 2, 2, 2, 285, 286, 5, 62, 32, 2, 286, 287, 7, 45, 2, 2, 287, 288, 7, 9, 2, 2, 288, 289, 5, 70, 36, 2, 289, 290, 7, 11, 2, 2, 290, 61, 3, 2, 2, 2, 291, 297, 7, 44, 2, 2, 292, 293, 7, 4, 2, 2, 293, 294, 5, 44, 23, 2, 294, 295, 7, 5, 2, 2, 295, 297, 3, 2, 2, 2, 296, 291, 3, 2, 2, 2, 296, 292, 3, 2, 2, 2, 297, 298, 3, 2, 2, 2, 298, 300, 7, 26, 2, 2, 299, 296, 3, 2, 2, 2, 300, 303, 3, 2, 2, 2, 301, 299, 3, 2, 2, 2, 301, 302, 3, 2, 2, 2, 302, 63, 3, 2, 2, 2, 303, 301, 3, 2, 2, 2, 304, 307, 7, 44, 2, 2, 305, 307, 5, 54, 28, 2, 306, 304, 3, 2, 2, 2, 306, 305, 3, 2, 2, 2, 307, 313, 3, 2, 2, 2, 308, 311, 7, 10, 2, 2, 309, 312, 7, 44, 2, 2, 310, 312, 5, 54, 28, 2, 311, 309, 3, 2, 2, 2, 311, 310, 3, 2, 2, 2, 312, 314, 3, 2, 2, 2, 313, 308, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 313, 3, 2, 2, 2, 315, 316, 3, 2, 2, 2, 316, 317, 3, 2, 2, 2, 317, 318, 7, 19, 2, 2, 318, 319, 5, 60, 31, 2, 319, 65, 3, 2, 2, 2, 320, 321, 7, 27, 2, 2, 321, 322, 7, 45, 2, 2, 322, 323, 7, 9, 2, 2, 323, 324, 5, 68, 35, 2, 324, 325, 7, 11, 2, 2, 325, 326, 7, 23, 2, 2, 326, 327, 5, 6, 4, 2, 327, 328, 7, 24, 2, 2, 328, 67, 3, 2, 2, 2, 329, 334, 7, 44, 2, 2, 330, 331, 7, 10, 2, 2, 331, 333, 7, 44, 2, 2, 332, 330, 3, 2, 2, 2, 333, 336, 3, 2, 2, 2, 334, 332, 3, 2, 2, 2, 334, 335, 3, 2, 2, 2, 335, 338, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 337, 329, 3, 2, 2, 2, 337, 338, 3, 2, 2, 2, 338, 69, 3, 2, 2, 2, 339, 344, 5, 44, 23, 2, 340, 341, 7, 10, 2, 2, 341, 343, 5, 44, 23, 2, 342, 340, 3, 2, 2, 2, 343, 346, 3, 2, 2, 2, 344, 342, 3, 2, 2, 2, 344, 345, 3, 2, 2, 2, 345, 348, 3, 2, 2, 2, 346, 344, 3, 2, 2, 2, 347, 339, 3, 2, 2, 2, 347, 348, 3, 2, 2, 2, 348, 71, 3, 2, 2, 2, 349, 350, 8, 37, 1, 2, 350, 351, 7, 41, 2, 2, 351, 362, 5, 72, 37, 7, 352, 353, 5, 44, 23, 2, 353, 354, 5, 74, 38, 2, 354, 355, 5, 44, 23, 2, 355, 362, 3, 2, 2, 2, 356, 362, 7, 32, 2, 2, 357, 358, 7, 9, 2, 2, 358, 359, 5, 72, 37, 2, 359, 360, 7, 11, 2, 2, 360, 362, 3, 2, 2, 2, 361, 349, 3, 2, 2, 2, 361, 352, 3, 2, 2, 2, 361, 356, 3, 2, 2, 2, 361, 357, 3, 2, 2, 2, 362, 369, 3, 2, 2, 2, 363, 364, 12, 5, 2, 2, 364, 365, 5, 76, 39, 2, 365, 366, 5, 72, 37, 6, 366, 368, 3, 2, 2, 2, 367, 363, 3, 2, 2, 2, 368, 371, 3, 2, 2, 2, 369, 367, 3, 2, 2, 2, 369, 370, 3, 2, 2, 2, 370, 73, 3, 2, 2, 2, 371, 369, 3, 2, 2, 2, 372, 373, 9, 6, 2, 2, 373, 75, 3, 2, 2, 2, 374, 375, 9, 7, 2, 2, 375, 77, 3, 2, 2, 2, 376, 383, 7, 42, 2, 2, 377, 383, 7, 44, 2, 2, 378, 383, 5, 30, 16, 2, 379, 383, 5, 54, 28, 2, 380, 383, 5, 60, 31, 2, 381, 383, 7, 43, 2, 2, 382, 376, 3, 2, 2, 2, 382, 377, 3, 2, 2, 2, 382, 378, 3, 2, 2, 2, 382, 379, 3, 2, 2, 2, 382, 380, 3, 2, 2, 2, 382, 381, 3, 2, 2, 2, 383, 79, 3, 2, 2, 2, 37, 85, 87, 93, 97, 111, 115, 161, 164, 170, 192, 195, 210, 220, 222, 233, 236, 239, 248, 254, 259, 275, 277, 283, 296, 301, 306, 311, 315, 334, 337, 344, 347, 361, 369, 382] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 397, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 7, 3, 89, 10, 3, 12, 3, 14, 3, 92, 11, 3, 3, 4, 6, 4, 95, 10, 4, 13, 4, 14, 4, 96, 3, 5, 3, 5, 5, 5, 101, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 115, 10, 6, 3, 7, 3, 7, 5, 7, 119, 10, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 7, 16, 163, 10, 16, 12, 16, 14, 16, 166, 11, 16, 5, 16, 168, 10, 16, 3, 16, 3, 16, 3, 17, 3, 17, 5, 17, 174, 10, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 194, 10, 22, 12, 22, 14, 22, 197, 11, 22, 5, 22, 199, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 214, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 224, 10, 23, 12, 23, 14, 23, 227, 11, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 235, 10, 24, 12, 24, 14, 24, 238, 11, 24, 5, 24, 240, 10, 24, 3, 24, 5, 24, 243, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 7, 25, 250, 10, 25, 12, 25, 14, 25, 253, 11, 25, 3, 25, 7, 25, 256, 10, 25, 12, 25, 14, 25, 259, 11, 25, 3, 26, 3, 26, 5, 26, 263, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 6, 28, 279, 10, 28, 13, 28, 14, 28, 280, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 287, 10, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 300, 10, 32, 3, 32, 7, 32, 303, 10, 32, 12, 32, 14, 32, 306, 11, 32, 3, 33, 3, 33, 5, 33, 310, 10, 33, 3, 33, 3, 33, 3, 33, 5, 33, 315, 10, 33, 6, 33, 317, 10, 33, 13, 33, 14, 33, 318, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 7, 35, 336, 10, 35, 12, 35, 14, 35, 339, 11, 35, 5, 35, 341, 10, 35, 3, 36, 3, 36, 3, 36, 7, 36, 346, 10, 36, 12, 36, 14, 36, 349, 11, 36, 5, 36, 351, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 365, 10, 37, 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 371, 10, 37, 12, 37, 14, 37, 374, 11, 37, 3, 38, 3, 38, 7, 38, 378, 10, 38, 12, 38, 14, 38, 381, 11, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 5, 41, 395, 10, 41, 3, 41, 2, 4, 44, 72, 42, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 411, 2, 82, 3, 2, 2, 2, 4, 90, 3, 2, 2, 2, 6, 94, 3, 2, 2, 2, 8, 100, 3, 2, 2, 2, 10, 114, 3, 2, 2, 2, 12, 118, 3, 2, 2, 2, 14, 120, 3, 2, 2, 2, 16, 126, 3, 2, 2, 2, 18, 136, 3, 2, 2, 2, 20, 142, 3, 2, 2, 2, 22, 149, 3, 2, 2, 2, 24, 152, 3, 2, 2, 2, 26, 154, 3, 2, 2, 2, 28, 156, 3, 2, 2, 2, 30, 158, 3, 2, 2, 2, 32, 173, 3, 2, 2, 2, 34, 178, 3, 2, 2, 2, 36, 183, 3, 2, 2, 2, 38, 185, 3, 2, 2, 2, 40, 187, 3, 2, 2, 2, 42, 189, 3, 2, 2, 2, 44, 213, 3, 2, 2, 2, 46, 228, 3, 2, 2, 2, 48, 251, 3, 2, 2, 2, 50, 262, 3, 2, 2, 2, 52, 264, 3, 2, 2, 2, 54, 271, 3, 2, 2, 2, 56, 282, 3, 2, 2, 2, 58, 286, 3, 2, 2, 2, 60, 288, 3, 2, 2, 2, 62, 304, 3, 2, 2, 2, 64, 309, 3, 2, 2, 2, 66, 323, 3, 2, 2, 2, 68, 340, 3, 2, 2, 2, 70, 350, 3, 2, 2, 2, 72, 364, 3, 2, 2, 2, 74, 375, 3, 2, 2, 2, 76, 384, 3, 2, 2, 2, 78, 386, 3, 2, 2, 2, 80, 394, 3, 2, 2, 2, 82, 83, 5, 4, 3, 2, 83, 84, 7, 2, 2, 3, 84, 3, 3, 2, 2, 2, 85, 89, 5, 10, 6, 2, 86, 89, 5, 8, 5, 2, 87, 89, 5, 74, 38, 2, 88, 85, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 88, 87, 3, 2, 2, 2, 89, 92, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 5, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 93, 95, 5, 10, 6, 2, 94, 93, 3, 2, 2, 2, 95, 96, 3, 2, 2, 2, 96, 94, 3, 2, 2, 2, 96, 97, 3, 2, 2, 2, 97, 7, 3, 2, 2, 2, 98, 101, 5, 46, 24, 2, 99, 101, 5, 66, 34, 2, 100, 98, 3, 2, 2, 2, 100, 99, 3, 2, 2, 2, 101, 9, 3, 2, 2, 2, 102, 115, 5, 64, 33, 2, 103, 115, 5, 32, 17, 2, 104, 115, 5, 34, 18, 2, 105, 115, 5, 12, 7, 2, 106, 115, 5, 18, 10, 2, 107, 115, 5, 22, 12, 2, 108, 115, 5, 26, 14, 2, 109, 115, 5, 20, 11, 2, 110, 115, 5, 28, 15, 2, 111, 115, 5, 52, 27, 2, 112, 115, 5, 60, 31, 2, 113, 115, 5, 42, 22, 2, 114, 102, 3, 2, 2, 2, 114, 103, 3, 2, 2, 2, 114, 104, 3, 2, 2, 2, 114, 105, 3, 2, 2, 2, 114, 106, 3, 2, 2, 2, 114, 107, 3, 2, 2, 2, 114, 108, 3, 2, 2, 2, 114, 109, 3, 2, 2, 2, 114, 110, 3, 2, 2, 2, 114, 111, 3, 2, 2, 2, 114, 112, 3, 2, 2, 2, 114, 113, 3, 2, 2, 2, 115, 11, 3, 2, 2, 2, 116, 119, 5, 14, 8, 2, 117, 119, 5, 16, 9, 2, 118, 116, 3, 2, 2, 2, 118, 117, 3, 2, 2, 2, 119, 13, 3, 2, 2, 2, 120, 121, 7, 3, 2, 2, 121, 122, 5, 72, 37, 2, 122, 123, 7, 4, 2, 2, 123, 124, 5, 6, 4, 2, 124, 125, 7, 5, 2, 2, 125, 15, 3, 2, 2, 2, 126, 127, 7, 3, 2, 2, 127, 128, 5, 72, 37, 2, 128, 129, 7, 4, 2, 2, 129, 130, 5, 6, 4, 2, 130, 131, 7, 5, 2, 2, 131, 132, 7, 6, 2, 2, 132, 133, 7, 4, 2, 2, 133, 134, 5, 6, 4, 2, 134, 135, 7, 5, 2, 2, 135, 17, 3, 2, 2, 2, 136, 137, 7, 7, 2, 2, 137, 138, 5, 80, 41, 2, 138, 139, 7, 4, 2, 2, 139, 140, 5, 6, 4, 2, 140, 141, 7, 5, 2, 2, 141, 19, 3, 2, 2, 2, 142, 143, 7, 8, 2, 2, 143, 144, 7, 9, 2, 2, 144, 145, 5, 44, 23, 2, 145, 146, 7, 10, 2, 2, 146, 147, 5, 44, 23, 2, 147, 148, 7, 11, 2, 2, 148, 21, 3, 2, 2, 2, 149, 150, 5, 24, 13, 2, 150, 151, 5, 44, 23, 2, 151, 23, 3, 2, 2, 2, 152, 153, 9, 2, 2, 2, 153, 25, 3, 2, 2, 2, 154, 155, 9, 3, 2, 2, 155, 27, 3, 2, 2, 2, 156, 157, 7, 18, 2, 2, 157, 29, 3, 2, 2, 2, 158, 167, 7, 4, 2, 2, 159, 164, 5, 44, 23, 2, 160, 161, 7, 10, 2, 2, 161, 163, 5, 44, 23, 2, 162, 160, 3, 2, 2, 2, 163, 166, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 168, 3, 2, 2, 2, 166, 164, 3, 2, 2, 2, 167, 159, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 7, 5, 2, 2, 170, 31, 3, 2, 2, 2, 171, 174, 7, 45, 2, 2, 172, 174, 5, 54, 28, 2, 173, 171, 3, 2, 2, 2, 173, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 176, 7, 19, 2, 2, 176, 177, 5, 44, 23, 2, 177, 33, 3, 2, 2, 2, 178, 179, 7, 20, 2, 2, 179, 180, 7, 9, 2, 2, 180, 181, 5, 44, 23, 2, 181, 182, 7, 11, 2, 2, 182, 35, 3, 2, 2, 2, 183, 184, 9, 4, 2, 2, 184, 37, 3, 2, 2, 2, 185, 186, 9, 5, 2, 2, 186, 39, 3, 2, 2, 2, 187, 188, 7, 30, 2, 2, 188, 41, 3, 2, 2, 2, 189, 198, 7, 21, 2, 2, 190, 195, 5, 44, 23, 2, 191, 192, 7, 10, 2, 2, 192, 194, 5, 44, 23, 2, 193, 191, 3, 2, 2, 2, 194, 197, 3, 2, 2, 2, 195, 193, 3, 2, 2, 2, 195, 196, 3, 2, 2, 2, 196, 199, 3, 2, 2, 2, 197, 195, 3, 2, 2, 2, 198, 190, 3, 2, 2, 2, 198, 199, 3, 2, 2, 2, 199, 43, 3, 2, 2, 2, 200, 201, 8, 23, 1, 2, 201, 202, 5, 40, 21, 2, 202, 203, 5, 44, 23, 8, 203, 214, 3, 2, 2, 2, 204, 205, 5, 58, 30, 2, 205, 206, 7, 19, 2, 2, 206, 207, 5, 44, 23, 5, 207, 214, 3, 2, 2, 2, 208, 209, 7, 9, 2, 2, 209, 210, 5, 44, 23, 2, 210, 211, 7, 11, 2, 2, 211, 214, 3, 2, 2, 2, 212, 214, 5, 80, 41, 2, 213, 200, 3, 2, 2, 2, 213, 204, 3, 2, 2, 2, 213, 208, 3, 2, 2, 2, 213, 212, 3, 2, 2, 2, 214, 225, 3, 2, 2, 2, 215, 216, 12, 7, 2, 2, 216, 217, 5, 36, 19, 2, 217, 218, 5, 44, 23, 8, 218, 224, 3, 2, 2, 2, 219, 220, 12, 6, 2, 2, 220, 221, 5, 38, 20, 2, 221, 222, 5, 44, 23, 7, 222, 224, 3, 2, 2, 2, 223, 215, 3, 2, 2, 2, 223, 219, 3, 2, 2, 2, 224, 227, 3, 2, 2, 2, 225, 223, 3, 2, 2, 2, 225, 226, 3, 2, 2, 2, 226, 45, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 228, 229, 7, 22, 2, 2, 229, 242, 7, 45, 2, 2, 230, 231, 7, 9, 2, 2, 231, 239, 7, 45, 2, 2, 232, 236, 7, 10, 2, 2, 233, 235, 7, 45, 2, 2, 234, 233, 3, 2, 2, 2, 235, 238, 3, 2, 2, 2, 236, 234, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 240, 3, 2, 2, 2, 238, 236, 3, 2, 2, 2, 239, 232, 3, 2, 2, 2, 239, 240, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 243, 7, 11, 2, 2, 242, 230, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 245, 7, 23, 2, 2, 245, 246, 5, 48, 25, 2, 246, 247, 7, 24, 2, 2, 247, 47, 3, 2, 2, 2, 248, 250, 5, 50, 26, 2, 249, 248, 3, 2, 2, 2, 250, 253, 3, 2, 2, 2, 251, 249, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 257, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 254, 256, 5, 66, 34, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 49, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 263, 5, 32, 17, 2, 261, 263, 5, 52, 27, 2, 262, 260, 3, 2, 2, 2, 262, 261, 3, 2, 2, 2, 263, 51, 3, 2, 2, 2, 264, 265, 5, 58, 30, 2, 265, 266, 7, 19, 2, 2, 266, 267, 7, 25, 2, 2, 267, 268, 7, 45, 2, 2, 268, 269, 7, 9, 2, 2, 269, 270, 7, 11, 2, 2, 270, 53, 3, 2, 2, 2, 271, 278, 5, 56, 29, 2, 272, 273, 7, 26, 2, 2, 273, 279, 7, 45, 2, 2, 274, 275, 7, 4, 2, 2, 275, 276, 5, 44, 23, 2, 276, 277, 7, 5, 2, 2, 277, 279, 3, 2, 2, 2, 278, 272, 3, 2, 2, 2, 278, 274, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 278, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 55, 3, 2, 2, 2, 282, 283, 7, 45, 2, 2, 283, 57, 3, 2, 2, 2, 284, 287, 7, 45, 2, 2, 285, 287, 5, 54, 28, 2, 286, 284, 3, 2, 2, 2, 286, 285, 3, 2, 2, 2, 287, 59, 3, 2, 2, 2, 288, 289, 5, 62, 32, 2, 289, 290, 7, 46, 2, 2, 290, 291, 7, 9, 2, 2, 291, 292, 5, 70, 36, 2, 292, 293, 7, 11, 2, 2, 293, 61, 3, 2, 2, 2, 294, 300, 7, 45, 2, 2, 295, 296, 7, 4, 2, 2, 296, 297, 5, 44, 23, 2, 297, 298, 7, 5, 2, 2, 298, 300, 3, 2, 2, 2, 299, 294, 3, 2, 2, 2, 299, 295, 3, 2, 2, 2, 300, 301, 3, 2, 2, 2, 301, 303, 7, 26, 2, 2, 302, 299, 3, 2, 2, 2, 303, 306, 3, 2, 2, 2, 304, 302, 3, 2, 2, 2, 304, 305, 3, 2, 2, 2, 305, 63, 3, 2, 2, 2, 306, 304, 3, 2, 2, 2, 307, 310, 7, 45, 2, 2, 308, 310, 5, 54, 28, 2, 309, 307, 3, 2, 2, 2, 309, 308, 3, 2, 2, 2, 310, 316, 3, 2, 2, 2, 311, 314, 7, 10, 2, 2, 312, 315, 7, 45, 2, 2, 313, 315, 5, 54, 28, 2, 314, 312, 3, 2, 2, 2, 314, 313, 3, 2, 2, 2, 315, 317, 3, 2, 2, 2, 316, 311, 3, 2, 2, 2, 317, 318, 3, 2, 2, 2, 318, 316, 3, 2, 2, 2, 318, 319, 3, 2, 2, 2, 319, 320, 3, 2, 2, 2, 320, 321, 7, 19, 2, 2, 321, 322, 5, 60, 31, 2, 322, 65, 3, 2, 2, 2, 323, 324, 7, 27, 2, 2, 324, 325, 7, 46, 2, 2, 325, 326, 7, 9, 2, 2, 326, 327, 5, 68, 35, 2, 327, 328, 7, 11, 2, 2, 328, 329, 7, 23, 2, 2, 329, 330, 5, 6, 4, 2, 330, 331, 7, 24, 2, 2, 331, 67, 3, 2, 2, 2, 332, 337, 7, 45, 2, 2, 333, 334, 7, 10, 2, 2, 334, 336, 7, 45, 2, 2, 335, 333, 3, 2, 2, 2, 336, 339, 3, 2, 2, 2, 337, 335, 3, 2, 2, 2, 337, 338, 3, 2, 2, 2, 338, 341, 3, 2, 2, 2, 339, 337, 3, 2, 2, 2, 340, 332, 3, 2, 2, 2, 340, 341, 3, 2, 2, 2, 341, 69, 3, 2, 2, 2, 342, 347, 5, 44, 23, 2, 343, 344, 7, 10, 2, 2, 344, 346, 5, 44, 23, 2, 345, 343, 3, 2, 2, 2, 346, 349, 3, 2, 2, 2, 347, 345, 3, 2, 2, 2, 347, 348, 3, 2, 2, 2, 348, 351, 3, 2, 2, 2, 349, 347, 3, 2, 2, 2, 350, 342, 3, 2, 2, 2, 350, 351, 3, 2, 2, 2, 351, 71, 3, 2, 2, 2, 352, 353, 8, 37, 1, 2, 353, 354, 7, 42, 2, 2, 354, 365, 5, 72, 37, 7, 355, 356, 5, 44, 23, 2, 356, 357, 5, 76, 39, 2, 357, 358, 5, 44, 23, 2, 358, 365, 3, 2, 2, 2, 359, 365, 7, 33, 2, 2, 360, 361, 7, 9, 2, 2, 361, 362, 5, 72, 37, 2, 362, 363, 7, 11, 2, 2, 363, 365, 3, 2, 2, 2, 364, 352, 3, 2, 2, 2, 364, 355, 3, 2, 2, 2, 364, 359, 3, 2, 2, 2, 364, 360, 3, 2, 2, 2, 365, 372, 3, 2, 2, 2, 366, 367, 12, 5, 2, 2, 367, 368, 5, 78, 40, 2, 368, 369, 5, 72, 37, 6, 369, 371, 3, 2, 2, 2, 370, 366, 3, 2, 2, 2, 371, 374, 3, 2, 2, 2, 372, 370, 3, 2, 2, 2, 372, 373, 3, 2, 2, 2, 373, 73, 3, 2, 2, 2, 374, 372, 3, 2, 2, 2, 375, 379, 7, 28, 2, 2, 376, 378, 7, 46, 2, 2, 377, 376, 3, 2, 2, 2, 378, 381, 3, 2, 2, 2, 379, 377, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 382, 3, 2, 2, 2, 381, 379, 3, 2, 2, 2, 382, 383, 7, 28, 2, 2, 383, 75, 3, 2, 2, 2, 384, 385, 9, 6, 2, 2, 385, 77, 3, 2, 2, 2, 386, 387, 9, 7, 2, 2, 387, 79, 3, 2, 2, 2, 388, 395, 7, 43, 2, 2, 389, 395, 7, 45, 2, 2, 390, 395, 5, 30, 16, 2, 391, 395, 5, 54, 28, 2, 392, 395, 5, 60, 31, 2, 393, 395, 7, 44, 2, 2, 394, 388, 3, 2, 2, 2, 394, 389, 3, 2, 2, 2, 394, 390, 3, 2, 2, 2, 394, 391, 3, 2, 2, 2, 394, 392, 3, 2, 2, 2, 394, 393, 3, 2, 2, 2, 395, 81, 3, 2, 2, 2, 38, 88, 90, 96, 100, 114, 118, 164, 167, 173, 195, 198, 213, 223, 225, 236, 239, 242, 251, 257, 262, 278, 280, 286, 299, 304, 309, 314, 318, 337, 340, 347, 350, 364, 372, 379, 394] \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.tokens b/ChironCore/turtparse/tlang.tokens index 71328b7..fc62d55 100644 --- a/ChironCore/turtparse/tlang.tokens +++ b/ChironCore/turtparse/tlang.tokens @@ -23,25 +23,26 @@ T__21=22 T__22=23 T__23=24 T__24=25 -PLUS=26 -MINUS=27 -MUL=28 -DIV=29 -PENCOND=30 -LT=31 -GT=32 -EQ=33 -NEQ=34 -LTE=35 -GTE=36 -AND=37 -OR=38 -NOT=39 -NUM=40 -REAL=41 -VAR=42 -NAME=43 -Whitespace=44 +T__25=26 +PLUS=27 +MINUS=28 +MUL=29 +DIV=30 +PENCOND=31 +LT=32 +GT=33 +EQ=34 +NEQ=35 +LTE=36 +GTE=37 +AND=38 +OR=39 +NOT=40 +NUM=41 +REAL=42 +VAR=43 +NAME=44 +Whitespace=45 'if'=1 '['=2 ']'=3 @@ -67,17 +68,18 @@ Whitespace=44 'new'=23 '.'=24 'def'=25 -'+'=26 -'-'=27 -'*'=28 -'/'=29 -'pendown?'=30 -'<'=31 -'>'=32 -'=='=33 -'!='=34 -'<='=35 -'>='=36 -'&&'=37 -'||'=38 -'!'=39 +'#'=26 +'+'=27 +'-'=28 +'*'=29 +'/'=30 +'pendown?'=31 +'<'=32 +'>'=33 +'=='=34 +'!='=35 +'<='=36 +'>='=37 +'&&'=38 +'||'=39 +'!'=40 diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index 7609c09..8aeea7c 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -25,6 +25,7 @@ null 'new' '.' 'def' +'#' '+' '-' '*' @@ -72,6 +73,7 @@ null null null null +null PLUS MINUS MUL @@ -118,6 +120,7 @@ T__21 T__22 T__23 T__24 +T__25 PLUS MINUS MUL @@ -146,4 +149,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 46, 287, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 6, 41, 247, 10, 41, 13, 41, 14, 41, 248, 3, 42, 6, 42, 252, 10, 42, 13, 42, 14, 42, 253, 3, 42, 3, 42, 6, 42, 258, 10, 42, 13, 42, 14, 42, 259, 5, 42, 262, 10, 42, 3, 43, 3, 43, 3, 43, 5, 43, 267, 10, 43, 3, 43, 3, 43, 7, 43, 271, 10, 43, 12, 43, 14, 43, 274, 11, 43, 3, 44, 6, 44, 277, 10, 44, 13, 44, 14, 44, 278, 3, 45, 6, 45, 282, 10, 45, 13, 45, 14, 45, 283, 3, 45, 3, 45, 2, 2, 46, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 294, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 3, 91, 3, 2, 2, 2, 5, 94, 3, 2, 2, 2, 7, 96, 3, 2, 2, 2, 9, 98, 3, 2, 2, 2, 11, 103, 3, 2, 2, 2, 13, 110, 3, 2, 2, 2, 15, 115, 3, 2, 2, 2, 17, 117, 3, 2, 2, 2, 19, 119, 3, 2, 2, 2, 21, 121, 3, 2, 2, 2, 23, 129, 3, 2, 2, 2, 25, 138, 3, 2, 2, 2, 27, 143, 3, 2, 2, 2, 29, 149, 3, 2, 2, 2, 31, 155, 3, 2, 2, 2, 33, 163, 3, 2, 2, 2, 35, 169, 3, 2, 2, 2, 37, 171, 3, 2, 2, 2, 39, 177, 3, 2, 2, 2, 41, 184, 3, 2, 2, 2, 43, 190, 3, 2, 2, 2, 45, 192, 3, 2, 2, 2, 47, 194, 3, 2, 2, 2, 49, 198, 3, 2, 2, 2, 51, 200, 3, 2, 2, 2, 53, 204, 3, 2, 2, 2, 55, 206, 3, 2, 2, 2, 57, 208, 3, 2, 2, 2, 59, 210, 3, 2, 2, 2, 61, 212, 3, 2, 2, 2, 63, 221, 3, 2, 2, 2, 65, 223, 3, 2, 2, 2, 67, 225, 3, 2, 2, 2, 69, 228, 3, 2, 2, 2, 71, 231, 3, 2, 2, 2, 73, 234, 3, 2, 2, 2, 75, 237, 3, 2, 2, 2, 77, 240, 3, 2, 2, 2, 79, 243, 3, 2, 2, 2, 81, 246, 3, 2, 2, 2, 83, 251, 3, 2, 2, 2, 85, 263, 3, 2, 2, 2, 87, 276, 3, 2, 2, 2, 89, 281, 3, 2, 2, 2, 91, 92, 7, 107, 2, 2, 92, 93, 7, 104, 2, 2, 93, 4, 3, 2, 2, 2, 94, 95, 7, 93, 2, 2, 95, 6, 3, 2, 2, 2, 96, 97, 7, 95, 2, 2, 97, 8, 3, 2, 2, 2, 98, 99, 7, 103, 2, 2, 99, 100, 7, 110, 2, 2, 100, 101, 7, 117, 2, 2, 101, 102, 7, 103, 2, 2, 102, 10, 3, 2, 2, 2, 103, 104, 7, 116, 2, 2, 104, 105, 7, 103, 2, 2, 105, 106, 7, 114, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 99, 2, 2, 108, 109, 7, 118, 2, 2, 109, 12, 3, 2, 2, 2, 110, 111, 7, 105, 2, 2, 111, 112, 7, 113, 2, 2, 112, 113, 7, 118, 2, 2, 113, 114, 7, 113, 2, 2, 114, 14, 3, 2, 2, 2, 115, 116, 7, 42, 2, 2, 116, 16, 3, 2, 2, 2, 117, 118, 7, 46, 2, 2, 118, 18, 3, 2, 2, 2, 119, 120, 7, 43, 2, 2, 120, 20, 3, 2, 2, 2, 121, 122, 7, 104, 2, 2, 122, 123, 7, 113, 2, 2, 123, 124, 7, 116, 2, 2, 124, 125, 7, 121, 2, 2, 125, 126, 7, 99, 2, 2, 126, 127, 7, 116, 2, 2, 127, 128, 7, 102, 2, 2, 128, 22, 3, 2, 2, 2, 129, 130, 7, 100, 2, 2, 130, 131, 7, 99, 2, 2, 131, 132, 7, 101, 2, 2, 132, 133, 7, 109, 2, 2, 133, 134, 7, 121, 2, 2, 134, 135, 7, 99, 2, 2, 135, 136, 7, 116, 2, 2, 136, 137, 7, 102, 2, 2, 137, 24, 3, 2, 2, 2, 138, 139, 7, 110, 2, 2, 139, 140, 7, 103, 2, 2, 140, 141, 7, 104, 2, 2, 141, 142, 7, 118, 2, 2, 142, 26, 3, 2, 2, 2, 143, 144, 7, 116, 2, 2, 144, 145, 7, 107, 2, 2, 145, 146, 7, 105, 2, 2, 146, 147, 7, 106, 2, 2, 147, 148, 7, 118, 2, 2, 148, 28, 3, 2, 2, 2, 149, 150, 7, 114, 2, 2, 150, 151, 7, 103, 2, 2, 151, 152, 7, 112, 2, 2, 152, 153, 7, 119, 2, 2, 153, 154, 7, 114, 2, 2, 154, 30, 3, 2, 2, 2, 155, 156, 7, 114, 2, 2, 156, 157, 7, 103, 2, 2, 157, 158, 7, 112, 2, 2, 158, 159, 7, 102, 2, 2, 159, 160, 7, 113, 2, 2, 160, 161, 7, 121, 2, 2, 161, 162, 7, 112, 2, 2, 162, 32, 3, 2, 2, 2, 163, 164, 7, 114, 2, 2, 164, 165, 7, 99, 2, 2, 165, 166, 7, 119, 2, 2, 166, 167, 7, 117, 2, 2, 167, 168, 7, 103, 2, 2, 168, 34, 3, 2, 2, 2, 169, 170, 7, 63, 2, 2, 170, 36, 3, 2, 2, 2, 171, 172, 7, 114, 2, 2, 172, 173, 7, 116, 2, 2, 173, 174, 7, 107, 2, 2, 174, 175, 7, 112, 2, 2, 175, 176, 7, 118, 2, 2, 176, 38, 3, 2, 2, 2, 177, 178, 7, 116, 2, 2, 178, 179, 7, 103, 2, 2, 179, 180, 7, 118, 2, 2, 180, 181, 7, 119, 2, 2, 181, 182, 7, 116, 2, 2, 182, 183, 7, 112, 2, 2, 183, 40, 3, 2, 2, 2, 184, 185, 7, 101, 2, 2, 185, 186, 7, 110, 2, 2, 186, 187, 7, 99, 2, 2, 187, 188, 7, 117, 2, 2, 188, 189, 7, 117, 2, 2, 189, 42, 3, 2, 2, 2, 190, 191, 7, 125, 2, 2, 191, 44, 3, 2, 2, 2, 192, 193, 7, 127, 2, 2, 193, 46, 3, 2, 2, 2, 194, 195, 7, 112, 2, 2, 195, 196, 7, 103, 2, 2, 196, 197, 7, 121, 2, 2, 197, 48, 3, 2, 2, 2, 198, 199, 7, 48, 2, 2, 199, 50, 3, 2, 2, 2, 200, 201, 7, 102, 2, 2, 201, 202, 7, 103, 2, 2, 202, 203, 7, 104, 2, 2, 203, 52, 3, 2, 2, 2, 204, 205, 7, 45, 2, 2, 205, 54, 3, 2, 2, 2, 206, 207, 7, 47, 2, 2, 207, 56, 3, 2, 2, 2, 208, 209, 7, 44, 2, 2, 209, 58, 3, 2, 2, 2, 210, 211, 7, 49, 2, 2, 211, 60, 3, 2, 2, 2, 212, 213, 7, 114, 2, 2, 213, 214, 7, 103, 2, 2, 214, 215, 7, 112, 2, 2, 215, 216, 7, 102, 2, 2, 216, 217, 7, 113, 2, 2, 217, 218, 7, 121, 2, 2, 218, 219, 7, 112, 2, 2, 219, 220, 7, 65, 2, 2, 220, 62, 3, 2, 2, 2, 221, 222, 7, 62, 2, 2, 222, 64, 3, 2, 2, 2, 223, 224, 7, 64, 2, 2, 224, 66, 3, 2, 2, 2, 225, 226, 7, 63, 2, 2, 226, 227, 7, 63, 2, 2, 227, 68, 3, 2, 2, 2, 228, 229, 7, 35, 2, 2, 229, 230, 7, 63, 2, 2, 230, 70, 3, 2, 2, 2, 231, 232, 7, 62, 2, 2, 232, 233, 7, 63, 2, 2, 233, 72, 3, 2, 2, 2, 234, 235, 7, 64, 2, 2, 235, 236, 7, 63, 2, 2, 236, 74, 3, 2, 2, 2, 237, 238, 7, 40, 2, 2, 238, 239, 7, 40, 2, 2, 239, 76, 3, 2, 2, 2, 240, 241, 7, 126, 2, 2, 241, 242, 7, 126, 2, 2, 242, 78, 3, 2, 2, 2, 243, 244, 7, 35, 2, 2, 244, 80, 3, 2, 2, 2, 245, 247, 9, 2, 2, 2, 246, 245, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 82, 3, 2, 2, 2, 250, 252, 9, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 253, 254, 3, 2, 2, 2, 254, 261, 3, 2, 2, 2, 255, 257, 7, 48, 2, 2, 256, 258, 9, 2, 2, 2, 257, 256, 3, 2, 2, 2, 258, 259, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 262, 3, 2, 2, 2, 261, 255, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 84, 3, 2, 2, 2, 263, 266, 7, 60, 2, 2, 264, 265, 7, 97, 2, 2, 265, 267, 7, 97, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 272, 9, 3, 2, 2, 269, 271, 9, 4, 2, 2, 270, 269, 3, 2, 2, 2, 271, 274, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 86, 3, 2, 2, 2, 274, 272, 3, 2, 2, 2, 275, 277, 9, 5, 2, 2, 276, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 276, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 88, 3, 2, 2, 2, 280, 282, 9, 6, 2, 2, 281, 280, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 286, 8, 45, 2, 2, 286, 90, 3, 2, 2, 2, 11, 2, 248, 253, 259, 261, 266, 272, 278, 283, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 47, 295, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 251, 10, 42, 13, 42, 14, 42, 252, 3, 43, 6, 43, 256, 10, 43, 13, 43, 14, 43, 257, 3, 43, 3, 43, 6, 43, 262, 10, 43, 13, 43, 14, 43, 263, 5, 43, 266, 10, 43, 3, 44, 3, 44, 3, 44, 5, 44, 271, 10, 44, 3, 44, 3, 44, 7, 44, 275, 10, 44, 12, 44, 14, 44, 278, 11, 44, 3, 45, 3, 45, 5, 45, 282, 10, 45, 3, 45, 6, 45, 285, 10, 45, 13, 45, 14, 45, 286, 3, 46, 6, 46, 290, 10, 46, 13, 46, 14, 46, 291, 3, 46, 3, 46, 2, 2, 47, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 303, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 3, 93, 3, 2, 2, 2, 5, 96, 3, 2, 2, 2, 7, 98, 3, 2, 2, 2, 9, 100, 3, 2, 2, 2, 11, 105, 3, 2, 2, 2, 13, 112, 3, 2, 2, 2, 15, 117, 3, 2, 2, 2, 17, 119, 3, 2, 2, 2, 19, 121, 3, 2, 2, 2, 21, 123, 3, 2, 2, 2, 23, 131, 3, 2, 2, 2, 25, 140, 3, 2, 2, 2, 27, 145, 3, 2, 2, 2, 29, 151, 3, 2, 2, 2, 31, 157, 3, 2, 2, 2, 33, 165, 3, 2, 2, 2, 35, 171, 3, 2, 2, 2, 37, 173, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 186, 3, 2, 2, 2, 43, 192, 3, 2, 2, 2, 45, 194, 3, 2, 2, 2, 47, 196, 3, 2, 2, 2, 49, 200, 3, 2, 2, 2, 51, 202, 3, 2, 2, 2, 53, 206, 3, 2, 2, 2, 55, 208, 3, 2, 2, 2, 57, 210, 3, 2, 2, 2, 59, 212, 3, 2, 2, 2, 61, 214, 3, 2, 2, 2, 63, 216, 3, 2, 2, 2, 65, 225, 3, 2, 2, 2, 67, 227, 3, 2, 2, 2, 69, 229, 3, 2, 2, 2, 71, 232, 3, 2, 2, 2, 73, 235, 3, 2, 2, 2, 75, 238, 3, 2, 2, 2, 77, 241, 3, 2, 2, 2, 79, 244, 3, 2, 2, 2, 81, 247, 3, 2, 2, 2, 83, 250, 3, 2, 2, 2, 85, 255, 3, 2, 2, 2, 87, 267, 3, 2, 2, 2, 89, 281, 3, 2, 2, 2, 91, 289, 3, 2, 2, 2, 93, 94, 7, 107, 2, 2, 94, 95, 7, 104, 2, 2, 95, 4, 3, 2, 2, 2, 96, 97, 7, 93, 2, 2, 97, 6, 3, 2, 2, 2, 98, 99, 7, 95, 2, 2, 99, 8, 3, 2, 2, 2, 100, 101, 7, 103, 2, 2, 101, 102, 7, 110, 2, 2, 102, 103, 7, 117, 2, 2, 103, 104, 7, 103, 2, 2, 104, 10, 3, 2, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 114, 2, 2, 108, 109, 7, 103, 2, 2, 109, 110, 7, 99, 2, 2, 110, 111, 7, 118, 2, 2, 111, 12, 3, 2, 2, 2, 112, 113, 7, 105, 2, 2, 113, 114, 7, 113, 2, 2, 114, 115, 7, 118, 2, 2, 115, 116, 7, 113, 2, 2, 116, 14, 3, 2, 2, 2, 117, 118, 7, 42, 2, 2, 118, 16, 3, 2, 2, 2, 119, 120, 7, 46, 2, 2, 120, 18, 3, 2, 2, 2, 121, 122, 7, 43, 2, 2, 122, 20, 3, 2, 2, 2, 123, 124, 7, 104, 2, 2, 124, 125, 7, 113, 2, 2, 125, 126, 7, 116, 2, 2, 126, 127, 7, 121, 2, 2, 127, 128, 7, 99, 2, 2, 128, 129, 7, 116, 2, 2, 129, 130, 7, 102, 2, 2, 130, 22, 3, 2, 2, 2, 131, 132, 7, 100, 2, 2, 132, 133, 7, 99, 2, 2, 133, 134, 7, 101, 2, 2, 134, 135, 7, 109, 2, 2, 135, 136, 7, 121, 2, 2, 136, 137, 7, 99, 2, 2, 137, 138, 7, 116, 2, 2, 138, 139, 7, 102, 2, 2, 139, 24, 3, 2, 2, 2, 140, 141, 7, 110, 2, 2, 141, 142, 7, 103, 2, 2, 142, 143, 7, 104, 2, 2, 143, 144, 7, 118, 2, 2, 144, 26, 3, 2, 2, 2, 145, 146, 7, 116, 2, 2, 146, 147, 7, 107, 2, 2, 147, 148, 7, 105, 2, 2, 148, 149, 7, 106, 2, 2, 149, 150, 7, 118, 2, 2, 150, 28, 3, 2, 2, 2, 151, 152, 7, 114, 2, 2, 152, 153, 7, 103, 2, 2, 153, 154, 7, 112, 2, 2, 154, 155, 7, 119, 2, 2, 155, 156, 7, 114, 2, 2, 156, 30, 3, 2, 2, 2, 157, 158, 7, 114, 2, 2, 158, 159, 7, 103, 2, 2, 159, 160, 7, 112, 2, 2, 160, 161, 7, 102, 2, 2, 161, 162, 7, 113, 2, 2, 162, 163, 7, 121, 2, 2, 163, 164, 7, 112, 2, 2, 164, 32, 3, 2, 2, 2, 165, 166, 7, 114, 2, 2, 166, 167, 7, 99, 2, 2, 167, 168, 7, 119, 2, 2, 168, 169, 7, 117, 2, 2, 169, 170, 7, 103, 2, 2, 170, 34, 3, 2, 2, 2, 171, 172, 7, 63, 2, 2, 172, 36, 3, 2, 2, 2, 173, 174, 7, 114, 2, 2, 174, 175, 7, 116, 2, 2, 175, 176, 7, 107, 2, 2, 176, 177, 7, 112, 2, 2, 177, 178, 7, 118, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 116, 2, 2, 180, 181, 7, 103, 2, 2, 181, 182, 7, 118, 2, 2, 182, 183, 7, 119, 2, 2, 183, 184, 7, 116, 2, 2, 184, 185, 7, 112, 2, 2, 185, 40, 3, 2, 2, 2, 186, 187, 7, 101, 2, 2, 187, 188, 7, 110, 2, 2, 188, 189, 7, 99, 2, 2, 189, 190, 7, 117, 2, 2, 190, 191, 7, 117, 2, 2, 191, 42, 3, 2, 2, 2, 192, 193, 7, 125, 2, 2, 193, 44, 3, 2, 2, 2, 194, 195, 7, 127, 2, 2, 195, 46, 3, 2, 2, 2, 196, 197, 7, 112, 2, 2, 197, 198, 7, 103, 2, 2, 198, 199, 7, 121, 2, 2, 199, 48, 3, 2, 2, 2, 200, 201, 7, 48, 2, 2, 201, 50, 3, 2, 2, 2, 202, 203, 7, 102, 2, 2, 203, 204, 7, 103, 2, 2, 204, 205, 7, 104, 2, 2, 205, 52, 3, 2, 2, 2, 206, 207, 7, 37, 2, 2, 207, 54, 3, 2, 2, 2, 208, 209, 7, 45, 2, 2, 209, 56, 3, 2, 2, 2, 210, 211, 7, 47, 2, 2, 211, 58, 3, 2, 2, 2, 212, 213, 7, 44, 2, 2, 213, 60, 3, 2, 2, 2, 214, 215, 7, 49, 2, 2, 215, 62, 3, 2, 2, 2, 216, 217, 7, 114, 2, 2, 217, 218, 7, 103, 2, 2, 218, 219, 7, 112, 2, 2, 219, 220, 7, 102, 2, 2, 220, 221, 7, 113, 2, 2, 221, 222, 7, 121, 2, 2, 222, 223, 7, 112, 2, 2, 223, 224, 7, 65, 2, 2, 224, 64, 3, 2, 2, 2, 225, 226, 7, 62, 2, 2, 226, 66, 3, 2, 2, 2, 227, 228, 7, 64, 2, 2, 228, 68, 3, 2, 2, 2, 229, 230, 7, 63, 2, 2, 230, 231, 7, 63, 2, 2, 231, 70, 3, 2, 2, 2, 232, 233, 7, 35, 2, 2, 233, 234, 7, 63, 2, 2, 234, 72, 3, 2, 2, 2, 235, 236, 7, 62, 2, 2, 236, 237, 7, 63, 2, 2, 237, 74, 3, 2, 2, 2, 238, 239, 7, 64, 2, 2, 239, 240, 7, 63, 2, 2, 240, 76, 3, 2, 2, 2, 241, 242, 7, 40, 2, 2, 242, 243, 7, 40, 2, 2, 243, 78, 3, 2, 2, 2, 244, 245, 7, 126, 2, 2, 245, 246, 7, 126, 2, 2, 246, 80, 3, 2, 2, 2, 247, 248, 7, 35, 2, 2, 248, 82, 3, 2, 2, 2, 249, 251, 9, 2, 2, 2, 250, 249, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 84, 3, 2, 2, 2, 254, 256, 9, 2, 2, 2, 255, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 265, 3, 2, 2, 2, 259, 261, 7, 48, 2, 2, 260, 262, 9, 2, 2, 2, 261, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 266, 3, 2, 2, 2, 265, 259, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 86, 3, 2, 2, 2, 267, 270, 7, 60, 2, 2, 268, 269, 7, 97, 2, 2, 269, 271, 7, 97, 2, 2, 270, 268, 3, 2, 2, 2, 270, 271, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 276, 9, 3, 2, 2, 273, 275, 9, 4, 2, 2, 274, 273, 3, 2, 2, 2, 275, 278, 3, 2, 2, 2, 276, 274, 3, 2, 2, 2, 276, 277, 3, 2, 2, 2, 277, 88, 3, 2, 2, 2, 278, 276, 3, 2, 2, 2, 279, 280, 7, 97, 2, 2, 280, 282, 7, 97, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 284, 3, 2, 2, 2, 283, 285, 9, 5, 2, 2, 284, 283, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 90, 3, 2, 2, 2, 288, 290, 9, 6, 2, 2, 289, 288, 3, 2, 2, 2, 290, 291, 3, 2, 2, 2, 291, 289, 3, 2, 2, 2, 291, 292, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 294, 8, 46, 2, 2, 294, 92, 3, 2, 2, 2, 12, 2, 252, 257, 263, 265, 270, 276, 281, 286, 291, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index b9f3f11..2d9c195 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -8,122 +8,126 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2.") - buf.write("\u011f\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2/") + buf.write("\u0127\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") buf.write("\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36") buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%") - buf.write("\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\3\2") - buf.write("\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3") - buf.write("\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\t\3\t") - buf.write("\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3") - buf.write("\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\16") - buf.write("\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17") - buf.write("\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21") - buf.write("\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23") - buf.write("\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25") - buf.write("\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30\3\30\3\30\3\31") - buf.write("\3\31\3\32\3\32\3\32\3\32\3\33\3\33\3\34\3\34\3\35\3\35") - buf.write("\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37") - buf.write("\3 \3 \3!\3!\3\"\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3") - buf.write("&\3&\3&\3\'\3\'\3\'\3(\3(\3)\6)\u00f7\n)\r)\16)\u00f8") - buf.write("\3*\6*\u00fc\n*\r*\16*\u00fd\3*\3*\6*\u0102\n*\r*\16*") - buf.write("\u0103\5*\u0106\n*\3+\3+\3+\5+\u010b\n+\3+\3+\7+\u010f") - buf.write("\n+\f+\16+\u0112\13+\3,\6,\u0115\n,\r,\16,\u0116\3-\6") - buf.write("-\u011a\n-\r-\16-\u011b\3-\3-\2\2.\3\3\5\4\7\5\t\6\13") - buf.write("\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37") - buf.write("\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34") - buf.write("\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.\3\2\7\3") - buf.write("\2\62;\5\2C\\aac|\5\2\62;C\\c|\4\2C\\c|\5\2\13\f\17\17") - buf.write("\"\"\2\u0126\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3") - buf.write("\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2") - buf.write("\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2") - buf.write("\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2") - buf.write("#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2") - buf.write("\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65") - buf.write("\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2") - buf.write("\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2") - buf.write("\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2") - buf.write("\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\3[\3") - buf.write("\2\2\2\5^\3\2\2\2\7`\3\2\2\2\tb\3\2\2\2\13g\3\2\2\2\r") - buf.write("n\3\2\2\2\17s\3\2\2\2\21u\3\2\2\2\23w\3\2\2\2\25y\3\2") - buf.write("\2\2\27\u0081\3\2\2\2\31\u008a\3\2\2\2\33\u008f\3\2\2") - buf.write("\2\35\u0095\3\2\2\2\37\u009b\3\2\2\2!\u00a3\3\2\2\2#\u00a9") - buf.write("\3\2\2\2%\u00ab\3\2\2\2\'\u00b1\3\2\2\2)\u00b8\3\2\2\2") - buf.write("+\u00be\3\2\2\2-\u00c0\3\2\2\2/\u00c2\3\2\2\2\61\u00c6") - buf.write("\3\2\2\2\63\u00c8\3\2\2\2\65\u00cc\3\2\2\2\67\u00ce\3") - buf.write("\2\2\29\u00d0\3\2\2\2;\u00d2\3\2\2\2=\u00d4\3\2\2\2?\u00dd") - buf.write("\3\2\2\2A\u00df\3\2\2\2C\u00e1\3\2\2\2E\u00e4\3\2\2\2") - buf.write("G\u00e7\3\2\2\2I\u00ea\3\2\2\2K\u00ed\3\2\2\2M\u00f0\3") - buf.write("\2\2\2O\u00f3\3\2\2\2Q\u00f6\3\2\2\2S\u00fb\3\2\2\2U\u0107") - buf.write("\3\2\2\2W\u0114\3\2\2\2Y\u0119\3\2\2\2[\\\7k\2\2\\]\7") - buf.write("h\2\2]\4\3\2\2\2^_\7]\2\2_\6\3\2\2\2`a\7_\2\2a\b\3\2\2") - buf.write("\2bc\7g\2\2cd\7n\2\2de\7u\2\2ef\7g\2\2f\n\3\2\2\2gh\7") - buf.write("t\2\2hi\7g\2\2ij\7r\2\2jk\7g\2\2kl\7c\2\2lm\7v\2\2m\f") - buf.write("\3\2\2\2no\7i\2\2op\7q\2\2pq\7v\2\2qr\7q\2\2r\16\3\2\2") - buf.write("\2st\7*\2\2t\20\3\2\2\2uv\7.\2\2v\22\3\2\2\2wx\7+\2\2") - buf.write("x\24\3\2\2\2yz\7h\2\2z{\7q\2\2{|\7t\2\2|}\7y\2\2}~\7c") - buf.write("\2\2~\177\7t\2\2\177\u0080\7f\2\2\u0080\26\3\2\2\2\u0081") - buf.write("\u0082\7d\2\2\u0082\u0083\7c\2\2\u0083\u0084\7e\2\2\u0084") - buf.write("\u0085\7m\2\2\u0085\u0086\7y\2\2\u0086\u0087\7c\2\2\u0087") - buf.write("\u0088\7t\2\2\u0088\u0089\7f\2\2\u0089\30\3\2\2\2\u008a") - buf.write("\u008b\7n\2\2\u008b\u008c\7g\2\2\u008c\u008d\7h\2\2\u008d") - buf.write("\u008e\7v\2\2\u008e\32\3\2\2\2\u008f\u0090\7t\2\2\u0090") - buf.write("\u0091\7k\2\2\u0091\u0092\7i\2\2\u0092\u0093\7j\2\2\u0093") - buf.write("\u0094\7v\2\2\u0094\34\3\2\2\2\u0095\u0096\7r\2\2\u0096") - buf.write("\u0097\7g\2\2\u0097\u0098\7p\2\2\u0098\u0099\7w\2\2\u0099") - buf.write("\u009a\7r\2\2\u009a\36\3\2\2\2\u009b\u009c\7r\2\2\u009c") - buf.write("\u009d\7g\2\2\u009d\u009e\7p\2\2\u009e\u009f\7f\2\2\u009f") - buf.write("\u00a0\7q\2\2\u00a0\u00a1\7y\2\2\u00a1\u00a2\7p\2\2\u00a2") - buf.write(" \3\2\2\2\u00a3\u00a4\7r\2\2\u00a4\u00a5\7c\2\2\u00a5") - buf.write("\u00a6\7w\2\2\u00a6\u00a7\7u\2\2\u00a7\u00a8\7g\2\2\u00a8") - buf.write("\"\3\2\2\2\u00a9\u00aa\7?\2\2\u00aa$\3\2\2\2\u00ab\u00ac") - buf.write("\7r\2\2\u00ac\u00ad\7t\2\2\u00ad\u00ae\7k\2\2\u00ae\u00af") - buf.write("\7p\2\2\u00af\u00b0\7v\2\2\u00b0&\3\2\2\2\u00b1\u00b2") - buf.write("\7t\2\2\u00b2\u00b3\7g\2\2\u00b3\u00b4\7v\2\2\u00b4\u00b5") - buf.write("\7w\2\2\u00b5\u00b6\7t\2\2\u00b6\u00b7\7p\2\2\u00b7(\3") - buf.write("\2\2\2\u00b8\u00b9\7e\2\2\u00b9\u00ba\7n\2\2\u00ba\u00bb") - buf.write("\7c\2\2\u00bb\u00bc\7u\2\2\u00bc\u00bd\7u\2\2\u00bd*\3") - buf.write("\2\2\2\u00be\u00bf\7}\2\2\u00bf,\3\2\2\2\u00c0\u00c1\7") - buf.write("\177\2\2\u00c1.\3\2\2\2\u00c2\u00c3\7p\2\2\u00c3\u00c4") - buf.write("\7g\2\2\u00c4\u00c5\7y\2\2\u00c5\60\3\2\2\2\u00c6\u00c7") - buf.write("\7\60\2\2\u00c7\62\3\2\2\2\u00c8\u00c9\7f\2\2\u00c9\u00ca") - buf.write("\7g\2\2\u00ca\u00cb\7h\2\2\u00cb\64\3\2\2\2\u00cc\u00cd") - buf.write("\7-\2\2\u00cd\66\3\2\2\2\u00ce\u00cf\7/\2\2\u00cf8\3\2") - buf.write("\2\2\u00d0\u00d1\7,\2\2\u00d1:\3\2\2\2\u00d2\u00d3\7\61") - buf.write("\2\2\u00d3<\3\2\2\2\u00d4\u00d5\7r\2\2\u00d5\u00d6\7g") - buf.write("\2\2\u00d6\u00d7\7p\2\2\u00d7\u00d8\7f\2\2\u00d8\u00d9") - buf.write("\7q\2\2\u00d9\u00da\7y\2\2\u00da\u00db\7p\2\2\u00db\u00dc") - buf.write("\7A\2\2\u00dc>\3\2\2\2\u00dd\u00de\7>\2\2\u00de@\3\2\2") - buf.write("\2\u00df\u00e0\7@\2\2\u00e0B\3\2\2\2\u00e1\u00e2\7?\2") - buf.write("\2\u00e2\u00e3\7?\2\2\u00e3D\3\2\2\2\u00e4\u00e5\7#\2") - buf.write("\2\u00e5\u00e6\7?\2\2\u00e6F\3\2\2\2\u00e7\u00e8\7>\2") - buf.write("\2\u00e8\u00e9\7?\2\2\u00e9H\3\2\2\2\u00ea\u00eb\7@\2") - buf.write("\2\u00eb\u00ec\7?\2\2\u00ecJ\3\2\2\2\u00ed\u00ee\7(\2") - buf.write("\2\u00ee\u00ef\7(\2\2\u00efL\3\2\2\2\u00f0\u00f1\7~\2") - buf.write("\2\u00f1\u00f2\7~\2\2\u00f2N\3\2\2\2\u00f3\u00f4\7#\2") - buf.write("\2\u00f4P\3\2\2\2\u00f5\u00f7\t\2\2\2\u00f6\u00f5\3\2") - buf.write("\2\2\u00f7\u00f8\3\2\2\2\u00f8\u00f6\3\2\2\2\u00f8\u00f9") - buf.write("\3\2\2\2\u00f9R\3\2\2\2\u00fa\u00fc\t\2\2\2\u00fb\u00fa") - buf.write("\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\u00fb\3\2\2\2\u00fd") - buf.write("\u00fe\3\2\2\2\u00fe\u0105\3\2\2\2\u00ff\u0101\7\60\2") - buf.write("\2\u0100\u0102\t\2\2\2\u0101\u0100\3\2\2\2\u0102\u0103") - buf.write("\3\2\2\2\u0103\u0101\3\2\2\2\u0103\u0104\3\2\2\2\u0104") - buf.write("\u0106\3\2\2\2\u0105\u00ff\3\2\2\2\u0105\u0106\3\2\2\2") - buf.write("\u0106T\3\2\2\2\u0107\u010a\7<\2\2\u0108\u0109\7a\2\2") - buf.write("\u0109\u010b\7a\2\2\u010a\u0108\3\2\2\2\u010a\u010b\3") - buf.write("\2\2\2\u010b\u010c\3\2\2\2\u010c\u0110\t\3\2\2\u010d\u010f") - buf.write("\t\4\2\2\u010e\u010d\3\2\2\2\u010f\u0112\3\2\2\2\u0110") - buf.write("\u010e\3\2\2\2\u0110\u0111\3\2\2\2\u0111V\3\2\2\2\u0112") - buf.write("\u0110\3\2\2\2\u0113\u0115\t\5\2\2\u0114\u0113\3\2\2\2") - buf.write("\u0115\u0116\3\2\2\2\u0116\u0114\3\2\2\2\u0116\u0117\3") - buf.write("\2\2\2\u0117X\3\2\2\2\u0118\u011a\t\6\2\2\u0119\u0118") - buf.write("\3\2\2\2\u011a\u011b\3\2\2\2\u011b\u0119\3\2\2\2\u011b") - buf.write("\u011c\3\2\2\2\u011c\u011d\3\2\2\2\u011d\u011e\b-\2\2") - buf.write("\u011eZ\3\2\2\2\13\2\u00f8\u00fd\u0103\u0105\u010a\u0110") - buf.write("\u0116\u011b\3\b\2\2") + buf.write("\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\4.") + buf.write("\t.\3\2\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3") + buf.write("\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b") + buf.write("\3\t\3\t\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3") + buf.write("\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3") + buf.write("\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3") + buf.write("\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20") + buf.write("\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23") + buf.write("\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25") + buf.write("\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30") + buf.write("\3\30\3\30\3\31\3\31\3\32\3\32\3\32\3\32\3\33\3\33\3\34") + buf.write("\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3 \3 \3 \3 \3 \3 ") + buf.write("\3 \3 \3 \3!\3!\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3&") + buf.write("\3&\3&\3\'\3\'\3\'\3(\3(\3(\3)\3)\3*\6*\u00fb\n*\r*\16") + buf.write("*\u00fc\3+\6+\u0100\n+\r+\16+\u0101\3+\3+\6+\u0106\n+") + buf.write("\r+\16+\u0107\5+\u010a\n+\3,\3,\3,\5,\u010f\n,\3,\3,\7") + buf.write(",\u0113\n,\f,\16,\u0116\13,\3-\3-\5-\u011a\n-\3-\6-\u011d") + buf.write("\n-\r-\16-\u011e\3.\6.\u0122\n.\r.\16.\u0123\3.\3.\2\2") + buf.write("/\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31") + buf.write("\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31") + buf.write("\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O") + buf.write(")Q*S+U,W-Y.[/\3\2\7\3\2\62;\5\2C\\aac|\5\2\62;C\\c|\4") + buf.write("\2C\\c|\5\2\13\f\17\17\"\"\2\u012f\2\3\3\2\2\2\2\5\3\2") + buf.write("\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2") + buf.write("\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2") + buf.write("\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37") + buf.write("\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2") + buf.write("\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2") + buf.write("\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2") + buf.write("\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2") + buf.write("\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2") + buf.write("\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3") + buf.write("\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\3]\3\2\2\2\5`\3\2\2\2\7b") + buf.write("\3\2\2\2\td\3\2\2\2\13i\3\2\2\2\rp\3\2\2\2\17u\3\2\2\2") + buf.write("\21w\3\2\2\2\23y\3\2\2\2\25{\3\2\2\2\27\u0083\3\2\2\2") + buf.write("\31\u008c\3\2\2\2\33\u0091\3\2\2\2\35\u0097\3\2\2\2\37") + buf.write("\u009d\3\2\2\2!\u00a5\3\2\2\2#\u00ab\3\2\2\2%\u00ad\3") + buf.write("\2\2\2\'\u00b3\3\2\2\2)\u00ba\3\2\2\2+\u00c0\3\2\2\2-") + buf.write("\u00c2\3\2\2\2/\u00c4\3\2\2\2\61\u00c8\3\2\2\2\63\u00ca") + buf.write("\3\2\2\2\65\u00ce\3\2\2\2\67\u00d0\3\2\2\29\u00d2\3\2") + buf.write("\2\2;\u00d4\3\2\2\2=\u00d6\3\2\2\2?\u00d8\3\2\2\2A\u00e1") + buf.write("\3\2\2\2C\u00e3\3\2\2\2E\u00e5\3\2\2\2G\u00e8\3\2\2\2") + buf.write("I\u00eb\3\2\2\2K\u00ee\3\2\2\2M\u00f1\3\2\2\2O\u00f4\3") + buf.write("\2\2\2Q\u00f7\3\2\2\2S\u00fa\3\2\2\2U\u00ff\3\2\2\2W\u010b") + buf.write("\3\2\2\2Y\u0119\3\2\2\2[\u0121\3\2\2\2]^\7k\2\2^_\7h\2") + buf.write("\2_\4\3\2\2\2`a\7]\2\2a\6\3\2\2\2bc\7_\2\2c\b\3\2\2\2") + buf.write("de\7g\2\2ef\7n\2\2fg\7u\2\2gh\7g\2\2h\n\3\2\2\2ij\7t\2") + buf.write("\2jk\7g\2\2kl\7r\2\2lm\7g\2\2mn\7c\2\2no\7v\2\2o\f\3\2") + buf.write("\2\2pq\7i\2\2qr\7q\2\2rs\7v\2\2st\7q\2\2t\16\3\2\2\2u") + buf.write("v\7*\2\2v\20\3\2\2\2wx\7.\2\2x\22\3\2\2\2yz\7+\2\2z\24") + buf.write("\3\2\2\2{|\7h\2\2|}\7q\2\2}~\7t\2\2~\177\7y\2\2\177\u0080") + buf.write("\7c\2\2\u0080\u0081\7t\2\2\u0081\u0082\7f\2\2\u0082\26") + buf.write("\3\2\2\2\u0083\u0084\7d\2\2\u0084\u0085\7c\2\2\u0085\u0086") + buf.write("\7e\2\2\u0086\u0087\7m\2\2\u0087\u0088\7y\2\2\u0088\u0089") + buf.write("\7c\2\2\u0089\u008a\7t\2\2\u008a\u008b\7f\2\2\u008b\30") + buf.write("\3\2\2\2\u008c\u008d\7n\2\2\u008d\u008e\7g\2\2\u008e\u008f") + buf.write("\7h\2\2\u008f\u0090\7v\2\2\u0090\32\3\2\2\2\u0091\u0092") + buf.write("\7t\2\2\u0092\u0093\7k\2\2\u0093\u0094\7i\2\2\u0094\u0095") + buf.write("\7j\2\2\u0095\u0096\7v\2\2\u0096\34\3\2\2\2\u0097\u0098") + buf.write("\7r\2\2\u0098\u0099\7g\2\2\u0099\u009a\7p\2\2\u009a\u009b") + buf.write("\7w\2\2\u009b\u009c\7r\2\2\u009c\36\3\2\2\2\u009d\u009e") + buf.write("\7r\2\2\u009e\u009f\7g\2\2\u009f\u00a0\7p\2\2\u00a0\u00a1") + buf.write("\7f\2\2\u00a1\u00a2\7q\2\2\u00a2\u00a3\7y\2\2\u00a3\u00a4") + buf.write("\7p\2\2\u00a4 \3\2\2\2\u00a5\u00a6\7r\2\2\u00a6\u00a7") + buf.write("\7c\2\2\u00a7\u00a8\7w\2\2\u00a8\u00a9\7u\2\2\u00a9\u00aa") + buf.write("\7g\2\2\u00aa\"\3\2\2\2\u00ab\u00ac\7?\2\2\u00ac$\3\2") + buf.write("\2\2\u00ad\u00ae\7r\2\2\u00ae\u00af\7t\2\2\u00af\u00b0") + buf.write("\7k\2\2\u00b0\u00b1\7p\2\2\u00b1\u00b2\7v\2\2\u00b2&\3") + buf.write("\2\2\2\u00b3\u00b4\7t\2\2\u00b4\u00b5\7g\2\2\u00b5\u00b6") + buf.write("\7v\2\2\u00b6\u00b7\7w\2\2\u00b7\u00b8\7t\2\2\u00b8\u00b9") + buf.write("\7p\2\2\u00b9(\3\2\2\2\u00ba\u00bb\7e\2\2\u00bb\u00bc") + buf.write("\7n\2\2\u00bc\u00bd\7c\2\2\u00bd\u00be\7u\2\2\u00be\u00bf") + buf.write("\7u\2\2\u00bf*\3\2\2\2\u00c0\u00c1\7}\2\2\u00c1,\3\2\2") + buf.write("\2\u00c2\u00c3\7\177\2\2\u00c3.\3\2\2\2\u00c4\u00c5\7") + buf.write("p\2\2\u00c5\u00c6\7g\2\2\u00c6\u00c7\7y\2\2\u00c7\60\3") + buf.write("\2\2\2\u00c8\u00c9\7\60\2\2\u00c9\62\3\2\2\2\u00ca\u00cb") + buf.write("\7f\2\2\u00cb\u00cc\7g\2\2\u00cc\u00cd\7h\2\2\u00cd\64") + buf.write("\3\2\2\2\u00ce\u00cf\7%\2\2\u00cf\66\3\2\2\2\u00d0\u00d1") + buf.write("\7-\2\2\u00d18\3\2\2\2\u00d2\u00d3\7/\2\2\u00d3:\3\2\2") + buf.write("\2\u00d4\u00d5\7,\2\2\u00d5<\3\2\2\2\u00d6\u00d7\7\61") + buf.write("\2\2\u00d7>\3\2\2\2\u00d8\u00d9\7r\2\2\u00d9\u00da\7g") + buf.write("\2\2\u00da\u00db\7p\2\2\u00db\u00dc\7f\2\2\u00dc\u00dd") + buf.write("\7q\2\2\u00dd\u00de\7y\2\2\u00de\u00df\7p\2\2\u00df\u00e0") + buf.write("\7A\2\2\u00e0@\3\2\2\2\u00e1\u00e2\7>\2\2\u00e2B\3\2\2") + buf.write("\2\u00e3\u00e4\7@\2\2\u00e4D\3\2\2\2\u00e5\u00e6\7?\2") + buf.write("\2\u00e6\u00e7\7?\2\2\u00e7F\3\2\2\2\u00e8\u00e9\7#\2") + buf.write("\2\u00e9\u00ea\7?\2\2\u00eaH\3\2\2\2\u00eb\u00ec\7>\2") + buf.write("\2\u00ec\u00ed\7?\2\2\u00edJ\3\2\2\2\u00ee\u00ef\7@\2") + buf.write("\2\u00ef\u00f0\7?\2\2\u00f0L\3\2\2\2\u00f1\u00f2\7(\2") + buf.write("\2\u00f2\u00f3\7(\2\2\u00f3N\3\2\2\2\u00f4\u00f5\7~\2") + buf.write("\2\u00f5\u00f6\7~\2\2\u00f6P\3\2\2\2\u00f7\u00f8\7#\2") + buf.write("\2\u00f8R\3\2\2\2\u00f9\u00fb\t\2\2\2\u00fa\u00f9\3\2") + buf.write("\2\2\u00fb\u00fc\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd") + buf.write("\3\2\2\2\u00fdT\3\2\2\2\u00fe\u0100\t\2\2\2\u00ff\u00fe") + buf.write("\3\2\2\2\u0100\u0101\3\2\2\2\u0101\u00ff\3\2\2\2\u0101") + buf.write("\u0102\3\2\2\2\u0102\u0109\3\2\2\2\u0103\u0105\7\60\2") + buf.write("\2\u0104\u0106\t\2\2\2\u0105\u0104\3\2\2\2\u0106\u0107") + buf.write("\3\2\2\2\u0107\u0105\3\2\2\2\u0107\u0108\3\2\2\2\u0108") + buf.write("\u010a\3\2\2\2\u0109\u0103\3\2\2\2\u0109\u010a\3\2\2\2") + buf.write("\u010aV\3\2\2\2\u010b\u010e\7<\2\2\u010c\u010d\7a\2\2") + buf.write("\u010d\u010f\7a\2\2\u010e\u010c\3\2\2\2\u010e\u010f\3") + buf.write("\2\2\2\u010f\u0110\3\2\2\2\u0110\u0114\t\3\2\2\u0111\u0113") + buf.write("\t\4\2\2\u0112\u0111\3\2\2\2\u0113\u0116\3\2\2\2\u0114") + buf.write("\u0112\3\2\2\2\u0114\u0115\3\2\2\2\u0115X\3\2\2\2\u0116") + buf.write("\u0114\3\2\2\2\u0117\u0118\7a\2\2\u0118\u011a\7a\2\2\u0119") + buf.write("\u0117\3\2\2\2\u0119\u011a\3\2\2\2\u011a\u011c\3\2\2\2") + buf.write("\u011b\u011d\t\5\2\2\u011c\u011b\3\2\2\2\u011d\u011e\3") + buf.write("\2\2\2\u011e\u011c\3\2\2\2\u011e\u011f\3\2\2\2\u011fZ") + buf.write("\3\2\2\2\u0120\u0122\t\6\2\2\u0121\u0120\3\2\2\2\u0122") + buf.write("\u0123\3\2\2\2\u0123\u0121\3\2\2\2\u0123\u0124\3\2\2\2") + buf.write("\u0124\u0125\3\2\2\2\u0125\u0126\b.\2\2\u0126\\\3\2\2") + buf.write("\2\f\2\u00fc\u0101\u0107\u0109\u010e\u0114\u0119\u011e") + buf.write("\u0123\3\b\2\2") return buf.getvalue() @@ -158,25 +162,26 @@ class tlangLexer(Lexer): T__22 = 23 T__23 = 24 T__24 = 25 - PLUS = 26 - MINUS = 27 - MUL = 28 - DIV = 29 - PENCOND = 30 - LT = 31 - GT = 32 - EQ = 33 - NEQ = 34 - LTE = 35 - GTE = 36 - AND = 37 - OR = 38 - NOT = 39 - NUM = 40 - REAL = 41 - VAR = 42 - NAME = 43 - Whitespace = 44 + T__25 = 26 + PLUS = 27 + MINUS = 28 + MUL = 29 + DIV = 30 + PENCOND = 31 + LT = 32 + GT = 33 + EQ = 34 + NEQ = 35 + LTE = 36 + GTE = 37 + AND = 38 + OR = 39 + NOT = 40 + NUM = 41 + REAL = 42 + VAR = 43 + NAME = 44 + Whitespace = 45 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] @@ -186,9 +191,9 @@ class tlangLexer(Lexer): "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'return'", - "'class'", "'{'", "'}'", "'new'", "'.'", "'def'", "'+'", "'-'", - "'*'", "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", - "'>='", "'&&'", "'||'", "'!'" ] + "'class'", "'{'", "'}'", "'new'", "'.'", "'def'", "'#'", "'+'", + "'-'", "'*'", "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", + "'<='", "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", @@ -198,10 +203,10 @@ class tlangLexer(Lexer): ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", - "T__20", "T__21", "T__22", "T__23", "T__24", "PLUS", "MINUS", - "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", - "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", "NAME", - "Whitespace" ] + "T__20", "T__21", "T__22", "T__23", "T__24", "T__25", + "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", + "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", + "REAL", "VAR", "NAME", "Whitespace" ] grammarFileName = "tlang.g4" diff --git a/ChironCore/turtparse/tlangLexer.tokens b/ChironCore/turtparse/tlangLexer.tokens index 71328b7..fc62d55 100644 --- a/ChironCore/turtparse/tlangLexer.tokens +++ b/ChironCore/turtparse/tlangLexer.tokens @@ -23,25 +23,26 @@ T__21=22 T__22=23 T__23=24 T__24=25 -PLUS=26 -MINUS=27 -MUL=28 -DIV=29 -PENCOND=30 -LT=31 -GT=32 -EQ=33 -NEQ=34 -LTE=35 -GTE=36 -AND=37 -OR=38 -NOT=39 -NUM=40 -REAL=41 -VAR=42 -NAME=43 -Whitespace=44 +T__25=26 +PLUS=27 +MINUS=28 +MUL=29 +DIV=30 +PENCOND=31 +LT=32 +GT=33 +EQ=34 +NEQ=35 +LTE=36 +GTE=37 +AND=38 +OR=39 +NOT=40 +NUM=41 +REAL=42 +VAR=43 +NAME=44 +Whitespace=45 'if'=1 '['=2 ']'=3 @@ -67,17 +68,18 @@ Whitespace=44 'new'=23 '.'=24 'def'=25 -'+'=26 -'-'=27 -'*'=28 -'/'=29 -'pendown?'=30 -'<'=31 -'>'=32 -'=='=33 -'!='=34 -'<='=35 -'>='=36 -'&&'=37 -'||'=38 -'!'=39 +'#'=26 +'+'=27 +'-'=28 +'*'=29 +'/'=30 +'pendown?'=31 +'<'=32 +'>'=33 +'=='=34 +'!='=35 +'<='=36 +'>='=37 +'&&'=38 +'||'=39 +'!'=40 diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index 3582691..5fd2da8 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -8,176 +8,182 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3.") - buf.write("\u0181\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3/") + buf.write("\u018d\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36") buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t") - buf.write("&\4\'\t\'\4(\t(\3\2\3\2\3\2\3\3\3\3\7\3V\n\3\f\3\16\3") - buf.write("Y\13\3\3\4\6\4\\\n\4\r\4\16\4]\3\5\3\5\5\5b\n\5\3\6\3") - buf.write("\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\5\6p\n\6\3") - buf.write("\7\3\7\5\7t\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3") - buf.write("\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\13") - buf.write("\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\r\3\r\3\16") - buf.write("\3\16\3\17\3\17\3\20\3\20\3\20\3\20\7\20\u00a0\n\20\f") - buf.write("\20\16\20\u00a3\13\20\5\20\u00a5\n\20\3\20\3\20\3\21\3") - buf.write("\21\5\21\u00ab\n\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22") - buf.write("\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\26\3\26") - buf.write("\7\26\u00bf\n\26\f\26\16\26\u00c2\13\26\5\26\u00c4\n\26") - buf.write("\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27") - buf.write("\3\27\3\27\5\27\u00d3\n\27\3\27\3\27\3\27\3\27\3\27\3") - buf.write("\27\3\27\3\27\7\27\u00dd\n\27\f\27\16\27\u00e0\13\27\3") - buf.write("\30\3\30\3\30\3\30\3\30\3\30\7\30\u00e8\n\30\f\30\16\30") - buf.write("\u00eb\13\30\5\30\u00ed\n\30\3\30\5\30\u00f0\n\30\3\30") - buf.write("\3\30\3\30\3\30\3\31\7\31\u00f7\n\31\f\31\16\31\u00fa") - buf.write("\13\31\3\31\7\31\u00fd\n\31\f\31\16\31\u0100\13\31\3\32") - buf.write("\3\32\5\32\u0104\n\32\3\33\3\33\3\33\3\33\3\33\3\33\3") - buf.write("\33\3\34\3\34\3\34\3\34\3\34\3\34\3\34\6\34\u0114\n\34") - buf.write("\r\34\16\34\u0115\3\35\3\35\3\36\3\36\5\36\u011c\n\36") - buf.write("\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3 \5 \u0129") - buf.write("\n \3 \7 \u012c\n \f \16 \u012f\13 \3!\3!\5!\u0133\n!") - buf.write("\3!\3!\3!\5!\u0138\n!\6!\u013a\n!\r!\16!\u013b\3!\3!\3") - buf.write("!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\7#\u014d") - buf.write("\n#\f#\16#\u0150\13#\5#\u0152\n#\3$\3$\3$\7$\u0157\n$") - buf.write("\f$\16$\u015a\13$\5$\u015c\n$\3%\3%\3%\3%\3%\3%\3%\3%") - buf.write("\3%\3%\3%\3%\5%\u016a\n%\3%\3%\3%\3%\7%\u0170\n%\f%\16") - buf.write("%\u0173\13%\3&\3&\3\'\3\'\3(\3(\3(\3(\3(\3(\5(\u017f\n") - buf.write("(\3(\2\4,H)\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"") - buf.write("$&(*,.\60\62\64\668:<>@BDFHJLN\2\b\3\2\f\17\3\2\20\21") - buf.write("\3\2\36\37\3\2\34\35\3\2!&\3\2\'(\2\u018e\2P\3\2\2\2\4") - buf.write("W\3\2\2\2\6[\3\2\2\2\ba\3\2\2\2\no\3\2\2\2\fs\3\2\2\2") - buf.write("\16u\3\2\2\2\20{\3\2\2\2\22\u0085\3\2\2\2\24\u008b\3\2") - buf.write("\2\2\26\u0092\3\2\2\2\30\u0095\3\2\2\2\32\u0097\3\2\2") - buf.write("\2\34\u0099\3\2\2\2\36\u009b\3\2\2\2 \u00aa\3\2\2\2\"") - buf.write("\u00af\3\2\2\2$\u00b4\3\2\2\2&\u00b6\3\2\2\2(\u00b8\3") - buf.write("\2\2\2*\u00ba\3\2\2\2,\u00d2\3\2\2\2.\u00e1\3\2\2\2\60") - buf.write("\u00f8\3\2\2\2\62\u0103\3\2\2\2\64\u0105\3\2\2\2\66\u010c") - buf.write("\3\2\2\28\u0117\3\2\2\2:\u011b\3\2\2\2<\u011d\3\2\2\2") - buf.write(">\u012d\3\2\2\2@\u0132\3\2\2\2B\u0140\3\2\2\2D\u0151\3") - buf.write("\2\2\2F\u015b\3\2\2\2H\u0169\3\2\2\2J\u0174\3\2\2\2L\u0176") - buf.write("\3\2\2\2N\u017e\3\2\2\2PQ\5\4\3\2QR\7\2\2\3R\3\3\2\2\2") - buf.write("SV\5\n\6\2TV\5\b\5\2US\3\2\2\2UT\3\2\2\2VY\3\2\2\2WU\3") - buf.write("\2\2\2WX\3\2\2\2X\5\3\2\2\2YW\3\2\2\2Z\\\5\n\6\2[Z\3\2") - buf.write("\2\2\\]\3\2\2\2][\3\2\2\2]^\3\2\2\2^\7\3\2\2\2_b\5.\30") - buf.write("\2`b\5B\"\2a_\3\2\2\2a`\3\2\2\2b\t\3\2\2\2cp\5@!\2dp\5") - buf.write(" \21\2ep\5\"\22\2fp\5\f\7\2gp\5\22\n\2hp\5\26\f\2ip\5") - buf.write("\32\16\2jp\5\24\13\2kp\5\34\17\2lp\5\64\33\2mp\5<\37\2") - buf.write("np\5*\26\2oc\3\2\2\2od\3\2\2\2oe\3\2\2\2of\3\2\2\2og\3") - buf.write("\2\2\2oh\3\2\2\2oi\3\2\2\2oj\3\2\2\2ok\3\2\2\2ol\3\2\2") - buf.write("\2om\3\2\2\2on\3\2\2\2p\13\3\2\2\2qt\5\16\b\2rt\5\20\t") - buf.write("\2sq\3\2\2\2sr\3\2\2\2t\r\3\2\2\2uv\7\3\2\2vw\5H%\2wx") - buf.write("\7\4\2\2xy\5\6\4\2yz\7\5\2\2z\17\3\2\2\2{|\7\3\2\2|}\5") - buf.write("H%\2}~\7\4\2\2~\177\5\6\4\2\177\u0080\7\5\2\2\u0080\u0081") - buf.write("\7\6\2\2\u0081\u0082\7\4\2\2\u0082\u0083\5\6\4\2\u0083") - buf.write("\u0084\7\5\2\2\u0084\21\3\2\2\2\u0085\u0086\7\7\2\2\u0086") - buf.write("\u0087\5N(\2\u0087\u0088\7\4\2\2\u0088\u0089\5\6\4\2\u0089") - buf.write("\u008a\7\5\2\2\u008a\23\3\2\2\2\u008b\u008c\7\b\2\2\u008c") - buf.write("\u008d\7\t\2\2\u008d\u008e\5,\27\2\u008e\u008f\7\n\2\2") - buf.write("\u008f\u0090\5,\27\2\u0090\u0091\7\13\2\2\u0091\25\3\2") - buf.write("\2\2\u0092\u0093\5\30\r\2\u0093\u0094\5,\27\2\u0094\27") - buf.write("\3\2\2\2\u0095\u0096\t\2\2\2\u0096\31\3\2\2\2\u0097\u0098") - buf.write("\t\3\2\2\u0098\33\3\2\2\2\u0099\u009a\7\22\2\2\u009a\35") - buf.write("\3\2\2\2\u009b\u00a4\7\4\2\2\u009c\u00a1\5,\27\2\u009d") - buf.write("\u009e\7\n\2\2\u009e\u00a0\5,\27\2\u009f\u009d\3\2\2\2") - buf.write("\u00a0\u00a3\3\2\2\2\u00a1\u009f\3\2\2\2\u00a1\u00a2\3") - buf.write("\2\2\2\u00a2\u00a5\3\2\2\2\u00a3\u00a1\3\2\2\2\u00a4\u009c") - buf.write("\3\2\2\2\u00a4\u00a5\3\2\2\2\u00a5\u00a6\3\2\2\2\u00a6") - buf.write("\u00a7\7\5\2\2\u00a7\37\3\2\2\2\u00a8\u00ab\7,\2\2\u00a9") - buf.write("\u00ab\5\66\34\2\u00aa\u00a8\3\2\2\2\u00aa\u00a9\3\2\2") - buf.write("\2\u00ab\u00ac\3\2\2\2\u00ac\u00ad\7\23\2\2\u00ad\u00ae") - buf.write("\5,\27\2\u00ae!\3\2\2\2\u00af\u00b0\7\24\2\2\u00b0\u00b1") - buf.write("\7\t\2\2\u00b1\u00b2\5,\27\2\u00b2\u00b3\7\13\2\2\u00b3") - buf.write("#\3\2\2\2\u00b4\u00b5\t\4\2\2\u00b5%\3\2\2\2\u00b6\u00b7") - buf.write("\t\5\2\2\u00b7\'\3\2\2\2\u00b8\u00b9\7\35\2\2\u00b9)\3") - buf.write("\2\2\2\u00ba\u00c3\7\25\2\2\u00bb\u00c0\5,\27\2\u00bc") - buf.write("\u00bd\7\n\2\2\u00bd\u00bf\5,\27\2\u00be\u00bc\3\2\2\2") - buf.write("\u00bf\u00c2\3\2\2\2\u00c0\u00be\3\2\2\2\u00c0\u00c1\3") - buf.write("\2\2\2\u00c1\u00c4\3\2\2\2\u00c2\u00c0\3\2\2\2\u00c3\u00bb") - buf.write("\3\2\2\2\u00c3\u00c4\3\2\2\2\u00c4+\3\2\2\2\u00c5\u00c6") - buf.write("\b\27\1\2\u00c6\u00c7\5(\25\2\u00c7\u00c8\5,\27\b\u00c8") - buf.write("\u00d3\3\2\2\2\u00c9\u00ca\5:\36\2\u00ca\u00cb\7\23\2") - buf.write("\2\u00cb\u00cc\5,\27\5\u00cc\u00d3\3\2\2\2\u00cd\u00ce") - buf.write("\7\t\2\2\u00ce\u00cf\5,\27\2\u00cf\u00d0\7\13\2\2\u00d0") - buf.write("\u00d3\3\2\2\2\u00d1\u00d3\5N(\2\u00d2\u00c5\3\2\2\2\u00d2") - buf.write("\u00c9\3\2\2\2\u00d2\u00cd\3\2\2\2\u00d2\u00d1\3\2\2\2") - buf.write("\u00d3\u00de\3\2\2\2\u00d4\u00d5\f\7\2\2\u00d5\u00d6\5") - buf.write("$\23\2\u00d6\u00d7\5,\27\b\u00d7\u00dd\3\2\2\2\u00d8\u00d9") - buf.write("\f\6\2\2\u00d9\u00da\5&\24\2\u00da\u00db\5,\27\7\u00db") - buf.write("\u00dd\3\2\2\2\u00dc\u00d4\3\2\2\2\u00dc\u00d8\3\2\2\2") - buf.write("\u00dd\u00e0\3\2\2\2\u00de\u00dc\3\2\2\2\u00de\u00df\3") - buf.write("\2\2\2\u00df-\3\2\2\2\u00e0\u00de\3\2\2\2\u00e1\u00e2") - buf.write("\7\26\2\2\u00e2\u00ef\7,\2\2\u00e3\u00e4\7\t\2\2\u00e4") - buf.write("\u00ec\7,\2\2\u00e5\u00e9\7\n\2\2\u00e6\u00e8\7,\2\2\u00e7") - buf.write("\u00e6\3\2\2\2\u00e8\u00eb\3\2\2\2\u00e9\u00e7\3\2\2\2") - buf.write("\u00e9\u00ea\3\2\2\2\u00ea\u00ed\3\2\2\2\u00eb\u00e9\3") - buf.write("\2\2\2\u00ec\u00e5\3\2\2\2\u00ec\u00ed\3\2\2\2\u00ed\u00ee") - buf.write("\3\2\2\2\u00ee\u00f0\7\13\2\2\u00ef\u00e3\3\2\2\2\u00ef") - buf.write("\u00f0\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f2\7\27\2") - buf.write("\2\u00f2\u00f3\5\60\31\2\u00f3\u00f4\7\30\2\2\u00f4/\3") - buf.write("\2\2\2\u00f5\u00f7\5\62\32\2\u00f6\u00f5\3\2\2\2\u00f7") - buf.write("\u00fa\3\2\2\2\u00f8\u00f6\3\2\2\2\u00f8\u00f9\3\2\2\2") - buf.write("\u00f9\u00fe\3\2\2\2\u00fa\u00f8\3\2\2\2\u00fb\u00fd\5") - buf.write("B\"\2\u00fc\u00fb\3\2\2\2\u00fd\u0100\3\2\2\2\u00fe\u00fc") - buf.write("\3\2\2\2\u00fe\u00ff\3\2\2\2\u00ff\61\3\2\2\2\u0100\u00fe") - buf.write("\3\2\2\2\u0101\u0104\5 \21\2\u0102\u0104\5\64\33\2\u0103") - buf.write("\u0101\3\2\2\2\u0103\u0102\3\2\2\2\u0104\63\3\2\2\2\u0105") - buf.write("\u0106\5:\36\2\u0106\u0107\7\23\2\2\u0107\u0108\7\31\2") - buf.write("\2\u0108\u0109\7,\2\2\u0109\u010a\7\t\2\2\u010a\u010b") - buf.write("\7\13\2\2\u010b\65\3\2\2\2\u010c\u0113\58\35\2\u010d\u010e") - buf.write("\7\32\2\2\u010e\u0114\7,\2\2\u010f\u0110\7\4\2\2\u0110") - buf.write("\u0111\5,\27\2\u0111\u0112\7\5\2\2\u0112\u0114\3\2\2\2") - buf.write("\u0113\u010d\3\2\2\2\u0113\u010f\3\2\2\2\u0114\u0115\3") - buf.write("\2\2\2\u0115\u0113\3\2\2\2\u0115\u0116\3\2\2\2\u0116\67") - buf.write("\3\2\2\2\u0117\u0118\7,\2\2\u01189\3\2\2\2\u0119\u011c") - buf.write("\7,\2\2\u011a\u011c\5\66\34\2\u011b\u0119\3\2\2\2\u011b") - buf.write("\u011a\3\2\2\2\u011c;\3\2\2\2\u011d\u011e\5> \2\u011e") - buf.write("\u011f\7-\2\2\u011f\u0120\7\t\2\2\u0120\u0121\5F$\2\u0121") - buf.write("\u0122\7\13\2\2\u0122=\3\2\2\2\u0123\u0129\7,\2\2\u0124") - buf.write("\u0125\7\4\2\2\u0125\u0126\5,\27\2\u0126\u0127\7\5\2\2") - buf.write("\u0127\u0129\3\2\2\2\u0128\u0123\3\2\2\2\u0128\u0124\3") - buf.write("\2\2\2\u0129\u012a\3\2\2\2\u012a\u012c\7\32\2\2\u012b") - buf.write("\u0128\3\2\2\2\u012c\u012f\3\2\2\2\u012d\u012b\3\2\2\2") - buf.write("\u012d\u012e\3\2\2\2\u012e?\3\2\2\2\u012f\u012d\3\2\2") - buf.write("\2\u0130\u0133\7,\2\2\u0131\u0133\5\66\34\2\u0132\u0130") - buf.write("\3\2\2\2\u0132\u0131\3\2\2\2\u0133\u0139\3\2\2\2\u0134") - buf.write("\u0137\7\n\2\2\u0135\u0138\7,\2\2\u0136\u0138\5\66\34") - buf.write("\2\u0137\u0135\3\2\2\2\u0137\u0136\3\2\2\2\u0138\u013a") - buf.write("\3\2\2\2\u0139\u0134\3\2\2\2\u013a\u013b\3\2\2\2\u013b") - buf.write("\u0139\3\2\2\2\u013b\u013c\3\2\2\2\u013c\u013d\3\2\2\2") - buf.write("\u013d\u013e\7\23\2\2\u013e\u013f\5<\37\2\u013fA\3\2\2") - buf.write("\2\u0140\u0141\7\33\2\2\u0141\u0142\7-\2\2\u0142\u0143") - buf.write("\7\t\2\2\u0143\u0144\5D#\2\u0144\u0145\7\13\2\2\u0145") - buf.write("\u0146\7\27\2\2\u0146\u0147\5\6\4\2\u0147\u0148\7\30\2") - buf.write("\2\u0148C\3\2\2\2\u0149\u014e\7,\2\2\u014a\u014b\7\n\2") - buf.write("\2\u014b\u014d\7,\2\2\u014c\u014a\3\2\2\2\u014d\u0150") - buf.write("\3\2\2\2\u014e\u014c\3\2\2\2\u014e\u014f\3\2\2\2\u014f") - buf.write("\u0152\3\2\2\2\u0150\u014e\3\2\2\2\u0151\u0149\3\2\2\2") - buf.write("\u0151\u0152\3\2\2\2\u0152E\3\2\2\2\u0153\u0158\5,\27") - buf.write("\2\u0154\u0155\7\n\2\2\u0155\u0157\5,\27\2\u0156\u0154") - buf.write("\3\2\2\2\u0157\u015a\3\2\2\2\u0158\u0156\3\2\2\2\u0158") - buf.write("\u0159\3\2\2\2\u0159\u015c\3\2\2\2\u015a\u0158\3\2\2\2") - buf.write("\u015b\u0153\3\2\2\2\u015b\u015c\3\2\2\2\u015cG\3\2\2") - buf.write("\2\u015d\u015e\b%\1\2\u015e\u015f\7)\2\2\u015f\u016a\5") - buf.write("H%\7\u0160\u0161\5,\27\2\u0161\u0162\5J&\2\u0162\u0163") - buf.write("\5,\27\2\u0163\u016a\3\2\2\2\u0164\u016a\7 \2\2\u0165") - buf.write("\u0166\7\t\2\2\u0166\u0167\5H%\2\u0167\u0168\7\13\2\2") - buf.write("\u0168\u016a\3\2\2\2\u0169\u015d\3\2\2\2\u0169\u0160\3") - buf.write("\2\2\2\u0169\u0164\3\2\2\2\u0169\u0165\3\2\2\2\u016a\u0171") - buf.write("\3\2\2\2\u016b\u016c\f\5\2\2\u016c\u016d\5L\'\2\u016d") - buf.write("\u016e\5H%\6\u016e\u0170\3\2\2\2\u016f\u016b\3\2\2\2\u0170") - buf.write("\u0173\3\2\2\2\u0171\u016f\3\2\2\2\u0171\u0172\3\2\2\2") - buf.write("\u0172I\3\2\2\2\u0173\u0171\3\2\2\2\u0174\u0175\t\6\2") - buf.write("\2\u0175K\3\2\2\2\u0176\u0177\t\7\2\2\u0177M\3\2\2\2\u0178") - buf.write("\u017f\7*\2\2\u0179\u017f\7,\2\2\u017a\u017f\5\36\20\2") - buf.write("\u017b\u017f\5\66\34\2\u017c\u017f\5<\37\2\u017d\u017f") - buf.write("\7+\2\2\u017e\u0178\3\2\2\2\u017e\u0179\3\2\2\2\u017e") - buf.write("\u017a\3\2\2\2\u017e\u017b\3\2\2\2\u017e\u017c\3\2\2\2") - buf.write("\u017e\u017d\3\2\2\2\u017fO\3\2\2\2%UW]aos\u00a1\u00a4") - buf.write("\u00aa\u00c0\u00c3\u00d2\u00dc\u00de\u00e9\u00ec\u00ef") - buf.write("\u00f8\u00fe\u0103\u0113\u0115\u011b\u0128\u012d\u0132") - buf.write("\u0137\u013b\u014e\u0151\u0158\u015b\u0169\u0171\u017e") + buf.write("&\4\'\t\'\4(\t(\4)\t)\3\2\3\2\3\2\3\3\3\3\3\3\7\3Y\n\3") + buf.write("\f\3\16\3\\\13\3\3\4\6\4_\n\4\r\4\16\4`\3\5\3\5\5\5e\n") + buf.write("\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\5\6") + buf.write("s\n\6\3\7\3\7\5\7w\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t") + buf.write("\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3") + buf.write("\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\r") + buf.write("\3\r\3\16\3\16\3\17\3\17\3\20\3\20\3\20\3\20\7\20\u00a3") + buf.write("\n\20\f\20\16\20\u00a6\13\20\5\20\u00a8\n\20\3\20\3\20") + buf.write("\3\21\3\21\5\21\u00ae\n\21\3\21\3\21\3\21\3\22\3\22\3") + buf.write("\22\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\26\3\26") + buf.write("\3\26\3\26\7\26\u00c2\n\26\f\26\16\26\u00c5\13\26\5\26") + buf.write("\u00c7\n\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3") + buf.write("\27\3\27\3\27\3\27\3\27\5\27\u00d6\n\27\3\27\3\27\3\27") + buf.write("\3\27\3\27\3\27\3\27\3\27\7\27\u00e0\n\27\f\27\16\27\u00e3") + buf.write("\13\27\3\30\3\30\3\30\3\30\3\30\3\30\7\30\u00eb\n\30\f") + buf.write("\30\16\30\u00ee\13\30\5\30\u00f0\n\30\3\30\5\30\u00f3") + buf.write("\n\30\3\30\3\30\3\30\3\30\3\31\7\31\u00fa\n\31\f\31\16") + buf.write("\31\u00fd\13\31\3\31\7\31\u0100\n\31\f\31\16\31\u0103") + buf.write("\13\31\3\32\3\32\5\32\u0107\n\32\3\33\3\33\3\33\3\33\3") + buf.write("\33\3\33\3\33\3\34\3\34\3\34\3\34\3\34\3\34\3\34\6\34") + buf.write("\u0117\n\34\r\34\16\34\u0118\3\35\3\35\3\36\3\36\5\36") + buf.write("\u011f\n\36\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 ") + buf.write("\3 \5 \u012c\n \3 \7 \u012f\n \f \16 \u0132\13 \3!\3!") + buf.write("\5!\u0136\n!\3!\3!\3!\5!\u013b\n!\6!\u013d\n!\r!\16!\u013e") + buf.write("\3!\3!\3!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3") + buf.write("#\7#\u0150\n#\f#\16#\u0153\13#\5#\u0155\n#\3$\3$\3$\7") + buf.write("$\u015a\n$\f$\16$\u015d\13$\5$\u015f\n$\3%\3%\3%\3%\3") + buf.write("%\3%\3%\3%\3%\3%\3%\3%\5%\u016d\n%\3%\3%\3%\3%\7%\u0173") + buf.write("\n%\f%\16%\u0176\13%\3&\3&\7&\u017a\n&\f&\16&\u017d\13") + buf.write("&\3&\3&\3\'\3\'\3(\3(\3)\3)\3)\3)\3)\3)\5)\u018b\n)\3") + buf.write(")\2\4,H*\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(") + buf.write("*,.\60\62\64\668:<>@BDFHJLNP\2\b\3\2\f\17\3\2\20\21\3") + buf.write("\2\37 \3\2\35\36\3\2\"\'\3\2()\2\u019b\2R\3\2\2\2\4Z\3") + buf.write("\2\2\2\6^\3\2\2\2\bd\3\2\2\2\nr\3\2\2\2\fv\3\2\2\2\16") + buf.write("x\3\2\2\2\20~\3\2\2\2\22\u0088\3\2\2\2\24\u008e\3\2\2") + buf.write("\2\26\u0095\3\2\2\2\30\u0098\3\2\2\2\32\u009a\3\2\2\2") + buf.write("\34\u009c\3\2\2\2\36\u009e\3\2\2\2 \u00ad\3\2\2\2\"\u00b2") + buf.write("\3\2\2\2$\u00b7\3\2\2\2&\u00b9\3\2\2\2(\u00bb\3\2\2\2") + buf.write("*\u00bd\3\2\2\2,\u00d5\3\2\2\2.\u00e4\3\2\2\2\60\u00fb") + buf.write("\3\2\2\2\62\u0106\3\2\2\2\64\u0108\3\2\2\2\66\u010f\3") + buf.write("\2\2\28\u011a\3\2\2\2:\u011e\3\2\2\2<\u0120\3\2\2\2>\u0130") + buf.write("\3\2\2\2@\u0135\3\2\2\2B\u0143\3\2\2\2D\u0154\3\2\2\2") + buf.write("F\u015e\3\2\2\2H\u016c\3\2\2\2J\u0177\3\2\2\2L\u0180\3") + buf.write("\2\2\2N\u0182\3\2\2\2P\u018a\3\2\2\2RS\5\4\3\2ST\7\2\2") + buf.write("\3T\3\3\2\2\2UY\5\n\6\2VY\5\b\5\2WY\5J&\2XU\3\2\2\2XV") + buf.write("\3\2\2\2XW\3\2\2\2Y\\\3\2\2\2ZX\3\2\2\2Z[\3\2\2\2[\5\3") + buf.write("\2\2\2\\Z\3\2\2\2]_\5\n\6\2^]\3\2\2\2_`\3\2\2\2`^\3\2") + buf.write("\2\2`a\3\2\2\2a\7\3\2\2\2be\5.\30\2ce\5B\"\2db\3\2\2\2") + buf.write("dc\3\2\2\2e\t\3\2\2\2fs\5@!\2gs\5 \21\2hs\5\"\22\2is\5") + buf.write("\f\7\2js\5\22\n\2ks\5\26\f\2ls\5\32\16\2ms\5\24\13\2n") + buf.write("s\5\34\17\2os\5\64\33\2ps\5<\37\2qs\5*\26\2rf\3\2\2\2") + buf.write("rg\3\2\2\2rh\3\2\2\2ri\3\2\2\2rj\3\2\2\2rk\3\2\2\2rl\3") + buf.write("\2\2\2rm\3\2\2\2rn\3\2\2\2ro\3\2\2\2rp\3\2\2\2rq\3\2\2") + buf.write("\2s\13\3\2\2\2tw\5\16\b\2uw\5\20\t\2vt\3\2\2\2vu\3\2\2") + buf.write("\2w\r\3\2\2\2xy\7\3\2\2yz\5H%\2z{\7\4\2\2{|\5\6\4\2|}") + buf.write("\7\5\2\2}\17\3\2\2\2~\177\7\3\2\2\177\u0080\5H%\2\u0080") + buf.write("\u0081\7\4\2\2\u0081\u0082\5\6\4\2\u0082\u0083\7\5\2\2") + buf.write("\u0083\u0084\7\6\2\2\u0084\u0085\7\4\2\2\u0085\u0086\5") + buf.write("\6\4\2\u0086\u0087\7\5\2\2\u0087\21\3\2\2\2\u0088\u0089") + buf.write("\7\7\2\2\u0089\u008a\5P)\2\u008a\u008b\7\4\2\2\u008b\u008c") + buf.write("\5\6\4\2\u008c\u008d\7\5\2\2\u008d\23\3\2\2\2\u008e\u008f") + buf.write("\7\b\2\2\u008f\u0090\7\t\2\2\u0090\u0091\5,\27\2\u0091") + buf.write("\u0092\7\n\2\2\u0092\u0093\5,\27\2\u0093\u0094\7\13\2") + buf.write("\2\u0094\25\3\2\2\2\u0095\u0096\5\30\r\2\u0096\u0097\5") + buf.write(",\27\2\u0097\27\3\2\2\2\u0098\u0099\t\2\2\2\u0099\31\3") + buf.write("\2\2\2\u009a\u009b\t\3\2\2\u009b\33\3\2\2\2\u009c\u009d") + buf.write("\7\22\2\2\u009d\35\3\2\2\2\u009e\u00a7\7\4\2\2\u009f\u00a4") + buf.write("\5,\27\2\u00a0\u00a1\7\n\2\2\u00a1\u00a3\5,\27\2\u00a2") + buf.write("\u00a0\3\2\2\2\u00a3\u00a6\3\2\2\2\u00a4\u00a2\3\2\2\2") + buf.write("\u00a4\u00a5\3\2\2\2\u00a5\u00a8\3\2\2\2\u00a6\u00a4\3") + buf.write("\2\2\2\u00a7\u009f\3\2\2\2\u00a7\u00a8\3\2\2\2\u00a8\u00a9") + buf.write("\3\2\2\2\u00a9\u00aa\7\5\2\2\u00aa\37\3\2\2\2\u00ab\u00ae") + buf.write("\7-\2\2\u00ac\u00ae\5\66\34\2\u00ad\u00ab\3\2\2\2\u00ad") + buf.write("\u00ac\3\2\2\2\u00ae\u00af\3\2\2\2\u00af\u00b0\7\23\2") + buf.write("\2\u00b0\u00b1\5,\27\2\u00b1!\3\2\2\2\u00b2\u00b3\7\24") + buf.write("\2\2\u00b3\u00b4\7\t\2\2\u00b4\u00b5\5,\27\2\u00b5\u00b6") + buf.write("\7\13\2\2\u00b6#\3\2\2\2\u00b7\u00b8\t\4\2\2\u00b8%\3") + buf.write("\2\2\2\u00b9\u00ba\t\5\2\2\u00ba\'\3\2\2\2\u00bb\u00bc") + buf.write("\7\36\2\2\u00bc)\3\2\2\2\u00bd\u00c6\7\25\2\2\u00be\u00c3") + buf.write("\5,\27\2\u00bf\u00c0\7\n\2\2\u00c0\u00c2\5,\27\2\u00c1") + buf.write("\u00bf\3\2\2\2\u00c2\u00c5\3\2\2\2\u00c3\u00c1\3\2\2\2") + buf.write("\u00c3\u00c4\3\2\2\2\u00c4\u00c7\3\2\2\2\u00c5\u00c3\3") + buf.write("\2\2\2\u00c6\u00be\3\2\2\2\u00c6\u00c7\3\2\2\2\u00c7+") + buf.write("\3\2\2\2\u00c8\u00c9\b\27\1\2\u00c9\u00ca\5(\25\2\u00ca") + buf.write("\u00cb\5,\27\b\u00cb\u00d6\3\2\2\2\u00cc\u00cd\5:\36\2") + buf.write("\u00cd\u00ce\7\23\2\2\u00ce\u00cf\5,\27\5\u00cf\u00d6") + buf.write("\3\2\2\2\u00d0\u00d1\7\t\2\2\u00d1\u00d2\5,\27\2\u00d2") + buf.write("\u00d3\7\13\2\2\u00d3\u00d6\3\2\2\2\u00d4\u00d6\5P)\2") + buf.write("\u00d5\u00c8\3\2\2\2\u00d5\u00cc\3\2\2\2\u00d5\u00d0\3") + buf.write("\2\2\2\u00d5\u00d4\3\2\2\2\u00d6\u00e1\3\2\2\2\u00d7\u00d8") + buf.write("\f\7\2\2\u00d8\u00d9\5$\23\2\u00d9\u00da\5,\27\b\u00da") + buf.write("\u00e0\3\2\2\2\u00db\u00dc\f\6\2\2\u00dc\u00dd\5&\24\2") + buf.write("\u00dd\u00de\5,\27\7\u00de\u00e0\3\2\2\2\u00df\u00d7\3") + buf.write("\2\2\2\u00df\u00db\3\2\2\2\u00e0\u00e3\3\2\2\2\u00e1\u00df") + buf.write("\3\2\2\2\u00e1\u00e2\3\2\2\2\u00e2-\3\2\2\2\u00e3\u00e1") + buf.write("\3\2\2\2\u00e4\u00e5\7\26\2\2\u00e5\u00f2\7-\2\2\u00e6") + buf.write("\u00e7\7\t\2\2\u00e7\u00ef\7-\2\2\u00e8\u00ec\7\n\2\2") + buf.write("\u00e9\u00eb\7-\2\2\u00ea\u00e9\3\2\2\2\u00eb\u00ee\3") + buf.write("\2\2\2\u00ec\u00ea\3\2\2\2\u00ec\u00ed\3\2\2\2\u00ed\u00f0") + buf.write("\3\2\2\2\u00ee\u00ec\3\2\2\2\u00ef\u00e8\3\2\2\2\u00ef") + buf.write("\u00f0\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f3\7\13\2") + buf.write("\2\u00f2\u00e6\3\2\2\2\u00f2\u00f3\3\2\2\2\u00f3\u00f4") + buf.write("\3\2\2\2\u00f4\u00f5\7\27\2\2\u00f5\u00f6\5\60\31\2\u00f6") + buf.write("\u00f7\7\30\2\2\u00f7/\3\2\2\2\u00f8\u00fa\5\62\32\2\u00f9") + buf.write("\u00f8\3\2\2\2\u00fa\u00fd\3\2\2\2\u00fb\u00f9\3\2\2\2") + buf.write("\u00fb\u00fc\3\2\2\2\u00fc\u0101\3\2\2\2\u00fd\u00fb\3") + buf.write("\2\2\2\u00fe\u0100\5B\"\2\u00ff\u00fe\3\2\2\2\u0100\u0103") + buf.write("\3\2\2\2\u0101\u00ff\3\2\2\2\u0101\u0102\3\2\2\2\u0102") + buf.write("\61\3\2\2\2\u0103\u0101\3\2\2\2\u0104\u0107\5 \21\2\u0105") + buf.write("\u0107\5\64\33\2\u0106\u0104\3\2\2\2\u0106\u0105\3\2\2") + buf.write("\2\u0107\63\3\2\2\2\u0108\u0109\5:\36\2\u0109\u010a\7") + buf.write("\23\2\2\u010a\u010b\7\31\2\2\u010b\u010c\7-\2\2\u010c") + buf.write("\u010d\7\t\2\2\u010d\u010e\7\13\2\2\u010e\65\3\2\2\2\u010f") + buf.write("\u0116\58\35\2\u0110\u0111\7\32\2\2\u0111\u0117\7-\2\2") + buf.write("\u0112\u0113\7\4\2\2\u0113\u0114\5,\27\2\u0114\u0115\7") + buf.write("\5\2\2\u0115\u0117\3\2\2\2\u0116\u0110\3\2\2\2\u0116\u0112") + buf.write("\3\2\2\2\u0117\u0118\3\2\2\2\u0118\u0116\3\2\2\2\u0118") + buf.write("\u0119\3\2\2\2\u0119\67\3\2\2\2\u011a\u011b\7-\2\2\u011b") + buf.write("9\3\2\2\2\u011c\u011f\7-\2\2\u011d\u011f\5\66\34\2\u011e") + buf.write("\u011c\3\2\2\2\u011e\u011d\3\2\2\2\u011f;\3\2\2\2\u0120") + buf.write("\u0121\5> \2\u0121\u0122\7.\2\2\u0122\u0123\7\t\2\2\u0123") + buf.write("\u0124\5F$\2\u0124\u0125\7\13\2\2\u0125=\3\2\2\2\u0126") + buf.write("\u012c\7-\2\2\u0127\u0128\7\4\2\2\u0128\u0129\5,\27\2") + buf.write("\u0129\u012a\7\5\2\2\u012a\u012c\3\2\2\2\u012b\u0126\3") + buf.write("\2\2\2\u012b\u0127\3\2\2\2\u012c\u012d\3\2\2\2\u012d\u012f") + buf.write("\7\32\2\2\u012e\u012b\3\2\2\2\u012f\u0132\3\2\2\2\u0130") + buf.write("\u012e\3\2\2\2\u0130\u0131\3\2\2\2\u0131?\3\2\2\2\u0132") + buf.write("\u0130\3\2\2\2\u0133\u0136\7-\2\2\u0134\u0136\5\66\34") + buf.write("\2\u0135\u0133\3\2\2\2\u0135\u0134\3\2\2\2\u0136\u013c") + buf.write("\3\2\2\2\u0137\u013a\7\n\2\2\u0138\u013b\7-\2\2\u0139") + buf.write("\u013b\5\66\34\2\u013a\u0138\3\2\2\2\u013a\u0139\3\2\2") + buf.write("\2\u013b\u013d\3\2\2\2\u013c\u0137\3\2\2\2\u013d\u013e") + buf.write("\3\2\2\2\u013e\u013c\3\2\2\2\u013e\u013f\3\2\2\2\u013f") + buf.write("\u0140\3\2\2\2\u0140\u0141\7\23\2\2\u0141\u0142\5<\37") + buf.write("\2\u0142A\3\2\2\2\u0143\u0144\7\33\2\2\u0144\u0145\7.") + buf.write("\2\2\u0145\u0146\7\t\2\2\u0146\u0147\5D#\2\u0147\u0148") + buf.write("\7\13\2\2\u0148\u0149\7\27\2\2\u0149\u014a\5\6\4\2\u014a") + buf.write("\u014b\7\30\2\2\u014bC\3\2\2\2\u014c\u0151\7-\2\2\u014d") + buf.write("\u014e\7\n\2\2\u014e\u0150\7-\2\2\u014f\u014d\3\2\2\2") + buf.write("\u0150\u0153\3\2\2\2\u0151\u014f\3\2\2\2\u0151\u0152\3") + buf.write("\2\2\2\u0152\u0155\3\2\2\2\u0153\u0151\3\2\2\2\u0154\u014c") + buf.write("\3\2\2\2\u0154\u0155\3\2\2\2\u0155E\3\2\2\2\u0156\u015b") + buf.write("\5,\27\2\u0157\u0158\7\n\2\2\u0158\u015a\5,\27\2\u0159") + buf.write("\u0157\3\2\2\2\u015a\u015d\3\2\2\2\u015b\u0159\3\2\2\2") + buf.write("\u015b\u015c\3\2\2\2\u015c\u015f\3\2\2\2\u015d\u015b\3") + buf.write("\2\2\2\u015e\u0156\3\2\2\2\u015e\u015f\3\2\2\2\u015fG") + buf.write("\3\2\2\2\u0160\u0161\b%\1\2\u0161\u0162\7*\2\2\u0162\u016d") + buf.write("\5H%\7\u0163\u0164\5,\27\2\u0164\u0165\5L\'\2\u0165\u0166") + buf.write("\5,\27\2\u0166\u016d\3\2\2\2\u0167\u016d\7!\2\2\u0168") + buf.write("\u0169\7\t\2\2\u0169\u016a\5H%\2\u016a\u016b\7\13\2\2") + buf.write("\u016b\u016d\3\2\2\2\u016c\u0160\3\2\2\2\u016c\u0163\3") + buf.write("\2\2\2\u016c\u0167\3\2\2\2\u016c\u0168\3\2\2\2\u016d\u0174") + buf.write("\3\2\2\2\u016e\u016f\f\5\2\2\u016f\u0170\5N(\2\u0170\u0171") + buf.write("\5H%\6\u0171\u0173\3\2\2\2\u0172\u016e\3\2\2\2\u0173\u0176") + buf.write("\3\2\2\2\u0174\u0172\3\2\2\2\u0174\u0175\3\2\2\2\u0175") + buf.write("I\3\2\2\2\u0176\u0174\3\2\2\2\u0177\u017b\7\34\2\2\u0178") + buf.write("\u017a\7.\2\2\u0179\u0178\3\2\2\2\u017a\u017d\3\2\2\2") + buf.write("\u017b\u0179\3\2\2\2\u017b\u017c\3\2\2\2\u017c\u017e\3") + buf.write("\2\2\2\u017d\u017b\3\2\2\2\u017e\u017f\7\34\2\2\u017f") + buf.write("K\3\2\2\2\u0180\u0181\t\6\2\2\u0181M\3\2\2\2\u0182\u0183") + buf.write("\t\7\2\2\u0183O\3\2\2\2\u0184\u018b\7+\2\2\u0185\u018b") + buf.write("\7-\2\2\u0186\u018b\5\36\20\2\u0187\u018b\5\66\34\2\u0188") + buf.write("\u018b\5<\37\2\u0189\u018b\7,\2\2\u018a\u0184\3\2\2\2") + buf.write("\u018a\u0185\3\2\2\2\u018a\u0186\3\2\2\2\u018a\u0187\3") + buf.write("\2\2\2\u018a\u0188\3\2\2\2\u018a\u0189\3\2\2\2\u018bQ") + buf.write("\3\2\2\2&XZ`drv\u00a4\u00a7\u00ad\u00c3\u00c6\u00d5\u00df") + buf.write("\u00e1\u00ec\u00ef\u00f2\u00fb\u0101\u0106\u0116\u0118") + buf.write("\u011e\u012b\u0130\u0135\u013a\u013e\u0151\u0154\u015b") + buf.write("\u015e\u016c\u0174\u017b\u018a") return buf.getvalue() @@ -195,9 +201,9 @@ class tlangParser ( Parser ): "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'return'", "'class'", "'{'", "'}'", - "'new'", "'.'", "'def'", "'+'", "'-'", "'*'", "'/'", - "'pendown?'", "'<'", "'>'", "'=='", "'!='", "'<='", - "'>='", "'&&'", "'||'", "'!'" ] + "'new'", "'.'", "'def'", "'#'", "'+'", "'-'", "'*'", + "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", + "'<='", "'>='", "'&&'", "'||'", "'!'" ] symbolicNames = [ "", "", "", "", "", "", "", "", @@ -205,10 +211,10 @@ class tlangParser ( Parser ): "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "PLUS", "MINUS", "MUL", - "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", - "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", "NAME", - "Whitespace" ] + "", "", "", "PLUS", "MINUS", + "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", + "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", + "NAME", "Whitespace" ] RULE_start = 0 RULE_instruction_list = 1 @@ -246,9 +252,10 @@ class tlangParser ( Parser ): RULE_parameters = 33 RULE_arguments = 34 RULE_condition = 35 - RULE_binCondOp = 36 - RULE_logicOp = 37 - RULE_value = 38 + RULE_comment = 36 + RULE_binCondOp = 37 + RULE_logicOp = 38 + RULE_value = 39 ruleNames = [ "start", "instruction_list", "strict_ilist", "declaration", "instruction", "conditional", "ifConditional", "ifElseConditional", @@ -259,7 +266,7 @@ class tlangParser ( Parser ): "objectInstantiation", "objectOrArrayAccess", "baseAccess", "lvalue", "functionCall", "methodCaller", "functionCallWithReturnValues", "functionDeclaration", "parameters", "arguments", "condition", - "binCondOp", "logicOp", "value" ] + "comment", "binCondOp", "logicOp", "value" ] EOF = Token.EOF T__0=1 @@ -287,25 +294,26 @@ class tlangParser ( Parser ): T__22=23 T__23=24 T__24=25 - PLUS=26 - MINUS=27 - MUL=28 - DIV=29 - PENCOND=30 - LT=31 - GT=32 - EQ=33 - NEQ=34 - LTE=35 - GTE=36 - AND=37 - OR=38 - NOT=39 - NUM=40 - REAL=41 - VAR=42 - NAME=43 - Whitespace=44 + T__25=26 + PLUS=27 + MINUS=28 + MUL=29 + DIV=30 + PENCOND=31 + LT=32 + GT=33 + EQ=34 + NEQ=35 + LTE=36 + GTE=37 + AND=38 + OR=39 + NOT=40 + NUM=41 + REAL=42 + VAR=43 + NAME=44 + Whitespace=45 def __init__(self, input:TokenStream, output:TextIO = sys.stdout): super().__init__(input, output) @@ -347,9 +355,9 @@ def start(self): self.enterRule(localctx, 0, self.RULE_start) try: self.enterOuterAlt(localctx, 1) - self.state = 78 + self.state = 80 self.instruction_list() - self.state = 79 + self.state = 81 self.match(tlangParser.EOF) except RecognitionException as re: localctx.exception = re @@ -380,6 +388,13 @@ def declaration(self, i:int=None): return self.getTypedRuleContext(tlangParser.DeclarationContext,i) + def comment(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.CommentContext) + else: + return self.getTypedRuleContext(tlangParser.CommentContext,i) + + def getRuleIndex(self): return tlangParser.RULE_instruction_list @@ -399,25 +414,29 @@ def instruction_list(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 85 + self.state = 88 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 83 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.T__25) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): + self.state = 86 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__0, tlangParser.T__1, tlangParser.T__4, tlangParser.T__5, tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12, tlangParser.T__13, tlangParser.T__14, tlangParser.T__15, tlangParser.T__17, tlangParser.T__18, tlangParser.VAR, tlangParser.NAME]: - self.state = 81 + self.state = 83 self.instruction() pass elif token in [tlangParser.T__19, tlangParser.T__24]: - self.state = 82 + self.state = 84 self.declaration() pass + elif token in [tlangParser.T__25]: + self.state = 85 + self.comment() + pass else: raise NoViableAltException(self) - self.state = 87 + self.state = 90 self._errHandler.sync(self) _la = self._input.LA(1) @@ -462,13 +481,13 @@ def strict_ilist(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 89 + self.state = 92 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 88 + self.state = 91 self.instruction() - self.state = 91 + self.state = 94 self._errHandler.sync(self) _la = self._input.LA(1) if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): @@ -514,17 +533,17 @@ def declaration(self): localctx = tlangParser.DeclarationContext(self, self._ctx, self.state) self.enterRule(localctx, 6, self.RULE_declaration) try: - self.state = 95 + self.state = 98 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__19]: self.enterOuterAlt(localctx, 1) - self.state = 93 + self.state = 96 self.classDeclaration() pass elif token in [tlangParser.T__24]: self.enterOuterAlt(localctx, 2) - self.state = 94 + self.state = 97 self.functionDeclaration() pass else: @@ -610,78 +629,78 @@ def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) self.enterRule(localctx, 8, self.RULE_instruction) try: - self.state = 109 + self.state = 112 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,4,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 97 + self.state = 100 self.functionCallWithReturnValues() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 98 + self.state = 101 self.assignment() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 99 + self.state = 102 self.printStatement() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 100 + self.state = 103 self.conditional() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 101 + self.state = 104 self.loop() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 102 + self.state = 105 self.moveCommand() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 103 + self.state = 106 self.penCommand() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 104 + self.state = 107 self.gotoCommand() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 105 + self.state = 108 self.pauseCommand() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 106 + self.state = 109 self.objectInstantiation() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 107 + self.state = 110 self.functionCall() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 108 + self.state = 111 self.returnStatement() pass @@ -726,18 +745,18 @@ def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) self.enterRule(localctx, 10, self.RULE_conditional) try: - self.state = 113 + self.state = 116 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,5,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 111 + self.state = 114 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 112 + self.state = 115 self.ifElseConditional() pass @@ -783,15 +802,15 @@ def ifConditional(self): self.enterRule(localctx, 12, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 115 + self.state = 118 self.match(tlangParser.T__0) - self.state = 116 + self.state = 119 self.condition(0) - self.state = 117 + self.state = 120 self.match(tlangParser.T__1) - self.state = 118 + self.state = 121 self.strict_ilist() - self.state = 119 + self.state = 122 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -837,23 +856,23 @@ def ifElseConditional(self): self.enterRule(localctx, 14, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 121 + self.state = 124 self.match(tlangParser.T__0) - self.state = 122 + self.state = 125 self.condition(0) - self.state = 123 + self.state = 126 self.match(tlangParser.T__1) - self.state = 124 + self.state = 127 self.strict_ilist() - self.state = 125 + self.state = 128 self.match(tlangParser.T__2) - self.state = 126 + self.state = 129 self.match(tlangParser.T__3) - self.state = 127 + self.state = 130 self.match(tlangParser.T__1) - self.state = 128 + self.state = 131 self.strict_ilist() - self.state = 129 + self.state = 132 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -896,15 +915,15 @@ def loop(self): self.enterRule(localctx, 16, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 131 + self.state = 134 self.match(tlangParser.T__4) - self.state = 132 + self.state = 135 self.value() - self.state = 133 + self.state = 136 self.match(tlangParser.T__1) - self.state = 134 + self.state = 137 self.strict_ilist() - self.state = 135 + self.state = 138 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -946,17 +965,17 @@ def gotoCommand(self): self.enterRule(localctx, 18, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 137 + self.state = 140 self.match(tlangParser.T__5) - self.state = 138 + self.state = 141 self.match(tlangParser.T__6) - self.state = 139 + self.state = 142 self.expression(0) - self.state = 140 + self.state = 143 self.match(tlangParser.T__7) - self.state = 141 + self.state = 144 self.expression(0) - self.state = 142 + self.state = 145 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -999,9 +1018,9 @@ def moveCommand(self): self.enterRule(localctx, 20, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 144 + self.state = 147 self.moveOp() - self.state = 145 + self.state = 148 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1038,7 +1057,7 @@ def moveOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 147 + self.state = 150 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -1080,7 +1099,7 @@ def penCommand(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 149 + self.state = 152 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -1121,7 +1140,7 @@ def pauseCommand(self): self.enterRule(localctx, 26, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 151 + self.state = 154 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -1164,29 +1183,29 @@ def array(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 153 + self.state = 156 self.match(tlangParser.T__1) - self.state = 162 + self.state = 165 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 154 + self.state = 157 self.expression(0) - self.state = 159 + self.state = 162 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 155 + self.state = 158 self.match(tlangParser.T__7) - self.state = 156 + self.state = 159 self.expression(0) - self.state = 161 + self.state = 164 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 164 + self.state = 167 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -1232,23 +1251,23 @@ def assignment(self): self.enterRule(localctx, 30, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 168 + self.state = 171 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,8,self._ctx) if la_ == 1: - self.state = 166 + self.state = 169 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 167 + self.state = 170 self.objectOrArrayAccess() pass - self.state = 170 + self.state = 173 self.match(tlangParser.T__16) - self.state = 171 + self.state = 174 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1287,13 +1306,13 @@ def printStatement(self): self.enterRule(localctx, 32, self.RULE_printStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 173 + self.state = 176 self.match(tlangParser.T__17) - self.state = 174 + self.state = 177 self.match(tlangParser.T__6) - self.state = 175 + self.state = 178 self.expression(0) - self.state = 176 + self.state = 179 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1335,7 +1354,7 @@ def multiplicative(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 178 + self.state = 181 _la = self._input.LA(1) if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) @@ -1382,7 +1401,7 @@ def additive(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 180 + self.state = 183 _la = self._input.LA(1) if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) @@ -1425,7 +1444,7 @@ def unaryArithOp(self): self.enterRule(localctx, 38, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 182 + self.state = 185 self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re @@ -1468,23 +1487,23 @@ def returnStatement(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 184 + self.state = 187 self.match(tlangParser.T__18) - self.state = 193 + self.state = 196 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,10,self._ctx) if la_ == 1: - self.state = 185 + self.state = 188 self.expression(0) - self.state = 190 + self.state = 193 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 186 + self.state = 189 self.match(tlangParser.T__7) - self.state = 187 + self.state = 190 self.expression(0) - self.state = 192 + self.state = 195 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1644,7 +1663,7 @@ def expression(self, _p:int=0): self.enterRecursionRule(localctx, 42, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 208 + self.state = 211 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,11,self._ctx) if la_ == 1: @@ -1652,9 +1671,9 @@ def expression(self, _p:int=0): self._ctx = localctx _prevctx = localctx - self.state = 196 + self.state = 199 self.unaryArithOp() - self.state = 197 + self.state = 200 self.expression(6) pass @@ -1662,11 +1681,11 @@ def expression(self, _p:int=0): localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 199 + self.state = 202 self.lvalue() - self.state = 200 + self.state = 203 self.match(tlangParser.T__16) - self.state = 201 + self.state = 204 self.expression(3) pass @@ -1674,11 +1693,11 @@ def expression(self, _p:int=0): localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 203 + self.state = 206 self.match(tlangParser.T__6) - self.state = 204 + self.state = 207 self.expression(0) - self.state = 205 + self.state = 208 self.match(tlangParser.T__8) pass @@ -1686,13 +1705,13 @@ def expression(self, _p:int=0): localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 207 + self.state = 210 self.value() pass self._ctx.stop = self._input.LT(-1) - self.state = 220 + self.state = 223 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,13,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -1700,37 +1719,37 @@ def expression(self, _p:int=0): if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 218 + self.state = 221 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,12,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 210 + self.state = 213 if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 211 + self.state = 214 self.multiplicative() - self.state = 212 + self.state = 215 self.expression(6) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 214 + self.state = 217 if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") - self.state = 215 + self.state = 218 self.additive() - self.state = 216 + self.state = 219 self.expression(5) pass - self.state = 222 + self.state = 225 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,13,self._ctx) @@ -1778,45 +1797,45 @@ def classDeclaration(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 223 + self.state = 226 self.match(tlangParser.T__19) - self.state = 224 + self.state = 227 self.match(tlangParser.VAR) - self.state = 237 + self.state = 240 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.T__6: - self.state = 225 + self.state = 228 self.match(tlangParser.T__6) - self.state = 226 + self.state = 229 self.match(tlangParser.VAR) - self.state = 234 + self.state = 237 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.T__7: - self.state = 227 + self.state = 230 self.match(tlangParser.T__7) - self.state = 231 + self.state = 234 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 228 + self.state = 231 self.match(tlangParser.VAR) - self.state = 233 + self.state = 236 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 236 + self.state = 239 self.match(tlangParser.T__8) - self.state = 239 + self.state = 242 self.match(tlangParser.T__20) - self.state = 240 + self.state = 243 self.classBody() - self.state = 241 + self.state = 244 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -1866,23 +1885,23 @@ def classBody(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 246 + self.state = 249 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 243 + self.state = 246 self.classAttributeDeclaration() - self.state = 248 + self.state = 251 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 252 + self.state = 255 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__24: - self.state = 249 + self.state = 252 self.functionDeclaration() - self.state = 254 + self.state = 257 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1926,18 +1945,18 @@ def classAttributeDeclaration(self): localctx = tlangParser.ClassAttributeDeclarationContext(self, self._ctx, self.state) self.enterRule(localctx, 48, self.RULE_classAttributeDeclaration) try: - self.state = 257 + self.state = 260 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,19,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 255 + self.state = 258 self.assignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 256 + self.state = 259 self.objectInstantiation() pass @@ -1982,17 +2001,17 @@ def objectInstantiation(self): self.enterRule(localctx, 50, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 259 + self.state = 262 self.lvalue() - self.state = 260 + self.state = 263 self.match(tlangParser.T__16) - self.state = 261 + self.state = 264 self.match(tlangParser.T__22) - self.state = 262 + self.state = 265 self.match(tlangParser.VAR) - self.state = 263 + self.state = 266 self.match(tlangParser.T__6) - self.state = 264 + self.state = 267 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2044,28 +2063,28 @@ def objectOrArrayAccess(self): self.enterRule(localctx, 52, self.RULE_objectOrArrayAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 266 + self.state = 269 self.baseAccess() - self.state = 273 + self.state = 276 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 273 + self.state = 276 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__23]: - self.state = 267 + self.state = 270 self.match(tlangParser.T__23) - self.state = 268 + self.state = 271 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 269 + self.state = 272 self.match(tlangParser.T__1) - self.state = 270 + self.state = 273 self.expression(0) - self.state = 271 + self.state = 274 self.match(tlangParser.T__2) pass else: @@ -2074,7 +2093,7 @@ def objectOrArrayAccess(self): else: raise NoViableAltException(self) - self.state = 275 + self.state = 278 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,21,self._ctx) @@ -2114,7 +2133,7 @@ def baseAccess(self): self.enterRule(localctx, 54, self.RULE_baseAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 277 + self.state = 280 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -2155,18 +2174,18 @@ def lvalue(self): localctx = tlangParser.LvalueContext(self, self._ctx, self.state) self.enterRule(localctx, 56, self.RULE_lvalue) try: - self.state = 281 + self.state = 284 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,22,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 279 + self.state = 282 self.match(tlangParser.VAR) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 280 + self.state = 283 self.objectOrArrayAccess() pass @@ -2215,15 +2234,15 @@ def functionCall(self): self.enterRule(localctx, 58, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 283 + self.state = 286 self.methodCaller() - self.state = 284 + self.state = 287 self.match(tlangParser.NAME) - self.state = 285 + self.state = 288 self.match(tlangParser.T__6) - self.state = 286 + self.state = 289 self.arguments() - self.state = 287 + self.state = 290 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2272,31 +2291,31 @@ def methodCaller(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 299 + self.state = 302 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__1 or _la==tlangParser.VAR: - self.state = 294 + self.state = 297 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.VAR]: - self.state = 289 + self.state = 292 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 290 + self.state = 293 self.match(tlangParser.T__1) - self.state = 291 + self.state = 294 self.expression(0) - self.state = 292 + self.state = 295 self.match(tlangParser.T__2) pass else: raise NoViableAltException(self) - self.state = 296 + self.state = 299 self.match(tlangParser.T__23) - self.state = 301 + self.state = 304 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2351,49 +2370,49 @@ def functionCallWithReturnValues(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 304 + self.state = 307 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,25,self._ctx) if la_ == 1: - self.state = 302 + self.state = 305 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 303 + self.state = 306 self.objectOrArrayAccess() pass - self.state = 311 + self.state = 314 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 306 - self.match(tlangParser.T__7) self.state = 309 + self.match(tlangParser.T__7) + self.state = 312 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,26,self._ctx) if la_ == 1: - self.state = 307 + self.state = 310 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 308 + self.state = 311 self.objectOrArrayAccess() pass - self.state = 313 + self.state = 316 self._errHandler.sync(self) _la = self._input.LA(1) if not (_la==tlangParser.T__7): break - self.state = 315 + self.state = 318 self.match(tlangParser.T__16) - self.state = 316 + self.state = 319 self.functionCall() except RecognitionException as re: localctx.exception = re @@ -2439,21 +2458,21 @@ def functionDeclaration(self): self.enterRule(localctx, 64, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 318 + self.state = 321 self.match(tlangParser.T__24) - self.state = 319 + self.state = 322 self.match(tlangParser.NAME) - self.state = 320 + self.state = 323 self.match(tlangParser.T__6) - self.state = 321 + self.state = 324 self.parameters() - self.state = 322 + self.state = 325 self.match(tlangParser.T__8) - self.state = 323 + self.state = 326 self.match(tlangParser.T__20) - self.state = 324 + self.state = 327 self.strict_ilist() - self.state = 325 + self.state = 328 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -2495,21 +2514,21 @@ def parameters(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 335 + self.state = 338 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.VAR: - self.state = 327 + self.state = 330 self.match(tlangParser.VAR) - self.state = 332 + self.state = 335 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 328 + self.state = 331 self.match(tlangParser.T__7) - self.state = 329 + self.state = 332 self.match(tlangParser.VAR) - self.state = 334 + self.state = 337 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2556,21 +2575,21 @@ def arguments(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 345 + self.state = 348 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 337 + self.state = 340 self.expression(0) - self.state = 342 + self.state = 345 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 338 + self.state = 341 self.match(tlangParser.T__7) - self.state = 339 + self.state = 342 self.expression(0) - self.state = 344 + self.state = 347 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2639,42 +2658,42 @@ def condition(self, _p:int=0): self.enterRecursionRule(localctx, 70, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 359 + self.state = 362 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,32,self._ctx) if la_ == 1: - self.state = 348 + self.state = 351 self.match(tlangParser.NOT) - self.state = 349 + self.state = 352 self.condition(5) pass elif la_ == 2: - self.state = 350 + self.state = 353 self.expression(0) - self.state = 351 + self.state = 354 self.binCondOp() - self.state = 352 + self.state = 355 self.expression(0) pass elif la_ == 3: - self.state = 354 + self.state = 357 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 355 + self.state = 358 self.match(tlangParser.T__6) - self.state = 356 + self.state = 359 self.condition(0) - self.state = 357 + self.state = 360 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 367 + self.state = 370 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,33,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -2684,15 +2703,15 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 361 + self.state = 364 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 362 + self.state = 365 self.logicOp() - self.state = 363 + self.state = 366 self.condition(4) - self.state = 369 + self.state = 372 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,33,self._ctx) @@ -2705,6 +2724,60 @@ def condition(self, _p:int=0): return localctx + class CommentContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def NAME(self, i:int=None): + if i is None: + return self.getTokens(tlangParser.NAME) + else: + return self.getToken(tlangParser.NAME, i) + + def getRuleIndex(self): + return tlangParser.RULE_comment + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitComment" ): + return visitor.visitComment(self) + else: + return visitor.visitChildren(self) + + + + + def comment(self): + + localctx = tlangParser.CommentContext(self, self._ctx, self.state) + self.enterRule(localctx, 72, self.RULE_comment) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 373 + self.match(tlangParser.T__25) + self.state = 377 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==tlangParser.NAME: + self.state = 374 + self.match(tlangParser.NAME) + self.state = 379 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 380 + self.match(tlangParser.T__25) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class BinCondOpContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -2744,11 +2817,11 @@ def accept(self, visitor:ParseTreeVisitor): def binCondOp(self): localctx = tlangParser.BinCondOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 72, self.RULE_binCondOp) + self.enterRule(localctx, 74, self.RULE_binCondOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 370 + self.state = 382 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2791,11 +2864,11 @@ def accept(self, visitor:ParseTreeVisitor): def logicOp(self): localctx = tlangParser.LogicOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 74, self.RULE_logicOp) + self.enterRule(localctx, 76, self.RULE_logicOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 372 + self.state = 384 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2853,44 +2926,44 @@ def accept(self, visitor:ParseTreeVisitor): def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) - self.enterRule(localctx, 76, self.RULE_value) + self.enterRule(localctx, 78, self.RULE_value) try: - self.state = 380 + self.state = 392 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,34,self._ctx) + la_ = self._interp.adaptivePredict(self._input,35,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 374 + self.state = 386 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 375 + self.state = 387 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 376 + self.state = 388 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 377 + self.state = 389 self.objectOrArrayAccess() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 378 + self.state = 390 self.functionCall() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 379 + self.state = 391 self.match(tlangParser.REAL) pass diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index aa36a0b..59126c6 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -214,6 +214,11 @@ def visitCondition(self, ctx:tlangParser.ConditionContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#comment. + def visitComment(self, ctx:tlangParser.CommentContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#binCondOp. def visitBinCondOp(self, ctx:tlangParser.BinCondOpContext): return self.visitChildren(ctx) From a35157f6a41f43f9dda2fc836ebc91c4c721c276 Mon Sep 17 00:00:00 2001 From: Yash Pratap Singh Date: Mon, 7 Apr 2025 13:32:00 +0530 Subject: [PATCH 28/47] feature: add test script --- ChironCore/test.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 ChironCore/test.sh diff --git a/ChironCore/test.sh b/ChironCore/test.sh new file mode 100755 index 0000000..8a4625c --- /dev/null +++ b/ChironCore/test.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Step 1: Generate ANTLR files +cd turtparse || exit +java -cp ../extlib/antlr-4.7.2-complete.jar org.antlr.v4.Tool \ + -Dlanguage=Python3 -visitor -no-listener tlang.g4 +cd .. + +# Step 2: Loop through arguments +for path in "$@"; do + if [[ -d "$path" ]]; then + # Argument is a directory: loop over files inside + for file in "$path"/*; do + if [[ -f "$file" ]]; then + echo "Running: $file" + python3 ./chiron.py -r "$file" + pid=$! + + wait "$pid" + fi + done + elif [[ -f "$path" ]]; then + # Argument is a file: run directly + echo "Running: $path" + python3 ./chiron.py -r "$path" + pid=$! + + wait "$pid" + else + echo "Warning: '$path' is not a valid file or directory" + fi +done + From cf30f03c41b1a5e890d7854985e96d9e86067f6d Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Mon, 7 Apr 2025 17:29:49 +0530 Subject: [PATCH 29/47] fixed duplicate addition of intermediate instructions --- ChironCore/ChironAST/builder.py | 8 +- ChironCore/example/issues.txt | 1 + ChironCore/example/test.tl | 2 +- ChironCore/turtparse/tlang.interp | 2 +- ChironCore/turtparse/tlangParser.py | 822 ++++++++++++++-------------- 5 files changed, 430 insertions(+), 405 deletions(-) diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 344322f..1ca5903 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -38,13 +38,17 @@ def visitInstruction_list(self, ctx: tlangParser.Instruction_listContext): instrList = [] for declr in ctx.declaration(): - self.stmtList.extend(self.subStmtList + self.visit(declr)) + instrList = self.visit(declr) + self.stmtList.extend(self.subStmtList + instrList) self.subStmtList = [] + instrList = [] self.virtualRegCount = 0 for instr in ctx.instruction(): - self.stmtList.extend(self.subStmtList + self.visit(instr)) + instrList = self.visit(instr) + self.stmtList.extend(self.subStmtList + instrList) self.subStmtList = [] + instrList = [] self.virtualRegCount = 0 return [] diff --git a/ChironCore/example/issues.txt b/ChironCore/example/issues.txt index 7b665fe..7248de6 100644 --- a/ChironCore/example/issues.txt +++ b/ChironCore/example/issues.txt @@ -15,6 +15,7 @@ 15. :self can only come in the first position in the object access of method call chain 16. commenting now supported [fixed] 17. first all the declaration will be processed and then the instructions! +18. Strictly enforce the keywords like return and def to not be used as function of class names diff --git a/ChironCore/example/test.tl b/ChironCore/example/test.tl index 1a0b1da..807478f 100644 --- a/ChironCore/example/test.tl +++ b/ChironCore/example/test.tl @@ -5,6 +5,6 @@ def add(:a, :b) } def increment(:a) { - return add(:a, 1) + return (add(:a, 1)) } print(increment(4)) diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index 2fe52e4..af394d0 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -138,4 +138,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 397, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 7, 3, 89, 10, 3, 12, 3, 14, 3, 92, 11, 3, 3, 4, 6, 4, 95, 10, 4, 13, 4, 14, 4, 96, 3, 5, 3, 5, 5, 5, 101, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 115, 10, 6, 3, 7, 3, 7, 5, 7, 119, 10, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 7, 16, 163, 10, 16, 12, 16, 14, 16, 166, 11, 16, 5, 16, 168, 10, 16, 3, 16, 3, 16, 3, 17, 3, 17, 5, 17, 174, 10, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 194, 10, 22, 12, 22, 14, 22, 197, 11, 22, 5, 22, 199, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 214, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 224, 10, 23, 12, 23, 14, 23, 227, 11, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 235, 10, 24, 12, 24, 14, 24, 238, 11, 24, 5, 24, 240, 10, 24, 3, 24, 5, 24, 243, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 7, 25, 250, 10, 25, 12, 25, 14, 25, 253, 11, 25, 3, 25, 7, 25, 256, 10, 25, 12, 25, 14, 25, 259, 11, 25, 3, 26, 3, 26, 5, 26, 263, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 6, 28, 279, 10, 28, 13, 28, 14, 28, 280, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 287, 10, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 300, 10, 32, 3, 32, 7, 32, 303, 10, 32, 12, 32, 14, 32, 306, 11, 32, 3, 33, 3, 33, 5, 33, 310, 10, 33, 3, 33, 3, 33, 3, 33, 5, 33, 315, 10, 33, 6, 33, 317, 10, 33, 13, 33, 14, 33, 318, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 7, 35, 336, 10, 35, 12, 35, 14, 35, 339, 11, 35, 5, 35, 341, 10, 35, 3, 36, 3, 36, 3, 36, 7, 36, 346, 10, 36, 12, 36, 14, 36, 349, 11, 36, 5, 36, 351, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 365, 10, 37, 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 371, 10, 37, 12, 37, 14, 37, 374, 11, 37, 3, 38, 3, 38, 7, 38, 378, 10, 38, 12, 38, 14, 38, 381, 11, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 5, 41, 395, 10, 41, 3, 41, 2, 4, 44, 72, 42, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 411, 2, 82, 3, 2, 2, 2, 4, 90, 3, 2, 2, 2, 6, 94, 3, 2, 2, 2, 8, 100, 3, 2, 2, 2, 10, 114, 3, 2, 2, 2, 12, 118, 3, 2, 2, 2, 14, 120, 3, 2, 2, 2, 16, 126, 3, 2, 2, 2, 18, 136, 3, 2, 2, 2, 20, 142, 3, 2, 2, 2, 22, 149, 3, 2, 2, 2, 24, 152, 3, 2, 2, 2, 26, 154, 3, 2, 2, 2, 28, 156, 3, 2, 2, 2, 30, 158, 3, 2, 2, 2, 32, 173, 3, 2, 2, 2, 34, 178, 3, 2, 2, 2, 36, 183, 3, 2, 2, 2, 38, 185, 3, 2, 2, 2, 40, 187, 3, 2, 2, 2, 42, 189, 3, 2, 2, 2, 44, 213, 3, 2, 2, 2, 46, 228, 3, 2, 2, 2, 48, 251, 3, 2, 2, 2, 50, 262, 3, 2, 2, 2, 52, 264, 3, 2, 2, 2, 54, 271, 3, 2, 2, 2, 56, 282, 3, 2, 2, 2, 58, 286, 3, 2, 2, 2, 60, 288, 3, 2, 2, 2, 62, 304, 3, 2, 2, 2, 64, 309, 3, 2, 2, 2, 66, 323, 3, 2, 2, 2, 68, 340, 3, 2, 2, 2, 70, 350, 3, 2, 2, 2, 72, 364, 3, 2, 2, 2, 74, 375, 3, 2, 2, 2, 76, 384, 3, 2, 2, 2, 78, 386, 3, 2, 2, 2, 80, 394, 3, 2, 2, 2, 82, 83, 5, 4, 3, 2, 83, 84, 7, 2, 2, 3, 84, 3, 3, 2, 2, 2, 85, 89, 5, 10, 6, 2, 86, 89, 5, 8, 5, 2, 87, 89, 5, 74, 38, 2, 88, 85, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 88, 87, 3, 2, 2, 2, 89, 92, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 5, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 93, 95, 5, 10, 6, 2, 94, 93, 3, 2, 2, 2, 95, 96, 3, 2, 2, 2, 96, 94, 3, 2, 2, 2, 96, 97, 3, 2, 2, 2, 97, 7, 3, 2, 2, 2, 98, 101, 5, 46, 24, 2, 99, 101, 5, 66, 34, 2, 100, 98, 3, 2, 2, 2, 100, 99, 3, 2, 2, 2, 101, 9, 3, 2, 2, 2, 102, 115, 5, 64, 33, 2, 103, 115, 5, 32, 17, 2, 104, 115, 5, 34, 18, 2, 105, 115, 5, 12, 7, 2, 106, 115, 5, 18, 10, 2, 107, 115, 5, 22, 12, 2, 108, 115, 5, 26, 14, 2, 109, 115, 5, 20, 11, 2, 110, 115, 5, 28, 15, 2, 111, 115, 5, 52, 27, 2, 112, 115, 5, 60, 31, 2, 113, 115, 5, 42, 22, 2, 114, 102, 3, 2, 2, 2, 114, 103, 3, 2, 2, 2, 114, 104, 3, 2, 2, 2, 114, 105, 3, 2, 2, 2, 114, 106, 3, 2, 2, 2, 114, 107, 3, 2, 2, 2, 114, 108, 3, 2, 2, 2, 114, 109, 3, 2, 2, 2, 114, 110, 3, 2, 2, 2, 114, 111, 3, 2, 2, 2, 114, 112, 3, 2, 2, 2, 114, 113, 3, 2, 2, 2, 115, 11, 3, 2, 2, 2, 116, 119, 5, 14, 8, 2, 117, 119, 5, 16, 9, 2, 118, 116, 3, 2, 2, 2, 118, 117, 3, 2, 2, 2, 119, 13, 3, 2, 2, 2, 120, 121, 7, 3, 2, 2, 121, 122, 5, 72, 37, 2, 122, 123, 7, 4, 2, 2, 123, 124, 5, 6, 4, 2, 124, 125, 7, 5, 2, 2, 125, 15, 3, 2, 2, 2, 126, 127, 7, 3, 2, 2, 127, 128, 5, 72, 37, 2, 128, 129, 7, 4, 2, 2, 129, 130, 5, 6, 4, 2, 130, 131, 7, 5, 2, 2, 131, 132, 7, 6, 2, 2, 132, 133, 7, 4, 2, 2, 133, 134, 5, 6, 4, 2, 134, 135, 7, 5, 2, 2, 135, 17, 3, 2, 2, 2, 136, 137, 7, 7, 2, 2, 137, 138, 5, 80, 41, 2, 138, 139, 7, 4, 2, 2, 139, 140, 5, 6, 4, 2, 140, 141, 7, 5, 2, 2, 141, 19, 3, 2, 2, 2, 142, 143, 7, 8, 2, 2, 143, 144, 7, 9, 2, 2, 144, 145, 5, 44, 23, 2, 145, 146, 7, 10, 2, 2, 146, 147, 5, 44, 23, 2, 147, 148, 7, 11, 2, 2, 148, 21, 3, 2, 2, 2, 149, 150, 5, 24, 13, 2, 150, 151, 5, 44, 23, 2, 151, 23, 3, 2, 2, 2, 152, 153, 9, 2, 2, 2, 153, 25, 3, 2, 2, 2, 154, 155, 9, 3, 2, 2, 155, 27, 3, 2, 2, 2, 156, 157, 7, 18, 2, 2, 157, 29, 3, 2, 2, 2, 158, 167, 7, 4, 2, 2, 159, 164, 5, 44, 23, 2, 160, 161, 7, 10, 2, 2, 161, 163, 5, 44, 23, 2, 162, 160, 3, 2, 2, 2, 163, 166, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 168, 3, 2, 2, 2, 166, 164, 3, 2, 2, 2, 167, 159, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 7, 5, 2, 2, 170, 31, 3, 2, 2, 2, 171, 174, 7, 45, 2, 2, 172, 174, 5, 54, 28, 2, 173, 171, 3, 2, 2, 2, 173, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 176, 7, 19, 2, 2, 176, 177, 5, 44, 23, 2, 177, 33, 3, 2, 2, 2, 178, 179, 7, 20, 2, 2, 179, 180, 7, 9, 2, 2, 180, 181, 5, 44, 23, 2, 181, 182, 7, 11, 2, 2, 182, 35, 3, 2, 2, 2, 183, 184, 9, 4, 2, 2, 184, 37, 3, 2, 2, 2, 185, 186, 9, 5, 2, 2, 186, 39, 3, 2, 2, 2, 187, 188, 7, 30, 2, 2, 188, 41, 3, 2, 2, 2, 189, 198, 7, 21, 2, 2, 190, 195, 5, 44, 23, 2, 191, 192, 7, 10, 2, 2, 192, 194, 5, 44, 23, 2, 193, 191, 3, 2, 2, 2, 194, 197, 3, 2, 2, 2, 195, 193, 3, 2, 2, 2, 195, 196, 3, 2, 2, 2, 196, 199, 3, 2, 2, 2, 197, 195, 3, 2, 2, 2, 198, 190, 3, 2, 2, 2, 198, 199, 3, 2, 2, 2, 199, 43, 3, 2, 2, 2, 200, 201, 8, 23, 1, 2, 201, 202, 5, 40, 21, 2, 202, 203, 5, 44, 23, 8, 203, 214, 3, 2, 2, 2, 204, 205, 5, 58, 30, 2, 205, 206, 7, 19, 2, 2, 206, 207, 5, 44, 23, 5, 207, 214, 3, 2, 2, 2, 208, 209, 7, 9, 2, 2, 209, 210, 5, 44, 23, 2, 210, 211, 7, 11, 2, 2, 211, 214, 3, 2, 2, 2, 212, 214, 5, 80, 41, 2, 213, 200, 3, 2, 2, 2, 213, 204, 3, 2, 2, 2, 213, 208, 3, 2, 2, 2, 213, 212, 3, 2, 2, 2, 214, 225, 3, 2, 2, 2, 215, 216, 12, 7, 2, 2, 216, 217, 5, 36, 19, 2, 217, 218, 5, 44, 23, 8, 218, 224, 3, 2, 2, 2, 219, 220, 12, 6, 2, 2, 220, 221, 5, 38, 20, 2, 221, 222, 5, 44, 23, 7, 222, 224, 3, 2, 2, 2, 223, 215, 3, 2, 2, 2, 223, 219, 3, 2, 2, 2, 224, 227, 3, 2, 2, 2, 225, 223, 3, 2, 2, 2, 225, 226, 3, 2, 2, 2, 226, 45, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 228, 229, 7, 22, 2, 2, 229, 242, 7, 45, 2, 2, 230, 231, 7, 9, 2, 2, 231, 239, 7, 45, 2, 2, 232, 236, 7, 10, 2, 2, 233, 235, 7, 45, 2, 2, 234, 233, 3, 2, 2, 2, 235, 238, 3, 2, 2, 2, 236, 234, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 240, 3, 2, 2, 2, 238, 236, 3, 2, 2, 2, 239, 232, 3, 2, 2, 2, 239, 240, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 243, 7, 11, 2, 2, 242, 230, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 245, 7, 23, 2, 2, 245, 246, 5, 48, 25, 2, 246, 247, 7, 24, 2, 2, 247, 47, 3, 2, 2, 2, 248, 250, 5, 50, 26, 2, 249, 248, 3, 2, 2, 2, 250, 253, 3, 2, 2, 2, 251, 249, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 257, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 254, 256, 5, 66, 34, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 49, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 263, 5, 32, 17, 2, 261, 263, 5, 52, 27, 2, 262, 260, 3, 2, 2, 2, 262, 261, 3, 2, 2, 2, 263, 51, 3, 2, 2, 2, 264, 265, 5, 58, 30, 2, 265, 266, 7, 19, 2, 2, 266, 267, 7, 25, 2, 2, 267, 268, 7, 45, 2, 2, 268, 269, 7, 9, 2, 2, 269, 270, 7, 11, 2, 2, 270, 53, 3, 2, 2, 2, 271, 278, 5, 56, 29, 2, 272, 273, 7, 26, 2, 2, 273, 279, 7, 45, 2, 2, 274, 275, 7, 4, 2, 2, 275, 276, 5, 44, 23, 2, 276, 277, 7, 5, 2, 2, 277, 279, 3, 2, 2, 2, 278, 272, 3, 2, 2, 2, 278, 274, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 278, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 55, 3, 2, 2, 2, 282, 283, 7, 45, 2, 2, 283, 57, 3, 2, 2, 2, 284, 287, 7, 45, 2, 2, 285, 287, 5, 54, 28, 2, 286, 284, 3, 2, 2, 2, 286, 285, 3, 2, 2, 2, 287, 59, 3, 2, 2, 2, 288, 289, 5, 62, 32, 2, 289, 290, 7, 46, 2, 2, 290, 291, 7, 9, 2, 2, 291, 292, 5, 70, 36, 2, 292, 293, 7, 11, 2, 2, 293, 61, 3, 2, 2, 2, 294, 300, 7, 45, 2, 2, 295, 296, 7, 4, 2, 2, 296, 297, 5, 44, 23, 2, 297, 298, 7, 5, 2, 2, 298, 300, 3, 2, 2, 2, 299, 294, 3, 2, 2, 2, 299, 295, 3, 2, 2, 2, 300, 301, 3, 2, 2, 2, 301, 303, 7, 26, 2, 2, 302, 299, 3, 2, 2, 2, 303, 306, 3, 2, 2, 2, 304, 302, 3, 2, 2, 2, 304, 305, 3, 2, 2, 2, 305, 63, 3, 2, 2, 2, 306, 304, 3, 2, 2, 2, 307, 310, 7, 45, 2, 2, 308, 310, 5, 54, 28, 2, 309, 307, 3, 2, 2, 2, 309, 308, 3, 2, 2, 2, 310, 316, 3, 2, 2, 2, 311, 314, 7, 10, 2, 2, 312, 315, 7, 45, 2, 2, 313, 315, 5, 54, 28, 2, 314, 312, 3, 2, 2, 2, 314, 313, 3, 2, 2, 2, 315, 317, 3, 2, 2, 2, 316, 311, 3, 2, 2, 2, 317, 318, 3, 2, 2, 2, 318, 316, 3, 2, 2, 2, 318, 319, 3, 2, 2, 2, 319, 320, 3, 2, 2, 2, 320, 321, 7, 19, 2, 2, 321, 322, 5, 60, 31, 2, 322, 65, 3, 2, 2, 2, 323, 324, 7, 27, 2, 2, 324, 325, 7, 46, 2, 2, 325, 326, 7, 9, 2, 2, 326, 327, 5, 68, 35, 2, 327, 328, 7, 11, 2, 2, 328, 329, 7, 23, 2, 2, 329, 330, 5, 6, 4, 2, 330, 331, 7, 24, 2, 2, 331, 67, 3, 2, 2, 2, 332, 337, 7, 45, 2, 2, 333, 334, 7, 10, 2, 2, 334, 336, 7, 45, 2, 2, 335, 333, 3, 2, 2, 2, 336, 339, 3, 2, 2, 2, 337, 335, 3, 2, 2, 2, 337, 338, 3, 2, 2, 2, 338, 341, 3, 2, 2, 2, 339, 337, 3, 2, 2, 2, 340, 332, 3, 2, 2, 2, 340, 341, 3, 2, 2, 2, 341, 69, 3, 2, 2, 2, 342, 347, 5, 44, 23, 2, 343, 344, 7, 10, 2, 2, 344, 346, 5, 44, 23, 2, 345, 343, 3, 2, 2, 2, 346, 349, 3, 2, 2, 2, 347, 345, 3, 2, 2, 2, 347, 348, 3, 2, 2, 2, 348, 351, 3, 2, 2, 2, 349, 347, 3, 2, 2, 2, 350, 342, 3, 2, 2, 2, 350, 351, 3, 2, 2, 2, 351, 71, 3, 2, 2, 2, 352, 353, 8, 37, 1, 2, 353, 354, 7, 42, 2, 2, 354, 365, 5, 72, 37, 7, 355, 356, 5, 44, 23, 2, 356, 357, 5, 76, 39, 2, 357, 358, 5, 44, 23, 2, 358, 365, 3, 2, 2, 2, 359, 365, 7, 33, 2, 2, 360, 361, 7, 9, 2, 2, 361, 362, 5, 72, 37, 2, 362, 363, 7, 11, 2, 2, 363, 365, 3, 2, 2, 2, 364, 352, 3, 2, 2, 2, 364, 355, 3, 2, 2, 2, 364, 359, 3, 2, 2, 2, 364, 360, 3, 2, 2, 2, 365, 372, 3, 2, 2, 2, 366, 367, 12, 5, 2, 2, 367, 368, 5, 78, 40, 2, 368, 369, 5, 72, 37, 6, 369, 371, 3, 2, 2, 2, 370, 366, 3, 2, 2, 2, 371, 374, 3, 2, 2, 2, 372, 370, 3, 2, 2, 2, 372, 373, 3, 2, 2, 2, 373, 73, 3, 2, 2, 2, 374, 372, 3, 2, 2, 2, 375, 379, 7, 28, 2, 2, 376, 378, 7, 46, 2, 2, 377, 376, 3, 2, 2, 2, 378, 381, 3, 2, 2, 2, 379, 377, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 382, 3, 2, 2, 2, 381, 379, 3, 2, 2, 2, 382, 383, 7, 28, 2, 2, 383, 75, 3, 2, 2, 2, 384, 385, 9, 6, 2, 2, 385, 77, 3, 2, 2, 2, 386, 387, 9, 7, 2, 2, 387, 79, 3, 2, 2, 2, 388, 395, 7, 43, 2, 2, 389, 395, 7, 45, 2, 2, 390, 395, 5, 30, 16, 2, 391, 395, 5, 54, 28, 2, 392, 395, 5, 60, 31, 2, 393, 395, 7, 44, 2, 2, 394, 388, 3, 2, 2, 2, 394, 389, 3, 2, 2, 2, 394, 390, 3, 2, 2, 2, 394, 391, 3, 2, 2, 2, 394, 392, 3, 2, 2, 2, 394, 393, 3, 2, 2, 2, 395, 81, 3, 2, 2, 2, 38, 88, 90, 96, 100, 114, 118, 164, 167, 173, 195, 198, 213, 223, 225, 236, 239, 242, 251, 257, 262, 278, 280, 286, 299, 304, 309, 314, 318, 337, 340, 347, 350, 364, 372, 379, 394] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 398, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 7, 3, 89, 10, 3, 12, 3, 14, 3, 92, 11, 3, 3, 4, 3, 4, 6, 4, 96, 10, 4, 13, 4, 14, 4, 97, 3, 5, 3, 5, 5, 5, 102, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 116, 10, 6, 3, 7, 3, 7, 5, 7, 120, 10, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 7, 16, 164, 10, 16, 12, 16, 14, 16, 167, 11, 16, 5, 16, 169, 10, 16, 3, 16, 3, 16, 3, 17, 3, 17, 5, 17, 175, 10, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 195, 10, 22, 12, 22, 14, 22, 198, 11, 22, 5, 22, 200, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 215, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 225, 10, 23, 12, 23, 14, 23, 228, 11, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 236, 10, 24, 12, 24, 14, 24, 239, 11, 24, 5, 24, 241, 10, 24, 3, 24, 5, 24, 244, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 7, 25, 251, 10, 25, 12, 25, 14, 25, 254, 11, 25, 3, 25, 7, 25, 257, 10, 25, 12, 25, 14, 25, 260, 11, 25, 3, 26, 3, 26, 5, 26, 264, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 6, 28, 280, 10, 28, 13, 28, 14, 28, 281, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 288, 10, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 301, 10, 32, 3, 32, 7, 32, 304, 10, 32, 12, 32, 14, 32, 307, 11, 32, 3, 33, 3, 33, 5, 33, 311, 10, 33, 3, 33, 3, 33, 3, 33, 5, 33, 316, 10, 33, 6, 33, 318, 10, 33, 13, 33, 14, 33, 319, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 7, 35, 337, 10, 35, 12, 35, 14, 35, 340, 11, 35, 5, 35, 342, 10, 35, 3, 36, 3, 36, 3, 36, 7, 36, 347, 10, 36, 12, 36, 14, 36, 350, 11, 36, 5, 36, 352, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 366, 10, 37, 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 372, 10, 37, 12, 37, 14, 37, 375, 11, 37, 3, 38, 3, 38, 7, 38, 379, 10, 38, 12, 38, 14, 38, 382, 11, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 5, 41, 396, 10, 41, 3, 41, 2, 4, 44, 72, 42, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 413, 2, 82, 3, 2, 2, 2, 4, 90, 3, 2, 2, 2, 6, 95, 3, 2, 2, 2, 8, 101, 3, 2, 2, 2, 10, 115, 3, 2, 2, 2, 12, 119, 3, 2, 2, 2, 14, 121, 3, 2, 2, 2, 16, 127, 3, 2, 2, 2, 18, 137, 3, 2, 2, 2, 20, 143, 3, 2, 2, 2, 22, 150, 3, 2, 2, 2, 24, 153, 3, 2, 2, 2, 26, 155, 3, 2, 2, 2, 28, 157, 3, 2, 2, 2, 30, 159, 3, 2, 2, 2, 32, 174, 3, 2, 2, 2, 34, 179, 3, 2, 2, 2, 36, 184, 3, 2, 2, 2, 38, 186, 3, 2, 2, 2, 40, 188, 3, 2, 2, 2, 42, 190, 3, 2, 2, 2, 44, 214, 3, 2, 2, 2, 46, 229, 3, 2, 2, 2, 48, 252, 3, 2, 2, 2, 50, 263, 3, 2, 2, 2, 52, 265, 3, 2, 2, 2, 54, 272, 3, 2, 2, 2, 56, 283, 3, 2, 2, 2, 58, 287, 3, 2, 2, 2, 60, 289, 3, 2, 2, 2, 62, 305, 3, 2, 2, 2, 64, 310, 3, 2, 2, 2, 66, 324, 3, 2, 2, 2, 68, 341, 3, 2, 2, 2, 70, 351, 3, 2, 2, 2, 72, 365, 3, 2, 2, 2, 74, 376, 3, 2, 2, 2, 76, 385, 3, 2, 2, 2, 78, 387, 3, 2, 2, 2, 80, 395, 3, 2, 2, 2, 82, 83, 5, 4, 3, 2, 83, 84, 7, 2, 2, 3, 84, 3, 3, 2, 2, 2, 85, 89, 5, 10, 6, 2, 86, 89, 5, 8, 5, 2, 87, 89, 5, 74, 38, 2, 88, 85, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 88, 87, 3, 2, 2, 2, 89, 92, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 5, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 93, 96, 5, 10, 6, 2, 94, 96, 5, 74, 38, 2, 95, 93, 3, 2, 2, 2, 95, 94, 3, 2, 2, 2, 96, 97, 3, 2, 2, 2, 97, 95, 3, 2, 2, 2, 97, 98, 3, 2, 2, 2, 98, 7, 3, 2, 2, 2, 99, 102, 5, 46, 24, 2, 100, 102, 5, 66, 34, 2, 101, 99, 3, 2, 2, 2, 101, 100, 3, 2, 2, 2, 102, 9, 3, 2, 2, 2, 103, 116, 5, 64, 33, 2, 104, 116, 5, 32, 17, 2, 105, 116, 5, 34, 18, 2, 106, 116, 5, 12, 7, 2, 107, 116, 5, 18, 10, 2, 108, 116, 5, 22, 12, 2, 109, 116, 5, 26, 14, 2, 110, 116, 5, 20, 11, 2, 111, 116, 5, 28, 15, 2, 112, 116, 5, 52, 27, 2, 113, 116, 5, 60, 31, 2, 114, 116, 5, 42, 22, 2, 115, 103, 3, 2, 2, 2, 115, 104, 3, 2, 2, 2, 115, 105, 3, 2, 2, 2, 115, 106, 3, 2, 2, 2, 115, 107, 3, 2, 2, 2, 115, 108, 3, 2, 2, 2, 115, 109, 3, 2, 2, 2, 115, 110, 3, 2, 2, 2, 115, 111, 3, 2, 2, 2, 115, 112, 3, 2, 2, 2, 115, 113, 3, 2, 2, 2, 115, 114, 3, 2, 2, 2, 116, 11, 3, 2, 2, 2, 117, 120, 5, 14, 8, 2, 118, 120, 5, 16, 9, 2, 119, 117, 3, 2, 2, 2, 119, 118, 3, 2, 2, 2, 120, 13, 3, 2, 2, 2, 121, 122, 7, 3, 2, 2, 122, 123, 5, 72, 37, 2, 123, 124, 7, 4, 2, 2, 124, 125, 5, 6, 4, 2, 125, 126, 7, 5, 2, 2, 126, 15, 3, 2, 2, 2, 127, 128, 7, 3, 2, 2, 128, 129, 5, 72, 37, 2, 129, 130, 7, 4, 2, 2, 130, 131, 5, 6, 4, 2, 131, 132, 7, 5, 2, 2, 132, 133, 7, 6, 2, 2, 133, 134, 7, 4, 2, 2, 134, 135, 5, 6, 4, 2, 135, 136, 7, 5, 2, 2, 136, 17, 3, 2, 2, 2, 137, 138, 7, 7, 2, 2, 138, 139, 5, 80, 41, 2, 139, 140, 7, 4, 2, 2, 140, 141, 5, 6, 4, 2, 141, 142, 7, 5, 2, 2, 142, 19, 3, 2, 2, 2, 143, 144, 7, 8, 2, 2, 144, 145, 7, 9, 2, 2, 145, 146, 5, 44, 23, 2, 146, 147, 7, 10, 2, 2, 147, 148, 5, 44, 23, 2, 148, 149, 7, 11, 2, 2, 149, 21, 3, 2, 2, 2, 150, 151, 5, 24, 13, 2, 151, 152, 5, 44, 23, 2, 152, 23, 3, 2, 2, 2, 153, 154, 9, 2, 2, 2, 154, 25, 3, 2, 2, 2, 155, 156, 9, 3, 2, 2, 156, 27, 3, 2, 2, 2, 157, 158, 7, 18, 2, 2, 158, 29, 3, 2, 2, 2, 159, 168, 7, 4, 2, 2, 160, 165, 5, 44, 23, 2, 161, 162, 7, 10, 2, 2, 162, 164, 5, 44, 23, 2, 163, 161, 3, 2, 2, 2, 164, 167, 3, 2, 2, 2, 165, 163, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 169, 3, 2, 2, 2, 167, 165, 3, 2, 2, 2, 168, 160, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 3, 2, 2, 2, 170, 171, 7, 5, 2, 2, 171, 31, 3, 2, 2, 2, 172, 175, 7, 45, 2, 2, 173, 175, 5, 54, 28, 2, 174, 172, 3, 2, 2, 2, 174, 173, 3, 2, 2, 2, 175, 176, 3, 2, 2, 2, 176, 177, 7, 19, 2, 2, 177, 178, 5, 44, 23, 2, 178, 33, 3, 2, 2, 2, 179, 180, 7, 20, 2, 2, 180, 181, 7, 9, 2, 2, 181, 182, 5, 44, 23, 2, 182, 183, 7, 11, 2, 2, 183, 35, 3, 2, 2, 2, 184, 185, 9, 4, 2, 2, 185, 37, 3, 2, 2, 2, 186, 187, 9, 5, 2, 2, 187, 39, 3, 2, 2, 2, 188, 189, 7, 30, 2, 2, 189, 41, 3, 2, 2, 2, 190, 199, 7, 21, 2, 2, 191, 196, 5, 44, 23, 2, 192, 193, 7, 10, 2, 2, 193, 195, 5, 44, 23, 2, 194, 192, 3, 2, 2, 2, 195, 198, 3, 2, 2, 2, 196, 194, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 200, 3, 2, 2, 2, 198, 196, 3, 2, 2, 2, 199, 191, 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, 43, 3, 2, 2, 2, 201, 202, 8, 23, 1, 2, 202, 203, 5, 40, 21, 2, 203, 204, 5, 44, 23, 8, 204, 215, 3, 2, 2, 2, 205, 206, 5, 58, 30, 2, 206, 207, 7, 19, 2, 2, 207, 208, 5, 44, 23, 5, 208, 215, 3, 2, 2, 2, 209, 210, 7, 9, 2, 2, 210, 211, 5, 44, 23, 2, 211, 212, 7, 11, 2, 2, 212, 215, 3, 2, 2, 2, 213, 215, 5, 80, 41, 2, 214, 201, 3, 2, 2, 2, 214, 205, 3, 2, 2, 2, 214, 209, 3, 2, 2, 2, 214, 213, 3, 2, 2, 2, 215, 226, 3, 2, 2, 2, 216, 217, 12, 7, 2, 2, 217, 218, 5, 36, 19, 2, 218, 219, 5, 44, 23, 8, 219, 225, 3, 2, 2, 2, 220, 221, 12, 6, 2, 2, 221, 222, 5, 38, 20, 2, 222, 223, 5, 44, 23, 7, 223, 225, 3, 2, 2, 2, 224, 216, 3, 2, 2, 2, 224, 220, 3, 2, 2, 2, 225, 228, 3, 2, 2, 2, 226, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 45, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 229, 230, 7, 22, 2, 2, 230, 243, 7, 45, 2, 2, 231, 232, 7, 9, 2, 2, 232, 240, 7, 45, 2, 2, 233, 237, 7, 10, 2, 2, 234, 236, 7, 45, 2, 2, 235, 234, 3, 2, 2, 2, 236, 239, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 241, 3, 2, 2, 2, 239, 237, 3, 2, 2, 2, 240, 233, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 244, 7, 11, 2, 2, 243, 231, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 246, 7, 23, 2, 2, 246, 247, 5, 48, 25, 2, 247, 248, 7, 24, 2, 2, 248, 47, 3, 2, 2, 2, 249, 251, 5, 50, 26, 2, 250, 249, 3, 2, 2, 2, 251, 254, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 258, 3, 2, 2, 2, 254, 252, 3, 2, 2, 2, 255, 257, 5, 66, 34, 2, 256, 255, 3, 2, 2, 2, 257, 260, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 258, 259, 3, 2, 2, 2, 259, 49, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 261, 264, 5, 32, 17, 2, 262, 264, 5, 52, 27, 2, 263, 261, 3, 2, 2, 2, 263, 262, 3, 2, 2, 2, 264, 51, 3, 2, 2, 2, 265, 266, 5, 58, 30, 2, 266, 267, 7, 19, 2, 2, 267, 268, 7, 25, 2, 2, 268, 269, 7, 45, 2, 2, 269, 270, 7, 9, 2, 2, 270, 271, 7, 11, 2, 2, 271, 53, 3, 2, 2, 2, 272, 279, 5, 56, 29, 2, 273, 274, 7, 26, 2, 2, 274, 280, 7, 45, 2, 2, 275, 276, 7, 4, 2, 2, 276, 277, 5, 44, 23, 2, 277, 278, 7, 5, 2, 2, 278, 280, 3, 2, 2, 2, 279, 273, 3, 2, 2, 2, 279, 275, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 55, 3, 2, 2, 2, 283, 284, 7, 45, 2, 2, 284, 57, 3, 2, 2, 2, 285, 288, 7, 45, 2, 2, 286, 288, 5, 54, 28, 2, 287, 285, 3, 2, 2, 2, 287, 286, 3, 2, 2, 2, 288, 59, 3, 2, 2, 2, 289, 290, 5, 62, 32, 2, 290, 291, 7, 46, 2, 2, 291, 292, 7, 9, 2, 2, 292, 293, 5, 70, 36, 2, 293, 294, 7, 11, 2, 2, 294, 61, 3, 2, 2, 2, 295, 301, 7, 45, 2, 2, 296, 297, 7, 4, 2, 2, 297, 298, 5, 44, 23, 2, 298, 299, 7, 5, 2, 2, 299, 301, 3, 2, 2, 2, 300, 295, 3, 2, 2, 2, 300, 296, 3, 2, 2, 2, 301, 302, 3, 2, 2, 2, 302, 304, 7, 26, 2, 2, 303, 300, 3, 2, 2, 2, 304, 307, 3, 2, 2, 2, 305, 303, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 63, 3, 2, 2, 2, 307, 305, 3, 2, 2, 2, 308, 311, 7, 45, 2, 2, 309, 311, 5, 54, 28, 2, 310, 308, 3, 2, 2, 2, 310, 309, 3, 2, 2, 2, 311, 317, 3, 2, 2, 2, 312, 315, 7, 10, 2, 2, 313, 316, 7, 45, 2, 2, 314, 316, 5, 54, 28, 2, 315, 313, 3, 2, 2, 2, 315, 314, 3, 2, 2, 2, 316, 318, 3, 2, 2, 2, 317, 312, 3, 2, 2, 2, 318, 319, 3, 2, 2, 2, 319, 317, 3, 2, 2, 2, 319, 320, 3, 2, 2, 2, 320, 321, 3, 2, 2, 2, 321, 322, 7, 19, 2, 2, 322, 323, 5, 60, 31, 2, 323, 65, 3, 2, 2, 2, 324, 325, 7, 27, 2, 2, 325, 326, 7, 46, 2, 2, 326, 327, 7, 9, 2, 2, 327, 328, 5, 68, 35, 2, 328, 329, 7, 11, 2, 2, 329, 330, 7, 23, 2, 2, 330, 331, 5, 6, 4, 2, 331, 332, 7, 24, 2, 2, 332, 67, 3, 2, 2, 2, 333, 338, 7, 45, 2, 2, 334, 335, 7, 10, 2, 2, 335, 337, 7, 45, 2, 2, 336, 334, 3, 2, 2, 2, 337, 340, 3, 2, 2, 2, 338, 336, 3, 2, 2, 2, 338, 339, 3, 2, 2, 2, 339, 342, 3, 2, 2, 2, 340, 338, 3, 2, 2, 2, 341, 333, 3, 2, 2, 2, 341, 342, 3, 2, 2, 2, 342, 69, 3, 2, 2, 2, 343, 348, 5, 44, 23, 2, 344, 345, 7, 10, 2, 2, 345, 347, 5, 44, 23, 2, 346, 344, 3, 2, 2, 2, 347, 350, 3, 2, 2, 2, 348, 346, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 352, 3, 2, 2, 2, 350, 348, 3, 2, 2, 2, 351, 343, 3, 2, 2, 2, 351, 352, 3, 2, 2, 2, 352, 71, 3, 2, 2, 2, 353, 354, 8, 37, 1, 2, 354, 355, 7, 42, 2, 2, 355, 366, 5, 72, 37, 7, 356, 357, 5, 44, 23, 2, 357, 358, 5, 76, 39, 2, 358, 359, 5, 44, 23, 2, 359, 366, 3, 2, 2, 2, 360, 366, 7, 33, 2, 2, 361, 362, 7, 9, 2, 2, 362, 363, 5, 72, 37, 2, 363, 364, 7, 11, 2, 2, 364, 366, 3, 2, 2, 2, 365, 353, 3, 2, 2, 2, 365, 356, 3, 2, 2, 2, 365, 360, 3, 2, 2, 2, 365, 361, 3, 2, 2, 2, 366, 373, 3, 2, 2, 2, 367, 368, 12, 5, 2, 2, 368, 369, 5, 78, 40, 2, 369, 370, 5, 72, 37, 6, 370, 372, 3, 2, 2, 2, 371, 367, 3, 2, 2, 2, 372, 375, 3, 2, 2, 2, 373, 371, 3, 2, 2, 2, 373, 374, 3, 2, 2, 2, 374, 73, 3, 2, 2, 2, 375, 373, 3, 2, 2, 2, 376, 380, 7, 28, 2, 2, 377, 379, 7, 46, 2, 2, 378, 377, 3, 2, 2, 2, 379, 382, 3, 2, 2, 2, 380, 378, 3, 2, 2, 2, 380, 381, 3, 2, 2, 2, 381, 383, 3, 2, 2, 2, 382, 380, 3, 2, 2, 2, 383, 384, 7, 28, 2, 2, 384, 75, 3, 2, 2, 2, 385, 386, 9, 6, 2, 2, 386, 77, 3, 2, 2, 2, 387, 388, 9, 7, 2, 2, 388, 79, 3, 2, 2, 2, 389, 396, 7, 43, 2, 2, 390, 396, 7, 45, 2, 2, 391, 396, 5, 30, 16, 2, 392, 396, 5, 54, 28, 2, 393, 396, 5, 60, 31, 2, 394, 396, 7, 44, 2, 2, 395, 389, 3, 2, 2, 2, 395, 390, 3, 2, 2, 2, 395, 391, 3, 2, 2, 2, 395, 392, 3, 2, 2, 2, 395, 393, 3, 2, 2, 2, 395, 394, 3, 2, 2, 2, 396, 81, 3, 2, 2, 2, 39, 88, 90, 95, 97, 101, 115, 119, 165, 168, 174, 196, 199, 214, 224, 226, 237, 240, 243, 252, 258, 263, 279, 281, 287, 300, 305, 310, 315, 319, 338, 341, 348, 351, 365, 373, 380, 395] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index 5fd2da8..6d11687 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -9,181 +9,182 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3/") - buf.write("\u018d\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\u018e\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36") buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t") buf.write("&\4\'\t\'\4(\t(\4)\t)\3\2\3\2\3\2\3\3\3\3\3\3\7\3Y\n\3") - buf.write("\f\3\16\3\\\13\3\3\4\6\4_\n\4\r\4\16\4`\3\5\3\5\5\5e\n") - buf.write("\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\5\6") - buf.write("s\n\6\3\7\3\7\5\7w\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t") - buf.write("\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3") - buf.write("\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\r") - buf.write("\3\r\3\16\3\16\3\17\3\17\3\20\3\20\3\20\3\20\7\20\u00a3") - buf.write("\n\20\f\20\16\20\u00a6\13\20\5\20\u00a8\n\20\3\20\3\20") - buf.write("\3\21\3\21\5\21\u00ae\n\21\3\21\3\21\3\21\3\22\3\22\3") - buf.write("\22\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\26\3\26") - buf.write("\3\26\3\26\7\26\u00c2\n\26\f\26\16\26\u00c5\13\26\5\26") - buf.write("\u00c7\n\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3") - buf.write("\27\3\27\3\27\3\27\3\27\5\27\u00d6\n\27\3\27\3\27\3\27") - buf.write("\3\27\3\27\3\27\3\27\3\27\7\27\u00e0\n\27\f\27\16\27\u00e3") - buf.write("\13\27\3\30\3\30\3\30\3\30\3\30\3\30\7\30\u00eb\n\30\f") - buf.write("\30\16\30\u00ee\13\30\5\30\u00f0\n\30\3\30\5\30\u00f3") - buf.write("\n\30\3\30\3\30\3\30\3\30\3\31\7\31\u00fa\n\31\f\31\16") - buf.write("\31\u00fd\13\31\3\31\7\31\u0100\n\31\f\31\16\31\u0103") - buf.write("\13\31\3\32\3\32\5\32\u0107\n\32\3\33\3\33\3\33\3\33\3") - buf.write("\33\3\33\3\33\3\34\3\34\3\34\3\34\3\34\3\34\3\34\6\34") - buf.write("\u0117\n\34\r\34\16\34\u0118\3\35\3\35\3\36\3\36\5\36") - buf.write("\u011f\n\36\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 ") - buf.write("\3 \5 \u012c\n \3 \7 \u012f\n \f \16 \u0132\13 \3!\3!") - buf.write("\5!\u0136\n!\3!\3!\3!\5!\u013b\n!\6!\u013d\n!\r!\16!\u013e") - buf.write("\3!\3!\3!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3") - buf.write("#\7#\u0150\n#\f#\16#\u0153\13#\5#\u0155\n#\3$\3$\3$\7") - buf.write("$\u015a\n$\f$\16$\u015d\13$\5$\u015f\n$\3%\3%\3%\3%\3") - buf.write("%\3%\3%\3%\3%\3%\3%\3%\5%\u016d\n%\3%\3%\3%\3%\7%\u0173") - buf.write("\n%\f%\16%\u0176\13%\3&\3&\7&\u017a\n&\f&\16&\u017d\13") - buf.write("&\3&\3&\3\'\3\'\3(\3(\3)\3)\3)\3)\3)\3)\5)\u018b\n)\3") - buf.write(")\2\4,H*\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(") - buf.write("*,.\60\62\64\668:<>@BDFHJLNP\2\b\3\2\f\17\3\2\20\21\3") - buf.write("\2\37 \3\2\35\36\3\2\"\'\3\2()\2\u019b\2R\3\2\2\2\4Z\3") - buf.write("\2\2\2\6^\3\2\2\2\bd\3\2\2\2\nr\3\2\2\2\fv\3\2\2\2\16") - buf.write("x\3\2\2\2\20~\3\2\2\2\22\u0088\3\2\2\2\24\u008e\3\2\2") - buf.write("\2\26\u0095\3\2\2\2\30\u0098\3\2\2\2\32\u009a\3\2\2\2") - buf.write("\34\u009c\3\2\2\2\36\u009e\3\2\2\2 \u00ad\3\2\2\2\"\u00b2") - buf.write("\3\2\2\2$\u00b7\3\2\2\2&\u00b9\3\2\2\2(\u00bb\3\2\2\2") - buf.write("*\u00bd\3\2\2\2,\u00d5\3\2\2\2.\u00e4\3\2\2\2\60\u00fb") - buf.write("\3\2\2\2\62\u0106\3\2\2\2\64\u0108\3\2\2\2\66\u010f\3") - buf.write("\2\2\28\u011a\3\2\2\2:\u011e\3\2\2\2<\u0120\3\2\2\2>\u0130") - buf.write("\3\2\2\2@\u0135\3\2\2\2B\u0143\3\2\2\2D\u0154\3\2\2\2") - buf.write("F\u015e\3\2\2\2H\u016c\3\2\2\2J\u0177\3\2\2\2L\u0180\3") - buf.write("\2\2\2N\u0182\3\2\2\2P\u018a\3\2\2\2RS\5\4\3\2ST\7\2\2") - buf.write("\3T\3\3\2\2\2UY\5\n\6\2VY\5\b\5\2WY\5J&\2XU\3\2\2\2XV") - buf.write("\3\2\2\2XW\3\2\2\2Y\\\3\2\2\2ZX\3\2\2\2Z[\3\2\2\2[\5\3") - buf.write("\2\2\2\\Z\3\2\2\2]_\5\n\6\2^]\3\2\2\2_`\3\2\2\2`^\3\2") - buf.write("\2\2`a\3\2\2\2a\7\3\2\2\2be\5.\30\2ce\5B\"\2db\3\2\2\2") - buf.write("dc\3\2\2\2e\t\3\2\2\2fs\5@!\2gs\5 \21\2hs\5\"\22\2is\5") - buf.write("\f\7\2js\5\22\n\2ks\5\26\f\2ls\5\32\16\2ms\5\24\13\2n") - buf.write("s\5\34\17\2os\5\64\33\2ps\5<\37\2qs\5*\26\2rf\3\2\2\2") - buf.write("rg\3\2\2\2rh\3\2\2\2ri\3\2\2\2rj\3\2\2\2rk\3\2\2\2rl\3") - buf.write("\2\2\2rm\3\2\2\2rn\3\2\2\2ro\3\2\2\2rp\3\2\2\2rq\3\2\2") - buf.write("\2s\13\3\2\2\2tw\5\16\b\2uw\5\20\t\2vt\3\2\2\2vu\3\2\2") - buf.write("\2w\r\3\2\2\2xy\7\3\2\2yz\5H%\2z{\7\4\2\2{|\5\6\4\2|}") - buf.write("\7\5\2\2}\17\3\2\2\2~\177\7\3\2\2\177\u0080\5H%\2\u0080") - buf.write("\u0081\7\4\2\2\u0081\u0082\5\6\4\2\u0082\u0083\7\5\2\2") - buf.write("\u0083\u0084\7\6\2\2\u0084\u0085\7\4\2\2\u0085\u0086\5") - buf.write("\6\4\2\u0086\u0087\7\5\2\2\u0087\21\3\2\2\2\u0088\u0089") - buf.write("\7\7\2\2\u0089\u008a\5P)\2\u008a\u008b\7\4\2\2\u008b\u008c") - buf.write("\5\6\4\2\u008c\u008d\7\5\2\2\u008d\23\3\2\2\2\u008e\u008f") - buf.write("\7\b\2\2\u008f\u0090\7\t\2\2\u0090\u0091\5,\27\2\u0091") - buf.write("\u0092\7\n\2\2\u0092\u0093\5,\27\2\u0093\u0094\7\13\2") - buf.write("\2\u0094\25\3\2\2\2\u0095\u0096\5\30\r\2\u0096\u0097\5") - buf.write(",\27\2\u0097\27\3\2\2\2\u0098\u0099\t\2\2\2\u0099\31\3") - buf.write("\2\2\2\u009a\u009b\t\3\2\2\u009b\33\3\2\2\2\u009c\u009d") - buf.write("\7\22\2\2\u009d\35\3\2\2\2\u009e\u00a7\7\4\2\2\u009f\u00a4") - buf.write("\5,\27\2\u00a0\u00a1\7\n\2\2\u00a1\u00a3\5,\27\2\u00a2") - buf.write("\u00a0\3\2\2\2\u00a3\u00a6\3\2\2\2\u00a4\u00a2\3\2\2\2") - buf.write("\u00a4\u00a5\3\2\2\2\u00a5\u00a8\3\2\2\2\u00a6\u00a4\3") - buf.write("\2\2\2\u00a7\u009f\3\2\2\2\u00a7\u00a8\3\2\2\2\u00a8\u00a9") - buf.write("\3\2\2\2\u00a9\u00aa\7\5\2\2\u00aa\37\3\2\2\2\u00ab\u00ae") - buf.write("\7-\2\2\u00ac\u00ae\5\66\34\2\u00ad\u00ab\3\2\2\2\u00ad") - buf.write("\u00ac\3\2\2\2\u00ae\u00af\3\2\2\2\u00af\u00b0\7\23\2") - buf.write("\2\u00b0\u00b1\5,\27\2\u00b1!\3\2\2\2\u00b2\u00b3\7\24") - buf.write("\2\2\u00b3\u00b4\7\t\2\2\u00b4\u00b5\5,\27\2\u00b5\u00b6") - buf.write("\7\13\2\2\u00b6#\3\2\2\2\u00b7\u00b8\t\4\2\2\u00b8%\3") - buf.write("\2\2\2\u00b9\u00ba\t\5\2\2\u00ba\'\3\2\2\2\u00bb\u00bc") - buf.write("\7\36\2\2\u00bc)\3\2\2\2\u00bd\u00c6\7\25\2\2\u00be\u00c3") - buf.write("\5,\27\2\u00bf\u00c0\7\n\2\2\u00c0\u00c2\5,\27\2\u00c1") - buf.write("\u00bf\3\2\2\2\u00c2\u00c5\3\2\2\2\u00c3\u00c1\3\2\2\2") - buf.write("\u00c3\u00c4\3\2\2\2\u00c4\u00c7\3\2\2\2\u00c5\u00c3\3") - buf.write("\2\2\2\u00c6\u00be\3\2\2\2\u00c6\u00c7\3\2\2\2\u00c7+") - buf.write("\3\2\2\2\u00c8\u00c9\b\27\1\2\u00c9\u00ca\5(\25\2\u00ca") - buf.write("\u00cb\5,\27\b\u00cb\u00d6\3\2\2\2\u00cc\u00cd\5:\36\2") - buf.write("\u00cd\u00ce\7\23\2\2\u00ce\u00cf\5,\27\5\u00cf\u00d6") - buf.write("\3\2\2\2\u00d0\u00d1\7\t\2\2\u00d1\u00d2\5,\27\2\u00d2") - buf.write("\u00d3\7\13\2\2\u00d3\u00d6\3\2\2\2\u00d4\u00d6\5P)\2") - buf.write("\u00d5\u00c8\3\2\2\2\u00d5\u00cc\3\2\2\2\u00d5\u00d0\3") - buf.write("\2\2\2\u00d5\u00d4\3\2\2\2\u00d6\u00e1\3\2\2\2\u00d7\u00d8") - buf.write("\f\7\2\2\u00d8\u00d9\5$\23\2\u00d9\u00da\5,\27\b\u00da") - buf.write("\u00e0\3\2\2\2\u00db\u00dc\f\6\2\2\u00dc\u00dd\5&\24\2") - buf.write("\u00dd\u00de\5,\27\7\u00de\u00e0\3\2\2\2\u00df\u00d7\3") - buf.write("\2\2\2\u00df\u00db\3\2\2\2\u00e0\u00e3\3\2\2\2\u00e1\u00df") - buf.write("\3\2\2\2\u00e1\u00e2\3\2\2\2\u00e2-\3\2\2\2\u00e3\u00e1") - buf.write("\3\2\2\2\u00e4\u00e5\7\26\2\2\u00e5\u00f2\7-\2\2\u00e6") - buf.write("\u00e7\7\t\2\2\u00e7\u00ef\7-\2\2\u00e8\u00ec\7\n\2\2") - buf.write("\u00e9\u00eb\7-\2\2\u00ea\u00e9\3\2\2\2\u00eb\u00ee\3") - buf.write("\2\2\2\u00ec\u00ea\3\2\2\2\u00ec\u00ed\3\2\2\2\u00ed\u00f0") - buf.write("\3\2\2\2\u00ee\u00ec\3\2\2\2\u00ef\u00e8\3\2\2\2\u00ef") - buf.write("\u00f0\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f3\7\13\2") - buf.write("\2\u00f2\u00e6\3\2\2\2\u00f2\u00f3\3\2\2\2\u00f3\u00f4") - buf.write("\3\2\2\2\u00f4\u00f5\7\27\2\2\u00f5\u00f6\5\60\31\2\u00f6") - buf.write("\u00f7\7\30\2\2\u00f7/\3\2\2\2\u00f8\u00fa\5\62\32\2\u00f9") - buf.write("\u00f8\3\2\2\2\u00fa\u00fd\3\2\2\2\u00fb\u00f9\3\2\2\2") - buf.write("\u00fb\u00fc\3\2\2\2\u00fc\u0101\3\2\2\2\u00fd\u00fb\3") - buf.write("\2\2\2\u00fe\u0100\5B\"\2\u00ff\u00fe\3\2\2\2\u0100\u0103") - buf.write("\3\2\2\2\u0101\u00ff\3\2\2\2\u0101\u0102\3\2\2\2\u0102") - buf.write("\61\3\2\2\2\u0103\u0101\3\2\2\2\u0104\u0107\5 \21\2\u0105") - buf.write("\u0107\5\64\33\2\u0106\u0104\3\2\2\2\u0106\u0105\3\2\2") - buf.write("\2\u0107\63\3\2\2\2\u0108\u0109\5:\36\2\u0109\u010a\7") - buf.write("\23\2\2\u010a\u010b\7\31\2\2\u010b\u010c\7-\2\2\u010c") - buf.write("\u010d\7\t\2\2\u010d\u010e\7\13\2\2\u010e\65\3\2\2\2\u010f") - buf.write("\u0116\58\35\2\u0110\u0111\7\32\2\2\u0111\u0117\7-\2\2") - buf.write("\u0112\u0113\7\4\2\2\u0113\u0114\5,\27\2\u0114\u0115\7") - buf.write("\5\2\2\u0115\u0117\3\2\2\2\u0116\u0110\3\2\2\2\u0116\u0112") - buf.write("\3\2\2\2\u0117\u0118\3\2\2\2\u0118\u0116\3\2\2\2\u0118") - buf.write("\u0119\3\2\2\2\u0119\67\3\2\2\2\u011a\u011b\7-\2\2\u011b") - buf.write("9\3\2\2\2\u011c\u011f\7-\2\2\u011d\u011f\5\66\34\2\u011e") - buf.write("\u011c\3\2\2\2\u011e\u011d\3\2\2\2\u011f;\3\2\2\2\u0120") - buf.write("\u0121\5> \2\u0121\u0122\7.\2\2\u0122\u0123\7\t\2\2\u0123") - buf.write("\u0124\5F$\2\u0124\u0125\7\13\2\2\u0125=\3\2\2\2\u0126") - buf.write("\u012c\7-\2\2\u0127\u0128\7\4\2\2\u0128\u0129\5,\27\2") - buf.write("\u0129\u012a\7\5\2\2\u012a\u012c\3\2\2\2\u012b\u0126\3") - buf.write("\2\2\2\u012b\u0127\3\2\2\2\u012c\u012d\3\2\2\2\u012d\u012f") - buf.write("\7\32\2\2\u012e\u012b\3\2\2\2\u012f\u0132\3\2\2\2\u0130") - buf.write("\u012e\3\2\2\2\u0130\u0131\3\2\2\2\u0131?\3\2\2\2\u0132") - buf.write("\u0130\3\2\2\2\u0133\u0136\7-\2\2\u0134\u0136\5\66\34") - buf.write("\2\u0135\u0133\3\2\2\2\u0135\u0134\3\2\2\2\u0136\u013c") - buf.write("\3\2\2\2\u0137\u013a\7\n\2\2\u0138\u013b\7-\2\2\u0139") - buf.write("\u013b\5\66\34\2\u013a\u0138\3\2\2\2\u013a\u0139\3\2\2") - buf.write("\2\u013b\u013d\3\2\2\2\u013c\u0137\3\2\2\2\u013d\u013e") - buf.write("\3\2\2\2\u013e\u013c\3\2\2\2\u013e\u013f\3\2\2\2\u013f") - buf.write("\u0140\3\2\2\2\u0140\u0141\7\23\2\2\u0141\u0142\5<\37") - buf.write("\2\u0142A\3\2\2\2\u0143\u0144\7\33\2\2\u0144\u0145\7.") - buf.write("\2\2\u0145\u0146\7\t\2\2\u0146\u0147\5D#\2\u0147\u0148") - buf.write("\7\13\2\2\u0148\u0149\7\27\2\2\u0149\u014a\5\6\4\2\u014a") - buf.write("\u014b\7\30\2\2\u014bC\3\2\2\2\u014c\u0151\7-\2\2\u014d") - buf.write("\u014e\7\n\2\2\u014e\u0150\7-\2\2\u014f\u014d\3\2\2\2") - buf.write("\u0150\u0153\3\2\2\2\u0151\u014f\3\2\2\2\u0151\u0152\3") - buf.write("\2\2\2\u0152\u0155\3\2\2\2\u0153\u0151\3\2\2\2\u0154\u014c") - buf.write("\3\2\2\2\u0154\u0155\3\2\2\2\u0155E\3\2\2\2\u0156\u015b") - buf.write("\5,\27\2\u0157\u0158\7\n\2\2\u0158\u015a\5,\27\2\u0159") - buf.write("\u0157\3\2\2\2\u015a\u015d\3\2\2\2\u015b\u0159\3\2\2\2") - buf.write("\u015b\u015c\3\2\2\2\u015c\u015f\3\2\2\2\u015d\u015b\3") - buf.write("\2\2\2\u015e\u0156\3\2\2\2\u015e\u015f\3\2\2\2\u015fG") - buf.write("\3\2\2\2\u0160\u0161\b%\1\2\u0161\u0162\7*\2\2\u0162\u016d") - buf.write("\5H%\7\u0163\u0164\5,\27\2\u0164\u0165\5L\'\2\u0165\u0166") - buf.write("\5,\27\2\u0166\u016d\3\2\2\2\u0167\u016d\7!\2\2\u0168") - buf.write("\u0169\7\t\2\2\u0169\u016a\5H%\2\u016a\u016b\7\13\2\2") - buf.write("\u016b\u016d\3\2\2\2\u016c\u0160\3\2\2\2\u016c\u0163\3") - buf.write("\2\2\2\u016c\u0167\3\2\2\2\u016c\u0168\3\2\2\2\u016d\u0174") - buf.write("\3\2\2\2\u016e\u016f\f\5\2\2\u016f\u0170\5N(\2\u0170\u0171") - buf.write("\5H%\6\u0171\u0173\3\2\2\2\u0172\u016e\3\2\2\2\u0173\u0176") - buf.write("\3\2\2\2\u0174\u0172\3\2\2\2\u0174\u0175\3\2\2\2\u0175") - buf.write("I\3\2\2\2\u0176\u0174\3\2\2\2\u0177\u017b\7\34\2\2\u0178") - buf.write("\u017a\7.\2\2\u0179\u0178\3\2\2\2\u017a\u017d\3\2\2\2") - buf.write("\u017b\u0179\3\2\2\2\u017b\u017c\3\2\2\2\u017c\u017e\3") - buf.write("\2\2\2\u017d\u017b\3\2\2\2\u017e\u017f\7\34\2\2\u017f") - buf.write("K\3\2\2\2\u0180\u0181\t\6\2\2\u0181M\3\2\2\2\u0182\u0183") - buf.write("\t\7\2\2\u0183O\3\2\2\2\u0184\u018b\7+\2\2\u0185\u018b") - buf.write("\7-\2\2\u0186\u018b\5\36\20\2\u0187\u018b\5\66\34\2\u0188") - buf.write("\u018b\5<\37\2\u0189\u018b\7,\2\2\u018a\u0184\3\2\2\2") - buf.write("\u018a\u0185\3\2\2\2\u018a\u0186\3\2\2\2\u018a\u0187\3") - buf.write("\2\2\2\u018a\u0188\3\2\2\2\u018a\u0189\3\2\2\2\u018bQ") - buf.write("\3\2\2\2&XZ`drv\u00a4\u00a7\u00ad\u00c3\u00c6\u00d5\u00df") - buf.write("\u00e1\u00ec\u00ef\u00f2\u00fb\u0101\u0106\u0116\u0118") - buf.write("\u011e\u012b\u0130\u0135\u013a\u013e\u0151\u0154\u015b") - buf.write("\u015e\u016c\u0174\u017b\u018a") + buf.write("\f\3\16\3\\\13\3\3\4\3\4\6\4`\n\4\r\4\16\4a\3\5\3\5\5") + buf.write("\5f\n\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3") + buf.write("\6\5\6t\n\6\3\7\3\7\5\7x\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3") + buf.write("\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n") + buf.write("\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3") + buf.write("\f\3\r\3\r\3\16\3\16\3\17\3\17\3\20\3\20\3\20\3\20\7\20") + buf.write("\u00a4\n\20\f\20\16\20\u00a7\13\20\5\20\u00a9\n\20\3\20") + buf.write("\3\20\3\21\3\21\5\21\u00af\n\21\3\21\3\21\3\21\3\22\3") + buf.write("\22\3\22\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\26") + buf.write("\3\26\3\26\3\26\7\26\u00c3\n\26\f\26\16\26\u00c6\13\26") + buf.write("\5\26\u00c8\n\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3") + buf.write("\27\3\27\3\27\3\27\3\27\3\27\5\27\u00d7\n\27\3\27\3\27") + buf.write("\3\27\3\27\3\27\3\27\3\27\3\27\7\27\u00e1\n\27\f\27\16") + buf.write("\27\u00e4\13\27\3\30\3\30\3\30\3\30\3\30\3\30\7\30\u00ec") + buf.write("\n\30\f\30\16\30\u00ef\13\30\5\30\u00f1\n\30\3\30\5\30") + buf.write("\u00f4\n\30\3\30\3\30\3\30\3\30\3\31\7\31\u00fb\n\31\f") + buf.write("\31\16\31\u00fe\13\31\3\31\7\31\u0101\n\31\f\31\16\31") + buf.write("\u0104\13\31\3\32\3\32\5\32\u0108\n\32\3\33\3\33\3\33") + buf.write("\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34\3\34\3\34\3\34") + buf.write("\6\34\u0118\n\34\r\34\16\34\u0119\3\35\3\35\3\36\3\36") + buf.write("\5\36\u0120\n\36\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3") + buf.write(" \3 \3 \5 \u012d\n \3 \7 \u0130\n \f \16 \u0133\13 \3") + buf.write("!\3!\5!\u0137\n!\3!\3!\3!\5!\u013c\n!\6!\u013e\n!\r!\16") + buf.write("!\u013f\3!\3!\3!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3") + buf.write("#\3#\3#\7#\u0151\n#\f#\16#\u0154\13#\5#\u0156\n#\3$\3") + buf.write("$\3$\7$\u015b\n$\f$\16$\u015e\13$\5$\u0160\n$\3%\3%\3") + buf.write("%\3%\3%\3%\3%\3%\3%\3%\3%\3%\5%\u016e\n%\3%\3%\3%\3%\7") + buf.write("%\u0174\n%\f%\16%\u0177\13%\3&\3&\7&\u017b\n&\f&\16&\u017e") + buf.write("\13&\3&\3&\3\'\3\'\3(\3(\3)\3)\3)\3)\3)\3)\5)\u018c\n") + buf.write(")\3)\2\4,H*\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"") + buf.write("$&(*,.\60\62\64\668:<>@BDFHJLNP\2\b\3\2\f\17\3\2\20\21") + buf.write("\3\2\37 \3\2\35\36\3\2\"\'\3\2()\2\u019d\2R\3\2\2\2\4") + buf.write("Z\3\2\2\2\6_\3\2\2\2\be\3\2\2\2\ns\3\2\2\2\fw\3\2\2\2") + buf.write("\16y\3\2\2\2\20\177\3\2\2\2\22\u0089\3\2\2\2\24\u008f") + buf.write("\3\2\2\2\26\u0096\3\2\2\2\30\u0099\3\2\2\2\32\u009b\3") + buf.write("\2\2\2\34\u009d\3\2\2\2\36\u009f\3\2\2\2 \u00ae\3\2\2") + buf.write("\2\"\u00b3\3\2\2\2$\u00b8\3\2\2\2&\u00ba\3\2\2\2(\u00bc") + buf.write("\3\2\2\2*\u00be\3\2\2\2,\u00d6\3\2\2\2.\u00e5\3\2\2\2") + buf.write("\60\u00fc\3\2\2\2\62\u0107\3\2\2\2\64\u0109\3\2\2\2\66") + buf.write("\u0110\3\2\2\28\u011b\3\2\2\2:\u011f\3\2\2\2<\u0121\3") + buf.write("\2\2\2>\u0131\3\2\2\2@\u0136\3\2\2\2B\u0144\3\2\2\2D\u0155") + buf.write("\3\2\2\2F\u015f\3\2\2\2H\u016d\3\2\2\2J\u0178\3\2\2\2") + buf.write("L\u0181\3\2\2\2N\u0183\3\2\2\2P\u018b\3\2\2\2RS\5\4\3") + buf.write("\2ST\7\2\2\3T\3\3\2\2\2UY\5\n\6\2VY\5\b\5\2WY\5J&\2XU") + buf.write("\3\2\2\2XV\3\2\2\2XW\3\2\2\2Y\\\3\2\2\2ZX\3\2\2\2Z[\3") + buf.write("\2\2\2[\5\3\2\2\2\\Z\3\2\2\2]`\5\n\6\2^`\5J&\2_]\3\2\2") + buf.write("\2_^\3\2\2\2`a\3\2\2\2a_\3\2\2\2ab\3\2\2\2b\7\3\2\2\2") + buf.write("cf\5.\30\2df\5B\"\2ec\3\2\2\2ed\3\2\2\2f\t\3\2\2\2gt\5") + buf.write("@!\2ht\5 \21\2it\5\"\22\2jt\5\f\7\2kt\5\22\n\2lt\5\26") + buf.write("\f\2mt\5\32\16\2nt\5\24\13\2ot\5\34\17\2pt\5\64\33\2q") + buf.write("t\5<\37\2rt\5*\26\2sg\3\2\2\2sh\3\2\2\2si\3\2\2\2sj\3") + buf.write("\2\2\2sk\3\2\2\2sl\3\2\2\2sm\3\2\2\2sn\3\2\2\2so\3\2\2") + buf.write("\2sp\3\2\2\2sq\3\2\2\2sr\3\2\2\2t\13\3\2\2\2ux\5\16\b") + buf.write("\2vx\5\20\t\2wu\3\2\2\2wv\3\2\2\2x\r\3\2\2\2yz\7\3\2\2") + buf.write("z{\5H%\2{|\7\4\2\2|}\5\6\4\2}~\7\5\2\2~\17\3\2\2\2\177") + buf.write("\u0080\7\3\2\2\u0080\u0081\5H%\2\u0081\u0082\7\4\2\2\u0082") + buf.write("\u0083\5\6\4\2\u0083\u0084\7\5\2\2\u0084\u0085\7\6\2\2") + buf.write("\u0085\u0086\7\4\2\2\u0086\u0087\5\6\4\2\u0087\u0088\7") + buf.write("\5\2\2\u0088\21\3\2\2\2\u0089\u008a\7\7\2\2\u008a\u008b") + buf.write("\5P)\2\u008b\u008c\7\4\2\2\u008c\u008d\5\6\4\2\u008d\u008e") + buf.write("\7\5\2\2\u008e\23\3\2\2\2\u008f\u0090\7\b\2\2\u0090\u0091") + buf.write("\7\t\2\2\u0091\u0092\5,\27\2\u0092\u0093\7\n\2\2\u0093") + buf.write("\u0094\5,\27\2\u0094\u0095\7\13\2\2\u0095\25\3\2\2\2\u0096") + buf.write("\u0097\5\30\r\2\u0097\u0098\5,\27\2\u0098\27\3\2\2\2\u0099") + buf.write("\u009a\t\2\2\2\u009a\31\3\2\2\2\u009b\u009c\t\3\2\2\u009c") + buf.write("\33\3\2\2\2\u009d\u009e\7\22\2\2\u009e\35\3\2\2\2\u009f") + buf.write("\u00a8\7\4\2\2\u00a0\u00a5\5,\27\2\u00a1\u00a2\7\n\2\2") + buf.write("\u00a2\u00a4\5,\27\2\u00a3\u00a1\3\2\2\2\u00a4\u00a7\3") + buf.write("\2\2\2\u00a5\u00a3\3\2\2\2\u00a5\u00a6\3\2\2\2\u00a6\u00a9") + buf.write("\3\2\2\2\u00a7\u00a5\3\2\2\2\u00a8\u00a0\3\2\2\2\u00a8") + buf.write("\u00a9\3\2\2\2\u00a9\u00aa\3\2\2\2\u00aa\u00ab\7\5\2\2") + buf.write("\u00ab\37\3\2\2\2\u00ac\u00af\7-\2\2\u00ad\u00af\5\66") + buf.write("\34\2\u00ae\u00ac\3\2\2\2\u00ae\u00ad\3\2\2\2\u00af\u00b0") + buf.write("\3\2\2\2\u00b0\u00b1\7\23\2\2\u00b1\u00b2\5,\27\2\u00b2") + buf.write("!\3\2\2\2\u00b3\u00b4\7\24\2\2\u00b4\u00b5\7\t\2\2\u00b5") + buf.write("\u00b6\5,\27\2\u00b6\u00b7\7\13\2\2\u00b7#\3\2\2\2\u00b8") + buf.write("\u00b9\t\4\2\2\u00b9%\3\2\2\2\u00ba\u00bb\t\5\2\2\u00bb") + buf.write("\'\3\2\2\2\u00bc\u00bd\7\36\2\2\u00bd)\3\2\2\2\u00be\u00c7") + buf.write("\7\25\2\2\u00bf\u00c4\5,\27\2\u00c0\u00c1\7\n\2\2\u00c1") + buf.write("\u00c3\5,\27\2\u00c2\u00c0\3\2\2\2\u00c3\u00c6\3\2\2\2") + buf.write("\u00c4\u00c2\3\2\2\2\u00c4\u00c5\3\2\2\2\u00c5\u00c8\3") + buf.write("\2\2\2\u00c6\u00c4\3\2\2\2\u00c7\u00bf\3\2\2\2\u00c7\u00c8") + buf.write("\3\2\2\2\u00c8+\3\2\2\2\u00c9\u00ca\b\27\1\2\u00ca\u00cb") + buf.write("\5(\25\2\u00cb\u00cc\5,\27\b\u00cc\u00d7\3\2\2\2\u00cd") + buf.write("\u00ce\5:\36\2\u00ce\u00cf\7\23\2\2\u00cf\u00d0\5,\27") + buf.write("\5\u00d0\u00d7\3\2\2\2\u00d1\u00d2\7\t\2\2\u00d2\u00d3") + buf.write("\5,\27\2\u00d3\u00d4\7\13\2\2\u00d4\u00d7\3\2\2\2\u00d5") + buf.write("\u00d7\5P)\2\u00d6\u00c9\3\2\2\2\u00d6\u00cd\3\2\2\2\u00d6") + buf.write("\u00d1\3\2\2\2\u00d6\u00d5\3\2\2\2\u00d7\u00e2\3\2\2\2") + buf.write("\u00d8\u00d9\f\7\2\2\u00d9\u00da\5$\23\2\u00da\u00db\5") + buf.write(",\27\b\u00db\u00e1\3\2\2\2\u00dc\u00dd\f\6\2\2\u00dd\u00de") + buf.write("\5&\24\2\u00de\u00df\5,\27\7\u00df\u00e1\3\2\2\2\u00e0") + buf.write("\u00d8\3\2\2\2\u00e0\u00dc\3\2\2\2\u00e1\u00e4\3\2\2\2") + buf.write("\u00e2\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3-\3\2\2") + buf.write("\2\u00e4\u00e2\3\2\2\2\u00e5\u00e6\7\26\2\2\u00e6\u00f3") + buf.write("\7-\2\2\u00e7\u00e8\7\t\2\2\u00e8\u00f0\7-\2\2\u00e9\u00ed") + buf.write("\7\n\2\2\u00ea\u00ec\7-\2\2\u00eb\u00ea\3\2\2\2\u00ec") + buf.write("\u00ef\3\2\2\2\u00ed\u00eb\3\2\2\2\u00ed\u00ee\3\2\2\2") + buf.write("\u00ee\u00f1\3\2\2\2\u00ef\u00ed\3\2\2\2\u00f0\u00e9\3") + buf.write("\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f2\3\2\2\2\u00f2\u00f4") + buf.write("\7\13\2\2\u00f3\u00e7\3\2\2\2\u00f3\u00f4\3\2\2\2\u00f4") + buf.write("\u00f5\3\2\2\2\u00f5\u00f6\7\27\2\2\u00f6\u00f7\5\60\31") + buf.write("\2\u00f7\u00f8\7\30\2\2\u00f8/\3\2\2\2\u00f9\u00fb\5\62") + buf.write("\32\2\u00fa\u00f9\3\2\2\2\u00fb\u00fe\3\2\2\2\u00fc\u00fa") + buf.write("\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\u0102\3\2\2\2\u00fe") + buf.write("\u00fc\3\2\2\2\u00ff\u0101\5B\"\2\u0100\u00ff\3\2\2\2") + buf.write("\u0101\u0104\3\2\2\2\u0102\u0100\3\2\2\2\u0102\u0103\3") + buf.write("\2\2\2\u0103\61\3\2\2\2\u0104\u0102\3\2\2\2\u0105\u0108") + buf.write("\5 \21\2\u0106\u0108\5\64\33\2\u0107\u0105\3\2\2\2\u0107") + buf.write("\u0106\3\2\2\2\u0108\63\3\2\2\2\u0109\u010a\5:\36\2\u010a") + buf.write("\u010b\7\23\2\2\u010b\u010c\7\31\2\2\u010c\u010d\7-\2") + buf.write("\2\u010d\u010e\7\t\2\2\u010e\u010f\7\13\2\2\u010f\65\3") + buf.write("\2\2\2\u0110\u0117\58\35\2\u0111\u0112\7\32\2\2\u0112") + buf.write("\u0118\7-\2\2\u0113\u0114\7\4\2\2\u0114\u0115\5,\27\2") + buf.write("\u0115\u0116\7\5\2\2\u0116\u0118\3\2\2\2\u0117\u0111\3") + buf.write("\2\2\2\u0117\u0113\3\2\2\2\u0118\u0119\3\2\2\2\u0119\u0117") + buf.write("\3\2\2\2\u0119\u011a\3\2\2\2\u011a\67\3\2\2\2\u011b\u011c") + buf.write("\7-\2\2\u011c9\3\2\2\2\u011d\u0120\7-\2\2\u011e\u0120") + buf.write("\5\66\34\2\u011f\u011d\3\2\2\2\u011f\u011e\3\2\2\2\u0120") + buf.write(";\3\2\2\2\u0121\u0122\5> \2\u0122\u0123\7.\2\2\u0123\u0124") + buf.write("\7\t\2\2\u0124\u0125\5F$\2\u0125\u0126\7\13\2\2\u0126") + buf.write("=\3\2\2\2\u0127\u012d\7-\2\2\u0128\u0129\7\4\2\2\u0129") + buf.write("\u012a\5,\27\2\u012a\u012b\7\5\2\2\u012b\u012d\3\2\2\2") + buf.write("\u012c\u0127\3\2\2\2\u012c\u0128\3\2\2\2\u012d\u012e\3") + buf.write("\2\2\2\u012e\u0130\7\32\2\2\u012f\u012c\3\2\2\2\u0130") + buf.write("\u0133\3\2\2\2\u0131\u012f\3\2\2\2\u0131\u0132\3\2\2\2") + buf.write("\u0132?\3\2\2\2\u0133\u0131\3\2\2\2\u0134\u0137\7-\2\2") + buf.write("\u0135\u0137\5\66\34\2\u0136\u0134\3\2\2\2\u0136\u0135") + buf.write("\3\2\2\2\u0137\u013d\3\2\2\2\u0138\u013b\7\n\2\2\u0139") + buf.write("\u013c\7-\2\2\u013a\u013c\5\66\34\2\u013b\u0139\3\2\2") + buf.write("\2\u013b\u013a\3\2\2\2\u013c\u013e\3\2\2\2\u013d\u0138") + buf.write("\3\2\2\2\u013e\u013f\3\2\2\2\u013f\u013d\3\2\2\2\u013f") + buf.write("\u0140\3\2\2\2\u0140\u0141\3\2\2\2\u0141\u0142\7\23\2") + buf.write("\2\u0142\u0143\5<\37\2\u0143A\3\2\2\2\u0144\u0145\7\33") + buf.write("\2\2\u0145\u0146\7.\2\2\u0146\u0147\7\t\2\2\u0147\u0148") + buf.write("\5D#\2\u0148\u0149\7\13\2\2\u0149\u014a\7\27\2\2\u014a") + buf.write("\u014b\5\6\4\2\u014b\u014c\7\30\2\2\u014cC\3\2\2\2\u014d") + buf.write("\u0152\7-\2\2\u014e\u014f\7\n\2\2\u014f\u0151\7-\2\2\u0150") + buf.write("\u014e\3\2\2\2\u0151\u0154\3\2\2\2\u0152\u0150\3\2\2\2") + buf.write("\u0152\u0153\3\2\2\2\u0153\u0156\3\2\2\2\u0154\u0152\3") + buf.write("\2\2\2\u0155\u014d\3\2\2\2\u0155\u0156\3\2\2\2\u0156E") + buf.write("\3\2\2\2\u0157\u015c\5,\27\2\u0158\u0159\7\n\2\2\u0159") + buf.write("\u015b\5,\27\2\u015a\u0158\3\2\2\2\u015b\u015e\3\2\2\2") + buf.write("\u015c\u015a\3\2\2\2\u015c\u015d\3\2\2\2\u015d\u0160\3") + buf.write("\2\2\2\u015e\u015c\3\2\2\2\u015f\u0157\3\2\2\2\u015f\u0160") + buf.write("\3\2\2\2\u0160G\3\2\2\2\u0161\u0162\b%\1\2\u0162\u0163") + buf.write("\7*\2\2\u0163\u016e\5H%\7\u0164\u0165\5,\27\2\u0165\u0166") + buf.write("\5L\'\2\u0166\u0167\5,\27\2\u0167\u016e\3\2\2\2\u0168") + buf.write("\u016e\7!\2\2\u0169\u016a\7\t\2\2\u016a\u016b\5H%\2\u016b") + buf.write("\u016c\7\13\2\2\u016c\u016e\3\2\2\2\u016d\u0161\3\2\2") + buf.write("\2\u016d\u0164\3\2\2\2\u016d\u0168\3\2\2\2\u016d\u0169") + buf.write("\3\2\2\2\u016e\u0175\3\2\2\2\u016f\u0170\f\5\2\2\u0170") + buf.write("\u0171\5N(\2\u0171\u0172\5H%\6\u0172\u0174\3\2\2\2\u0173") + buf.write("\u016f\3\2\2\2\u0174\u0177\3\2\2\2\u0175\u0173\3\2\2\2") + buf.write("\u0175\u0176\3\2\2\2\u0176I\3\2\2\2\u0177\u0175\3\2\2") + buf.write("\2\u0178\u017c\7\34\2\2\u0179\u017b\7.\2\2\u017a\u0179") + buf.write("\3\2\2\2\u017b\u017e\3\2\2\2\u017c\u017a\3\2\2\2\u017c") + buf.write("\u017d\3\2\2\2\u017d\u017f\3\2\2\2\u017e\u017c\3\2\2\2") + buf.write("\u017f\u0180\7\34\2\2\u0180K\3\2\2\2\u0181\u0182\t\6\2") + buf.write("\2\u0182M\3\2\2\2\u0183\u0184\t\7\2\2\u0184O\3\2\2\2\u0185") + buf.write("\u018c\7+\2\2\u0186\u018c\7-\2\2\u0187\u018c\5\36\20\2") + buf.write("\u0188\u018c\5\66\34\2\u0189\u018c\5<\37\2\u018a\u018c") + buf.write("\7,\2\2\u018b\u0185\3\2\2\2\u018b\u0186\3\2\2\2\u018b") + buf.write("\u0187\3\2\2\2\u018b\u0188\3\2\2\2\u018b\u0189\3\2\2\2") + buf.write("\u018b\u018a\3\2\2\2\u018cQ\3\2\2\2\'XZ_aesw\u00a5\u00a8") + buf.write("\u00ae\u00c4\u00c7\u00d6\u00e0\u00e2\u00ed\u00f0\u00f3") + buf.write("\u00fc\u0102\u0107\u0117\u0119\u011f\u012c\u0131\u0136") + buf.write("\u013b\u013f\u0152\u0155\u015c\u015f\u016d\u0175\u017c") + buf.write("\u018b") return buf.getvalue() @@ -462,6 +463,13 @@ def instruction(self, i:int=None): return self.getTypedRuleContext(tlangParser.InstructionContext,i) + def comment(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.CommentContext) + else: + return self.getTypedRuleContext(tlangParser.CommentContext,i) + + def getRuleIndex(self): return tlangParser.RULE_strict_ilist @@ -481,16 +489,28 @@ def strict_ilist(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 92 + self.state = 93 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 91 - self.instruction() - self.state = 94 + self.state = 93 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [tlangParser.T__0, tlangParser.T__1, tlangParser.T__4, tlangParser.T__5, tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12, tlangParser.T__13, tlangParser.T__14, tlangParser.T__15, tlangParser.T__17, tlangParser.T__18, tlangParser.VAR, tlangParser.NAME]: + self.state = 91 + self.instruction() + pass + elif token in [tlangParser.T__25]: + self.state = 92 + self.comment() + pass + else: + raise NoViableAltException(self) + + self.state = 95 self._errHandler.sync(self) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__25) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): break except RecognitionException as re: @@ -533,17 +553,17 @@ def declaration(self): localctx = tlangParser.DeclarationContext(self, self._ctx, self.state) self.enterRule(localctx, 6, self.RULE_declaration) try: - self.state = 98 + self.state = 99 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__19]: self.enterOuterAlt(localctx, 1) - self.state = 96 + self.state = 97 self.classDeclaration() pass elif token in [tlangParser.T__24]: self.enterOuterAlt(localctx, 2) - self.state = 97 + self.state = 98 self.functionDeclaration() pass else: @@ -629,78 +649,78 @@ def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) self.enterRule(localctx, 8, self.RULE_instruction) try: - self.state = 112 + self.state = 113 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,4,self._ctx) + la_ = self._interp.adaptivePredict(self._input,5,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 100 + self.state = 101 self.functionCallWithReturnValues() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 101 + self.state = 102 self.assignment() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 102 + self.state = 103 self.printStatement() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 103 + self.state = 104 self.conditional() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 104 + self.state = 105 self.loop() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 105 + self.state = 106 self.moveCommand() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 106 + self.state = 107 self.penCommand() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 107 + self.state = 108 self.gotoCommand() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 108 + self.state = 109 self.pauseCommand() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 109 + self.state = 110 self.objectInstantiation() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 110 + self.state = 111 self.functionCall() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 111 + self.state = 112 self.returnStatement() pass @@ -745,18 +765,18 @@ def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) self.enterRule(localctx, 10, self.RULE_conditional) try: - self.state = 116 + self.state = 117 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,5,self._ctx) + la_ = self._interp.adaptivePredict(self._input,6,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 114 + self.state = 115 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 115 + self.state = 116 self.ifElseConditional() pass @@ -802,15 +822,15 @@ def ifConditional(self): self.enterRule(localctx, 12, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 118 - self.match(tlangParser.T__0) self.state = 119 - self.condition(0) + self.match(tlangParser.T__0) self.state = 120 - self.match(tlangParser.T__1) + self.condition(0) self.state = 121 - self.strict_ilist() + self.match(tlangParser.T__1) self.state = 122 + self.strict_ilist() + self.state = 123 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -856,23 +876,23 @@ def ifElseConditional(self): self.enterRule(localctx, 14, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 124 - self.match(tlangParser.T__0) self.state = 125 - self.condition(0) + self.match(tlangParser.T__0) self.state = 126 - self.match(tlangParser.T__1) + self.condition(0) self.state = 127 - self.strict_ilist() + self.match(tlangParser.T__1) self.state = 128 - self.match(tlangParser.T__2) + self.strict_ilist() self.state = 129 - self.match(tlangParser.T__3) + self.match(tlangParser.T__2) self.state = 130 - self.match(tlangParser.T__1) + self.match(tlangParser.T__3) self.state = 131 - self.strict_ilist() + self.match(tlangParser.T__1) self.state = 132 + self.strict_ilist() + self.state = 133 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -915,15 +935,15 @@ def loop(self): self.enterRule(localctx, 16, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 134 - self.match(tlangParser.T__4) self.state = 135 - self.value() + self.match(tlangParser.T__4) self.state = 136 - self.match(tlangParser.T__1) + self.value() self.state = 137 - self.strict_ilist() + self.match(tlangParser.T__1) self.state = 138 + self.strict_ilist() + self.state = 139 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -965,17 +985,17 @@ def gotoCommand(self): self.enterRule(localctx, 18, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 140 - self.match(tlangParser.T__5) self.state = 141 - self.match(tlangParser.T__6) + self.match(tlangParser.T__5) self.state = 142 - self.expression(0) + self.match(tlangParser.T__6) self.state = 143 - self.match(tlangParser.T__7) - self.state = 144 self.expression(0) + self.state = 144 + self.match(tlangParser.T__7) self.state = 145 + self.expression(0) + self.state = 146 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1018,9 +1038,9 @@ def moveCommand(self): self.enterRule(localctx, 20, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 147 - self.moveOp() self.state = 148 + self.moveOp() + self.state = 149 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1057,7 +1077,7 @@ def moveOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 150 + self.state = 151 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -1099,7 +1119,7 @@ def penCommand(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 152 + self.state = 153 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -1140,7 +1160,7 @@ def pauseCommand(self): self.enterRule(localctx, 26, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 154 + self.state = 155 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -1183,29 +1203,29 @@ def array(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 156 + self.state = 157 self.match(tlangParser.T__1) - self.state = 165 + self.state = 166 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 157 + self.state = 158 self.expression(0) - self.state = 162 + self.state = 163 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 158 - self.match(tlangParser.T__7) self.state = 159 + self.match(tlangParser.T__7) + self.state = 160 self.expression(0) - self.state = 164 + self.state = 165 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 167 + self.state = 168 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -1251,23 +1271,23 @@ def assignment(self): self.enterRule(localctx, 30, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 171 + self.state = 172 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,8,self._ctx) + la_ = self._interp.adaptivePredict(self._input,9,self._ctx) if la_ == 1: - self.state = 169 + self.state = 170 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 170 + self.state = 171 self.objectOrArrayAccess() pass - self.state = 173 - self.match(tlangParser.T__16) self.state = 174 + self.match(tlangParser.T__16) + self.state = 175 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1306,13 +1326,13 @@ def printStatement(self): self.enterRule(localctx, 32, self.RULE_printStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 176 - self.match(tlangParser.T__17) self.state = 177 - self.match(tlangParser.T__6) + self.match(tlangParser.T__17) self.state = 178 - self.expression(0) + self.match(tlangParser.T__6) self.state = 179 + self.expression(0) + self.state = 180 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1354,7 +1374,7 @@ def multiplicative(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 181 + self.state = 182 _la = self._input.LA(1) if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) @@ -1401,7 +1421,7 @@ def additive(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 183 + self.state = 184 _la = self._input.LA(1) if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) @@ -1444,7 +1464,7 @@ def unaryArithOp(self): self.enterRule(localctx, 38, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 185 + self.state = 186 self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re @@ -1487,23 +1507,23 @@ def returnStatement(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 187 + self.state = 188 self.match(tlangParser.T__18) - self.state = 196 + self.state = 197 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,10,self._ctx) + la_ = self._interp.adaptivePredict(self._input,11,self._ctx) if la_ == 1: - self.state = 188 + self.state = 189 self.expression(0) - self.state = 193 + self.state = 194 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 189 - self.match(tlangParser.T__7) self.state = 190 + self.match(tlangParser.T__7) + self.state = 191 self.expression(0) - self.state = 195 + self.state = 196 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1663,17 +1683,17 @@ def expression(self, _p:int=0): self.enterRecursionRule(localctx, 42, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 211 + self.state = 212 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,11,self._ctx) + la_ = self._interp.adaptivePredict(self._input,12,self._ctx) if la_ == 1: localctx = tlangParser.UnaryExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 199 - self.unaryArithOp() self.state = 200 + self.unaryArithOp() + self.state = 201 self.expression(6) pass @@ -1681,11 +1701,11 @@ def expression(self, _p:int=0): localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 202 - self.lvalue() self.state = 203 - self.match(tlangParser.T__16) + self.lvalue() self.state = 204 + self.match(tlangParser.T__16) + self.state = 205 self.expression(3) pass @@ -1693,11 +1713,11 @@ def expression(self, _p:int=0): localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 206 - self.match(tlangParser.T__6) self.state = 207 - self.expression(0) + self.match(tlangParser.T__6) self.state = 208 + self.expression(0) + self.state = 209 self.match(tlangParser.T__8) pass @@ -1705,53 +1725,53 @@ def expression(self, _p:int=0): localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 210 + self.state = 211 self.value() pass self._ctx.stop = self._input.LT(-1) - self.state = 223 + self.state = 224 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,13,self._ctx) + _alt = self._interp.adaptivePredict(self._input,14,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 221 + self.state = 222 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,12,self._ctx) + la_ = self._interp.adaptivePredict(self._input,13,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 213 + self.state = 214 if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 214 - self.multiplicative() self.state = 215 + self.multiplicative() + self.state = 216 self.expression(6) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 217 + self.state = 218 if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") - self.state = 218 - self.additive() self.state = 219 + self.additive() + self.state = 220 self.expression(5) pass - self.state = 225 + self.state = 226 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,13,self._ctx) + _alt = self._interp.adaptivePredict(self._input,14,self._ctx) except RecognitionException as re: localctx.exception = re @@ -1797,45 +1817,45 @@ def classDeclaration(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 226 - self.match(tlangParser.T__19) self.state = 227 + self.match(tlangParser.T__19) + self.state = 228 self.match(tlangParser.VAR) - self.state = 240 + self.state = 241 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.T__6: - self.state = 228 - self.match(tlangParser.T__6) self.state = 229 + self.match(tlangParser.T__6) + self.state = 230 self.match(tlangParser.VAR) - self.state = 237 + self.state = 238 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.T__7: - self.state = 230 + self.state = 231 self.match(tlangParser.T__7) - self.state = 234 + self.state = 235 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 231 + self.state = 232 self.match(tlangParser.VAR) - self.state = 236 + self.state = 237 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 239 + self.state = 240 self.match(tlangParser.T__8) - self.state = 242 - self.match(tlangParser.T__20) self.state = 243 - self.classBody() + self.match(tlangParser.T__20) self.state = 244 + self.classBody() + self.state = 245 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -1885,23 +1905,23 @@ def classBody(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 249 + self.state = 250 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 246 + self.state = 247 self.classAttributeDeclaration() - self.state = 251 + self.state = 252 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 255 + self.state = 256 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__24: - self.state = 252 + self.state = 253 self.functionDeclaration() - self.state = 257 + self.state = 258 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1945,18 +1965,18 @@ def classAttributeDeclaration(self): localctx = tlangParser.ClassAttributeDeclarationContext(self, self._ctx, self.state) self.enterRule(localctx, 48, self.RULE_classAttributeDeclaration) try: - self.state = 260 + self.state = 261 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,19,self._ctx) + la_ = self._interp.adaptivePredict(self._input,20,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 258 + self.state = 259 self.assignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 259 + self.state = 260 self.objectInstantiation() pass @@ -2001,17 +2021,17 @@ def objectInstantiation(self): self.enterRule(localctx, 50, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 262 - self.lvalue() self.state = 263 - self.match(tlangParser.T__16) + self.lvalue() self.state = 264 - self.match(tlangParser.T__22) + self.match(tlangParser.T__16) self.state = 265 - self.match(tlangParser.VAR) + self.match(tlangParser.T__22) self.state = 266 - self.match(tlangParser.T__6) + self.match(tlangParser.VAR) self.state = 267 + self.match(tlangParser.T__6) + self.state = 268 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2063,28 +2083,28 @@ def objectOrArrayAccess(self): self.enterRule(localctx, 52, self.RULE_objectOrArrayAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 269 + self.state = 270 self.baseAccess() - self.state = 276 + self.state = 277 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 276 + self.state = 277 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__23]: - self.state = 270 - self.match(tlangParser.T__23) self.state = 271 + self.match(tlangParser.T__23) + self.state = 272 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 272 - self.match(tlangParser.T__1) self.state = 273 - self.expression(0) + self.match(tlangParser.T__1) self.state = 274 + self.expression(0) + self.state = 275 self.match(tlangParser.T__2) pass else: @@ -2093,9 +2113,9 @@ def objectOrArrayAccess(self): else: raise NoViableAltException(self) - self.state = 278 + self.state = 279 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,21,self._ctx) + _alt = self._interp.adaptivePredict(self._input,22,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2133,7 +2153,7 @@ def baseAccess(self): self.enterRule(localctx, 54, self.RULE_baseAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 280 + self.state = 281 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -2174,18 +2194,18 @@ def lvalue(self): localctx = tlangParser.LvalueContext(self, self._ctx, self.state) self.enterRule(localctx, 56, self.RULE_lvalue) try: - self.state = 284 + self.state = 285 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,22,self._ctx) + la_ = self._interp.adaptivePredict(self._input,23,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 282 + self.state = 283 self.match(tlangParser.VAR) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 283 + self.state = 284 self.objectOrArrayAccess() pass @@ -2234,15 +2254,15 @@ def functionCall(self): self.enterRule(localctx, 58, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 286 - self.methodCaller() self.state = 287 - self.match(tlangParser.NAME) + self.methodCaller() self.state = 288 - self.match(tlangParser.T__6) + self.match(tlangParser.NAME) self.state = 289 - self.arguments() + self.match(tlangParser.T__6) self.state = 290 + self.arguments() + self.state = 291 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2291,31 +2311,31 @@ def methodCaller(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 302 + self.state = 303 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__1 or _la==tlangParser.VAR: - self.state = 297 + self.state = 298 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.VAR]: - self.state = 292 + self.state = 293 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 293 - self.match(tlangParser.T__1) self.state = 294 - self.expression(0) + self.match(tlangParser.T__1) self.state = 295 + self.expression(0) + self.state = 296 self.match(tlangParser.T__2) pass else: raise NoViableAltException(self) - self.state = 299 + self.state = 300 self.match(tlangParser.T__23) - self.state = 304 + self.state = 305 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2370,49 +2390,49 @@ def functionCallWithReturnValues(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 307 + self.state = 308 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,25,self._ctx) + la_ = self._interp.adaptivePredict(self._input,26,self._ctx) if la_ == 1: - self.state = 305 + self.state = 306 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 306 + self.state = 307 self.objectOrArrayAccess() pass - self.state = 314 + self.state = 315 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 309 + self.state = 310 self.match(tlangParser.T__7) - self.state = 312 + self.state = 313 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,26,self._ctx) + la_ = self._interp.adaptivePredict(self._input,27,self._ctx) if la_ == 1: - self.state = 310 + self.state = 311 self.match(tlangParser.VAR) pass elif la_ == 2: - self.state = 311 + self.state = 312 self.objectOrArrayAccess() pass - self.state = 316 + self.state = 317 self._errHandler.sync(self) _la = self._input.LA(1) if not (_la==tlangParser.T__7): break - self.state = 318 - self.match(tlangParser.T__16) self.state = 319 + self.match(tlangParser.T__16) + self.state = 320 self.functionCall() except RecognitionException as re: localctx.exception = re @@ -2458,21 +2478,21 @@ def functionDeclaration(self): self.enterRule(localctx, 64, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 321 - self.match(tlangParser.T__24) self.state = 322 - self.match(tlangParser.NAME) + self.match(tlangParser.T__24) self.state = 323 - self.match(tlangParser.T__6) + self.match(tlangParser.NAME) self.state = 324 - self.parameters() + self.match(tlangParser.T__6) self.state = 325 - self.match(tlangParser.T__8) + self.parameters() self.state = 326 - self.match(tlangParser.T__20) + self.match(tlangParser.T__8) self.state = 327 - self.strict_ilist() + self.match(tlangParser.T__20) self.state = 328 + self.strict_ilist() + self.state = 329 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -2514,21 +2534,21 @@ def parameters(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 338 + self.state = 339 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.VAR: - self.state = 330 + self.state = 331 self.match(tlangParser.VAR) - self.state = 335 + self.state = 336 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 331 - self.match(tlangParser.T__7) self.state = 332 + self.match(tlangParser.T__7) + self.state = 333 self.match(tlangParser.VAR) - self.state = 337 + self.state = 338 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2575,21 +2595,21 @@ def arguments(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 348 + self.state = 349 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 340 + self.state = 341 self.expression(0) - self.state = 345 + self.state = 346 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 341 - self.match(tlangParser.T__7) self.state = 342 + self.match(tlangParser.T__7) + self.state = 343 self.expression(0) - self.state = 347 + self.state = 348 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2658,44 +2678,44 @@ def condition(self, _p:int=0): self.enterRecursionRule(localctx, 70, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 362 + self.state = 363 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,32,self._ctx) + la_ = self._interp.adaptivePredict(self._input,33,self._ctx) if la_ == 1: - self.state = 351 - self.match(tlangParser.NOT) self.state = 352 + self.match(tlangParser.NOT) + self.state = 353 self.condition(5) pass elif la_ == 2: - self.state = 353 - self.expression(0) self.state = 354 - self.binCondOp() + self.expression(0) self.state = 355 + self.binCondOp() + self.state = 356 self.expression(0) pass elif la_ == 3: - self.state = 357 + self.state = 358 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 358 - self.match(tlangParser.T__6) self.state = 359 - self.condition(0) + self.match(tlangParser.T__6) self.state = 360 + self.condition(0) + self.state = 361 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 370 + self.state = 371 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,33,self._ctx) + _alt = self._interp.adaptivePredict(self._input,34,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -2703,17 +2723,17 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 364 + self.state = 365 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 365 - self.logicOp() self.state = 366 + self.logicOp() + self.state = 367 self.condition(4) - self.state = 372 + self.state = 373 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,33,self._ctx) + _alt = self._interp.adaptivePredict(self._input,34,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2755,19 +2775,19 @@ def comment(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 373 + self.state = 374 self.match(tlangParser.T__25) - self.state = 377 + self.state = 378 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.NAME: - self.state = 374 + self.state = 375 self.match(tlangParser.NAME) - self.state = 379 + self.state = 380 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 380 + self.state = 381 self.match(tlangParser.T__25) except RecognitionException as re: localctx.exception = re @@ -2821,7 +2841,7 @@ def binCondOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 382 + self.state = 383 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2868,7 +2888,7 @@ def logicOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 384 + self.state = 385 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2928,42 +2948,42 @@ def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) self.enterRule(localctx, 78, self.RULE_value) try: - self.state = 392 + self.state = 393 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,35,self._ctx) + la_ = self._interp.adaptivePredict(self._input,36,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 386 + self.state = 387 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 387 + self.state = 388 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 388 + self.state = 389 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 389 + self.state = 390 self.objectOrArrayAccess() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 390 + self.state = 391 self.functionCall() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 391 + self.state = 392 self.match(tlangParser.REAL) pass From e374d81cd9ff8f7723553d9c0c69e1c71300bb64 Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Tue, 8 Apr 2025 02:36:56 +0530 Subject: [PATCH 30/47] code commenting and refactoring --- ChironCore/ChironAST/ChironAST.py | 14 +- ChironCore/ChironAST/builder.py | 226 ++-- .../example/demo/class_inheritance_2.tl | 2 +- ChironCore/example/test.tl | 2 +- ChironCore/interpreter.py | 1 - ChironCore/turtparse/tlang.g4 | 19 +- ChironCore/turtparse/tlang.interp | 9 +- ChironCore/turtparse/tlangParser.py | 968 +++++++++--------- ChironCore/turtparse/tlangVisitor.py | 17 +- 9 files changed, 607 insertions(+), 651 deletions(-) diff --git a/ChironCore/ChironAST/ChironAST.py b/ChironCore/ChironAST/ChironAST.py index decb7b4..1bcd046 100644 --- a/ChironCore/ChironAST/ChironAST.py +++ b/ChironCore/ChironAST/ChironAST.py @@ -338,14 +338,14 @@ def __str__(self): # # return self.var.__str__() + "[" + self.idx.__str__() + "]" -class ObjectOrArrayAccess(Value): - def __init__(self, var, accesses): +class DataLocationAccess(Value): + def __init__(self, var, access_chain): self.var = var - self.accesses = accesses # List of attribute names or indices + self.access_chain = access_chain # List of attribute names or indices def __str__(self): result = self.var - for access in self.accesses: + for access in self.access_chain: if isinstance(access, list): # Array indexing indices_str = "".join(f"[{idx}]" for idx in access) result += indices_str @@ -354,12 +354,12 @@ def __str__(self): return result class MethodCaller: - def __init__(self, caller): - self.caller = caller + def __init__(self, access_chain): + self.access_chain = access_chain def __str__(self): result = "" - for access in self.caller: + for access in self.access_chain: if isinstance(access, list): # Array indexing indices_str = "".join(f"[{idx}]" for idx in access) result += indices_str diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 1ca5903..9bf7b9e 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -14,174 +14,159 @@ class astGenPass(tlangVisitor): def __init__(self): - self.repeatInstrCount = 0 # keeps count for no of 'repeat' instructions - self.stmtList = [] + self.repeatInstrCount = 0 # Counter for 'repeat' instructions + self.stmtList = [] # Final list of all executable statements + # Temporary list of sub-statements generated for expression breakdown self.subStmtList = [] + # Counter for naming virtual registers used during code synthesis self.virtualRegCount = 0 - self.class_register = "" - - def getLval(self, ctx:tlangParser.LvalueContext): + # Holds the name of the current class context being compiled + self.classRegister = None + def visitLvalue(self, ctx: tlangParser.LvalueContext): if ctx.VAR(): if isinstance(ctx.VAR(), list): return ChironAST.Var(ctx.VAR()[0].getText()) return ChironAST.Var(ctx.VAR().getText()) - elif ctx.objectOrArrayAccess(): - return self.visitObjectOrArrayAccess(ctx.objectOrArrayAccess()) + elif ctx.dataLocationAccess(): + return self.visitDataLocationAccess(ctx.dataLocationAccess()) def visitStart(self, ctx: tlangParser.StartContext): - stmtList = self.visit(ctx.instruction_list()) - self.stmtList.extend(stmtList) + """Entry point for visiting the parse tree. Returns the synthesized statement list.""" + self.visit(ctx.statement_list()) return self.stmtList - def visitInstruction_list(self, ctx: tlangParser.Instruction_listContext): - instrList = [] - - for declr in ctx.declaration(): - instrList = self.visit(declr) - self.stmtList.extend(self.subStmtList + instrList) - self.subStmtList = [] - instrList = [] - self.virtualRegCount = 0 - - for instr in ctx.instruction(): - instrList = self.visit(instr) - self.stmtList.extend(self.subStmtList + instrList) + def visitStatement_list(self, ctx: tlangParser.Statement_listContext): + self.stmtList.extend(self.visit(ctx.declaration_list())) + self.stmtList.extend(self.visit(ctx.strict_ilist())) + + def processInstructionBlock(self, items): + """ + Shared utility for processing declaration or instruction blocks. + Appends the resulting instructions and sub-statements to the main statement list. + """ + stmtList = [] + for item in items: + currStmtList = self.visit(item) + stmtList.extend(self.subStmtList + currStmtList) self.subStmtList = [] - instrList = [] self.virtualRegCount = 0 + return stmtList - return [] - - def visitStrict_ilist(self, ctx: tlangParser.Strict_ilistContext): - # TODO: code refactoring. visitInstruction_list and visitStrict_ilist have same body - instrList = [] - for instr in ctx.instruction(): - visvalue = self.visit(instr) - instrList.extend(self.subStmtList + visvalue) - self.subStmtList = [] - self.virtualRegCount = 0 + def visitDeclaration_list(self, ctx: tlangParser.Declaration_listContext): + return self.processInstructionBlock(ctx.declaration()) - return instrList + def visitStrict_ilist(self, ctx: tlangParser.Strict_ilistContext): + return self.processInstructionBlock(ctx.instruction()) - def visitFunctionDeclaration(self, ctx: tlangParser.FunctionDeclarationContext, className = None): - if className: - functionName = className + "@" + ctx.NAME().getText() + def visitFunctionDeclaration(self, ctx: tlangParser.FunctionDeclarationContext): + # address(pc) of method will be registered in the interpreter against the key of the form ":className@methodName" + if self.classRegister is not None: + functionName = ":" + self.classRegister + "@" + ctx.NAME().getText() else: functionName = ctx.NAME().getText() functionParams = [param.getText() for param in ctx.parameters( ).VAR()] if ctx.parameters() is not None else None functionBody = self.visit(ctx.strict_ilist()) + # function compilation generated two extra statements apart from the function body + # 1. function declaration - This command is used to register the address(pc) of the function in the interpreter + # against the function name + # 2. parameters passing - This command is used to push the parameters to the function on the call stack return [(ChironAST.FunctionDeclarationCommand(functionName, functionParams, functionBody), len(functionBody) + 2)] + [(ChironAST.ParametersPassingCommand(functionParams), 1)] + functionBody def visitFunctionCall(self, ctx: tlangParser.FunctionCallContext): functionName = ctx.NAME().getText() - print("######caller context", ctx.methodCaller()) - callerClass = self.visitMethodCaller(ctx.methodCaller()) if ctx.methodCaller().children is not None else None + # the object invoking the method, in case the function call is a method call + methodCaller = self.visitMethodCaller( + ctx.methodCaller()) if ctx.methodCaller().children is not None else None functionArgs = [self.visit(arg) for arg in ctx.arguments( ).expression()] if ctx.arguments() is not None else [] - if callerClass: - print("###Caller Class", str(callerClass)) - print("##########") - functionArgs.insert(0, callerClass) - # call the private method with mangled name - if len(callerClass.caller) == 1 and functionName.startswith("__") and callerClass.caller[0] == ":self": - functionName = f"_{self.class_register}{functionName}" - print(functionArgs) - return [(ChironAST.FunctionCallCommand(functionName, functionArgs, callerClass), 1)] + # if the function is a method call, insert the caller object as the first argument + if methodCaller: + functionArgs.insert(0, methodCaller) + # call private methods with mangled names + # eg, :self.__privateMethod() will be called as :self._className__privateMethod() + if len(methodCaller.access_chain) == 1 and methodCaller.access_chain[0] == ":self" and functionName.startswith("__"): + functionName = f"_{self.classRegister}{functionName}" + return [(ChironAST.FunctionCallCommand(functionName, functionArgs, methodCaller), 1)] def visitFunctionCallWithReturnValues(self, ctx: tlangParser.FunctionCallWithReturnValuesContext): - functionCallCommand = self.visitFunctionCall(ctx.functionCall()) - returnLocations = [var.getText() for var in ctx.VAR()] + functionCallStmt = self.visitFunctionCall(ctx.functionCall()) + returnLocations = [self.visit(lvalue) for lvalue in ctx.lvalue()] + # read return statement is used to pop the return values from the call stack and copy them to the variables readReturnCommand = ChironAST.ReadReturnCommand(returnLocations) - return functionCallCommand + [(readReturnCommand, 1)] + return functionCallStmt + [(readReturnCommand, 1)] def visitReturnStatement(self, ctx: tlangParser.ReturnStatementContext): returnValues = [self.visit(expr) for expr in ctx.expression( )] if ctx.expression() is not None else None return [(ChironAST.ReturnCommand(returnValues), 1)] - # computes list of recursive assign statements def visitAssignment(self, ctx: tlangParser.AssignmentContext): - - # print(ctx.VAR().getText(),ctx.expression().getText()) - lval = self.getLval(ctx) + lval = self.visit(ctx.lvalue()) rval = self.visit(ctx.expression()) - print(lval, rval, "Inside assignment") return [(ChironAST.AssignmentCommand(lval, rval), 1)] - def visitObjectOrArrayAccess(self, ctx: tlangParser.ObjectOrArrayAccessContext): - - base = ctx.baseAccess().VAR().getText() - + def visitDataLocationAccess(self, ctx: tlangParser.DataLocationAccessContext): + base = ctx.baseVar().VAR().getText() # Traverse through the nested access ('.' for attributes, '[]' for indices) - accesses = [] - i = 1 # Start from second child (skip baseAccess) - + access_chain = [] + i = 1 # Start from second child (skip baseVar) while i < len(ctx.children): child = ctx.children[i] - if isinstance(child, TerminalNodeImpl) and child.getText() == '.': # Next child must be a VAR (attribute access) i += 1 # Move to VAR - mangled_name = ctx.children[i].getText() - if base == ":self" and i==2 and ctx.children[i].getText().startswith(":__"): - mangled_name = f":_{self.class_register}{mangled_name.replace(":","")}" - accesses.append(mangled_name) - + access = ctx.children[i].getText() + # Handle private attributes + # If the access is with ":self" and the attribute is private, mangle the name + if base == ":self" and i == 2 and ctx.children[i].getText().startswith(":__"): + access = f":_{self.classRegister}{access.replace(":", "")}" + access_chain.append(access) elif child.getText() == '[': # Array access: Process the expression inside `[]` i += 1 # Move to expression inside brackets # Visit and evaluate expression expr = self.visit(ctx.children[i]) - accesses.append([expr.val]) # Store index as a list - + access_chain.append([expr.val]) # Store index as a list i += 1 # Skip closing ']' - i += 1 # Move to the next child + return ChironAST.DataLocationAccess(base, access_chain) - return ChironAST.ObjectOrArrayAccess(base, accesses) - def visitMethodCaller(self, ctx: tlangParser.MethodCallerContext): - accesses = [] - i = 0 - + access_chain = [] + i = 0 while i < len(ctx.children): child = ctx.children[i] - - if isinstance(child, TerminalNodeImpl) : + if isinstance(child, TerminalNodeImpl): # Current child must be a VAR (attribute access) - accesses.append(ctx.children[i].getText()) + access_chain.append(ctx.children[i].getText()) i += 1 # skip '.' - elif child.getText() == '[': # Array access: Process the expression inside `[]` i += 1 # Move to expression inside brackets # Visit and evaluate expression expr = self.visit(ctx.children[i]) - accesses.append([expr.val]) # Store index as a list - + access_chain.append([expr.val]) # Store index as a list i += 2 # Skip closing ']' - i += 1 # Move to the next child - - print(accesses) - return ChironAST.MethodCaller(accesses) + return ChironAST.MethodCaller(access_chain) def visitObjectInstantiation(self, ctx: tlangParser.ObjectInstantiationContext): # Extract the left-hand side (target variable or object access) - lval = self.getLval(ctx.lvalue()) + lval = self.visit(ctx.lvalue()) # Extract the class name - # The last VAR is the clazss being instantiated + # The last VAR is the class being instantiated class_name = ctx.VAR().getText() - return [(ChironAST.ObjectInstantiationCommand(lval, class_name), 1)] def visitClassDeclaration(self, ctx: tlangParser.ClassDeclarationContext): - className = ctx.VAR()[0].getText() # Extract class name - self.class_register = className.replace(":","") - baseClasses = [var.getText() for var in ctx.VAR()[1:]] if len(ctx.VAR()) > 1 else None # Extract base classes + className = ctx.VAR()[0].getText() + self.classRegister = className.replace(":", "") + baseClasses = [var.getText() for var in ctx.VAR()[1:]] if len( + ctx.VAR()) > 1 else None # Extract base classes attributes = [] + # attributes which are object instantiations objectAttributes = [] methods = [] if ctx.classBody(): @@ -190,20 +175,16 @@ def visitClassDeclaration(self, ctx: tlangParser.ClassDeclarationContext): assign_instr = self.visitAssignment(attrDecl.assignment()) attributes.extend(assign_instr) if isinstance(attrDecl.objectInstantiation(), tlangParser.ObjectInstantiationContext): - objectAttributes.extend(self.visitObjectInstantiation(attrDecl.objectInstantiation())) + objectAttributes.extend(self.visitObjectInstantiation( + attrDecl.objectInstantiation())) for methodCtx in ctx.classBody().functionDeclaration(): - methods.extend(self.visitFunctionDeclaration(methodCtx, className)) - # Extract methods of the class + methods.extend(self.visitFunctionDeclaration( + methodCtx)) + self.classRegister = None # Reset class register + # compiling class declaration generates one extra statement apart from the class body + # 1. class declaration - This command is used to register the class as a python class(along with its attributes) in the interpreter return [(ChironAST.ClassDeclarationCommand(className, baseClasses, attributes, objectAttributes), 1)] + methods - # def visitArrayAccess(self, ctx:tlangParser.ArrayAccessContext): - # var = ctx.VAR().getText() - # indices = [self.visit(expr).val for expr in ctx.expression()] # Visit all expressions in [] - - # # print(var, indices, "Inside multi-dimensional array access") - - # return ChironAST.ArrayAccess(var, indices) # Return an object handling multiple indices - def visitValue(self, ctx: tlangParser.ValueContext): if ctx.NUM(): return ChironAST.Num(ctx.NUM().getText()) @@ -213,36 +194,39 @@ def visitValue(self, ctx: tlangParser.ValueContext): return ChironAST.Var(ctx.VAR().getText()) elif ctx.array(): return ChironAST.Array(ctx.array().getText()) - elif ctx.objectOrArrayAccess(): - return self.visitObjectOrArrayAccess(ctx.objectOrArrayAccess()) + elif ctx.dataLocationAccess(): + return self.visitDataLocationAccess(ctx.dataLocationAccess()) elif ctx.functionCall(): return self.visitFunctionCallExpr(ctx.functionCall()) def visitFunctionCallExpr(self, ctx: tlangParser.FunctionCallContext): + # TODO: Refactoring, this function has similar body as visitFunctionCall functionName = ctx.NAME().getText() - callerClass = self.visitMethodCaller(ctx.methodCaller()) if ctx.methodCaller().children is not None else None + # the object invoking the method, in case the function call is a method call + methodCaller = self.visitMethodCaller( + ctx.methodCaller()) if ctx.methodCaller().children is not None else None functionArgs = [self.visit(arg) for arg in ctx.arguments( ).expression()] if ctx.arguments() is not None else [] - if callerClass: - functionArgs.insert(0, callerClass) + # if the function is a method call, insert the caller object as the first argument + if methodCaller: + functionArgs.insert(0, methodCaller) + # call private methods with mangled names + # eg, :self.__privateMethod() will be called as :self._className__privateMethod() + if len(methodCaller.access_chain) == 1 and methodCaller.access_chain[0] == ":self" and functionName.startswith("__"): + functionName = f"_{self.classRegister}{functionName}" + # create a virtual register to store the return value returnLocation = ChironAST.Var(":__reg_" + str(self.virtualRegCount)) self.virtualRegCount += 1 - currStmtList = [(ChironAST.FunctionCallCommand(functionName, functionArgs, callerClass), 1)] + [(ChironAST.ReadReturnCommand([returnLocation]), 1)] - self.subStmtList.extend(currStmtList) + self.subStmtList.extend([(ChironAST.FunctionCallCommand(functionName, functionArgs, + methodCaller), 1)] + [(ChironAST.ReadReturnCommand([returnLocation]), 1)]) return returnLocation - - + def visitAssignExpr(self, ctx: tlangParser.AssignExprContext): - - print("Assignment Expr") - lval = self.getLval(ctx.lvalue()) + lval = self.visit(ctx.lvalue()) rval = self.visit(ctx.expression()) - currentStmtList = [(ChironAST.AssignmentCommand(lval, rval), 1)] - self.subStmtList.extend(currentStmtList) - return lval - # return "("+ ChironAST.AssignmentCommand(lval, rval) + ")" - # return # Calls visitAssignment + self.subStmtList.extend([(ChironAST.AssignmentCommand(lval, rval), 1)]) + return lval def visitPrintStatement(self, ctx: tlangParser.PrintStatementContext): expr_value = self.visit(ctx.expression()) # Evaluate the expression diff --git a/ChironCore/example/demo/class_inheritance_2.tl b/ChironCore/example/demo/class_inheritance_2.tl index e976955..4ea6836 100644 --- a/ChironCore/example/demo/class_inheritance_2.tl +++ b/ChironCore/example/demo/class_inheritance_2.tl @@ -11,7 +11,7 @@ class :Hexagon(:Shape) { :sides = 6 def drawHex(:self) { repeat :self.:sides [ - :self.__moveForward(100) + :self.moveForward() right 60 ] return diff --git a/ChironCore/example/test.tl b/ChironCore/example/test.tl index 807478f..cc69ccc 100644 --- a/ChironCore/example/test.tl +++ b/ChironCore/example/test.tl @@ -7,4 +7,4 @@ def increment(:a) { return (add(:a, 1)) } -print(increment(4)) +print(increment(4)*5) diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index c8c8393..ae3ce5c 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -180,7 +180,6 @@ def handleFunctionDeclaration(self, stmt, tgt): if "@" in stmt.name and stmt.name.split("@")[1].startswith("__"): class_name, method_name = stmt.name.split("@") function_name = class_name+ "@" + "_" + class_name.replace(":","") + method_name - print("[DEBUGGING] FUNCTION NAME MANGLED TO: ", function_name) else: function_name = stmt.name diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index c0cc96d..4bb1161 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -1,11 +1,12 @@ grammar tlang; -start : instruction_list EOF +start : statement_list EOF ; -instruction_list : (instruction | declaration | comment)* - ; +statement_list : declaration_list strict_ilist ; + +declaration_list : (declaration)* ; strict_ilist : (instruction | comment)+ ; @@ -50,7 +51,7 @@ array ; assignment : - ( VAR | objectOrArrayAccess ) '=' expression + lvalue '=' expression ; printStatement : 'print' '(' expression ')' ; @@ -87,20 +88,20 @@ classAttributeDeclaration : assignment | objectInstantiation ; objectInstantiation : lvalue '=' 'new' VAR '(' ')' ; -objectOrArrayAccess : baseAccess ('.' VAR | '[' expression ']')+ ; +dataLocationAccess : baseVar ('.' VAR | '[' expression ']')+ ; -baseAccess : VAR ; +baseVar : VAR ; lvalue : VAR - | objectOrArrayAccess + | dataLocationAccess ; // function call functionCall : methodCaller NAME '(' arguments ')' ; methodCaller : ((VAR | '[' expression ']') '.')* ; -functionCallWithReturnValues : ( VAR | objectOrArrayAccess) ( ',' ( VAR | objectOrArrayAccess) )+ '=' functionCall ; +functionCallWithReturnValues : lvalue ( ',' lvalue )+ '=' functionCall ; // function declaration functionDeclaration : 'def' NAME '(' parameters ')' '{' strict_ilist '}' ; @@ -139,7 +140,7 @@ NOT: '!' ; value : NUM | VAR | array - | objectOrArrayAccess + | dataLocationAccess | functionCall | REAL ; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index af394d0..f4ea0c2 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -96,7 +96,8 @@ Whitespace rule names: start -instruction_list +statement_list +declaration_list strict_ilist declaration instruction @@ -121,8 +122,8 @@ classDeclaration classBody classAttributeDeclaration objectInstantiation -objectOrArrayAccess -baseAccess +dataLocationAccess +baseVar lvalue functionCall methodCaller @@ -138,4 +139,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 398, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 7, 3, 89, 10, 3, 12, 3, 14, 3, 92, 11, 3, 3, 4, 3, 4, 6, 4, 96, 10, 4, 13, 4, 14, 4, 97, 3, 5, 3, 5, 5, 5, 102, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 116, 10, 6, 3, 7, 3, 7, 5, 7, 120, 10, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 7, 16, 164, 10, 16, 12, 16, 14, 16, 167, 11, 16, 5, 16, 169, 10, 16, 3, 16, 3, 16, 3, 17, 3, 17, 5, 17, 175, 10, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 195, 10, 22, 12, 22, 14, 22, 198, 11, 22, 5, 22, 200, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 215, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 225, 10, 23, 12, 23, 14, 23, 228, 11, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 236, 10, 24, 12, 24, 14, 24, 239, 11, 24, 5, 24, 241, 10, 24, 3, 24, 5, 24, 244, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 7, 25, 251, 10, 25, 12, 25, 14, 25, 254, 11, 25, 3, 25, 7, 25, 257, 10, 25, 12, 25, 14, 25, 260, 11, 25, 3, 26, 3, 26, 5, 26, 264, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 6, 28, 280, 10, 28, 13, 28, 14, 28, 281, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 288, 10, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 301, 10, 32, 3, 32, 7, 32, 304, 10, 32, 12, 32, 14, 32, 307, 11, 32, 3, 33, 3, 33, 5, 33, 311, 10, 33, 3, 33, 3, 33, 3, 33, 5, 33, 316, 10, 33, 6, 33, 318, 10, 33, 13, 33, 14, 33, 319, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 7, 35, 337, 10, 35, 12, 35, 14, 35, 340, 11, 35, 5, 35, 342, 10, 35, 3, 36, 3, 36, 3, 36, 7, 36, 347, 10, 36, 12, 36, 14, 36, 350, 11, 36, 5, 36, 352, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 366, 10, 37, 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 372, 10, 37, 12, 37, 14, 37, 375, 11, 37, 3, 38, 3, 38, 7, 38, 379, 10, 38, 12, 38, 14, 38, 382, 11, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 5, 41, 396, 10, 41, 3, 41, 2, 4, 44, 72, 42, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 413, 2, 82, 3, 2, 2, 2, 4, 90, 3, 2, 2, 2, 6, 95, 3, 2, 2, 2, 8, 101, 3, 2, 2, 2, 10, 115, 3, 2, 2, 2, 12, 119, 3, 2, 2, 2, 14, 121, 3, 2, 2, 2, 16, 127, 3, 2, 2, 2, 18, 137, 3, 2, 2, 2, 20, 143, 3, 2, 2, 2, 22, 150, 3, 2, 2, 2, 24, 153, 3, 2, 2, 2, 26, 155, 3, 2, 2, 2, 28, 157, 3, 2, 2, 2, 30, 159, 3, 2, 2, 2, 32, 174, 3, 2, 2, 2, 34, 179, 3, 2, 2, 2, 36, 184, 3, 2, 2, 2, 38, 186, 3, 2, 2, 2, 40, 188, 3, 2, 2, 2, 42, 190, 3, 2, 2, 2, 44, 214, 3, 2, 2, 2, 46, 229, 3, 2, 2, 2, 48, 252, 3, 2, 2, 2, 50, 263, 3, 2, 2, 2, 52, 265, 3, 2, 2, 2, 54, 272, 3, 2, 2, 2, 56, 283, 3, 2, 2, 2, 58, 287, 3, 2, 2, 2, 60, 289, 3, 2, 2, 2, 62, 305, 3, 2, 2, 2, 64, 310, 3, 2, 2, 2, 66, 324, 3, 2, 2, 2, 68, 341, 3, 2, 2, 2, 70, 351, 3, 2, 2, 2, 72, 365, 3, 2, 2, 2, 74, 376, 3, 2, 2, 2, 76, 385, 3, 2, 2, 2, 78, 387, 3, 2, 2, 2, 80, 395, 3, 2, 2, 2, 82, 83, 5, 4, 3, 2, 83, 84, 7, 2, 2, 3, 84, 3, 3, 2, 2, 2, 85, 89, 5, 10, 6, 2, 86, 89, 5, 8, 5, 2, 87, 89, 5, 74, 38, 2, 88, 85, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 88, 87, 3, 2, 2, 2, 89, 92, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 5, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 93, 96, 5, 10, 6, 2, 94, 96, 5, 74, 38, 2, 95, 93, 3, 2, 2, 2, 95, 94, 3, 2, 2, 2, 96, 97, 3, 2, 2, 2, 97, 95, 3, 2, 2, 2, 97, 98, 3, 2, 2, 2, 98, 7, 3, 2, 2, 2, 99, 102, 5, 46, 24, 2, 100, 102, 5, 66, 34, 2, 101, 99, 3, 2, 2, 2, 101, 100, 3, 2, 2, 2, 102, 9, 3, 2, 2, 2, 103, 116, 5, 64, 33, 2, 104, 116, 5, 32, 17, 2, 105, 116, 5, 34, 18, 2, 106, 116, 5, 12, 7, 2, 107, 116, 5, 18, 10, 2, 108, 116, 5, 22, 12, 2, 109, 116, 5, 26, 14, 2, 110, 116, 5, 20, 11, 2, 111, 116, 5, 28, 15, 2, 112, 116, 5, 52, 27, 2, 113, 116, 5, 60, 31, 2, 114, 116, 5, 42, 22, 2, 115, 103, 3, 2, 2, 2, 115, 104, 3, 2, 2, 2, 115, 105, 3, 2, 2, 2, 115, 106, 3, 2, 2, 2, 115, 107, 3, 2, 2, 2, 115, 108, 3, 2, 2, 2, 115, 109, 3, 2, 2, 2, 115, 110, 3, 2, 2, 2, 115, 111, 3, 2, 2, 2, 115, 112, 3, 2, 2, 2, 115, 113, 3, 2, 2, 2, 115, 114, 3, 2, 2, 2, 116, 11, 3, 2, 2, 2, 117, 120, 5, 14, 8, 2, 118, 120, 5, 16, 9, 2, 119, 117, 3, 2, 2, 2, 119, 118, 3, 2, 2, 2, 120, 13, 3, 2, 2, 2, 121, 122, 7, 3, 2, 2, 122, 123, 5, 72, 37, 2, 123, 124, 7, 4, 2, 2, 124, 125, 5, 6, 4, 2, 125, 126, 7, 5, 2, 2, 126, 15, 3, 2, 2, 2, 127, 128, 7, 3, 2, 2, 128, 129, 5, 72, 37, 2, 129, 130, 7, 4, 2, 2, 130, 131, 5, 6, 4, 2, 131, 132, 7, 5, 2, 2, 132, 133, 7, 6, 2, 2, 133, 134, 7, 4, 2, 2, 134, 135, 5, 6, 4, 2, 135, 136, 7, 5, 2, 2, 136, 17, 3, 2, 2, 2, 137, 138, 7, 7, 2, 2, 138, 139, 5, 80, 41, 2, 139, 140, 7, 4, 2, 2, 140, 141, 5, 6, 4, 2, 141, 142, 7, 5, 2, 2, 142, 19, 3, 2, 2, 2, 143, 144, 7, 8, 2, 2, 144, 145, 7, 9, 2, 2, 145, 146, 5, 44, 23, 2, 146, 147, 7, 10, 2, 2, 147, 148, 5, 44, 23, 2, 148, 149, 7, 11, 2, 2, 149, 21, 3, 2, 2, 2, 150, 151, 5, 24, 13, 2, 151, 152, 5, 44, 23, 2, 152, 23, 3, 2, 2, 2, 153, 154, 9, 2, 2, 2, 154, 25, 3, 2, 2, 2, 155, 156, 9, 3, 2, 2, 156, 27, 3, 2, 2, 2, 157, 158, 7, 18, 2, 2, 158, 29, 3, 2, 2, 2, 159, 168, 7, 4, 2, 2, 160, 165, 5, 44, 23, 2, 161, 162, 7, 10, 2, 2, 162, 164, 5, 44, 23, 2, 163, 161, 3, 2, 2, 2, 164, 167, 3, 2, 2, 2, 165, 163, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 169, 3, 2, 2, 2, 167, 165, 3, 2, 2, 2, 168, 160, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 3, 2, 2, 2, 170, 171, 7, 5, 2, 2, 171, 31, 3, 2, 2, 2, 172, 175, 7, 45, 2, 2, 173, 175, 5, 54, 28, 2, 174, 172, 3, 2, 2, 2, 174, 173, 3, 2, 2, 2, 175, 176, 3, 2, 2, 2, 176, 177, 7, 19, 2, 2, 177, 178, 5, 44, 23, 2, 178, 33, 3, 2, 2, 2, 179, 180, 7, 20, 2, 2, 180, 181, 7, 9, 2, 2, 181, 182, 5, 44, 23, 2, 182, 183, 7, 11, 2, 2, 183, 35, 3, 2, 2, 2, 184, 185, 9, 4, 2, 2, 185, 37, 3, 2, 2, 2, 186, 187, 9, 5, 2, 2, 187, 39, 3, 2, 2, 2, 188, 189, 7, 30, 2, 2, 189, 41, 3, 2, 2, 2, 190, 199, 7, 21, 2, 2, 191, 196, 5, 44, 23, 2, 192, 193, 7, 10, 2, 2, 193, 195, 5, 44, 23, 2, 194, 192, 3, 2, 2, 2, 195, 198, 3, 2, 2, 2, 196, 194, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 200, 3, 2, 2, 2, 198, 196, 3, 2, 2, 2, 199, 191, 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, 43, 3, 2, 2, 2, 201, 202, 8, 23, 1, 2, 202, 203, 5, 40, 21, 2, 203, 204, 5, 44, 23, 8, 204, 215, 3, 2, 2, 2, 205, 206, 5, 58, 30, 2, 206, 207, 7, 19, 2, 2, 207, 208, 5, 44, 23, 5, 208, 215, 3, 2, 2, 2, 209, 210, 7, 9, 2, 2, 210, 211, 5, 44, 23, 2, 211, 212, 7, 11, 2, 2, 212, 215, 3, 2, 2, 2, 213, 215, 5, 80, 41, 2, 214, 201, 3, 2, 2, 2, 214, 205, 3, 2, 2, 2, 214, 209, 3, 2, 2, 2, 214, 213, 3, 2, 2, 2, 215, 226, 3, 2, 2, 2, 216, 217, 12, 7, 2, 2, 217, 218, 5, 36, 19, 2, 218, 219, 5, 44, 23, 8, 219, 225, 3, 2, 2, 2, 220, 221, 12, 6, 2, 2, 221, 222, 5, 38, 20, 2, 222, 223, 5, 44, 23, 7, 223, 225, 3, 2, 2, 2, 224, 216, 3, 2, 2, 2, 224, 220, 3, 2, 2, 2, 225, 228, 3, 2, 2, 2, 226, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 45, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 229, 230, 7, 22, 2, 2, 230, 243, 7, 45, 2, 2, 231, 232, 7, 9, 2, 2, 232, 240, 7, 45, 2, 2, 233, 237, 7, 10, 2, 2, 234, 236, 7, 45, 2, 2, 235, 234, 3, 2, 2, 2, 236, 239, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 241, 3, 2, 2, 2, 239, 237, 3, 2, 2, 2, 240, 233, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 244, 7, 11, 2, 2, 243, 231, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 246, 7, 23, 2, 2, 246, 247, 5, 48, 25, 2, 247, 248, 7, 24, 2, 2, 248, 47, 3, 2, 2, 2, 249, 251, 5, 50, 26, 2, 250, 249, 3, 2, 2, 2, 251, 254, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 258, 3, 2, 2, 2, 254, 252, 3, 2, 2, 2, 255, 257, 5, 66, 34, 2, 256, 255, 3, 2, 2, 2, 257, 260, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 258, 259, 3, 2, 2, 2, 259, 49, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 261, 264, 5, 32, 17, 2, 262, 264, 5, 52, 27, 2, 263, 261, 3, 2, 2, 2, 263, 262, 3, 2, 2, 2, 264, 51, 3, 2, 2, 2, 265, 266, 5, 58, 30, 2, 266, 267, 7, 19, 2, 2, 267, 268, 7, 25, 2, 2, 268, 269, 7, 45, 2, 2, 269, 270, 7, 9, 2, 2, 270, 271, 7, 11, 2, 2, 271, 53, 3, 2, 2, 2, 272, 279, 5, 56, 29, 2, 273, 274, 7, 26, 2, 2, 274, 280, 7, 45, 2, 2, 275, 276, 7, 4, 2, 2, 276, 277, 5, 44, 23, 2, 277, 278, 7, 5, 2, 2, 278, 280, 3, 2, 2, 2, 279, 273, 3, 2, 2, 2, 279, 275, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 55, 3, 2, 2, 2, 283, 284, 7, 45, 2, 2, 284, 57, 3, 2, 2, 2, 285, 288, 7, 45, 2, 2, 286, 288, 5, 54, 28, 2, 287, 285, 3, 2, 2, 2, 287, 286, 3, 2, 2, 2, 288, 59, 3, 2, 2, 2, 289, 290, 5, 62, 32, 2, 290, 291, 7, 46, 2, 2, 291, 292, 7, 9, 2, 2, 292, 293, 5, 70, 36, 2, 293, 294, 7, 11, 2, 2, 294, 61, 3, 2, 2, 2, 295, 301, 7, 45, 2, 2, 296, 297, 7, 4, 2, 2, 297, 298, 5, 44, 23, 2, 298, 299, 7, 5, 2, 2, 299, 301, 3, 2, 2, 2, 300, 295, 3, 2, 2, 2, 300, 296, 3, 2, 2, 2, 301, 302, 3, 2, 2, 2, 302, 304, 7, 26, 2, 2, 303, 300, 3, 2, 2, 2, 304, 307, 3, 2, 2, 2, 305, 303, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 63, 3, 2, 2, 2, 307, 305, 3, 2, 2, 2, 308, 311, 7, 45, 2, 2, 309, 311, 5, 54, 28, 2, 310, 308, 3, 2, 2, 2, 310, 309, 3, 2, 2, 2, 311, 317, 3, 2, 2, 2, 312, 315, 7, 10, 2, 2, 313, 316, 7, 45, 2, 2, 314, 316, 5, 54, 28, 2, 315, 313, 3, 2, 2, 2, 315, 314, 3, 2, 2, 2, 316, 318, 3, 2, 2, 2, 317, 312, 3, 2, 2, 2, 318, 319, 3, 2, 2, 2, 319, 317, 3, 2, 2, 2, 319, 320, 3, 2, 2, 2, 320, 321, 3, 2, 2, 2, 321, 322, 7, 19, 2, 2, 322, 323, 5, 60, 31, 2, 323, 65, 3, 2, 2, 2, 324, 325, 7, 27, 2, 2, 325, 326, 7, 46, 2, 2, 326, 327, 7, 9, 2, 2, 327, 328, 5, 68, 35, 2, 328, 329, 7, 11, 2, 2, 329, 330, 7, 23, 2, 2, 330, 331, 5, 6, 4, 2, 331, 332, 7, 24, 2, 2, 332, 67, 3, 2, 2, 2, 333, 338, 7, 45, 2, 2, 334, 335, 7, 10, 2, 2, 335, 337, 7, 45, 2, 2, 336, 334, 3, 2, 2, 2, 337, 340, 3, 2, 2, 2, 338, 336, 3, 2, 2, 2, 338, 339, 3, 2, 2, 2, 339, 342, 3, 2, 2, 2, 340, 338, 3, 2, 2, 2, 341, 333, 3, 2, 2, 2, 341, 342, 3, 2, 2, 2, 342, 69, 3, 2, 2, 2, 343, 348, 5, 44, 23, 2, 344, 345, 7, 10, 2, 2, 345, 347, 5, 44, 23, 2, 346, 344, 3, 2, 2, 2, 347, 350, 3, 2, 2, 2, 348, 346, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 352, 3, 2, 2, 2, 350, 348, 3, 2, 2, 2, 351, 343, 3, 2, 2, 2, 351, 352, 3, 2, 2, 2, 352, 71, 3, 2, 2, 2, 353, 354, 8, 37, 1, 2, 354, 355, 7, 42, 2, 2, 355, 366, 5, 72, 37, 7, 356, 357, 5, 44, 23, 2, 357, 358, 5, 76, 39, 2, 358, 359, 5, 44, 23, 2, 359, 366, 3, 2, 2, 2, 360, 366, 7, 33, 2, 2, 361, 362, 7, 9, 2, 2, 362, 363, 5, 72, 37, 2, 363, 364, 7, 11, 2, 2, 364, 366, 3, 2, 2, 2, 365, 353, 3, 2, 2, 2, 365, 356, 3, 2, 2, 2, 365, 360, 3, 2, 2, 2, 365, 361, 3, 2, 2, 2, 366, 373, 3, 2, 2, 2, 367, 368, 12, 5, 2, 2, 368, 369, 5, 78, 40, 2, 369, 370, 5, 72, 37, 6, 370, 372, 3, 2, 2, 2, 371, 367, 3, 2, 2, 2, 372, 375, 3, 2, 2, 2, 373, 371, 3, 2, 2, 2, 373, 374, 3, 2, 2, 2, 374, 73, 3, 2, 2, 2, 375, 373, 3, 2, 2, 2, 376, 380, 7, 28, 2, 2, 377, 379, 7, 46, 2, 2, 378, 377, 3, 2, 2, 2, 379, 382, 3, 2, 2, 2, 380, 378, 3, 2, 2, 2, 380, 381, 3, 2, 2, 2, 381, 383, 3, 2, 2, 2, 382, 380, 3, 2, 2, 2, 383, 384, 7, 28, 2, 2, 384, 75, 3, 2, 2, 2, 385, 386, 9, 6, 2, 2, 386, 77, 3, 2, 2, 2, 387, 388, 9, 7, 2, 2, 388, 79, 3, 2, 2, 2, 389, 396, 7, 43, 2, 2, 390, 396, 7, 45, 2, 2, 391, 396, 5, 30, 16, 2, 392, 396, 5, 54, 28, 2, 393, 396, 5, 60, 31, 2, 394, 396, 7, 44, 2, 2, 395, 389, 3, 2, 2, 2, 395, 390, 3, 2, 2, 2, 395, 391, 3, 2, 2, 2, 395, 392, 3, 2, 2, 2, 395, 393, 3, 2, 2, 2, 395, 394, 3, 2, 2, 2, 396, 81, 3, 2, 2, 2, 39, 88, 90, 95, 97, 101, 115, 119, 165, 168, 174, 196, 199, 214, 224, 226, 237, 240, 243, 252, 258, 263, 279, 281, 287, 300, 305, 310, 315, 319, 338, 341, 348, 351, 365, 373, 380, 395] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 392, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 7, 4, 92, 10, 4, 12, 4, 14, 4, 95, 11, 4, 3, 5, 3, 5, 6, 5, 99, 10, 5, 13, 5, 14, 5, 100, 3, 6, 3, 6, 5, 6, 105, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 119, 10, 7, 3, 8, 3, 8, 5, 8, 123, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 167, 10, 17, 12, 17, 14, 17, 170, 11, 17, 5, 17, 172, 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 195, 10, 23, 12, 23, 14, 23, 198, 11, 23, 5, 23, 200, 10, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 215, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 225, 10, 24, 12, 24, 14, 24, 228, 11, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 236, 10, 25, 12, 25, 14, 25, 239, 11, 25, 5, 25, 241, 10, 25, 3, 25, 5, 25, 244, 10, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 7, 26, 251, 10, 26, 12, 26, 14, 26, 254, 11, 26, 3, 26, 7, 26, 257, 10, 26, 12, 26, 14, 26, 260, 11, 26, 3, 27, 3, 27, 5, 27, 264, 10, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 6, 29, 280, 10, 29, 13, 29, 14, 29, 281, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 288, 10, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 301, 10, 33, 3, 33, 7, 33, 304, 10, 33, 12, 33, 14, 33, 307, 11, 33, 3, 34, 3, 34, 3, 34, 6, 34, 312, 10, 34, 13, 34, 14, 34, 313, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 7, 36, 331, 10, 36, 12, 36, 14, 36, 334, 11, 36, 5, 36, 336, 10, 36, 3, 37, 3, 37, 3, 37, 7, 37, 341, 10, 37, 12, 37, 14, 37, 344, 11, 37, 5, 37, 346, 10, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 5, 38, 360, 10, 38, 3, 38, 3, 38, 3, 38, 3, 38, 7, 38, 366, 10, 38, 12, 38, 14, 38, 369, 11, 38, 3, 39, 3, 39, 7, 39, 373, 10, 39, 12, 39, 14, 39, 376, 11, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 5, 42, 390, 10, 42, 3, 42, 2, 4, 46, 74, 43, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 401, 2, 84, 3, 2, 2, 2, 4, 87, 3, 2, 2, 2, 6, 93, 3, 2, 2, 2, 8, 98, 3, 2, 2, 2, 10, 104, 3, 2, 2, 2, 12, 118, 3, 2, 2, 2, 14, 122, 3, 2, 2, 2, 16, 124, 3, 2, 2, 2, 18, 130, 3, 2, 2, 2, 20, 140, 3, 2, 2, 2, 22, 146, 3, 2, 2, 2, 24, 153, 3, 2, 2, 2, 26, 156, 3, 2, 2, 2, 28, 158, 3, 2, 2, 2, 30, 160, 3, 2, 2, 2, 32, 162, 3, 2, 2, 2, 34, 175, 3, 2, 2, 2, 36, 179, 3, 2, 2, 2, 38, 184, 3, 2, 2, 2, 40, 186, 3, 2, 2, 2, 42, 188, 3, 2, 2, 2, 44, 190, 3, 2, 2, 2, 46, 214, 3, 2, 2, 2, 48, 229, 3, 2, 2, 2, 50, 252, 3, 2, 2, 2, 52, 263, 3, 2, 2, 2, 54, 265, 3, 2, 2, 2, 56, 272, 3, 2, 2, 2, 58, 283, 3, 2, 2, 2, 60, 287, 3, 2, 2, 2, 62, 289, 3, 2, 2, 2, 64, 305, 3, 2, 2, 2, 66, 308, 3, 2, 2, 2, 68, 318, 3, 2, 2, 2, 70, 335, 3, 2, 2, 2, 72, 345, 3, 2, 2, 2, 74, 359, 3, 2, 2, 2, 76, 370, 3, 2, 2, 2, 78, 379, 3, 2, 2, 2, 80, 381, 3, 2, 2, 2, 82, 389, 3, 2, 2, 2, 84, 85, 5, 4, 3, 2, 85, 86, 7, 2, 2, 3, 86, 3, 3, 2, 2, 2, 87, 88, 5, 6, 4, 2, 88, 89, 5, 8, 5, 2, 89, 5, 3, 2, 2, 2, 90, 92, 5, 10, 6, 2, 91, 90, 3, 2, 2, 2, 92, 95, 3, 2, 2, 2, 93, 91, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 7, 3, 2, 2, 2, 95, 93, 3, 2, 2, 2, 96, 99, 5, 12, 7, 2, 97, 99, 5, 76, 39, 2, 98, 96, 3, 2, 2, 2, 98, 97, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 98, 3, 2, 2, 2, 100, 101, 3, 2, 2, 2, 101, 9, 3, 2, 2, 2, 102, 105, 5, 48, 25, 2, 103, 105, 5, 68, 35, 2, 104, 102, 3, 2, 2, 2, 104, 103, 3, 2, 2, 2, 105, 11, 3, 2, 2, 2, 106, 119, 5, 66, 34, 2, 107, 119, 5, 34, 18, 2, 108, 119, 5, 36, 19, 2, 109, 119, 5, 14, 8, 2, 110, 119, 5, 20, 11, 2, 111, 119, 5, 24, 13, 2, 112, 119, 5, 28, 15, 2, 113, 119, 5, 22, 12, 2, 114, 119, 5, 30, 16, 2, 115, 119, 5, 54, 28, 2, 116, 119, 5, 62, 32, 2, 117, 119, 5, 44, 23, 2, 118, 106, 3, 2, 2, 2, 118, 107, 3, 2, 2, 2, 118, 108, 3, 2, 2, 2, 118, 109, 3, 2, 2, 2, 118, 110, 3, 2, 2, 2, 118, 111, 3, 2, 2, 2, 118, 112, 3, 2, 2, 2, 118, 113, 3, 2, 2, 2, 118, 114, 3, 2, 2, 2, 118, 115, 3, 2, 2, 2, 118, 116, 3, 2, 2, 2, 118, 117, 3, 2, 2, 2, 119, 13, 3, 2, 2, 2, 120, 123, 5, 16, 9, 2, 121, 123, 5, 18, 10, 2, 122, 120, 3, 2, 2, 2, 122, 121, 3, 2, 2, 2, 123, 15, 3, 2, 2, 2, 124, 125, 7, 3, 2, 2, 125, 126, 5, 74, 38, 2, 126, 127, 7, 4, 2, 2, 127, 128, 5, 8, 5, 2, 128, 129, 7, 5, 2, 2, 129, 17, 3, 2, 2, 2, 130, 131, 7, 3, 2, 2, 131, 132, 5, 74, 38, 2, 132, 133, 7, 4, 2, 2, 133, 134, 5, 8, 5, 2, 134, 135, 7, 5, 2, 2, 135, 136, 7, 6, 2, 2, 136, 137, 7, 4, 2, 2, 137, 138, 5, 8, 5, 2, 138, 139, 7, 5, 2, 2, 139, 19, 3, 2, 2, 2, 140, 141, 7, 7, 2, 2, 141, 142, 5, 82, 42, 2, 142, 143, 7, 4, 2, 2, 143, 144, 5, 8, 5, 2, 144, 145, 7, 5, 2, 2, 145, 21, 3, 2, 2, 2, 146, 147, 7, 8, 2, 2, 147, 148, 7, 9, 2, 2, 148, 149, 5, 46, 24, 2, 149, 150, 7, 10, 2, 2, 150, 151, 5, 46, 24, 2, 151, 152, 7, 11, 2, 2, 152, 23, 3, 2, 2, 2, 153, 154, 5, 26, 14, 2, 154, 155, 5, 46, 24, 2, 155, 25, 3, 2, 2, 2, 156, 157, 9, 2, 2, 2, 157, 27, 3, 2, 2, 2, 158, 159, 9, 3, 2, 2, 159, 29, 3, 2, 2, 2, 160, 161, 7, 18, 2, 2, 161, 31, 3, 2, 2, 2, 162, 171, 7, 4, 2, 2, 163, 168, 5, 46, 24, 2, 164, 165, 7, 10, 2, 2, 165, 167, 5, 46, 24, 2, 166, 164, 3, 2, 2, 2, 167, 170, 3, 2, 2, 2, 168, 166, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 172, 3, 2, 2, 2, 170, 168, 3, 2, 2, 2, 171, 163, 3, 2, 2, 2, 171, 172, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 174, 7, 5, 2, 2, 174, 33, 3, 2, 2, 2, 175, 176, 5, 60, 31, 2, 176, 177, 7, 19, 2, 2, 177, 178, 5, 46, 24, 2, 178, 35, 3, 2, 2, 2, 179, 180, 7, 20, 2, 2, 180, 181, 7, 9, 2, 2, 181, 182, 5, 46, 24, 2, 182, 183, 7, 11, 2, 2, 183, 37, 3, 2, 2, 2, 184, 185, 9, 4, 2, 2, 185, 39, 3, 2, 2, 2, 186, 187, 9, 5, 2, 2, 187, 41, 3, 2, 2, 2, 188, 189, 7, 30, 2, 2, 189, 43, 3, 2, 2, 2, 190, 199, 7, 21, 2, 2, 191, 196, 5, 46, 24, 2, 192, 193, 7, 10, 2, 2, 193, 195, 5, 46, 24, 2, 194, 192, 3, 2, 2, 2, 195, 198, 3, 2, 2, 2, 196, 194, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 200, 3, 2, 2, 2, 198, 196, 3, 2, 2, 2, 199, 191, 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, 45, 3, 2, 2, 2, 201, 202, 8, 24, 1, 2, 202, 203, 5, 42, 22, 2, 203, 204, 5, 46, 24, 8, 204, 215, 3, 2, 2, 2, 205, 206, 5, 60, 31, 2, 206, 207, 7, 19, 2, 2, 207, 208, 5, 46, 24, 5, 208, 215, 3, 2, 2, 2, 209, 210, 7, 9, 2, 2, 210, 211, 5, 46, 24, 2, 211, 212, 7, 11, 2, 2, 212, 215, 3, 2, 2, 2, 213, 215, 5, 82, 42, 2, 214, 201, 3, 2, 2, 2, 214, 205, 3, 2, 2, 2, 214, 209, 3, 2, 2, 2, 214, 213, 3, 2, 2, 2, 215, 226, 3, 2, 2, 2, 216, 217, 12, 7, 2, 2, 217, 218, 5, 38, 20, 2, 218, 219, 5, 46, 24, 8, 219, 225, 3, 2, 2, 2, 220, 221, 12, 6, 2, 2, 221, 222, 5, 40, 21, 2, 222, 223, 5, 46, 24, 7, 223, 225, 3, 2, 2, 2, 224, 216, 3, 2, 2, 2, 224, 220, 3, 2, 2, 2, 225, 228, 3, 2, 2, 2, 226, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 47, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 229, 230, 7, 22, 2, 2, 230, 243, 7, 45, 2, 2, 231, 232, 7, 9, 2, 2, 232, 240, 7, 45, 2, 2, 233, 237, 7, 10, 2, 2, 234, 236, 7, 45, 2, 2, 235, 234, 3, 2, 2, 2, 236, 239, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 241, 3, 2, 2, 2, 239, 237, 3, 2, 2, 2, 240, 233, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 244, 7, 11, 2, 2, 243, 231, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 246, 7, 23, 2, 2, 246, 247, 5, 50, 26, 2, 247, 248, 7, 24, 2, 2, 248, 49, 3, 2, 2, 2, 249, 251, 5, 52, 27, 2, 250, 249, 3, 2, 2, 2, 251, 254, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 258, 3, 2, 2, 2, 254, 252, 3, 2, 2, 2, 255, 257, 5, 68, 35, 2, 256, 255, 3, 2, 2, 2, 257, 260, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 258, 259, 3, 2, 2, 2, 259, 51, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 261, 264, 5, 34, 18, 2, 262, 264, 5, 54, 28, 2, 263, 261, 3, 2, 2, 2, 263, 262, 3, 2, 2, 2, 264, 53, 3, 2, 2, 2, 265, 266, 5, 60, 31, 2, 266, 267, 7, 19, 2, 2, 267, 268, 7, 25, 2, 2, 268, 269, 7, 45, 2, 2, 269, 270, 7, 9, 2, 2, 270, 271, 7, 11, 2, 2, 271, 55, 3, 2, 2, 2, 272, 279, 5, 58, 30, 2, 273, 274, 7, 26, 2, 2, 274, 280, 7, 45, 2, 2, 275, 276, 7, 4, 2, 2, 276, 277, 5, 46, 24, 2, 277, 278, 7, 5, 2, 2, 278, 280, 3, 2, 2, 2, 279, 273, 3, 2, 2, 2, 279, 275, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 57, 3, 2, 2, 2, 283, 284, 7, 45, 2, 2, 284, 59, 3, 2, 2, 2, 285, 288, 7, 45, 2, 2, 286, 288, 5, 56, 29, 2, 287, 285, 3, 2, 2, 2, 287, 286, 3, 2, 2, 2, 288, 61, 3, 2, 2, 2, 289, 290, 5, 64, 33, 2, 290, 291, 7, 46, 2, 2, 291, 292, 7, 9, 2, 2, 292, 293, 5, 72, 37, 2, 293, 294, 7, 11, 2, 2, 294, 63, 3, 2, 2, 2, 295, 301, 7, 45, 2, 2, 296, 297, 7, 4, 2, 2, 297, 298, 5, 46, 24, 2, 298, 299, 7, 5, 2, 2, 299, 301, 3, 2, 2, 2, 300, 295, 3, 2, 2, 2, 300, 296, 3, 2, 2, 2, 301, 302, 3, 2, 2, 2, 302, 304, 7, 26, 2, 2, 303, 300, 3, 2, 2, 2, 304, 307, 3, 2, 2, 2, 305, 303, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 65, 3, 2, 2, 2, 307, 305, 3, 2, 2, 2, 308, 311, 5, 60, 31, 2, 309, 310, 7, 10, 2, 2, 310, 312, 5, 60, 31, 2, 311, 309, 3, 2, 2, 2, 312, 313, 3, 2, 2, 2, 313, 311, 3, 2, 2, 2, 313, 314, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 316, 7, 19, 2, 2, 316, 317, 5, 62, 32, 2, 317, 67, 3, 2, 2, 2, 318, 319, 7, 27, 2, 2, 319, 320, 7, 46, 2, 2, 320, 321, 7, 9, 2, 2, 321, 322, 5, 70, 36, 2, 322, 323, 7, 11, 2, 2, 323, 324, 7, 23, 2, 2, 324, 325, 5, 8, 5, 2, 325, 326, 7, 24, 2, 2, 326, 69, 3, 2, 2, 2, 327, 332, 7, 45, 2, 2, 328, 329, 7, 10, 2, 2, 329, 331, 7, 45, 2, 2, 330, 328, 3, 2, 2, 2, 331, 334, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 332, 333, 3, 2, 2, 2, 333, 336, 3, 2, 2, 2, 334, 332, 3, 2, 2, 2, 335, 327, 3, 2, 2, 2, 335, 336, 3, 2, 2, 2, 336, 71, 3, 2, 2, 2, 337, 342, 5, 46, 24, 2, 338, 339, 7, 10, 2, 2, 339, 341, 5, 46, 24, 2, 340, 338, 3, 2, 2, 2, 341, 344, 3, 2, 2, 2, 342, 340, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 346, 3, 2, 2, 2, 344, 342, 3, 2, 2, 2, 345, 337, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 73, 3, 2, 2, 2, 347, 348, 8, 38, 1, 2, 348, 349, 7, 42, 2, 2, 349, 360, 5, 74, 38, 7, 350, 351, 5, 46, 24, 2, 351, 352, 5, 78, 40, 2, 352, 353, 5, 46, 24, 2, 353, 360, 3, 2, 2, 2, 354, 360, 7, 33, 2, 2, 355, 356, 7, 9, 2, 2, 356, 357, 5, 74, 38, 2, 357, 358, 7, 11, 2, 2, 358, 360, 3, 2, 2, 2, 359, 347, 3, 2, 2, 2, 359, 350, 3, 2, 2, 2, 359, 354, 3, 2, 2, 2, 359, 355, 3, 2, 2, 2, 360, 367, 3, 2, 2, 2, 361, 362, 12, 5, 2, 2, 362, 363, 5, 80, 41, 2, 363, 364, 5, 74, 38, 6, 364, 366, 3, 2, 2, 2, 365, 361, 3, 2, 2, 2, 366, 369, 3, 2, 2, 2, 367, 365, 3, 2, 2, 2, 367, 368, 3, 2, 2, 2, 368, 75, 3, 2, 2, 2, 369, 367, 3, 2, 2, 2, 370, 374, 7, 28, 2, 2, 371, 373, 7, 46, 2, 2, 372, 371, 3, 2, 2, 2, 373, 376, 3, 2, 2, 2, 374, 372, 3, 2, 2, 2, 374, 375, 3, 2, 2, 2, 375, 377, 3, 2, 2, 2, 376, 374, 3, 2, 2, 2, 377, 378, 7, 28, 2, 2, 378, 77, 3, 2, 2, 2, 379, 380, 9, 6, 2, 2, 380, 79, 3, 2, 2, 2, 381, 382, 9, 7, 2, 2, 382, 81, 3, 2, 2, 2, 383, 390, 7, 43, 2, 2, 384, 390, 7, 45, 2, 2, 385, 390, 5, 32, 17, 2, 386, 390, 5, 56, 29, 2, 387, 390, 5, 62, 32, 2, 388, 390, 7, 44, 2, 2, 389, 383, 3, 2, 2, 2, 389, 384, 3, 2, 2, 2, 389, 385, 3, 2, 2, 2, 389, 386, 3, 2, 2, 2, 389, 387, 3, 2, 2, 2, 389, 388, 3, 2, 2, 2, 390, 83, 3, 2, 2, 2, 35, 93, 98, 100, 104, 118, 122, 168, 171, 196, 199, 214, 224, 226, 237, 240, 243, 252, 258, 263, 279, 281, 287, 300, 305, 313, 332, 335, 342, 345, 359, 367, 374, 389] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index 6d11687..bf384cd 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -9,107 +9,105 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3/") - buf.write("\u018e\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\u0188\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36") buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t") - buf.write("&\4\'\t\'\4(\t(\4)\t)\3\2\3\2\3\2\3\3\3\3\3\3\7\3Y\n\3") - buf.write("\f\3\16\3\\\13\3\3\4\3\4\6\4`\n\4\r\4\16\4a\3\5\3\5\5") - buf.write("\5f\n\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3") - buf.write("\6\5\6t\n\6\3\7\3\7\5\7x\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3") - buf.write("\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n") - buf.write("\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3") - buf.write("\f\3\r\3\r\3\16\3\16\3\17\3\17\3\20\3\20\3\20\3\20\7\20") - buf.write("\u00a4\n\20\f\20\16\20\u00a7\13\20\5\20\u00a9\n\20\3\20") - buf.write("\3\20\3\21\3\21\5\21\u00af\n\21\3\21\3\21\3\21\3\22\3") - buf.write("\22\3\22\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\26") - buf.write("\3\26\3\26\3\26\7\26\u00c3\n\26\f\26\16\26\u00c6\13\26") - buf.write("\5\26\u00c8\n\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3") - buf.write("\27\3\27\3\27\3\27\3\27\3\27\5\27\u00d7\n\27\3\27\3\27") - buf.write("\3\27\3\27\3\27\3\27\3\27\3\27\7\27\u00e1\n\27\f\27\16") - buf.write("\27\u00e4\13\27\3\30\3\30\3\30\3\30\3\30\3\30\7\30\u00ec") - buf.write("\n\30\f\30\16\30\u00ef\13\30\5\30\u00f1\n\30\3\30\5\30") - buf.write("\u00f4\n\30\3\30\3\30\3\30\3\30\3\31\7\31\u00fb\n\31\f") - buf.write("\31\16\31\u00fe\13\31\3\31\7\31\u0101\n\31\f\31\16\31") - buf.write("\u0104\13\31\3\32\3\32\5\32\u0108\n\32\3\33\3\33\3\33") - buf.write("\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34\3\34\3\34\3\34") - buf.write("\6\34\u0118\n\34\r\34\16\34\u0119\3\35\3\35\3\36\3\36") - buf.write("\5\36\u0120\n\36\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3") - buf.write(" \3 \3 \5 \u012d\n \3 \7 \u0130\n \f \16 \u0133\13 \3") - buf.write("!\3!\5!\u0137\n!\3!\3!\3!\5!\u013c\n!\6!\u013e\n!\r!\16") - buf.write("!\u013f\3!\3!\3!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3") - buf.write("#\3#\3#\7#\u0151\n#\f#\16#\u0154\13#\5#\u0156\n#\3$\3") - buf.write("$\3$\7$\u015b\n$\f$\16$\u015e\13$\5$\u0160\n$\3%\3%\3") - buf.write("%\3%\3%\3%\3%\3%\3%\3%\3%\3%\5%\u016e\n%\3%\3%\3%\3%\7") - buf.write("%\u0174\n%\f%\16%\u0177\13%\3&\3&\7&\u017b\n&\f&\16&\u017e") - buf.write("\13&\3&\3&\3\'\3\'\3(\3(\3)\3)\3)\3)\3)\3)\5)\u018c\n") - buf.write(")\3)\2\4,H*\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"") - buf.write("$&(*,.\60\62\64\668:<>@BDFHJLNP\2\b\3\2\f\17\3\2\20\21") - buf.write("\3\2\37 \3\2\35\36\3\2\"\'\3\2()\2\u019d\2R\3\2\2\2\4") - buf.write("Z\3\2\2\2\6_\3\2\2\2\be\3\2\2\2\ns\3\2\2\2\fw\3\2\2\2") - buf.write("\16y\3\2\2\2\20\177\3\2\2\2\22\u0089\3\2\2\2\24\u008f") - buf.write("\3\2\2\2\26\u0096\3\2\2\2\30\u0099\3\2\2\2\32\u009b\3") - buf.write("\2\2\2\34\u009d\3\2\2\2\36\u009f\3\2\2\2 \u00ae\3\2\2") - buf.write("\2\"\u00b3\3\2\2\2$\u00b8\3\2\2\2&\u00ba\3\2\2\2(\u00bc") - buf.write("\3\2\2\2*\u00be\3\2\2\2,\u00d6\3\2\2\2.\u00e5\3\2\2\2") - buf.write("\60\u00fc\3\2\2\2\62\u0107\3\2\2\2\64\u0109\3\2\2\2\66") - buf.write("\u0110\3\2\2\28\u011b\3\2\2\2:\u011f\3\2\2\2<\u0121\3") - buf.write("\2\2\2>\u0131\3\2\2\2@\u0136\3\2\2\2B\u0144\3\2\2\2D\u0155") - buf.write("\3\2\2\2F\u015f\3\2\2\2H\u016d\3\2\2\2J\u0178\3\2\2\2") - buf.write("L\u0181\3\2\2\2N\u0183\3\2\2\2P\u018b\3\2\2\2RS\5\4\3") - buf.write("\2ST\7\2\2\3T\3\3\2\2\2UY\5\n\6\2VY\5\b\5\2WY\5J&\2XU") - buf.write("\3\2\2\2XV\3\2\2\2XW\3\2\2\2Y\\\3\2\2\2ZX\3\2\2\2Z[\3") - buf.write("\2\2\2[\5\3\2\2\2\\Z\3\2\2\2]`\5\n\6\2^`\5J&\2_]\3\2\2") - buf.write("\2_^\3\2\2\2`a\3\2\2\2a_\3\2\2\2ab\3\2\2\2b\7\3\2\2\2") - buf.write("cf\5.\30\2df\5B\"\2ec\3\2\2\2ed\3\2\2\2f\t\3\2\2\2gt\5") - buf.write("@!\2ht\5 \21\2it\5\"\22\2jt\5\f\7\2kt\5\22\n\2lt\5\26") - buf.write("\f\2mt\5\32\16\2nt\5\24\13\2ot\5\34\17\2pt\5\64\33\2q") - buf.write("t\5<\37\2rt\5*\26\2sg\3\2\2\2sh\3\2\2\2si\3\2\2\2sj\3") - buf.write("\2\2\2sk\3\2\2\2sl\3\2\2\2sm\3\2\2\2sn\3\2\2\2so\3\2\2") - buf.write("\2sp\3\2\2\2sq\3\2\2\2sr\3\2\2\2t\13\3\2\2\2ux\5\16\b") - buf.write("\2vx\5\20\t\2wu\3\2\2\2wv\3\2\2\2x\r\3\2\2\2yz\7\3\2\2") - buf.write("z{\5H%\2{|\7\4\2\2|}\5\6\4\2}~\7\5\2\2~\17\3\2\2\2\177") - buf.write("\u0080\7\3\2\2\u0080\u0081\5H%\2\u0081\u0082\7\4\2\2\u0082") - buf.write("\u0083\5\6\4\2\u0083\u0084\7\5\2\2\u0084\u0085\7\6\2\2") - buf.write("\u0085\u0086\7\4\2\2\u0086\u0087\5\6\4\2\u0087\u0088\7") - buf.write("\5\2\2\u0088\21\3\2\2\2\u0089\u008a\7\7\2\2\u008a\u008b") - buf.write("\5P)\2\u008b\u008c\7\4\2\2\u008c\u008d\5\6\4\2\u008d\u008e") - buf.write("\7\5\2\2\u008e\23\3\2\2\2\u008f\u0090\7\b\2\2\u0090\u0091") - buf.write("\7\t\2\2\u0091\u0092\5,\27\2\u0092\u0093\7\n\2\2\u0093") - buf.write("\u0094\5,\27\2\u0094\u0095\7\13\2\2\u0095\25\3\2\2\2\u0096") - buf.write("\u0097\5\30\r\2\u0097\u0098\5,\27\2\u0098\27\3\2\2\2\u0099") - buf.write("\u009a\t\2\2\2\u009a\31\3\2\2\2\u009b\u009c\t\3\2\2\u009c") - buf.write("\33\3\2\2\2\u009d\u009e\7\22\2\2\u009e\35\3\2\2\2\u009f") - buf.write("\u00a8\7\4\2\2\u00a0\u00a5\5,\27\2\u00a1\u00a2\7\n\2\2") - buf.write("\u00a2\u00a4\5,\27\2\u00a3\u00a1\3\2\2\2\u00a4\u00a7\3") - buf.write("\2\2\2\u00a5\u00a3\3\2\2\2\u00a5\u00a6\3\2\2\2\u00a6\u00a9") - buf.write("\3\2\2\2\u00a7\u00a5\3\2\2\2\u00a8\u00a0\3\2\2\2\u00a8") - buf.write("\u00a9\3\2\2\2\u00a9\u00aa\3\2\2\2\u00aa\u00ab\7\5\2\2") - buf.write("\u00ab\37\3\2\2\2\u00ac\u00af\7-\2\2\u00ad\u00af\5\66") - buf.write("\34\2\u00ae\u00ac\3\2\2\2\u00ae\u00ad\3\2\2\2\u00af\u00b0") - buf.write("\3\2\2\2\u00b0\u00b1\7\23\2\2\u00b1\u00b2\5,\27\2\u00b2") - buf.write("!\3\2\2\2\u00b3\u00b4\7\24\2\2\u00b4\u00b5\7\t\2\2\u00b5") - buf.write("\u00b6\5,\27\2\u00b6\u00b7\7\13\2\2\u00b7#\3\2\2\2\u00b8") - buf.write("\u00b9\t\4\2\2\u00b9%\3\2\2\2\u00ba\u00bb\t\5\2\2\u00bb") - buf.write("\'\3\2\2\2\u00bc\u00bd\7\36\2\2\u00bd)\3\2\2\2\u00be\u00c7") - buf.write("\7\25\2\2\u00bf\u00c4\5,\27\2\u00c0\u00c1\7\n\2\2\u00c1") - buf.write("\u00c3\5,\27\2\u00c2\u00c0\3\2\2\2\u00c3\u00c6\3\2\2\2") + buf.write("&\4\'\t\'\4(\t(\4)\t)\4*\t*\3\2\3\2\3\2\3\3\3\3\3\3\3") + buf.write("\4\7\4\\\n\4\f\4\16\4_\13\4\3\5\3\5\6\5c\n\5\r\5\16\5") + buf.write("d\3\6\3\6\5\6i\n\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7") + buf.write("\3\7\3\7\3\7\5\7w\n\7\3\b\3\b\5\b{\n\b\3\t\3\t\3\t\3\t") + buf.write("\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13") + buf.write("\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f") + buf.write("\3\r\3\r\3\r\3\16\3\16\3\17\3\17\3\20\3\20\3\21\3\21\3") + buf.write("\21\3\21\7\21\u00a7\n\21\f\21\16\21\u00aa\13\21\5\21\u00ac") + buf.write("\n\21\3\21\3\21\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23") + buf.write("\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\27\3\27") + buf.write("\7\27\u00c3\n\27\f\27\16\27\u00c6\13\27\5\27\u00c8\n\27") + buf.write("\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30") + buf.write("\3\30\3\30\5\30\u00d7\n\30\3\30\3\30\3\30\3\30\3\30\3") + buf.write("\30\3\30\3\30\7\30\u00e1\n\30\f\30\16\30\u00e4\13\30\3") + buf.write("\31\3\31\3\31\3\31\3\31\3\31\7\31\u00ec\n\31\f\31\16\31") + buf.write("\u00ef\13\31\5\31\u00f1\n\31\3\31\5\31\u00f4\n\31\3\31") + buf.write("\3\31\3\31\3\31\3\32\7\32\u00fb\n\32\f\32\16\32\u00fe") + buf.write("\13\32\3\32\7\32\u0101\n\32\f\32\16\32\u0104\13\32\3\33") + buf.write("\3\33\5\33\u0108\n\33\3\34\3\34\3\34\3\34\3\34\3\34\3") + buf.write("\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\6\35\u0118\n\35") + buf.write("\r\35\16\35\u0119\3\36\3\36\3\37\3\37\5\37\u0120\n\37") + buf.write("\3 \3 \3 \3 \3 \3 \3!\3!\3!\3!\3!\5!\u012d\n!\3!\7!\u0130") + buf.write("\n!\f!\16!\u0133\13!\3\"\3\"\3\"\6\"\u0138\n\"\r\"\16") + buf.write("\"\u0139\3\"\3\"\3\"\3#\3#\3#\3#\3#\3#\3#\3#\3#\3$\3$") + buf.write("\3$\7$\u014b\n$\f$\16$\u014e\13$\5$\u0150\n$\3%\3%\3%") + buf.write("\7%\u0155\n%\f%\16%\u0158\13%\5%\u015a\n%\3&\3&\3&\3&") + buf.write("\3&\3&\3&\3&\3&\3&\3&\3&\5&\u0168\n&\3&\3&\3&\3&\7&\u016e") + buf.write("\n&\f&\16&\u0171\13&\3\'\3\'\7\'\u0175\n\'\f\'\16\'\u0178") + buf.write("\13\'\3\'\3\'\3(\3(\3)\3)\3*\3*\3*\3*\3*\3*\5*\u0186\n") + buf.write("*\3*\2\4.J+\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"") + buf.write("$&(*,.\60\62\64\668:<>@BDFHJLNPR\2\b\3\2\f\17\3\2\20\21") + buf.write("\3\2\37 \3\2\35\36\3\2\"\'\3\2()\2\u0191\2T\3\2\2\2\4") + buf.write("W\3\2\2\2\6]\3\2\2\2\bb\3\2\2\2\nh\3\2\2\2\fv\3\2\2\2") + buf.write("\16z\3\2\2\2\20|\3\2\2\2\22\u0082\3\2\2\2\24\u008c\3\2") + buf.write("\2\2\26\u0092\3\2\2\2\30\u0099\3\2\2\2\32\u009c\3\2\2") + buf.write("\2\34\u009e\3\2\2\2\36\u00a0\3\2\2\2 \u00a2\3\2\2\2\"") + buf.write("\u00af\3\2\2\2$\u00b3\3\2\2\2&\u00b8\3\2\2\2(\u00ba\3") + buf.write("\2\2\2*\u00bc\3\2\2\2,\u00be\3\2\2\2.\u00d6\3\2\2\2\60") + buf.write("\u00e5\3\2\2\2\62\u00fc\3\2\2\2\64\u0107\3\2\2\2\66\u0109") + buf.write("\3\2\2\28\u0110\3\2\2\2:\u011b\3\2\2\2<\u011f\3\2\2\2") + buf.write(">\u0121\3\2\2\2@\u0131\3\2\2\2B\u0134\3\2\2\2D\u013e\3") + buf.write("\2\2\2F\u014f\3\2\2\2H\u0159\3\2\2\2J\u0167\3\2\2\2L\u0172") + buf.write("\3\2\2\2N\u017b\3\2\2\2P\u017d\3\2\2\2R\u0185\3\2\2\2") + buf.write("TU\5\4\3\2UV\7\2\2\3V\3\3\2\2\2WX\5\6\4\2XY\5\b\5\2Y\5") + buf.write("\3\2\2\2Z\\\5\n\6\2[Z\3\2\2\2\\_\3\2\2\2][\3\2\2\2]^\3") + buf.write("\2\2\2^\7\3\2\2\2_]\3\2\2\2`c\5\f\7\2ac\5L\'\2b`\3\2\2") + buf.write("\2ba\3\2\2\2cd\3\2\2\2db\3\2\2\2de\3\2\2\2e\t\3\2\2\2") + buf.write("fi\5\60\31\2gi\5D#\2hf\3\2\2\2hg\3\2\2\2i\13\3\2\2\2j") + buf.write("w\5B\"\2kw\5\"\22\2lw\5$\23\2mw\5\16\b\2nw\5\24\13\2o") + buf.write("w\5\30\r\2pw\5\34\17\2qw\5\26\f\2rw\5\36\20\2sw\5\66\34") + buf.write("\2tw\5> \2uw\5,\27\2vj\3\2\2\2vk\3\2\2\2vl\3\2\2\2vm\3") + buf.write("\2\2\2vn\3\2\2\2vo\3\2\2\2vp\3\2\2\2vq\3\2\2\2vr\3\2\2") + buf.write("\2vs\3\2\2\2vt\3\2\2\2vu\3\2\2\2w\r\3\2\2\2x{\5\20\t\2") + buf.write("y{\5\22\n\2zx\3\2\2\2zy\3\2\2\2{\17\3\2\2\2|}\7\3\2\2") + buf.write("}~\5J&\2~\177\7\4\2\2\177\u0080\5\b\5\2\u0080\u0081\7") + buf.write("\5\2\2\u0081\21\3\2\2\2\u0082\u0083\7\3\2\2\u0083\u0084") + buf.write("\5J&\2\u0084\u0085\7\4\2\2\u0085\u0086\5\b\5\2\u0086\u0087") + buf.write("\7\5\2\2\u0087\u0088\7\6\2\2\u0088\u0089\7\4\2\2\u0089") + buf.write("\u008a\5\b\5\2\u008a\u008b\7\5\2\2\u008b\23\3\2\2\2\u008c") + buf.write("\u008d\7\7\2\2\u008d\u008e\5R*\2\u008e\u008f\7\4\2\2\u008f") + buf.write("\u0090\5\b\5\2\u0090\u0091\7\5\2\2\u0091\25\3\2\2\2\u0092") + buf.write("\u0093\7\b\2\2\u0093\u0094\7\t\2\2\u0094\u0095\5.\30\2") + buf.write("\u0095\u0096\7\n\2\2\u0096\u0097\5.\30\2\u0097\u0098\7") + buf.write("\13\2\2\u0098\27\3\2\2\2\u0099\u009a\5\32\16\2\u009a\u009b") + buf.write("\5.\30\2\u009b\31\3\2\2\2\u009c\u009d\t\2\2\2\u009d\33") + buf.write("\3\2\2\2\u009e\u009f\t\3\2\2\u009f\35\3\2\2\2\u00a0\u00a1") + buf.write("\7\22\2\2\u00a1\37\3\2\2\2\u00a2\u00ab\7\4\2\2\u00a3\u00a8") + buf.write("\5.\30\2\u00a4\u00a5\7\n\2\2\u00a5\u00a7\5.\30\2\u00a6") + buf.write("\u00a4\3\2\2\2\u00a7\u00aa\3\2\2\2\u00a8\u00a6\3\2\2\2") + buf.write("\u00a8\u00a9\3\2\2\2\u00a9\u00ac\3\2\2\2\u00aa\u00a8\3") + buf.write("\2\2\2\u00ab\u00a3\3\2\2\2\u00ab\u00ac\3\2\2\2\u00ac\u00ad") + buf.write("\3\2\2\2\u00ad\u00ae\7\5\2\2\u00ae!\3\2\2\2\u00af\u00b0") + buf.write("\5<\37\2\u00b0\u00b1\7\23\2\2\u00b1\u00b2\5.\30\2\u00b2") + buf.write("#\3\2\2\2\u00b3\u00b4\7\24\2\2\u00b4\u00b5\7\t\2\2\u00b5") + buf.write("\u00b6\5.\30\2\u00b6\u00b7\7\13\2\2\u00b7%\3\2\2\2\u00b8") + buf.write("\u00b9\t\4\2\2\u00b9\'\3\2\2\2\u00ba\u00bb\t\5\2\2\u00bb") + buf.write(")\3\2\2\2\u00bc\u00bd\7\36\2\2\u00bd+\3\2\2\2\u00be\u00c7") + buf.write("\7\25\2\2\u00bf\u00c4\5.\30\2\u00c0\u00c1\7\n\2\2\u00c1") + buf.write("\u00c3\5.\30\2\u00c2\u00c0\3\2\2\2\u00c3\u00c6\3\2\2\2") buf.write("\u00c4\u00c2\3\2\2\2\u00c4\u00c5\3\2\2\2\u00c5\u00c8\3") buf.write("\2\2\2\u00c6\u00c4\3\2\2\2\u00c7\u00bf\3\2\2\2\u00c7\u00c8") - buf.write("\3\2\2\2\u00c8+\3\2\2\2\u00c9\u00ca\b\27\1\2\u00ca\u00cb") - buf.write("\5(\25\2\u00cb\u00cc\5,\27\b\u00cc\u00d7\3\2\2\2\u00cd") - buf.write("\u00ce\5:\36\2\u00ce\u00cf\7\23\2\2\u00cf\u00d0\5,\27") + buf.write("\3\2\2\2\u00c8-\3\2\2\2\u00c9\u00ca\b\30\1\2\u00ca\u00cb") + buf.write("\5*\26\2\u00cb\u00cc\5.\30\b\u00cc\u00d7\3\2\2\2\u00cd") + buf.write("\u00ce\5<\37\2\u00ce\u00cf\7\23\2\2\u00cf\u00d0\5.\30") buf.write("\5\u00d0\u00d7\3\2\2\2\u00d1\u00d2\7\t\2\2\u00d2\u00d3") - buf.write("\5,\27\2\u00d3\u00d4\7\13\2\2\u00d4\u00d7\3\2\2\2\u00d5") - buf.write("\u00d7\5P)\2\u00d6\u00c9\3\2\2\2\u00d6\u00cd\3\2\2\2\u00d6") + buf.write("\5.\30\2\u00d3\u00d4\7\13\2\2\u00d4\u00d7\3\2\2\2\u00d5") + buf.write("\u00d7\5R*\2\u00d6\u00c9\3\2\2\2\u00d6\u00cd\3\2\2\2\u00d6") buf.write("\u00d1\3\2\2\2\u00d6\u00d5\3\2\2\2\u00d7\u00e2\3\2\2\2") - buf.write("\u00d8\u00d9\f\7\2\2\u00d9\u00da\5$\23\2\u00da\u00db\5") - buf.write(",\27\b\u00db\u00e1\3\2\2\2\u00dc\u00dd\f\6\2\2\u00dd\u00de") - buf.write("\5&\24\2\u00de\u00df\5,\27\7\u00df\u00e1\3\2\2\2\u00e0") + buf.write("\u00d8\u00d9\f\7\2\2\u00d9\u00da\5&\24\2\u00da\u00db\5") + buf.write(".\30\b\u00db\u00e1\3\2\2\2\u00dc\u00dd\f\6\2\2\u00dd\u00de") + buf.write("\5(\25\2\u00de\u00df\5.\30\7\u00df\u00e1\3\2\2\2\u00e0") buf.write("\u00d8\3\2\2\2\u00e0\u00dc\3\2\2\2\u00e1\u00e4\3\2\2\2") - buf.write("\u00e2\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3-\3\2\2") + buf.write("\u00e2\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3/\3\2\2") buf.write("\2\u00e4\u00e2\3\2\2\2\u00e5\u00e6\7\26\2\2\u00e6\u00f3") buf.write("\7-\2\2\u00e7\u00e8\7\t\2\2\u00e8\u00f0\7-\2\2\u00e9\u00ed") buf.write("\7\n\2\2\u00ea\u00ec\7-\2\2\u00eb\u00ea\3\2\2\2\u00ec") @@ -117,74 +115,70 @@ def serializedATN(): buf.write("\u00ee\u00f1\3\2\2\2\u00ef\u00ed\3\2\2\2\u00f0\u00e9\3") buf.write("\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f2\3\2\2\2\u00f2\u00f4") buf.write("\7\13\2\2\u00f3\u00e7\3\2\2\2\u00f3\u00f4\3\2\2\2\u00f4") - buf.write("\u00f5\3\2\2\2\u00f5\u00f6\7\27\2\2\u00f6\u00f7\5\60\31") - buf.write("\2\u00f7\u00f8\7\30\2\2\u00f8/\3\2\2\2\u00f9\u00fb\5\62") - buf.write("\32\2\u00fa\u00f9\3\2\2\2\u00fb\u00fe\3\2\2\2\u00fc\u00fa") - buf.write("\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\u0102\3\2\2\2\u00fe") - buf.write("\u00fc\3\2\2\2\u00ff\u0101\5B\"\2\u0100\u00ff\3\2\2\2") - buf.write("\u0101\u0104\3\2\2\2\u0102\u0100\3\2\2\2\u0102\u0103\3") - buf.write("\2\2\2\u0103\61\3\2\2\2\u0104\u0102\3\2\2\2\u0105\u0108") - buf.write("\5 \21\2\u0106\u0108\5\64\33\2\u0107\u0105\3\2\2\2\u0107") - buf.write("\u0106\3\2\2\2\u0108\63\3\2\2\2\u0109\u010a\5:\36\2\u010a") + buf.write("\u00f5\3\2\2\2\u00f5\u00f6\7\27\2\2\u00f6\u00f7\5\62\32") + buf.write("\2\u00f7\u00f8\7\30\2\2\u00f8\61\3\2\2\2\u00f9\u00fb\5") + buf.write("\64\33\2\u00fa\u00f9\3\2\2\2\u00fb\u00fe\3\2\2\2\u00fc") + buf.write("\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\u0102\3\2\2\2") + buf.write("\u00fe\u00fc\3\2\2\2\u00ff\u0101\5D#\2\u0100\u00ff\3\2") + buf.write("\2\2\u0101\u0104\3\2\2\2\u0102\u0100\3\2\2\2\u0102\u0103") + buf.write("\3\2\2\2\u0103\63\3\2\2\2\u0104\u0102\3\2\2\2\u0105\u0108") + buf.write("\5\"\22\2\u0106\u0108\5\66\34\2\u0107\u0105\3\2\2\2\u0107") + buf.write("\u0106\3\2\2\2\u0108\65\3\2\2\2\u0109\u010a\5<\37\2\u010a") buf.write("\u010b\7\23\2\2\u010b\u010c\7\31\2\2\u010c\u010d\7-\2") - buf.write("\2\u010d\u010e\7\t\2\2\u010e\u010f\7\13\2\2\u010f\65\3") - buf.write("\2\2\2\u0110\u0117\58\35\2\u0111\u0112\7\32\2\2\u0112") - buf.write("\u0118\7-\2\2\u0113\u0114\7\4\2\2\u0114\u0115\5,\27\2") + buf.write("\2\u010d\u010e\7\t\2\2\u010e\u010f\7\13\2\2\u010f\67\3") + buf.write("\2\2\2\u0110\u0117\5:\36\2\u0111\u0112\7\32\2\2\u0112") + buf.write("\u0118\7-\2\2\u0113\u0114\7\4\2\2\u0114\u0115\5.\30\2") buf.write("\u0115\u0116\7\5\2\2\u0116\u0118\3\2\2\2\u0117\u0111\3") buf.write("\2\2\2\u0117\u0113\3\2\2\2\u0118\u0119\3\2\2\2\u0119\u0117") - buf.write("\3\2\2\2\u0119\u011a\3\2\2\2\u011a\67\3\2\2\2\u011b\u011c") - buf.write("\7-\2\2\u011c9\3\2\2\2\u011d\u0120\7-\2\2\u011e\u0120") - buf.write("\5\66\34\2\u011f\u011d\3\2\2\2\u011f\u011e\3\2\2\2\u0120") - buf.write(";\3\2\2\2\u0121\u0122\5> \2\u0122\u0123\7.\2\2\u0123\u0124") - buf.write("\7\t\2\2\u0124\u0125\5F$\2\u0125\u0126\7\13\2\2\u0126") - buf.write("=\3\2\2\2\u0127\u012d\7-\2\2\u0128\u0129\7\4\2\2\u0129") - buf.write("\u012a\5,\27\2\u012a\u012b\7\5\2\2\u012b\u012d\3\2\2\2") + buf.write("\3\2\2\2\u0119\u011a\3\2\2\2\u011a9\3\2\2\2\u011b\u011c") + buf.write("\7-\2\2\u011c;\3\2\2\2\u011d\u0120\7-\2\2\u011e\u0120") + buf.write("\58\35\2\u011f\u011d\3\2\2\2\u011f\u011e\3\2\2\2\u0120") + buf.write("=\3\2\2\2\u0121\u0122\5@!\2\u0122\u0123\7.\2\2\u0123\u0124") + buf.write("\7\t\2\2\u0124\u0125\5H%\2\u0125\u0126\7\13\2\2\u0126") + buf.write("?\3\2\2\2\u0127\u012d\7-\2\2\u0128\u0129\7\4\2\2\u0129") + buf.write("\u012a\5.\30\2\u012a\u012b\7\5\2\2\u012b\u012d\3\2\2\2") buf.write("\u012c\u0127\3\2\2\2\u012c\u0128\3\2\2\2\u012d\u012e\3") buf.write("\2\2\2\u012e\u0130\7\32\2\2\u012f\u012c\3\2\2\2\u0130") buf.write("\u0133\3\2\2\2\u0131\u012f\3\2\2\2\u0131\u0132\3\2\2\2") - buf.write("\u0132?\3\2\2\2\u0133\u0131\3\2\2\2\u0134\u0137\7-\2\2") - buf.write("\u0135\u0137\5\66\34\2\u0136\u0134\3\2\2\2\u0136\u0135") - buf.write("\3\2\2\2\u0137\u013d\3\2\2\2\u0138\u013b\7\n\2\2\u0139") - buf.write("\u013c\7-\2\2\u013a\u013c\5\66\34\2\u013b\u0139\3\2\2") - buf.write("\2\u013b\u013a\3\2\2\2\u013c\u013e\3\2\2\2\u013d\u0138") - buf.write("\3\2\2\2\u013e\u013f\3\2\2\2\u013f\u013d\3\2\2\2\u013f") - buf.write("\u0140\3\2\2\2\u0140\u0141\3\2\2\2\u0141\u0142\7\23\2") - buf.write("\2\u0142\u0143\5<\37\2\u0143A\3\2\2\2\u0144\u0145\7\33") - buf.write("\2\2\u0145\u0146\7.\2\2\u0146\u0147\7\t\2\2\u0147\u0148") - buf.write("\5D#\2\u0148\u0149\7\13\2\2\u0149\u014a\7\27\2\2\u014a") - buf.write("\u014b\5\6\4\2\u014b\u014c\7\30\2\2\u014cC\3\2\2\2\u014d") - buf.write("\u0152\7-\2\2\u014e\u014f\7\n\2\2\u014f\u0151\7-\2\2\u0150") - buf.write("\u014e\3\2\2\2\u0151\u0154\3\2\2\2\u0152\u0150\3\2\2\2") - buf.write("\u0152\u0153\3\2\2\2\u0153\u0156\3\2\2\2\u0154\u0152\3") - buf.write("\2\2\2\u0155\u014d\3\2\2\2\u0155\u0156\3\2\2\2\u0156E") - buf.write("\3\2\2\2\u0157\u015c\5,\27\2\u0158\u0159\7\n\2\2\u0159") - buf.write("\u015b\5,\27\2\u015a\u0158\3\2\2\2\u015b\u015e\3\2\2\2") - buf.write("\u015c\u015a\3\2\2\2\u015c\u015d\3\2\2\2\u015d\u0160\3") - buf.write("\2\2\2\u015e\u015c\3\2\2\2\u015f\u0157\3\2\2\2\u015f\u0160") - buf.write("\3\2\2\2\u0160G\3\2\2\2\u0161\u0162\b%\1\2\u0162\u0163") - buf.write("\7*\2\2\u0163\u016e\5H%\7\u0164\u0165\5,\27\2\u0165\u0166") - buf.write("\5L\'\2\u0166\u0167\5,\27\2\u0167\u016e\3\2\2\2\u0168") - buf.write("\u016e\7!\2\2\u0169\u016a\7\t\2\2\u016a\u016b\5H%\2\u016b") - buf.write("\u016c\7\13\2\2\u016c\u016e\3\2\2\2\u016d\u0161\3\2\2") - buf.write("\2\u016d\u0164\3\2\2\2\u016d\u0168\3\2\2\2\u016d\u0169") - buf.write("\3\2\2\2\u016e\u0175\3\2\2\2\u016f\u0170\f\5\2\2\u0170") - buf.write("\u0171\5N(\2\u0171\u0172\5H%\6\u0172\u0174\3\2\2\2\u0173") - buf.write("\u016f\3\2\2\2\u0174\u0177\3\2\2\2\u0175\u0173\3\2\2\2") - buf.write("\u0175\u0176\3\2\2\2\u0176I\3\2\2\2\u0177\u0175\3\2\2") - buf.write("\2\u0178\u017c\7\34\2\2\u0179\u017b\7.\2\2\u017a\u0179") - buf.write("\3\2\2\2\u017b\u017e\3\2\2\2\u017c\u017a\3\2\2\2\u017c") - buf.write("\u017d\3\2\2\2\u017d\u017f\3\2\2\2\u017e\u017c\3\2\2\2") - buf.write("\u017f\u0180\7\34\2\2\u0180K\3\2\2\2\u0181\u0182\t\6\2") - buf.write("\2\u0182M\3\2\2\2\u0183\u0184\t\7\2\2\u0184O\3\2\2\2\u0185") - buf.write("\u018c\7+\2\2\u0186\u018c\7-\2\2\u0187\u018c\5\36\20\2") - buf.write("\u0188\u018c\5\66\34\2\u0189\u018c\5<\37\2\u018a\u018c") - buf.write("\7,\2\2\u018b\u0185\3\2\2\2\u018b\u0186\3\2\2\2\u018b") - buf.write("\u0187\3\2\2\2\u018b\u0188\3\2\2\2\u018b\u0189\3\2\2\2") - buf.write("\u018b\u018a\3\2\2\2\u018cQ\3\2\2\2\'XZ_aesw\u00a5\u00a8") - buf.write("\u00ae\u00c4\u00c7\u00d6\u00e0\u00e2\u00ed\u00f0\u00f3") - buf.write("\u00fc\u0102\u0107\u0117\u0119\u011f\u012c\u0131\u0136") - buf.write("\u013b\u013f\u0152\u0155\u015c\u015f\u016d\u0175\u017c") - buf.write("\u018b") + buf.write("\u0132A\3\2\2\2\u0133\u0131\3\2\2\2\u0134\u0137\5<\37") + buf.write("\2\u0135\u0136\7\n\2\2\u0136\u0138\5<\37\2\u0137\u0135") + buf.write("\3\2\2\2\u0138\u0139\3\2\2\2\u0139\u0137\3\2\2\2\u0139") + buf.write("\u013a\3\2\2\2\u013a\u013b\3\2\2\2\u013b\u013c\7\23\2") + buf.write("\2\u013c\u013d\5> \2\u013dC\3\2\2\2\u013e\u013f\7\33\2") + buf.write("\2\u013f\u0140\7.\2\2\u0140\u0141\7\t\2\2\u0141\u0142") + buf.write("\5F$\2\u0142\u0143\7\13\2\2\u0143\u0144\7\27\2\2\u0144") + buf.write("\u0145\5\b\5\2\u0145\u0146\7\30\2\2\u0146E\3\2\2\2\u0147") + buf.write("\u014c\7-\2\2\u0148\u0149\7\n\2\2\u0149\u014b\7-\2\2\u014a") + buf.write("\u0148\3\2\2\2\u014b\u014e\3\2\2\2\u014c\u014a\3\2\2\2") + buf.write("\u014c\u014d\3\2\2\2\u014d\u0150\3\2\2\2\u014e\u014c\3") + buf.write("\2\2\2\u014f\u0147\3\2\2\2\u014f\u0150\3\2\2\2\u0150G") + buf.write("\3\2\2\2\u0151\u0156\5.\30\2\u0152\u0153\7\n\2\2\u0153") + buf.write("\u0155\5.\30\2\u0154\u0152\3\2\2\2\u0155\u0158\3\2\2\2") + buf.write("\u0156\u0154\3\2\2\2\u0156\u0157\3\2\2\2\u0157\u015a\3") + buf.write("\2\2\2\u0158\u0156\3\2\2\2\u0159\u0151\3\2\2\2\u0159\u015a") + buf.write("\3\2\2\2\u015aI\3\2\2\2\u015b\u015c\b&\1\2\u015c\u015d") + buf.write("\7*\2\2\u015d\u0168\5J&\7\u015e\u015f\5.\30\2\u015f\u0160") + buf.write("\5N(\2\u0160\u0161\5.\30\2\u0161\u0168\3\2\2\2\u0162\u0168") + buf.write("\7!\2\2\u0163\u0164\7\t\2\2\u0164\u0165\5J&\2\u0165\u0166") + buf.write("\7\13\2\2\u0166\u0168\3\2\2\2\u0167\u015b\3\2\2\2\u0167") + buf.write("\u015e\3\2\2\2\u0167\u0162\3\2\2\2\u0167\u0163\3\2\2\2") + buf.write("\u0168\u016f\3\2\2\2\u0169\u016a\f\5\2\2\u016a\u016b\5") + buf.write("P)\2\u016b\u016c\5J&\6\u016c\u016e\3\2\2\2\u016d\u0169") + buf.write("\3\2\2\2\u016e\u0171\3\2\2\2\u016f\u016d\3\2\2\2\u016f") + buf.write("\u0170\3\2\2\2\u0170K\3\2\2\2\u0171\u016f\3\2\2\2\u0172") + buf.write("\u0176\7\34\2\2\u0173\u0175\7.\2\2\u0174\u0173\3\2\2\2") + buf.write("\u0175\u0178\3\2\2\2\u0176\u0174\3\2\2\2\u0176\u0177\3") + buf.write("\2\2\2\u0177\u0179\3\2\2\2\u0178\u0176\3\2\2\2\u0179\u017a") + buf.write("\7\34\2\2\u017aM\3\2\2\2\u017b\u017c\t\6\2\2\u017cO\3") + buf.write("\2\2\2\u017d\u017e\t\7\2\2\u017eQ\3\2\2\2\u017f\u0186") + buf.write("\7+\2\2\u0180\u0186\7-\2\2\u0181\u0186\5 \21\2\u0182\u0186") + buf.write("\58\35\2\u0183\u0186\5> \2\u0184\u0186\7,\2\2\u0185\u017f") + buf.write("\3\2\2\2\u0185\u0180\3\2\2\2\u0185\u0181\3\2\2\2\u0185") + buf.write("\u0182\3\2\2\2\u0185\u0183\3\2\2\2\u0185\u0184\3\2\2\2") + buf.write("\u0186S\3\2\2\2#]bdhvz\u00a8\u00ab\u00c4\u00c7\u00d6\u00e0") + buf.write("\u00e2\u00ed\u00f0\u00f3\u00fc\u0102\u0107\u0117\u0119") + buf.write("\u011f\u012c\u0131\u0139\u014c\u014f\u0156\u0159\u0167") + buf.write("\u016f\u0176\u0185") return buf.getvalue() @@ -218,56 +212,58 @@ class tlangParser ( Parser ): "NAME", "Whitespace" ] RULE_start = 0 - RULE_instruction_list = 1 - RULE_strict_ilist = 2 - RULE_declaration = 3 - RULE_instruction = 4 - RULE_conditional = 5 - RULE_ifConditional = 6 - RULE_ifElseConditional = 7 - RULE_loop = 8 - RULE_gotoCommand = 9 - RULE_moveCommand = 10 - RULE_moveOp = 11 - RULE_penCommand = 12 - RULE_pauseCommand = 13 - RULE_array = 14 - RULE_assignment = 15 - RULE_printStatement = 16 - RULE_multiplicative = 17 - RULE_additive = 18 - RULE_unaryArithOp = 19 - RULE_returnStatement = 20 - RULE_expression = 21 - RULE_classDeclaration = 22 - RULE_classBody = 23 - RULE_classAttributeDeclaration = 24 - RULE_objectInstantiation = 25 - RULE_objectOrArrayAccess = 26 - RULE_baseAccess = 27 - RULE_lvalue = 28 - RULE_functionCall = 29 - RULE_methodCaller = 30 - RULE_functionCallWithReturnValues = 31 - RULE_functionDeclaration = 32 - RULE_parameters = 33 - RULE_arguments = 34 - RULE_condition = 35 - RULE_comment = 36 - RULE_binCondOp = 37 - RULE_logicOp = 38 - RULE_value = 39 - - ruleNames = [ "start", "instruction_list", "strict_ilist", "declaration", - "instruction", "conditional", "ifConditional", "ifElseConditional", - "loop", "gotoCommand", "moveCommand", "moveOp", "penCommand", - "pauseCommand", "array", "assignment", "printStatement", - "multiplicative", "additive", "unaryArithOp", "returnStatement", - "expression", "classDeclaration", "classBody", "classAttributeDeclaration", - "objectInstantiation", "objectOrArrayAccess", "baseAccess", - "lvalue", "functionCall", "methodCaller", "functionCallWithReturnValues", - "functionDeclaration", "parameters", "arguments", "condition", - "comment", "binCondOp", "logicOp", "value" ] + RULE_statement_list = 1 + RULE_declaration_list = 2 + RULE_strict_ilist = 3 + RULE_declaration = 4 + RULE_instruction = 5 + RULE_conditional = 6 + RULE_ifConditional = 7 + RULE_ifElseConditional = 8 + RULE_loop = 9 + RULE_gotoCommand = 10 + RULE_moveCommand = 11 + RULE_moveOp = 12 + RULE_penCommand = 13 + RULE_pauseCommand = 14 + RULE_array = 15 + RULE_assignment = 16 + RULE_printStatement = 17 + RULE_multiplicative = 18 + RULE_additive = 19 + RULE_unaryArithOp = 20 + RULE_returnStatement = 21 + RULE_expression = 22 + RULE_classDeclaration = 23 + RULE_classBody = 24 + RULE_classAttributeDeclaration = 25 + RULE_objectInstantiation = 26 + RULE_dataLocationAccess = 27 + RULE_baseVar = 28 + RULE_lvalue = 29 + RULE_functionCall = 30 + RULE_methodCaller = 31 + RULE_functionCallWithReturnValues = 32 + RULE_functionDeclaration = 33 + RULE_parameters = 34 + RULE_arguments = 35 + RULE_condition = 36 + RULE_comment = 37 + RULE_binCondOp = 38 + RULE_logicOp = 39 + RULE_value = 40 + + ruleNames = [ "start", "statement_list", "declaration_list", "strict_ilist", + "declaration", "instruction", "conditional", "ifConditional", + "ifElseConditional", "loop", "gotoCommand", "moveCommand", + "moveOp", "penCommand", "pauseCommand", "array", "assignment", + "printStatement", "multiplicative", "additive", "unaryArithOp", + "returnStatement", "expression", "classDeclaration", + "classBody", "classAttributeDeclaration", "objectInstantiation", + "dataLocationAccess", "baseVar", "lvalue", "functionCall", + "methodCaller", "functionCallWithReturnValues", "functionDeclaration", + "parameters", "arguments", "condition", "comment", "binCondOp", + "logicOp", "value" ] EOF = Token.EOF T__0=1 @@ -331,8 +327,8 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def instruction_list(self): - return self.getTypedRuleContext(tlangParser.Instruction_listContext,0) + def statement_list(self): + return self.getTypedRuleContext(tlangParser.Statement_listContext,0) def EOF(self): @@ -356,9 +352,9 @@ def start(self): self.enterRule(localctx, 0, self.RULE_start) try: self.enterOuterAlt(localctx, 1) - self.state = 80 - self.instruction_list() - self.state = 81 + self.state = 82 + self.statement_list() + self.state = 83 self.match(tlangParser.EOF) except RecognitionException as re: localctx.exception = re @@ -369,19 +365,57 @@ def start(self): return localctx - class Instruction_listContext(ParserRuleContext): + class Statement_listContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def instruction(self, i:int=None): - if i is None: - return self.getTypedRuleContexts(tlangParser.InstructionContext) + def declaration_list(self): + return self.getTypedRuleContext(tlangParser.Declaration_listContext,0) + + + def strict_ilist(self): + return self.getTypedRuleContext(tlangParser.Strict_ilistContext,0) + + + def getRuleIndex(self): + return tlangParser.RULE_statement_list + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitStatement_list" ): + return visitor.visitStatement_list(self) else: - return self.getTypedRuleContext(tlangParser.InstructionContext,i) + return visitor.visitChildren(self) + + + + + def statement_list(self): + + localctx = tlangParser.Statement_listContext(self, self._ctx, self.state) + self.enterRule(localctx, 2, self.RULE_statement_list) + try: + self.enterOuterAlt(localctx, 1) + self.state = 85 + self.declaration_list() + self.state = 86 + self.strict_ilist() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + class Declaration_listContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + def declaration(self, i:int=None): if i is None: return self.getTypedRuleContexts(tlangParser.DeclarationContext) @@ -389,55 +423,32 @@ def declaration(self, i:int=None): return self.getTypedRuleContext(tlangParser.DeclarationContext,i) - def comment(self, i:int=None): - if i is None: - return self.getTypedRuleContexts(tlangParser.CommentContext) - else: - return self.getTypedRuleContext(tlangParser.CommentContext,i) - - def getRuleIndex(self): - return tlangParser.RULE_instruction_list + return tlangParser.RULE_declaration_list def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitInstruction_list" ): - return visitor.visitInstruction_list(self) + if hasattr( visitor, "visitDeclaration_list" ): + return visitor.visitDeclaration_list(self) else: return visitor.visitChildren(self) - def instruction_list(self): + def declaration_list(self): - localctx = tlangParser.Instruction_listContext(self, self._ctx, self.state) - self.enterRule(localctx, 2, self.RULE_instruction_list) + localctx = tlangParser.Declaration_listContext(self, self._ctx, self.state) + self.enterRule(localctx, 4, self.RULE_declaration_list) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 88 + self.state = 91 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__19) | (1 << tlangParser.T__24) | (1 << tlangParser.T__25) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 86 - self._errHandler.sync(self) - token = self._input.LA(1) - if token in [tlangParser.T__0, tlangParser.T__1, tlangParser.T__4, tlangParser.T__5, tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12, tlangParser.T__13, tlangParser.T__14, tlangParser.T__15, tlangParser.T__17, tlangParser.T__18, tlangParser.VAR, tlangParser.NAME]: - self.state = 83 - self.instruction() - pass - elif token in [tlangParser.T__19, tlangParser.T__24]: - self.state = 84 - self.declaration() - pass - elif token in [tlangParser.T__25]: - self.state = 85 - self.comment() - pass - else: - raise NoViableAltException(self) - - self.state = 90 + while _la==tlangParser.T__19 or _la==tlangParser.T__24: + self.state = 88 + self.declaration() + self.state = 93 self._errHandler.sync(self) _la = self._input.LA(1) @@ -485,29 +496,29 @@ def accept(self, visitor:ParseTreeVisitor): def strict_ilist(self): localctx = tlangParser.Strict_ilistContext(self, self._ctx, self.state) - self.enterRule(localctx, 4, self.RULE_strict_ilist) + self.enterRule(localctx, 6, self.RULE_strict_ilist) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 93 + self.state = 96 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 93 + self.state = 96 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__0, tlangParser.T__1, tlangParser.T__4, tlangParser.T__5, tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12, tlangParser.T__13, tlangParser.T__14, tlangParser.T__15, tlangParser.T__17, tlangParser.T__18, tlangParser.VAR, tlangParser.NAME]: - self.state = 91 + self.state = 94 self.instruction() pass elif token in [tlangParser.T__25]: - self.state = 92 + self.state = 95 self.comment() pass else: raise NoViableAltException(self) - self.state = 95 + self.state = 98 self._errHandler.sync(self) _la = self._input.LA(1) if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__25) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): @@ -551,19 +562,19 @@ def accept(self, visitor:ParseTreeVisitor): def declaration(self): localctx = tlangParser.DeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 6, self.RULE_declaration) + self.enterRule(localctx, 8, self.RULE_declaration) try: - self.state = 99 + self.state = 102 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__19]: self.enterOuterAlt(localctx, 1) - self.state = 97 + self.state = 100 self.classDeclaration() pass elif token in [tlangParser.T__24]: self.enterOuterAlt(localctx, 2) - self.state = 98 + self.state = 101 self.functionDeclaration() pass else: @@ -647,80 +658,80 @@ def accept(self, visitor:ParseTreeVisitor): def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) - self.enterRule(localctx, 8, self.RULE_instruction) + self.enterRule(localctx, 10, self.RULE_instruction) try: - self.state = 113 + self.state = 116 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,5,self._ctx) + la_ = self._interp.adaptivePredict(self._input,4,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 101 + self.state = 104 self.functionCallWithReturnValues() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 102 + self.state = 105 self.assignment() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 103 + self.state = 106 self.printStatement() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 104 + self.state = 107 self.conditional() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 105 + self.state = 108 self.loop() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 106 + self.state = 109 self.moveCommand() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 107 + self.state = 110 self.penCommand() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 108 + self.state = 111 self.gotoCommand() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 109 + self.state = 112 self.pauseCommand() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 110 + self.state = 113 self.objectInstantiation() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 111 + self.state = 114 self.functionCall() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 112 + self.state = 115 self.returnStatement() pass @@ -763,20 +774,20 @@ def accept(self, visitor:ParseTreeVisitor): def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) - self.enterRule(localctx, 10, self.RULE_conditional) + self.enterRule(localctx, 12, self.RULE_conditional) try: - self.state = 117 + self.state = 120 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,6,self._ctx) + la_ = self._interp.adaptivePredict(self._input,5,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 115 + self.state = 118 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 116 + self.state = 119 self.ifElseConditional() pass @@ -819,18 +830,18 @@ def accept(self, visitor:ParseTreeVisitor): def ifConditional(self): localctx = tlangParser.IfConditionalContext(self, self._ctx, self.state) - self.enterRule(localctx, 12, self.RULE_ifConditional) + self.enterRule(localctx, 14, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 119 + self.state = 122 self.match(tlangParser.T__0) - self.state = 120 + self.state = 123 self.condition(0) - self.state = 121 + self.state = 124 self.match(tlangParser.T__1) - self.state = 122 + self.state = 125 self.strict_ilist() - self.state = 123 + self.state = 126 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -873,26 +884,26 @@ def accept(self, visitor:ParseTreeVisitor): def ifElseConditional(self): localctx = tlangParser.IfElseConditionalContext(self, self._ctx, self.state) - self.enterRule(localctx, 14, self.RULE_ifElseConditional) + self.enterRule(localctx, 16, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 125 + self.state = 128 self.match(tlangParser.T__0) - self.state = 126 + self.state = 129 self.condition(0) - self.state = 127 + self.state = 130 self.match(tlangParser.T__1) - self.state = 128 + self.state = 131 self.strict_ilist() - self.state = 129 + self.state = 132 self.match(tlangParser.T__2) - self.state = 130 + self.state = 133 self.match(tlangParser.T__3) - self.state = 131 + self.state = 134 self.match(tlangParser.T__1) - self.state = 132 + self.state = 135 self.strict_ilist() - self.state = 133 + self.state = 136 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -932,18 +943,18 @@ def accept(self, visitor:ParseTreeVisitor): def loop(self): localctx = tlangParser.LoopContext(self, self._ctx, self.state) - self.enterRule(localctx, 16, self.RULE_loop) + self.enterRule(localctx, 18, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 135 + self.state = 138 self.match(tlangParser.T__4) - self.state = 136 + self.state = 139 self.value() - self.state = 137 + self.state = 140 self.match(tlangParser.T__1) - self.state = 138 + self.state = 141 self.strict_ilist() - self.state = 139 + self.state = 142 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -982,20 +993,20 @@ def accept(self, visitor:ParseTreeVisitor): def gotoCommand(self): localctx = tlangParser.GotoCommandContext(self, self._ctx, self.state) - self.enterRule(localctx, 18, self.RULE_gotoCommand) + self.enterRule(localctx, 20, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 141 + self.state = 144 self.match(tlangParser.T__5) - self.state = 142 + self.state = 145 self.match(tlangParser.T__6) - self.state = 143 + self.state = 146 self.expression(0) - self.state = 144 + self.state = 147 self.match(tlangParser.T__7) - self.state = 145 + self.state = 148 self.expression(0) - self.state = 146 + self.state = 149 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1035,12 +1046,12 @@ def accept(self, visitor:ParseTreeVisitor): def moveCommand(self): localctx = tlangParser.MoveCommandContext(self, self._ctx, self.state) - self.enterRule(localctx, 20, self.RULE_moveCommand) + self.enterRule(localctx, 22, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 148 + self.state = 151 self.moveOp() - self.state = 149 + self.state = 152 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1073,11 +1084,11 @@ def accept(self, visitor:ParseTreeVisitor): def moveOp(self): localctx = tlangParser.MoveOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 22, self.RULE_moveOp) + self.enterRule(localctx, 24, self.RULE_moveOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 151 + self.state = 154 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -1115,11 +1126,11 @@ def accept(self, visitor:ParseTreeVisitor): def penCommand(self): localctx = tlangParser.PenCommandContext(self, self._ctx, self.state) - self.enterRule(localctx, 24, self.RULE_penCommand) + self.enterRule(localctx, 26, self.RULE_penCommand) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 153 + self.state = 156 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -1157,10 +1168,10 @@ def accept(self, visitor:ParseTreeVisitor): def pauseCommand(self): localctx = tlangParser.PauseCommandContext(self, self._ctx, self.state) - self.enterRule(localctx, 26, self.RULE_pauseCommand) + self.enterRule(localctx, 28, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 155 + self.state = 158 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -1199,33 +1210,33 @@ def accept(self, visitor:ParseTreeVisitor): def array(self): localctx = tlangParser.ArrayContext(self, self._ctx, self.state) - self.enterRule(localctx, 28, self.RULE_array) + self.enterRule(localctx, 30, self.RULE_array) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 157 + self.state = 160 self.match(tlangParser.T__1) - self.state = 166 + self.state = 169 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 158 + self.state = 161 self.expression(0) - self.state = 163 + self.state = 166 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 159 + self.state = 162 self.match(tlangParser.T__7) - self.state = 160 + self.state = 163 self.expression(0) - self.state = 165 + self.state = 168 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 168 + self.state = 171 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -1242,15 +1253,12 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def expression(self): - return self.getTypedRuleContext(tlangParser.ExpressionContext,0) - + def lvalue(self): + return self.getTypedRuleContext(tlangParser.LvalueContext,0) - def VAR(self): - return self.getToken(tlangParser.VAR, 0) - def objectOrArrayAccess(self): - return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,0) + def expression(self): + return self.getTypedRuleContext(tlangParser.ExpressionContext,0) def getRuleIndex(self): @@ -1268,23 +1276,11 @@ def accept(self, visitor:ParseTreeVisitor): def assignment(self): localctx = tlangParser.AssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 30, self.RULE_assignment) + self.enterRule(localctx, 32, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 172 - self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,9,self._ctx) - if la_ == 1: - self.state = 170 - self.match(tlangParser.VAR) - pass - - elif la_ == 2: - self.state = 171 - self.objectOrArrayAccess() - pass - - + self.state = 173 + self.lvalue() self.state = 174 self.match(tlangParser.T__16) self.state = 175 @@ -1323,7 +1319,7 @@ def accept(self, visitor:ParseTreeVisitor): def printStatement(self): localctx = tlangParser.PrintStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 32, self.RULE_printStatement) + self.enterRule(localctx, 34, self.RULE_printStatement) try: self.enterOuterAlt(localctx, 1) self.state = 177 @@ -1370,7 +1366,7 @@ def accept(self, visitor:ParseTreeVisitor): def multiplicative(self): localctx = tlangParser.MultiplicativeContext(self, self._ctx, self.state) - self.enterRule(localctx, 34, self.RULE_multiplicative) + self.enterRule(localctx, 36, self.RULE_multiplicative) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) @@ -1417,7 +1413,7 @@ def accept(self, visitor:ParseTreeVisitor): def additive(self): localctx = tlangParser.AdditiveContext(self, self._ctx, self.state) - self.enterRule(localctx, 36, self.RULE_additive) + self.enterRule(localctx, 38, self.RULE_additive) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) @@ -1461,7 +1457,7 @@ def accept(self, visitor:ParseTreeVisitor): def unaryArithOp(self): localctx = tlangParser.UnaryArithOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 38, self.RULE_unaryArithOp) + self.enterRule(localctx, 40, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) self.state = 186 @@ -1503,7 +1499,7 @@ def accept(self, visitor:ParseTreeVisitor): def returnStatement(self): localctx = tlangParser.ReturnStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 40, self.RULE_returnStatement) + self.enterRule(localctx, 42, self.RULE_returnStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) @@ -1511,7 +1507,7 @@ def returnStatement(self): self.match(tlangParser.T__18) self.state = 197 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,11,self._ctx) + la_ = self._interp.adaptivePredict(self._input,9,self._ctx) if la_ == 1: self.state = 189 self.expression(0) @@ -1679,13 +1675,13 @@ def expression(self, _p:int=0): _parentState = self.state localctx = tlangParser.ExpressionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 42 - self.enterRecursionRule(localctx, 42, self.RULE_expression, _p) + _startState = 44 + self.enterRecursionRule(localctx, 44, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) self.state = 212 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,12,self._ctx) + la_ = self._interp.adaptivePredict(self._input,10,self._ctx) if la_ == 1: localctx = tlangParser.UnaryExprContext(self, localctx) self._ctx = localctx @@ -1733,7 +1729,7 @@ def expression(self, _p:int=0): self._ctx.stop = self._input.LT(-1) self.state = 224 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,14,self._ctx) + _alt = self._interp.adaptivePredict(self._input,12,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -1741,7 +1737,7 @@ def expression(self, _p:int=0): _prevctx = localctx self.state = 222 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,13,self._ctx) + la_ = self._interp.adaptivePredict(self._input,11,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) @@ -1771,7 +1767,7 @@ def expression(self, _p:int=0): self.state = 226 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,14,self._ctx) + _alt = self._interp.adaptivePredict(self._input,12,self._ctx) except RecognitionException as re: localctx.exception = re @@ -1813,7 +1809,7 @@ def accept(self, visitor:ParseTreeVisitor): def classDeclaration(self): localctx = tlangParser.ClassDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 44, self.RULE_classDeclaration) + self.enterRule(localctx, 46, self.RULE_classDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) @@ -1901,7 +1897,7 @@ def accept(self, visitor:ParseTreeVisitor): def classBody(self): localctx = tlangParser.ClassBodyContext(self, self._ctx, self.state) - self.enterRule(localctx, 46, self.RULE_classBody) + self.enterRule(localctx, 48, self.RULE_classBody) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) @@ -1963,11 +1959,11 @@ def accept(self, visitor:ParseTreeVisitor): def classAttributeDeclaration(self): localctx = tlangParser.ClassAttributeDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 48, self.RULE_classAttributeDeclaration) + self.enterRule(localctx, 50, self.RULE_classAttributeDeclaration) try: self.state = 261 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,20,self._ctx) + la_ = self._interp.adaptivePredict(self._input,18,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) self.state = 259 @@ -2018,7 +2014,7 @@ def accept(self, visitor:ParseTreeVisitor): def objectInstantiation(self): localctx = tlangParser.ObjectInstantiationContext(self, self._ctx, self.state) - self.enterRule(localctx, 50, self.RULE_objectInstantiation) + self.enterRule(localctx, 52, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) self.state = 263 @@ -2042,14 +2038,14 @@ def objectInstantiation(self): return localctx - class ObjectOrArrayAccessContext(ParserRuleContext): + class DataLocationAccessContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def baseAccess(self): - return self.getTypedRuleContext(tlangParser.BaseAccessContext,0) + def baseVar(self): + return self.getTypedRuleContext(tlangParser.BaseVarContext,0) def VAR(self, i:int=None): @@ -2066,25 +2062,25 @@ def expression(self, i:int=None): def getRuleIndex(self): - return tlangParser.RULE_objectOrArrayAccess + return tlangParser.RULE_dataLocationAccess def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitObjectOrArrayAccess" ): - return visitor.visitObjectOrArrayAccess(self) + if hasattr( visitor, "visitDataLocationAccess" ): + return visitor.visitDataLocationAccess(self) else: return visitor.visitChildren(self) - def objectOrArrayAccess(self): + def dataLocationAccess(self): - localctx = tlangParser.ObjectOrArrayAccessContext(self, self._ctx, self.state) - self.enterRule(localctx, 52, self.RULE_objectOrArrayAccess) + localctx = tlangParser.DataLocationAccessContext(self, self._ctx, self.state) + self.enterRule(localctx, 54, self.RULE_dataLocationAccess) try: self.enterOuterAlt(localctx, 1) self.state = 270 - self.baseAccess() + self.baseVar() self.state = 277 self._errHandler.sync(self) _alt = 1 @@ -2115,7 +2111,7 @@ def objectOrArrayAccess(self): raise NoViableAltException(self) self.state = 279 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,22,self._ctx) + _alt = self._interp.adaptivePredict(self._input,20,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2126,7 +2122,7 @@ def objectOrArrayAccess(self): return localctx - class BaseAccessContext(ParserRuleContext): + class BaseVarContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) @@ -2136,21 +2132,21 @@ def VAR(self): return self.getToken(tlangParser.VAR, 0) def getRuleIndex(self): - return tlangParser.RULE_baseAccess + return tlangParser.RULE_baseVar def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitBaseAccess" ): - return visitor.visitBaseAccess(self) + if hasattr( visitor, "visitBaseVar" ): + return visitor.visitBaseVar(self) else: return visitor.visitChildren(self) - def baseAccess(self): + def baseVar(self): - localctx = tlangParser.BaseAccessContext(self, self._ctx, self.state) - self.enterRule(localctx, 54, self.RULE_baseAccess) + localctx = tlangParser.BaseVarContext(self, self._ctx, self.state) + self.enterRule(localctx, 56, self.RULE_baseVar) try: self.enterOuterAlt(localctx, 1) self.state = 281 @@ -2173,8 +2169,8 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): def VAR(self): return self.getToken(tlangParser.VAR, 0) - def objectOrArrayAccess(self): - return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,0) + def dataLocationAccess(self): + return self.getTypedRuleContext(tlangParser.DataLocationAccessContext,0) def getRuleIndex(self): @@ -2192,11 +2188,11 @@ def accept(self, visitor:ParseTreeVisitor): def lvalue(self): localctx = tlangParser.LvalueContext(self, self._ctx, self.state) - self.enterRule(localctx, 56, self.RULE_lvalue) + self.enterRule(localctx, 58, self.RULE_lvalue) try: self.state = 285 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,23,self._ctx) + la_ = self._interp.adaptivePredict(self._input,21,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) self.state = 283 @@ -2206,7 +2202,7 @@ def lvalue(self): elif la_ == 2: self.enterOuterAlt(localctx, 2) self.state = 284 - self.objectOrArrayAccess() + self.dataLocationAccess() pass @@ -2251,7 +2247,7 @@ def accept(self, visitor:ParseTreeVisitor): def functionCall(self): localctx = tlangParser.FunctionCallContext(self, self._ctx, self.state) - self.enterRule(localctx, 58, self.RULE_functionCall) + self.enterRule(localctx, 60, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) self.state = 287 @@ -2307,7 +2303,7 @@ def accept(self, visitor:ParseTreeVisitor): def methodCaller(self): localctx = tlangParser.MethodCallerContext(self, self._ctx, self.state) - self.enterRule(localctx, 60, self.RULE_methodCaller) + self.enterRule(localctx, 62, self.RULE_methodCaller) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) @@ -2354,21 +2350,15 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def functionCall(self): - return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) - - - def VAR(self, i:int=None): + def lvalue(self, i:int=None): if i is None: - return self.getTokens(tlangParser.VAR) + return self.getTypedRuleContexts(tlangParser.LvalueContext) else: - return self.getToken(tlangParser.VAR, i) + return self.getTypedRuleContext(tlangParser.LvalueContext,i) - def objectOrArrayAccess(self, i:int=None): - if i is None: - return self.getTypedRuleContexts(tlangParser.ObjectOrArrayAccessContext) - else: - return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,i) + + def functionCall(self): + return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) def getRuleIndex(self): @@ -2386,53 +2376,29 @@ def accept(self, visitor:ParseTreeVisitor): def functionCallWithReturnValues(self): localctx = tlangParser.FunctionCallWithReturnValuesContext(self, self._ctx, self.state) - self.enterRule(localctx, 62, self.RULE_functionCallWithReturnValues) + self.enterRule(localctx, 64, self.RULE_functionCallWithReturnValues) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 308 - self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,26,self._ctx) - if la_ == 1: - self.state = 306 - self.match(tlangParser.VAR) - pass - - elif la_ == 2: - self.state = 307 - self.objectOrArrayAccess() - pass - - - self.state = 315 + self.state = 306 + self.lvalue() + self.state = 309 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 310 + self.state = 307 self.match(tlangParser.T__7) - self.state = 313 - self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,27,self._ctx) - if la_ == 1: - self.state = 311 - self.match(tlangParser.VAR) - pass - - elif la_ == 2: - self.state = 312 - self.objectOrArrayAccess() - pass - - - self.state = 317 + self.state = 308 + self.lvalue() + self.state = 311 self._errHandler.sync(self) _la = self._input.LA(1) if not (_la==tlangParser.T__7): break - self.state = 319 + self.state = 313 self.match(tlangParser.T__16) - self.state = 320 + self.state = 314 self.functionCall() except RecognitionException as re: localctx.exception = re @@ -2475,24 +2441,24 @@ def accept(self, visitor:ParseTreeVisitor): def functionDeclaration(self): localctx = tlangParser.FunctionDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 64, self.RULE_functionDeclaration) + self.enterRule(localctx, 66, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 322 + self.state = 316 self.match(tlangParser.T__24) - self.state = 323 + self.state = 317 self.match(tlangParser.NAME) - self.state = 324 + self.state = 318 self.match(tlangParser.T__6) - self.state = 325 + self.state = 319 self.parameters() - self.state = 326 + self.state = 320 self.match(tlangParser.T__8) - self.state = 327 + self.state = 321 self.match(tlangParser.T__20) - self.state = 328 + self.state = 322 self.strict_ilist() - self.state = 329 + self.state = 323 self.match(tlangParser.T__21) except RecognitionException as re: localctx.exception = re @@ -2530,25 +2496,25 @@ def accept(self, visitor:ParseTreeVisitor): def parameters(self): localctx = tlangParser.ParametersContext(self, self._ctx, self.state) - self.enterRule(localctx, 66, self.RULE_parameters) + self.enterRule(localctx, 68, self.RULE_parameters) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 339 + self.state = 333 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.VAR: - self.state = 331 + self.state = 325 self.match(tlangParser.VAR) - self.state = 336 + self.state = 330 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 332 + self.state = 326 self.match(tlangParser.T__7) - self.state = 333 + self.state = 327 self.match(tlangParser.VAR) - self.state = 338 + self.state = 332 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2591,25 +2557,25 @@ def accept(self, visitor:ParseTreeVisitor): def arguments(self): localctx = tlangParser.ArgumentsContext(self, self._ctx, self.state) - self.enterRule(localctx, 68, self.RULE_arguments) + self.enterRule(localctx, 70, self.RULE_arguments) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 349 + self.state = 343 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 341 + self.state = 335 self.expression(0) - self.state = 346 + self.state = 340 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 342 + self.state = 336 self.match(tlangParser.T__7) - self.state = 343 + self.state = 337 self.expression(0) - self.state = 348 + self.state = 342 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2674,48 +2640,48 @@ def condition(self, _p:int=0): _parentState = self.state localctx = tlangParser.ConditionContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 70 - self.enterRecursionRule(localctx, 70, self.RULE_condition, _p) + _startState = 72 + self.enterRecursionRule(localctx, 72, self.RULE_condition, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 363 + self.state = 357 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,33,self._ctx) + la_ = self._interp.adaptivePredict(self._input,29,self._ctx) if la_ == 1: - self.state = 352 + self.state = 346 self.match(tlangParser.NOT) - self.state = 353 + self.state = 347 self.condition(5) pass elif la_ == 2: - self.state = 354 + self.state = 348 self.expression(0) - self.state = 355 + self.state = 349 self.binCondOp() - self.state = 356 + self.state = 350 self.expression(0) pass elif la_ == 3: - self.state = 358 + self.state = 352 self.match(tlangParser.PENCOND) pass elif la_ == 4: - self.state = 359 + self.state = 353 self.match(tlangParser.T__6) - self.state = 360 + self.state = 354 self.condition(0) - self.state = 361 + self.state = 355 self.match(tlangParser.T__8) pass self._ctx.stop = self._input.LT(-1) - self.state = 371 + self.state = 365 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,34,self._ctx) + _alt = self._interp.adaptivePredict(self._input,30,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: @@ -2723,17 +2689,17 @@ def condition(self, _p:int=0): _prevctx = localctx localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 365 + self.state = 359 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 366 + self.state = 360 self.logicOp() - self.state = 367 + self.state = 361 self.condition(4) - self.state = 373 + self.state = 367 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,34,self._ctx) + _alt = self._interp.adaptivePredict(self._input,30,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2771,23 +2737,23 @@ def accept(self, visitor:ParseTreeVisitor): def comment(self): localctx = tlangParser.CommentContext(self, self._ctx, self.state) - self.enterRule(localctx, 72, self.RULE_comment) + self.enterRule(localctx, 74, self.RULE_comment) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 374 + self.state = 368 self.match(tlangParser.T__25) - self.state = 378 + self.state = 372 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.NAME: - self.state = 375 + self.state = 369 self.match(tlangParser.NAME) - self.state = 380 + self.state = 374 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 381 + self.state = 375 self.match(tlangParser.T__25) except RecognitionException as re: localctx.exception = re @@ -2837,11 +2803,11 @@ def accept(self, visitor:ParseTreeVisitor): def binCondOp(self): localctx = tlangParser.BinCondOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 74, self.RULE_binCondOp) + self.enterRule(localctx, 76, self.RULE_binCondOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 383 + self.state = 377 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2884,11 +2850,11 @@ def accept(self, visitor:ParseTreeVisitor): def logicOp(self): localctx = tlangParser.LogicOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 76, self.RULE_logicOp) + self.enterRule(localctx, 78, self.RULE_logicOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 385 + self.state = 379 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2920,8 +2886,8 @@ def array(self): return self.getTypedRuleContext(tlangParser.ArrayContext,0) - def objectOrArrayAccess(self): - return self.getTypedRuleContext(tlangParser.ObjectOrArrayAccessContext,0) + def dataLocationAccess(self): + return self.getTypedRuleContext(tlangParser.DataLocationAccessContext,0) def functionCall(self): @@ -2946,44 +2912,44 @@ def accept(self, visitor:ParseTreeVisitor): def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) - self.enterRule(localctx, 78, self.RULE_value) + self.enterRule(localctx, 80, self.RULE_value) try: - self.state = 393 + self.state = 387 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,36,self._ctx) + la_ = self._interp.adaptivePredict(self._input,32,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 387 + self.state = 381 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 388 + self.state = 382 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 389 + self.state = 383 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 390 - self.objectOrArrayAccess() + self.state = 384 + self.dataLocationAccess() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 391 + self.state = 385 self.functionCall() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 392 + self.state = 386 self.match(tlangParser.REAL) pass @@ -3001,8 +2967,8 @@ def value(self): def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): if self._predicates == None: self._predicates = dict() - self._predicates[21] = self.expression_sempred - self._predicates[35] = self.condition_sempred + self._predicates[22] = self.expression_sempred + self._predicates[36] = self.condition_sempred pred = self._predicates.get(ruleIndex, None) if pred is None: raise Exception("No predicate with index:" + str(ruleIndex)) diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index 59126c6..632f1a0 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -14,8 +14,13 @@ def visitStart(self, ctx:tlangParser.StartContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#instruction_list. - def visitInstruction_list(self, ctx:tlangParser.Instruction_listContext): + # Visit a parse tree produced by tlangParser#statement_list. + def visitStatement_list(self, ctx:tlangParser.Statement_listContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by tlangParser#declaration_list. + def visitDeclaration_list(self, ctx:tlangParser.Declaration_listContext): return self.visitChildren(ctx) @@ -164,13 +169,13 @@ def visitObjectInstantiation(self, ctx:tlangParser.ObjectInstantiationContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#objectOrArrayAccess. - def visitObjectOrArrayAccess(self, ctx:tlangParser.ObjectOrArrayAccessContext): + # Visit a parse tree produced by tlangParser#dataLocationAccess. + def visitDataLocationAccess(self, ctx:tlangParser.DataLocationAccessContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#baseAccess. - def visitBaseAccess(self, ctx:tlangParser.BaseAccessContext): + # Visit a parse tree produced by tlangParser#baseVar. + def visitBaseVar(self, ctx:tlangParser.BaseVarContext): return self.visitChildren(ctx) From ce0176e3666e17e5508a5987d5f1d59556bdf13b Mon Sep 17 00:00:00 2001 From: luthanhar Date: Thu, 17 Apr 2025 03:49:51 +0530 Subject: [PATCH 31/47] Grammar change, removing ambiguity, refactoring code, expression is now an instruction, expression can now be evaluated in if conditions --- ChironCore/ChironAST/builder.py | 117 +- .../example/demo/class_inheritance_2.tl | 6 +- ChironCore/example/demo/class_methods.tl | 2 +- ChironCore/example/demo/diamond_problem.tl | 2 +- ChironCore/example/demo/functions.tl | 11 +- ChironCore/example/demo/general.tl | 4 +- ChironCore/example/demo/rangoli.tl | 6 +- ChironCore/example/demo/test.tl | 6 + ChironCore/example/test.tl | 7 +- ChironCore/interpreter.py | 28 +- ChironCore/turtparse/tlang.g4 | 50 +- ChironCore/turtparse/tlang.interp | 22 +- ChironCore/turtparse/tlang.tokens | 74 +- ChironCore/turtparse/tlangLexer.interp | 26 +- ChironCore/turtparse/tlangLexer.py | 188 +-- ChironCore/turtparse/tlangLexer.tokens | 74 +- ChironCore/turtparse/tlangParser.py | 1315 ++++++++--------- ChironCore/turtparse/tlangVisitor.py | 38 +- 18 files changed, 953 insertions(+), 1023 deletions(-) create mode 100644 ChironCore/example/demo/test.tl diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 9bf7b9e..1b49286 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -48,6 +48,8 @@ def processInstructionBlock(self, items): stmtList = [] for item in items: currStmtList = self.visit(item) + if not isinstance(currStmtList,list): + currStmtList=[] stmtList.extend(self.subStmtList + currStmtList) self.subStmtList = [] self.virtualRegCount = 0 @@ -74,28 +76,6 @@ def visitFunctionDeclaration(self, ctx: tlangParser.FunctionDeclarationContext): # 2. parameters passing - This command is used to push the parameters to the function on the call stack return [(ChironAST.FunctionDeclarationCommand(functionName, functionParams, functionBody), len(functionBody) + 2)] + [(ChironAST.ParametersPassingCommand(functionParams), 1)] + functionBody - def visitFunctionCall(self, ctx: tlangParser.FunctionCallContext): - functionName = ctx.NAME().getText() - # the object invoking the method, in case the function call is a method call - methodCaller = self.visitMethodCaller( - ctx.methodCaller()) if ctx.methodCaller().children is not None else None - functionArgs = [self.visit(arg) for arg in ctx.arguments( - ).expression()] if ctx.arguments() is not None else [] - # if the function is a method call, insert the caller object as the first argument - if methodCaller: - functionArgs.insert(0, methodCaller) - # call private methods with mangled names - # eg, :self.__privateMethod() will be called as :self._className__privateMethod() - if len(methodCaller.access_chain) == 1 and methodCaller.access_chain[0] == ":self" and functionName.startswith("__"): - functionName = f"_{self.classRegister}{functionName}" - return [(ChironAST.FunctionCallCommand(functionName, functionArgs, methodCaller), 1)] - - def visitFunctionCallWithReturnValues(self, ctx: tlangParser.FunctionCallWithReturnValuesContext): - functionCallStmt = self.visitFunctionCall(ctx.functionCall()) - returnLocations = [self.visit(lvalue) for lvalue in ctx.lvalue()] - # read return statement is used to pop the return values from the call stack and copy them to the variables - readReturnCommand = ChironAST.ReadReturnCommand(returnLocations) - return functionCallStmt + [(readReturnCommand, 1)] def visitReturnStatement(self, ctx: tlangParser.ReturnStatementContext): returnValues = [self.visit(expr) for expr in ctx.expression( @@ -121,7 +101,7 @@ def visitDataLocationAccess(self, ctx: tlangParser.DataLocationAccessContext): # Handle private attributes # If the access is with ":self" and the attribute is private, mangle the name if base == ":self" and i == 2 and ctx.children[i].getText().startswith(":__"): - access = f":_{self.classRegister}{access.replace(":", "")}" + access = f":_{self.classRegister}{access.replace(':', '')}" access_chain.append(access) elif child.getText() == '[': # Array access: Process the expression inside `[]` @@ -234,12 +214,18 @@ def visitPrintStatement(self, ctx: tlangParser.PrintStatementContext): return [(ChironAST.PrintCommand(expr_value), 1)] def visitIfConditional(self, ctx: tlangParser.IfConditionalContext): - condObj = ChironAST.ConditionCommand(self.visit(ctx.condition())) + condObj = ChironAST.ConditionCommand(self.visit(ctx.expression())) + if self.subStmtList: + self.stmtList.extend(self.subStmtList) + self.subStmtList=[] thenInstrList = self.visit(ctx.strict_ilist()) return [(condObj, len(thenInstrList) + 1)] + thenInstrList def visitIfElseConditional(self, ctx: tlangParser.IfElseConditionalContext): - condObj = ChironAST.ConditionCommand(self.visit(ctx.condition())) + condObj = ChironAST.ConditionCommand(self.visit(ctx.expression())) + if self.subStmtList: + self.stmtList.extend(self.subStmtList) + self.subStmtList=[] thenInstrList = self.visit(ctx.strict_ilist(0)) elseInstrList = self.visit(ctx.strict_ilist(1)) jumpOverElseBlock = [(ChironAST.ConditionCommand( @@ -281,48 +267,43 @@ def visitMulExpr(self, ctx: tlangParser.MulExprContext): # Visit a parse tree produced by tlangParser#parenExpr. def visitParenExpr(self, ctx: tlangParser.ParenExprContext): return self.visit(ctx.expression()) + + def visitNotExpr(self, ctx: tlangParser.NotExprContext): + expr1 = self.visit(ctx.condition(0)) + return ChironAST.NOT(expr1) + + def visitBinExpr(self, ctx: tlangParser.BinExprContext): + expr1 = self.visit(ctx.expression(0)) + expr2 = self.visit(ctx.expression(1)) + binOpCtx = ctx.binCondOp() + + if binOpCtx.LT(): + return ChironAST.LT(expr1, expr2) + elif binOpCtx.GT(): + return ChironAST.GT(expr1, expr2) + elif binOpCtx.EQ(): + return ChironAST.EQ(expr1, expr2) + elif binOpCtx.NEQ(): + return ChironAST.NEQ(expr1, expr2) + elif binOpCtx.LTE(): + return ChironAST.LTE(expr1, expr2) + elif binOpCtx.GTE(): + return ChironAST.GTE(expr1, expr2) + + def visitLogExpr(self, ctx: tlangParser.LogExprContext): + expr1 = self.visit(ctx.expression(0)) + expr2 = self.visit(ctx.expression(1)) + logicOpCtx = ctx.logicOp() + + if logicOpCtx.AND(): + return ChironAST.AND(expr1, expr2) + elif logicOpCtx.OR(): + return ChironAST.OR(expr1, expr2) + + def visitPenExpr(self, ctx: tlangParser.PenExprContext): + return ChironAST.PenStatus() - def visitCondition(self, ctx: tlangParser.ConditionContext): - if ctx.PENCOND(): - return ChironAST.PenStatus() - - if ctx.NOT(): - expr1 = self.visit(ctx.condition(0)) - return ChironAST.NOT(expr1) - - if ctx.logicOp(): - expr1 = self.visit(ctx.condition(0)) - expr2 = self.visit(ctx.condition(1)) - logicOpCtx = ctx.logicOp() - - if logicOpCtx.AND(): - return ChironAST.AND(expr1, expr2) - elif logicOpCtx.OR(): - return ChironAST.OR(expr1, expr2) - - if ctx.binCondOp(): - expr1 = self.visit(ctx.expression(0)) - expr2 = self.visit(ctx.expression(1)) - binOpCtx = ctx.binCondOp() - - if binOpCtx.LT(): - return ChironAST.LT(expr1, expr2) - elif binOpCtx.GT(): - return ChironAST.GT(expr1, expr2) - elif binOpCtx.EQ(): - return ChironAST.EQ(expr1, expr2) - elif binOpCtx.NEQ(): - return ChironAST.NEQ(expr1, expr2) - elif binOpCtx.LTE(): - return ChironAST.LTE(expr1, expr2) - elif binOpCtx.GTE(): - return ChironAST.GTE(expr1, expr2) - - if ctx.condition(): - # condition is inside paranthesis - return self.visit(ctx.condition(0)) - return self.visitChildren(ctx) def visitLoop(self, ctx: tlangParser.LoopContext): # insert counter variable in IR for tracking repeat count @@ -339,10 +320,8 @@ def visitLoop(self, ctx: tlangParser.LoopContext): counterVarDecrInstr = ChironAST.AssignmentCommand( counterVar, ChironAST.Diff(counterVar, constOne)) - thenInstrList = [] - for instr in ctx.strict_ilist().instruction(): - temp = self.visit(instr) - thenInstrList.extend(temp) + thenInstrList = self.visit(ctx.strict_ilist()) + boolFalse = ChironAST.ConditionCommand(ChironAST.BoolFalse()) return [(counterVarInitInstr, 1), (loopCond, len(thenInstrList) + 3)] + thenInstrList +\ diff --git a/ChironCore/example/demo/class_inheritance_2.tl b/ChironCore/example/demo/class_inheritance_2.tl index 4ea6836..802b215 100644 --- a/ChironCore/example/demo/class_inheritance_2.tl +++ b/ChironCore/example/demo/class_inheritance_2.tl @@ -3,7 +3,7 @@ class :Shape { def moveForward(:self) { forward :self.:length - return + return 0 } } @@ -14,11 +14,11 @@ class :Hexagon(:Shape) { :self.moveForward() right 60 ] - return + return 0 } def __moveForward(:self, :distance) { forward :distance - return + return 0 } } diff --git a/ChironCore/example/demo/class_methods.tl b/ChironCore/example/demo/class_methods.tl index ba185be..e63571f 100644 --- a/ChironCore/example/demo/class_methods.tl +++ b/ChironCore/example/demo/class_methods.tl @@ -7,7 +7,7 @@ class :Pentagon { forward :self.:length right :angle ] - return + return 0 } } diff --git a/ChironCore/example/demo/diamond_problem.tl b/ChironCore/example/demo/diamond_problem.tl index e19681a..b3907f4 100644 --- a/ChironCore/example/demo/diamond_problem.tl +++ b/ChironCore/example/demo/diamond_problem.tl @@ -3,7 +3,7 @@ class :Animal { def walk(:self) { print(:self.:walk) - return + return 0 } } diff --git a/ChironCore/example/demo/functions.tl b/ChironCore/example/demo/functions.tl index cccb6eb..cf524ac 100644 --- a/ChironCore/example/demo/functions.tl +++ b/ChironCore/example/demo/functions.tl @@ -1,11 +1,16 @@ def drawSide(:length) { forward :length right 90 - return + return 0 +} +def drawSide(:length,:righti) { + forward :length + right :righti + return 0 } :length = 250 +:righti = 45 drawSide(:length) -drawSide(:length) -drawSide(:length) +drawSide(:length,:righti) drawSide(:length) diff --git a/ChironCore/example/demo/general.tl b/ChironCore/example/demo/general.tl index a1ff8a3..6478be5 100644 --- a/ChironCore/example/demo/general.tl +++ b/ChironCore/example/demo/general.tl @@ -10,7 +10,7 @@ class :Star(:Shape) { forward :self.:length right :angle ] - return + return 10 } } @@ -19,7 +19,7 @@ def drawSquare(:size) { forward :size right 90 ] - return + return 10 } :star = new :Star() diff --git a/ChironCore/example/demo/rangoli.tl b/ChironCore/example/demo/rangoli.tl index 66c5a5e..d8b603e 100644 --- a/ChironCore/example/demo/rangoli.tl +++ b/ChironCore/example/demo/rangoli.tl @@ -52,7 +52,7 @@ def drawRangoli(:size) :size = sqroot((:size * :size ) / 2) if :size > 10 [ drawRangoli(:size) ] - return + return 100 } class :Point { @@ -62,5 +62,5 @@ class :Point { penup :point = new :Point() goto (:point.:x, :point.:y) - -drawRangoli(:size) \ No newline at end of file +:size=200 +drawRangoli(:size) diff --git a/ChironCore/example/demo/test.tl b/ChironCore/example/demo/test.tl new file mode 100644 index 0000000..147eb7f --- /dev/null +++ b/ChironCore/example/demo/test.tl @@ -0,0 +1,6 @@ +if :x=2 [ + print(2) +] +else [ + print(4) +] \ No newline at end of file diff --git a/ChironCore/example/test.tl b/ChironCore/example/test.tl index cc69ccc..1a14e07 100644 --- a/ChironCore/example/test.tl +++ b/ChironCore/example/test.tl @@ -1,10 +1,11 @@ - def add(:a, :b) { return :a + :b } def increment(:a) { - return (add(:a, 1)) + return add(:a, 1),3,4 } -print(increment(4)*5) +:x = increment(3) +add(4,3) +print(:x) \ No newline at end of file diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index ae3ce5c..a5e0171 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -112,9 +112,17 @@ def __init__(self, irHandler, params): if self.args is not None and self.args.hooks: self.chironhook = Chironhooks.ConcreteChironHooks() self.pc = 0 + print("###########################Intermediate Representation (IR):#############") + for index, instruction in enumerate(self.ir): + print(f"{index}: {instruction} | {instruction[0]}") def interpret(self): print("Program counter : ", self.pc) + if not self.ir: + return True + + + stmt, tgt = self.ir[self.pc] print(stmt, stmt.__class__.__name__, tgt) @@ -211,23 +219,39 @@ def handleFunctionCall(self, stmt, tgt): # Copying the return values in their respective placeholders def handleReturnRead(self, stmt, tgt): - for rval in reversed(stmt.returnValues): - rval = str(rval).replace(":", "") + + print(f"Read Return: {stmt.returnValues}") + cnt=self.call_stack.pop() + rval=stmt.returnValues[0] + rval = str(rval).replace(":", "") + if(cnt==1): exec(f"self.prg.{rval} = self.call_stack.pop()") + else: + exec(f"self.prg.{rval} = self.call_stack[-{cnt}:]") + self.call_stack=self.call_stack[:-cnt] + return 1 + def handleFunctionReturn(self, stmt, tgt): + + print(f"Function Return: {stmt}") # Restore the previous program context rval_list = [] + cnt=0 for rval in stmt.returnValues: + cnt=cnt+1 rval_value = addContext(rval) exec(f"self.return_value = {rval_value}") rval_list.append(self.return_value) self.prg = self.call_stack.pop() self.pc = self.call_stack.pop() self.call_stack.extend(rval_list) + self.call_stack.append(cnt) + return 0 + # Copying the parameters in their respective placeholders def handleParametersPassing(self, stmt, tgt): for param in reversed(stmt.params): diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index 4bb1161..6edf55c 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -8,16 +8,15 @@ statement_list : declaration_list strict_ilist ; declaration_list : (declaration)* ; -strict_ilist : (instruction | comment)+ +strict_ilist : (instruction | comment)* ; declaration : classDeclaration | functionDeclaration ; -instruction : functionCallWithReturnValues - | assignment - | printStatement +instruction : + printStatement | conditional | loop | moveCommand @@ -25,15 +24,16 @@ instruction : functionCallWithReturnValues | gotoCommand | pauseCommand | objectInstantiation - | functionCall + | expression | returnStatement + ; conditional : ifConditional | ifElseConditional ; -ifConditional : 'if' condition '[' strict_ilist ']' ; +ifConditional : 'if' expression '[' strict_ilist ']' ; -ifElseConditional : 'if' condition '[' strict_ilist ']' 'else' '[' strict_ilist ']' ; +ifElseConditional : 'if' expression '[' strict_ilist ']' 'else' '[' strict_ilist ']' ; loop : 'repeat' value '[' strict_ilist ']' ; @@ -54,7 +54,7 @@ assignment : lvalue '=' expression ; -printStatement : 'print' '(' expression ')' ; +printStatement : PRINT '(' expression ')' ; multiplicative : MUL | DIV; additive : PLUS | MINUS; @@ -67,18 +67,22 @@ MUL : '*' ; DIV : '/' ; -returnStatement : 'return' ( expression ( ',' expression )* )? ; +returnStatement : RETURN ( expression ( ',' expression )* ) ; expression : unaryArithOp expression #unaryExpr | expression multiplicative expression #mulExpr | expression additive expression #addExpr - | lvalue '=' expression #assignExpr + | lvalue '=' expression #assignExpr | '(' expression ')' #parenExpr | value #valueExpr - ; + | NOT expression #notExpr + | expression binCondOp expression #binExpr + | expression logicOp expression #logExpr + | PENCOND #penExpr +; classDeclaration : 'class' VAR ('(' VAR (',' (VAR)*)? ')')? '{' classBody '}' ; @@ -101,7 +105,6 @@ lvalue functionCall : methodCaller NAME '(' arguments ')' ; methodCaller : ((VAR | '[' expression ']') '.')* ; -functionCallWithReturnValues : lvalue ( ',' lvalue )+ '=' functionCall ; // function declaration functionDeclaration : 'def' NAME '(' parameters ')' '{' strict_ilist '}' ; @@ -109,22 +112,22 @@ functionDeclaration : 'def' NAME '(' parameters ')' '{' strict_ilist '}' ; parameters : ( VAR ( ',' VAR )* )? ; arguments : ( expression ( ',' expression )* )? ; -// TODO : -// procedure_declaration : 'to' NAME (VAR)+ strict_ilist 'end' ; - -condition : NOT condition - |expression binCondOp expression - | condition logicOp condition - | PENCOND - | '(' condition ')' - ; comment : '#' (NAME)* '#' ; +logicOp : AND | OR ; + + binCondOp : EQ | NEQ | LT | GT | LTE | GTE ; -logicOp : AND | OR ; +AND: '&&'; +OR : '||'; + +RETURN : 'return' ; + +PRINT : 'print' ; + PENCOND : 'pendown?'; LT : '<' ; @@ -133,8 +136,7 @@ EQ : '=='; NEQ: '!='; LTE: '<='; GTE: '>='; -AND: '&&'; -OR : '||'; + NOT: '!' ; value : NUM diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index f4ea0c2..452149b 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -17,8 +17,6 @@ null 'pendown' 'pause' '=' -'print' -'return' 'class' '{' '}' @@ -30,6 +28,10 @@ null '-' '*' '/' +'&&' +'||' +'return' +'print' 'pendown?' '<' '>' @@ -37,8 +39,6 @@ null '!=' '<=' '>=' -'&&' -'||' '!' null null @@ -72,12 +72,14 @@ null null null null -null -null PLUS MINUS MUL DIV +AND +OR +RETURN +PRINT PENCOND LT GT @@ -85,8 +87,6 @@ EQ NEQ LTE GTE -AND -OR NOT NUM REAL @@ -127,16 +127,14 @@ baseVar lvalue functionCall methodCaller -functionCallWithReturnValues functionDeclaration parameters arguments -condition comment -binCondOp logicOp +binCondOp value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 392, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 7, 4, 92, 10, 4, 12, 4, 14, 4, 95, 11, 4, 3, 5, 3, 5, 6, 5, 99, 10, 5, 13, 5, 14, 5, 100, 3, 6, 3, 6, 5, 6, 105, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 119, 10, 7, 3, 8, 3, 8, 5, 8, 123, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 167, 10, 17, 12, 17, 14, 17, 170, 11, 17, 5, 17, 172, 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 195, 10, 23, 12, 23, 14, 23, 198, 11, 23, 5, 23, 200, 10, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 215, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 225, 10, 24, 12, 24, 14, 24, 228, 11, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 236, 10, 25, 12, 25, 14, 25, 239, 11, 25, 5, 25, 241, 10, 25, 3, 25, 5, 25, 244, 10, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 7, 26, 251, 10, 26, 12, 26, 14, 26, 254, 11, 26, 3, 26, 7, 26, 257, 10, 26, 12, 26, 14, 26, 260, 11, 26, 3, 27, 3, 27, 5, 27, 264, 10, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 6, 29, 280, 10, 29, 13, 29, 14, 29, 281, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 288, 10, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 301, 10, 33, 3, 33, 7, 33, 304, 10, 33, 12, 33, 14, 33, 307, 11, 33, 3, 34, 3, 34, 3, 34, 6, 34, 312, 10, 34, 13, 34, 14, 34, 313, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 7, 36, 331, 10, 36, 12, 36, 14, 36, 334, 11, 36, 5, 36, 336, 10, 36, 3, 37, 3, 37, 3, 37, 7, 37, 341, 10, 37, 12, 37, 14, 37, 344, 11, 37, 5, 37, 346, 10, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 5, 38, 360, 10, 38, 3, 38, 3, 38, 3, 38, 3, 38, 7, 38, 366, 10, 38, 12, 38, 14, 38, 369, 11, 38, 3, 39, 3, 39, 7, 39, 373, 10, 39, 12, 39, 14, 39, 376, 11, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 5, 42, 390, 10, 42, 3, 42, 2, 4, 46, 74, 43, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 31, 32, 3, 2, 29, 30, 3, 2, 34, 39, 3, 2, 40, 41, 2, 401, 2, 84, 3, 2, 2, 2, 4, 87, 3, 2, 2, 2, 6, 93, 3, 2, 2, 2, 8, 98, 3, 2, 2, 2, 10, 104, 3, 2, 2, 2, 12, 118, 3, 2, 2, 2, 14, 122, 3, 2, 2, 2, 16, 124, 3, 2, 2, 2, 18, 130, 3, 2, 2, 2, 20, 140, 3, 2, 2, 2, 22, 146, 3, 2, 2, 2, 24, 153, 3, 2, 2, 2, 26, 156, 3, 2, 2, 2, 28, 158, 3, 2, 2, 2, 30, 160, 3, 2, 2, 2, 32, 162, 3, 2, 2, 2, 34, 175, 3, 2, 2, 2, 36, 179, 3, 2, 2, 2, 38, 184, 3, 2, 2, 2, 40, 186, 3, 2, 2, 2, 42, 188, 3, 2, 2, 2, 44, 190, 3, 2, 2, 2, 46, 214, 3, 2, 2, 2, 48, 229, 3, 2, 2, 2, 50, 252, 3, 2, 2, 2, 52, 263, 3, 2, 2, 2, 54, 265, 3, 2, 2, 2, 56, 272, 3, 2, 2, 2, 58, 283, 3, 2, 2, 2, 60, 287, 3, 2, 2, 2, 62, 289, 3, 2, 2, 2, 64, 305, 3, 2, 2, 2, 66, 308, 3, 2, 2, 2, 68, 318, 3, 2, 2, 2, 70, 335, 3, 2, 2, 2, 72, 345, 3, 2, 2, 2, 74, 359, 3, 2, 2, 2, 76, 370, 3, 2, 2, 2, 78, 379, 3, 2, 2, 2, 80, 381, 3, 2, 2, 2, 82, 389, 3, 2, 2, 2, 84, 85, 5, 4, 3, 2, 85, 86, 7, 2, 2, 3, 86, 3, 3, 2, 2, 2, 87, 88, 5, 6, 4, 2, 88, 89, 5, 8, 5, 2, 89, 5, 3, 2, 2, 2, 90, 92, 5, 10, 6, 2, 91, 90, 3, 2, 2, 2, 92, 95, 3, 2, 2, 2, 93, 91, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 7, 3, 2, 2, 2, 95, 93, 3, 2, 2, 2, 96, 99, 5, 12, 7, 2, 97, 99, 5, 76, 39, 2, 98, 96, 3, 2, 2, 2, 98, 97, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 98, 3, 2, 2, 2, 100, 101, 3, 2, 2, 2, 101, 9, 3, 2, 2, 2, 102, 105, 5, 48, 25, 2, 103, 105, 5, 68, 35, 2, 104, 102, 3, 2, 2, 2, 104, 103, 3, 2, 2, 2, 105, 11, 3, 2, 2, 2, 106, 119, 5, 66, 34, 2, 107, 119, 5, 34, 18, 2, 108, 119, 5, 36, 19, 2, 109, 119, 5, 14, 8, 2, 110, 119, 5, 20, 11, 2, 111, 119, 5, 24, 13, 2, 112, 119, 5, 28, 15, 2, 113, 119, 5, 22, 12, 2, 114, 119, 5, 30, 16, 2, 115, 119, 5, 54, 28, 2, 116, 119, 5, 62, 32, 2, 117, 119, 5, 44, 23, 2, 118, 106, 3, 2, 2, 2, 118, 107, 3, 2, 2, 2, 118, 108, 3, 2, 2, 2, 118, 109, 3, 2, 2, 2, 118, 110, 3, 2, 2, 2, 118, 111, 3, 2, 2, 2, 118, 112, 3, 2, 2, 2, 118, 113, 3, 2, 2, 2, 118, 114, 3, 2, 2, 2, 118, 115, 3, 2, 2, 2, 118, 116, 3, 2, 2, 2, 118, 117, 3, 2, 2, 2, 119, 13, 3, 2, 2, 2, 120, 123, 5, 16, 9, 2, 121, 123, 5, 18, 10, 2, 122, 120, 3, 2, 2, 2, 122, 121, 3, 2, 2, 2, 123, 15, 3, 2, 2, 2, 124, 125, 7, 3, 2, 2, 125, 126, 5, 74, 38, 2, 126, 127, 7, 4, 2, 2, 127, 128, 5, 8, 5, 2, 128, 129, 7, 5, 2, 2, 129, 17, 3, 2, 2, 2, 130, 131, 7, 3, 2, 2, 131, 132, 5, 74, 38, 2, 132, 133, 7, 4, 2, 2, 133, 134, 5, 8, 5, 2, 134, 135, 7, 5, 2, 2, 135, 136, 7, 6, 2, 2, 136, 137, 7, 4, 2, 2, 137, 138, 5, 8, 5, 2, 138, 139, 7, 5, 2, 2, 139, 19, 3, 2, 2, 2, 140, 141, 7, 7, 2, 2, 141, 142, 5, 82, 42, 2, 142, 143, 7, 4, 2, 2, 143, 144, 5, 8, 5, 2, 144, 145, 7, 5, 2, 2, 145, 21, 3, 2, 2, 2, 146, 147, 7, 8, 2, 2, 147, 148, 7, 9, 2, 2, 148, 149, 5, 46, 24, 2, 149, 150, 7, 10, 2, 2, 150, 151, 5, 46, 24, 2, 151, 152, 7, 11, 2, 2, 152, 23, 3, 2, 2, 2, 153, 154, 5, 26, 14, 2, 154, 155, 5, 46, 24, 2, 155, 25, 3, 2, 2, 2, 156, 157, 9, 2, 2, 2, 157, 27, 3, 2, 2, 2, 158, 159, 9, 3, 2, 2, 159, 29, 3, 2, 2, 2, 160, 161, 7, 18, 2, 2, 161, 31, 3, 2, 2, 2, 162, 171, 7, 4, 2, 2, 163, 168, 5, 46, 24, 2, 164, 165, 7, 10, 2, 2, 165, 167, 5, 46, 24, 2, 166, 164, 3, 2, 2, 2, 167, 170, 3, 2, 2, 2, 168, 166, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 172, 3, 2, 2, 2, 170, 168, 3, 2, 2, 2, 171, 163, 3, 2, 2, 2, 171, 172, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 174, 7, 5, 2, 2, 174, 33, 3, 2, 2, 2, 175, 176, 5, 60, 31, 2, 176, 177, 7, 19, 2, 2, 177, 178, 5, 46, 24, 2, 178, 35, 3, 2, 2, 2, 179, 180, 7, 20, 2, 2, 180, 181, 7, 9, 2, 2, 181, 182, 5, 46, 24, 2, 182, 183, 7, 11, 2, 2, 183, 37, 3, 2, 2, 2, 184, 185, 9, 4, 2, 2, 185, 39, 3, 2, 2, 2, 186, 187, 9, 5, 2, 2, 187, 41, 3, 2, 2, 2, 188, 189, 7, 30, 2, 2, 189, 43, 3, 2, 2, 2, 190, 199, 7, 21, 2, 2, 191, 196, 5, 46, 24, 2, 192, 193, 7, 10, 2, 2, 193, 195, 5, 46, 24, 2, 194, 192, 3, 2, 2, 2, 195, 198, 3, 2, 2, 2, 196, 194, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 200, 3, 2, 2, 2, 198, 196, 3, 2, 2, 2, 199, 191, 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, 45, 3, 2, 2, 2, 201, 202, 8, 24, 1, 2, 202, 203, 5, 42, 22, 2, 203, 204, 5, 46, 24, 8, 204, 215, 3, 2, 2, 2, 205, 206, 5, 60, 31, 2, 206, 207, 7, 19, 2, 2, 207, 208, 5, 46, 24, 5, 208, 215, 3, 2, 2, 2, 209, 210, 7, 9, 2, 2, 210, 211, 5, 46, 24, 2, 211, 212, 7, 11, 2, 2, 212, 215, 3, 2, 2, 2, 213, 215, 5, 82, 42, 2, 214, 201, 3, 2, 2, 2, 214, 205, 3, 2, 2, 2, 214, 209, 3, 2, 2, 2, 214, 213, 3, 2, 2, 2, 215, 226, 3, 2, 2, 2, 216, 217, 12, 7, 2, 2, 217, 218, 5, 38, 20, 2, 218, 219, 5, 46, 24, 8, 219, 225, 3, 2, 2, 2, 220, 221, 12, 6, 2, 2, 221, 222, 5, 40, 21, 2, 222, 223, 5, 46, 24, 7, 223, 225, 3, 2, 2, 2, 224, 216, 3, 2, 2, 2, 224, 220, 3, 2, 2, 2, 225, 228, 3, 2, 2, 2, 226, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 47, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 229, 230, 7, 22, 2, 2, 230, 243, 7, 45, 2, 2, 231, 232, 7, 9, 2, 2, 232, 240, 7, 45, 2, 2, 233, 237, 7, 10, 2, 2, 234, 236, 7, 45, 2, 2, 235, 234, 3, 2, 2, 2, 236, 239, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 241, 3, 2, 2, 2, 239, 237, 3, 2, 2, 2, 240, 233, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 244, 7, 11, 2, 2, 243, 231, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 246, 7, 23, 2, 2, 246, 247, 5, 50, 26, 2, 247, 248, 7, 24, 2, 2, 248, 49, 3, 2, 2, 2, 249, 251, 5, 52, 27, 2, 250, 249, 3, 2, 2, 2, 251, 254, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 258, 3, 2, 2, 2, 254, 252, 3, 2, 2, 2, 255, 257, 5, 68, 35, 2, 256, 255, 3, 2, 2, 2, 257, 260, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 258, 259, 3, 2, 2, 2, 259, 51, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 261, 264, 5, 34, 18, 2, 262, 264, 5, 54, 28, 2, 263, 261, 3, 2, 2, 2, 263, 262, 3, 2, 2, 2, 264, 53, 3, 2, 2, 2, 265, 266, 5, 60, 31, 2, 266, 267, 7, 19, 2, 2, 267, 268, 7, 25, 2, 2, 268, 269, 7, 45, 2, 2, 269, 270, 7, 9, 2, 2, 270, 271, 7, 11, 2, 2, 271, 55, 3, 2, 2, 2, 272, 279, 5, 58, 30, 2, 273, 274, 7, 26, 2, 2, 274, 280, 7, 45, 2, 2, 275, 276, 7, 4, 2, 2, 276, 277, 5, 46, 24, 2, 277, 278, 7, 5, 2, 2, 278, 280, 3, 2, 2, 2, 279, 273, 3, 2, 2, 2, 279, 275, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 57, 3, 2, 2, 2, 283, 284, 7, 45, 2, 2, 284, 59, 3, 2, 2, 2, 285, 288, 7, 45, 2, 2, 286, 288, 5, 56, 29, 2, 287, 285, 3, 2, 2, 2, 287, 286, 3, 2, 2, 2, 288, 61, 3, 2, 2, 2, 289, 290, 5, 64, 33, 2, 290, 291, 7, 46, 2, 2, 291, 292, 7, 9, 2, 2, 292, 293, 5, 72, 37, 2, 293, 294, 7, 11, 2, 2, 294, 63, 3, 2, 2, 2, 295, 301, 7, 45, 2, 2, 296, 297, 7, 4, 2, 2, 297, 298, 5, 46, 24, 2, 298, 299, 7, 5, 2, 2, 299, 301, 3, 2, 2, 2, 300, 295, 3, 2, 2, 2, 300, 296, 3, 2, 2, 2, 301, 302, 3, 2, 2, 2, 302, 304, 7, 26, 2, 2, 303, 300, 3, 2, 2, 2, 304, 307, 3, 2, 2, 2, 305, 303, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 65, 3, 2, 2, 2, 307, 305, 3, 2, 2, 2, 308, 311, 5, 60, 31, 2, 309, 310, 7, 10, 2, 2, 310, 312, 5, 60, 31, 2, 311, 309, 3, 2, 2, 2, 312, 313, 3, 2, 2, 2, 313, 311, 3, 2, 2, 2, 313, 314, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 316, 7, 19, 2, 2, 316, 317, 5, 62, 32, 2, 317, 67, 3, 2, 2, 2, 318, 319, 7, 27, 2, 2, 319, 320, 7, 46, 2, 2, 320, 321, 7, 9, 2, 2, 321, 322, 5, 70, 36, 2, 322, 323, 7, 11, 2, 2, 323, 324, 7, 23, 2, 2, 324, 325, 5, 8, 5, 2, 325, 326, 7, 24, 2, 2, 326, 69, 3, 2, 2, 2, 327, 332, 7, 45, 2, 2, 328, 329, 7, 10, 2, 2, 329, 331, 7, 45, 2, 2, 330, 328, 3, 2, 2, 2, 331, 334, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 332, 333, 3, 2, 2, 2, 333, 336, 3, 2, 2, 2, 334, 332, 3, 2, 2, 2, 335, 327, 3, 2, 2, 2, 335, 336, 3, 2, 2, 2, 336, 71, 3, 2, 2, 2, 337, 342, 5, 46, 24, 2, 338, 339, 7, 10, 2, 2, 339, 341, 5, 46, 24, 2, 340, 338, 3, 2, 2, 2, 341, 344, 3, 2, 2, 2, 342, 340, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 346, 3, 2, 2, 2, 344, 342, 3, 2, 2, 2, 345, 337, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 73, 3, 2, 2, 2, 347, 348, 8, 38, 1, 2, 348, 349, 7, 42, 2, 2, 349, 360, 5, 74, 38, 7, 350, 351, 5, 46, 24, 2, 351, 352, 5, 78, 40, 2, 352, 353, 5, 46, 24, 2, 353, 360, 3, 2, 2, 2, 354, 360, 7, 33, 2, 2, 355, 356, 7, 9, 2, 2, 356, 357, 5, 74, 38, 2, 357, 358, 7, 11, 2, 2, 358, 360, 3, 2, 2, 2, 359, 347, 3, 2, 2, 2, 359, 350, 3, 2, 2, 2, 359, 354, 3, 2, 2, 2, 359, 355, 3, 2, 2, 2, 360, 367, 3, 2, 2, 2, 361, 362, 12, 5, 2, 2, 362, 363, 5, 80, 41, 2, 363, 364, 5, 74, 38, 6, 364, 366, 3, 2, 2, 2, 365, 361, 3, 2, 2, 2, 366, 369, 3, 2, 2, 2, 367, 365, 3, 2, 2, 2, 367, 368, 3, 2, 2, 2, 368, 75, 3, 2, 2, 2, 369, 367, 3, 2, 2, 2, 370, 374, 7, 28, 2, 2, 371, 373, 7, 46, 2, 2, 372, 371, 3, 2, 2, 2, 373, 376, 3, 2, 2, 2, 374, 372, 3, 2, 2, 2, 374, 375, 3, 2, 2, 2, 375, 377, 3, 2, 2, 2, 376, 374, 3, 2, 2, 2, 377, 378, 7, 28, 2, 2, 378, 77, 3, 2, 2, 2, 379, 380, 9, 6, 2, 2, 380, 79, 3, 2, 2, 2, 381, 382, 9, 7, 2, 2, 382, 81, 3, 2, 2, 2, 383, 390, 7, 43, 2, 2, 384, 390, 7, 45, 2, 2, 385, 390, 5, 32, 17, 2, 386, 390, 5, 56, 29, 2, 387, 390, 5, 62, 32, 2, 388, 390, 7, 44, 2, 2, 389, 383, 3, 2, 2, 2, 389, 384, 3, 2, 2, 2, 389, 385, 3, 2, 2, 2, 389, 386, 3, 2, 2, 2, 389, 387, 3, 2, 2, 2, 389, 388, 3, 2, 2, 2, 390, 83, 3, 2, 2, 2, 35, 93, 98, 100, 104, 118, 122, 168, 171, 196, 199, 214, 224, 226, 237, 240, 243, 252, 258, 263, 279, 281, 287, 300, 305, 313, 332, 335, 342, 345, 359, 367, 374, 389] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 363, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 7, 4, 88, 10, 4, 12, 4, 14, 4, 91, 11, 4, 3, 5, 3, 5, 7, 5, 95, 10, 5, 12, 5, 14, 5, 98, 11, 5, 3, 6, 3, 6, 5, 6, 102, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 114, 10, 7, 3, 8, 3, 8, 5, 8, 118, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 162, 10, 17, 12, 17, 14, 17, 165, 11, 17, 5, 17, 167, 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 190, 10, 23, 12, 23, 14, 23, 193, 11, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 211, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 229, 10, 24, 12, 24, 14, 24, 232, 11, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 240, 10, 25, 12, 25, 14, 25, 243, 11, 25, 5, 25, 245, 10, 25, 3, 25, 5, 25, 248, 10, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 7, 26, 255, 10, 26, 12, 26, 14, 26, 258, 11, 26, 3, 26, 7, 26, 261, 10, 26, 12, 26, 14, 26, 264, 11, 26, 3, 27, 3, 27, 5, 27, 268, 10, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 6, 29, 284, 10, 29, 13, 29, 14, 29, 285, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 292, 10, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 305, 10, 33, 3, 33, 7, 33, 308, 10, 33, 12, 33, 14, 33, 311, 11, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 7, 35, 325, 10, 35, 12, 35, 14, 35, 328, 11, 35, 5, 35, 330, 10, 35, 3, 36, 3, 36, 3, 36, 7, 36, 335, 10, 36, 12, 36, 14, 36, 338, 11, 36, 5, 36, 340, 10, 36, 3, 37, 3, 37, 7, 37, 344, 10, 37, 12, 37, 14, 37, 347, 11, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 5, 40, 361, 10, 40, 3, 40, 2, 3, 46, 41, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 29, 30, 3, 2, 27, 28, 3, 2, 31, 32, 3, 2, 36, 41, 2, 370, 2, 80, 3, 2, 2, 2, 4, 83, 3, 2, 2, 2, 6, 89, 3, 2, 2, 2, 8, 96, 3, 2, 2, 2, 10, 101, 3, 2, 2, 2, 12, 113, 3, 2, 2, 2, 14, 117, 3, 2, 2, 2, 16, 119, 3, 2, 2, 2, 18, 125, 3, 2, 2, 2, 20, 135, 3, 2, 2, 2, 22, 141, 3, 2, 2, 2, 24, 148, 3, 2, 2, 2, 26, 151, 3, 2, 2, 2, 28, 153, 3, 2, 2, 2, 30, 155, 3, 2, 2, 2, 32, 157, 3, 2, 2, 2, 34, 170, 3, 2, 2, 2, 36, 174, 3, 2, 2, 2, 38, 179, 3, 2, 2, 2, 40, 181, 3, 2, 2, 2, 42, 183, 3, 2, 2, 2, 44, 185, 3, 2, 2, 2, 46, 210, 3, 2, 2, 2, 48, 233, 3, 2, 2, 2, 50, 256, 3, 2, 2, 2, 52, 267, 3, 2, 2, 2, 54, 269, 3, 2, 2, 2, 56, 276, 3, 2, 2, 2, 58, 287, 3, 2, 2, 2, 60, 291, 3, 2, 2, 2, 62, 293, 3, 2, 2, 2, 64, 309, 3, 2, 2, 2, 66, 312, 3, 2, 2, 2, 68, 329, 3, 2, 2, 2, 70, 339, 3, 2, 2, 2, 72, 341, 3, 2, 2, 2, 74, 350, 3, 2, 2, 2, 76, 352, 3, 2, 2, 2, 78, 360, 3, 2, 2, 2, 80, 81, 5, 4, 3, 2, 81, 82, 7, 2, 2, 3, 82, 3, 3, 2, 2, 2, 83, 84, 5, 6, 4, 2, 84, 85, 5, 8, 5, 2, 85, 5, 3, 2, 2, 2, 86, 88, 5, 10, 6, 2, 87, 86, 3, 2, 2, 2, 88, 91, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 7, 3, 2, 2, 2, 91, 89, 3, 2, 2, 2, 92, 95, 5, 12, 7, 2, 93, 95, 5, 72, 37, 2, 94, 92, 3, 2, 2, 2, 94, 93, 3, 2, 2, 2, 95, 98, 3, 2, 2, 2, 96, 94, 3, 2, 2, 2, 96, 97, 3, 2, 2, 2, 97, 9, 3, 2, 2, 2, 98, 96, 3, 2, 2, 2, 99, 102, 5, 48, 25, 2, 100, 102, 5, 66, 34, 2, 101, 99, 3, 2, 2, 2, 101, 100, 3, 2, 2, 2, 102, 11, 3, 2, 2, 2, 103, 114, 5, 36, 19, 2, 104, 114, 5, 14, 8, 2, 105, 114, 5, 20, 11, 2, 106, 114, 5, 24, 13, 2, 107, 114, 5, 28, 15, 2, 108, 114, 5, 22, 12, 2, 109, 114, 5, 30, 16, 2, 110, 114, 5, 54, 28, 2, 111, 114, 5, 46, 24, 2, 112, 114, 5, 44, 23, 2, 113, 103, 3, 2, 2, 2, 113, 104, 3, 2, 2, 2, 113, 105, 3, 2, 2, 2, 113, 106, 3, 2, 2, 2, 113, 107, 3, 2, 2, 2, 113, 108, 3, 2, 2, 2, 113, 109, 3, 2, 2, 2, 113, 110, 3, 2, 2, 2, 113, 111, 3, 2, 2, 2, 113, 112, 3, 2, 2, 2, 114, 13, 3, 2, 2, 2, 115, 118, 5, 16, 9, 2, 116, 118, 5, 18, 10, 2, 117, 115, 3, 2, 2, 2, 117, 116, 3, 2, 2, 2, 118, 15, 3, 2, 2, 2, 119, 120, 7, 3, 2, 2, 120, 121, 5, 46, 24, 2, 121, 122, 7, 4, 2, 2, 122, 123, 5, 8, 5, 2, 123, 124, 7, 5, 2, 2, 124, 17, 3, 2, 2, 2, 125, 126, 7, 3, 2, 2, 126, 127, 5, 46, 24, 2, 127, 128, 7, 4, 2, 2, 128, 129, 5, 8, 5, 2, 129, 130, 7, 5, 2, 2, 130, 131, 7, 6, 2, 2, 131, 132, 7, 4, 2, 2, 132, 133, 5, 8, 5, 2, 133, 134, 7, 5, 2, 2, 134, 19, 3, 2, 2, 2, 135, 136, 7, 7, 2, 2, 136, 137, 5, 78, 40, 2, 137, 138, 7, 4, 2, 2, 138, 139, 5, 8, 5, 2, 139, 140, 7, 5, 2, 2, 140, 21, 3, 2, 2, 2, 141, 142, 7, 8, 2, 2, 142, 143, 7, 9, 2, 2, 143, 144, 5, 46, 24, 2, 144, 145, 7, 10, 2, 2, 145, 146, 5, 46, 24, 2, 146, 147, 7, 11, 2, 2, 147, 23, 3, 2, 2, 2, 148, 149, 5, 26, 14, 2, 149, 150, 5, 46, 24, 2, 150, 25, 3, 2, 2, 2, 151, 152, 9, 2, 2, 2, 152, 27, 3, 2, 2, 2, 153, 154, 9, 3, 2, 2, 154, 29, 3, 2, 2, 2, 155, 156, 7, 18, 2, 2, 156, 31, 3, 2, 2, 2, 157, 166, 7, 4, 2, 2, 158, 163, 5, 46, 24, 2, 159, 160, 7, 10, 2, 2, 160, 162, 5, 46, 24, 2, 161, 159, 3, 2, 2, 2, 162, 165, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 167, 3, 2, 2, 2, 165, 163, 3, 2, 2, 2, 166, 158, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 7, 5, 2, 2, 169, 33, 3, 2, 2, 2, 170, 171, 5, 60, 31, 2, 171, 172, 7, 19, 2, 2, 172, 173, 5, 46, 24, 2, 173, 35, 3, 2, 2, 2, 174, 175, 7, 34, 2, 2, 175, 176, 7, 9, 2, 2, 176, 177, 5, 46, 24, 2, 177, 178, 7, 11, 2, 2, 178, 37, 3, 2, 2, 2, 179, 180, 9, 4, 2, 2, 180, 39, 3, 2, 2, 2, 181, 182, 9, 5, 2, 2, 182, 41, 3, 2, 2, 2, 183, 184, 7, 28, 2, 2, 184, 43, 3, 2, 2, 2, 185, 186, 7, 33, 2, 2, 186, 191, 5, 46, 24, 2, 187, 188, 7, 10, 2, 2, 188, 190, 5, 46, 24, 2, 189, 187, 3, 2, 2, 2, 190, 193, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 45, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 194, 195, 8, 24, 1, 2, 195, 196, 5, 42, 22, 2, 196, 197, 5, 46, 24, 12, 197, 211, 3, 2, 2, 2, 198, 199, 5, 60, 31, 2, 199, 200, 7, 19, 2, 2, 200, 201, 5, 46, 24, 9, 201, 211, 3, 2, 2, 2, 202, 203, 7, 9, 2, 2, 203, 204, 5, 46, 24, 2, 204, 205, 7, 11, 2, 2, 205, 211, 3, 2, 2, 2, 206, 211, 5, 78, 40, 2, 207, 208, 7, 42, 2, 2, 208, 211, 5, 46, 24, 6, 209, 211, 7, 35, 2, 2, 210, 194, 3, 2, 2, 2, 210, 198, 3, 2, 2, 2, 210, 202, 3, 2, 2, 2, 210, 206, 3, 2, 2, 2, 210, 207, 3, 2, 2, 2, 210, 209, 3, 2, 2, 2, 211, 230, 3, 2, 2, 2, 212, 213, 12, 11, 2, 2, 213, 214, 5, 38, 20, 2, 214, 215, 5, 46, 24, 12, 215, 229, 3, 2, 2, 2, 216, 217, 12, 10, 2, 2, 217, 218, 5, 40, 21, 2, 218, 219, 5, 46, 24, 11, 219, 229, 3, 2, 2, 2, 220, 221, 12, 5, 2, 2, 221, 222, 5, 76, 39, 2, 222, 223, 5, 46, 24, 6, 223, 229, 3, 2, 2, 2, 224, 225, 12, 4, 2, 2, 225, 226, 5, 74, 38, 2, 226, 227, 5, 46, 24, 5, 227, 229, 3, 2, 2, 2, 228, 212, 3, 2, 2, 2, 228, 216, 3, 2, 2, 2, 228, 220, 3, 2, 2, 2, 228, 224, 3, 2, 2, 2, 229, 232, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 47, 3, 2, 2, 2, 232, 230, 3, 2, 2, 2, 233, 234, 7, 20, 2, 2, 234, 247, 7, 45, 2, 2, 235, 236, 7, 9, 2, 2, 236, 244, 7, 45, 2, 2, 237, 241, 7, 10, 2, 2, 238, 240, 7, 45, 2, 2, 239, 238, 3, 2, 2, 2, 240, 243, 3, 2, 2, 2, 241, 239, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 244, 237, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 246, 3, 2, 2, 2, 246, 248, 7, 11, 2, 2, 247, 235, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 250, 7, 21, 2, 2, 250, 251, 5, 50, 26, 2, 251, 252, 7, 22, 2, 2, 252, 49, 3, 2, 2, 2, 253, 255, 5, 52, 27, 2, 254, 253, 3, 2, 2, 2, 255, 258, 3, 2, 2, 2, 256, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 262, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 259, 261, 5, 66, 34, 2, 260, 259, 3, 2, 2, 2, 261, 264, 3, 2, 2, 2, 262, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 51, 3, 2, 2, 2, 264, 262, 3, 2, 2, 2, 265, 268, 5, 34, 18, 2, 266, 268, 5, 54, 28, 2, 267, 265, 3, 2, 2, 2, 267, 266, 3, 2, 2, 2, 268, 53, 3, 2, 2, 2, 269, 270, 5, 60, 31, 2, 270, 271, 7, 19, 2, 2, 271, 272, 7, 23, 2, 2, 272, 273, 7, 45, 2, 2, 273, 274, 7, 9, 2, 2, 274, 275, 7, 11, 2, 2, 275, 55, 3, 2, 2, 2, 276, 283, 5, 58, 30, 2, 277, 278, 7, 24, 2, 2, 278, 284, 7, 45, 2, 2, 279, 280, 7, 4, 2, 2, 280, 281, 5, 46, 24, 2, 281, 282, 7, 5, 2, 2, 282, 284, 3, 2, 2, 2, 283, 277, 3, 2, 2, 2, 283, 279, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 283, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 57, 3, 2, 2, 2, 287, 288, 7, 45, 2, 2, 288, 59, 3, 2, 2, 2, 289, 292, 7, 45, 2, 2, 290, 292, 5, 56, 29, 2, 291, 289, 3, 2, 2, 2, 291, 290, 3, 2, 2, 2, 292, 61, 3, 2, 2, 2, 293, 294, 5, 64, 33, 2, 294, 295, 7, 46, 2, 2, 295, 296, 7, 9, 2, 2, 296, 297, 5, 70, 36, 2, 297, 298, 7, 11, 2, 2, 298, 63, 3, 2, 2, 2, 299, 305, 7, 45, 2, 2, 300, 301, 7, 4, 2, 2, 301, 302, 5, 46, 24, 2, 302, 303, 7, 5, 2, 2, 303, 305, 3, 2, 2, 2, 304, 299, 3, 2, 2, 2, 304, 300, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 308, 7, 24, 2, 2, 307, 304, 3, 2, 2, 2, 308, 311, 3, 2, 2, 2, 309, 307, 3, 2, 2, 2, 309, 310, 3, 2, 2, 2, 310, 65, 3, 2, 2, 2, 311, 309, 3, 2, 2, 2, 312, 313, 7, 25, 2, 2, 313, 314, 7, 46, 2, 2, 314, 315, 7, 9, 2, 2, 315, 316, 5, 68, 35, 2, 316, 317, 7, 11, 2, 2, 317, 318, 7, 21, 2, 2, 318, 319, 5, 8, 5, 2, 319, 320, 7, 22, 2, 2, 320, 67, 3, 2, 2, 2, 321, 326, 7, 45, 2, 2, 322, 323, 7, 10, 2, 2, 323, 325, 7, 45, 2, 2, 324, 322, 3, 2, 2, 2, 325, 328, 3, 2, 2, 2, 326, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 330, 3, 2, 2, 2, 328, 326, 3, 2, 2, 2, 329, 321, 3, 2, 2, 2, 329, 330, 3, 2, 2, 2, 330, 69, 3, 2, 2, 2, 331, 336, 5, 46, 24, 2, 332, 333, 7, 10, 2, 2, 333, 335, 5, 46, 24, 2, 334, 332, 3, 2, 2, 2, 335, 338, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 336, 337, 3, 2, 2, 2, 337, 340, 3, 2, 2, 2, 338, 336, 3, 2, 2, 2, 339, 331, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 71, 3, 2, 2, 2, 341, 345, 7, 26, 2, 2, 342, 344, 7, 46, 2, 2, 343, 342, 3, 2, 2, 2, 344, 347, 3, 2, 2, 2, 345, 343, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 348, 3, 2, 2, 2, 347, 345, 3, 2, 2, 2, 348, 349, 7, 26, 2, 2, 349, 73, 3, 2, 2, 2, 350, 351, 9, 6, 2, 2, 351, 75, 3, 2, 2, 2, 352, 353, 9, 7, 2, 2, 353, 77, 3, 2, 2, 2, 354, 361, 7, 43, 2, 2, 355, 361, 7, 45, 2, 2, 356, 361, 5, 32, 17, 2, 357, 361, 5, 56, 29, 2, 358, 361, 5, 62, 32, 2, 359, 361, 7, 44, 2, 2, 360, 354, 3, 2, 2, 2, 360, 355, 3, 2, 2, 2, 360, 356, 3, 2, 2, 2, 360, 357, 3, 2, 2, 2, 360, 358, 3, 2, 2, 2, 360, 359, 3, 2, 2, 2, 361, 79, 3, 2, 2, 2, 31, 89, 94, 96, 101, 113, 117, 163, 166, 191, 210, 228, 230, 241, 244, 247, 256, 262, 267, 283, 285, 291, 304, 309, 326, 329, 336, 339, 345, 360] \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.tokens b/ChironCore/turtparse/tlang.tokens index fc62d55..feb2c1e 100644 --- a/ChironCore/turtparse/tlang.tokens +++ b/ChironCore/turtparse/tlang.tokens @@ -22,21 +22,21 @@ T__20=21 T__21=22 T__22=23 T__23=24 -T__24=25 -T__25=26 -PLUS=27 -MINUS=28 -MUL=29 -DIV=30 -PENCOND=31 -LT=32 -GT=33 -EQ=34 -NEQ=35 -LTE=36 -GTE=37 -AND=38 -OR=39 +PLUS=25 +MINUS=26 +MUL=27 +DIV=28 +AND=29 +OR=30 +RETURN=31 +PRINT=32 +PENCOND=33 +LT=34 +GT=35 +EQ=36 +NEQ=37 +LTE=38 +GTE=39 NOT=40 NUM=41 REAL=42 @@ -60,26 +60,26 @@ Whitespace=45 'pendown'=15 'pause'=16 '='=17 -'print'=18 -'return'=19 -'class'=20 -'{'=21 -'}'=22 -'new'=23 -'.'=24 -'def'=25 -'#'=26 -'+'=27 -'-'=28 -'*'=29 -'/'=30 -'pendown?'=31 -'<'=32 -'>'=33 -'=='=34 -'!='=35 -'<='=36 -'>='=37 -'&&'=38 -'||'=39 +'class'=18 +'{'=19 +'}'=20 +'new'=21 +'.'=22 +'def'=23 +'#'=24 +'+'=25 +'-'=26 +'*'=27 +'/'=28 +'&&'=29 +'||'=30 +'return'=31 +'print'=32 +'pendown?'=33 +'<'=34 +'>'=35 +'=='=36 +'!='=37 +'<='=38 +'>='=39 '!'=40 diff --git a/ChironCore/turtparse/tlangLexer.interp b/ChironCore/turtparse/tlangLexer.interp index 8aeea7c..895e42b 100644 --- a/ChironCore/turtparse/tlangLexer.interp +++ b/ChironCore/turtparse/tlangLexer.interp @@ -17,8 +17,6 @@ null 'pendown' 'pause' '=' -'print' -'return' 'class' '{' '}' @@ -30,6 +28,10 @@ null '-' '*' '/' +'&&' +'||' +'return' +'print' 'pendown?' '<' '>' @@ -37,8 +39,6 @@ null '!=' '<=' '>=' -'&&' -'||' '!' null null @@ -72,12 +72,14 @@ null null null null -null -null PLUS MINUS MUL DIV +AND +OR +RETURN +PRINT PENCOND LT GT @@ -85,8 +87,6 @@ EQ NEQ LTE GTE -AND -OR NOT NUM REAL @@ -119,12 +119,14 @@ T__20 T__21 T__22 T__23 -T__24 -T__25 PLUS MINUS MUL DIV +AND +OR +RETURN +PRINT PENCOND LT GT @@ -132,8 +134,6 @@ EQ NEQ LTE GTE -AND -OR NOT NUM REAL @@ -149,4 +149,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 47, 295, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 251, 10, 42, 13, 42, 14, 42, 252, 3, 43, 6, 43, 256, 10, 43, 13, 43, 14, 43, 257, 3, 43, 3, 43, 6, 43, 262, 10, 43, 13, 43, 14, 43, 263, 5, 43, 266, 10, 43, 3, 44, 3, 44, 3, 44, 5, 44, 271, 10, 44, 3, 44, 3, 44, 7, 44, 275, 10, 44, 12, 44, 14, 44, 278, 11, 44, 3, 45, 3, 45, 5, 45, 282, 10, 45, 3, 45, 6, 45, 285, 10, 45, 13, 45, 14, 45, 286, 3, 46, 6, 46, 290, 10, 46, 13, 46, 14, 46, 291, 3, 46, 3, 46, 2, 2, 47, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 303, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 3, 93, 3, 2, 2, 2, 5, 96, 3, 2, 2, 2, 7, 98, 3, 2, 2, 2, 9, 100, 3, 2, 2, 2, 11, 105, 3, 2, 2, 2, 13, 112, 3, 2, 2, 2, 15, 117, 3, 2, 2, 2, 17, 119, 3, 2, 2, 2, 19, 121, 3, 2, 2, 2, 21, 123, 3, 2, 2, 2, 23, 131, 3, 2, 2, 2, 25, 140, 3, 2, 2, 2, 27, 145, 3, 2, 2, 2, 29, 151, 3, 2, 2, 2, 31, 157, 3, 2, 2, 2, 33, 165, 3, 2, 2, 2, 35, 171, 3, 2, 2, 2, 37, 173, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 186, 3, 2, 2, 2, 43, 192, 3, 2, 2, 2, 45, 194, 3, 2, 2, 2, 47, 196, 3, 2, 2, 2, 49, 200, 3, 2, 2, 2, 51, 202, 3, 2, 2, 2, 53, 206, 3, 2, 2, 2, 55, 208, 3, 2, 2, 2, 57, 210, 3, 2, 2, 2, 59, 212, 3, 2, 2, 2, 61, 214, 3, 2, 2, 2, 63, 216, 3, 2, 2, 2, 65, 225, 3, 2, 2, 2, 67, 227, 3, 2, 2, 2, 69, 229, 3, 2, 2, 2, 71, 232, 3, 2, 2, 2, 73, 235, 3, 2, 2, 2, 75, 238, 3, 2, 2, 2, 77, 241, 3, 2, 2, 2, 79, 244, 3, 2, 2, 2, 81, 247, 3, 2, 2, 2, 83, 250, 3, 2, 2, 2, 85, 255, 3, 2, 2, 2, 87, 267, 3, 2, 2, 2, 89, 281, 3, 2, 2, 2, 91, 289, 3, 2, 2, 2, 93, 94, 7, 107, 2, 2, 94, 95, 7, 104, 2, 2, 95, 4, 3, 2, 2, 2, 96, 97, 7, 93, 2, 2, 97, 6, 3, 2, 2, 2, 98, 99, 7, 95, 2, 2, 99, 8, 3, 2, 2, 2, 100, 101, 7, 103, 2, 2, 101, 102, 7, 110, 2, 2, 102, 103, 7, 117, 2, 2, 103, 104, 7, 103, 2, 2, 104, 10, 3, 2, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 114, 2, 2, 108, 109, 7, 103, 2, 2, 109, 110, 7, 99, 2, 2, 110, 111, 7, 118, 2, 2, 111, 12, 3, 2, 2, 2, 112, 113, 7, 105, 2, 2, 113, 114, 7, 113, 2, 2, 114, 115, 7, 118, 2, 2, 115, 116, 7, 113, 2, 2, 116, 14, 3, 2, 2, 2, 117, 118, 7, 42, 2, 2, 118, 16, 3, 2, 2, 2, 119, 120, 7, 46, 2, 2, 120, 18, 3, 2, 2, 2, 121, 122, 7, 43, 2, 2, 122, 20, 3, 2, 2, 2, 123, 124, 7, 104, 2, 2, 124, 125, 7, 113, 2, 2, 125, 126, 7, 116, 2, 2, 126, 127, 7, 121, 2, 2, 127, 128, 7, 99, 2, 2, 128, 129, 7, 116, 2, 2, 129, 130, 7, 102, 2, 2, 130, 22, 3, 2, 2, 2, 131, 132, 7, 100, 2, 2, 132, 133, 7, 99, 2, 2, 133, 134, 7, 101, 2, 2, 134, 135, 7, 109, 2, 2, 135, 136, 7, 121, 2, 2, 136, 137, 7, 99, 2, 2, 137, 138, 7, 116, 2, 2, 138, 139, 7, 102, 2, 2, 139, 24, 3, 2, 2, 2, 140, 141, 7, 110, 2, 2, 141, 142, 7, 103, 2, 2, 142, 143, 7, 104, 2, 2, 143, 144, 7, 118, 2, 2, 144, 26, 3, 2, 2, 2, 145, 146, 7, 116, 2, 2, 146, 147, 7, 107, 2, 2, 147, 148, 7, 105, 2, 2, 148, 149, 7, 106, 2, 2, 149, 150, 7, 118, 2, 2, 150, 28, 3, 2, 2, 2, 151, 152, 7, 114, 2, 2, 152, 153, 7, 103, 2, 2, 153, 154, 7, 112, 2, 2, 154, 155, 7, 119, 2, 2, 155, 156, 7, 114, 2, 2, 156, 30, 3, 2, 2, 2, 157, 158, 7, 114, 2, 2, 158, 159, 7, 103, 2, 2, 159, 160, 7, 112, 2, 2, 160, 161, 7, 102, 2, 2, 161, 162, 7, 113, 2, 2, 162, 163, 7, 121, 2, 2, 163, 164, 7, 112, 2, 2, 164, 32, 3, 2, 2, 2, 165, 166, 7, 114, 2, 2, 166, 167, 7, 99, 2, 2, 167, 168, 7, 119, 2, 2, 168, 169, 7, 117, 2, 2, 169, 170, 7, 103, 2, 2, 170, 34, 3, 2, 2, 2, 171, 172, 7, 63, 2, 2, 172, 36, 3, 2, 2, 2, 173, 174, 7, 114, 2, 2, 174, 175, 7, 116, 2, 2, 175, 176, 7, 107, 2, 2, 176, 177, 7, 112, 2, 2, 177, 178, 7, 118, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 116, 2, 2, 180, 181, 7, 103, 2, 2, 181, 182, 7, 118, 2, 2, 182, 183, 7, 119, 2, 2, 183, 184, 7, 116, 2, 2, 184, 185, 7, 112, 2, 2, 185, 40, 3, 2, 2, 2, 186, 187, 7, 101, 2, 2, 187, 188, 7, 110, 2, 2, 188, 189, 7, 99, 2, 2, 189, 190, 7, 117, 2, 2, 190, 191, 7, 117, 2, 2, 191, 42, 3, 2, 2, 2, 192, 193, 7, 125, 2, 2, 193, 44, 3, 2, 2, 2, 194, 195, 7, 127, 2, 2, 195, 46, 3, 2, 2, 2, 196, 197, 7, 112, 2, 2, 197, 198, 7, 103, 2, 2, 198, 199, 7, 121, 2, 2, 199, 48, 3, 2, 2, 2, 200, 201, 7, 48, 2, 2, 201, 50, 3, 2, 2, 2, 202, 203, 7, 102, 2, 2, 203, 204, 7, 103, 2, 2, 204, 205, 7, 104, 2, 2, 205, 52, 3, 2, 2, 2, 206, 207, 7, 37, 2, 2, 207, 54, 3, 2, 2, 2, 208, 209, 7, 45, 2, 2, 209, 56, 3, 2, 2, 2, 210, 211, 7, 47, 2, 2, 211, 58, 3, 2, 2, 2, 212, 213, 7, 44, 2, 2, 213, 60, 3, 2, 2, 2, 214, 215, 7, 49, 2, 2, 215, 62, 3, 2, 2, 2, 216, 217, 7, 114, 2, 2, 217, 218, 7, 103, 2, 2, 218, 219, 7, 112, 2, 2, 219, 220, 7, 102, 2, 2, 220, 221, 7, 113, 2, 2, 221, 222, 7, 121, 2, 2, 222, 223, 7, 112, 2, 2, 223, 224, 7, 65, 2, 2, 224, 64, 3, 2, 2, 2, 225, 226, 7, 62, 2, 2, 226, 66, 3, 2, 2, 2, 227, 228, 7, 64, 2, 2, 228, 68, 3, 2, 2, 2, 229, 230, 7, 63, 2, 2, 230, 231, 7, 63, 2, 2, 231, 70, 3, 2, 2, 2, 232, 233, 7, 35, 2, 2, 233, 234, 7, 63, 2, 2, 234, 72, 3, 2, 2, 2, 235, 236, 7, 62, 2, 2, 236, 237, 7, 63, 2, 2, 237, 74, 3, 2, 2, 2, 238, 239, 7, 64, 2, 2, 239, 240, 7, 63, 2, 2, 240, 76, 3, 2, 2, 2, 241, 242, 7, 40, 2, 2, 242, 243, 7, 40, 2, 2, 243, 78, 3, 2, 2, 2, 244, 245, 7, 126, 2, 2, 245, 246, 7, 126, 2, 2, 246, 80, 3, 2, 2, 2, 247, 248, 7, 35, 2, 2, 248, 82, 3, 2, 2, 2, 249, 251, 9, 2, 2, 2, 250, 249, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 84, 3, 2, 2, 2, 254, 256, 9, 2, 2, 2, 255, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 265, 3, 2, 2, 2, 259, 261, 7, 48, 2, 2, 260, 262, 9, 2, 2, 2, 261, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 266, 3, 2, 2, 2, 265, 259, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 86, 3, 2, 2, 2, 267, 270, 7, 60, 2, 2, 268, 269, 7, 97, 2, 2, 269, 271, 7, 97, 2, 2, 270, 268, 3, 2, 2, 2, 270, 271, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 276, 9, 3, 2, 2, 273, 275, 9, 4, 2, 2, 274, 273, 3, 2, 2, 2, 275, 278, 3, 2, 2, 2, 276, 274, 3, 2, 2, 2, 276, 277, 3, 2, 2, 2, 277, 88, 3, 2, 2, 2, 278, 276, 3, 2, 2, 2, 279, 280, 7, 97, 2, 2, 280, 282, 7, 97, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 284, 3, 2, 2, 2, 283, 285, 9, 5, 2, 2, 284, 283, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 90, 3, 2, 2, 2, 288, 290, 9, 6, 2, 2, 289, 288, 3, 2, 2, 2, 290, 291, 3, 2, 2, 2, 291, 289, 3, 2, 2, 2, 291, 292, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 294, 8, 46, 2, 2, 294, 92, 3, 2, 2, 2, 12, 2, 252, 257, 263, 265, 270, 276, 281, 286, 291, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 47, 295, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 6, 42, 251, 10, 42, 13, 42, 14, 42, 252, 3, 43, 6, 43, 256, 10, 43, 13, 43, 14, 43, 257, 3, 43, 3, 43, 6, 43, 262, 10, 43, 13, 43, 14, 43, 263, 5, 43, 266, 10, 43, 3, 44, 3, 44, 3, 44, 5, 44, 271, 10, 44, 3, 44, 3, 44, 7, 44, 275, 10, 44, 12, 44, 14, 44, 278, 11, 44, 3, 45, 3, 45, 5, 45, 282, 10, 45, 3, 45, 6, 45, 285, 10, 45, 13, 45, 14, 45, 286, 3, 46, 6, 46, 290, 10, 46, 13, 46, 14, 46, 291, 3, 46, 3, 46, 2, 2, 47, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 3, 2, 7, 3, 2, 50, 59, 5, 2, 67, 92, 97, 97, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 4, 2, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 303, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 3, 93, 3, 2, 2, 2, 5, 96, 3, 2, 2, 2, 7, 98, 3, 2, 2, 2, 9, 100, 3, 2, 2, 2, 11, 105, 3, 2, 2, 2, 13, 112, 3, 2, 2, 2, 15, 117, 3, 2, 2, 2, 17, 119, 3, 2, 2, 2, 19, 121, 3, 2, 2, 2, 21, 123, 3, 2, 2, 2, 23, 131, 3, 2, 2, 2, 25, 140, 3, 2, 2, 2, 27, 145, 3, 2, 2, 2, 29, 151, 3, 2, 2, 2, 31, 157, 3, 2, 2, 2, 33, 165, 3, 2, 2, 2, 35, 171, 3, 2, 2, 2, 37, 173, 3, 2, 2, 2, 39, 179, 3, 2, 2, 2, 41, 181, 3, 2, 2, 2, 43, 183, 3, 2, 2, 2, 45, 187, 3, 2, 2, 2, 47, 189, 3, 2, 2, 2, 49, 193, 3, 2, 2, 2, 51, 195, 3, 2, 2, 2, 53, 197, 3, 2, 2, 2, 55, 199, 3, 2, 2, 2, 57, 201, 3, 2, 2, 2, 59, 203, 3, 2, 2, 2, 61, 206, 3, 2, 2, 2, 63, 209, 3, 2, 2, 2, 65, 216, 3, 2, 2, 2, 67, 222, 3, 2, 2, 2, 69, 231, 3, 2, 2, 2, 71, 233, 3, 2, 2, 2, 73, 235, 3, 2, 2, 2, 75, 238, 3, 2, 2, 2, 77, 241, 3, 2, 2, 2, 79, 244, 3, 2, 2, 2, 81, 247, 3, 2, 2, 2, 83, 250, 3, 2, 2, 2, 85, 255, 3, 2, 2, 2, 87, 267, 3, 2, 2, 2, 89, 281, 3, 2, 2, 2, 91, 289, 3, 2, 2, 2, 93, 94, 7, 107, 2, 2, 94, 95, 7, 104, 2, 2, 95, 4, 3, 2, 2, 2, 96, 97, 7, 93, 2, 2, 97, 6, 3, 2, 2, 2, 98, 99, 7, 95, 2, 2, 99, 8, 3, 2, 2, 2, 100, 101, 7, 103, 2, 2, 101, 102, 7, 110, 2, 2, 102, 103, 7, 117, 2, 2, 103, 104, 7, 103, 2, 2, 104, 10, 3, 2, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 114, 2, 2, 108, 109, 7, 103, 2, 2, 109, 110, 7, 99, 2, 2, 110, 111, 7, 118, 2, 2, 111, 12, 3, 2, 2, 2, 112, 113, 7, 105, 2, 2, 113, 114, 7, 113, 2, 2, 114, 115, 7, 118, 2, 2, 115, 116, 7, 113, 2, 2, 116, 14, 3, 2, 2, 2, 117, 118, 7, 42, 2, 2, 118, 16, 3, 2, 2, 2, 119, 120, 7, 46, 2, 2, 120, 18, 3, 2, 2, 2, 121, 122, 7, 43, 2, 2, 122, 20, 3, 2, 2, 2, 123, 124, 7, 104, 2, 2, 124, 125, 7, 113, 2, 2, 125, 126, 7, 116, 2, 2, 126, 127, 7, 121, 2, 2, 127, 128, 7, 99, 2, 2, 128, 129, 7, 116, 2, 2, 129, 130, 7, 102, 2, 2, 130, 22, 3, 2, 2, 2, 131, 132, 7, 100, 2, 2, 132, 133, 7, 99, 2, 2, 133, 134, 7, 101, 2, 2, 134, 135, 7, 109, 2, 2, 135, 136, 7, 121, 2, 2, 136, 137, 7, 99, 2, 2, 137, 138, 7, 116, 2, 2, 138, 139, 7, 102, 2, 2, 139, 24, 3, 2, 2, 2, 140, 141, 7, 110, 2, 2, 141, 142, 7, 103, 2, 2, 142, 143, 7, 104, 2, 2, 143, 144, 7, 118, 2, 2, 144, 26, 3, 2, 2, 2, 145, 146, 7, 116, 2, 2, 146, 147, 7, 107, 2, 2, 147, 148, 7, 105, 2, 2, 148, 149, 7, 106, 2, 2, 149, 150, 7, 118, 2, 2, 150, 28, 3, 2, 2, 2, 151, 152, 7, 114, 2, 2, 152, 153, 7, 103, 2, 2, 153, 154, 7, 112, 2, 2, 154, 155, 7, 119, 2, 2, 155, 156, 7, 114, 2, 2, 156, 30, 3, 2, 2, 2, 157, 158, 7, 114, 2, 2, 158, 159, 7, 103, 2, 2, 159, 160, 7, 112, 2, 2, 160, 161, 7, 102, 2, 2, 161, 162, 7, 113, 2, 2, 162, 163, 7, 121, 2, 2, 163, 164, 7, 112, 2, 2, 164, 32, 3, 2, 2, 2, 165, 166, 7, 114, 2, 2, 166, 167, 7, 99, 2, 2, 167, 168, 7, 119, 2, 2, 168, 169, 7, 117, 2, 2, 169, 170, 7, 103, 2, 2, 170, 34, 3, 2, 2, 2, 171, 172, 7, 63, 2, 2, 172, 36, 3, 2, 2, 2, 173, 174, 7, 101, 2, 2, 174, 175, 7, 110, 2, 2, 175, 176, 7, 99, 2, 2, 176, 177, 7, 117, 2, 2, 177, 178, 7, 117, 2, 2, 178, 38, 3, 2, 2, 2, 179, 180, 7, 125, 2, 2, 180, 40, 3, 2, 2, 2, 181, 182, 7, 127, 2, 2, 182, 42, 3, 2, 2, 2, 183, 184, 7, 112, 2, 2, 184, 185, 7, 103, 2, 2, 185, 186, 7, 121, 2, 2, 186, 44, 3, 2, 2, 2, 187, 188, 7, 48, 2, 2, 188, 46, 3, 2, 2, 2, 189, 190, 7, 102, 2, 2, 190, 191, 7, 103, 2, 2, 191, 192, 7, 104, 2, 2, 192, 48, 3, 2, 2, 2, 193, 194, 7, 37, 2, 2, 194, 50, 3, 2, 2, 2, 195, 196, 7, 45, 2, 2, 196, 52, 3, 2, 2, 2, 197, 198, 7, 47, 2, 2, 198, 54, 3, 2, 2, 2, 199, 200, 7, 44, 2, 2, 200, 56, 3, 2, 2, 2, 201, 202, 7, 49, 2, 2, 202, 58, 3, 2, 2, 2, 203, 204, 7, 40, 2, 2, 204, 205, 7, 40, 2, 2, 205, 60, 3, 2, 2, 2, 206, 207, 7, 126, 2, 2, 207, 208, 7, 126, 2, 2, 208, 62, 3, 2, 2, 2, 209, 210, 7, 116, 2, 2, 210, 211, 7, 103, 2, 2, 211, 212, 7, 118, 2, 2, 212, 213, 7, 119, 2, 2, 213, 214, 7, 116, 2, 2, 214, 215, 7, 112, 2, 2, 215, 64, 3, 2, 2, 2, 216, 217, 7, 114, 2, 2, 217, 218, 7, 116, 2, 2, 218, 219, 7, 107, 2, 2, 219, 220, 7, 112, 2, 2, 220, 221, 7, 118, 2, 2, 221, 66, 3, 2, 2, 2, 222, 223, 7, 114, 2, 2, 223, 224, 7, 103, 2, 2, 224, 225, 7, 112, 2, 2, 225, 226, 7, 102, 2, 2, 226, 227, 7, 113, 2, 2, 227, 228, 7, 121, 2, 2, 228, 229, 7, 112, 2, 2, 229, 230, 7, 65, 2, 2, 230, 68, 3, 2, 2, 2, 231, 232, 7, 62, 2, 2, 232, 70, 3, 2, 2, 2, 233, 234, 7, 64, 2, 2, 234, 72, 3, 2, 2, 2, 235, 236, 7, 63, 2, 2, 236, 237, 7, 63, 2, 2, 237, 74, 3, 2, 2, 2, 238, 239, 7, 35, 2, 2, 239, 240, 7, 63, 2, 2, 240, 76, 3, 2, 2, 2, 241, 242, 7, 62, 2, 2, 242, 243, 7, 63, 2, 2, 243, 78, 3, 2, 2, 2, 244, 245, 7, 64, 2, 2, 245, 246, 7, 63, 2, 2, 246, 80, 3, 2, 2, 2, 247, 248, 7, 35, 2, 2, 248, 82, 3, 2, 2, 2, 249, 251, 9, 2, 2, 2, 250, 249, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 84, 3, 2, 2, 2, 254, 256, 9, 2, 2, 2, 255, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 265, 3, 2, 2, 2, 259, 261, 7, 48, 2, 2, 260, 262, 9, 2, 2, 2, 261, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 266, 3, 2, 2, 2, 265, 259, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 86, 3, 2, 2, 2, 267, 270, 7, 60, 2, 2, 268, 269, 7, 97, 2, 2, 269, 271, 7, 97, 2, 2, 270, 268, 3, 2, 2, 2, 270, 271, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 276, 9, 3, 2, 2, 273, 275, 9, 4, 2, 2, 274, 273, 3, 2, 2, 2, 275, 278, 3, 2, 2, 2, 276, 274, 3, 2, 2, 2, 276, 277, 3, 2, 2, 2, 277, 88, 3, 2, 2, 2, 278, 276, 3, 2, 2, 2, 279, 280, 7, 97, 2, 2, 280, 282, 7, 97, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 284, 3, 2, 2, 2, 283, 285, 9, 5, 2, 2, 284, 283, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 90, 3, 2, 2, 2, 288, 290, 9, 6, 2, 2, 289, 288, 3, 2, 2, 2, 290, 291, 3, 2, 2, 2, 291, 289, 3, 2, 2, 2, 291, 292, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 294, 8, 46, 2, 2, 294, 92, 3, 2, 2, 2, 12, 2, 252, 257, 263, 265, 270, 276, 281, 286, 291, 3, 8, 2, 2] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangLexer.py b/ChironCore/turtparse/tlangLexer.py index 2d9c195..4f24906 100644 --- a/ChironCore/turtparse/tlangLexer.py +++ b/ChironCore/turtparse/tlangLexer.py @@ -23,49 +23,49 @@ def serializedATN(): buf.write("\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3") buf.write("\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20") buf.write("\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23") - buf.write("\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25") - buf.write("\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30") - buf.write("\3\30\3\30\3\31\3\31\3\32\3\32\3\32\3\32\3\33\3\33\3\34") - buf.write("\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3 \3 \3 \3 \3 \3 ") - buf.write("\3 \3 \3 \3!\3!\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3&") - buf.write("\3&\3&\3\'\3\'\3\'\3(\3(\3(\3)\3)\3*\6*\u00fb\n*\r*\16") - buf.write("*\u00fc\3+\6+\u0100\n+\r+\16+\u0101\3+\3+\6+\u0106\n+") - buf.write("\r+\16+\u0107\5+\u010a\n+\3,\3,\3,\5,\u010f\n,\3,\3,\7") - buf.write(",\u0113\n,\f,\16,\u0116\13,\3-\3-\5-\u011a\n-\3-\6-\u011d") - buf.write("\n-\r-\16-\u011e\3.\6.\u0122\n.\r.\16.\u0123\3.\3.\2\2") - buf.write("/\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31") - buf.write("\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31") - buf.write("\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O") - buf.write(")Q*S+U,W-Y.[/\3\2\7\3\2\62;\5\2C\\aac|\5\2\62;C\\c|\4") - buf.write("\2C\\c|\5\2\13\f\17\17\"\"\2\u012f\2\3\3\2\2\2\2\5\3\2") - buf.write("\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2") - buf.write("\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2") - buf.write("\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37") - buf.write("\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2") - buf.write("\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2") - buf.write("\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2") - buf.write("\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2") - buf.write("\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2") - buf.write("\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3") - buf.write("\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\3]\3\2\2\2\5`\3\2\2\2\7b") - buf.write("\3\2\2\2\td\3\2\2\2\13i\3\2\2\2\rp\3\2\2\2\17u\3\2\2\2") - buf.write("\21w\3\2\2\2\23y\3\2\2\2\25{\3\2\2\2\27\u0083\3\2\2\2") - buf.write("\31\u008c\3\2\2\2\33\u0091\3\2\2\2\35\u0097\3\2\2\2\37") - buf.write("\u009d\3\2\2\2!\u00a5\3\2\2\2#\u00ab\3\2\2\2%\u00ad\3") - buf.write("\2\2\2\'\u00b3\3\2\2\2)\u00ba\3\2\2\2+\u00c0\3\2\2\2-") - buf.write("\u00c2\3\2\2\2/\u00c4\3\2\2\2\61\u00c8\3\2\2\2\63\u00ca") - buf.write("\3\2\2\2\65\u00ce\3\2\2\2\67\u00d0\3\2\2\29\u00d2\3\2") - buf.write("\2\2;\u00d4\3\2\2\2=\u00d6\3\2\2\2?\u00d8\3\2\2\2A\u00e1") - buf.write("\3\2\2\2C\u00e3\3\2\2\2E\u00e5\3\2\2\2G\u00e8\3\2\2\2") - buf.write("I\u00eb\3\2\2\2K\u00ee\3\2\2\2M\u00f1\3\2\2\2O\u00f4\3") - buf.write("\2\2\2Q\u00f7\3\2\2\2S\u00fa\3\2\2\2U\u00ff\3\2\2\2W\u010b") - buf.write("\3\2\2\2Y\u0119\3\2\2\2[\u0121\3\2\2\2]^\7k\2\2^_\7h\2") - buf.write("\2_\4\3\2\2\2`a\7]\2\2a\6\3\2\2\2bc\7_\2\2c\b\3\2\2\2") - buf.write("de\7g\2\2ef\7n\2\2fg\7u\2\2gh\7g\2\2h\n\3\2\2\2ij\7t\2") - buf.write("\2jk\7g\2\2kl\7r\2\2lm\7g\2\2mn\7c\2\2no\7v\2\2o\f\3\2") - buf.write("\2\2pq\7i\2\2qr\7q\2\2rs\7v\2\2st\7q\2\2t\16\3\2\2\2u") - buf.write("v\7*\2\2v\20\3\2\2\2wx\7.\2\2x\22\3\2\2\2yz\7+\2\2z\24") - buf.write("\3\2\2\2{|\7h\2\2|}\7q\2\2}~\7t\2\2~\177\7y\2\2\177\u0080") + buf.write("\3\23\3\23\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\26\3\26") + buf.write("\3\27\3\27\3\30\3\30\3\30\3\30\3\31\3\31\3\32\3\32\3\33") + buf.write("\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\36\3\37\3\37\3\37") + buf.write("\3 \3 \3 \3 \3 \3 \3 \3!\3!\3!\3!\3!\3!\3\"\3\"\3\"\3") + buf.write("\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3$\3$\3%\3%\3%\3&\3&\3&\3") + buf.write("\'\3\'\3\'\3(\3(\3(\3)\3)\3*\6*\u00fb\n*\r*\16*\u00fc") + buf.write("\3+\6+\u0100\n+\r+\16+\u0101\3+\3+\6+\u0106\n+\r+\16+") + buf.write("\u0107\5+\u010a\n+\3,\3,\3,\5,\u010f\n,\3,\3,\7,\u0113") + buf.write("\n,\f,\16,\u0116\13,\3-\3-\5-\u011a\n-\3-\6-\u011d\n-") + buf.write("\r-\16-\u011e\3.\6.\u0122\n.\r.\16.\u0123\3.\3.\2\2/\3") + buf.write("\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16") + buf.write("\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61") + buf.write("\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*") + buf.write("S+U,W-Y.[/\3\2\7\3\2\62;\5\2C\\aac|\5\2\62;C\\c|\4\2C") + buf.write("\\c|\5\2\13\f\17\17\"\"\2\u012f\2\3\3\2\2\2\2\5\3\2\2") + buf.write("\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2") + buf.write("\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27") + buf.write("\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3") + buf.write("\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2") + buf.write(")\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2") + buf.write("\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2") + buf.write(";\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2") + buf.write("\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2") + buf.write("\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2") + buf.write("\2\2\2Y\3\2\2\2\2[\3\2\2\2\3]\3\2\2\2\5`\3\2\2\2\7b\3") + buf.write("\2\2\2\td\3\2\2\2\13i\3\2\2\2\rp\3\2\2\2\17u\3\2\2\2\21") + buf.write("w\3\2\2\2\23y\3\2\2\2\25{\3\2\2\2\27\u0083\3\2\2\2\31") + buf.write("\u008c\3\2\2\2\33\u0091\3\2\2\2\35\u0097\3\2\2\2\37\u009d") + buf.write("\3\2\2\2!\u00a5\3\2\2\2#\u00ab\3\2\2\2%\u00ad\3\2\2\2") + buf.write("\'\u00b3\3\2\2\2)\u00b5\3\2\2\2+\u00b7\3\2\2\2-\u00bb") + buf.write("\3\2\2\2/\u00bd\3\2\2\2\61\u00c1\3\2\2\2\63\u00c3\3\2") + buf.write("\2\2\65\u00c5\3\2\2\2\67\u00c7\3\2\2\29\u00c9\3\2\2\2") + buf.write(";\u00cb\3\2\2\2=\u00ce\3\2\2\2?\u00d1\3\2\2\2A\u00d8\3") + buf.write("\2\2\2C\u00de\3\2\2\2E\u00e7\3\2\2\2G\u00e9\3\2\2\2I\u00eb") + buf.write("\3\2\2\2K\u00ee\3\2\2\2M\u00f1\3\2\2\2O\u00f4\3\2\2\2") + buf.write("Q\u00f7\3\2\2\2S\u00fa\3\2\2\2U\u00ff\3\2\2\2W\u010b\3") + buf.write("\2\2\2Y\u0119\3\2\2\2[\u0121\3\2\2\2]^\7k\2\2^_\7h\2\2") + buf.write("_\4\3\2\2\2`a\7]\2\2a\6\3\2\2\2bc\7_\2\2c\b\3\2\2\2de") + buf.write("\7g\2\2ef\7n\2\2fg\7u\2\2gh\7g\2\2h\n\3\2\2\2ij\7t\2\2") + buf.write("jk\7g\2\2kl\7r\2\2lm\7g\2\2mn\7c\2\2no\7v\2\2o\f\3\2\2") + buf.write("\2pq\7i\2\2qr\7q\2\2rs\7v\2\2st\7q\2\2t\16\3\2\2\2uv\7") + buf.write("*\2\2v\20\3\2\2\2wx\7.\2\2x\22\3\2\2\2yz\7+\2\2z\24\3") + buf.write("\2\2\2{|\7h\2\2|}\7q\2\2}~\7t\2\2~\177\7y\2\2\177\u0080") buf.write("\7c\2\2\u0080\u0081\7t\2\2\u0081\u0082\7f\2\2\u0082\26") buf.write("\3\2\2\2\u0083\u0084\7d\2\2\u0084\u0085\7c\2\2\u0085\u0086") buf.write("\7e\2\2\u0086\u0087\7m\2\2\u0087\u0088\7y\2\2\u0088\u0089") @@ -81,31 +81,31 @@ def serializedATN(): buf.write("\7p\2\2\u00a4 \3\2\2\2\u00a5\u00a6\7r\2\2\u00a6\u00a7") buf.write("\7c\2\2\u00a7\u00a8\7w\2\2\u00a8\u00a9\7u\2\2\u00a9\u00aa") buf.write("\7g\2\2\u00aa\"\3\2\2\2\u00ab\u00ac\7?\2\2\u00ac$\3\2") - buf.write("\2\2\u00ad\u00ae\7r\2\2\u00ae\u00af\7t\2\2\u00af\u00b0") - buf.write("\7k\2\2\u00b0\u00b1\7p\2\2\u00b1\u00b2\7v\2\2\u00b2&\3") - buf.write("\2\2\2\u00b3\u00b4\7t\2\2\u00b4\u00b5\7g\2\2\u00b5\u00b6") - buf.write("\7v\2\2\u00b6\u00b7\7w\2\2\u00b7\u00b8\7t\2\2\u00b8\u00b9") - buf.write("\7p\2\2\u00b9(\3\2\2\2\u00ba\u00bb\7e\2\2\u00bb\u00bc") - buf.write("\7n\2\2\u00bc\u00bd\7c\2\2\u00bd\u00be\7u\2\2\u00be\u00bf") - buf.write("\7u\2\2\u00bf*\3\2\2\2\u00c0\u00c1\7}\2\2\u00c1,\3\2\2") - buf.write("\2\u00c2\u00c3\7\177\2\2\u00c3.\3\2\2\2\u00c4\u00c5\7") - buf.write("p\2\2\u00c5\u00c6\7g\2\2\u00c6\u00c7\7y\2\2\u00c7\60\3") - buf.write("\2\2\2\u00c8\u00c9\7\60\2\2\u00c9\62\3\2\2\2\u00ca\u00cb") - buf.write("\7f\2\2\u00cb\u00cc\7g\2\2\u00cc\u00cd\7h\2\2\u00cd\64") - buf.write("\3\2\2\2\u00ce\u00cf\7%\2\2\u00cf\66\3\2\2\2\u00d0\u00d1") - buf.write("\7-\2\2\u00d18\3\2\2\2\u00d2\u00d3\7/\2\2\u00d3:\3\2\2") - buf.write("\2\u00d4\u00d5\7,\2\2\u00d5<\3\2\2\2\u00d6\u00d7\7\61") - buf.write("\2\2\u00d7>\3\2\2\2\u00d8\u00d9\7r\2\2\u00d9\u00da\7g") - buf.write("\2\2\u00da\u00db\7p\2\2\u00db\u00dc\7f\2\2\u00dc\u00dd") - buf.write("\7q\2\2\u00dd\u00de\7y\2\2\u00de\u00df\7p\2\2\u00df\u00e0") - buf.write("\7A\2\2\u00e0@\3\2\2\2\u00e1\u00e2\7>\2\2\u00e2B\3\2\2") - buf.write("\2\u00e3\u00e4\7@\2\2\u00e4D\3\2\2\2\u00e5\u00e6\7?\2") - buf.write("\2\u00e6\u00e7\7?\2\2\u00e7F\3\2\2\2\u00e8\u00e9\7#\2") - buf.write("\2\u00e9\u00ea\7?\2\2\u00eaH\3\2\2\2\u00eb\u00ec\7>\2") - buf.write("\2\u00ec\u00ed\7?\2\2\u00edJ\3\2\2\2\u00ee\u00ef\7@\2") - buf.write("\2\u00ef\u00f0\7?\2\2\u00f0L\3\2\2\2\u00f1\u00f2\7(\2") - buf.write("\2\u00f2\u00f3\7(\2\2\u00f3N\3\2\2\2\u00f4\u00f5\7~\2") - buf.write("\2\u00f5\u00f6\7~\2\2\u00f6P\3\2\2\2\u00f7\u00f8\7#\2") + buf.write("\2\2\u00ad\u00ae\7e\2\2\u00ae\u00af\7n\2\2\u00af\u00b0") + buf.write("\7c\2\2\u00b0\u00b1\7u\2\2\u00b1\u00b2\7u\2\2\u00b2&\3") + buf.write("\2\2\2\u00b3\u00b4\7}\2\2\u00b4(\3\2\2\2\u00b5\u00b6\7") + buf.write("\177\2\2\u00b6*\3\2\2\2\u00b7\u00b8\7p\2\2\u00b8\u00b9") + buf.write("\7g\2\2\u00b9\u00ba\7y\2\2\u00ba,\3\2\2\2\u00bb\u00bc") + buf.write("\7\60\2\2\u00bc.\3\2\2\2\u00bd\u00be\7f\2\2\u00be\u00bf") + buf.write("\7g\2\2\u00bf\u00c0\7h\2\2\u00c0\60\3\2\2\2\u00c1\u00c2") + buf.write("\7%\2\2\u00c2\62\3\2\2\2\u00c3\u00c4\7-\2\2\u00c4\64\3") + buf.write("\2\2\2\u00c5\u00c6\7/\2\2\u00c6\66\3\2\2\2\u00c7\u00c8") + buf.write("\7,\2\2\u00c88\3\2\2\2\u00c9\u00ca\7\61\2\2\u00ca:\3\2") + buf.write("\2\2\u00cb\u00cc\7(\2\2\u00cc\u00cd\7(\2\2\u00cd<\3\2") + buf.write("\2\2\u00ce\u00cf\7~\2\2\u00cf\u00d0\7~\2\2\u00d0>\3\2") + buf.write("\2\2\u00d1\u00d2\7t\2\2\u00d2\u00d3\7g\2\2\u00d3\u00d4") + buf.write("\7v\2\2\u00d4\u00d5\7w\2\2\u00d5\u00d6\7t\2\2\u00d6\u00d7") + buf.write("\7p\2\2\u00d7@\3\2\2\2\u00d8\u00d9\7r\2\2\u00d9\u00da") + buf.write("\7t\2\2\u00da\u00db\7k\2\2\u00db\u00dc\7p\2\2\u00dc\u00dd") + buf.write("\7v\2\2\u00ddB\3\2\2\2\u00de\u00df\7r\2\2\u00df\u00e0") + buf.write("\7g\2\2\u00e0\u00e1\7p\2\2\u00e1\u00e2\7f\2\2\u00e2\u00e3") + buf.write("\7q\2\2\u00e3\u00e4\7y\2\2\u00e4\u00e5\7p\2\2\u00e5\u00e6") + buf.write("\7A\2\2\u00e6D\3\2\2\2\u00e7\u00e8\7>\2\2\u00e8F\3\2\2") + buf.write("\2\u00e9\u00ea\7@\2\2\u00eaH\3\2\2\2\u00eb\u00ec\7?\2") + buf.write("\2\u00ec\u00ed\7?\2\2\u00edJ\3\2\2\2\u00ee\u00ef\7#\2") + buf.write("\2\u00ef\u00f0\7?\2\2\u00f0L\3\2\2\2\u00f1\u00f2\7>\2") + buf.write("\2\u00f2\u00f3\7?\2\2\u00f3N\3\2\2\2\u00f4\u00f5\7@\2") + buf.write("\2\u00f5\u00f6\7?\2\2\u00f6P\3\2\2\2\u00f7\u00f8\7#\2") buf.write("\2\u00f8R\3\2\2\2\u00f9\u00fb\t\2\2\2\u00fa\u00f9\3\2") buf.write("\2\2\u00fb\u00fc\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd") buf.write("\3\2\2\2\u00fdT\3\2\2\2\u00fe\u0100\t\2\2\2\u00ff\u00fe") @@ -161,21 +161,21 @@ class tlangLexer(Lexer): T__21 = 22 T__22 = 23 T__23 = 24 - T__24 = 25 - T__25 = 26 - PLUS = 27 - MINUS = 28 - MUL = 29 - DIV = 30 - PENCOND = 31 - LT = 32 - GT = 33 - EQ = 34 - NEQ = 35 - LTE = 36 - GTE = 37 - AND = 38 - OR = 39 + PLUS = 25 + MINUS = 26 + MUL = 27 + DIV = 28 + AND = 29 + OR = 30 + RETURN = 31 + PRINT = 32 + PENCOND = 33 + LT = 34 + GT = 35 + EQ = 36 + NEQ = 37 + LTE = 38 + GTE = 39 NOT = 40 NUM = 41 REAL = 42 @@ -190,23 +190,23 @@ class tlangLexer(Lexer): literalNames = [ "", "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", - "'penup'", "'pendown'", "'pause'", "'='", "'print'", "'return'", - "'class'", "'{'", "'}'", "'new'", "'.'", "'def'", "'#'", "'+'", - "'-'", "'*'", "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", - "'<='", "'>='", "'&&'", "'||'", "'!'" ] + "'penup'", "'pendown'", "'pause'", "'='", "'class'", "'{'", + "'}'", "'new'", "'.'", "'def'", "'#'", "'+'", "'-'", "'*'", + "'/'", "'&&'", "'||'", "'return'", "'print'", "'pendown?'", + "'<'", "'>'", "'=='", "'!='", "'<='", "'>='", "'!'" ] symbolicNames = [ "", - "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", - "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", - "NAME", "Whitespace" ] + "PLUS", "MINUS", "MUL", "DIV", "AND", "OR", "RETURN", "PRINT", + "PENCOND", "LT", "GT", "EQ", "NEQ", "LTE", "GTE", "NOT", "NUM", + "REAL", "VAR", "NAME", "Whitespace" ] ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", - "T__20", "T__21", "T__22", "T__23", "T__24", "T__25", - "PLUS", "MINUS", "MUL", "DIV", "PENCOND", "LT", "GT", - "EQ", "NEQ", "LTE", "GTE", "AND", "OR", "NOT", "NUM", - "REAL", "VAR", "NAME", "Whitespace" ] + "T__20", "T__21", "T__22", "T__23", "PLUS", "MINUS", "MUL", + "DIV", "AND", "OR", "RETURN", "PRINT", "PENCOND", "LT", + "GT", "EQ", "NEQ", "LTE", "GTE", "NOT", "NUM", "REAL", + "VAR", "NAME", "Whitespace" ] grammarFileName = "tlang.g4" diff --git a/ChironCore/turtparse/tlangLexer.tokens b/ChironCore/turtparse/tlangLexer.tokens index fc62d55..feb2c1e 100644 --- a/ChironCore/turtparse/tlangLexer.tokens +++ b/ChironCore/turtparse/tlangLexer.tokens @@ -22,21 +22,21 @@ T__20=21 T__21=22 T__22=23 T__23=24 -T__24=25 -T__25=26 -PLUS=27 -MINUS=28 -MUL=29 -DIV=30 -PENCOND=31 -LT=32 -GT=33 -EQ=34 -NEQ=35 -LTE=36 -GTE=37 -AND=38 -OR=39 +PLUS=25 +MINUS=26 +MUL=27 +DIV=28 +AND=29 +OR=30 +RETURN=31 +PRINT=32 +PENCOND=33 +LT=34 +GT=35 +EQ=36 +NEQ=37 +LTE=38 +GTE=39 NOT=40 NUM=41 REAL=42 @@ -60,26 +60,26 @@ Whitespace=45 'pendown'=15 'pause'=16 '='=17 -'print'=18 -'return'=19 -'class'=20 -'{'=21 -'}'=22 -'new'=23 -'.'=24 -'def'=25 -'#'=26 -'+'=27 -'-'=28 -'*'=29 -'/'=30 -'pendown?'=31 -'<'=32 -'>'=33 -'=='=34 -'!='=35 -'<='=36 -'>='=37 -'&&'=38 -'||'=39 +'class'=18 +'{'=19 +'}'=20 +'new'=21 +'.'=22 +'def'=23 +'#'=24 +'+'=25 +'-'=26 +'*'=27 +'/'=28 +'&&'=29 +'||'=30 +'return'=31 +'print'=32 +'pendown?'=33 +'<'=34 +'>'=35 +'=='=36 +'!='=37 +'<='=38 +'>='=39 '!'=40 diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index bf384cd..d5d0cd0 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -9,176 +9,163 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3/") - buf.write("\u0188\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\u016b\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36") buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t") - buf.write("&\4\'\t\'\4(\t(\4)\t)\4*\t*\3\2\3\2\3\2\3\3\3\3\3\3\3") - buf.write("\4\7\4\\\n\4\f\4\16\4_\13\4\3\5\3\5\6\5c\n\5\r\5\16\5") - buf.write("d\3\6\3\6\5\6i\n\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7") - buf.write("\3\7\3\7\3\7\5\7w\n\7\3\b\3\b\5\b{\n\b\3\t\3\t\3\t\3\t") - buf.write("\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13") - buf.write("\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f") - buf.write("\3\r\3\r\3\r\3\16\3\16\3\17\3\17\3\20\3\20\3\21\3\21\3") - buf.write("\21\3\21\7\21\u00a7\n\21\f\21\16\21\u00aa\13\21\5\21\u00ac") - buf.write("\n\21\3\21\3\21\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23") - buf.write("\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\27\3\27") - buf.write("\7\27\u00c3\n\27\f\27\16\27\u00c6\13\27\5\27\u00c8\n\27") - buf.write("\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30") - buf.write("\3\30\3\30\5\30\u00d7\n\30\3\30\3\30\3\30\3\30\3\30\3") - buf.write("\30\3\30\3\30\7\30\u00e1\n\30\f\30\16\30\u00e4\13\30\3") - buf.write("\31\3\31\3\31\3\31\3\31\3\31\7\31\u00ec\n\31\f\31\16\31") - buf.write("\u00ef\13\31\5\31\u00f1\n\31\3\31\5\31\u00f4\n\31\3\31") - buf.write("\3\31\3\31\3\31\3\32\7\32\u00fb\n\32\f\32\16\32\u00fe") - buf.write("\13\32\3\32\7\32\u0101\n\32\f\32\16\32\u0104\13\32\3\33") - buf.write("\3\33\5\33\u0108\n\33\3\34\3\34\3\34\3\34\3\34\3\34\3") - buf.write("\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\6\35\u0118\n\35") - buf.write("\r\35\16\35\u0119\3\36\3\36\3\37\3\37\5\37\u0120\n\37") - buf.write("\3 \3 \3 \3 \3 \3 \3!\3!\3!\3!\3!\5!\u012d\n!\3!\7!\u0130") - buf.write("\n!\f!\16!\u0133\13!\3\"\3\"\3\"\6\"\u0138\n\"\r\"\16") - buf.write("\"\u0139\3\"\3\"\3\"\3#\3#\3#\3#\3#\3#\3#\3#\3#\3$\3$") - buf.write("\3$\7$\u014b\n$\f$\16$\u014e\13$\5$\u0150\n$\3%\3%\3%") - buf.write("\7%\u0155\n%\f%\16%\u0158\13%\5%\u015a\n%\3&\3&\3&\3&") - buf.write("\3&\3&\3&\3&\3&\3&\3&\3&\5&\u0168\n&\3&\3&\3&\3&\7&\u016e") - buf.write("\n&\f&\16&\u0171\13&\3\'\3\'\7\'\u0175\n\'\f\'\16\'\u0178") - buf.write("\13\'\3\'\3\'\3(\3(\3)\3)\3*\3*\3*\3*\3*\3*\5*\u0186\n") - buf.write("*\3*\2\4.J+\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"") - buf.write("$&(*,.\60\62\64\668:<>@BDFHJLNPR\2\b\3\2\f\17\3\2\20\21") - buf.write("\3\2\37 \3\2\35\36\3\2\"\'\3\2()\2\u0191\2T\3\2\2\2\4") - buf.write("W\3\2\2\2\6]\3\2\2\2\bb\3\2\2\2\nh\3\2\2\2\fv\3\2\2\2") - buf.write("\16z\3\2\2\2\20|\3\2\2\2\22\u0082\3\2\2\2\24\u008c\3\2") - buf.write("\2\2\26\u0092\3\2\2\2\30\u0099\3\2\2\2\32\u009c\3\2\2") - buf.write("\2\34\u009e\3\2\2\2\36\u00a0\3\2\2\2 \u00a2\3\2\2\2\"") - buf.write("\u00af\3\2\2\2$\u00b3\3\2\2\2&\u00b8\3\2\2\2(\u00ba\3") - buf.write("\2\2\2*\u00bc\3\2\2\2,\u00be\3\2\2\2.\u00d6\3\2\2\2\60") - buf.write("\u00e5\3\2\2\2\62\u00fc\3\2\2\2\64\u0107\3\2\2\2\66\u0109") - buf.write("\3\2\2\28\u0110\3\2\2\2:\u011b\3\2\2\2<\u011f\3\2\2\2") - buf.write(">\u0121\3\2\2\2@\u0131\3\2\2\2B\u0134\3\2\2\2D\u013e\3") - buf.write("\2\2\2F\u014f\3\2\2\2H\u0159\3\2\2\2J\u0167\3\2\2\2L\u0172") - buf.write("\3\2\2\2N\u017b\3\2\2\2P\u017d\3\2\2\2R\u0185\3\2\2\2") - buf.write("TU\5\4\3\2UV\7\2\2\3V\3\3\2\2\2WX\5\6\4\2XY\5\b\5\2Y\5") - buf.write("\3\2\2\2Z\\\5\n\6\2[Z\3\2\2\2\\_\3\2\2\2][\3\2\2\2]^\3") - buf.write("\2\2\2^\7\3\2\2\2_]\3\2\2\2`c\5\f\7\2ac\5L\'\2b`\3\2\2") - buf.write("\2ba\3\2\2\2cd\3\2\2\2db\3\2\2\2de\3\2\2\2e\t\3\2\2\2") - buf.write("fi\5\60\31\2gi\5D#\2hf\3\2\2\2hg\3\2\2\2i\13\3\2\2\2j") - buf.write("w\5B\"\2kw\5\"\22\2lw\5$\23\2mw\5\16\b\2nw\5\24\13\2o") - buf.write("w\5\30\r\2pw\5\34\17\2qw\5\26\f\2rw\5\36\20\2sw\5\66\34") - buf.write("\2tw\5> \2uw\5,\27\2vj\3\2\2\2vk\3\2\2\2vl\3\2\2\2vm\3") - buf.write("\2\2\2vn\3\2\2\2vo\3\2\2\2vp\3\2\2\2vq\3\2\2\2vr\3\2\2") - buf.write("\2vs\3\2\2\2vt\3\2\2\2vu\3\2\2\2w\r\3\2\2\2x{\5\20\t\2") - buf.write("y{\5\22\n\2zx\3\2\2\2zy\3\2\2\2{\17\3\2\2\2|}\7\3\2\2") - buf.write("}~\5J&\2~\177\7\4\2\2\177\u0080\5\b\5\2\u0080\u0081\7") - buf.write("\5\2\2\u0081\21\3\2\2\2\u0082\u0083\7\3\2\2\u0083\u0084") - buf.write("\5J&\2\u0084\u0085\7\4\2\2\u0085\u0086\5\b\5\2\u0086\u0087") - buf.write("\7\5\2\2\u0087\u0088\7\6\2\2\u0088\u0089\7\4\2\2\u0089") - buf.write("\u008a\5\b\5\2\u008a\u008b\7\5\2\2\u008b\23\3\2\2\2\u008c") - buf.write("\u008d\7\7\2\2\u008d\u008e\5R*\2\u008e\u008f\7\4\2\2\u008f") - buf.write("\u0090\5\b\5\2\u0090\u0091\7\5\2\2\u0091\25\3\2\2\2\u0092") - buf.write("\u0093\7\b\2\2\u0093\u0094\7\t\2\2\u0094\u0095\5.\30\2") - buf.write("\u0095\u0096\7\n\2\2\u0096\u0097\5.\30\2\u0097\u0098\7") - buf.write("\13\2\2\u0098\27\3\2\2\2\u0099\u009a\5\32\16\2\u009a\u009b") - buf.write("\5.\30\2\u009b\31\3\2\2\2\u009c\u009d\t\2\2\2\u009d\33") - buf.write("\3\2\2\2\u009e\u009f\t\3\2\2\u009f\35\3\2\2\2\u00a0\u00a1") - buf.write("\7\22\2\2\u00a1\37\3\2\2\2\u00a2\u00ab\7\4\2\2\u00a3\u00a8") - buf.write("\5.\30\2\u00a4\u00a5\7\n\2\2\u00a5\u00a7\5.\30\2\u00a6") - buf.write("\u00a4\3\2\2\2\u00a7\u00aa\3\2\2\2\u00a8\u00a6\3\2\2\2") - buf.write("\u00a8\u00a9\3\2\2\2\u00a9\u00ac\3\2\2\2\u00aa\u00a8\3") - buf.write("\2\2\2\u00ab\u00a3\3\2\2\2\u00ab\u00ac\3\2\2\2\u00ac\u00ad") - buf.write("\3\2\2\2\u00ad\u00ae\7\5\2\2\u00ae!\3\2\2\2\u00af\u00b0") - buf.write("\5<\37\2\u00b0\u00b1\7\23\2\2\u00b1\u00b2\5.\30\2\u00b2") - buf.write("#\3\2\2\2\u00b3\u00b4\7\24\2\2\u00b4\u00b5\7\t\2\2\u00b5") - buf.write("\u00b6\5.\30\2\u00b6\u00b7\7\13\2\2\u00b7%\3\2\2\2\u00b8") - buf.write("\u00b9\t\4\2\2\u00b9\'\3\2\2\2\u00ba\u00bb\t\5\2\2\u00bb") - buf.write(")\3\2\2\2\u00bc\u00bd\7\36\2\2\u00bd+\3\2\2\2\u00be\u00c7") - buf.write("\7\25\2\2\u00bf\u00c4\5.\30\2\u00c0\u00c1\7\n\2\2\u00c1") - buf.write("\u00c3\5.\30\2\u00c2\u00c0\3\2\2\2\u00c3\u00c6\3\2\2\2") - buf.write("\u00c4\u00c2\3\2\2\2\u00c4\u00c5\3\2\2\2\u00c5\u00c8\3") - buf.write("\2\2\2\u00c6\u00c4\3\2\2\2\u00c7\u00bf\3\2\2\2\u00c7\u00c8") - buf.write("\3\2\2\2\u00c8-\3\2\2\2\u00c9\u00ca\b\30\1\2\u00ca\u00cb") - buf.write("\5*\26\2\u00cb\u00cc\5.\30\b\u00cc\u00d7\3\2\2\2\u00cd") - buf.write("\u00ce\5<\37\2\u00ce\u00cf\7\23\2\2\u00cf\u00d0\5.\30") - buf.write("\5\u00d0\u00d7\3\2\2\2\u00d1\u00d2\7\t\2\2\u00d2\u00d3") - buf.write("\5.\30\2\u00d3\u00d4\7\13\2\2\u00d4\u00d7\3\2\2\2\u00d5") - buf.write("\u00d7\5R*\2\u00d6\u00c9\3\2\2\2\u00d6\u00cd\3\2\2\2\u00d6") - buf.write("\u00d1\3\2\2\2\u00d6\u00d5\3\2\2\2\u00d7\u00e2\3\2\2\2") - buf.write("\u00d8\u00d9\f\7\2\2\u00d9\u00da\5&\24\2\u00da\u00db\5") - buf.write(".\30\b\u00db\u00e1\3\2\2\2\u00dc\u00dd\f\6\2\2\u00dd\u00de") - buf.write("\5(\25\2\u00de\u00df\5.\30\7\u00df\u00e1\3\2\2\2\u00e0") - buf.write("\u00d8\3\2\2\2\u00e0\u00dc\3\2\2\2\u00e1\u00e4\3\2\2\2") - buf.write("\u00e2\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3/\3\2\2") - buf.write("\2\u00e4\u00e2\3\2\2\2\u00e5\u00e6\7\26\2\2\u00e6\u00f3") - buf.write("\7-\2\2\u00e7\u00e8\7\t\2\2\u00e8\u00f0\7-\2\2\u00e9\u00ed") - buf.write("\7\n\2\2\u00ea\u00ec\7-\2\2\u00eb\u00ea\3\2\2\2\u00ec") - buf.write("\u00ef\3\2\2\2\u00ed\u00eb\3\2\2\2\u00ed\u00ee\3\2\2\2") - buf.write("\u00ee\u00f1\3\2\2\2\u00ef\u00ed\3\2\2\2\u00f0\u00e9\3") - buf.write("\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f2\3\2\2\2\u00f2\u00f4") - buf.write("\7\13\2\2\u00f3\u00e7\3\2\2\2\u00f3\u00f4\3\2\2\2\u00f4") - buf.write("\u00f5\3\2\2\2\u00f5\u00f6\7\27\2\2\u00f6\u00f7\5\62\32") - buf.write("\2\u00f7\u00f8\7\30\2\2\u00f8\61\3\2\2\2\u00f9\u00fb\5") - buf.write("\64\33\2\u00fa\u00f9\3\2\2\2\u00fb\u00fe\3\2\2\2\u00fc") - buf.write("\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\u0102\3\2\2\2") - buf.write("\u00fe\u00fc\3\2\2\2\u00ff\u0101\5D#\2\u0100\u00ff\3\2") - buf.write("\2\2\u0101\u0104\3\2\2\2\u0102\u0100\3\2\2\2\u0102\u0103") - buf.write("\3\2\2\2\u0103\63\3\2\2\2\u0104\u0102\3\2\2\2\u0105\u0108") - buf.write("\5\"\22\2\u0106\u0108\5\66\34\2\u0107\u0105\3\2\2\2\u0107") - buf.write("\u0106\3\2\2\2\u0108\65\3\2\2\2\u0109\u010a\5<\37\2\u010a") - buf.write("\u010b\7\23\2\2\u010b\u010c\7\31\2\2\u010c\u010d\7-\2") - buf.write("\2\u010d\u010e\7\t\2\2\u010e\u010f\7\13\2\2\u010f\67\3") - buf.write("\2\2\2\u0110\u0117\5:\36\2\u0111\u0112\7\32\2\2\u0112") - buf.write("\u0118\7-\2\2\u0113\u0114\7\4\2\2\u0114\u0115\5.\30\2") - buf.write("\u0115\u0116\7\5\2\2\u0116\u0118\3\2\2\2\u0117\u0111\3") - buf.write("\2\2\2\u0117\u0113\3\2\2\2\u0118\u0119\3\2\2\2\u0119\u0117") - buf.write("\3\2\2\2\u0119\u011a\3\2\2\2\u011a9\3\2\2\2\u011b\u011c") - buf.write("\7-\2\2\u011c;\3\2\2\2\u011d\u0120\7-\2\2\u011e\u0120") - buf.write("\58\35\2\u011f\u011d\3\2\2\2\u011f\u011e\3\2\2\2\u0120") - buf.write("=\3\2\2\2\u0121\u0122\5@!\2\u0122\u0123\7.\2\2\u0123\u0124") - buf.write("\7\t\2\2\u0124\u0125\5H%\2\u0125\u0126\7\13\2\2\u0126") - buf.write("?\3\2\2\2\u0127\u012d\7-\2\2\u0128\u0129\7\4\2\2\u0129") - buf.write("\u012a\5.\30\2\u012a\u012b\7\5\2\2\u012b\u012d\3\2\2\2") - buf.write("\u012c\u0127\3\2\2\2\u012c\u0128\3\2\2\2\u012d\u012e\3") - buf.write("\2\2\2\u012e\u0130\7\32\2\2\u012f\u012c\3\2\2\2\u0130") - buf.write("\u0133\3\2\2\2\u0131\u012f\3\2\2\2\u0131\u0132\3\2\2\2") - buf.write("\u0132A\3\2\2\2\u0133\u0131\3\2\2\2\u0134\u0137\5<\37") - buf.write("\2\u0135\u0136\7\n\2\2\u0136\u0138\5<\37\2\u0137\u0135") - buf.write("\3\2\2\2\u0138\u0139\3\2\2\2\u0139\u0137\3\2\2\2\u0139") - buf.write("\u013a\3\2\2\2\u013a\u013b\3\2\2\2\u013b\u013c\7\23\2") - buf.write("\2\u013c\u013d\5> \2\u013dC\3\2\2\2\u013e\u013f\7\33\2") - buf.write("\2\u013f\u0140\7.\2\2\u0140\u0141\7\t\2\2\u0141\u0142") - buf.write("\5F$\2\u0142\u0143\7\13\2\2\u0143\u0144\7\27\2\2\u0144") - buf.write("\u0145\5\b\5\2\u0145\u0146\7\30\2\2\u0146E\3\2\2\2\u0147") - buf.write("\u014c\7-\2\2\u0148\u0149\7\n\2\2\u0149\u014b\7-\2\2\u014a") - buf.write("\u0148\3\2\2\2\u014b\u014e\3\2\2\2\u014c\u014a\3\2\2\2") - buf.write("\u014c\u014d\3\2\2\2\u014d\u0150\3\2\2\2\u014e\u014c\3") - buf.write("\2\2\2\u014f\u0147\3\2\2\2\u014f\u0150\3\2\2\2\u0150G") - buf.write("\3\2\2\2\u0151\u0156\5.\30\2\u0152\u0153\7\n\2\2\u0153") - buf.write("\u0155\5.\30\2\u0154\u0152\3\2\2\2\u0155\u0158\3\2\2\2") - buf.write("\u0156\u0154\3\2\2\2\u0156\u0157\3\2\2\2\u0157\u015a\3") - buf.write("\2\2\2\u0158\u0156\3\2\2\2\u0159\u0151\3\2\2\2\u0159\u015a") - buf.write("\3\2\2\2\u015aI\3\2\2\2\u015b\u015c\b&\1\2\u015c\u015d") - buf.write("\7*\2\2\u015d\u0168\5J&\7\u015e\u015f\5.\30\2\u015f\u0160") - buf.write("\5N(\2\u0160\u0161\5.\30\2\u0161\u0168\3\2\2\2\u0162\u0168") - buf.write("\7!\2\2\u0163\u0164\7\t\2\2\u0164\u0165\5J&\2\u0165\u0166") - buf.write("\7\13\2\2\u0166\u0168\3\2\2\2\u0167\u015b\3\2\2\2\u0167") - buf.write("\u015e\3\2\2\2\u0167\u0162\3\2\2\2\u0167\u0163\3\2\2\2") - buf.write("\u0168\u016f\3\2\2\2\u0169\u016a\f\5\2\2\u016a\u016b\5") - buf.write("P)\2\u016b\u016c\5J&\6\u016c\u016e\3\2\2\2\u016d\u0169") - buf.write("\3\2\2\2\u016e\u0171\3\2\2\2\u016f\u016d\3\2\2\2\u016f") - buf.write("\u0170\3\2\2\2\u0170K\3\2\2\2\u0171\u016f\3\2\2\2\u0172") - buf.write("\u0176\7\34\2\2\u0173\u0175\7.\2\2\u0174\u0173\3\2\2\2") - buf.write("\u0175\u0178\3\2\2\2\u0176\u0174\3\2\2\2\u0176\u0177\3") - buf.write("\2\2\2\u0177\u0179\3\2\2\2\u0178\u0176\3\2\2\2\u0179\u017a") - buf.write("\7\34\2\2\u017aM\3\2\2\2\u017b\u017c\t\6\2\2\u017cO\3") - buf.write("\2\2\2\u017d\u017e\t\7\2\2\u017eQ\3\2\2\2\u017f\u0186") - buf.write("\7+\2\2\u0180\u0186\7-\2\2\u0181\u0186\5 \21\2\u0182\u0186") - buf.write("\58\35\2\u0183\u0186\5> \2\u0184\u0186\7,\2\2\u0185\u017f") - buf.write("\3\2\2\2\u0185\u0180\3\2\2\2\u0185\u0181\3\2\2\2\u0185") - buf.write("\u0182\3\2\2\2\u0185\u0183\3\2\2\2\u0185\u0184\3\2\2\2") - buf.write("\u0186S\3\2\2\2#]bdhvz\u00a8\u00ab\u00c4\u00c7\u00d6\u00e0") - buf.write("\u00e2\u00ed\u00f0\u00f3\u00fc\u0102\u0107\u0117\u0119") - buf.write("\u011f\u012c\u0131\u0139\u014c\u014f\u0156\u0159\u0167") - buf.write("\u016f\u0176\u0185") + buf.write("&\4\'\t\'\4(\t(\3\2\3\2\3\2\3\3\3\3\3\3\3\4\7\4X\n\4\f") + buf.write("\4\16\4[\13\4\3\5\3\5\7\5_\n\5\f\5\16\5b\13\5\3\6\3\6") + buf.write("\5\6f\n\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\5\7") + buf.write("r\n\7\3\b\3\b\5\bv\n\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n") + buf.write("\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3") + buf.write("\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\16") + buf.write("\3\16\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\21\7\21\u00a2") + buf.write("\n\21\f\21\16\21\u00a5\13\21\5\21\u00a7\n\21\3\21\3\21") + buf.write("\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\24\3\24") + buf.write("\3\25\3\25\3\26\3\26\3\27\3\27\3\27\3\27\7\27\u00be\n") + buf.write("\27\f\27\16\27\u00c1\13\27\3\30\3\30\3\30\3\30\3\30\3") + buf.write("\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30") + buf.write("\5\30\u00d3\n\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3") + buf.write("\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\7\30\u00e5") + buf.write("\n\30\f\30\16\30\u00e8\13\30\3\31\3\31\3\31\3\31\3\31") + buf.write("\3\31\7\31\u00f0\n\31\f\31\16\31\u00f3\13\31\5\31\u00f5") + buf.write("\n\31\3\31\5\31\u00f8\n\31\3\31\3\31\3\31\3\31\3\32\7") + buf.write("\32\u00ff\n\32\f\32\16\32\u0102\13\32\3\32\7\32\u0105") + buf.write("\n\32\f\32\16\32\u0108\13\32\3\33\3\33\5\33\u010c\n\33") + buf.write("\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35") + buf.write("\3\35\3\35\3\35\6\35\u011c\n\35\r\35\16\35\u011d\3\36") + buf.write("\3\36\3\37\3\37\5\37\u0124\n\37\3 \3 \3 \3 \3 \3 \3!\3") + buf.write("!\3!\3!\3!\5!\u0131\n!\3!\7!\u0134\n!\f!\16!\u0137\13") + buf.write("!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\7#\u0145") + buf.write("\n#\f#\16#\u0148\13#\5#\u014a\n#\3$\3$\3$\7$\u014f\n$") + buf.write("\f$\16$\u0152\13$\5$\u0154\n$\3%\3%\7%\u0158\n%\f%\16") + buf.write("%\u015b\13%\3%\3%\3&\3&\3\'\3\'\3(\3(\3(\3(\3(\3(\5(\u0169") + buf.write("\n(\3(\2\3.)\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"") + buf.write("$&(*,.\60\62\64\668:<>@BDFHJLN\2\b\3\2\f\17\3\2\20\21") + buf.write("\3\2\35\36\3\2\33\34\3\2\37 \3\2$)\2\u0172\2P\3\2\2\2") + buf.write("\4S\3\2\2\2\6Y\3\2\2\2\b`\3\2\2\2\ne\3\2\2\2\fq\3\2\2") + buf.write("\2\16u\3\2\2\2\20w\3\2\2\2\22}\3\2\2\2\24\u0087\3\2\2") + buf.write("\2\26\u008d\3\2\2\2\30\u0094\3\2\2\2\32\u0097\3\2\2\2") + buf.write("\34\u0099\3\2\2\2\36\u009b\3\2\2\2 \u009d\3\2\2\2\"\u00aa") + buf.write("\3\2\2\2$\u00ae\3\2\2\2&\u00b3\3\2\2\2(\u00b5\3\2\2\2") + buf.write("*\u00b7\3\2\2\2,\u00b9\3\2\2\2.\u00d2\3\2\2\2\60\u00e9") + buf.write("\3\2\2\2\62\u0100\3\2\2\2\64\u010b\3\2\2\2\66\u010d\3") + buf.write("\2\2\28\u0114\3\2\2\2:\u011f\3\2\2\2<\u0123\3\2\2\2>\u0125") + buf.write("\3\2\2\2@\u0135\3\2\2\2B\u0138\3\2\2\2D\u0149\3\2\2\2") + buf.write("F\u0153\3\2\2\2H\u0155\3\2\2\2J\u015e\3\2\2\2L\u0160\3") + buf.write("\2\2\2N\u0168\3\2\2\2PQ\5\4\3\2QR\7\2\2\3R\3\3\2\2\2S") + buf.write("T\5\6\4\2TU\5\b\5\2U\5\3\2\2\2VX\5\n\6\2WV\3\2\2\2X[\3") + buf.write("\2\2\2YW\3\2\2\2YZ\3\2\2\2Z\7\3\2\2\2[Y\3\2\2\2\\_\5\f") + buf.write("\7\2]_\5H%\2^\\\3\2\2\2^]\3\2\2\2_b\3\2\2\2`^\3\2\2\2") + buf.write("`a\3\2\2\2a\t\3\2\2\2b`\3\2\2\2cf\5\60\31\2df\5B\"\2e") + buf.write("c\3\2\2\2ed\3\2\2\2f\13\3\2\2\2gr\5$\23\2hr\5\16\b\2i") + buf.write("r\5\24\13\2jr\5\30\r\2kr\5\34\17\2lr\5\26\f\2mr\5\36\20") + buf.write("\2nr\5\66\34\2or\5.\30\2pr\5,\27\2qg\3\2\2\2qh\3\2\2\2") + buf.write("qi\3\2\2\2qj\3\2\2\2qk\3\2\2\2ql\3\2\2\2qm\3\2\2\2qn\3") + buf.write("\2\2\2qo\3\2\2\2qp\3\2\2\2r\r\3\2\2\2sv\5\20\t\2tv\5\22") + buf.write("\n\2us\3\2\2\2ut\3\2\2\2v\17\3\2\2\2wx\7\3\2\2xy\5.\30") + buf.write("\2yz\7\4\2\2z{\5\b\5\2{|\7\5\2\2|\21\3\2\2\2}~\7\3\2\2") + buf.write("~\177\5.\30\2\177\u0080\7\4\2\2\u0080\u0081\5\b\5\2\u0081") + buf.write("\u0082\7\5\2\2\u0082\u0083\7\6\2\2\u0083\u0084\7\4\2\2") + buf.write("\u0084\u0085\5\b\5\2\u0085\u0086\7\5\2\2\u0086\23\3\2") + buf.write("\2\2\u0087\u0088\7\7\2\2\u0088\u0089\5N(\2\u0089\u008a") + buf.write("\7\4\2\2\u008a\u008b\5\b\5\2\u008b\u008c\7\5\2\2\u008c") + buf.write("\25\3\2\2\2\u008d\u008e\7\b\2\2\u008e\u008f\7\t\2\2\u008f") + buf.write("\u0090\5.\30\2\u0090\u0091\7\n\2\2\u0091\u0092\5.\30\2") + buf.write("\u0092\u0093\7\13\2\2\u0093\27\3\2\2\2\u0094\u0095\5\32") + buf.write("\16\2\u0095\u0096\5.\30\2\u0096\31\3\2\2\2\u0097\u0098") + buf.write("\t\2\2\2\u0098\33\3\2\2\2\u0099\u009a\t\3\2\2\u009a\35") + buf.write("\3\2\2\2\u009b\u009c\7\22\2\2\u009c\37\3\2\2\2\u009d\u00a6") + buf.write("\7\4\2\2\u009e\u00a3\5.\30\2\u009f\u00a0\7\n\2\2\u00a0") + buf.write("\u00a2\5.\30\2\u00a1\u009f\3\2\2\2\u00a2\u00a5\3\2\2\2") + buf.write("\u00a3\u00a1\3\2\2\2\u00a3\u00a4\3\2\2\2\u00a4\u00a7\3") + buf.write("\2\2\2\u00a5\u00a3\3\2\2\2\u00a6\u009e\3\2\2\2\u00a6\u00a7") + buf.write("\3\2\2\2\u00a7\u00a8\3\2\2\2\u00a8\u00a9\7\5\2\2\u00a9") + buf.write("!\3\2\2\2\u00aa\u00ab\5<\37\2\u00ab\u00ac\7\23\2\2\u00ac") + buf.write("\u00ad\5.\30\2\u00ad#\3\2\2\2\u00ae\u00af\7\"\2\2\u00af") + buf.write("\u00b0\7\t\2\2\u00b0\u00b1\5.\30\2\u00b1\u00b2\7\13\2") + buf.write("\2\u00b2%\3\2\2\2\u00b3\u00b4\t\4\2\2\u00b4\'\3\2\2\2") + buf.write("\u00b5\u00b6\t\5\2\2\u00b6)\3\2\2\2\u00b7\u00b8\7\34\2") + buf.write("\2\u00b8+\3\2\2\2\u00b9\u00ba\7!\2\2\u00ba\u00bf\5.\30") + buf.write("\2\u00bb\u00bc\7\n\2\2\u00bc\u00be\5.\30\2\u00bd\u00bb") + buf.write("\3\2\2\2\u00be\u00c1\3\2\2\2\u00bf\u00bd\3\2\2\2\u00bf") + buf.write("\u00c0\3\2\2\2\u00c0-\3\2\2\2\u00c1\u00bf\3\2\2\2\u00c2") + buf.write("\u00c3\b\30\1\2\u00c3\u00c4\5*\26\2\u00c4\u00c5\5.\30") + buf.write("\f\u00c5\u00d3\3\2\2\2\u00c6\u00c7\5<\37\2\u00c7\u00c8") + buf.write("\7\23\2\2\u00c8\u00c9\5.\30\t\u00c9\u00d3\3\2\2\2\u00ca") + buf.write("\u00cb\7\t\2\2\u00cb\u00cc\5.\30\2\u00cc\u00cd\7\13\2") + buf.write("\2\u00cd\u00d3\3\2\2\2\u00ce\u00d3\5N(\2\u00cf\u00d0\7") + buf.write("*\2\2\u00d0\u00d3\5.\30\6\u00d1\u00d3\7#\2\2\u00d2\u00c2") + buf.write("\3\2\2\2\u00d2\u00c6\3\2\2\2\u00d2\u00ca\3\2\2\2\u00d2") + buf.write("\u00ce\3\2\2\2\u00d2\u00cf\3\2\2\2\u00d2\u00d1\3\2\2\2") + buf.write("\u00d3\u00e6\3\2\2\2\u00d4\u00d5\f\13\2\2\u00d5\u00d6") + buf.write("\5&\24\2\u00d6\u00d7\5.\30\f\u00d7\u00e5\3\2\2\2\u00d8") + buf.write("\u00d9\f\n\2\2\u00d9\u00da\5(\25\2\u00da\u00db\5.\30\13") + buf.write("\u00db\u00e5\3\2\2\2\u00dc\u00dd\f\5\2\2\u00dd\u00de\5") + buf.write("L\'\2\u00de\u00df\5.\30\6\u00df\u00e5\3\2\2\2\u00e0\u00e1") + buf.write("\f\4\2\2\u00e1\u00e2\5J&\2\u00e2\u00e3\5.\30\5\u00e3\u00e5") + buf.write("\3\2\2\2\u00e4\u00d4\3\2\2\2\u00e4\u00d8\3\2\2\2\u00e4") + buf.write("\u00dc\3\2\2\2\u00e4\u00e0\3\2\2\2\u00e5\u00e8\3\2\2\2") + buf.write("\u00e6\u00e4\3\2\2\2\u00e6\u00e7\3\2\2\2\u00e7/\3\2\2") + buf.write("\2\u00e8\u00e6\3\2\2\2\u00e9\u00ea\7\24\2\2\u00ea\u00f7") + buf.write("\7-\2\2\u00eb\u00ec\7\t\2\2\u00ec\u00f4\7-\2\2\u00ed\u00f1") + buf.write("\7\n\2\2\u00ee\u00f0\7-\2\2\u00ef\u00ee\3\2\2\2\u00f0") + buf.write("\u00f3\3\2\2\2\u00f1\u00ef\3\2\2\2\u00f1\u00f2\3\2\2\2") + buf.write("\u00f2\u00f5\3\2\2\2\u00f3\u00f1\3\2\2\2\u00f4\u00ed\3") + buf.write("\2\2\2\u00f4\u00f5\3\2\2\2\u00f5\u00f6\3\2\2\2\u00f6\u00f8") + buf.write("\7\13\2\2\u00f7\u00eb\3\2\2\2\u00f7\u00f8\3\2\2\2\u00f8") + buf.write("\u00f9\3\2\2\2\u00f9\u00fa\7\25\2\2\u00fa\u00fb\5\62\32") + buf.write("\2\u00fb\u00fc\7\26\2\2\u00fc\61\3\2\2\2\u00fd\u00ff\5") + buf.write("\64\33\2\u00fe\u00fd\3\2\2\2\u00ff\u0102\3\2\2\2\u0100") + buf.write("\u00fe\3\2\2\2\u0100\u0101\3\2\2\2\u0101\u0106\3\2\2\2") + buf.write("\u0102\u0100\3\2\2\2\u0103\u0105\5B\"\2\u0104\u0103\3") + buf.write("\2\2\2\u0105\u0108\3\2\2\2\u0106\u0104\3\2\2\2\u0106\u0107") + buf.write("\3\2\2\2\u0107\63\3\2\2\2\u0108\u0106\3\2\2\2\u0109\u010c") + buf.write("\5\"\22\2\u010a\u010c\5\66\34\2\u010b\u0109\3\2\2\2\u010b") + buf.write("\u010a\3\2\2\2\u010c\65\3\2\2\2\u010d\u010e\5<\37\2\u010e") + buf.write("\u010f\7\23\2\2\u010f\u0110\7\27\2\2\u0110\u0111\7-\2") + buf.write("\2\u0111\u0112\7\t\2\2\u0112\u0113\7\13\2\2\u0113\67\3") + buf.write("\2\2\2\u0114\u011b\5:\36\2\u0115\u0116\7\30\2\2\u0116") + buf.write("\u011c\7-\2\2\u0117\u0118\7\4\2\2\u0118\u0119\5.\30\2") + buf.write("\u0119\u011a\7\5\2\2\u011a\u011c\3\2\2\2\u011b\u0115\3") + buf.write("\2\2\2\u011b\u0117\3\2\2\2\u011c\u011d\3\2\2\2\u011d\u011b") + buf.write("\3\2\2\2\u011d\u011e\3\2\2\2\u011e9\3\2\2\2\u011f\u0120") + buf.write("\7-\2\2\u0120;\3\2\2\2\u0121\u0124\7-\2\2\u0122\u0124") + buf.write("\58\35\2\u0123\u0121\3\2\2\2\u0123\u0122\3\2\2\2\u0124") + buf.write("=\3\2\2\2\u0125\u0126\5@!\2\u0126\u0127\7.\2\2\u0127\u0128") + buf.write("\7\t\2\2\u0128\u0129\5F$\2\u0129\u012a\7\13\2\2\u012a") + buf.write("?\3\2\2\2\u012b\u0131\7-\2\2\u012c\u012d\7\4\2\2\u012d") + buf.write("\u012e\5.\30\2\u012e\u012f\7\5\2\2\u012f\u0131\3\2\2\2") + buf.write("\u0130\u012b\3\2\2\2\u0130\u012c\3\2\2\2\u0131\u0132\3") + buf.write("\2\2\2\u0132\u0134\7\30\2\2\u0133\u0130\3\2\2\2\u0134") + buf.write("\u0137\3\2\2\2\u0135\u0133\3\2\2\2\u0135\u0136\3\2\2\2") + buf.write("\u0136A\3\2\2\2\u0137\u0135\3\2\2\2\u0138\u0139\7\31\2") + buf.write("\2\u0139\u013a\7.\2\2\u013a\u013b\7\t\2\2\u013b\u013c") + buf.write("\5D#\2\u013c\u013d\7\13\2\2\u013d\u013e\7\25\2\2\u013e") + buf.write("\u013f\5\b\5\2\u013f\u0140\7\26\2\2\u0140C\3\2\2\2\u0141") + buf.write("\u0146\7-\2\2\u0142\u0143\7\n\2\2\u0143\u0145\7-\2\2\u0144") + buf.write("\u0142\3\2\2\2\u0145\u0148\3\2\2\2\u0146\u0144\3\2\2\2") + buf.write("\u0146\u0147\3\2\2\2\u0147\u014a\3\2\2\2\u0148\u0146\3") + buf.write("\2\2\2\u0149\u0141\3\2\2\2\u0149\u014a\3\2\2\2\u014aE") + buf.write("\3\2\2\2\u014b\u0150\5.\30\2\u014c\u014d\7\n\2\2\u014d") + buf.write("\u014f\5.\30\2\u014e\u014c\3\2\2\2\u014f\u0152\3\2\2\2") + buf.write("\u0150\u014e\3\2\2\2\u0150\u0151\3\2\2\2\u0151\u0154\3") + buf.write("\2\2\2\u0152\u0150\3\2\2\2\u0153\u014b\3\2\2\2\u0153\u0154") + buf.write("\3\2\2\2\u0154G\3\2\2\2\u0155\u0159\7\32\2\2\u0156\u0158") + buf.write("\7.\2\2\u0157\u0156\3\2\2\2\u0158\u015b\3\2\2\2\u0159") + buf.write("\u0157\3\2\2\2\u0159\u015a\3\2\2\2\u015a\u015c\3\2\2\2") + buf.write("\u015b\u0159\3\2\2\2\u015c\u015d\7\32\2\2\u015dI\3\2\2") + buf.write("\2\u015e\u015f\t\6\2\2\u015fK\3\2\2\2\u0160\u0161\t\7") + buf.write("\2\2\u0161M\3\2\2\2\u0162\u0169\7+\2\2\u0163\u0169\7-") + buf.write("\2\2\u0164\u0169\5 \21\2\u0165\u0169\58\35\2\u0166\u0169") + buf.write("\5> \2\u0167\u0169\7,\2\2\u0168\u0162\3\2\2\2\u0168\u0163") + buf.write("\3\2\2\2\u0168\u0164\3\2\2\2\u0168\u0165\3\2\2\2\u0168") + buf.write("\u0166\3\2\2\2\u0168\u0167\3\2\2\2\u0169O\3\2\2\2\37Y") + buf.write("^`equ\u00a3\u00a6\u00bf\u00d2\u00e4\u00e6\u00f1\u00f4") + buf.write("\u00f7\u0100\u0106\u010b\u011b\u011d\u0123\u0130\u0135") + buf.write("\u0146\u0149\u0150\u0153\u0159\u0168") return buf.getvalue() @@ -195,10 +182,10 @@ class tlangParser ( Parser ): literalNames = [ "", "'if'", "'['", "']'", "'else'", "'repeat'", "'goto'", "'('", "','", "')'", "'forward'", "'backward'", "'left'", "'right'", "'penup'", "'pendown'", "'pause'", - "'='", "'print'", "'return'", "'class'", "'{'", "'}'", - "'new'", "'.'", "'def'", "'#'", "'+'", "'-'", "'*'", - "'/'", "'pendown?'", "'<'", "'>'", "'=='", "'!='", - "'<='", "'>='", "'&&'", "'||'", "'!'" ] + "'='", "'class'", "'{'", "'}'", "'new'", "'.'", "'def'", + "'#'", "'+'", "'-'", "'*'", "'/'", "'&&'", "'||'", + "'return'", "'print'", "'pendown?'", "'<'", "'>'", + "'=='", "'!='", "'<='", "'>='", "'!'" ] symbolicNames = [ "", "", "", "", "", "", "", "", @@ -206,9 +193,9 @@ class tlangParser ( Parser ): "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "PLUS", "MINUS", - "MUL", "DIV", "PENCOND", "LT", "GT", "EQ", "NEQ", - "LTE", "GTE", "AND", "OR", "NOT", "NUM", "REAL", "VAR", + "", "PLUS", "MINUS", "MUL", "DIV", "AND", + "OR", "RETURN", "PRINT", "PENCOND", "LT", "GT", "EQ", + "NEQ", "LTE", "GTE", "NOT", "NUM", "REAL", "VAR", "NAME", "Whitespace" ] RULE_start = 0 @@ -243,15 +230,13 @@ class tlangParser ( Parser ): RULE_lvalue = 29 RULE_functionCall = 30 RULE_methodCaller = 31 - RULE_functionCallWithReturnValues = 32 - RULE_functionDeclaration = 33 - RULE_parameters = 34 - RULE_arguments = 35 - RULE_condition = 36 - RULE_comment = 37 - RULE_binCondOp = 38 - RULE_logicOp = 39 - RULE_value = 40 + RULE_functionDeclaration = 32 + RULE_parameters = 33 + RULE_arguments = 34 + RULE_comment = 35 + RULE_logicOp = 36 + RULE_binCondOp = 37 + RULE_value = 38 ruleNames = [ "start", "statement_list", "declaration_list", "strict_ilist", "declaration", "instruction", "conditional", "ifConditional", @@ -261,9 +246,8 @@ class tlangParser ( Parser ): "returnStatement", "expression", "classDeclaration", "classBody", "classAttributeDeclaration", "objectInstantiation", "dataLocationAccess", "baseVar", "lvalue", "functionCall", - "methodCaller", "functionCallWithReturnValues", "functionDeclaration", - "parameters", "arguments", "condition", "comment", "binCondOp", - "logicOp", "value" ] + "methodCaller", "functionDeclaration", "parameters", + "arguments", "comment", "logicOp", "binCondOp", "value" ] EOF = Token.EOF T__0=1 @@ -290,21 +274,21 @@ class tlangParser ( Parser ): T__21=22 T__22=23 T__23=24 - T__24=25 - T__25=26 - PLUS=27 - MINUS=28 - MUL=29 - DIV=30 - PENCOND=31 - LT=32 - GT=33 - EQ=34 - NEQ=35 - LTE=36 - GTE=37 - AND=38 - OR=39 + PLUS=25 + MINUS=26 + MUL=27 + DIV=28 + AND=29 + OR=30 + RETURN=31 + PRINT=32 + PENCOND=33 + LT=34 + GT=35 + EQ=36 + NEQ=37 + LTE=38 + GTE=39 NOT=40 NUM=41 REAL=42 @@ -352,9 +336,9 @@ def start(self): self.enterRule(localctx, 0, self.RULE_start) try: self.enterOuterAlt(localctx, 1) - self.state = 82 + self.state = 78 self.statement_list() - self.state = 83 + self.state = 79 self.match(tlangParser.EOF) except RecognitionException as re: localctx.exception = re @@ -397,9 +381,9 @@ def statement_list(self): self.enterRule(localctx, 2, self.RULE_statement_list) try: self.enterOuterAlt(localctx, 1) - self.state = 85 + self.state = 81 self.declaration_list() - self.state = 86 + self.state = 82 self.strict_ilist() except RecognitionException as re: localctx.exception = re @@ -442,13 +426,13 @@ def declaration_list(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 91 + self.state = 87 self._errHandler.sync(self) _la = self._input.LA(1) - while _la==tlangParser.T__19 or _la==tlangParser.T__24: - self.state = 88 + while _la==tlangParser.T__17 or _la==tlangParser.T__22: + self.state = 84 self.declaration() - self.state = 93 + self.state = 89 self._errHandler.sync(self) _la = self._input.LA(1) @@ -500,29 +484,27 @@ def strict_ilist(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 96 + self.state = 94 self._errHandler.sync(self) _la = self._input.LA(1) - while True: - self.state = 96 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__6) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__23) | (1 << tlangParser.MINUS) | (1 << tlangParser.RETURN) | (1 << tlangParser.PRINT) | (1 << tlangParser.PENCOND) | (1 << tlangParser.NOT) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): + self.state = 92 self._errHandler.sync(self) token = self._input.LA(1) - if token in [tlangParser.T__0, tlangParser.T__1, tlangParser.T__4, tlangParser.T__5, tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12, tlangParser.T__13, tlangParser.T__14, tlangParser.T__15, tlangParser.T__17, tlangParser.T__18, tlangParser.VAR, tlangParser.NAME]: - self.state = 94 + if token in [tlangParser.T__0, tlangParser.T__1, tlangParser.T__4, tlangParser.T__5, tlangParser.T__6, tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12, tlangParser.T__13, tlangParser.T__14, tlangParser.T__15, tlangParser.MINUS, tlangParser.RETURN, tlangParser.PRINT, tlangParser.PENCOND, tlangParser.NOT, tlangParser.NUM, tlangParser.REAL, tlangParser.VAR, tlangParser.NAME]: + self.state = 90 self.instruction() pass - elif token in [tlangParser.T__25]: - self.state = 95 + elif token in [tlangParser.T__23]: + self.state = 91 self.comment() pass else: raise NoViableAltException(self) - self.state = 98 + self.state = 96 self._errHandler.sync(self) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__17) | (1 << tlangParser.T__18) | (1 << tlangParser.T__25) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0)): - break except RecognitionException as re: localctx.exception = re @@ -564,17 +546,17 @@ def declaration(self): localctx = tlangParser.DeclarationContext(self, self._ctx, self.state) self.enterRule(localctx, 8, self.RULE_declaration) try: - self.state = 102 + self.state = 99 self._errHandler.sync(self) token = self._input.LA(1) - if token in [tlangParser.T__19]: + if token in [tlangParser.T__17]: self.enterOuterAlt(localctx, 1) - self.state = 100 + self.state = 97 self.classDeclaration() pass - elif token in [tlangParser.T__24]: + elif token in [tlangParser.T__22]: self.enterOuterAlt(localctx, 2) - self.state = 101 + self.state = 98 self.functionDeclaration() pass else: @@ -595,14 +577,6 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def functionCallWithReturnValues(self): - return self.getTypedRuleContext(tlangParser.FunctionCallWithReturnValuesContext,0) - - - def assignment(self): - return self.getTypedRuleContext(tlangParser.AssignmentContext,0) - - def printStatement(self): return self.getTypedRuleContext(tlangParser.PrintStatementContext,0) @@ -635,8 +609,8 @@ def objectInstantiation(self): return self.getTypedRuleContext(tlangParser.ObjectInstantiationContext,0) - def functionCall(self): - return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) + def expression(self): + return self.getTypedRuleContext(tlangParser.ExpressionContext,0) def returnStatement(self): @@ -660,78 +634,66 @@ def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) self.enterRule(localctx, 10, self.RULE_instruction) try: - self.state = 116 + self.state = 111 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,4,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 104 - self.functionCallWithReturnValues() + self.state = 101 + self.printStatement() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 105 - self.assignment() + self.state = 102 + self.conditional() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 106 - self.printStatement() + self.state = 103 + self.loop() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 107 - self.conditional() + self.state = 104 + self.moveCommand() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 108 - self.loop() + self.state = 105 + self.penCommand() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 109 - self.moveCommand() + self.state = 106 + self.gotoCommand() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 110 - self.penCommand() + self.state = 107 + self.pauseCommand() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 111 - self.gotoCommand() + self.state = 108 + self.objectInstantiation() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 112 - self.pauseCommand() + self.state = 109 + self.expression(0) pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 113 - self.objectInstantiation() - pass - - elif la_ == 11: - self.enterOuterAlt(localctx, 11) - self.state = 114 - self.functionCall() - pass - - elif la_ == 12: - self.enterOuterAlt(localctx, 12) - self.state = 115 + self.state = 110 self.returnStatement() pass @@ -776,18 +738,18 @@ def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) self.enterRule(localctx, 12, self.RULE_conditional) try: - self.state = 120 + self.state = 115 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,5,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 118 + self.state = 113 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 119 + self.state = 114 self.ifElseConditional() pass @@ -807,8 +769,8 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def condition(self): - return self.getTypedRuleContext(tlangParser.ConditionContext,0) + def expression(self): + return self.getTypedRuleContext(tlangParser.ExpressionContext,0) def strict_ilist(self): @@ -833,15 +795,15 @@ def ifConditional(self): self.enterRule(localctx, 14, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 122 + self.state = 117 self.match(tlangParser.T__0) - self.state = 123 - self.condition(0) - self.state = 124 + self.state = 118 + self.expression(0) + self.state = 119 self.match(tlangParser.T__1) - self.state = 125 + self.state = 120 self.strict_ilist() - self.state = 126 + self.state = 121 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -858,8 +820,8 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def condition(self): - return self.getTypedRuleContext(tlangParser.ConditionContext,0) + def expression(self): + return self.getTypedRuleContext(tlangParser.ExpressionContext,0) def strict_ilist(self, i:int=None): @@ -887,23 +849,23 @@ def ifElseConditional(self): self.enterRule(localctx, 16, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 128 + self.state = 123 self.match(tlangParser.T__0) - self.state = 129 - self.condition(0) - self.state = 130 + self.state = 124 + self.expression(0) + self.state = 125 self.match(tlangParser.T__1) - self.state = 131 + self.state = 126 self.strict_ilist() - self.state = 132 + self.state = 127 self.match(tlangParser.T__2) - self.state = 133 + self.state = 128 self.match(tlangParser.T__3) - self.state = 134 + self.state = 129 self.match(tlangParser.T__1) - self.state = 135 + self.state = 130 self.strict_ilist() - self.state = 136 + self.state = 131 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -946,15 +908,15 @@ def loop(self): self.enterRule(localctx, 18, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 138 + self.state = 133 self.match(tlangParser.T__4) - self.state = 139 + self.state = 134 self.value() - self.state = 140 + self.state = 135 self.match(tlangParser.T__1) - self.state = 141 + self.state = 136 self.strict_ilist() - self.state = 142 + self.state = 137 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -996,17 +958,17 @@ def gotoCommand(self): self.enterRule(localctx, 20, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 144 + self.state = 139 self.match(tlangParser.T__5) - self.state = 145 + self.state = 140 self.match(tlangParser.T__6) - self.state = 146 + self.state = 141 self.expression(0) - self.state = 147 + self.state = 142 self.match(tlangParser.T__7) - self.state = 148 + self.state = 143 self.expression(0) - self.state = 149 + self.state = 144 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1049,9 +1011,9 @@ def moveCommand(self): self.enterRule(localctx, 22, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 151 + self.state = 146 self.moveOp() - self.state = 152 + self.state = 147 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1088,7 +1050,7 @@ def moveOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 154 + self.state = 149 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -1130,7 +1092,7 @@ def penCommand(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 156 + self.state = 151 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -1171,7 +1133,7 @@ def pauseCommand(self): self.enterRule(localctx, 28, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 158 + self.state = 153 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -1214,29 +1176,29 @@ def array(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 160 + self.state = 155 self.match(tlangParser.T__1) - self.state = 169 + self.state = 164 self._errHandler.sync(self) _la = self._input.LA(1) - if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 161 + if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.PENCOND) | (1 << tlangParser.NOT) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): + self.state = 156 self.expression(0) - self.state = 166 + self.state = 161 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 162 + self.state = 157 self.match(tlangParser.T__7) - self.state = 163 + self.state = 158 self.expression(0) - self.state = 168 + self.state = 163 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 171 + self.state = 166 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -1279,11 +1241,11 @@ def assignment(self): self.enterRule(localctx, 32, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 173 + self.state = 168 self.lvalue() - self.state = 174 + self.state = 169 self.match(tlangParser.T__16) - self.state = 175 + self.state = 170 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1300,6 +1262,9 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + def PRINT(self): + return self.getToken(tlangParser.PRINT, 0) + def expression(self): return self.getTypedRuleContext(tlangParser.ExpressionContext,0) @@ -1322,13 +1287,13 @@ def printStatement(self): self.enterRule(localctx, 34, self.RULE_printStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 177 - self.match(tlangParser.T__17) - self.state = 178 + self.state = 172 + self.match(tlangParser.PRINT) + self.state = 173 self.match(tlangParser.T__6) - self.state = 179 + self.state = 174 self.expression(0) - self.state = 180 + self.state = 175 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1370,7 +1335,7 @@ def multiplicative(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 182 + self.state = 177 _la = self._input.LA(1) if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) @@ -1417,7 +1382,7 @@ def additive(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 184 + self.state = 179 _la = self._input.LA(1) if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) @@ -1460,7 +1425,7 @@ def unaryArithOp(self): self.enterRule(localctx, 40, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 186 + self.state = 181 self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re @@ -1477,6 +1442,9 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + def RETURN(self): + return self.getToken(tlangParser.RETURN, 0) + def expression(self, i:int=None): if i is None: return self.getTypedRuleContexts(tlangParser.ExpressionContext) @@ -1503,27 +1471,22 @@ def returnStatement(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 188 - self.match(tlangParser.T__18) - self.state = 197 + self.state = 183 + self.match(tlangParser.RETURN) + + self.state = 184 + self.expression(0) + self.state = 189 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,9,self._ctx) - if la_ == 1: - self.state = 189 + _la = self._input.LA(1) + while _la==tlangParser.T__7: + self.state = 185 + self.match(tlangParser.T__7) + self.state = 186 self.expression(0) - self.state = 194 + self.state = 191 self._errHandler.sync(self) _la = self._input.LA(1) - while _la==tlangParser.T__7: - self.state = 190 - self.match(tlangParser.T__7) - self.state = 191 - self.expression(0) - self.state = 196 - self._errHandler.sync(self) - _la = self._input.LA(1) - - except RecognitionException as re: localctx.exception = re @@ -1549,6 +1512,29 @@ def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) + class BinExprContext(ExpressionContext): + + def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext + super().__init__(parser) + self.copyFrom(ctx) + + def expression(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.ExpressionContext) + else: + return self.getTypedRuleContext(tlangParser.ExpressionContext,i) + + def binCondOp(self): + return self.getTypedRuleContext(tlangParser.BinCondOpContext,0) + + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitBinExpr" ): + return visitor.visitBinExpr(self) + else: + return visitor.visitChildren(self) + + class UnaryExprContext(ExpressionContext): def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext @@ -1586,6 +1572,25 @@ def accept(self, visitor:ParseTreeVisitor): return visitor.visitChildren(self) + class NotExprContext(ExpressionContext): + + def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext + super().__init__(parser) + self.copyFrom(ctx) + + def NOT(self): + return self.getToken(tlangParser.NOT, 0) + def expression(self): + return self.getTypedRuleContext(tlangParser.ExpressionContext,0) + + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitNotExpr" ): + return visitor.visitNotExpr(self) + else: + return visitor.visitChildren(self) + + class AddExprContext(ExpressionContext): def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext @@ -1632,6 +1637,22 @@ def accept(self, visitor:ParseTreeVisitor): return visitor.visitChildren(self) + class PenExprContext(ExpressionContext): + + def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext + super().__init__(parser) + self.copyFrom(ctx) + + def PENCOND(self): + return self.getToken(tlangParser.PENCOND, 0) + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitPenExpr" ): + return visitor.visitPenExpr(self) + else: + return visitor.visitChildren(self) + + class AssignExprContext(ExpressionContext): def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext @@ -1669,6 +1690,29 @@ def accept(self, visitor:ParseTreeVisitor): return visitor.visitChildren(self) + class LogExprContext(ExpressionContext): + + def __init__(self, parser, ctx:ParserRuleContext): # actually a tlangParser.ExpressionContext + super().__init__(parser) + self.copyFrom(ctx) + + def expression(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(tlangParser.ExpressionContext) + else: + return self.getTypedRuleContext(tlangParser.ExpressionContext,i) + + def logicOp(self): + return self.getTypedRuleContext(tlangParser.LogicOpContext,0) + + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitLogExpr" ): + return visitor.visitLogExpr(self) + else: + return visitor.visitChildren(self) + + def expression(self, _p:int=0): _parentctx = self._ctx @@ -1679,41 +1723,41 @@ def expression(self, _p:int=0): self.enterRecursionRule(localctx, 44, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 212 + self.state = 208 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,10,self._ctx) + la_ = self._interp.adaptivePredict(self._input,9,self._ctx) if la_ == 1: localctx = tlangParser.UnaryExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 200 + self.state = 193 self.unaryArithOp() - self.state = 201 - self.expression(6) + self.state = 194 + self.expression(10) pass elif la_ == 2: localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 203 + self.state = 196 self.lvalue() - self.state = 204 + self.state = 197 self.match(tlangParser.T__16) - self.state = 205 - self.expression(3) + self.state = 198 + self.expression(7) pass elif la_ == 3: localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 207 + self.state = 200 self.match(tlangParser.T__6) - self.state = 208 + self.state = 201 self.expression(0) - self.state = 209 + self.state = 202 self.match(tlangParser.T__8) pass @@ -1721,53 +1765,97 @@ def expression(self, _p:int=0): localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 211 + self.state = 204 self.value() pass + elif la_ == 5: + localctx = tlangParser.NotExprContext(self, localctx) + self._ctx = localctx + _prevctx = localctx + self.state = 205 + self.match(tlangParser.NOT) + self.state = 206 + self.expression(4) + pass + + elif la_ == 6: + localctx = tlangParser.PenExprContext(self, localctx) + self._ctx = localctx + _prevctx = localctx + self.state = 207 + self.match(tlangParser.PENCOND) + pass + self._ctx.stop = self._input.LT(-1) - self.state = 224 + self.state = 228 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,12,self._ctx) + _alt = self._interp.adaptivePredict(self._input,11,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt==1: if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 222 + self.state = 226 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,11,self._ctx) + la_ = self._interp.adaptivePredict(self._input,10,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 214 - if not self.precpred(self._ctx, 5): + self.state = 210 + if not self.precpred(self._ctx, 9): from antlr4.error.Errors import FailedPredicateException - raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 215 + raise FailedPredicateException(self, "self.precpred(self._ctx, 9)") + self.state = 211 self.multiplicative() - self.state = 216 - self.expression(6) + self.state = 212 + self.expression(10) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) + self.state = 214 + if not self.precpred(self._ctx, 8): + from antlr4.error.Errors import FailedPredicateException + raise FailedPredicateException(self, "self.precpred(self._ctx, 8)") + self.state = 215 + self.additive() + self.state = 216 + self.expression(9) + pass + + elif la_ == 3: + localctx = tlangParser.BinExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) + self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) self.state = 218 - if not self.precpred(self._ctx, 4): + if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException - raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") + raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") self.state = 219 - self.additive() + self.binCondOp() self.state = 220 - self.expression(5) + self.expression(4) + pass + + elif la_ == 4: + localctx = tlangParser.LogExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) + self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) + self.state = 222 + if not self.precpred(self._ctx, 2): + from antlr4.error.Errors import FailedPredicateException + raise FailedPredicateException(self, "self.precpred(self._ctx, 2)") + self.state = 223 + self.logicOp() + self.state = 224 + self.expression(3) pass - self.state = 226 + self.state = 230 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,12,self._ctx) + _alt = self._interp.adaptivePredict(self._input,11,self._ctx) except RecognitionException as re: localctx.exception = re @@ -1813,46 +1901,46 @@ def classDeclaration(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 227 - self.match(tlangParser.T__19) - self.state = 228 + self.state = 231 + self.match(tlangParser.T__17) + self.state = 232 self.match(tlangParser.VAR) - self.state = 241 + self.state = 245 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.T__6: - self.state = 229 + self.state = 233 self.match(tlangParser.T__6) - self.state = 230 + self.state = 234 self.match(tlangParser.VAR) - self.state = 238 + self.state = 242 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.T__7: - self.state = 231 - self.match(tlangParser.T__7) self.state = 235 + self.match(tlangParser.T__7) + self.state = 239 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 232 + self.state = 236 self.match(tlangParser.VAR) - self.state = 237 + self.state = 241 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 240 + self.state = 244 self.match(tlangParser.T__8) - self.state = 243 - self.match(tlangParser.T__20) - self.state = 244 + self.state = 247 + self.match(tlangParser.T__18) + self.state = 248 self.classBody() - self.state = 245 - self.match(tlangParser.T__21) + self.state = 249 + self.match(tlangParser.T__19) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -1901,23 +1989,23 @@ def classBody(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 250 + self.state = 254 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 247 + self.state = 251 self.classAttributeDeclaration() - self.state = 252 + self.state = 256 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 256 + self.state = 260 self._errHandler.sync(self) _la = self._input.LA(1) - while _la==tlangParser.T__24: - self.state = 253 + while _la==tlangParser.T__22: + self.state = 257 self.functionDeclaration() - self.state = 258 + self.state = 262 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1961,18 +2049,18 @@ def classAttributeDeclaration(self): localctx = tlangParser.ClassAttributeDeclarationContext(self, self._ctx, self.state) self.enterRule(localctx, 50, self.RULE_classAttributeDeclaration) try: - self.state = 261 + self.state = 265 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,18,self._ctx) + la_ = self._interp.adaptivePredict(self._input,17,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 259 + self.state = 263 self.assignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 260 + self.state = 264 self.objectInstantiation() pass @@ -2017,17 +2105,17 @@ def objectInstantiation(self): self.enterRule(localctx, 52, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 263 + self.state = 267 self.lvalue() - self.state = 264 + self.state = 268 self.match(tlangParser.T__16) - self.state = 265 - self.match(tlangParser.T__22) - self.state = 266 + self.state = 269 + self.match(tlangParser.T__20) + self.state = 270 self.match(tlangParser.VAR) - self.state = 267 + self.state = 271 self.match(tlangParser.T__6) - self.state = 268 + self.state = 272 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2079,28 +2167,28 @@ def dataLocationAccess(self): self.enterRule(localctx, 54, self.RULE_dataLocationAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 270 + self.state = 274 self.baseVar() - self.state = 277 + self.state = 281 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 277 + self.state = 281 self._errHandler.sync(self) token = self._input.LA(1) - if token in [tlangParser.T__23]: - self.state = 271 - self.match(tlangParser.T__23) - self.state = 272 + if token in [tlangParser.T__21]: + self.state = 275 + self.match(tlangParser.T__21) + self.state = 276 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 273 + self.state = 277 self.match(tlangParser.T__1) - self.state = 274 + self.state = 278 self.expression(0) - self.state = 275 + self.state = 279 self.match(tlangParser.T__2) pass else: @@ -2109,9 +2197,9 @@ def dataLocationAccess(self): else: raise NoViableAltException(self) - self.state = 279 + self.state = 283 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,20,self._ctx) + _alt = self._interp.adaptivePredict(self._input,19,self._ctx) except RecognitionException as re: localctx.exception = re @@ -2149,7 +2237,7 @@ def baseVar(self): self.enterRule(localctx, 56, self.RULE_baseVar) try: self.enterOuterAlt(localctx, 1) - self.state = 281 + self.state = 285 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -2190,18 +2278,18 @@ def lvalue(self): localctx = tlangParser.LvalueContext(self, self._ctx, self.state) self.enterRule(localctx, 58, self.RULE_lvalue) try: - self.state = 285 + self.state = 289 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,21,self._ctx) + la_ = self._interp.adaptivePredict(self._input,20,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 283 + self.state = 287 self.match(tlangParser.VAR) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 284 + self.state = 288 self.dataLocationAccess() pass @@ -2250,15 +2338,15 @@ def functionCall(self): self.enterRule(localctx, 60, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 287 + self.state = 291 self.methodCaller() - self.state = 288 + self.state = 292 self.match(tlangParser.NAME) - self.state = 289 + self.state = 293 self.match(tlangParser.T__6) - self.state = 290 + self.state = 294 self.arguments() - self.state = 291 + self.state = 295 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2307,99 +2395,34 @@ def methodCaller(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 303 + self.state = 307 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__1 or _la==tlangParser.VAR: - self.state = 298 + self.state = 302 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.VAR]: - self.state = 293 + self.state = 297 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 294 + self.state = 298 self.match(tlangParser.T__1) - self.state = 295 + self.state = 299 self.expression(0) - self.state = 296 + self.state = 300 self.match(tlangParser.T__2) pass else: raise NoViableAltException(self) - self.state = 300 - self.match(tlangParser.T__23) - self.state = 305 - self._errHandler.sync(self) - _la = self._input.LA(1) - - except RecognitionException as re: - localctx.exception = re - self._errHandler.reportError(self, re) - self._errHandler.recover(self, re) - finally: - self.exitRule() - return localctx - - - class FunctionCallWithReturnValuesContext(ParserRuleContext): - - def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): - super().__init__(parent, invokingState) - self.parser = parser - - def lvalue(self, i:int=None): - if i is None: - return self.getTypedRuleContexts(tlangParser.LvalueContext) - else: - return self.getTypedRuleContext(tlangParser.LvalueContext,i) - - - def functionCall(self): - return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) - - - def getRuleIndex(self): - return tlangParser.RULE_functionCallWithReturnValues - - def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitFunctionCallWithReturnValues" ): - return visitor.visitFunctionCallWithReturnValues(self) - else: - return visitor.visitChildren(self) - - - - - def functionCallWithReturnValues(self): - - localctx = tlangParser.FunctionCallWithReturnValuesContext(self, self._ctx, self.state) - self.enterRule(localctx, 64, self.RULE_functionCallWithReturnValues) - self._la = 0 # Token type - try: - self.enterOuterAlt(localctx, 1) - self.state = 306 - self.lvalue() - self.state = 309 - self._errHandler.sync(self) - _la = self._input.LA(1) - while True: - self.state = 307 - self.match(tlangParser.T__7) - self.state = 308 - self.lvalue() - self.state = 311 + self.state = 304 + self.match(tlangParser.T__21) + self.state = 309 self._errHandler.sync(self) _la = self._input.LA(1) - if not (_la==tlangParser.T__7): - break - self.state = 313 - self.match(tlangParser.T__16) - self.state = 314 - self.functionCall() except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -2441,25 +2464,25 @@ def accept(self, visitor:ParseTreeVisitor): def functionDeclaration(self): localctx = tlangParser.FunctionDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 66, self.RULE_functionDeclaration) + self.enterRule(localctx, 64, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 316 - self.match(tlangParser.T__24) - self.state = 317 + self.state = 310 + self.match(tlangParser.T__22) + self.state = 311 self.match(tlangParser.NAME) - self.state = 318 + self.state = 312 self.match(tlangParser.T__6) - self.state = 319 + self.state = 313 self.parameters() - self.state = 320 + self.state = 314 self.match(tlangParser.T__8) - self.state = 321 - self.match(tlangParser.T__20) - self.state = 322 + self.state = 315 + self.match(tlangParser.T__18) + self.state = 316 self.strict_ilist() - self.state = 323 - self.match(tlangParser.T__21) + self.state = 317 + self.match(tlangParser.T__19) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -2496,25 +2519,25 @@ def accept(self, visitor:ParseTreeVisitor): def parameters(self): localctx = tlangParser.ParametersContext(self, self._ctx, self.state) - self.enterRule(localctx, 68, self.RULE_parameters) + self.enterRule(localctx, 66, self.RULE_parameters) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 333 + self.state = 327 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.VAR: - self.state = 325 + self.state = 319 self.match(tlangParser.VAR) - self.state = 330 + self.state = 324 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 326 + self.state = 320 self.match(tlangParser.T__7) - self.state = 327 + self.state = 321 self.match(tlangParser.VAR) - self.state = 332 + self.state = 326 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2557,25 +2580,25 @@ def accept(self, visitor:ParseTreeVisitor): def arguments(self): localctx = tlangParser.ArgumentsContext(self, self._ctx, self.state) - self.enterRule(localctx, 70, self.RULE_arguments) + self.enterRule(localctx, 68, self.RULE_arguments) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 343 + self.state = 337 self._errHandler.sync(self) _la = self._input.LA(1) - if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 335 + if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.PENCOND) | (1 << tlangParser.NOT) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): + self.state = 329 self.expression(0) - self.state = 340 + self.state = 334 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 336 + self.state = 330 self.match(tlangParser.T__7) - self.state = 337 + self.state = 331 self.expression(0) - self.state = 342 + self.state = 336 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2590,171 +2613,98 @@ def arguments(self): return localctx - class ConditionContext(ParserRuleContext): + class CommentContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def NOT(self): - return self.getToken(tlangParser.NOT, 0) - - def condition(self, i:int=None): - if i is None: - return self.getTypedRuleContexts(tlangParser.ConditionContext) - else: - return self.getTypedRuleContext(tlangParser.ConditionContext,i) - - - def expression(self, i:int=None): + def NAME(self, i:int=None): if i is None: - return self.getTypedRuleContexts(tlangParser.ExpressionContext) + return self.getTokens(tlangParser.NAME) else: - return self.getTypedRuleContext(tlangParser.ExpressionContext,i) - - - def binCondOp(self): - return self.getTypedRuleContext(tlangParser.BinCondOpContext,0) - - - def PENCOND(self): - return self.getToken(tlangParser.PENCOND, 0) - - def logicOp(self): - return self.getTypedRuleContext(tlangParser.LogicOpContext,0) - + return self.getToken(tlangParser.NAME, i) def getRuleIndex(self): - return tlangParser.RULE_condition + return tlangParser.RULE_comment def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitCondition" ): - return visitor.visitCondition(self) + if hasattr( visitor, "visitComment" ): + return visitor.visitComment(self) else: return visitor.visitChildren(self) - def condition(self, _p:int=0): - _parentctx = self._ctx - _parentState = self.state - localctx = tlangParser.ConditionContext(self, self._ctx, _parentState) - _prevctx = localctx - _startState = 72 - self.enterRecursionRule(localctx, 72, self.RULE_condition, _p) - try: - self.enterOuterAlt(localctx, 1) - self.state = 357 - self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,29,self._ctx) - if la_ == 1: - self.state = 346 - self.match(tlangParser.NOT) - self.state = 347 - self.condition(5) - pass - - elif la_ == 2: - self.state = 348 - self.expression(0) - self.state = 349 - self.binCondOp() - self.state = 350 - self.expression(0) - pass - - elif la_ == 3: - self.state = 352 - self.match(tlangParser.PENCOND) - pass - - elif la_ == 4: - self.state = 353 - self.match(tlangParser.T__6) - self.state = 354 - self.condition(0) - self.state = 355 - self.match(tlangParser.T__8) - pass + def comment(self): - self._ctx.stop = self._input.LT(-1) - self.state = 365 + localctx = tlangParser.CommentContext(self, self._ctx, self.state) + self.enterRule(localctx, 70, self.RULE_comment) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 339 + self.match(tlangParser.T__23) + self.state = 343 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,30,self._ctx) - while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: - if _alt==1: - if self._parseListeners is not None: - self.triggerExitRuleEvent() - _prevctx = localctx - localctx = tlangParser.ConditionContext(self, _parentctx, _parentState) - self.pushNewRecursionContext(localctx, _startState, self.RULE_condition) - self.state = 359 - if not self.precpred(self._ctx, 3): - from antlr4.error.Errors import FailedPredicateException - raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 360 - self.logicOp() - self.state = 361 - self.condition(4) - self.state = 367 + _la = self._input.LA(1) + while _la==tlangParser.NAME: + self.state = 340 + self.match(tlangParser.NAME) + self.state = 345 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,30,self._ctx) + _la = self._input.LA(1) + self.state = 346 + self.match(tlangParser.T__23) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) self._errHandler.recover(self, re) finally: - self.unrollRecursionContexts(_parentctx) + self.exitRule() return localctx - class CommentContext(ParserRuleContext): + class LogicOpContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser - def NAME(self, i:int=None): - if i is None: - return self.getTokens(tlangParser.NAME) - else: - return self.getToken(tlangParser.NAME, i) + def AND(self): + return self.getToken(tlangParser.AND, 0) + + def OR(self): + return self.getToken(tlangParser.OR, 0) def getRuleIndex(self): - return tlangParser.RULE_comment + return tlangParser.RULE_logicOp def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitComment" ): - return visitor.visitComment(self) + if hasattr( visitor, "visitLogicOp" ): + return visitor.visitLogicOp(self) else: return visitor.visitChildren(self) - def comment(self): + def logicOp(self): - localctx = tlangParser.CommentContext(self, self._ctx, self.state) - self.enterRule(localctx, 74, self.RULE_comment) + localctx = tlangParser.LogicOpContext(self, self._ctx, self.state) + self.enterRule(localctx, 72, self.RULE_logicOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 368 - self.match(tlangParser.T__25) - self.state = 372 - self._errHandler.sync(self) + self.state = 348 _la = self._input.LA(1) - while _la==tlangParser.NAME: - self.state = 369 - self.match(tlangParser.NAME) - self.state = 374 - self._errHandler.sync(self) - _la = self._input.LA(1) - - self.state = 375 - self.match(tlangParser.T__25) + if not(_la==tlangParser.AND or _la==tlangParser.OR): + self._errHandler.recoverInline(self) + else: + self._errHandler.reportMatch(self) + self.consume() except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -2803,11 +2753,11 @@ def accept(self, visitor:ParseTreeVisitor): def binCondOp(self): localctx = tlangParser.BinCondOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 76, self.RULE_binCondOp) + self.enterRule(localctx, 74, self.RULE_binCondOp) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 377 + self.state = 350 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2823,53 +2773,6 @@ def binCondOp(self): return localctx - class LogicOpContext(ParserRuleContext): - - def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): - super().__init__(parent, invokingState) - self.parser = parser - - def AND(self): - return self.getToken(tlangParser.AND, 0) - - def OR(self): - return self.getToken(tlangParser.OR, 0) - - def getRuleIndex(self): - return tlangParser.RULE_logicOp - - def accept(self, visitor:ParseTreeVisitor): - if hasattr( visitor, "visitLogicOp" ): - return visitor.visitLogicOp(self) - else: - return visitor.visitChildren(self) - - - - - def logicOp(self): - - localctx = tlangParser.LogicOpContext(self, self._ctx, self.state) - self.enterRule(localctx, 78, self.RULE_logicOp) - self._la = 0 # Token type - try: - self.enterOuterAlt(localctx, 1) - self.state = 379 - _la = self._input.LA(1) - if not(_la==tlangParser.AND or _la==tlangParser.OR): - self._errHandler.recoverInline(self) - else: - self._errHandler.reportMatch(self) - self.consume() - except RecognitionException as re: - localctx.exception = re - self._errHandler.reportError(self, re) - self._errHandler.recover(self, re) - finally: - self.exitRule() - return localctx - - class ValueContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): @@ -2912,44 +2815,44 @@ def accept(self, visitor:ParseTreeVisitor): def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) - self.enterRule(localctx, 80, self.RULE_value) + self.enterRule(localctx, 76, self.RULE_value) try: - self.state = 387 + self.state = 358 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input,32,self._ctx) + la_ = self._interp.adaptivePredict(self._input,28,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 381 + self.state = 352 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 382 + self.state = 353 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 383 + self.state = 354 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 384 + self.state = 355 self.dataLocationAccess() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 385 + self.state = 356 self.functionCall() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 386 + self.state = 357 self.match(tlangParser.REAL) pass @@ -2968,7 +2871,6 @@ def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): if self._predicates == None: self._predicates = dict() self._predicates[22] = self.expression_sempred - self._predicates[36] = self.condition_sempred pred = self._predicates.get(ruleIndex, None) if pred is None: raise Exception("No predicate with index:" + str(ruleIndex)) @@ -2977,18 +2879,21 @@ def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): def expression_sempred(self, localctx:ExpressionContext, predIndex:int): if predIndex == 0: - return self.precpred(self._ctx, 5) + return self.precpred(self._ctx, 9) if predIndex == 1: - return self.precpred(self._ctx, 4) + return self.precpred(self._ctx, 8) - def condition_sempred(self, localctx:ConditionContext, predIndex:int): if predIndex == 2: return self.precpred(self._ctx, 3) + if predIndex == 3: + return self.precpred(self._ctx, 2) + + diff --git a/ChironCore/turtparse/tlangVisitor.py b/ChironCore/turtparse/tlangVisitor.py index 632f1a0..e36f0bb 100644 --- a/ChironCore/turtparse/tlangVisitor.py +++ b/ChironCore/turtparse/tlangVisitor.py @@ -119,6 +119,11 @@ def visitReturnStatement(self, ctx:tlangParser.ReturnStatementContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#binExpr. + def visitBinExpr(self, ctx:tlangParser.BinExprContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#unaryExpr. def visitUnaryExpr(self, ctx:tlangParser.UnaryExprContext): return self.visitChildren(ctx) @@ -129,6 +134,11 @@ def visitValueExpr(self, ctx:tlangParser.ValueExprContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#notExpr. + def visitNotExpr(self, ctx:tlangParser.NotExprContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#addExpr. def visitAddExpr(self, ctx:tlangParser.AddExprContext): return self.visitChildren(ctx) @@ -139,6 +149,11 @@ def visitMulExpr(self, ctx:tlangParser.MulExprContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#penExpr. + def visitPenExpr(self, ctx:tlangParser.PenExprContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#assignExpr. def visitAssignExpr(self, ctx:tlangParser.AssignExprContext): return self.visitChildren(ctx) @@ -149,6 +164,11 @@ def visitParenExpr(self, ctx:tlangParser.ParenExprContext): return self.visitChildren(ctx) + # Visit a parse tree produced by tlangParser#logExpr. + def visitLogExpr(self, ctx:tlangParser.LogExprContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by tlangParser#classDeclaration. def visitClassDeclaration(self, ctx:tlangParser.ClassDeclarationContext): return self.visitChildren(ctx) @@ -194,11 +214,6 @@ def visitMethodCaller(self, ctx:tlangParser.MethodCallerContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#functionCallWithReturnValues. - def visitFunctionCallWithReturnValues(self, ctx:tlangParser.FunctionCallWithReturnValuesContext): - return self.visitChildren(ctx) - - # Visit a parse tree produced by tlangParser#functionDeclaration. def visitFunctionDeclaration(self, ctx:tlangParser.FunctionDeclarationContext): return self.visitChildren(ctx) @@ -214,23 +229,18 @@ def visitArguments(self, ctx:tlangParser.ArgumentsContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#condition. - def visitCondition(self, ctx:tlangParser.ConditionContext): - return self.visitChildren(ctx) - - # Visit a parse tree produced by tlangParser#comment. def visitComment(self, ctx:tlangParser.CommentContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#binCondOp. - def visitBinCondOp(self, ctx:tlangParser.BinCondOpContext): + # Visit a parse tree produced by tlangParser#logicOp. + def visitLogicOp(self, ctx:tlangParser.LogicOpContext): return self.visitChildren(ctx) - # Visit a parse tree produced by tlangParser#logicOp. - def visitLogicOp(self, ctx:tlangParser.LogicOpContext): + # Visit a parse tree produced by tlangParser#binCondOp. + def visitBinCondOp(self, ctx:tlangParser.BinCondOpContext): return self.visitChildren(ctx) From ee2ea6d5b2131965a7ef869313e8880f3bf453a0 Mon Sep 17 00:00:00 2001 From: Yash Pratap Singh Date: Sun, 20 Apr 2025 21:03:35 +0530 Subject: [PATCH 32/47] [feature] visualize class hierarchy with -ch flag - Add Class Hierarchy Analysis to visualize class structure and inheritance. - Use -cha command-line flag to enable/disable CHA output. - Methods reflect defining class colors, with inherited methods in original class colors. --- ChironCore/chiron.py | 6 ++ ChironCore/example/demo/class_hierarchy.tl | 22 ++++++ ChironCore/interpreter.py | 89 +++++++++++++++++++++- 3 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 ChironCore/example/demo/class_hierarchy.tl diff --git a/ChironCore/chiron.py b/ChironCore/chiron.py index 96f9997..acd8ea4 100755 --- a/ChironCore/chiron.py +++ b/ChironCore/chiron.py @@ -195,6 +195,12 @@ def stopTurtle(): default=True, type=bool, ) + cmdparser.add_argument( + "-ch", + "--class_hierarchy", + help="To visualize class inheritance and methods", + action="store_true", + ) args = cmdparser.parse_args() ir = "" diff --git a/ChironCore/example/demo/class_hierarchy.tl b/ChironCore/example/demo/class_hierarchy.tl new file mode 100644 index 0000000..00eb556 --- /dev/null +++ b/ChironCore/example/demo/class_hierarchy.tl @@ -0,0 +1,22 @@ +class :Base { + def Base(:arg1) {} +} + +class :Level1(:Base) { + def oneA() {} + def twoA(:arg1, :arg2) {} +} + +class :Level2(:Level1) { + def twoA(:arg1, :arg2) {} + def twoB(:arg1, :arg2, :arg3) {} +} + +class :Deroute(:Base) { + def something(:arg1, :arg2) {} +} + +class :Level3(:Level2, :Deroute) { + def threeA() {} + def threeB(:arg1, :arg2, :arg3, :arg4) {} +} diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index a5e0171..f924624 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -1,8 +1,10 @@ - from ChironAST import ChironAST from ChironHooks import Chironhooks import turtle import re +from graphviz import Digraph +import tkinter as tk +from PIL import Image, ImageTk Release = "Chiron v5.3" @@ -108,6 +110,9 @@ def __init__(self, irHandler, params): super().__init__(irHandler, params) self.prg = ProgramContext() self.class_list = ClassList() + self.class_hierarchy = {} + self.class_methods = {} + self.class_colors = {} # Hooks Object: if self.args is not None and self.args.hooks: self.chironhook = Chironhooks.ConcreteChironHooks() @@ -167,6 +172,8 @@ def interpret(self): if self.pc >= len(self.ir): # This is the ending of the interpreter. + if self.args.class_hierarchy: + self.print_class_hierarchy() self.trtl.write("End, Press ESC", font=("Arial", 15, "bold")) if self.args is not None and self.args.hooks: self.chironhook.ChironEndHook(self) @@ -192,6 +199,16 @@ def handleFunctionDeclaration(self, stmt, tgt): function_name = stmt.name self.function_addresses[function_name + "_" + str(len(stmt.params))] = self.pc + 1 # body of the function starts from next instruction + + # Record method in class_methods if it's a class method + if "@" in stmt.name: + class_name, method_name = stmt.name.split("@") + class_name = class_name.replace(":", "") + arity = len(stmt.params) + if class_name not in self.class_methods: + self.class_methods[class_name] = [] + self.class_methods[class_name].append((method_name, arity)) + return tgt def handleFunctionCall(self, stmt, tgt): @@ -263,33 +280,42 @@ def handleParametersPassing(self, stmt, tgt): def handleClassDeclaration(self, stmt, tgt): className = stmt.className.replace(":", "") attributes = stmt.attributes # List of attribute assignments + # Handle inheritance if base classes exist if hasattr(stmt, "baseClasses") and stmt.baseClasses: - base_classes = [getattr(self.class_list, str( - b).replace(":", "")) for b in stmt.baseClasses] - base_str = ", ".join([b.__name__ for b in base_classes]) + base_classes = [base.replace(":", "") for base in stmt.baseClasses] + self.class_hierarchy[className] = base_classes + base_classes_for_def = [getattr(self.class_list, str(b).replace(":", "")) for b in stmt.baseClasses] + base_str = ", ".join([b.__name__ for b in base_classes_for_def]) class_header = f"class {className}({base_str}):\n" else: + self.class_hierarchy[className] = [] class_header = f"class {className}:\n" + class_def = class_header init_method = " def __init__(self" # Start of __init__ init_body = " super().__init__()\n" + # Handle normal attributes (non-object attributes) for attr in attributes: attr, target = attr attr_name = str(attr.lvar).replace(":", "") attr_value = addContext(attr.rexpr) if attr.rexpr else "None" init_body += f" self.{attr_name} = {attr_value}\n" + # Handle object attributes for objectAttr in stmt.objectAttributes: objectAttr, target = objectAttr lhs = str(objectAttr.target).replace(":", "") init_body += f" self.{lhs} = None\n" + init_method += "):\n" # Close the __init__ method signature class_def += init_method class_def += init_body + # Step 1: Execute the class definition (store it inside self.class_list) exec(class_def, globals(), self.class_list.__dict__) + # Step 2: Assign object attributes after class creation for objectAttr in stmt.objectAttributes: objectAttr, target = objectAttr @@ -297,6 +323,7 @@ def handleClassDeclaration(self, stmt, tgt): rhs = addContext(objectAttr.class_name).replace( "self.prg.", "self.class_list.") exec(f"self.class_list.{className}.{lhs} = {rhs}()") + # Inherit methods from base classes inherited_function_addresses = {} if stmt.baseClasses: @@ -306,6 +333,7 @@ def handleClassDeclaration(self, stmt, tgt): new_function_name = f"{stmt.className}@{method_name}" inherited_function_addresses[new_function_name] = address self.function_addresses.update(inherited_function_addresses) + return 1 def handleObjectInstantiation(self, stmt, tgt): @@ -357,3 +385,56 @@ def handleGotoCommand(self, stmt, tgt): ycor = addContext(stmt.ycor) exec("self.trtl.goto(%s, %s)" % (xcor, ycor)) return 1 + + def get_all_methods(self, class_name): + if class_name not in self.class_hierarchy: + return {} + methods = {} + # Add methods defined in this class first (they override inherited ones) + if class_name in self.class_methods: + for method, arity in self.class_methods[class_name]: + methods[(method, arity)] = class_name + # Add inherited methods from base classes, in order + for base in self.class_hierarchy[class_name]: + base_methods = self.get_all_methods(base) + for (method, arity), defining_class in base_methods.items(): + if (method, arity) not in methods: + methods[(method, arity)] = defining_class + return methods + + def print_class_hierarchy(self): + dot = Digraph(comment='Class Hierarchy') + dot.attr(rankdir='BT') + + # Generate random colors for each class + import random + for class_name in self.class_hierarchy: + if class_name not in self.class_colors: + self.class_colors[class_name] = "#{:06x}".format(random.randint(0, 0xFFFFFF)) + + for class_name in self.class_hierarchy: + methods = self.get_all_methods(class_name) + label = f"<{class_name}
" # Newline after class name + for (method, arity), defining_class in sorted(methods.items()): + class_color = self.class_colors.get(defining_class, "#000000") # Default to black if not found + label += f"{method}({arity})
" + label += ">" + dot.node(class_name, label=label, shape='record', color=self.class_colors[class_name], style="solid") + + for class_name, bases in self.class_hierarchy.items(): + for base in bases: + dot.edge(base, class_name) + + dot.render('class_hierarchy', format='png', cleanup=True) + self.display_graph('class_hierarchy.png') + + def display_graph(self, image_path): + screen = self.t_screen + root = screen._root + top = tk.Toplevel(root) + top.title("Class Hierarchy Diagram") + img = Image.open(image_path) + photo = ImageTk.PhotoImage(img) + panel = tk.Label(top, image=photo) + panel.pack(side="bottom", fill="both", expand="yes") + panel.image = photo From ad07cd08a447c4f0a501c52825d32d9645163988 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Mon, 21 Apr 2025 02:21:57 +0530 Subject: [PATCH 33/47] changed grammar --- .../example/demo/class_inheritance_2.tl | 6 +- ChironCore/example/demo/class_methods.tl | 2 +- ChironCore/example/demo/diamond_problem.tl | 2 +- ChironCore/example/demo/functions.tl | 6 +- ChironCore/example/demo/general.tl | 4 +- ChironCore/example/demo/rangoli.tl | 4 +- ChironCore/example/example1.tl | 1 + ChironCore/example/exampleFC.tl | 8 +- ChironCore/example/exampleSE.tl | 1 + ChironCore/example/kachuapur3.tl | 4 +- ChironCore/optimized.kw | Bin 0 -> 1063 bytes ChironCore/test-1.ipynb | 62 +++++ ChironCore/turtparse/tlang.g4 | 14 +- ChironCore/turtparse/tlang.interp | 2 +- ChironCore/turtparse/tlangParser.py | 243 +++++++++--------- 15 files changed, 213 insertions(+), 146 deletions(-) create mode 100644 ChironCore/optimized.kw create mode 100644 ChironCore/test-1.ipynb diff --git a/ChironCore/example/demo/class_inheritance_2.tl b/ChironCore/example/demo/class_inheritance_2.tl index 802b215..757f60d 100644 --- a/ChironCore/example/demo/class_inheritance_2.tl +++ b/ChironCore/example/demo/class_inheritance_2.tl @@ -11,7 +11,7 @@ class :Hexagon(:Shape) { :sides = 6 def drawHex(:self) { repeat :self.:sides [ - :self.moveForward() + :f= :self.moveForward() right 60 ] return 0 @@ -23,6 +23,6 @@ class :Hexagon(:Shape) { } :hex = new :Hexagon() -:hex.drawHex() +:f= :hex.drawHex() # This does not work # -:hex.__moveForward(100) \ No newline at end of file +:f= :hex.__moveForward(100) \ No newline at end of file diff --git a/ChironCore/example/demo/class_methods.tl b/ChironCore/example/demo/class_methods.tl index e63571f..2351319 100644 --- a/ChironCore/example/demo/class_methods.tl +++ b/ChironCore/example/demo/class_methods.tl @@ -12,4 +12,4 @@ class :Pentagon { } :pent = new :Pentagon() -:pent.drawShape() +:f= :pent.drawShape() diff --git a/ChironCore/example/demo/diamond_problem.tl b/ChironCore/example/demo/diamond_problem.tl index b3907f4..eb8f6c9 100644 --- a/ChironCore/example/demo/diamond_problem.tl +++ b/ChironCore/example/demo/diamond_problem.tl @@ -22,4 +22,4 @@ class :Liger(:Lion, :Tiger) :liger = new :Liger() :liger.:walk = 2 -:liger.walk() \ No newline at end of file +:f= :liger.walk() \ No newline at end of file diff --git a/ChironCore/example/demo/functions.tl b/ChironCore/example/demo/functions.tl index cf524ac..32c72d4 100644 --- a/ChironCore/example/demo/functions.tl +++ b/ChironCore/example/demo/functions.tl @@ -11,6 +11,6 @@ def drawSide(:length,:righti) { :length = 250 :righti = 45 -drawSide(:length) -drawSide(:length,:righti) -drawSide(:length) +:f= drawSide(:length) +:f= drawSide(:length,:righti) +:f= drawSide(:length) diff --git a/ChironCore/example/demo/general.tl b/ChironCore/example/demo/general.tl index 6478be5..9b0529f 100644 --- a/ChironCore/example/demo/general.tl +++ b/ChironCore/example/demo/general.tl @@ -23,9 +23,9 @@ def drawSquare(:size) { } :star = new :Star() -:star.drawStar() +:f= :star.drawStar() penup goto(-25, 100) pendown :size = 300 -drawSquare(:size) +:f= drawSquare(:size) diff --git a/ChironCore/example/demo/rangoli.tl b/ChironCore/example/demo/rangoli.tl index d8b603e..8135579 100644 --- a/ChironCore/example/demo/rangoli.tl +++ b/ChironCore/example/demo/rangoli.tl @@ -51,7 +51,7 @@ def drawRangoli(:size) left 45 :size = sqroot((:size * :size ) / 2) if :size > 10 - [ drawRangoli(:size) ] + [ :f = drawRangoli(:size) ] return 100 } @@ -63,4 +63,4 @@ penup :point = new :Point() goto (:point.:x, :point.:y) :size=200 -drawRangoli(:size) +:f= drawRangoli(:size) diff --git a/ChironCore/example/example1.tl b/ChironCore/example/example1.tl index 42c907e..a23ac7f 100644 --- a/ChironCore/example/example1.tl +++ b/ChironCore/example/example1.tl @@ -1,4 +1,5 @@ pendown +:x = 4 :y = 2 :z = 4 :p = 10 diff --git a/ChironCore/example/exampleFC.tl b/ChironCore/example/exampleFC.tl index 4933053..7f2e2b3 100644 --- a/ChironCore/example/exampleFC.tl +++ b/ChironCore/example/exampleFC.tl @@ -12,7 +12,7 @@ def drawRectangle(:l, :b) right 90 forward :b penup - return + return 0 } def drawCircle() @@ -51,9 +51,9 @@ def factorial(:n) if :n == 1 [ return 1 ] - return :n * factorial(:n - 1) + return :n * (:f=factorial(:n - 1)) } -drawRectangle(50, 50) -:a, :b = drawCircle() +:f= drawRectangle(50, 50) +:a= drawCircle() print(factorial(6)) diff --git a/ChironCore/example/exampleSE.tl b/ChironCore/example/exampleSE.tl index f2096f5..81e650c 100644 --- a/ChironCore/example/exampleSE.tl +++ b/ChironCore/example/exampleSE.tl @@ -1,3 +1,4 @@ +:x = 3 :y = :x if :x <= 42 [ :y = :y + 40 diff --git a/ChironCore/example/kachuapur3.tl b/ChironCore/example/kachuapur3.tl index d137ae4..b32f6b8 100644 --- a/ChironCore/example/kachuapur3.tl +++ b/ChironCore/example/kachuapur3.tl @@ -27,6 +27,6 @@ print(:point.:x) print(:circle.:point.:x) print(:circle1.:point.:x) -:circle.:point.draw() +:f= :circle.:point.draw() -:circle1.:point.drawy() \ No newline at end of file +:f = :circle1.:point.drawy() \ No newline at end of file diff --git a/ChironCore/optimized.kw b/ChironCore/optimized.kw new file mode 100644 index 0000000000000000000000000000000000000000..ff8a327aa17e557fbc3aa33eee7b1aa4d4037378 GIT binary patch literal 1063 zcmaJM6w%o)NBhI{4`l z$xTt?8vbQt(}YW2bZv$y;fbbJVRIft zFl~$!DFgwnkt?MQr-KHj6;32WJV}YA_knf0e0fMa#fct+K*eSNR+v7aC+_xi*r?{x zGr&Ea)=r>uif2wg6pSvp(uixe-^@TGnGkL3iGB!1Zj>JtK1a@yEvn^!y<}sNbNvt5 zgIluu^mW20l4KDTKq8};4(yr71EkTFhzr`iI3`Nnn%_0xzO=?MH4jkn8pRYb4$H4R z11l;sI(@-sY)_tyAH&Ng4ENqn>IsLbTl?#6+d+v5)YlA))Ee)V&9TD6V6_3a--{*L z30iB$B!mJ|Y)x}6 1\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43moptimized.kw\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mrb\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m f:\n\u001b[1;32m 2\u001b[0m ir \u001b[38;5;241m=\u001b[39m pickle\u001b[38;5;241m.\u001b[39mload(f)\n\u001b[1;32m 4\u001b[0m \u001b[38;5;66;03m# You can now inspect `ir`\u001b[39;00m\n", + "File \u001b[0;32m~/Library/Python/3.11/lib/python/site-packages/IPython/core/interactiveshell.py:310\u001b[0m, in \u001b[0;36m_modified_open\u001b[0;34m(file, *args, **kwargs)\u001b[0m\n\u001b[1;32m 303\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m file \u001b[38;5;129;01min\u001b[39;00m {\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m2\u001b[39m}:\n\u001b[1;32m 304\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 305\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mIPython won\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt let you open fd=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mfile\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m by default \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 306\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mas it is likely to crash IPython. If you know what you are doing, \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 307\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124myou can use builtins\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m open.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 308\u001b[0m )\n\u001b[0;32m--> 310\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mio_open\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfile\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'optimized.kw'" + ] + } + ], + "source": [ + "with open(\"optimized.kw\", \"rb\") as f:\n", + " ir = pickle.load(f)\n", + "\n", + "# You can now inspect `ir`\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.5" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index 6edf55c..392d373 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -16,7 +16,8 @@ declaration : classDeclaration ; instruction : - printStatement + assignment + | printStatement | conditional | loop | moveCommand @@ -24,7 +25,6 @@ instruction : | gotoCommand | pauseCommand | objectInstantiation - | expression | returnStatement ; @@ -61,10 +61,6 @@ additive : PLUS | MINUS; unaryArithOp : MINUS ; -PLUS : '+' ; -MINUS : '-' ; -MUL : '*' ; -DIV : '/' ; returnStatement : RETURN ( expression ( ',' expression )* ) ; @@ -121,6 +117,12 @@ logicOp : AND | OR ; binCondOp : EQ | NEQ | LT | GT | LTE | GTE ; + +PLUS : '+' ; +MINUS : '-' ; +MUL : '*' ; +DIV : '/' ; + AND: '&&'; OR : '||'; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index 452149b..f5e4338 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -137,4 +137,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 363, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 7, 4, 88, 10, 4, 12, 4, 14, 4, 91, 11, 4, 3, 5, 3, 5, 7, 5, 95, 10, 5, 12, 5, 14, 5, 98, 11, 5, 3, 6, 3, 6, 5, 6, 102, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 114, 10, 7, 3, 8, 3, 8, 5, 8, 118, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 162, 10, 17, 12, 17, 14, 17, 165, 11, 17, 5, 17, 167, 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 190, 10, 23, 12, 23, 14, 23, 193, 11, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 211, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 229, 10, 24, 12, 24, 14, 24, 232, 11, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 240, 10, 25, 12, 25, 14, 25, 243, 11, 25, 5, 25, 245, 10, 25, 3, 25, 5, 25, 248, 10, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 7, 26, 255, 10, 26, 12, 26, 14, 26, 258, 11, 26, 3, 26, 7, 26, 261, 10, 26, 12, 26, 14, 26, 264, 11, 26, 3, 27, 3, 27, 5, 27, 268, 10, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 6, 29, 284, 10, 29, 13, 29, 14, 29, 285, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 292, 10, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 305, 10, 33, 3, 33, 7, 33, 308, 10, 33, 12, 33, 14, 33, 311, 11, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 7, 35, 325, 10, 35, 12, 35, 14, 35, 328, 11, 35, 5, 35, 330, 10, 35, 3, 36, 3, 36, 3, 36, 7, 36, 335, 10, 36, 12, 36, 14, 36, 338, 11, 36, 5, 36, 340, 10, 36, 3, 37, 3, 37, 7, 37, 344, 10, 37, 12, 37, 14, 37, 347, 11, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 5, 40, 361, 10, 40, 3, 40, 2, 3, 46, 41, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 29, 30, 3, 2, 27, 28, 3, 2, 31, 32, 3, 2, 36, 41, 2, 370, 2, 80, 3, 2, 2, 2, 4, 83, 3, 2, 2, 2, 6, 89, 3, 2, 2, 2, 8, 96, 3, 2, 2, 2, 10, 101, 3, 2, 2, 2, 12, 113, 3, 2, 2, 2, 14, 117, 3, 2, 2, 2, 16, 119, 3, 2, 2, 2, 18, 125, 3, 2, 2, 2, 20, 135, 3, 2, 2, 2, 22, 141, 3, 2, 2, 2, 24, 148, 3, 2, 2, 2, 26, 151, 3, 2, 2, 2, 28, 153, 3, 2, 2, 2, 30, 155, 3, 2, 2, 2, 32, 157, 3, 2, 2, 2, 34, 170, 3, 2, 2, 2, 36, 174, 3, 2, 2, 2, 38, 179, 3, 2, 2, 2, 40, 181, 3, 2, 2, 2, 42, 183, 3, 2, 2, 2, 44, 185, 3, 2, 2, 2, 46, 210, 3, 2, 2, 2, 48, 233, 3, 2, 2, 2, 50, 256, 3, 2, 2, 2, 52, 267, 3, 2, 2, 2, 54, 269, 3, 2, 2, 2, 56, 276, 3, 2, 2, 2, 58, 287, 3, 2, 2, 2, 60, 291, 3, 2, 2, 2, 62, 293, 3, 2, 2, 2, 64, 309, 3, 2, 2, 2, 66, 312, 3, 2, 2, 2, 68, 329, 3, 2, 2, 2, 70, 339, 3, 2, 2, 2, 72, 341, 3, 2, 2, 2, 74, 350, 3, 2, 2, 2, 76, 352, 3, 2, 2, 2, 78, 360, 3, 2, 2, 2, 80, 81, 5, 4, 3, 2, 81, 82, 7, 2, 2, 3, 82, 3, 3, 2, 2, 2, 83, 84, 5, 6, 4, 2, 84, 85, 5, 8, 5, 2, 85, 5, 3, 2, 2, 2, 86, 88, 5, 10, 6, 2, 87, 86, 3, 2, 2, 2, 88, 91, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 7, 3, 2, 2, 2, 91, 89, 3, 2, 2, 2, 92, 95, 5, 12, 7, 2, 93, 95, 5, 72, 37, 2, 94, 92, 3, 2, 2, 2, 94, 93, 3, 2, 2, 2, 95, 98, 3, 2, 2, 2, 96, 94, 3, 2, 2, 2, 96, 97, 3, 2, 2, 2, 97, 9, 3, 2, 2, 2, 98, 96, 3, 2, 2, 2, 99, 102, 5, 48, 25, 2, 100, 102, 5, 66, 34, 2, 101, 99, 3, 2, 2, 2, 101, 100, 3, 2, 2, 2, 102, 11, 3, 2, 2, 2, 103, 114, 5, 36, 19, 2, 104, 114, 5, 14, 8, 2, 105, 114, 5, 20, 11, 2, 106, 114, 5, 24, 13, 2, 107, 114, 5, 28, 15, 2, 108, 114, 5, 22, 12, 2, 109, 114, 5, 30, 16, 2, 110, 114, 5, 54, 28, 2, 111, 114, 5, 46, 24, 2, 112, 114, 5, 44, 23, 2, 113, 103, 3, 2, 2, 2, 113, 104, 3, 2, 2, 2, 113, 105, 3, 2, 2, 2, 113, 106, 3, 2, 2, 2, 113, 107, 3, 2, 2, 2, 113, 108, 3, 2, 2, 2, 113, 109, 3, 2, 2, 2, 113, 110, 3, 2, 2, 2, 113, 111, 3, 2, 2, 2, 113, 112, 3, 2, 2, 2, 114, 13, 3, 2, 2, 2, 115, 118, 5, 16, 9, 2, 116, 118, 5, 18, 10, 2, 117, 115, 3, 2, 2, 2, 117, 116, 3, 2, 2, 2, 118, 15, 3, 2, 2, 2, 119, 120, 7, 3, 2, 2, 120, 121, 5, 46, 24, 2, 121, 122, 7, 4, 2, 2, 122, 123, 5, 8, 5, 2, 123, 124, 7, 5, 2, 2, 124, 17, 3, 2, 2, 2, 125, 126, 7, 3, 2, 2, 126, 127, 5, 46, 24, 2, 127, 128, 7, 4, 2, 2, 128, 129, 5, 8, 5, 2, 129, 130, 7, 5, 2, 2, 130, 131, 7, 6, 2, 2, 131, 132, 7, 4, 2, 2, 132, 133, 5, 8, 5, 2, 133, 134, 7, 5, 2, 2, 134, 19, 3, 2, 2, 2, 135, 136, 7, 7, 2, 2, 136, 137, 5, 78, 40, 2, 137, 138, 7, 4, 2, 2, 138, 139, 5, 8, 5, 2, 139, 140, 7, 5, 2, 2, 140, 21, 3, 2, 2, 2, 141, 142, 7, 8, 2, 2, 142, 143, 7, 9, 2, 2, 143, 144, 5, 46, 24, 2, 144, 145, 7, 10, 2, 2, 145, 146, 5, 46, 24, 2, 146, 147, 7, 11, 2, 2, 147, 23, 3, 2, 2, 2, 148, 149, 5, 26, 14, 2, 149, 150, 5, 46, 24, 2, 150, 25, 3, 2, 2, 2, 151, 152, 9, 2, 2, 2, 152, 27, 3, 2, 2, 2, 153, 154, 9, 3, 2, 2, 154, 29, 3, 2, 2, 2, 155, 156, 7, 18, 2, 2, 156, 31, 3, 2, 2, 2, 157, 166, 7, 4, 2, 2, 158, 163, 5, 46, 24, 2, 159, 160, 7, 10, 2, 2, 160, 162, 5, 46, 24, 2, 161, 159, 3, 2, 2, 2, 162, 165, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 167, 3, 2, 2, 2, 165, 163, 3, 2, 2, 2, 166, 158, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 7, 5, 2, 2, 169, 33, 3, 2, 2, 2, 170, 171, 5, 60, 31, 2, 171, 172, 7, 19, 2, 2, 172, 173, 5, 46, 24, 2, 173, 35, 3, 2, 2, 2, 174, 175, 7, 34, 2, 2, 175, 176, 7, 9, 2, 2, 176, 177, 5, 46, 24, 2, 177, 178, 7, 11, 2, 2, 178, 37, 3, 2, 2, 2, 179, 180, 9, 4, 2, 2, 180, 39, 3, 2, 2, 2, 181, 182, 9, 5, 2, 2, 182, 41, 3, 2, 2, 2, 183, 184, 7, 28, 2, 2, 184, 43, 3, 2, 2, 2, 185, 186, 7, 33, 2, 2, 186, 191, 5, 46, 24, 2, 187, 188, 7, 10, 2, 2, 188, 190, 5, 46, 24, 2, 189, 187, 3, 2, 2, 2, 190, 193, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 45, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 194, 195, 8, 24, 1, 2, 195, 196, 5, 42, 22, 2, 196, 197, 5, 46, 24, 12, 197, 211, 3, 2, 2, 2, 198, 199, 5, 60, 31, 2, 199, 200, 7, 19, 2, 2, 200, 201, 5, 46, 24, 9, 201, 211, 3, 2, 2, 2, 202, 203, 7, 9, 2, 2, 203, 204, 5, 46, 24, 2, 204, 205, 7, 11, 2, 2, 205, 211, 3, 2, 2, 2, 206, 211, 5, 78, 40, 2, 207, 208, 7, 42, 2, 2, 208, 211, 5, 46, 24, 6, 209, 211, 7, 35, 2, 2, 210, 194, 3, 2, 2, 2, 210, 198, 3, 2, 2, 2, 210, 202, 3, 2, 2, 2, 210, 206, 3, 2, 2, 2, 210, 207, 3, 2, 2, 2, 210, 209, 3, 2, 2, 2, 211, 230, 3, 2, 2, 2, 212, 213, 12, 11, 2, 2, 213, 214, 5, 38, 20, 2, 214, 215, 5, 46, 24, 12, 215, 229, 3, 2, 2, 2, 216, 217, 12, 10, 2, 2, 217, 218, 5, 40, 21, 2, 218, 219, 5, 46, 24, 11, 219, 229, 3, 2, 2, 2, 220, 221, 12, 5, 2, 2, 221, 222, 5, 76, 39, 2, 222, 223, 5, 46, 24, 6, 223, 229, 3, 2, 2, 2, 224, 225, 12, 4, 2, 2, 225, 226, 5, 74, 38, 2, 226, 227, 5, 46, 24, 5, 227, 229, 3, 2, 2, 2, 228, 212, 3, 2, 2, 2, 228, 216, 3, 2, 2, 2, 228, 220, 3, 2, 2, 2, 228, 224, 3, 2, 2, 2, 229, 232, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 47, 3, 2, 2, 2, 232, 230, 3, 2, 2, 2, 233, 234, 7, 20, 2, 2, 234, 247, 7, 45, 2, 2, 235, 236, 7, 9, 2, 2, 236, 244, 7, 45, 2, 2, 237, 241, 7, 10, 2, 2, 238, 240, 7, 45, 2, 2, 239, 238, 3, 2, 2, 2, 240, 243, 3, 2, 2, 2, 241, 239, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 244, 237, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 246, 3, 2, 2, 2, 246, 248, 7, 11, 2, 2, 247, 235, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 250, 7, 21, 2, 2, 250, 251, 5, 50, 26, 2, 251, 252, 7, 22, 2, 2, 252, 49, 3, 2, 2, 2, 253, 255, 5, 52, 27, 2, 254, 253, 3, 2, 2, 2, 255, 258, 3, 2, 2, 2, 256, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 262, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 259, 261, 5, 66, 34, 2, 260, 259, 3, 2, 2, 2, 261, 264, 3, 2, 2, 2, 262, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 51, 3, 2, 2, 2, 264, 262, 3, 2, 2, 2, 265, 268, 5, 34, 18, 2, 266, 268, 5, 54, 28, 2, 267, 265, 3, 2, 2, 2, 267, 266, 3, 2, 2, 2, 268, 53, 3, 2, 2, 2, 269, 270, 5, 60, 31, 2, 270, 271, 7, 19, 2, 2, 271, 272, 7, 23, 2, 2, 272, 273, 7, 45, 2, 2, 273, 274, 7, 9, 2, 2, 274, 275, 7, 11, 2, 2, 275, 55, 3, 2, 2, 2, 276, 283, 5, 58, 30, 2, 277, 278, 7, 24, 2, 2, 278, 284, 7, 45, 2, 2, 279, 280, 7, 4, 2, 2, 280, 281, 5, 46, 24, 2, 281, 282, 7, 5, 2, 2, 282, 284, 3, 2, 2, 2, 283, 277, 3, 2, 2, 2, 283, 279, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 283, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 57, 3, 2, 2, 2, 287, 288, 7, 45, 2, 2, 288, 59, 3, 2, 2, 2, 289, 292, 7, 45, 2, 2, 290, 292, 5, 56, 29, 2, 291, 289, 3, 2, 2, 2, 291, 290, 3, 2, 2, 2, 292, 61, 3, 2, 2, 2, 293, 294, 5, 64, 33, 2, 294, 295, 7, 46, 2, 2, 295, 296, 7, 9, 2, 2, 296, 297, 5, 70, 36, 2, 297, 298, 7, 11, 2, 2, 298, 63, 3, 2, 2, 2, 299, 305, 7, 45, 2, 2, 300, 301, 7, 4, 2, 2, 301, 302, 5, 46, 24, 2, 302, 303, 7, 5, 2, 2, 303, 305, 3, 2, 2, 2, 304, 299, 3, 2, 2, 2, 304, 300, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 308, 7, 24, 2, 2, 307, 304, 3, 2, 2, 2, 308, 311, 3, 2, 2, 2, 309, 307, 3, 2, 2, 2, 309, 310, 3, 2, 2, 2, 310, 65, 3, 2, 2, 2, 311, 309, 3, 2, 2, 2, 312, 313, 7, 25, 2, 2, 313, 314, 7, 46, 2, 2, 314, 315, 7, 9, 2, 2, 315, 316, 5, 68, 35, 2, 316, 317, 7, 11, 2, 2, 317, 318, 7, 21, 2, 2, 318, 319, 5, 8, 5, 2, 319, 320, 7, 22, 2, 2, 320, 67, 3, 2, 2, 2, 321, 326, 7, 45, 2, 2, 322, 323, 7, 10, 2, 2, 323, 325, 7, 45, 2, 2, 324, 322, 3, 2, 2, 2, 325, 328, 3, 2, 2, 2, 326, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 330, 3, 2, 2, 2, 328, 326, 3, 2, 2, 2, 329, 321, 3, 2, 2, 2, 329, 330, 3, 2, 2, 2, 330, 69, 3, 2, 2, 2, 331, 336, 5, 46, 24, 2, 332, 333, 7, 10, 2, 2, 333, 335, 5, 46, 24, 2, 334, 332, 3, 2, 2, 2, 335, 338, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 336, 337, 3, 2, 2, 2, 337, 340, 3, 2, 2, 2, 338, 336, 3, 2, 2, 2, 339, 331, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 71, 3, 2, 2, 2, 341, 345, 7, 26, 2, 2, 342, 344, 7, 46, 2, 2, 343, 342, 3, 2, 2, 2, 344, 347, 3, 2, 2, 2, 345, 343, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 348, 3, 2, 2, 2, 347, 345, 3, 2, 2, 2, 348, 349, 7, 26, 2, 2, 349, 73, 3, 2, 2, 2, 350, 351, 9, 6, 2, 2, 351, 75, 3, 2, 2, 2, 352, 353, 9, 7, 2, 2, 353, 77, 3, 2, 2, 2, 354, 361, 7, 43, 2, 2, 355, 361, 7, 45, 2, 2, 356, 361, 5, 32, 17, 2, 357, 361, 5, 56, 29, 2, 358, 361, 5, 62, 32, 2, 359, 361, 7, 44, 2, 2, 360, 354, 3, 2, 2, 2, 360, 355, 3, 2, 2, 2, 360, 356, 3, 2, 2, 2, 360, 357, 3, 2, 2, 2, 360, 358, 3, 2, 2, 2, 360, 359, 3, 2, 2, 2, 361, 79, 3, 2, 2, 2, 31, 89, 94, 96, 101, 113, 117, 163, 166, 191, 210, 228, 230, 241, 244, 247, 256, 262, 267, 283, 285, 291, 304, 309, 326, 329, 336, 339, 345, 360] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 363, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 7, 4, 88, 10, 4, 12, 4, 14, 4, 91, 11, 4, 3, 5, 3, 5, 7, 5, 95, 10, 5, 12, 5, 14, 5, 98, 11, 5, 3, 6, 3, 6, 5, 6, 102, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 114, 10, 7, 3, 8, 3, 8, 5, 8, 118, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 162, 10, 17, 12, 17, 14, 17, 165, 11, 17, 5, 17, 167, 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 190, 10, 23, 12, 23, 14, 23, 193, 11, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 211, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 229, 10, 24, 12, 24, 14, 24, 232, 11, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 240, 10, 25, 12, 25, 14, 25, 243, 11, 25, 5, 25, 245, 10, 25, 3, 25, 5, 25, 248, 10, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 7, 26, 255, 10, 26, 12, 26, 14, 26, 258, 11, 26, 3, 26, 7, 26, 261, 10, 26, 12, 26, 14, 26, 264, 11, 26, 3, 27, 3, 27, 5, 27, 268, 10, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 6, 29, 284, 10, 29, 13, 29, 14, 29, 285, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 292, 10, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 305, 10, 33, 3, 33, 7, 33, 308, 10, 33, 12, 33, 14, 33, 311, 11, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 7, 35, 325, 10, 35, 12, 35, 14, 35, 328, 11, 35, 5, 35, 330, 10, 35, 3, 36, 3, 36, 3, 36, 7, 36, 335, 10, 36, 12, 36, 14, 36, 338, 11, 36, 5, 36, 340, 10, 36, 3, 37, 3, 37, 7, 37, 344, 10, 37, 12, 37, 14, 37, 347, 11, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 5, 40, 361, 10, 40, 3, 40, 2, 3, 46, 41, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 29, 30, 3, 2, 27, 28, 3, 2, 31, 32, 3, 2, 36, 41, 2, 370, 2, 80, 3, 2, 2, 2, 4, 83, 3, 2, 2, 2, 6, 89, 3, 2, 2, 2, 8, 96, 3, 2, 2, 2, 10, 101, 3, 2, 2, 2, 12, 113, 3, 2, 2, 2, 14, 117, 3, 2, 2, 2, 16, 119, 3, 2, 2, 2, 18, 125, 3, 2, 2, 2, 20, 135, 3, 2, 2, 2, 22, 141, 3, 2, 2, 2, 24, 148, 3, 2, 2, 2, 26, 151, 3, 2, 2, 2, 28, 153, 3, 2, 2, 2, 30, 155, 3, 2, 2, 2, 32, 157, 3, 2, 2, 2, 34, 170, 3, 2, 2, 2, 36, 174, 3, 2, 2, 2, 38, 179, 3, 2, 2, 2, 40, 181, 3, 2, 2, 2, 42, 183, 3, 2, 2, 2, 44, 185, 3, 2, 2, 2, 46, 210, 3, 2, 2, 2, 48, 233, 3, 2, 2, 2, 50, 256, 3, 2, 2, 2, 52, 267, 3, 2, 2, 2, 54, 269, 3, 2, 2, 2, 56, 276, 3, 2, 2, 2, 58, 287, 3, 2, 2, 2, 60, 291, 3, 2, 2, 2, 62, 293, 3, 2, 2, 2, 64, 309, 3, 2, 2, 2, 66, 312, 3, 2, 2, 2, 68, 329, 3, 2, 2, 2, 70, 339, 3, 2, 2, 2, 72, 341, 3, 2, 2, 2, 74, 350, 3, 2, 2, 2, 76, 352, 3, 2, 2, 2, 78, 360, 3, 2, 2, 2, 80, 81, 5, 4, 3, 2, 81, 82, 7, 2, 2, 3, 82, 3, 3, 2, 2, 2, 83, 84, 5, 6, 4, 2, 84, 85, 5, 8, 5, 2, 85, 5, 3, 2, 2, 2, 86, 88, 5, 10, 6, 2, 87, 86, 3, 2, 2, 2, 88, 91, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 7, 3, 2, 2, 2, 91, 89, 3, 2, 2, 2, 92, 95, 5, 12, 7, 2, 93, 95, 5, 72, 37, 2, 94, 92, 3, 2, 2, 2, 94, 93, 3, 2, 2, 2, 95, 98, 3, 2, 2, 2, 96, 94, 3, 2, 2, 2, 96, 97, 3, 2, 2, 2, 97, 9, 3, 2, 2, 2, 98, 96, 3, 2, 2, 2, 99, 102, 5, 48, 25, 2, 100, 102, 5, 66, 34, 2, 101, 99, 3, 2, 2, 2, 101, 100, 3, 2, 2, 2, 102, 11, 3, 2, 2, 2, 103, 114, 5, 34, 18, 2, 104, 114, 5, 36, 19, 2, 105, 114, 5, 14, 8, 2, 106, 114, 5, 20, 11, 2, 107, 114, 5, 24, 13, 2, 108, 114, 5, 28, 15, 2, 109, 114, 5, 22, 12, 2, 110, 114, 5, 30, 16, 2, 111, 114, 5, 54, 28, 2, 112, 114, 5, 44, 23, 2, 113, 103, 3, 2, 2, 2, 113, 104, 3, 2, 2, 2, 113, 105, 3, 2, 2, 2, 113, 106, 3, 2, 2, 2, 113, 107, 3, 2, 2, 2, 113, 108, 3, 2, 2, 2, 113, 109, 3, 2, 2, 2, 113, 110, 3, 2, 2, 2, 113, 111, 3, 2, 2, 2, 113, 112, 3, 2, 2, 2, 114, 13, 3, 2, 2, 2, 115, 118, 5, 16, 9, 2, 116, 118, 5, 18, 10, 2, 117, 115, 3, 2, 2, 2, 117, 116, 3, 2, 2, 2, 118, 15, 3, 2, 2, 2, 119, 120, 7, 3, 2, 2, 120, 121, 5, 46, 24, 2, 121, 122, 7, 4, 2, 2, 122, 123, 5, 8, 5, 2, 123, 124, 7, 5, 2, 2, 124, 17, 3, 2, 2, 2, 125, 126, 7, 3, 2, 2, 126, 127, 5, 46, 24, 2, 127, 128, 7, 4, 2, 2, 128, 129, 5, 8, 5, 2, 129, 130, 7, 5, 2, 2, 130, 131, 7, 6, 2, 2, 131, 132, 7, 4, 2, 2, 132, 133, 5, 8, 5, 2, 133, 134, 7, 5, 2, 2, 134, 19, 3, 2, 2, 2, 135, 136, 7, 7, 2, 2, 136, 137, 5, 78, 40, 2, 137, 138, 7, 4, 2, 2, 138, 139, 5, 8, 5, 2, 139, 140, 7, 5, 2, 2, 140, 21, 3, 2, 2, 2, 141, 142, 7, 8, 2, 2, 142, 143, 7, 9, 2, 2, 143, 144, 5, 46, 24, 2, 144, 145, 7, 10, 2, 2, 145, 146, 5, 46, 24, 2, 146, 147, 7, 11, 2, 2, 147, 23, 3, 2, 2, 2, 148, 149, 5, 26, 14, 2, 149, 150, 5, 46, 24, 2, 150, 25, 3, 2, 2, 2, 151, 152, 9, 2, 2, 2, 152, 27, 3, 2, 2, 2, 153, 154, 9, 3, 2, 2, 154, 29, 3, 2, 2, 2, 155, 156, 7, 18, 2, 2, 156, 31, 3, 2, 2, 2, 157, 166, 7, 4, 2, 2, 158, 163, 5, 46, 24, 2, 159, 160, 7, 10, 2, 2, 160, 162, 5, 46, 24, 2, 161, 159, 3, 2, 2, 2, 162, 165, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 167, 3, 2, 2, 2, 165, 163, 3, 2, 2, 2, 166, 158, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 7, 5, 2, 2, 169, 33, 3, 2, 2, 2, 170, 171, 5, 60, 31, 2, 171, 172, 7, 19, 2, 2, 172, 173, 5, 46, 24, 2, 173, 35, 3, 2, 2, 2, 174, 175, 7, 34, 2, 2, 175, 176, 7, 9, 2, 2, 176, 177, 5, 46, 24, 2, 177, 178, 7, 11, 2, 2, 178, 37, 3, 2, 2, 2, 179, 180, 9, 4, 2, 2, 180, 39, 3, 2, 2, 2, 181, 182, 9, 5, 2, 2, 182, 41, 3, 2, 2, 2, 183, 184, 7, 28, 2, 2, 184, 43, 3, 2, 2, 2, 185, 186, 7, 33, 2, 2, 186, 191, 5, 46, 24, 2, 187, 188, 7, 10, 2, 2, 188, 190, 5, 46, 24, 2, 189, 187, 3, 2, 2, 2, 190, 193, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 45, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 194, 195, 8, 24, 1, 2, 195, 196, 5, 42, 22, 2, 196, 197, 5, 46, 24, 12, 197, 211, 3, 2, 2, 2, 198, 199, 5, 60, 31, 2, 199, 200, 7, 19, 2, 2, 200, 201, 5, 46, 24, 9, 201, 211, 3, 2, 2, 2, 202, 203, 7, 9, 2, 2, 203, 204, 5, 46, 24, 2, 204, 205, 7, 11, 2, 2, 205, 211, 3, 2, 2, 2, 206, 211, 5, 78, 40, 2, 207, 208, 7, 42, 2, 2, 208, 211, 5, 46, 24, 6, 209, 211, 7, 35, 2, 2, 210, 194, 3, 2, 2, 2, 210, 198, 3, 2, 2, 2, 210, 202, 3, 2, 2, 2, 210, 206, 3, 2, 2, 2, 210, 207, 3, 2, 2, 2, 210, 209, 3, 2, 2, 2, 211, 230, 3, 2, 2, 2, 212, 213, 12, 11, 2, 2, 213, 214, 5, 38, 20, 2, 214, 215, 5, 46, 24, 12, 215, 229, 3, 2, 2, 2, 216, 217, 12, 10, 2, 2, 217, 218, 5, 40, 21, 2, 218, 219, 5, 46, 24, 11, 219, 229, 3, 2, 2, 2, 220, 221, 12, 5, 2, 2, 221, 222, 5, 76, 39, 2, 222, 223, 5, 46, 24, 6, 223, 229, 3, 2, 2, 2, 224, 225, 12, 4, 2, 2, 225, 226, 5, 74, 38, 2, 226, 227, 5, 46, 24, 5, 227, 229, 3, 2, 2, 2, 228, 212, 3, 2, 2, 2, 228, 216, 3, 2, 2, 2, 228, 220, 3, 2, 2, 2, 228, 224, 3, 2, 2, 2, 229, 232, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 47, 3, 2, 2, 2, 232, 230, 3, 2, 2, 2, 233, 234, 7, 20, 2, 2, 234, 247, 7, 45, 2, 2, 235, 236, 7, 9, 2, 2, 236, 244, 7, 45, 2, 2, 237, 241, 7, 10, 2, 2, 238, 240, 7, 45, 2, 2, 239, 238, 3, 2, 2, 2, 240, 243, 3, 2, 2, 2, 241, 239, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 244, 237, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 246, 3, 2, 2, 2, 246, 248, 7, 11, 2, 2, 247, 235, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 250, 7, 21, 2, 2, 250, 251, 5, 50, 26, 2, 251, 252, 7, 22, 2, 2, 252, 49, 3, 2, 2, 2, 253, 255, 5, 52, 27, 2, 254, 253, 3, 2, 2, 2, 255, 258, 3, 2, 2, 2, 256, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 262, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 259, 261, 5, 66, 34, 2, 260, 259, 3, 2, 2, 2, 261, 264, 3, 2, 2, 2, 262, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 51, 3, 2, 2, 2, 264, 262, 3, 2, 2, 2, 265, 268, 5, 34, 18, 2, 266, 268, 5, 54, 28, 2, 267, 265, 3, 2, 2, 2, 267, 266, 3, 2, 2, 2, 268, 53, 3, 2, 2, 2, 269, 270, 5, 60, 31, 2, 270, 271, 7, 19, 2, 2, 271, 272, 7, 23, 2, 2, 272, 273, 7, 45, 2, 2, 273, 274, 7, 9, 2, 2, 274, 275, 7, 11, 2, 2, 275, 55, 3, 2, 2, 2, 276, 283, 5, 58, 30, 2, 277, 278, 7, 24, 2, 2, 278, 284, 7, 45, 2, 2, 279, 280, 7, 4, 2, 2, 280, 281, 5, 46, 24, 2, 281, 282, 7, 5, 2, 2, 282, 284, 3, 2, 2, 2, 283, 277, 3, 2, 2, 2, 283, 279, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 283, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 57, 3, 2, 2, 2, 287, 288, 7, 45, 2, 2, 288, 59, 3, 2, 2, 2, 289, 292, 7, 45, 2, 2, 290, 292, 5, 56, 29, 2, 291, 289, 3, 2, 2, 2, 291, 290, 3, 2, 2, 2, 292, 61, 3, 2, 2, 2, 293, 294, 5, 64, 33, 2, 294, 295, 7, 46, 2, 2, 295, 296, 7, 9, 2, 2, 296, 297, 5, 70, 36, 2, 297, 298, 7, 11, 2, 2, 298, 63, 3, 2, 2, 2, 299, 305, 7, 45, 2, 2, 300, 301, 7, 4, 2, 2, 301, 302, 5, 46, 24, 2, 302, 303, 7, 5, 2, 2, 303, 305, 3, 2, 2, 2, 304, 299, 3, 2, 2, 2, 304, 300, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 308, 7, 24, 2, 2, 307, 304, 3, 2, 2, 2, 308, 311, 3, 2, 2, 2, 309, 307, 3, 2, 2, 2, 309, 310, 3, 2, 2, 2, 310, 65, 3, 2, 2, 2, 311, 309, 3, 2, 2, 2, 312, 313, 7, 25, 2, 2, 313, 314, 7, 46, 2, 2, 314, 315, 7, 9, 2, 2, 315, 316, 5, 68, 35, 2, 316, 317, 7, 11, 2, 2, 317, 318, 7, 21, 2, 2, 318, 319, 5, 8, 5, 2, 319, 320, 7, 22, 2, 2, 320, 67, 3, 2, 2, 2, 321, 326, 7, 45, 2, 2, 322, 323, 7, 10, 2, 2, 323, 325, 7, 45, 2, 2, 324, 322, 3, 2, 2, 2, 325, 328, 3, 2, 2, 2, 326, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 330, 3, 2, 2, 2, 328, 326, 3, 2, 2, 2, 329, 321, 3, 2, 2, 2, 329, 330, 3, 2, 2, 2, 330, 69, 3, 2, 2, 2, 331, 336, 5, 46, 24, 2, 332, 333, 7, 10, 2, 2, 333, 335, 5, 46, 24, 2, 334, 332, 3, 2, 2, 2, 335, 338, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 336, 337, 3, 2, 2, 2, 337, 340, 3, 2, 2, 2, 338, 336, 3, 2, 2, 2, 339, 331, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 71, 3, 2, 2, 2, 341, 345, 7, 26, 2, 2, 342, 344, 7, 46, 2, 2, 343, 342, 3, 2, 2, 2, 344, 347, 3, 2, 2, 2, 345, 343, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 348, 3, 2, 2, 2, 347, 345, 3, 2, 2, 2, 348, 349, 7, 26, 2, 2, 349, 73, 3, 2, 2, 2, 350, 351, 9, 6, 2, 2, 351, 75, 3, 2, 2, 2, 352, 353, 9, 7, 2, 2, 353, 77, 3, 2, 2, 2, 354, 361, 7, 43, 2, 2, 355, 361, 7, 45, 2, 2, 356, 361, 5, 32, 17, 2, 357, 361, 5, 56, 29, 2, 358, 361, 5, 62, 32, 2, 359, 361, 7, 44, 2, 2, 360, 354, 3, 2, 2, 2, 360, 355, 3, 2, 2, 2, 360, 356, 3, 2, 2, 2, 360, 357, 3, 2, 2, 2, 360, 358, 3, 2, 2, 2, 360, 359, 3, 2, 2, 2, 361, 79, 3, 2, 2, 2, 31, 89, 94, 96, 101, 113, 117, 163, 166, 191, 210, 228, 230, 241, 244, 247, 256, 262, 267, 283, 285, 291, 304, 309, 326, 329, 336, 339, 345, 360] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index d5d0cd0..da7e1af 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -60,112 +60,113 @@ def serializedATN(): buf.write("\2\2\2YW\3\2\2\2YZ\3\2\2\2Z\7\3\2\2\2[Y\3\2\2\2\\_\5\f") buf.write("\7\2]_\5H%\2^\\\3\2\2\2^]\3\2\2\2_b\3\2\2\2`^\3\2\2\2") buf.write("`a\3\2\2\2a\t\3\2\2\2b`\3\2\2\2cf\5\60\31\2df\5B\"\2e") - buf.write("c\3\2\2\2ed\3\2\2\2f\13\3\2\2\2gr\5$\23\2hr\5\16\b\2i") - buf.write("r\5\24\13\2jr\5\30\r\2kr\5\34\17\2lr\5\26\f\2mr\5\36\20") - buf.write("\2nr\5\66\34\2or\5.\30\2pr\5,\27\2qg\3\2\2\2qh\3\2\2\2") - buf.write("qi\3\2\2\2qj\3\2\2\2qk\3\2\2\2ql\3\2\2\2qm\3\2\2\2qn\3") - buf.write("\2\2\2qo\3\2\2\2qp\3\2\2\2r\r\3\2\2\2sv\5\20\t\2tv\5\22") - buf.write("\n\2us\3\2\2\2ut\3\2\2\2v\17\3\2\2\2wx\7\3\2\2xy\5.\30") - buf.write("\2yz\7\4\2\2z{\5\b\5\2{|\7\5\2\2|\21\3\2\2\2}~\7\3\2\2") - buf.write("~\177\5.\30\2\177\u0080\7\4\2\2\u0080\u0081\5\b\5\2\u0081") - buf.write("\u0082\7\5\2\2\u0082\u0083\7\6\2\2\u0083\u0084\7\4\2\2") - buf.write("\u0084\u0085\5\b\5\2\u0085\u0086\7\5\2\2\u0086\23\3\2") - buf.write("\2\2\u0087\u0088\7\7\2\2\u0088\u0089\5N(\2\u0089\u008a") - buf.write("\7\4\2\2\u008a\u008b\5\b\5\2\u008b\u008c\7\5\2\2\u008c") - buf.write("\25\3\2\2\2\u008d\u008e\7\b\2\2\u008e\u008f\7\t\2\2\u008f") - buf.write("\u0090\5.\30\2\u0090\u0091\7\n\2\2\u0091\u0092\5.\30\2") - buf.write("\u0092\u0093\7\13\2\2\u0093\27\3\2\2\2\u0094\u0095\5\32") - buf.write("\16\2\u0095\u0096\5.\30\2\u0096\31\3\2\2\2\u0097\u0098") - buf.write("\t\2\2\2\u0098\33\3\2\2\2\u0099\u009a\t\3\2\2\u009a\35") - buf.write("\3\2\2\2\u009b\u009c\7\22\2\2\u009c\37\3\2\2\2\u009d\u00a6") - buf.write("\7\4\2\2\u009e\u00a3\5.\30\2\u009f\u00a0\7\n\2\2\u00a0") - buf.write("\u00a2\5.\30\2\u00a1\u009f\3\2\2\2\u00a2\u00a5\3\2\2\2") - buf.write("\u00a3\u00a1\3\2\2\2\u00a3\u00a4\3\2\2\2\u00a4\u00a7\3") - buf.write("\2\2\2\u00a5\u00a3\3\2\2\2\u00a6\u009e\3\2\2\2\u00a6\u00a7") - buf.write("\3\2\2\2\u00a7\u00a8\3\2\2\2\u00a8\u00a9\7\5\2\2\u00a9") - buf.write("!\3\2\2\2\u00aa\u00ab\5<\37\2\u00ab\u00ac\7\23\2\2\u00ac") - buf.write("\u00ad\5.\30\2\u00ad#\3\2\2\2\u00ae\u00af\7\"\2\2\u00af") - buf.write("\u00b0\7\t\2\2\u00b0\u00b1\5.\30\2\u00b1\u00b2\7\13\2") - buf.write("\2\u00b2%\3\2\2\2\u00b3\u00b4\t\4\2\2\u00b4\'\3\2\2\2") - buf.write("\u00b5\u00b6\t\5\2\2\u00b6)\3\2\2\2\u00b7\u00b8\7\34\2") - buf.write("\2\u00b8+\3\2\2\2\u00b9\u00ba\7!\2\2\u00ba\u00bf\5.\30") - buf.write("\2\u00bb\u00bc\7\n\2\2\u00bc\u00be\5.\30\2\u00bd\u00bb") - buf.write("\3\2\2\2\u00be\u00c1\3\2\2\2\u00bf\u00bd\3\2\2\2\u00bf") - buf.write("\u00c0\3\2\2\2\u00c0-\3\2\2\2\u00c1\u00bf\3\2\2\2\u00c2") - buf.write("\u00c3\b\30\1\2\u00c3\u00c4\5*\26\2\u00c4\u00c5\5.\30") - buf.write("\f\u00c5\u00d3\3\2\2\2\u00c6\u00c7\5<\37\2\u00c7\u00c8") - buf.write("\7\23\2\2\u00c8\u00c9\5.\30\t\u00c9\u00d3\3\2\2\2\u00ca") - buf.write("\u00cb\7\t\2\2\u00cb\u00cc\5.\30\2\u00cc\u00cd\7\13\2") - buf.write("\2\u00cd\u00d3\3\2\2\2\u00ce\u00d3\5N(\2\u00cf\u00d0\7") - buf.write("*\2\2\u00d0\u00d3\5.\30\6\u00d1\u00d3\7#\2\2\u00d2\u00c2") - buf.write("\3\2\2\2\u00d2\u00c6\3\2\2\2\u00d2\u00ca\3\2\2\2\u00d2") - buf.write("\u00ce\3\2\2\2\u00d2\u00cf\3\2\2\2\u00d2\u00d1\3\2\2\2") - buf.write("\u00d3\u00e6\3\2\2\2\u00d4\u00d5\f\13\2\2\u00d5\u00d6") - buf.write("\5&\24\2\u00d6\u00d7\5.\30\f\u00d7\u00e5\3\2\2\2\u00d8") - buf.write("\u00d9\f\n\2\2\u00d9\u00da\5(\25\2\u00da\u00db\5.\30\13") - buf.write("\u00db\u00e5\3\2\2\2\u00dc\u00dd\f\5\2\2\u00dd\u00de\5") - buf.write("L\'\2\u00de\u00df\5.\30\6\u00df\u00e5\3\2\2\2\u00e0\u00e1") - buf.write("\f\4\2\2\u00e1\u00e2\5J&\2\u00e2\u00e3\5.\30\5\u00e3\u00e5") - buf.write("\3\2\2\2\u00e4\u00d4\3\2\2\2\u00e4\u00d8\3\2\2\2\u00e4") - buf.write("\u00dc\3\2\2\2\u00e4\u00e0\3\2\2\2\u00e5\u00e8\3\2\2\2") - buf.write("\u00e6\u00e4\3\2\2\2\u00e6\u00e7\3\2\2\2\u00e7/\3\2\2") - buf.write("\2\u00e8\u00e6\3\2\2\2\u00e9\u00ea\7\24\2\2\u00ea\u00f7") - buf.write("\7-\2\2\u00eb\u00ec\7\t\2\2\u00ec\u00f4\7-\2\2\u00ed\u00f1") - buf.write("\7\n\2\2\u00ee\u00f0\7-\2\2\u00ef\u00ee\3\2\2\2\u00f0") - buf.write("\u00f3\3\2\2\2\u00f1\u00ef\3\2\2\2\u00f1\u00f2\3\2\2\2") - buf.write("\u00f2\u00f5\3\2\2\2\u00f3\u00f1\3\2\2\2\u00f4\u00ed\3") - buf.write("\2\2\2\u00f4\u00f5\3\2\2\2\u00f5\u00f6\3\2\2\2\u00f6\u00f8") - buf.write("\7\13\2\2\u00f7\u00eb\3\2\2\2\u00f7\u00f8\3\2\2\2\u00f8") - buf.write("\u00f9\3\2\2\2\u00f9\u00fa\7\25\2\2\u00fa\u00fb\5\62\32") - buf.write("\2\u00fb\u00fc\7\26\2\2\u00fc\61\3\2\2\2\u00fd\u00ff\5") - buf.write("\64\33\2\u00fe\u00fd\3\2\2\2\u00ff\u0102\3\2\2\2\u0100") - buf.write("\u00fe\3\2\2\2\u0100\u0101\3\2\2\2\u0101\u0106\3\2\2\2") - buf.write("\u0102\u0100\3\2\2\2\u0103\u0105\5B\"\2\u0104\u0103\3") - buf.write("\2\2\2\u0105\u0108\3\2\2\2\u0106\u0104\3\2\2\2\u0106\u0107") - buf.write("\3\2\2\2\u0107\63\3\2\2\2\u0108\u0106\3\2\2\2\u0109\u010c") - buf.write("\5\"\22\2\u010a\u010c\5\66\34\2\u010b\u0109\3\2\2\2\u010b") - buf.write("\u010a\3\2\2\2\u010c\65\3\2\2\2\u010d\u010e\5<\37\2\u010e") - buf.write("\u010f\7\23\2\2\u010f\u0110\7\27\2\2\u0110\u0111\7-\2") - buf.write("\2\u0111\u0112\7\t\2\2\u0112\u0113\7\13\2\2\u0113\67\3") - buf.write("\2\2\2\u0114\u011b\5:\36\2\u0115\u0116\7\30\2\2\u0116") - buf.write("\u011c\7-\2\2\u0117\u0118\7\4\2\2\u0118\u0119\5.\30\2") - buf.write("\u0119\u011a\7\5\2\2\u011a\u011c\3\2\2\2\u011b\u0115\3") - buf.write("\2\2\2\u011b\u0117\3\2\2\2\u011c\u011d\3\2\2\2\u011d\u011b") - buf.write("\3\2\2\2\u011d\u011e\3\2\2\2\u011e9\3\2\2\2\u011f\u0120") - buf.write("\7-\2\2\u0120;\3\2\2\2\u0121\u0124\7-\2\2\u0122\u0124") - buf.write("\58\35\2\u0123\u0121\3\2\2\2\u0123\u0122\3\2\2\2\u0124") - buf.write("=\3\2\2\2\u0125\u0126\5@!\2\u0126\u0127\7.\2\2\u0127\u0128") - buf.write("\7\t\2\2\u0128\u0129\5F$\2\u0129\u012a\7\13\2\2\u012a") - buf.write("?\3\2\2\2\u012b\u0131\7-\2\2\u012c\u012d\7\4\2\2\u012d") - buf.write("\u012e\5.\30\2\u012e\u012f\7\5\2\2\u012f\u0131\3\2\2\2") - buf.write("\u0130\u012b\3\2\2\2\u0130\u012c\3\2\2\2\u0131\u0132\3") - buf.write("\2\2\2\u0132\u0134\7\30\2\2\u0133\u0130\3\2\2\2\u0134") - buf.write("\u0137\3\2\2\2\u0135\u0133\3\2\2\2\u0135\u0136\3\2\2\2") - buf.write("\u0136A\3\2\2\2\u0137\u0135\3\2\2\2\u0138\u0139\7\31\2") - buf.write("\2\u0139\u013a\7.\2\2\u013a\u013b\7\t\2\2\u013b\u013c") - buf.write("\5D#\2\u013c\u013d\7\13\2\2\u013d\u013e\7\25\2\2\u013e") - buf.write("\u013f\5\b\5\2\u013f\u0140\7\26\2\2\u0140C\3\2\2\2\u0141") - buf.write("\u0146\7-\2\2\u0142\u0143\7\n\2\2\u0143\u0145\7-\2\2\u0144") - buf.write("\u0142\3\2\2\2\u0145\u0148\3\2\2\2\u0146\u0144\3\2\2\2") - buf.write("\u0146\u0147\3\2\2\2\u0147\u014a\3\2\2\2\u0148\u0146\3") - buf.write("\2\2\2\u0149\u0141\3\2\2\2\u0149\u014a\3\2\2\2\u014aE") - buf.write("\3\2\2\2\u014b\u0150\5.\30\2\u014c\u014d\7\n\2\2\u014d") - buf.write("\u014f\5.\30\2\u014e\u014c\3\2\2\2\u014f\u0152\3\2\2\2") - buf.write("\u0150\u014e\3\2\2\2\u0150\u0151\3\2\2\2\u0151\u0154\3") - buf.write("\2\2\2\u0152\u0150\3\2\2\2\u0153\u014b\3\2\2\2\u0153\u0154") - buf.write("\3\2\2\2\u0154G\3\2\2\2\u0155\u0159\7\32\2\2\u0156\u0158") - buf.write("\7.\2\2\u0157\u0156\3\2\2\2\u0158\u015b\3\2\2\2\u0159") - buf.write("\u0157\3\2\2\2\u0159\u015a\3\2\2\2\u015a\u015c\3\2\2\2") - buf.write("\u015b\u0159\3\2\2\2\u015c\u015d\7\32\2\2\u015dI\3\2\2") - buf.write("\2\u015e\u015f\t\6\2\2\u015fK\3\2\2\2\u0160\u0161\t\7") - buf.write("\2\2\u0161M\3\2\2\2\u0162\u0169\7+\2\2\u0163\u0169\7-") - buf.write("\2\2\u0164\u0169\5 \21\2\u0165\u0169\58\35\2\u0166\u0169") - buf.write("\5> \2\u0167\u0169\7,\2\2\u0168\u0162\3\2\2\2\u0168\u0163") - buf.write("\3\2\2\2\u0168\u0164\3\2\2\2\u0168\u0165\3\2\2\2\u0168") - buf.write("\u0166\3\2\2\2\u0168\u0167\3\2\2\2\u0169O\3\2\2\2\37Y") - buf.write("^`equ\u00a3\u00a6\u00bf\u00d2\u00e4\u00e6\u00f1\u00f4") - buf.write("\u00f7\u0100\u0106\u010b\u011b\u011d\u0123\u0130\u0135") - buf.write("\u0146\u0149\u0150\u0153\u0159\u0168") + buf.write("c\3\2\2\2ed\3\2\2\2f\13\3\2\2\2gr\5\"\22\2hr\5$\23\2i") + buf.write("r\5\16\b\2jr\5\24\13\2kr\5\30\r\2lr\5\34\17\2mr\5\26\f") + buf.write("\2nr\5\36\20\2or\5\66\34\2pr\5,\27\2qg\3\2\2\2qh\3\2\2") + buf.write("\2qi\3\2\2\2qj\3\2\2\2qk\3\2\2\2ql\3\2\2\2qm\3\2\2\2q") + buf.write("n\3\2\2\2qo\3\2\2\2qp\3\2\2\2r\r\3\2\2\2sv\5\20\t\2tv") + buf.write("\5\22\n\2us\3\2\2\2ut\3\2\2\2v\17\3\2\2\2wx\7\3\2\2xy") + buf.write("\5.\30\2yz\7\4\2\2z{\5\b\5\2{|\7\5\2\2|\21\3\2\2\2}~\7") + buf.write("\3\2\2~\177\5.\30\2\177\u0080\7\4\2\2\u0080\u0081\5\b") + buf.write("\5\2\u0081\u0082\7\5\2\2\u0082\u0083\7\6\2\2\u0083\u0084") + buf.write("\7\4\2\2\u0084\u0085\5\b\5\2\u0085\u0086\7\5\2\2\u0086") + buf.write("\23\3\2\2\2\u0087\u0088\7\7\2\2\u0088\u0089\5N(\2\u0089") + buf.write("\u008a\7\4\2\2\u008a\u008b\5\b\5\2\u008b\u008c\7\5\2\2") + buf.write("\u008c\25\3\2\2\2\u008d\u008e\7\b\2\2\u008e\u008f\7\t") + buf.write("\2\2\u008f\u0090\5.\30\2\u0090\u0091\7\n\2\2\u0091\u0092") + buf.write("\5.\30\2\u0092\u0093\7\13\2\2\u0093\27\3\2\2\2\u0094\u0095") + buf.write("\5\32\16\2\u0095\u0096\5.\30\2\u0096\31\3\2\2\2\u0097") + buf.write("\u0098\t\2\2\2\u0098\33\3\2\2\2\u0099\u009a\t\3\2\2\u009a") + buf.write("\35\3\2\2\2\u009b\u009c\7\22\2\2\u009c\37\3\2\2\2\u009d") + buf.write("\u00a6\7\4\2\2\u009e\u00a3\5.\30\2\u009f\u00a0\7\n\2\2") + buf.write("\u00a0\u00a2\5.\30\2\u00a1\u009f\3\2\2\2\u00a2\u00a5\3") + buf.write("\2\2\2\u00a3\u00a1\3\2\2\2\u00a3\u00a4\3\2\2\2\u00a4\u00a7") + buf.write("\3\2\2\2\u00a5\u00a3\3\2\2\2\u00a6\u009e\3\2\2\2\u00a6") + buf.write("\u00a7\3\2\2\2\u00a7\u00a8\3\2\2\2\u00a8\u00a9\7\5\2\2") + buf.write("\u00a9!\3\2\2\2\u00aa\u00ab\5<\37\2\u00ab\u00ac\7\23\2") + buf.write("\2\u00ac\u00ad\5.\30\2\u00ad#\3\2\2\2\u00ae\u00af\7\"") + buf.write("\2\2\u00af\u00b0\7\t\2\2\u00b0\u00b1\5.\30\2\u00b1\u00b2") + buf.write("\7\13\2\2\u00b2%\3\2\2\2\u00b3\u00b4\t\4\2\2\u00b4\'\3") + buf.write("\2\2\2\u00b5\u00b6\t\5\2\2\u00b6)\3\2\2\2\u00b7\u00b8") + buf.write("\7\34\2\2\u00b8+\3\2\2\2\u00b9\u00ba\7!\2\2\u00ba\u00bf") + buf.write("\5.\30\2\u00bb\u00bc\7\n\2\2\u00bc\u00be\5.\30\2\u00bd") + buf.write("\u00bb\3\2\2\2\u00be\u00c1\3\2\2\2\u00bf\u00bd\3\2\2\2") + buf.write("\u00bf\u00c0\3\2\2\2\u00c0-\3\2\2\2\u00c1\u00bf\3\2\2") + buf.write("\2\u00c2\u00c3\b\30\1\2\u00c3\u00c4\5*\26\2\u00c4\u00c5") + buf.write("\5.\30\f\u00c5\u00d3\3\2\2\2\u00c6\u00c7\5<\37\2\u00c7") + buf.write("\u00c8\7\23\2\2\u00c8\u00c9\5.\30\t\u00c9\u00d3\3\2\2") + buf.write("\2\u00ca\u00cb\7\t\2\2\u00cb\u00cc\5.\30\2\u00cc\u00cd") + buf.write("\7\13\2\2\u00cd\u00d3\3\2\2\2\u00ce\u00d3\5N(\2\u00cf") + buf.write("\u00d0\7*\2\2\u00d0\u00d3\5.\30\6\u00d1\u00d3\7#\2\2\u00d2") + buf.write("\u00c2\3\2\2\2\u00d2\u00c6\3\2\2\2\u00d2\u00ca\3\2\2\2") + buf.write("\u00d2\u00ce\3\2\2\2\u00d2\u00cf\3\2\2\2\u00d2\u00d1\3") + buf.write("\2\2\2\u00d3\u00e6\3\2\2\2\u00d4\u00d5\f\13\2\2\u00d5") + buf.write("\u00d6\5&\24\2\u00d6\u00d7\5.\30\f\u00d7\u00e5\3\2\2\2") + buf.write("\u00d8\u00d9\f\n\2\2\u00d9\u00da\5(\25\2\u00da\u00db\5") + buf.write(".\30\13\u00db\u00e5\3\2\2\2\u00dc\u00dd\f\5\2\2\u00dd") + buf.write("\u00de\5L\'\2\u00de\u00df\5.\30\6\u00df\u00e5\3\2\2\2") + buf.write("\u00e0\u00e1\f\4\2\2\u00e1\u00e2\5J&\2\u00e2\u00e3\5.") + buf.write("\30\5\u00e3\u00e5\3\2\2\2\u00e4\u00d4\3\2\2\2\u00e4\u00d8") + buf.write("\3\2\2\2\u00e4\u00dc\3\2\2\2\u00e4\u00e0\3\2\2\2\u00e5") + buf.write("\u00e8\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e6\u00e7\3\2\2\2") + buf.write("\u00e7/\3\2\2\2\u00e8\u00e6\3\2\2\2\u00e9\u00ea\7\24\2") + buf.write("\2\u00ea\u00f7\7-\2\2\u00eb\u00ec\7\t\2\2\u00ec\u00f4") + buf.write("\7-\2\2\u00ed\u00f1\7\n\2\2\u00ee\u00f0\7-\2\2\u00ef\u00ee") + buf.write("\3\2\2\2\u00f0\u00f3\3\2\2\2\u00f1\u00ef\3\2\2\2\u00f1") + buf.write("\u00f2\3\2\2\2\u00f2\u00f5\3\2\2\2\u00f3\u00f1\3\2\2\2") + buf.write("\u00f4\u00ed\3\2\2\2\u00f4\u00f5\3\2\2\2\u00f5\u00f6\3") + buf.write("\2\2\2\u00f6\u00f8\7\13\2\2\u00f7\u00eb\3\2\2\2\u00f7") + buf.write("\u00f8\3\2\2\2\u00f8\u00f9\3\2\2\2\u00f9\u00fa\7\25\2") + buf.write("\2\u00fa\u00fb\5\62\32\2\u00fb\u00fc\7\26\2\2\u00fc\61") + buf.write("\3\2\2\2\u00fd\u00ff\5\64\33\2\u00fe\u00fd\3\2\2\2\u00ff") + buf.write("\u0102\3\2\2\2\u0100\u00fe\3\2\2\2\u0100\u0101\3\2\2\2") + buf.write("\u0101\u0106\3\2\2\2\u0102\u0100\3\2\2\2\u0103\u0105\5") + buf.write("B\"\2\u0104\u0103\3\2\2\2\u0105\u0108\3\2\2\2\u0106\u0104") + buf.write("\3\2\2\2\u0106\u0107\3\2\2\2\u0107\63\3\2\2\2\u0108\u0106") + buf.write("\3\2\2\2\u0109\u010c\5\"\22\2\u010a\u010c\5\66\34\2\u010b") + buf.write("\u0109\3\2\2\2\u010b\u010a\3\2\2\2\u010c\65\3\2\2\2\u010d") + buf.write("\u010e\5<\37\2\u010e\u010f\7\23\2\2\u010f\u0110\7\27\2") + buf.write("\2\u0110\u0111\7-\2\2\u0111\u0112\7\t\2\2\u0112\u0113") + buf.write("\7\13\2\2\u0113\67\3\2\2\2\u0114\u011b\5:\36\2\u0115\u0116") + buf.write("\7\30\2\2\u0116\u011c\7-\2\2\u0117\u0118\7\4\2\2\u0118") + buf.write("\u0119\5.\30\2\u0119\u011a\7\5\2\2\u011a\u011c\3\2\2\2") + buf.write("\u011b\u0115\3\2\2\2\u011b\u0117\3\2\2\2\u011c\u011d\3") + buf.write("\2\2\2\u011d\u011b\3\2\2\2\u011d\u011e\3\2\2\2\u011e9") + buf.write("\3\2\2\2\u011f\u0120\7-\2\2\u0120;\3\2\2\2\u0121\u0124") + buf.write("\7-\2\2\u0122\u0124\58\35\2\u0123\u0121\3\2\2\2\u0123") + buf.write("\u0122\3\2\2\2\u0124=\3\2\2\2\u0125\u0126\5@!\2\u0126") + buf.write("\u0127\7.\2\2\u0127\u0128\7\t\2\2\u0128\u0129\5F$\2\u0129") + buf.write("\u012a\7\13\2\2\u012a?\3\2\2\2\u012b\u0131\7-\2\2\u012c") + buf.write("\u012d\7\4\2\2\u012d\u012e\5.\30\2\u012e\u012f\7\5\2\2") + buf.write("\u012f\u0131\3\2\2\2\u0130\u012b\3\2\2\2\u0130\u012c\3") + buf.write("\2\2\2\u0131\u0132\3\2\2\2\u0132\u0134\7\30\2\2\u0133") + buf.write("\u0130\3\2\2\2\u0134\u0137\3\2\2\2\u0135\u0133\3\2\2\2") + buf.write("\u0135\u0136\3\2\2\2\u0136A\3\2\2\2\u0137\u0135\3\2\2") + buf.write("\2\u0138\u0139\7\31\2\2\u0139\u013a\7.\2\2\u013a\u013b") + buf.write("\7\t\2\2\u013b\u013c\5D#\2\u013c\u013d\7\13\2\2\u013d") + buf.write("\u013e\7\25\2\2\u013e\u013f\5\b\5\2\u013f\u0140\7\26\2") + buf.write("\2\u0140C\3\2\2\2\u0141\u0146\7-\2\2\u0142\u0143\7\n\2") + buf.write("\2\u0143\u0145\7-\2\2\u0144\u0142\3\2\2\2\u0145\u0148") + buf.write("\3\2\2\2\u0146\u0144\3\2\2\2\u0146\u0147\3\2\2\2\u0147") + buf.write("\u014a\3\2\2\2\u0148\u0146\3\2\2\2\u0149\u0141\3\2\2\2") + buf.write("\u0149\u014a\3\2\2\2\u014aE\3\2\2\2\u014b\u0150\5.\30") + buf.write("\2\u014c\u014d\7\n\2\2\u014d\u014f\5.\30\2\u014e\u014c") + buf.write("\3\2\2\2\u014f\u0152\3\2\2\2\u0150\u014e\3\2\2\2\u0150") + buf.write("\u0151\3\2\2\2\u0151\u0154\3\2\2\2\u0152\u0150\3\2\2\2") + buf.write("\u0153\u014b\3\2\2\2\u0153\u0154\3\2\2\2\u0154G\3\2\2") + buf.write("\2\u0155\u0159\7\32\2\2\u0156\u0158\7.\2\2\u0157\u0156") + buf.write("\3\2\2\2\u0158\u015b\3\2\2\2\u0159\u0157\3\2\2\2\u0159") + buf.write("\u015a\3\2\2\2\u015a\u015c\3\2\2\2\u015b\u0159\3\2\2\2") + buf.write("\u015c\u015d\7\32\2\2\u015dI\3\2\2\2\u015e\u015f\t\6\2") + buf.write("\2\u015fK\3\2\2\2\u0160\u0161\t\7\2\2\u0161M\3\2\2\2\u0162") + buf.write("\u0169\7+\2\2\u0163\u0169\7-\2\2\u0164\u0169\5 \21\2\u0165") + buf.write("\u0169\58\35\2\u0166\u0169\5> \2\u0167\u0169\7,\2\2\u0168") + buf.write("\u0162\3\2\2\2\u0168\u0163\3\2\2\2\u0168\u0164\3\2\2\2") + buf.write("\u0168\u0165\3\2\2\2\u0168\u0166\3\2\2\2\u0168\u0167\3") + buf.write("\2\2\2\u0169O\3\2\2\2\37Y^`equ\u00a3\u00a6\u00bf\u00d2") + buf.write("\u00e4\u00e6\u00f1\u00f4\u00f7\u0100\u0106\u010b\u011b") + buf.write("\u011d\u0123\u0130\u0135\u0146\u0149\u0150\u0153\u0159") + buf.write("\u0168") return buf.getvalue() @@ -487,11 +488,11 @@ def strict_ilist(self): self.state = 94 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__6) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__23) | (1 << tlangParser.MINUS) | (1 << tlangParser.RETURN) | (1 << tlangParser.PRINT) | (1 << tlangParser.PENCOND) | (1 << tlangParser.NOT) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__23) | (1 << tlangParser.RETURN) | (1 << tlangParser.PRINT) | (1 << tlangParser.VAR))) != 0): self.state = 92 self._errHandler.sync(self) token = self._input.LA(1) - if token in [tlangParser.T__0, tlangParser.T__1, tlangParser.T__4, tlangParser.T__5, tlangParser.T__6, tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12, tlangParser.T__13, tlangParser.T__14, tlangParser.T__15, tlangParser.MINUS, tlangParser.RETURN, tlangParser.PRINT, tlangParser.PENCOND, tlangParser.NOT, tlangParser.NUM, tlangParser.REAL, tlangParser.VAR, tlangParser.NAME]: + if token in [tlangParser.T__0, tlangParser.T__4, tlangParser.T__5, tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12, tlangParser.T__13, tlangParser.T__14, tlangParser.T__15, tlangParser.RETURN, tlangParser.PRINT, tlangParser.VAR]: self.state = 90 self.instruction() pass @@ -577,6 +578,10 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + def assignment(self): + return self.getTypedRuleContext(tlangParser.AssignmentContext,0) + + def printStatement(self): return self.getTypedRuleContext(tlangParser.PrintStatementContext,0) @@ -609,10 +614,6 @@ def objectInstantiation(self): return self.getTypedRuleContext(tlangParser.ObjectInstantiationContext,0) - def expression(self): - return self.getTypedRuleContext(tlangParser.ExpressionContext,0) - - def returnStatement(self): return self.getTypedRuleContext(tlangParser.ReturnStatementContext,0) @@ -640,55 +641,55 @@ def instruction(self): if la_ == 1: self.enterOuterAlt(localctx, 1) self.state = 101 - self.printStatement() + self.assignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) self.state = 102 - self.conditional() + self.printStatement() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) self.state = 103 - self.loop() + self.conditional() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) self.state = 104 - self.moveCommand() + self.loop() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) self.state = 105 - self.penCommand() + self.moveCommand() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) self.state = 106 - self.gotoCommand() + self.penCommand() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) self.state = 107 - self.pauseCommand() + self.gotoCommand() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) self.state = 108 - self.objectInstantiation() + self.pauseCommand() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) self.state = 109 - self.expression(0) + self.objectInstantiation() pass elif la_ == 10: From f9c26542586a00c22a7e76f0a28b4e4a3d42f669 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Mon, 21 Apr 2025 03:53:20 +0530 Subject: [PATCH 34/47] changed grammar and examples --- .../example/demo/class_inheritance_2.tl | 6 +- ChironCore/example/demo/class_methods.tl | 2 +- ChironCore/example/demo/diamond_problem.tl | 2 +- ChironCore/example/demo/functions.tl | 6 +- ChironCore/example/demo/general.tl | 4 +- ChironCore/example/demo/rangoli.tl | 4 +- ChironCore/example/exampleFC.tl | 6 +- ChironCore/example/kachuapur3.tl | 21 +- ChironCore/turtparse/tlang.g4 | 3 +- ChironCore/turtparse/tlang.interp | 2 +- ChironCore/turtparse/tlangParser.py | 652 +++++++++--------- 11 files changed, 350 insertions(+), 358 deletions(-) diff --git a/ChironCore/example/demo/class_inheritance_2.tl b/ChironCore/example/demo/class_inheritance_2.tl index 757f60d..9aa00a6 100644 --- a/ChironCore/example/demo/class_inheritance_2.tl +++ b/ChironCore/example/demo/class_inheritance_2.tl @@ -11,7 +11,7 @@ class :Hexagon(:Shape) { :sides = 6 def drawHex(:self) { repeat :self.:sides [ - :f= :self.moveForward() + :self.moveForward() right 60 ] return 0 @@ -23,6 +23,6 @@ class :Hexagon(:Shape) { } :hex = new :Hexagon() -:f= :hex.drawHex() +:hex.drawHex() # This does not work # -:f= :hex.__moveForward(100) \ No newline at end of file +:hex.__moveForward(100) \ No newline at end of file diff --git a/ChironCore/example/demo/class_methods.tl b/ChironCore/example/demo/class_methods.tl index 2351319..e63571f 100644 --- a/ChironCore/example/demo/class_methods.tl +++ b/ChironCore/example/demo/class_methods.tl @@ -12,4 +12,4 @@ class :Pentagon { } :pent = new :Pentagon() -:f= :pent.drawShape() +:pent.drawShape() diff --git a/ChironCore/example/demo/diamond_problem.tl b/ChironCore/example/demo/diamond_problem.tl index eb8f6c9..b3907f4 100644 --- a/ChironCore/example/demo/diamond_problem.tl +++ b/ChironCore/example/demo/diamond_problem.tl @@ -22,4 +22,4 @@ class :Liger(:Lion, :Tiger) :liger = new :Liger() :liger.:walk = 2 -:f= :liger.walk() \ No newline at end of file +:liger.walk() \ No newline at end of file diff --git a/ChironCore/example/demo/functions.tl b/ChironCore/example/demo/functions.tl index 32c72d4..cf524ac 100644 --- a/ChironCore/example/demo/functions.tl +++ b/ChironCore/example/demo/functions.tl @@ -11,6 +11,6 @@ def drawSide(:length,:righti) { :length = 250 :righti = 45 -:f= drawSide(:length) -:f= drawSide(:length,:righti) -:f= drawSide(:length) +drawSide(:length) +drawSide(:length,:righti) +drawSide(:length) diff --git a/ChironCore/example/demo/general.tl b/ChironCore/example/demo/general.tl index 9b0529f..6478be5 100644 --- a/ChironCore/example/demo/general.tl +++ b/ChironCore/example/demo/general.tl @@ -23,9 +23,9 @@ def drawSquare(:size) { } :star = new :Star() -:f= :star.drawStar() +:star.drawStar() penup goto(-25, 100) pendown :size = 300 -:f= drawSquare(:size) +drawSquare(:size) diff --git a/ChironCore/example/demo/rangoli.tl b/ChironCore/example/demo/rangoli.tl index 8135579..d8b603e 100644 --- a/ChironCore/example/demo/rangoli.tl +++ b/ChironCore/example/demo/rangoli.tl @@ -51,7 +51,7 @@ def drawRangoli(:size) left 45 :size = sqroot((:size * :size ) / 2) if :size > 10 - [ :f = drawRangoli(:size) ] + [ drawRangoli(:size) ] return 100 } @@ -63,4 +63,4 @@ penup :point = new :Point() goto (:point.:x, :point.:y) :size=200 -:f= drawRangoli(:size) +drawRangoli(:size) diff --git a/ChironCore/example/exampleFC.tl b/ChironCore/example/exampleFC.tl index 7f2e2b3..8a2c2ba 100644 --- a/ChironCore/example/exampleFC.tl +++ b/ChironCore/example/exampleFC.tl @@ -51,9 +51,9 @@ def factorial(:n) if :n == 1 [ return 1 ] - return :n * (:f=factorial(:n - 1)) + return :n * factorial(:n - 1) } -:f= drawRectangle(50, 50) -:a= drawCircle() +drawRectangle(50, 50) +drawCircle() print(factorial(6)) diff --git a/ChironCore/example/kachuapur3.tl b/ChironCore/example/kachuapur3.tl index b32f6b8..81c51ba 100644 --- a/ChironCore/example/kachuapur3.tl +++ b/ChironCore/example/kachuapur3.tl @@ -1,16 +1,6 @@ class :Point { :x = 6 - :y = 4 - def draw(:self) - { - print(:self.:x) - return - } - def drawy(:self) - { - print(:self.:y) - return - } + } class :Circle { @@ -20,13 +10,4 @@ class :Circle { :point = new :Point() :circle = new :Circle() -:circle1 = new :Circle() -print(:circle.:point.:x) -:circle.:point.:x = :circle.:point.:y = -100 -print(:point.:x) print(:circle.:point.:x) -print(:circle1.:point.:x) - -:f= :circle.:point.draw() - -:f = :circle1.:point.drawy() \ No newline at end of file diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index 392d373..960ad02 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -16,7 +16,7 @@ declaration : classDeclaration ; instruction : - assignment + assignment | printStatement | conditional | loop @@ -26,6 +26,7 @@ instruction : | pauseCommand | objectInstantiation | returnStatement + | functionCall ; diff --git a/ChironCore/turtparse/tlang.interp b/ChironCore/turtparse/tlang.interp index f5e4338..a8e7138 100644 --- a/ChironCore/turtparse/tlang.interp +++ b/ChironCore/turtparse/tlang.interp @@ -137,4 +137,4 @@ value atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 363, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 7, 4, 88, 10, 4, 12, 4, 14, 4, 91, 11, 4, 3, 5, 3, 5, 7, 5, 95, 10, 5, 12, 5, 14, 5, 98, 11, 5, 3, 6, 3, 6, 5, 6, 102, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 114, 10, 7, 3, 8, 3, 8, 5, 8, 118, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 162, 10, 17, 12, 17, 14, 17, 165, 11, 17, 5, 17, 167, 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 190, 10, 23, 12, 23, 14, 23, 193, 11, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 211, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 229, 10, 24, 12, 24, 14, 24, 232, 11, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 240, 10, 25, 12, 25, 14, 25, 243, 11, 25, 5, 25, 245, 10, 25, 3, 25, 5, 25, 248, 10, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 7, 26, 255, 10, 26, 12, 26, 14, 26, 258, 11, 26, 3, 26, 7, 26, 261, 10, 26, 12, 26, 14, 26, 264, 11, 26, 3, 27, 3, 27, 5, 27, 268, 10, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 6, 29, 284, 10, 29, 13, 29, 14, 29, 285, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 292, 10, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 305, 10, 33, 3, 33, 7, 33, 308, 10, 33, 12, 33, 14, 33, 311, 11, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 7, 35, 325, 10, 35, 12, 35, 14, 35, 328, 11, 35, 5, 35, 330, 10, 35, 3, 36, 3, 36, 3, 36, 7, 36, 335, 10, 36, 12, 36, 14, 36, 338, 11, 36, 5, 36, 340, 10, 36, 3, 37, 3, 37, 7, 37, 344, 10, 37, 12, 37, 14, 37, 347, 11, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 5, 40, 361, 10, 40, 3, 40, 2, 3, 46, 41, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 29, 30, 3, 2, 27, 28, 3, 2, 31, 32, 3, 2, 36, 41, 2, 370, 2, 80, 3, 2, 2, 2, 4, 83, 3, 2, 2, 2, 6, 89, 3, 2, 2, 2, 8, 96, 3, 2, 2, 2, 10, 101, 3, 2, 2, 2, 12, 113, 3, 2, 2, 2, 14, 117, 3, 2, 2, 2, 16, 119, 3, 2, 2, 2, 18, 125, 3, 2, 2, 2, 20, 135, 3, 2, 2, 2, 22, 141, 3, 2, 2, 2, 24, 148, 3, 2, 2, 2, 26, 151, 3, 2, 2, 2, 28, 153, 3, 2, 2, 2, 30, 155, 3, 2, 2, 2, 32, 157, 3, 2, 2, 2, 34, 170, 3, 2, 2, 2, 36, 174, 3, 2, 2, 2, 38, 179, 3, 2, 2, 2, 40, 181, 3, 2, 2, 2, 42, 183, 3, 2, 2, 2, 44, 185, 3, 2, 2, 2, 46, 210, 3, 2, 2, 2, 48, 233, 3, 2, 2, 2, 50, 256, 3, 2, 2, 2, 52, 267, 3, 2, 2, 2, 54, 269, 3, 2, 2, 2, 56, 276, 3, 2, 2, 2, 58, 287, 3, 2, 2, 2, 60, 291, 3, 2, 2, 2, 62, 293, 3, 2, 2, 2, 64, 309, 3, 2, 2, 2, 66, 312, 3, 2, 2, 2, 68, 329, 3, 2, 2, 2, 70, 339, 3, 2, 2, 2, 72, 341, 3, 2, 2, 2, 74, 350, 3, 2, 2, 2, 76, 352, 3, 2, 2, 2, 78, 360, 3, 2, 2, 2, 80, 81, 5, 4, 3, 2, 81, 82, 7, 2, 2, 3, 82, 3, 3, 2, 2, 2, 83, 84, 5, 6, 4, 2, 84, 85, 5, 8, 5, 2, 85, 5, 3, 2, 2, 2, 86, 88, 5, 10, 6, 2, 87, 86, 3, 2, 2, 2, 88, 91, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 7, 3, 2, 2, 2, 91, 89, 3, 2, 2, 2, 92, 95, 5, 12, 7, 2, 93, 95, 5, 72, 37, 2, 94, 92, 3, 2, 2, 2, 94, 93, 3, 2, 2, 2, 95, 98, 3, 2, 2, 2, 96, 94, 3, 2, 2, 2, 96, 97, 3, 2, 2, 2, 97, 9, 3, 2, 2, 2, 98, 96, 3, 2, 2, 2, 99, 102, 5, 48, 25, 2, 100, 102, 5, 66, 34, 2, 101, 99, 3, 2, 2, 2, 101, 100, 3, 2, 2, 2, 102, 11, 3, 2, 2, 2, 103, 114, 5, 34, 18, 2, 104, 114, 5, 36, 19, 2, 105, 114, 5, 14, 8, 2, 106, 114, 5, 20, 11, 2, 107, 114, 5, 24, 13, 2, 108, 114, 5, 28, 15, 2, 109, 114, 5, 22, 12, 2, 110, 114, 5, 30, 16, 2, 111, 114, 5, 54, 28, 2, 112, 114, 5, 44, 23, 2, 113, 103, 3, 2, 2, 2, 113, 104, 3, 2, 2, 2, 113, 105, 3, 2, 2, 2, 113, 106, 3, 2, 2, 2, 113, 107, 3, 2, 2, 2, 113, 108, 3, 2, 2, 2, 113, 109, 3, 2, 2, 2, 113, 110, 3, 2, 2, 2, 113, 111, 3, 2, 2, 2, 113, 112, 3, 2, 2, 2, 114, 13, 3, 2, 2, 2, 115, 118, 5, 16, 9, 2, 116, 118, 5, 18, 10, 2, 117, 115, 3, 2, 2, 2, 117, 116, 3, 2, 2, 2, 118, 15, 3, 2, 2, 2, 119, 120, 7, 3, 2, 2, 120, 121, 5, 46, 24, 2, 121, 122, 7, 4, 2, 2, 122, 123, 5, 8, 5, 2, 123, 124, 7, 5, 2, 2, 124, 17, 3, 2, 2, 2, 125, 126, 7, 3, 2, 2, 126, 127, 5, 46, 24, 2, 127, 128, 7, 4, 2, 2, 128, 129, 5, 8, 5, 2, 129, 130, 7, 5, 2, 2, 130, 131, 7, 6, 2, 2, 131, 132, 7, 4, 2, 2, 132, 133, 5, 8, 5, 2, 133, 134, 7, 5, 2, 2, 134, 19, 3, 2, 2, 2, 135, 136, 7, 7, 2, 2, 136, 137, 5, 78, 40, 2, 137, 138, 7, 4, 2, 2, 138, 139, 5, 8, 5, 2, 139, 140, 7, 5, 2, 2, 140, 21, 3, 2, 2, 2, 141, 142, 7, 8, 2, 2, 142, 143, 7, 9, 2, 2, 143, 144, 5, 46, 24, 2, 144, 145, 7, 10, 2, 2, 145, 146, 5, 46, 24, 2, 146, 147, 7, 11, 2, 2, 147, 23, 3, 2, 2, 2, 148, 149, 5, 26, 14, 2, 149, 150, 5, 46, 24, 2, 150, 25, 3, 2, 2, 2, 151, 152, 9, 2, 2, 2, 152, 27, 3, 2, 2, 2, 153, 154, 9, 3, 2, 2, 154, 29, 3, 2, 2, 2, 155, 156, 7, 18, 2, 2, 156, 31, 3, 2, 2, 2, 157, 166, 7, 4, 2, 2, 158, 163, 5, 46, 24, 2, 159, 160, 7, 10, 2, 2, 160, 162, 5, 46, 24, 2, 161, 159, 3, 2, 2, 2, 162, 165, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 167, 3, 2, 2, 2, 165, 163, 3, 2, 2, 2, 166, 158, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 7, 5, 2, 2, 169, 33, 3, 2, 2, 2, 170, 171, 5, 60, 31, 2, 171, 172, 7, 19, 2, 2, 172, 173, 5, 46, 24, 2, 173, 35, 3, 2, 2, 2, 174, 175, 7, 34, 2, 2, 175, 176, 7, 9, 2, 2, 176, 177, 5, 46, 24, 2, 177, 178, 7, 11, 2, 2, 178, 37, 3, 2, 2, 2, 179, 180, 9, 4, 2, 2, 180, 39, 3, 2, 2, 2, 181, 182, 9, 5, 2, 2, 182, 41, 3, 2, 2, 2, 183, 184, 7, 28, 2, 2, 184, 43, 3, 2, 2, 2, 185, 186, 7, 33, 2, 2, 186, 191, 5, 46, 24, 2, 187, 188, 7, 10, 2, 2, 188, 190, 5, 46, 24, 2, 189, 187, 3, 2, 2, 2, 190, 193, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 45, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 194, 195, 8, 24, 1, 2, 195, 196, 5, 42, 22, 2, 196, 197, 5, 46, 24, 12, 197, 211, 3, 2, 2, 2, 198, 199, 5, 60, 31, 2, 199, 200, 7, 19, 2, 2, 200, 201, 5, 46, 24, 9, 201, 211, 3, 2, 2, 2, 202, 203, 7, 9, 2, 2, 203, 204, 5, 46, 24, 2, 204, 205, 7, 11, 2, 2, 205, 211, 3, 2, 2, 2, 206, 211, 5, 78, 40, 2, 207, 208, 7, 42, 2, 2, 208, 211, 5, 46, 24, 6, 209, 211, 7, 35, 2, 2, 210, 194, 3, 2, 2, 2, 210, 198, 3, 2, 2, 2, 210, 202, 3, 2, 2, 2, 210, 206, 3, 2, 2, 2, 210, 207, 3, 2, 2, 2, 210, 209, 3, 2, 2, 2, 211, 230, 3, 2, 2, 2, 212, 213, 12, 11, 2, 2, 213, 214, 5, 38, 20, 2, 214, 215, 5, 46, 24, 12, 215, 229, 3, 2, 2, 2, 216, 217, 12, 10, 2, 2, 217, 218, 5, 40, 21, 2, 218, 219, 5, 46, 24, 11, 219, 229, 3, 2, 2, 2, 220, 221, 12, 5, 2, 2, 221, 222, 5, 76, 39, 2, 222, 223, 5, 46, 24, 6, 223, 229, 3, 2, 2, 2, 224, 225, 12, 4, 2, 2, 225, 226, 5, 74, 38, 2, 226, 227, 5, 46, 24, 5, 227, 229, 3, 2, 2, 2, 228, 212, 3, 2, 2, 2, 228, 216, 3, 2, 2, 2, 228, 220, 3, 2, 2, 2, 228, 224, 3, 2, 2, 2, 229, 232, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 47, 3, 2, 2, 2, 232, 230, 3, 2, 2, 2, 233, 234, 7, 20, 2, 2, 234, 247, 7, 45, 2, 2, 235, 236, 7, 9, 2, 2, 236, 244, 7, 45, 2, 2, 237, 241, 7, 10, 2, 2, 238, 240, 7, 45, 2, 2, 239, 238, 3, 2, 2, 2, 240, 243, 3, 2, 2, 2, 241, 239, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 244, 237, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 246, 3, 2, 2, 2, 246, 248, 7, 11, 2, 2, 247, 235, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 250, 7, 21, 2, 2, 250, 251, 5, 50, 26, 2, 251, 252, 7, 22, 2, 2, 252, 49, 3, 2, 2, 2, 253, 255, 5, 52, 27, 2, 254, 253, 3, 2, 2, 2, 255, 258, 3, 2, 2, 2, 256, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 262, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 259, 261, 5, 66, 34, 2, 260, 259, 3, 2, 2, 2, 261, 264, 3, 2, 2, 2, 262, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 51, 3, 2, 2, 2, 264, 262, 3, 2, 2, 2, 265, 268, 5, 34, 18, 2, 266, 268, 5, 54, 28, 2, 267, 265, 3, 2, 2, 2, 267, 266, 3, 2, 2, 2, 268, 53, 3, 2, 2, 2, 269, 270, 5, 60, 31, 2, 270, 271, 7, 19, 2, 2, 271, 272, 7, 23, 2, 2, 272, 273, 7, 45, 2, 2, 273, 274, 7, 9, 2, 2, 274, 275, 7, 11, 2, 2, 275, 55, 3, 2, 2, 2, 276, 283, 5, 58, 30, 2, 277, 278, 7, 24, 2, 2, 278, 284, 7, 45, 2, 2, 279, 280, 7, 4, 2, 2, 280, 281, 5, 46, 24, 2, 281, 282, 7, 5, 2, 2, 282, 284, 3, 2, 2, 2, 283, 277, 3, 2, 2, 2, 283, 279, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 283, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 57, 3, 2, 2, 2, 287, 288, 7, 45, 2, 2, 288, 59, 3, 2, 2, 2, 289, 292, 7, 45, 2, 2, 290, 292, 5, 56, 29, 2, 291, 289, 3, 2, 2, 2, 291, 290, 3, 2, 2, 2, 292, 61, 3, 2, 2, 2, 293, 294, 5, 64, 33, 2, 294, 295, 7, 46, 2, 2, 295, 296, 7, 9, 2, 2, 296, 297, 5, 70, 36, 2, 297, 298, 7, 11, 2, 2, 298, 63, 3, 2, 2, 2, 299, 305, 7, 45, 2, 2, 300, 301, 7, 4, 2, 2, 301, 302, 5, 46, 24, 2, 302, 303, 7, 5, 2, 2, 303, 305, 3, 2, 2, 2, 304, 299, 3, 2, 2, 2, 304, 300, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 308, 7, 24, 2, 2, 307, 304, 3, 2, 2, 2, 308, 311, 3, 2, 2, 2, 309, 307, 3, 2, 2, 2, 309, 310, 3, 2, 2, 2, 310, 65, 3, 2, 2, 2, 311, 309, 3, 2, 2, 2, 312, 313, 7, 25, 2, 2, 313, 314, 7, 46, 2, 2, 314, 315, 7, 9, 2, 2, 315, 316, 5, 68, 35, 2, 316, 317, 7, 11, 2, 2, 317, 318, 7, 21, 2, 2, 318, 319, 5, 8, 5, 2, 319, 320, 7, 22, 2, 2, 320, 67, 3, 2, 2, 2, 321, 326, 7, 45, 2, 2, 322, 323, 7, 10, 2, 2, 323, 325, 7, 45, 2, 2, 324, 322, 3, 2, 2, 2, 325, 328, 3, 2, 2, 2, 326, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 330, 3, 2, 2, 2, 328, 326, 3, 2, 2, 2, 329, 321, 3, 2, 2, 2, 329, 330, 3, 2, 2, 2, 330, 69, 3, 2, 2, 2, 331, 336, 5, 46, 24, 2, 332, 333, 7, 10, 2, 2, 333, 335, 5, 46, 24, 2, 334, 332, 3, 2, 2, 2, 335, 338, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 336, 337, 3, 2, 2, 2, 337, 340, 3, 2, 2, 2, 338, 336, 3, 2, 2, 2, 339, 331, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 71, 3, 2, 2, 2, 341, 345, 7, 26, 2, 2, 342, 344, 7, 46, 2, 2, 343, 342, 3, 2, 2, 2, 344, 347, 3, 2, 2, 2, 345, 343, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 348, 3, 2, 2, 2, 347, 345, 3, 2, 2, 2, 348, 349, 7, 26, 2, 2, 349, 73, 3, 2, 2, 2, 350, 351, 9, 6, 2, 2, 351, 75, 3, 2, 2, 2, 352, 353, 9, 7, 2, 2, 353, 77, 3, 2, 2, 2, 354, 361, 7, 43, 2, 2, 355, 361, 7, 45, 2, 2, 356, 361, 5, 32, 17, 2, 357, 361, 5, 56, 29, 2, 358, 361, 5, 62, 32, 2, 359, 361, 7, 44, 2, 2, 360, 354, 3, 2, 2, 2, 360, 355, 3, 2, 2, 2, 360, 356, 3, 2, 2, 2, 360, 357, 3, 2, 2, 2, 360, 358, 3, 2, 2, 2, 360, 359, 3, 2, 2, 2, 361, 79, 3, 2, 2, 2, 31, 89, 94, 96, 101, 113, 117, 163, 166, 191, 210, 228, 230, 241, 244, 247, 256, 262, 267, 283, 285, 291, 304, 309, 326, 329, 336, 339, 345, 360] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 47, 364, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 7, 4, 88, 10, 4, 12, 4, 14, 4, 91, 11, 4, 3, 5, 3, 5, 7, 5, 95, 10, 5, 12, 5, 14, 5, 98, 11, 5, 3, 6, 3, 6, 5, 6, 102, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 115, 10, 7, 3, 8, 3, 8, 5, 8, 119, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 163, 10, 17, 12, 17, 14, 17, 166, 11, 17, 5, 17, 168, 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 191, 10, 23, 12, 23, 14, 23, 194, 11, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 212, 10, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 230, 10, 24, 12, 24, 14, 24, 233, 11, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 241, 10, 25, 12, 25, 14, 25, 244, 11, 25, 5, 25, 246, 10, 25, 3, 25, 5, 25, 249, 10, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 7, 26, 256, 10, 26, 12, 26, 14, 26, 259, 11, 26, 3, 26, 7, 26, 262, 10, 26, 12, 26, 14, 26, 265, 11, 26, 3, 27, 3, 27, 5, 27, 269, 10, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 6, 29, 285, 10, 29, 13, 29, 14, 29, 286, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 293, 10, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 306, 10, 33, 3, 33, 7, 33, 309, 10, 33, 12, 33, 14, 33, 312, 11, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 7, 35, 326, 10, 35, 12, 35, 14, 35, 329, 11, 35, 5, 35, 331, 10, 35, 3, 36, 3, 36, 3, 36, 7, 36, 336, 10, 36, 12, 36, 14, 36, 339, 11, 36, 5, 36, 341, 10, 36, 3, 37, 3, 37, 7, 37, 345, 10, 37, 12, 37, 14, 37, 348, 11, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 5, 40, 362, 10, 40, 3, 40, 2, 3, 46, 41, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 2, 8, 3, 2, 12, 15, 3, 2, 16, 17, 3, 2, 29, 30, 3, 2, 27, 28, 3, 2, 31, 32, 3, 2, 36, 41, 2, 372, 2, 80, 3, 2, 2, 2, 4, 83, 3, 2, 2, 2, 6, 89, 3, 2, 2, 2, 8, 96, 3, 2, 2, 2, 10, 101, 3, 2, 2, 2, 12, 114, 3, 2, 2, 2, 14, 118, 3, 2, 2, 2, 16, 120, 3, 2, 2, 2, 18, 126, 3, 2, 2, 2, 20, 136, 3, 2, 2, 2, 22, 142, 3, 2, 2, 2, 24, 149, 3, 2, 2, 2, 26, 152, 3, 2, 2, 2, 28, 154, 3, 2, 2, 2, 30, 156, 3, 2, 2, 2, 32, 158, 3, 2, 2, 2, 34, 171, 3, 2, 2, 2, 36, 175, 3, 2, 2, 2, 38, 180, 3, 2, 2, 2, 40, 182, 3, 2, 2, 2, 42, 184, 3, 2, 2, 2, 44, 186, 3, 2, 2, 2, 46, 211, 3, 2, 2, 2, 48, 234, 3, 2, 2, 2, 50, 257, 3, 2, 2, 2, 52, 268, 3, 2, 2, 2, 54, 270, 3, 2, 2, 2, 56, 277, 3, 2, 2, 2, 58, 288, 3, 2, 2, 2, 60, 292, 3, 2, 2, 2, 62, 294, 3, 2, 2, 2, 64, 310, 3, 2, 2, 2, 66, 313, 3, 2, 2, 2, 68, 330, 3, 2, 2, 2, 70, 340, 3, 2, 2, 2, 72, 342, 3, 2, 2, 2, 74, 351, 3, 2, 2, 2, 76, 353, 3, 2, 2, 2, 78, 361, 3, 2, 2, 2, 80, 81, 5, 4, 3, 2, 81, 82, 7, 2, 2, 3, 82, 3, 3, 2, 2, 2, 83, 84, 5, 6, 4, 2, 84, 85, 5, 8, 5, 2, 85, 5, 3, 2, 2, 2, 86, 88, 5, 10, 6, 2, 87, 86, 3, 2, 2, 2, 88, 91, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 7, 3, 2, 2, 2, 91, 89, 3, 2, 2, 2, 92, 95, 5, 12, 7, 2, 93, 95, 5, 72, 37, 2, 94, 92, 3, 2, 2, 2, 94, 93, 3, 2, 2, 2, 95, 98, 3, 2, 2, 2, 96, 94, 3, 2, 2, 2, 96, 97, 3, 2, 2, 2, 97, 9, 3, 2, 2, 2, 98, 96, 3, 2, 2, 2, 99, 102, 5, 48, 25, 2, 100, 102, 5, 66, 34, 2, 101, 99, 3, 2, 2, 2, 101, 100, 3, 2, 2, 2, 102, 11, 3, 2, 2, 2, 103, 115, 5, 34, 18, 2, 104, 115, 5, 36, 19, 2, 105, 115, 5, 14, 8, 2, 106, 115, 5, 20, 11, 2, 107, 115, 5, 24, 13, 2, 108, 115, 5, 28, 15, 2, 109, 115, 5, 22, 12, 2, 110, 115, 5, 30, 16, 2, 111, 115, 5, 54, 28, 2, 112, 115, 5, 44, 23, 2, 113, 115, 5, 62, 32, 2, 114, 103, 3, 2, 2, 2, 114, 104, 3, 2, 2, 2, 114, 105, 3, 2, 2, 2, 114, 106, 3, 2, 2, 2, 114, 107, 3, 2, 2, 2, 114, 108, 3, 2, 2, 2, 114, 109, 3, 2, 2, 2, 114, 110, 3, 2, 2, 2, 114, 111, 3, 2, 2, 2, 114, 112, 3, 2, 2, 2, 114, 113, 3, 2, 2, 2, 115, 13, 3, 2, 2, 2, 116, 119, 5, 16, 9, 2, 117, 119, 5, 18, 10, 2, 118, 116, 3, 2, 2, 2, 118, 117, 3, 2, 2, 2, 119, 15, 3, 2, 2, 2, 120, 121, 7, 3, 2, 2, 121, 122, 5, 46, 24, 2, 122, 123, 7, 4, 2, 2, 123, 124, 5, 8, 5, 2, 124, 125, 7, 5, 2, 2, 125, 17, 3, 2, 2, 2, 126, 127, 7, 3, 2, 2, 127, 128, 5, 46, 24, 2, 128, 129, 7, 4, 2, 2, 129, 130, 5, 8, 5, 2, 130, 131, 7, 5, 2, 2, 131, 132, 7, 6, 2, 2, 132, 133, 7, 4, 2, 2, 133, 134, 5, 8, 5, 2, 134, 135, 7, 5, 2, 2, 135, 19, 3, 2, 2, 2, 136, 137, 7, 7, 2, 2, 137, 138, 5, 78, 40, 2, 138, 139, 7, 4, 2, 2, 139, 140, 5, 8, 5, 2, 140, 141, 7, 5, 2, 2, 141, 21, 3, 2, 2, 2, 142, 143, 7, 8, 2, 2, 143, 144, 7, 9, 2, 2, 144, 145, 5, 46, 24, 2, 145, 146, 7, 10, 2, 2, 146, 147, 5, 46, 24, 2, 147, 148, 7, 11, 2, 2, 148, 23, 3, 2, 2, 2, 149, 150, 5, 26, 14, 2, 150, 151, 5, 46, 24, 2, 151, 25, 3, 2, 2, 2, 152, 153, 9, 2, 2, 2, 153, 27, 3, 2, 2, 2, 154, 155, 9, 3, 2, 2, 155, 29, 3, 2, 2, 2, 156, 157, 7, 18, 2, 2, 157, 31, 3, 2, 2, 2, 158, 167, 7, 4, 2, 2, 159, 164, 5, 46, 24, 2, 160, 161, 7, 10, 2, 2, 161, 163, 5, 46, 24, 2, 162, 160, 3, 2, 2, 2, 163, 166, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 168, 3, 2, 2, 2, 166, 164, 3, 2, 2, 2, 167, 159, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 7, 5, 2, 2, 170, 33, 3, 2, 2, 2, 171, 172, 5, 60, 31, 2, 172, 173, 7, 19, 2, 2, 173, 174, 5, 46, 24, 2, 174, 35, 3, 2, 2, 2, 175, 176, 7, 34, 2, 2, 176, 177, 7, 9, 2, 2, 177, 178, 5, 46, 24, 2, 178, 179, 7, 11, 2, 2, 179, 37, 3, 2, 2, 2, 180, 181, 9, 4, 2, 2, 181, 39, 3, 2, 2, 2, 182, 183, 9, 5, 2, 2, 183, 41, 3, 2, 2, 2, 184, 185, 7, 28, 2, 2, 185, 43, 3, 2, 2, 2, 186, 187, 7, 33, 2, 2, 187, 192, 5, 46, 24, 2, 188, 189, 7, 10, 2, 2, 189, 191, 5, 46, 24, 2, 190, 188, 3, 2, 2, 2, 191, 194, 3, 2, 2, 2, 192, 190, 3, 2, 2, 2, 192, 193, 3, 2, 2, 2, 193, 45, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 195, 196, 8, 24, 1, 2, 196, 197, 5, 42, 22, 2, 197, 198, 5, 46, 24, 12, 198, 212, 3, 2, 2, 2, 199, 200, 5, 60, 31, 2, 200, 201, 7, 19, 2, 2, 201, 202, 5, 46, 24, 9, 202, 212, 3, 2, 2, 2, 203, 204, 7, 9, 2, 2, 204, 205, 5, 46, 24, 2, 205, 206, 7, 11, 2, 2, 206, 212, 3, 2, 2, 2, 207, 212, 5, 78, 40, 2, 208, 209, 7, 42, 2, 2, 209, 212, 5, 46, 24, 6, 210, 212, 7, 35, 2, 2, 211, 195, 3, 2, 2, 2, 211, 199, 3, 2, 2, 2, 211, 203, 3, 2, 2, 2, 211, 207, 3, 2, 2, 2, 211, 208, 3, 2, 2, 2, 211, 210, 3, 2, 2, 2, 212, 231, 3, 2, 2, 2, 213, 214, 12, 11, 2, 2, 214, 215, 5, 38, 20, 2, 215, 216, 5, 46, 24, 12, 216, 230, 3, 2, 2, 2, 217, 218, 12, 10, 2, 2, 218, 219, 5, 40, 21, 2, 219, 220, 5, 46, 24, 11, 220, 230, 3, 2, 2, 2, 221, 222, 12, 5, 2, 2, 222, 223, 5, 76, 39, 2, 223, 224, 5, 46, 24, 6, 224, 230, 3, 2, 2, 2, 225, 226, 12, 4, 2, 2, 226, 227, 5, 74, 38, 2, 227, 228, 5, 46, 24, 5, 228, 230, 3, 2, 2, 2, 229, 213, 3, 2, 2, 2, 229, 217, 3, 2, 2, 2, 229, 221, 3, 2, 2, 2, 229, 225, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 47, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 235, 7, 20, 2, 2, 235, 248, 7, 45, 2, 2, 236, 237, 7, 9, 2, 2, 237, 245, 7, 45, 2, 2, 238, 242, 7, 10, 2, 2, 239, 241, 7, 45, 2, 2, 240, 239, 3, 2, 2, 2, 241, 244, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 246, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 245, 238, 3, 2, 2, 2, 245, 246, 3, 2, 2, 2, 246, 247, 3, 2, 2, 2, 247, 249, 7, 11, 2, 2, 248, 236, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 251, 7, 21, 2, 2, 251, 252, 5, 50, 26, 2, 252, 253, 7, 22, 2, 2, 253, 49, 3, 2, 2, 2, 254, 256, 5, 52, 27, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 263, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 262, 5, 66, 34, 2, 261, 260, 3, 2, 2, 2, 262, 265, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 51, 3, 2, 2, 2, 265, 263, 3, 2, 2, 2, 266, 269, 5, 34, 18, 2, 267, 269, 5, 54, 28, 2, 268, 266, 3, 2, 2, 2, 268, 267, 3, 2, 2, 2, 269, 53, 3, 2, 2, 2, 270, 271, 5, 60, 31, 2, 271, 272, 7, 19, 2, 2, 272, 273, 7, 23, 2, 2, 273, 274, 7, 45, 2, 2, 274, 275, 7, 9, 2, 2, 275, 276, 7, 11, 2, 2, 276, 55, 3, 2, 2, 2, 277, 284, 5, 58, 30, 2, 278, 279, 7, 24, 2, 2, 279, 285, 7, 45, 2, 2, 280, 281, 7, 4, 2, 2, 281, 282, 5, 46, 24, 2, 282, 283, 7, 5, 2, 2, 283, 285, 3, 2, 2, 2, 284, 278, 3, 2, 2, 2, 284, 280, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 57, 3, 2, 2, 2, 288, 289, 7, 45, 2, 2, 289, 59, 3, 2, 2, 2, 290, 293, 7, 45, 2, 2, 291, 293, 5, 56, 29, 2, 292, 290, 3, 2, 2, 2, 292, 291, 3, 2, 2, 2, 293, 61, 3, 2, 2, 2, 294, 295, 5, 64, 33, 2, 295, 296, 7, 46, 2, 2, 296, 297, 7, 9, 2, 2, 297, 298, 5, 70, 36, 2, 298, 299, 7, 11, 2, 2, 299, 63, 3, 2, 2, 2, 300, 306, 7, 45, 2, 2, 301, 302, 7, 4, 2, 2, 302, 303, 5, 46, 24, 2, 303, 304, 7, 5, 2, 2, 304, 306, 3, 2, 2, 2, 305, 300, 3, 2, 2, 2, 305, 301, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 309, 7, 24, 2, 2, 308, 305, 3, 2, 2, 2, 309, 312, 3, 2, 2, 2, 310, 308, 3, 2, 2, 2, 310, 311, 3, 2, 2, 2, 311, 65, 3, 2, 2, 2, 312, 310, 3, 2, 2, 2, 313, 314, 7, 25, 2, 2, 314, 315, 7, 46, 2, 2, 315, 316, 7, 9, 2, 2, 316, 317, 5, 68, 35, 2, 317, 318, 7, 11, 2, 2, 318, 319, 7, 21, 2, 2, 319, 320, 5, 8, 5, 2, 320, 321, 7, 22, 2, 2, 321, 67, 3, 2, 2, 2, 322, 327, 7, 45, 2, 2, 323, 324, 7, 10, 2, 2, 324, 326, 7, 45, 2, 2, 325, 323, 3, 2, 2, 2, 326, 329, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 327, 328, 3, 2, 2, 2, 328, 331, 3, 2, 2, 2, 329, 327, 3, 2, 2, 2, 330, 322, 3, 2, 2, 2, 330, 331, 3, 2, 2, 2, 331, 69, 3, 2, 2, 2, 332, 337, 5, 46, 24, 2, 333, 334, 7, 10, 2, 2, 334, 336, 5, 46, 24, 2, 335, 333, 3, 2, 2, 2, 336, 339, 3, 2, 2, 2, 337, 335, 3, 2, 2, 2, 337, 338, 3, 2, 2, 2, 338, 341, 3, 2, 2, 2, 339, 337, 3, 2, 2, 2, 340, 332, 3, 2, 2, 2, 340, 341, 3, 2, 2, 2, 341, 71, 3, 2, 2, 2, 342, 346, 7, 26, 2, 2, 343, 345, 7, 46, 2, 2, 344, 343, 3, 2, 2, 2, 345, 348, 3, 2, 2, 2, 346, 344, 3, 2, 2, 2, 346, 347, 3, 2, 2, 2, 347, 349, 3, 2, 2, 2, 348, 346, 3, 2, 2, 2, 349, 350, 7, 26, 2, 2, 350, 73, 3, 2, 2, 2, 351, 352, 9, 6, 2, 2, 352, 75, 3, 2, 2, 2, 353, 354, 9, 7, 2, 2, 354, 77, 3, 2, 2, 2, 355, 362, 7, 43, 2, 2, 356, 362, 7, 45, 2, 2, 357, 362, 5, 32, 17, 2, 358, 362, 5, 56, 29, 2, 359, 362, 5, 62, 32, 2, 360, 362, 7, 44, 2, 2, 361, 355, 3, 2, 2, 2, 361, 356, 3, 2, 2, 2, 361, 357, 3, 2, 2, 2, 361, 358, 3, 2, 2, 2, 361, 359, 3, 2, 2, 2, 361, 360, 3, 2, 2, 2, 362, 79, 3, 2, 2, 2, 31, 89, 94, 96, 101, 114, 118, 164, 167, 192, 211, 229, 231, 242, 245, 248, 257, 263, 268, 284, 286, 292, 305, 310, 327, 330, 337, 340, 346, 361] \ No newline at end of file diff --git a/ChironCore/turtparse/tlangParser.py b/ChironCore/turtparse/tlangParser.py index da7e1af..38adf99 100644 --- a/ChironCore/turtparse/tlangParser.py +++ b/ChironCore/turtparse/tlangParser.py @@ -9,7 +9,7 @@ def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3/") - buf.write("\u016b\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\u016c\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") @@ -17,156 +17,156 @@ def serializedATN(): buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t") buf.write("&\4\'\t\'\4(\t(\3\2\3\2\3\2\3\3\3\3\3\3\3\4\7\4X\n\4\f") buf.write("\4\16\4[\13\4\3\5\3\5\7\5_\n\5\f\5\16\5b\13\5\3\6\3\6") - buf.write("\5\6f\n\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\5\7") - buf.write("r\n\7\3\b\3\b\5\bv\n\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n") - buf.write("\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3") - buf.write("\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\16") - buf.write("\3\16\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\21\7\21\u00a2") - buf.write("\n\21\f\21\16\21\u00a5\13\21\5\21\u00a7\n\21\3\21\3\21") - buf.write("\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\24\3\24") - buf.write("\3\25\3\25\3\26\3\26\3\27\3\27\3\27\3\27\7\27\u00be\n") - buf.write("\27\f\27\16\27\u00c1\13\27\3\30\3\30\3\30\3\30\3\30\3") - buf.write("\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30") - buf.write("\5\30\u00d3\n\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3") - buf.write("\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\7\30\u00e5") - buf.write("\n\30\f\30\16\30\u00e8\13\30\3\31\3\31\3\31\3\31\3\31") - buf.write("\3\31\7\31\u00f0\n\31\f\31\16\31\u00f3\13\31\5\31\u00f5") - buf.write("\n\31\3\31\5\31\u00f8\n\31\3\31\3\31\3\31\3\31\3\32\7") - buf.write("\32\u00ff\n\32\f\32\16\32\u0102\13\32\3\32\7\32\u0105") - buf.write("\n\32\f\32\16\32\u0108\13\32\3\33\3\33\5\33\u010c\n\33") + buf.write("\5\6f\n\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7") + buf.write("\5\7s\n\7\3\b\3\b\5\bw\n\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n") + buf.write("\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3") + buf.write("\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r") + buf.write("\3\16\3\16\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\21\7\21") + buf.write("\u00a3\n\21\f\21\16\21\u00a6\13\21\5\21\u00a8\n\21\3\21") + buf.write("\3\21\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\24") + buf.write("\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\27\3\27\7\27\u00bf") + buf.write("\n\27\f\27\16\27\u00c2\13\27\3\30\3\30\3\30\3\30\3\30") + buf.write("\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30") + buf.write("\5\30\u00d4\n\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3") + buf.write("\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\7\30\u00e6") + buf.write("\n\30\f\30\16\30\u00e9\13\30\3\31\3\31\3\31\3\31\3\31") + buf.write("\3\31\7\31\u00f1\n\31\f\31\16\31\u00f4\13\31\5\31\u00f6") + buf.write("\n\31\3\31\5\31\u00f9\n\31\3\31\3\31\3\31\3\31\3\32\7") + buf.write("\32\u0100\n\32\f\32\16\32\u0103\13\32\3\32\7\32\u0106") + buf.write("\n\32\f\32\16\32\u0109\13\32\3\33\3\33\5\33\u010d\n\33") buf.write("\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35") - buf.write("\3\35\3\35\3\35\6\35\u011c\n\35\r\35\16\35\u011d\3\36") - buf.write("\3\36\3\37\3\37\5\37\u0124\n\37\3 \3 \3 \3 \3 \3 \3!\3") - buf.write("!\3!\3!\3!\5!\u0131\n!\3!\7!\u0134\n!\f!\16!\u0137\13") - buf.write("!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\7#\u0145") - buf.write("\n#\f#\16#\u0148\13#\5#\u014a\n#\3$\3$\3$\7$\u014f\n$") - buf.write("\f$\16$\u0152\13$\5$\u0154\n$\3%\3%\7%\u0158\n%\f%\16") - buf.write("%\u015b\13%\3%\3%\3&\3&\3\'\3\'\3(\3(\3(\3(\3(\3(\5(\u0169") + buf.write("\3\35\3\35\3\35\6\35\u011d\n\35\r\35\16\35\u011e\3\36") + buf.write("\3\36\3\37\3\37\5\37\u0125\n\37\3 \3 \3 \3 \3 \3 \3!\3") + buf.write("!\3!\3!\3!\5!\u0132\n!\3!\7!\u0135\n!\f!\16!\u0138\13") + buf.write("!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\7#\u0146") + buf.write("\n#\f#\16#\u0149\13#\5#\u014b\n#\3$\3$\3$\7$\u0150\n$") + buf.write("\f$\16$\u0153\13$\5$\u0155\n$\3%\3%\7%\u0159\n%\f%\16") + buf.write("%\u015c\13%\3%\3%\3&\3&\3\'\3\'\3(\3(\3(\3(\3(\3(\5(\u016a") buf.write("\n(\3(\2\3.)\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"") buf.write("$&(*,.\60\62\64\668:<>@BDFHJLN\2\b\3\2\f\17\3\2\20\21") - buf.write("\3\2\35\36\3\2\33\34\3\2\37 \3\2$)\2\u0172\2P\3\2\2\2") - buf.write("\4S\3\2\2\2\6Y\3\2\2\2\b`\3\2\2\2\ne\3\2\2\2\fq\3\2\2") - buf.write("\2\16u\3\2\2\2\20w\3\2\2\2\22}\3\2\2\2\24\u0087\3\2\2") - buf.write("\2\26\u008d\3\2\2\2\30\u0094\3\2\2\2\32\u0097\3\2\2\2") - buf.write("\34\u0099\3\2\2\2\36\u009b\3\2\2\2 \u009d\3\2\2\2\"\u00aa") - buf.write("\3\2\2\2$\u00ae\3\2\2\2&\u00b3\3\2\2\2(\u00b5\3\2\2\2") - buf.write("*\u00b7\3\2\2\2,\u00b9\3\2\2\2.\u00d2\3\2\2\2\60\u00e9") - buf.write("\3\2\2\2\62\u0100\3\2\2\2\64\u010b\3\2\2\2\66\u010d\3") - buf.write("\2\2\28\u0114\3\2\2\2:\u011f\3\2\2\2<\u0123\3\2\2\2>\u0125") - buf.write("\3\2\2\2@\u0135\3\2\2\2B\u0138\3\2\2\2D\u0149\3\2\2\2") - buf.write("F\u0153\3\2\2\2H\u0155\3\2\2\2J\u015e\3\2\2\2L\u0160\3") - buf.write("\2\2\2N\u0168\3\2\2\2PQ\5\4\3\2QR\7\2\2\3R\3\3\2\2\2S") + buf.write("\3\2\35\36\3\2\33\34\3\2\37 \3\2$)\2\u0174\2P\3\2\2\2") + buf.write("\4S\3\2\2\2\6Y\3\2\2\2\b`\3\2\2\2\ne\3\2\2\2\fr\3\2\2") + buf.write("\2\16v\3\2\2\2\20x\3\2\2\2\22~\3\2\2\2\24\u0088\3\2\2") + buf.write("\2\26\u008e\3\2\2\2\30\u0095\3\2\2\2\32\u0098\3\2\2\2") + buf.write("\34\u009a\3\2\2\2\36\u009c\3\2\2\2 \u009e\3\2\2\2\"\u00ab") + buf.write("\3\2\2\2$\u00af\3\2\2\2&\u00b4\3\2\2\2(\u00b6\3\2\2\2") + buf.write("*\u00b8\3\2\2\2,\u00ba\3\2\2\2.\u00d3\3\2\2\2\60\u00ea") + buf.write("\3\2\2\2\62\u0101\3\2\2\2\64\u010c\3\2\2\2\66\u010e\3") + buf.write("\2\2\28\u0115\3\2\2\2:\u0120\3\2\2\2<\u0124\3\2\2\2>\u0126") + buf.write("\3\2\2\2@\u0136\3\2\2\2B\u0139\3\2\2\2D\u014a\3\2\2\2") + buf.write("F\u0154\3\2\2\2H\u0156\3\2\2\2J\u015f\3\2\2\2L\u0161\3") + buf.write("\2\2\2N\u0169\3\2\2\2PQ\5\4\3\2QR\7\2\2\3R\3\3\2\2\2S") buf.write("T\5\6\4\2TU\5\b\5\2U\5\3\2\2\2VX\5\n\6\2WV\3\2\2\2X[\3") buf.write("\2\2\2YW\3\2\2\2YZ\3\2\2\2Z\7\3\2\2\2[Y\3\2\2\2\\_\5\f") buf.write("\7\2]_\5H%\2^\\\3\2\2\2^]\3\2\2\2_b\3\2\2\2`^\3\2\2\2") buf.write("`a\3\2\2\2a\t\3\2\2\2b`\3\2\2\2cf\5\60\31\2df\5B\"\2e") - buf.write("c\3\2\2\2ed\3\2\2\2f\13\3\2\2\2gr\5\"\22\2hr\5$\23\2i") - buf.write("r\5\16\b\2jr\5\24\13\2kr\5\30\r\2lr\5\34\17\2mr\5\26\f") - buf.write("\2nr\5\36\20\2or\5\66\34\2pr\5,\27\2qg\3\2\2\2qh\3\2\2") - buf.write("\2qi\3\2\2\2qj\3\2\2\2qk\3\2\2\2ql\3\2\2\2qm\3\2\2\2q") - buf.write("n\3\2\2\2qo\3\2\2\2qp\3\2\2\2r\r\3\2\2\2sv\5\20\t\2tv") - buf.write("\5\22\n\2us\3\2\2\2ut\3\2\2\2v\17\3\2\2\2wx\7\3\2\2xy") - buf.write("\5.\30\2yz\7\4\2\2z{\5\b\5\2{|\7\5\2\2|\21\3\2\2\2}~\7") - buf.write("\3\2\2~\177\5.\30\2\177\u0080\7\4\2\2\u0080\u0081\5\b") - buf.write("\5\2\u0081\u0082\7\5\2\2\u0082\u0083\7\6\2\2\u0083\u0084") - buf.write("\7\4\2\2\u0084\u0085\5\b\5\2\u0085\u0086\7\5\2\2\u0086") - buf.write("\23\3\2\2\2\u0087\u0088\7\7\2\2\u0088\u0089\5N(\2\u0089") - buf.write("\u008a\7\4\2\2\u008a\u008b\5\b\5\2\u008b\u008c\7\5\2\2") - buf.write("\u008c\25\3\2\2\2\u008d\u008e\7\b\2\2\u008e\u008f\7\t") - buf.write("\2\2\u008f\u0090\5.\30\2\u0090\u0091\7\n\2\2\u0091\u0092") - buf.write("\5.\30\2\u0092\u0093\7\13\2\2\u0093\27\3\2\2\2\u0094\u0095") - buf.write("\5\32\16\2\u0095\u0096\5.\30\2\u0096\31\3\2\2\2\u0097") - buf.write("\u0098\t\2\2\2\u0098\33\3\2\2\2\u0099\u009a\t\3\2\2\u009a") - buf.write("\35\3\2\2\2\u009b\u009c\7\22\2\2\u009c\37\3\2\2\2\u009d") - buf.write("\u00a6\7\4\2\2\u009e\u00a3\5.\30\2\u009f\u00a0\7\n\2\2") - buf.write("\u00a0\u00a2\5.\30\2\u00a1\u009f\3\2\2\2\u00a2\u00a5\3") - buf.write("\2\2\2\u00a3\u00a1\3\2\2\2\u00a3\u00a4\3\2\2\2\u00a4\u00a7") - buf.write("\3\2\2\2\u00a5\u00a3\3\2\2\2\u00a6\u009e\3\2\2\2\u00a6") - buf.write("\u00a7\3\2\2\2\u00a7\u00a8\3\2\2\2\u00a8\u00a9\7\5\2\2") - buf.write("\u00a9!\3\2\2\2\u00aa\u00ab\5<\37\2\u00ab\u00ac\7\23\2") - buf.write("\2\u00ac\u00ad\5.\30\2\u00ad#\3\2\2\2\u00ae\u00af\7\"") - buf.write("\2\2\u00af\u00b0\7\t\2\2\u00b0\u00b1\5.\30\2\u00b1\u00b2") - buf.write("\7\13\2\2\u00b2%\3\2\2\2\u00b3\u00b4\t\4\2\2\u00b4\'\3") - buf.write("\2\2\2\u00b5\u00b6\t\5\2\2\u00b6)\3\2\2\2\u00b7\u00b8") - buf.write("\7\34\2\2\u00b8+\3\2\2\2\u00b9\u00ba\7!\2\2\u00ba\u00bf") - buf.write("\5.\30\2\u00bb\u00bc\7\n\2\2\u00bc\u00be\5.\30\2\u00bd") - buf.write("\u00bb\3\2\2\2\u00be\u00c1\3\2\2\2\u00bf\u00bd\3\2\2\2") - buf.write("\u00bf\u00c0\3\2\2\2\u00c0-\3\2\2\2\u00c1\u00bf\3\2\2") - buf.write("\2\u00c2\u00c3\b\30\1\2\u00c3\u00c4\5*\26\2\u00c4\u00c5") - buf.write("\5.\30\f\u00c5\u00d3\3\2\2\2\u00c6\u00c7\5<\37\2\u00c7") - buf.write("\u00c8\7\23\2\2\u00c8\u00c9\5.\30\t\u00c9\u00d3\3\2\2") - buf.write("\2\u00ca\u00cb\7\t\2\2\u00cb\u00cc\5.\30\2\u00cc\u00cd") - buf.write("\7\13\2\2\u00cd\u00d3\3\2\2\2\u00ce\u00d3\5N(\2\u00cf") - buf.write("\u00d0\7*\2\2\u00d0\u00d3\5.\30\6\u00d1\u00d3\7#\2\2\u00d2") - buf.write("\u00c2\3\2\2\2\u00d2\u00c6\3\2\2\2\u00d2\u00ca\3\2\2\2") - buf.write("\u00d2\u00ce\3\2\2\2\u00d2\u00cf\3\2\2\2\u00d2\u00d1\3") - buf.write("\2\2\2\u00d3\u00e6\3\2\2\2\u00d4\u00d5\f\13\2\2\u00d5") - buf.write("\u00d6\5&\24\2\u00d6\u00d7\5.\30\f\u00d7\u00e5\3\2\2\2") - buf.write("\u00d8\u00d9\f\n\2\2\u00d9\u00da\5(\25\2\u00da\u00db\5") - buf.write(".\30\13\u00db\u00e5\3\2\2\2\u00dc\u00dd\f\5\2\2\u00dd") - buf.write("\u00de\5L\'\2\u00de\u00df\5.\30\6\u00df\u00e5\3\2\2\2") - buf.write("\u00e0\u00e1\f\4\2\2\u00e1\u00e2\5J&\2\u00e2\u00e3\5.") - buf.write("\30\5\u00e3\u00e5\3\2\2\2\u00e4\u00d4\3\2\2\2\u00e4\u00d8") - buf.write("\3\2\2\2\u00e4\u00dc\3\2\2\2\u00e4\u00e0\3\2\2\2\u00e5") - buf.write("\u00e8\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e6\u00e7\3\2\2\2") - buf.write("\u00e7/\3\2\2\2\u00e8\u00e6\3\2\2\2\u00e9\u00ea\7\24\2") - buf.write("\2\u00ea\u00f7\7-\2\2\u00eb\u00ec\7\t\2\2\u00ec\u00f4") - buf.write("\7-\2\2\u00ed\u00f1\7\n\2\2\u00ee\u00f0\7-\2\2\u00ef\u00ee") - buf.write("\3\2\2\2\u00f0\u00f3\3\2\2\2\u00f1\u00ef\3\2\2\2\u00f1") - buf.write("\u00f2\3\2\2\2\u00f2\u00f5\3\2\2\2\u00f3\u00f1\3\2\2\2") - buf.write("\u00f4\u00ed\3\2\2\2\u00f4\u00f5\3\2\2\2\u00f5\u00f6\3") - buf.write("\2\2\2\u00f6\u00f8\7\13\2\2\u00f7\u00eb\3\2\2\2\u00f7") - buf.write("\u00f8\3\2\2\2\u00f8\u00f9\3\2\2\2\u00f9\u00fa\7\25\2") - buf.write("\2\u00fa\u00fb\5\62\32\2\u00fb\u00fc\7\26\2\2\u00fc\61") - buf.write("\3\2\2\2\u00fd\u00ff\5\64\33\2\u00fe\u00fd\3\2\2\2\u00ff") - buf.write("\u0102\3\2\2\2\u0100\u00fe\3\2\2\2\u0100\u0101\3\2\2\2") - buf.write("\u0101\u0106\3\2\2\2\u0102\u0100\3\2\2\2\u0103\u0105\5") - buf.write("B\"\2\u0104\u0103\3\2\2\2\u0105\u0108\3\2\2\2\u0106\u0104") - buf.write("\3\2\2\2\u0106\u0107\3\2\2\2\u0107\63\3\2\2\2\u0108\u0106") - buf.write("\3\2\2\2\u0109\u010c\5\"\22\2\u010a\u010c\5\66\34\2\u010b") - buf.write("\u0109\3\2\2\2\u010b\u010a\3\2\2\2\u010c\65\3\2\2\2\u010d") - buf.write("\u010e\5<\37\2\u010e\u010f\7\23\2\2\u010f\u0110\7\27\2") - buf.write("\2\u0110\u0111\7-\2\2\u0111\u0112\7\t\2\2\u0112\u0113") - buf.write("\7\13\2\2\u0113\67\3\2\2\2\u0114\u011b\5:\36\2\u0115\u0116") - buf.write("\7\30\2\2\u0116\u011c\7-\2\2\u0117\u0118\7\4\2\2\u0118") - buf.write("\u0119\5.\30\2\u0119\u011a\7\5\2\2\u011a\u011c\3\2\2\2") - buf.write("\u011b\u0115\3\2\2\2\u011b\u0117\3\2\2\2\u011c\u011d\3") - buf.write("\2\2\2\u011d\u011b\3\2\2\2\u011d\u011e\3\2\2\2\u011e9") - buf.write("\3\2\2\2\u011f\u0120\7-\2\2\u0120;\3\2\2\2\u0121\u0124") - buf.write("\7-\2\2\u0122\u0124\58\35\2\u0123\u0121\3\2\2\2\u0123") - buf.write("\u0122\3\2\2\2\u0124=\3\2\2\2\u0125\u0126\5@!\2\u0126") - buf.write("\u0127\7.\2\2\u0127\u0128\7\t\2\2\u0128\u0129\5F$\2\u0129") - buf.write("\u012a\7\13\2\2\u012a?\3\2\2\2\u012b\u0131\7-\2\2\u012c") - buf.write("\u012d\7\4\2\2\u012d\u012e\5.\30\2\u012e\u012f\7\5\2\2") - buf.write("\u012f\u0131\3\2\2\2\u0130\u012b\3\2\2\2\u0130\u012c\3") - buf.write("\2\2\2\u0131\u0132\3\2\2\2\u0132\u0134\7\30\2\2\u0133") - buf.write("\u0130\3\2\2\2\u0134\u0137\3\2\2\2\u0135\u0133\3\2\2\2") - buf.write("\u0135\u0136\3\2\2\2\u0136A\3\2\2\2\u0137\u0135\3\2\2") - buf.write("\2\u0138\u0139\7\31\2\2\u0139\u013a\7.\2\2\u013a\u013b") - buf.write("\7\t\2\2\u013b\u013c\5D#\2\u013c\u013d\7\13\2\2\u013d") - buf.write("\u013e\7\25\2\2\u013e\u013f\5\b\5\2\u013f\u0140\7\26\2") - buf.write("\2\u0140C\3\2\2\2\u0141\u0146\7-\2\2\u0142\u0143\7\n\2") - buf.write("\2\u0143\u0145\7-\2\2\u0144\u0142\3\2\2\2\u0145\u0148") - buf.write("\3\2\2\2\u0146\u0144\3\2\2\2\u0146\u0147\3\2\2\2\u0147") - buf.write("\u014a\3\2\2\2\u0148\u0146\3\2\2\2\u0149\u0141\3\2\2\2") - buf.write("\u0149\u014a\3\2\2\2\u014aE\3\2\2\2\u014b\u0150\5.\30") - buf.write("\2\u014c\u014d\7\n\2\2\u014d\u014f\5.\30\2\u014e\u014c") - buf.write("\3\2\2\2\u014f\u0152\3\2\2\2\u0150\u014e\3\2\2\2\u0150") - buf.write("\u0151\3\2\2\2\u0151\u0154\3\2\2\2\u0152\u0150\3\2\2\2") - buf.write("\u0153\u014b\3\2\2\2\u0153\u0154\3\2\2\2\u0154G\3\2\2") - buf.write("\2\u0155\u0159\7\32\2\2\u0156\u0158\7.\2\2\u0157\u0156") - buf.write("\3\2\2\2\u0158\u015b\3\2\2\2\u0159\u0157\3\2\2\2\u0159") - buf.write("\u015a\3\2\2\2\u015a\u015c\3\2\2\2\u015b\u0159\3\2\2\2") - buf.write("\u015c\u015d\7\32\2\2\u015dI\3\2\2\2\u015e\u015f\t\6\2") - buf.write("\2\u015fK\3\2\2\2\u0160\u0161\t\7\2\2\u0161M\3\2\2\2\u0162") - buf.write("\u0169\7+\2\2\u0163\u0169\7-\2\2\u0164\u0169\5 \21\2\u0165") - buf.write("\u0169\58\35\2\u0166\u0169\5> \2\u0167\u0169\7,\2\2\u0168") - buf.write("\u0162\3\2\2\2\u0168\u0163\3\2\2\2\u0168\u0164\3\2\2\2") - buf.write("\u0168\u0165\3\2\2\2\u0168\u0166\3\2\2\2\u0168\u0167\3") - buf.write("\2\2\2\u0169O\3\2\2\2\37Y^`equ\u00a3\u00a6\u00bf\u00d2") - buf.write("\u00e4\u00e6\u00f1\u00f4\u00f7\u0100\u0106\u010b\u011b") - buf.write("\u011d\u0123\u0130\u0135\u0146\u0149\u0150\u0153\u0159") - buf.write("\u0168") + buf.write("c\3\2\2\2ed\3\2\2\2f\13\3\2\2\2gs\5\"\22\2hs\5$\23\2i") + buf.write("s\5\16\b\2js\5\24\13\2ks\5\30\r\2ls\5\34\17\2ms\5\26\f") + buf.write("\2ns\5\36\20\2os\5\66\34\2ps\5,\27\2qs\5> \2rg\3\2\2\2") + buf.write("rh\3\2\2\2ri\3\2\2\2rj\3\2\2\2rk\3\2\2\2rl\3\2\2\2rm\3") + buf.write("\2\2\2rn\3\2\2\2ro\3\2\2\2rp\3\2\2\2rq\3\2\2\2s\r\3\2") + buf.write("\2\2tw\5\20\t\2uw\5\22\n\2vt\3\2\2\2vu\3\2\2\2w\17\3\2") + buf.write("\2\2xy\7\3\2\2yz\5.\30\2z{\7\4\2\2{|\5\b\5\2|}\7\5\2\2") + buf.write("}\21\3\2\2\2~\177\7\3\2\2\177\u0080\5.\30\2\u0080\u0081") + buf.write("\7\4\2\2\u0081\u0082\5\b\5\2\u0082\u0083\7\5\2\2\u0083") + buf.write("\u0084\7\6\2\2\u0084\u0085\7\4\2\2\u0085\u0086\5\b\5\2") + buf.write("\u0086\u0087\7\5\2\2\u0087\23\3\2\2\2\u0088\u0089\7\7") + buf.write("\2\2\u0089\u008a\5N(\2\u008a\u008b\7\4\2\2\u008b\u008c") + buf.write("\5\b\5\2\u008c\u008d\7\5\2\2\u008d\25\3\2\2\2\u008e\u008f") + buf.write("\7\b\2\2\u008f\u0090\7\t\2\2\u0090\u0091\5.\30\2\u0091") + buf.write("\u0092\7\n\2\2\u0092\u0093\5.\30\2\u0093\u0094\7\13\2") + buf.write("\2\u0094\27\3\2\2\2\u0095\u0096\5\32\16\2\u0096\u0097") + buf.write("\5.\30\2\u0097\31\3\2\2\2\u0098\u0099\t\2\2\2\u0099\33") + buf.write("\3\2\2\2\u009a\u009b\t\3\2\2\u009b\35\3\2\2\2\u009c\u009d") + buf.write("\7\22\2\2\u009d\37\3\2\2\2\u009e\u00a7\7\4\2\2\u009f\u00a4") + buf.write("\5.\30\2\u00a0\u00a1\7\n\2\2\u00a1\u00a3\5.\30\2\u00a2") + buf.write("\u00a0\3\2\2\2\u00a3\u00a6\3\2\2\2\u00a4\u00a2\3\2\2\2") + buf.write("\u00a4\u00a5\3\2\2\2\u00a5\u00a8\3\2\2\2\u00a6\u00a4\3") + buf.write("\2\2\2\u00a7\u009f\3\2\2\2\u00a7\u00a8\3\2\2\2\u00a8\u00a9") + buf.write("\3\2\2\2\u00a9\u00aa\7\5\2\2\u00aa!\3\2\2\2\u00ab\u00ac") + buf.write("\5<\37\2\u00ac\u00ad\7\23\2\2\u00ad\u00ae\5.\30\2\u00ae") + buf.write("#\3\2\2\2\u00af\u00b0\7\"\2\2\u00b0\u00b1\7\t\2\2\u00b1") + buf.write("\u00b2\5.\30\2\u00b2\u00b3\7\13\2\2\u00b3%\3\2\2\2\u00b4") + buf.write("\u00b5\t\4\2\2\u00b5\'\3\2\2\2\u00b6\u00b7\t\5\2\2\u00b7") + buf.write(")\3\2\2\2\u00b8\u00b9\7\34\2\2\u00b9+\3\2\2\2\u00ba\u00bb") + buf.write("\7!\2\2\u00bb\u00c0\5.\30\2\u00bc\u00bd\7\n\2\2\u00bd") + buf.write("\u00bf\5.\30\2\u00be\u00bc\3\2\2\2\u00bf\u00c2\3\2\2\2") + buf.write("\u00c0\u00be\3\2\2\2\u00c0\u00c1\3\2\2\2\u00c1-\3\2\2") + buf.write("\2\u00c2\u00c0\3\2\2\2\u00c3\u00c4\b\30\1\2\u00c4\u00c5") + buf.write("\5*\26\2\u00c5\u00c6\5.\30\f\u00c6\u00d4\3\2\2\2\u00c7") + buf.write("\u00c8\5<\37\2\u00c8\u00c9\7\23\2\2\u00c9\u00ca\5.\30") + buf.write("\t\u00ca\u00d4\3\2\2\2\u00cb\u00cc\7\t\2\2\u00cc\u00cd") + buf.write("\5.\30\2\u00cd\u00ce\7\13\2\2\u00ce\u00d4\3\2\2\2\u00cf") + buf.write("\u00d4\5N(\2\u00d0\u00d1\7*\2\2\u00d1\u00d4\5.\30\6\u00d2") + buf.write("\u00d4\7#\2\2\u00d3\u00c3\3\2\2\2\u00d3\u00c7\3\2\2\2") + buf.write("\u00d3\u00cb\3\2\2\2\u00d3\u00cf\3\2\2\2\u00d3\u00d0\3") + buf.write("\2\2\2\u00d3\u00d2\3\2\2\2\u00d4\u00e7\3\2\2\2\u00d5\u00d6") + buf.write("\f\13\2\2\u00d6\u00d7\5&\24\2\u00d7\u00d8\5.\30\f\u00d8") + buf.write("\u00e6\3\2\2\2\u00d9\u00da\f\n\2\2\u00da\u00db\5(\25\2") + buf.write("\u00db\u00dc\5.\30\13\u00dc\u00e6\3\2\2\2\u00dd\u00de") + buf.write("\f\5\2\2\u00de\u00df\5L\'\2\u00df\u00e0\5.\30\6\u00e0") + buf.write("\u00e6\3\2\2\2\u00e1\u00e2\f\4\2\2\u00e2\u00e3\5J&\2\u00e3") + buf.write("\u00e4\5.\30\5\u00e4\u00e6\3\2\2\2\u00e5\u00d5\3\2\2\2") + buf.write("\u00e5\u00d9\3\2\2\2\u00e5\u00dd\3\2\2\2\u00e5\u00e1\3") + buf.write("\2\2\2\u00e6\u00e9\3\2\2\2\u00e7\u00e5\3\2\2\2\u00e7\u00e8") + buf.write("\3\2\2\2\u00e8/\3\2\2\2\u00e9\u00e7\3\2\2\2\u00ea\u00eb") + buf.write("\7\24\2\2\u00eb\u00f8\7-\2\2\u00ec\u00ed\7\t\2\2\u00ed") + buf.write("\u00f5\7-\2\2\u00ee\u00f2\7\n\2\2\u00ef\u00f1\7-\2\2\u00f0") + buf.write("\u00ef\3\2\2\2\u00f1\u00f4\3\2\2\2\u00f2\u00f0\3\2\2\2") + buf.write("\u00f2\u00f3\3\2\2\2\u00f3\u00f6\3\2\2\2\u00f4\u00f2\3") + buf.write("\2\2\2\u00f5\u00ee\3\2\2\2\u00f5\u00f6\3\2\2\2\u00f6\u00f7") + buf.write("\3\2\2\2\u00f7\u00f9\7\13\2\2\u00f8\u00ec\3\2\2\2\u00f8") + buf.write("\u00f9\3\2\2\2\u00f9\u00fa\3\2\2\2\u00fa\u00fb\7\25\2") + buf.write("\2\u00fb\u00fc\5\62\32\2\u00fc\u00fd\7\26\2\2\u00fd\61") + buf.write("\3\2\2\2\u00fe\u0100\5\64\33\2\u00ff\u00fe\3\2\2\2\u0100") + buf.write("\u0103\3\2\2\2\u0101\u00ff\3\2\2\2\u0101\u0102\3\2\2\2") + buf.write("\u0102\u0107\3\2\2\2\u0103\u0101\3\2\2\2\u0104\u0106\5") + buf.write("B\"\2\u0105\u0104\3\2\2\2\u0106\u0109\3\2\2\2\u0107\u0105") + buf.write("\3\2\2\2\u0107\u0108\3\2\2\2\u0108\63\3\2\2\2\u0109\u0107") + buf.write("\3\2\2\2\u010a\u010d\5\"\22\2\u010b\u010d\5\66\34\2\u010c") + buf.write("\u010a\3\2\2\2\u010c\u010b\3\2\2\2\u010d\65\3\2\2\2\u010e") + buf.write("\u010f\5<\37\2\u010f\u0110\7\23\2\2\u0110\u0111\7\27\2") + buf.write("\2\u0111\u0112\7-\2\2\u0112\u0113\7\t\2\2\u0113\u0114") + buf.write("\7\13\2\2\u0114\67\3\2\2\2\u0115\u011c\5:\36\2\u0116\u0117") + buf.write("\7\30\2\2\u0117\u011d\7-\2\2\u0118\u0119\7\4\2\2\u0119") + buf.write("\u011a\5.\30\2\u011a\u011b\7\5\2\2\u011b\u011d\3\2\2\2") + buf.write("\u011c\u0116\3\2\2\2\u011c\u0118\3\2\2\2\u011d\u011e\3") + buf.write("\2\2\2\u011e\u011c\3\2\2\2\u011e\u011f\3\2\2\2\u011f9") + buf.write("\3\2\2\2\u0120\u0121\7-\2\2\u0121;\3\2\2\2\u0122\u0125") + buf.write("\7-\2\2\u0123\u0125\58\35\2\u0124\u0122\3\2\2\2\u0124") + buf.write("\u0123\3\2\2\2\u0125=\3\2\2\2\u0126\u0127\5@!\2\u0127") + buf.write("\u0128\7.\2\2\u0128\u0129\7\t\2\2\u0129\u012a\5F$\2\u012a") + buf.write("\u012b\7\13\2\2\u012b?\3\2\2\2\u012c\u0132\7-\2\2\u012d") + buf.write("\u012e\7\4\2\2\u012e\u012f\5.\30\2\u012f\u0130\7\5\2\2") + buf.write("\u0130\u0132\3\2\2\2\u0131\u012c\3\2\2\2\u0131\u012d\3") + buf.write("\2\2\2\u0132\u0133\3\2\2\2\u0133\u0135\7\30\2\2\u0134") + buf.write("\u0131\3\2\2\2\u0135\u0138\3\2\2\2\u0136\u0134\3\2\2\2") + buf.write("\u0136\u0137\3\2\2\2\u0137A\3\2\2\2\u0138\u0136\3\2\2") + buf.write("\2\u0139\u013a\7\31\2\2\u013a\u013b\7.\2\2\u013b\u013c") + buf.write("\7\t\2\2\u013c\u013d\5D#\2\u013d\u013e\7\13\2\2\u013e") + buf.write("\u013f\7\25\2\2\u013f\u0140\5\b\5\2\u0140\u0141\7\26\2") + buf.write("\2\u0141C\3\2\2\2\u0142\u0147\7-\2\2\u0143\u0144\7\n\2") + buf.write("\2\u0144\u0146\7-\2\2\u0145\u0143\3\2\2\2\u0146\u0149") + buf.write("\3\2\2\2\u0147\u0145\3\2\2\2\u0147\u0148\3\2\2\2\u0148") + buf.write("\u014b\3\2\2\2\u0149\u0147\3\2\2\2\u014a\u0142\3\2\2\2") + buf.write("\u014a\u014b\3\2\2\2\u014bE\3\2\2\2\u014c\u0151\5.\30") + buf.write("\2\u014d\u014e\7\n\2\2\u014e\u0150\5.\30\2\u014f\u014d") + buf.write("\3\2\2\2\u0150\u0153\3\2\2\2\u0151\u014f\3\2\2\2\u0151") + buf.write("\u0152\3\2\2\2\u0152\u0155\3\2\2\2\u0153\u0151\3\2\2\2") + buf.write("\u0154\u014c\3\2\2\2\u0154\u0155\3\2\2\2\u0155G\3\2\2") + buf.write("\2\u0156\u015a\7\32\2\2\u0157\u0159\7.\2\2\u0158\u0157") + buf.write("\3\2\2\2\u0159\u015c\3\2\2\2\u015a\u0158\3\2\2\2\u015a") + buf.write("\u015b\3\2\2\2\u015b\u015d\3\2\2\2\u015c\u015a\3\2\2\2") + buf.write("\u015d\u015e\7\32\2\2\u015eI\3\2\2\2\u015f\u0160\t\6\2") + buf.write("\2\u0160K\3\2\2\2\u0161\u0162\t\7\2\2\u0162M\3\2\2\2\u0163") + buf.write("\u016a\7+\2\2\u0164\u016a\7-\2\2\u0165\u016a\5 \21\2\u0166") + buf.write("\u016a\58\35\2\u0167\u016a\5> \2\u0168\u016a\7,\2\2\u0169") + buf.write("\u0163\3\2\2\2\u0169\u0164\3\2\2\2\u0169\u0165\3\2\2\2") + buf.write("\u0169\u0166\3\2\2\2\u0169\u0167\3\2\2\2\u0169\u0168\3") + buf.write("\2\2\2\u016aO\3\2\2\2\37Y^`erv\u00a4\u00a7\u00c0\u00d3") + buf.write("\u00e5\u00e7\u00f2\u00f5\u00f8\u0101\u0107\u010c\u011c") + buf.write("\u011e\u0124\u0131\u0136\u0147\u014a\u0151\u0154\u015a") + buf.write("\u0169") return buf.getvalue() @@ -488,11 +488,11 @@ def strict_ilist(self): self.state = 94 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__23) | (1 << tlangParser.RETURN) | (1 << tlangParser.PRINT) | (1 << tlangParser.VAR))) != 0): + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__0) | (1 << tlangParser.T__1) | (1 << tlangParser.T__4) | (1 << tlangParser.T__5) | (1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12) | (1 << tlangParser.T__13) | (1 << tlangParser.T__14) | (1 << tlangParser.T__15) | (1 << tlangParser.T__23) | (1 << tlangParser.RETURN) | (1 << tlangParser.PRINT) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): self.state = 92 self._errHandler.sync(self) token = self._input.LA(1) - if token in [tlangParser.T__0, tlangParser.T__4, tlangParser.T__5, tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12, tlangParser.T__13, tlangParser.T__14, tlangParser.T__15, tlangParser.RETURN, tlangParser.PRINT, tlangParser.VAR]: + if token in [tlangParser.T__0, tlangParser.T__1, tlangParser.T__4, tlangParser.T__5, tlangParser.T__9, tlangParser.T__10, tlangParser.T__11, tlangParser.T__12, tlangParser.T__13, tlangParser.T__14, tlangParser.T__15, tlangParser.RETURN, tlangParser.PRINT, tlangParser.VAR, tlangParser.NAME]: self.state = 90 self.instruction() pass @@ -618,6 +618,10 @@ def returnStatement(self): return self.getTypedRuleContext(tlangParser.ReturnStatementContext,0) + def functionCall(self): + return self.getTypedRuleContext(tlangParser.FunctionCallContext,0) + + def getRuleIndex(self): return tlangParser.RULE_instruction @@ -635,7 +639,7 @@ def instruction(self): localctx = tlangParser.InstructionContext(self, self._ctx, self.state) self.enterRule(localctx, 10, self.RULE_instruction) try: - self.state = 111 + self.state = 112 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,4,self._ctx) if la_ == 1: @@ -698,6 +702,12 @@ def instruction(self): self.returnStatement() pass + elif la_ == 11: + self.enterOuterAlt(localctx, 11) + self.state = 111 + self.functionCall() + pass + except RecognitionException as re: localctx.exception = re @@ -739,18 +749,18 @@ def conditional(self): localctx = tlangParser.ConditionalContext(self, self._ctx, self.state) self.enterRule(localctx, 12, self.RULE_conditional) try: - self.state = 115 + self.state = 116 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,5,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 113 + self.state = 114 self.ifConditional() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 114 + self.state = 115 self.ifElseConditional() pass @@ -796,15 +806,15 @@ def ifConditional(self): self.enterRule(localctx, 14, self.RULE_ifConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 117 - self.match(tlangParser.T__0) self.state = 118 - self.expression(0) + self.match(tlangParser.T__0) self.state = 119 - self.match(tlangParser.T__1) + self.expression(0) self.state = 120 - self.strict_ilist() + self.match(tlangParser.T__1) self.state = 121 + self.strict_ilist() + self.state = 122 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -850,23 +860,23 @@ def ifElseConditional(self): self.enterRule(localctx, 16, self.RULE_ifElseConditional) try: self.enterOuterAlt(localctx, 1) - self.state = 123 - self.match(tlangParser.T__0) self.state = 124 - self.expression(0) + self.match(tlangParser.T__0) self.state = 125 - self.match(tlangParser.T__1) + self.expression(0) self.state = 126 - self.strict_ilist() + self.match(tlangParser.T__1) self.state = 127 - self.match(tlangParser.T__2) + self.strict_ilist() self.state = 128 - self.match(tlangParser.T__3) + self.match(tlangParser.T__2) self.state = 129 - self.match(tlangParser.T__1) + self.match(tlangParser.T__3) self.state = 130 - self.strict_ilist() + self.match(tlangParser.T__1) self.state = 131 + self.strict_ilist() + self.state = 132 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -909,15 +919,15 @@ def loop(self): self.enterRule(localctx, 18, self.RULE_loop) try: self.enterOuterAlt(localctx, 1) - self.state = 133 - self.match(tlangParser.T__4) self.state = 134 - self.value() + self.match(tlangParser.T__4) self.state = 135 - self.match(tlangParser.T__1) + self.value() self.state = 136 - self.strict_ilist() + self.match(tlangParser.T__1) self.state = 137 + self.strict_ilist() + self.state = 138 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -959,17 +969,17 @@ def gotoCommand(self): self.enterRule(localctx, 20, self.RULE_gotoCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 139 - self.match(tlangParser.T__5) self.state = 140 - self.match(tlangParser.T__6) + self.match(tlangParser.T__5) self.state = 141 - self.expression(0) + self.match(tlangParser.T__6) self.state = 142 - self.match(tlangParser.T__7) - self.state = 143 self.expression(0) + self.state = 143 + self.match(tlangParser.T__7) self.state = 144 + self.expression(0) + self.state = 145 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1012,9 +1022,9 @@ def moveCommand(self): self.enterRule(localctx, 22, self.RULE_moveCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 146 - self.moveOp() self.state = 147 + self.moveOp() + self.state = 148 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1051,7 +1061,7 @@ def moveOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 149 + self.state = 150 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__9) | (1 << tlangParser.T__10) | (1 << tlangParser.T__11) | (1 << tlangParser.T__12))) != 0)): self._errHandler.recoverInline(self) @@ -1093,7 +1103,7 @@ def penCommand(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 151 + self.state = 152 _la = self._input.LA(1) if not(_la==tlangParser.T__13 or _la==tlangParser.T__14): self._errHandler.recoverInline(self) @@ -1134,7 +1144,7 @@ def pauseCommand(self): self.enterRule(localctx, 28, self.RULE_pauseCommand) try: self.enterOuterAlt(localctx, 1) - self.state = 153 + self.state = 154 self.match(tlangParser.T__15) except RecognitionException as re: localctx.exception = re @@ -1177,29 +1187,29 @@ def array(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 155 + self.state = 156 self.match(tlangParser.T__1) - self.state = 164 + self.state = 165 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.PENCOND) | (1 << tlangParser.NOT) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 156 + self.state = 157 self.expression(0) - self.state = 161 + self.state = 162 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 157 - self.match(tlangParser.T__7) self.state = 158 + self.match(tlangParser.T__7) + self.state = 159 self.expression(0) - self.state = 163 + self.state = 164 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 166 + self.state = 167 self.match(tlangParser.T__2) except RecognitionException as re: localctx.exception = re @@ -1242,11 +1252,11 @@ def assignment(self): self.enterRule(localctx, 32, self.RULE_assignment) try: self.enterOuterAlt(localctx, 1) - self.state = 168 - self.lvalue() self.state = 169 - self.match(tlangParser.T__16) + self.lvalue() self.state = 170 + self.match(tlangParser.T__16) + self.state = 171 self.expression(0) except RecognitionException as re: localctx.exception = re @@ -1288,13 +1298,13 @@ def printStatement(self): self.enterRule(localctx, 34, self.RULE_printStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 172 - self.match(tlangParser.PRINT) self.state = 173 - self.match(tlangParser.T__6) + self.match(tlangParser.PRINT) self.state = 174 - self.expression(0) + self.match(tlangParser.T__6) self.state = 175 + self.expression(0) + self.state = 176 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -1336,7 +1346,7 @@ def multiplicative(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 177 + self.state = 178 _la = self._input.LA(1) if not(_la==tlangParser.MUL or _la==tlangParser.DIV): self._errHandler.recoverInline(self) @@ -1383,7 +1393,7 @@ def additive(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 179 + self.state = 180 _la = self._input.LA(1) if not(_la==tlangParser.PLUS or _la==tlangParser.MINUS): self._errHandler.recoverInline(self) @@ -1426,7 +1436,7 @@ def unaryArithOp(self): self.enterRule(localctx, 40, self.RULE_unaryArithOp) try: self.enterOuterAlt(localctx, 1) - self.state = 181 + self.state = 182 self.match(tlangParser.MINUS) except RecognitionException as re: localctx.exception = re @@ -1472,20 +1482,20 @@ def returnStatement(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 183 + self.state = 184 self.match(tlangParser.RETURN) - self.state = 184 + self.state = 185 self.expression(0) - self.state = 189 + self.state = 190 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 185 - self.match(tlangParser.T__7) self.state = 186 + self.match(tlangParser.T__7) + self.state = 187 self.expression(0) - self.state = 191 + self.state = 192 self._errHandler.sync(self) _la = self._input.LA(1) @@ -1724,7 +1734,7 @@ def expression(self, _p:int=0): self.enterRecursionRule(localctx, 44, self.RULE_expression, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 208 + self.state = 209 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,9,self._ctx) if la_ == 1: @@ -1732,9 +1742,9 @@ def expression(self, _p:int=0): self._ctx = localctx _prevctx = localctx - self.state = 193 - self.unaryArithOp() self.state = 194 + self.unaryArithOp() + self.state = 195 self.expression(10) pass @@ -1742,11 +1752,11 @@ def expression(self, _p:int=0): localctx = tlangParser.AssignExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 196 - self.lvalue() self.state = 197 - self.match(tlangParser.T__16) + self.lvalue() self.state = 198 + self.match(tlangParser.T__16) + self.state = 199 self.expression(7) pass @@ -1754,11 +1764,11 @@ def expression(self, _p:int=0): localctx = tlangParser.ParenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 200 - self.match(tlangParser.T__6) self.state = 201 - self.expression(0) + self.match(tlangParser.T__6) self.state = 202 + self.expression(0) + self.state = 203 self.match(tlangParser.T__8) pass @@ -1766,7 +1776,7 @@ def expression(self, _p:int=0): localctx = tlangParser.ValueExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 204 + self.state = 205 self.value() pass @@ -1774,9 +1784,9 @@ def expression(self, _p:int=0): localctx = tlangParser.NotExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 205 - self.match(tlangParser.NOT) self.state = 206 + self.match(tlangParser.NOT) + self.state = 207 self.expression(4) pass @@ -1784,13 +1794,13 @@ def expression(self, _p:int=0): localctx = tlangParser.PenExprContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 207 + self.state = 208 self.match(tlangParser.PENCOND) pass self._ctx.stop = self._input.LT(-1) - self.state = 228 + self.state = 229 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,11,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -1798,63 +1808,63 @@ def expression(self, _p:int=0): if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 226 + self.state = 227 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,10,self._ctx) if la_ == 1: localctx = tlangParser.MulExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 210 + self.state = 211 if not self.precpred(self._ctx, 9): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 9)") - self.state = 211 - self.multiplicative() self.state = 212 + self.multiplicative() + self.state = 213 self.expression(10) pass elif la_ == 2: localctx = tlangParser.AddExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 214 + self.state = 215 if not self.precpred(self._ctx, 8): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 8)") - self.state = 215 - self.additive() self.state = 216 + self.additive() + self.state = 217 self.expression(9) pass elif la_ == 3: localctx = tlangParser.BinExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 218 + self.state = 219 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 219 - self.binCondOp() self.state = 220 + self.binCondOp() + self.state = 221 self.expression(4) pass elif la_ == 4: localctx = tlangParser.LogExprContext(self, tlangParser.ExpressionContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expression) - self.state = 222 + self.state = 223 if not self.precpred(self._ctx, 2): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 2)") - self.state = 223 - self.logicOp() self.state = 224 + self.logicOp() + self.state = 225 self.expression(3) pass - self.state = 230 + self.state = 231 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,11,self._ctx) @@ -1902,45 +1912,45 @@ def classDeclaration(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 231 - self.match(tlangParser.T__17) self.state = 232 + self.match(tlangParser.T__17) + self.state = 233 self.match(tlangParser.VAR) - self.state = 245 + self.state = 246 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.T__6: - self.state = 233 - self.match(tlangParser.T__6) self.state = 234 + self.match(tlangParser.T__6) + self.state = 235 self.match(tlangParser.VAR) - self.state = 242 + self.state = 243 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.T__7: - self.state = 235 + self.state = 236 self.match(tlangParser.T__7) - self.state = 239 + self.state = 240 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 236 + self.state = 237 self.match(tlangParser.VAR) - self.state = 241 + self.state = 242 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 244 + self.state = 245 self.match(tlangParser.T__8) - self.state = 247 - self.match(tlangParser.T__18) self.state = 248 - self.classBody() + self.match(tlangParser.T__18) self.state = 249 + self.classBody() + self.state = 250 self.match(tlangParser.T__19) except RecognitionException as re: localctx.exception = re @@ -1990,23 +2000,23 @@ def classBody(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 254 + self.state = 255 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.VAR: - self.state = 251 + self.state = 252 self.classAttributeDeclaration() - self.state = 256 + self.state = 257 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 260 + self.state = 261 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__22: - self.state = 257 + self.state = 258 self.functionDeclaration() - self.state = 262 + self.state = 263 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2050,18 +2060,18 @@ def classAttributeDeclaration(self): localctx = tlangParser.ClassAttributeDeclarationContext(self, self._ctx, self.state) self.enterRule(localctx, 50, self.RULE_classAttributeDeclaration) try: - self.state = 265 + self.state = 266 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,17,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 263 + self.state = 264 self.assignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 264 + self.state = 265 self.objectInstantiation() pass @@ -2106,17 +2116,17 @@ def objectInstantiation(self): self.enterRule(localctx, 52, self.RULE_objectInstantiation) try: self.enterOuterAlt(localctx, 1) - self.state = 267 - self.lvalue() self.state = 268 - self.match(tlangParser.T__16) + self.lvalue() self.state = 269 - self.match(tlangParser.T__20) + self.match(tlangParser.T__16) self.state = 270 - self.match(tlangParser.VAR) + self.match(tlangParser.T__20) self.state = 271 - self.match(tlangParser.T__6) + self.match(tlangParser.VAR) self.state = 272 + self.match(tlangParser.T__6) + self.state = 273 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2168,28 +2178,28 @@ def dataLocationAccess(self): self.enterRule(localctx, 54, self.RULE_dataLocationAccess) try: self.enterOuterAlt(localctx, 1) - self.state = 274 + self.state = 275 self.baseVar() - self.state = 281 + self.state = 282 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 281 + self.state = 282 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.T__21]: - self.state = 275 - self.match(tlangParser.T__21) self.state = 276 + self.match(tlangParser.T__21) + self.state = 277 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 277 - self.match(tlangParser.T__1) self.state = 278 - self.expression(0) + self.match(tlangParser.T__1) self.state = 279 + self.expression(0) + self.state = 280 self.match(tlangParser.T__2) pass else: @@ -2198,7 +2208,7 @@ def dataLocationAccess(self): else: raise NoViableAltException(self) - self.state = 283 + self.state = 284 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,19,self._ctx) @@ -2238,7 +2248,7 @@ def baseVar(self): self.enterRule(localctx, 56, self.RULE_baseVar) try: self.enterOuterAlt(localctx, 1) - self.state = 285 + self.state = 286 self.match(tlangParser.VAR) except RecognitionException as re: localctx.exception = re @@ -2279,18 +2289,18 @@ def lvalue(self): localctx = tlangParser.LvalueContext(self, self._ctx, self.state) self.enterRule(localctx, 58, self.RULE_lvalue) try: - self.state = 289 + self.state = 290 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,20,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 287 + self.state = 288 self.match(tlangParser.VAR) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 288 + self.state = 289 self.dataLocationAccess() pass @@ -2339,15 +2349,15 @@ def functionCall(self): self.enterRule(localctx, 60, self.RULE_functionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 291 - self.methodCaller() self.state = 292 - self.match(tlangParser.NAME) + self.methodCaller() self.state = 293 - self.match(tlangParser.T__6) + self.match(tlangParser.NAME) self.state = 294 - self.arguments() + self.match(tlangParser.T__6) self.state = 295 + self.arguments() + self.state = 296 self.match(tlangParser.T__8) except RecognitionException as re: localctx.exception = re @@ -2396,31 +2406,31 @@ def methodCaller(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 307 + self.state = 308 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__1 or _la==tlangParser.VAR: - self.state = 302 + self.state = 303 self._errHandler.sync(self) token = self._input.LA(1) if token in [tlangParser.VAR]: - self.state = 297 + self.state = 298 self.match(tlangParser.VAR) pass elif token in [tlangParser.T__1]: - self.state = 298 - self.match(tlangParser.T__1) self.state = 299 - self.expression(0) + self.match(tlangParser.T__1) self.state = 300 + self.expression(0) + self.state = 301 self.match(tlangParser.T__2) pass else: raise NoViableAltException(self) - self.state = 304 + self.state = 305 self.match(tlangParser.T__21) - self.state = 309 + self.state = 310 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2468,21 +2478,21 @@ def functionDeclaration(self): self.enterRule(localctx, 64, self.RULE_functionDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 310 - self.match(tlangParser.T__22) self.state = 311 - self.match(tlangParser.NAME) + self.match(tlangParser.T__22) self.state = 312 - self.match(tlangParser.T__6) + self.match(tlangParser.NAME) self.state = 313 - self.parameters() + self.match(tlangParser.T__6) self.state = 314 - self.match(tlangParser.T__8) + self.parameters() self.state = 315 - self.match(tlangParser.T__18) + self.match(tlangParser.T__8) self.state = 316 - self.strict_ilist() + self.match(tlangParser.T__18) self.state = 317 + self.strict_ilist() + self.state = 318 self.match(tlangParser.T__19) except RecognitionException as re: localctx.exception = re @@ -2524,21 +2534,21 @@ def parameters(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 327 + self.state = 328 self._errHandler.sync(self) _la = self._input.LA(1) if _la==tlangParser.VAR: - self.state = 319 + self.state = 320 self.match(tlangParser.VAR) - self.state = 324 + self.state = 325 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 320 - self.match(tlangParser.T__7) self.state = 321 + self.match(tlangParser.T__7) + self.state = 322 self.match(tlangParser.VAR) - self.state = 326 + self.state = 327 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2585,21 +2595,21 @@ def arguments(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 337 + self.state = 338 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.T__1) | (1 << tlangParser.T__6) | (1 << tlangParser.MINUS) | (1 << tlangParser.PENCOND) | (1 << tlangParser.NOT) | (1 << tlangParser.NUM) | (1 << tlangParser.REAL) | (1 << tlangParser.VAR) | (1 << tlangParser.NAME))) != 0): - self.state = 329 + self.state = 330 self.expression(0) - self.state = 334 + self.state = 335 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.T__7: - self.state = 330 - self.match(tlangParser.T__7) self.state = 331 + self.match(tlangParser.T__7) + self.state = 332 self.expression(0) - self.state = 336 + self.state = 337 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2645,19 +2655,19 @@ def comment(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 339 + self.state = 340 self.match(tlangParser.T__23) - self.state = 343 + self.state = 344 self._errHandler.sync(self) _la = self._input.LA(1) while _la==tlangParser.NAME: - self.state = 340 + self.state = 341 self.match(tlangParser.NAME) - self.state = 345 + self.state = 346 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 346 + self.state = 347 self.match(tlangParser.T__23) except RecognitionException as re: localctx.exception = re @@ -2699,7 +2709,7 @@ def logicOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 348 + self.state = 349 _la = self._input.LA(1) if not(_la==tlangParser.AND or _la==tlangParser.OR): self._errHandler.recoverInline(self) @@ -2758,7 +2768,7 @@ def binCondOp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 350 + self.state = 351 _la = self._input.LA(1) if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << tlangParser.LT) | (1 << tlangParser.GT) | (1 << tlangParser.EQ) | (1 << tlangParser.NEQ) | (1 << tlangParser.LTE) | (1 << tlangParser.GTE))) != 0)): self._errHandler.recoverInline(self) @@ -2818,42 +2828,42 @@ def value(self): localctx = tlangParser.ValueContext(self, self._ctx, self.state) self.enterRule(localctx, 76, self.RULE_value) try: - self.state = 358 + self.state = 359 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,28,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 352 + self.state = 353 self.match(tlangParser.NUM) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 353 + self.state = 354 self.match(tlangParser.VAR) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 354 + self.state = 355 self.array() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 355 + self.state = 356 self.dataLocationAccess() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 356 + self.state = 357 self.functionCall() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 357 + self.state = 358 self.match(tlangParser.REAL) pass From efa22d42ce2a87d73428895de0dbae614bf73c5f Mon Sep 17 00:00:00 2001 From: luthanhar Date: Mon, 21 Apr 2025 03:57:09 +0530 Subject: [PATCH 35/47] grammar change --- ChironCore/ChironAST/builder.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 1b49286..50b83d1 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -178,6 +178,7 @@ def visitValue(self, ctx: tlangParser.ValueContext): return self.visitDataLocationAccess(ctx.dataLocationAccess()) elif ctx.functionCall(): return self.visitFunctionCallExpr(ctx.functionCall()) + def visitFunctionCallExpr(self, ctx: tlangParser.FunctionCallContext): # TODO: Refactoring, this function has similar body as visitFunctionCall @@ -201,6 +202,10 @@ def visitFunctionCallExpr(self, ctx: tlangParser.FunctionCallContext): methodCaller), 1)] + [(ChironAST.ReadReturnCommand([returnLocation]), 1)]) return returnLocation + def visitFunctionCall(self, ctx:tlangParser.FunctionCallContext): + return self.visitFunctionCallExpr(ctx) + + def visitAssignExpr(self, ctx: tlangParser.AssignExprContext): lval = self.visit(ctx.lvalue()) rval = self.visit(ctx.expression()) From 6cc1a55bcde46fa9c048f35b484674b793b87ecc Mon Sep 17 00:00:00 2001 From: Yash Pratap Singh Date: Mon, 21 Apr 2025 05:07:30 +0530 Subject: [PATCH 36/47] [feature] visualize class hierarchy with -ch flag --- ChironCore/chiron.py | 6 + ChironCore/example/demo/class_hierarchy.tl | 74 +++++++++++ ChironCore/interpreter.py | 146 ++++++++++++++++----- 3 files changed, 195 insertions(+), 31 deletions(-) create mode 100644 ChironCore/example/demo/class_hierarchy.tl diff --git a/ChironCore/chiron.py b/ChironCore/chiron.py index 96f9997..acd8ea4 100755 --- a/ChironCore/chiron.py +++ b/ChironCore/chiron.py @@ -195,6 +195,12 @@ def stopTurtle(): default=True, type=bool, ) + cmdparser.add_argument( + "-ch", + "--class_hierarchy", + help="To visualize class inheritance and methods", + action="store_true", + ) args = cmdparser.parse_args() ir = "" diff --git a/ChironCore/example/demo/class_hierarchy.tl b/ChironCore/example/demo/class_hierarchy.tl new file mode 100644 index 0000000..c09a79a --- /dev/null +++ b/ChironCore/example/demo/class_hierarchy.tl @@ -0,0 +1,74 @@ +class :BankAccount { + :__accountNumber = 12345678 + :balance = 0 + + def getBalance(:self) { + return :self.:balance + } + + def deposit(:self, :amt) { + :self.:balance = :self.:balance + :amt + return 0 + } + + def withdraw(:self, :amt) { + if :self.:balance >= :amt [ + :self.:balance = :self.:balance - :amt + return 0 + ] + else [ + return -1 + ] + } +} + + +class :SavingsAccount(:BankAccount) { + :__interestRate = 0.05 + + + def withdraw(:self, :amt) { + if :self.:balance >= :amt [ + :self.:balance = :self.:balance - :amt + return 0 + ] + else [ + return -1 + ] + } + + def addInterest(:self) { + :interest = :self.:balance * :self.:__interestRate + :self.:balance = :self.:balance + :interest + return 0 + } +} + + +class :CheckingAccount(:BankAccount) { + :__overdraftLimit = 500 + + + def withdraw(:self, :amt) { + if :self.:balance + :self.:__overdraftLimit >= :amt [ + :self.:balance = :self.:balance - :amt + return 0 + ] + else [ + return -1 + ] + } +} + + +:saveAcc = new :SavingsAccount() +:saveAcc.deposit(1000) +:saveAcc.addInterest() +:bal1 = :saveAcc.getBalance() +print(:bal1) + +:chkAcc = new :CheckingAccount() +:chkAcc.deposit(200) +:chkAcc.withdraw(600) +:bal2 = :chkAcc.getBalance() +print(:bal2) diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index a5e0171..5ea5d28 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -1,8 +1,10 @@ - from ChironAST import ChironAST from ChironHooks import Chironhooks import turtle import re +from graphviz import Digraph +import tkinter as tk +from PIL import Image, ImageTk Release = "Chiron v5.3" @@ -74,7 +76,7 @@ def sanityCheck(self, irInstr): def interpret(self): pass - def initProgramContext(self, params): + def initProgramContext(params): pass @@ -108,21 +110,17 @@ def __init__(self, irHandler, params): super().__init__(irHandler, params) self.prg = ProgramContext() self.class_list = ClassList() + self.class_hierarchy = {} + self.class_methods = {} + self.class_attributes = {} # Store attributes with defining class + self.class_colors = {} # Hooks Object: if self.args is not None and self.args.hooks: self.chironhook = Chironhooks.ConcreteChironHooks() self.pc = 0 - print("###########################Intermediate Representation (IR):#############") - for index, instruction in enumerate(self.ir): - print(f"{index}: {instruction} | {instruction[0]}") def interpret(self): print("Program counter : ", self.pc) - if not self.ir: - return True - - - stmt, tgt = self.ir[self.pc] print(stmt, stmt.__class__.__name__, tgt) @@ -167,6 +165,8 @@ def interpret(self): if self.pc >= len(self.ir): # This is the ending of the interpreter. + if self.args.class_hierarchy: + self.print_class_hierarchy() self.trtl.write("End, Press ESC", font=("Arial", 15, "bold")) if self.args is not None and self.args.hooks: self.chironhook.ChironEndHook(self) @@ -192,6 +192,16 @@ def handleFunctionDeclaration(self, stmt, tgt): function_name = stmt.name self.function_addresses[function_name + "_" + str(len(stmt.params))] = self.pc + 1 # body of the function starts from next instruction + + # Record method in class_methods if it's a class method + if "@" in stmt.name: + class_name, method_name = stmt.name.split("@") + class_name = class_name.replace(":", "") + arity = len(stmt.params) + if class_name not in self.class_methods: + self.class_methods[class_name] = [] + self.class_methods[class_name].append((method_name, arity)) + return tgt def handleFunctionCall(self, stmt, tgt): @@ -219,39 +229,23 @@ def handleFunctionCall(self, stmt, tgt): # Copying the return values in their respective placeholders def handleReturnRead(self, stmt, tgt): - - print(f"Read Return: {stmt.returnValues}") - cnt=self.call_stack.pop() - rval=stmt.returnValues[0] - rval = str(rval).replace(":", "") - if(cnt==1): + for rval in reversed(stmt.returnValues): + rval = str(rval).replace(":", "") exec(f"self.prg.{rval} = self.call_stack.pop()") - else: - exec(f"self.prg.{rval} = self.call_stack[-{cnt}:]") - self.call_stack=self.call_stack[:-cnt] - return 1 - def handleFunctionReturn(self, stmt, tgt): - - print(f"Function Return: {stmt}") # Restore the previous program context rval_list = [] - cnt=0 for rval in stmt.returnValues: - cnt=cnt+1 rval_value = addContext(rval) exec(f"self.return_value = {rval_value}") rval_list.append(self.return_value) self.prg = self.call_stack.pop() self.pc = self.call_stack.pop() self.call_stack.extend(rval_list) - self.call_stack.append(cnt) - return 0 - # Copying the parameters in their respective placeholders def handleParametersPassing(self, stmt, tgt): for param in reversed(stmt.params): @@ -263,33 +257,48 @@ def handleParametersPassing(self, stmt, tgt): def handleClassDeclaration(self, stmt, tgt): className = stmt.className.replace(":", "") attributes = stmt.attributes # List of attribute assignments + # Handle inheritance if base classes exist if hasattr(stmt, "baseClasses") and stmt.baseClasses: - base_classes = [getattr(self.class_list, str( - b).replace(":", "")) for b in stmt.baseClasses] - base_str = ", ".join([b.__name__ for b in base_classes]) + base_classes = [base.replace(":", "") for base in stmt.baseClasses] + self.class_hierarchy[className] = base_classes + base_classes_for_def = [getattr(self.class_list, str(b).replace(":", "")) for b in stmt.baseClasses] + base_str = ", ".join([b.__name__ for b in base_classes_for_def]) class_header = f"class {className}({base_str}):\n" else: + self.class_hierarchy[className] = [] class_header = f"class {className}:\n" + class_def = class_header init_method = " def __init__(self" # Start of __init__ init_body = " super().__init__()\n" + # Handle normal attributes (non-object attributes) for attr in attributes: attr, target = attr attr_name = str(attr.lvar).replace(":", "") attr_value = addContext(attr.rexpr) if attr.rexpr else "None" init_body += f" self.{attr_name} = {attr_value}\n" + if className not in self.class_attributes: + self.class_attributes[className] = [] + self.class_attributes[className].append((attr_name, attr_value, className)) + # Handle object attributes for objectAttr in stmt.objectAttributes: objectAttr, target = objectAttr lhs = str(objectAttr.target).replace(":", "") init_body += f" self.{lhs} = None\n" + if className not in self.class_attributes: + self.class_attributes[className] = [] + self.class_attributes[className].append((lhs, "None", className)) + init_method += "):\n" # Close the __init__ method signature class_def += init_method class_def += init_body + # Step 1: Execute the class definition (store it inside self.class_list) exec(class_def, globals(), self.class_list.__dict__) + # Step 2: Assign object attributes after class creation for objectAttr in stmt.objectAttributes: objectAttr, target = objectAttr @@ -297,6 +306,7 @@ def handleClassDeclaration(self, stmt, tgt): rhs = addContext(objectAttr.class_name).replace( "self.prg.", "self.class_list.") exec(f"self.class_list.{className}.{lhs} = {rhs}()") + # Inherit methods from base classes inherited_function_addresses = {} if stmt.baseClasses: @@ -306,6 +316,7 @@ def handleClassDeclaration(self, stmt, tgt): new_function_name = f"{stmt.className}@{method_name}" inherited_function_addresses[new_function_name] = address self.function_addresses.update(inherited_function_addresses) + return 1 def handleObjectInstantiation(self, stmt, tgt): @@ -357,3 +368,76 @@ def handleGotoCommand(self, stmt, tgt): ycor = addContext(stmt.ycor) exec("self.trtl.goto(%s, %s)" % (xcor, ycor)) return 1 + + def get_all_methods(self, class_name): + if class_name not in self.class_hierarchy: + return {} + methods = {} + # Add methods defined in this class first (they override inherited ones) + if class_name in self.class_methods: + for method, arity in self.class_methods[class_name]: + methods[(method, arity)] = class_name + # Add inherited methods from base classes, in order + for base in self.class_hierarchy[class_name]: + base_methods = self.get_all_methods(base) + for (method, arity), defining_class in base_methods.items(): + if (method, arity) not in methods: + methods[(method, arity)] = defining_class + return methods + + def get_all_attributes(self, class_name): + if class_name not in self.class_hierarchy: + return [] + attributes = self.class_attributes.get(class_name, []) + # Add inherited attributes from base classes, avoiding duplicates + for base in self.class_hierarchy[class_name]: + base_attributes = self.get_all_attributes(base) + for attr_name, attr_value, defining_class in base_attributes: + if not any(a[0] == attr_name for a in attributes): + attributes.append((attr_name, attr_value, defining_class)) + return attributes + + def print_class_hierarchy(self): + dot = Digraph(comment='Class Hierarchy') + dot.attr(rankdir='BT') + + # Generate random colors for each class + import random + for class_name in self.class_hierarchy: + if class_name not in self.class_colors: + self.class_colors[class_name] = "#{:06x}".format(random.randint(0, 0xFFFFFF)) + + for class_name in self.class_hierarchy: + methods = self.get_all_methods(class_name) + attributes = self.get_all_attributes(class_name) + label = f"<{class_name}
" # Newline after class name + # Methods first + for (method, arity), defining_class in sorted(methods.items()): + class_color = self.class_colors.get(defining_class, "#000000") + label += f"{method}({arity})
" + # Blank line + label += "

" + # Attributes next + for attr_name, attr_value, defining_class in attributes: + class_color = self.class_colors.get(defining_class, "#000000") + label += f"{attr_name} = {attr_value}
" + label += ">" + dot.node(class_name, label=label, shape='record', color=self.class_colors[class_name], style="solid") + + for class_name, bases in self.class_hierarchy.items(): + for base in bases: + dot.edge(base, class_name) + + dot.render('class_hierarchy', format='png', cleanup=True) + self.display_graph('class_hierarchy.png') + + def display_graph(self, image_path): + screen = self.t_screen + root = screen._root + top = tk.Toplevel(root) + top.title("Class Hierarchy Diagram") + img = Image.open(image_path) + photo = ImageTk.PhotoImage(img) + panel = tk.Label(top, image=photo) + panel.pack(side="bottom", fill="both", expand="yes") + panel.image = photo From 74ee23bbabed01086c4a5a82150a20ccfb308ba5 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Mon, 21 Apr 2025 07:00:36 +0530 Subject: [PATCH 37/47] correcting object initialisation --- ChironCore/example/kachuapur3.tl | 77 ++++++++++++++++++++++++++++---- ChironCore/interpreter.py | 21 ++++----- 2 files changed, 80 insertions(+), 18 deletions(-) diff --git a/ChironCore/example/kachuapur3.tl b/ChironCore/example/kachuapur3.tl index 81c51ba..1d1e8fe 100644 --- a/ChironCore/example/kachuapur3.tl +++ b/ChironCore/example/kachuapur3.tl @@ -1,13 +1,74 @@ -class :Point { - :x = 6 +class :BankAccount { + :__accountNumber = 12345678 + :balance = 0 + def getBalance(:self) { + return :self.:balance + } + + def deposit(:self, :amt) { + :self.:balance = :self.:balance + :amt + return 0 + } + + def withdraw(:self, :amt) { + if :self.:balance >= :amt [ + :self.:balance = :self.:balance - :amt + return 0 + ] + else [ + return -1 + ] + } +} + + +class :SavingsAccount(:BankAccount) { + :__interestRate = 0.05 + + + def withdraw(:self, :amt) { + if :self.:balance >= :amt [ + :self.:balance = :self.:balance - :amt + return 0 + ] + else [ + return -1 + ] + } + + def addInterest(:self) { + :interest = :self.:balance * :self.:__interestRate + :self.:balance = :self.:balance + :interest + return 0 + } } -class :Circle { - :point = new :Point() - + +class :CheckingAccount(:BankAccount) { + :__overdraftLimit = 500 + + + def withdraw(:self, :amt) { + if :self.:balance + :self.:__overdraftLimit >= :amt [ + :self.:balance = :self.:balance - :amt + return 0 + ] + else [ + return -1 + ] + } } -:point = new :Point() -:circle = new :Circle() -print(:circle.:point.:x) + +:saveAcc = new :SavingsAccount() +:saveAcc.deposit(1000) +:saveAcc.addInterest() +:bal1 = :saveAcc.getBalance() +print(:bal1) + +:chkAcc = new :CheckingAccount() +:chkAcc.deposit(200) +:chkAcc.withdraw(600) +:bal2 = :chkAcc.getBalance() +print(:bal2) \ No newline at end of file diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index a5e0171..aff1cf5 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -284,20 +284,21 @@ def handleClassDeclaration(self, stmt, tgt): for objectAttr in stmt.objectAttributes: objectAttr, target = objectAttr lhs = str(objectAttr.target).replace(":", "") - init_body += f" self.{lhs} = None\n" + rhs_classname = addContext(objectAttr.class_name).replace("self.prg.", "") + + init_body += f" self.{lhs} = class_list.{rhs_classname}()\n" + # init_body += f" self.{lhs} = None\n" + init_method += "):\n" # Close the __init__ method signature class_def += init_method class_def += init_body # Step 1: Execute the class definition (store it inside self.class_list) - exec(class_def, globals(), self.class_list.__dict__) - # Step 2: Assign object attributes after class creation - for objectAttr in stmt.objectAttributes: - objectAttr, target = objectAttr - lhs = str(objectAttr.target).replace(":", "") - rhs = addContext(objectAttr.class_name).replace( - "self.prg.", "self.class_list.") - exec(f"self.class_list.{className}.{lhs} = {rhs}()") - # Inherit methods from base classes + context = globals().copy() + context["class_list"] = self.class_list + exec(class_def, context,self.class_list.__dict__) + + # self.class_list.__dict__[className] = context[className] + inherited_function_addresses = {} if stmt.baseClasses: for function_name, address in self.function_addresses.items(): From 4828f9d0df74077ccdb08a257877bc4663ea4c46 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Mon, 21 Apr 2025 07:14:31 +0530 Subject: [PATCH 38/47] object initialisation inside class --- ChironCore/interpreter.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 85cf5c9..888ece8 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -287,43 +287,22 @@ def handleClassDeclaration(self, stmt, tgt): for objectAttr in stmt.objectAttributes: objectAttr, target = objectAttr lhs = str(objectAttr.target).replace(":", "") -<<<<<<< HEAD rhs_classname = addContext(objectAttr.class_name).replace("self.prg.", "") init_body += f" self.{lhs} = class_list.{rhs_classname}()\n" # init_body += f" self.{lhs} = None\n" -======= - init_body += f" self.{lhs} = None\n" - if className not in self.class_attributes: - self.class_attributes[className] = [] - self.class_attributes[className].append((lhs, "None", className)) ->>>>>>> origin/armeet init_method += "):\n" # Close the __init__ method signature class_def += init_method class_def += init_body # Step 1: Execute the class definition (store it inside self.class_list) -<<<<<<< HEAD context = globals().copy() context["class_list"] = self.class_list exec(class_def, context,self.class_list.__dict__) # self.class_list.__dict__[className] = context[className] -======= - exec(class_def, globals(), self.class_list.__dict__) - - # Step 2: Assign object attributes after class creation - for objectAttr in stmt.objectAttributes: - objectAttr, target = objectAttr - lhs = str(objectAttr.target).replace(":", "") - rhs = addContext(objectAttr.class_name).replace( - "self.prg.", "self.class_list.") - exec(f"self.class_list.{className}.{lhs} = {rhs}()") - - # Inherit methods from base classes ->>>>>>> origin/armeet inherited_function_addresses = {} if stmt.baseClasses: for function_name, address in self.function_addresses.items(): From 7f40035ac715878041f8c6a8368809fe204393a3 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Mon, 21 Apr 2025 07:15:50 +0530 Subject: [PATCH 39/47] demo example upload --- ChironCore/example/kachuapur3.tl | 86 ++++++++------------------------ 1 file changed, 22 insertions(+), 64 deletions(-) diff --git a/ChironCore/example/kachuapur3.tl b/ChironCore/example/kachuapur3.tl index 1d1e8fe..70e7f29 100644 --- a/ChironCore/example/kachuapur3.tl +++ b/ChironCore/example/kachuapur3.tl @@ -1,74 +1,32 @@ -class :BankAccount { - :__accountNumber = 12345678 - :balance = 0 - - def getBalance(:self) { - return :self.:balance - } - - def deposit(:self, :amt) { - :self.:balance = :self.:balance + :amt +class :Point { + :x = 6 + :y = 4 + def draw(:self) + { + print(:self.:x) return 0 } - - def withdraw(:self, :amt) { - if :self.:balance >= :amt [ - :self.:balance = :self.:balance - :amt - return 0 - ] - else [ - return -1 - ] - } -} - - -class :SavingsAccount(:BankAccount) { - :__interestRate = 0.05 - - - def withdraw(:self, :amt) { - if :self.:balance >= :amt [ - :self.:balance = :self.:balance - :amt - return 0 - ] - else [ - return -1 - ] - } - - def addInterest(:self) { - :interest = :self.:balance * :self.:__interestRate - :self.:balance = :self.:balance + :interest + def drawy(:self) + { + print(:self.:y) return 0 } } - -class :CheckingAccount(:BankAccount) { - :__overdraftLimit = 500 - - - def withdraw(:self, :amt) { - if :self.:balance + :self.:__overdraftLimit >= :amt [ - :self.:balance = :self.:balance - :amt - return 0 - ] - else [ - return -1 - ] - } +class :Circle { + :point = new :Point() + } +:point = new :Point() +:circle = new :Circle() +:circle1 = new :Circle() +print(:circle.:point.:x) +:circle.:point.:x = :circle.:point.:y = -100 +print(:point.:x) +print(:circle.:point.:x) +print(:circle1.:point.:x) -:saveAcc = new :SavingsAccount() -:saveAcc.deposit(1000) -:saveAcc.addInterest() -:bal1 = :saveAcc.getBalance() -print(:bal1) +:circle.:point.draw() -:chkAcc = new :CheckingAccount() -:chkAcc.deposit(200) -:chkAcc.withdraw(600) -:bal2 = :chkAcc.getBalance() -print(:bal2) \ No newline at end of file +:circle1.:point.drawy() \ No newline at end of file From 2da18687d82350f0d38e86e6bd4ae146bc6d903b Mon Sep 17 00:00:00 2001 From: luthanhar Date: Mon, 21 Apr 2025 07:35:30 +0530 Subject: [PATCH 40/47] class herirrarchy changes --- ChironCore/class_hierarchy.png | Bin 0 -> 7839 bytes ChironCore/interpreter.py | 23 +++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 ChironCore/class_hierarchy.png diff --git a/ChironCore/class_hierarchy.png b/ChironCore/class_hierarchy.png new file mode 100644 index 0000000000000000000000000000000000000000..f7ecdd75d3b7cb1b907600e69b7a16eea7e0c2ea GIT binary patch literal 7839 zcmch6bx@RH*Y^qtN(%zgA_CIV%}ST_0)m9nh;+w-NT?tsEJ&Ah$I{*1C9x>IfHW*D zEPOZ5H}lLl^Syt+v$K28TyyW4bDjL1-}$Dcp+tmFgAW3Mh*Xs2b$}-Z_~tyo1%72J zpZEa}Tyr%gdC=|MC$l9#4g_L=sL0Deyi@-z`}jjPS}u;plAx@#Y7ekfUnTUjMtpku zREPU>0rxWn`HmtjZn$ZSV_PxS4ZeZ>TeXPkT7B&$EgYHB2Vdh&44-|)!g^1lCVM`x zCoqPw=x>jCNE$Z~l6r7;wi+$wmas*5nQkMt<B~E4zJ>;2iTHczL(`r)c+dB{9XtHoY^kauzRgQ zMWQ8-AM{1hTVT*4RznGT_JOQ%-}2N`ex#-v|EuzDaa}RqR_gq0IwcrJ z!l?1#1II{;$W~<^gT>BtVTnmo!uq;p7!hsnZ0TEG??85T_7cPDFzp;gy(TVAFh(#- zt6*XAp$ng?cLu_|GSkjz-7St){fU4zp(^|4ND38d&1t1It?d?b-~x^!JyYlmmQI+S zhJd2z#K;Uc&wLGQKT_YxskRwoWn*LeKpWlH_139{VupLZ$%}VP@`Nx;>#LOC`Adsl zLR09O-gN*Nv^!h6wwdCT*W8@ybF#@7cylc-D#1inY>JEVJ7~dcKbtcn3BmTAuXz8M zg5v06EjlMY+h#1C%ebEOlSz{&pXc72-e^WfBw6$2W(pylXbiQ0_2EI_ZAyN+Z#WUH z@JqYN=K-jum3x`-=Hr<%pkKMUu?eiv3}us! zx@weMQ!)z#_dZ(fuVRu5D~O_(P?QFvmfY~a(s3eo&?t)4k7wC=A~cb7lHM`uDZ+g2 z+gi1b%Y&(6ZsUSPi9I)i%?@B+?g89qUrW+%`eobZ|{oRjfaGDURV>yMStt zI++J8D)UgZfEZmAhtl#~xmoneL7!zf&xbF>^q~0`KM@eF+{Ug!iIs|q3Jz9KGNs|y z2>q4<|9(p?f*QL67FN&yAB9kXK%J1NxoNMHAFdEVi?@FR+w8&o*lriks|D{ zkVFu*dH;8F*U(tl^PaQzVuSL{qdrC(Al~B>5`F;E6cuqxjo?K!`$Qs3pQe!Ozil#d zGc!Nctpub%ug>|r_KkF=#6%)ti_$bl44d*C>}t zj4j~T8~Ep0Z9m5&?y(axVqFZ!pfLehK_Jhjmf3Sd82b7OA6h__gQ6OAtTSlzFrd9l z>y;hyRdd*3kR+4*@{haP@_ajVoch1zrZ6s(_XTm4vx1oBbwef(v6luL{^ydbykl(9 zm92{l&pO@@zsoSv=k!N&dJ`c9=%R$8 zj1XDyr0;Kay{p3Y``gonP0b*KC^6~An(Ao_E@b!}dp<0uO;yLb{?>7dYme8&>KHHMEH?vm!sZOlB4o~bVzs0Rp!Vb@ zgxVzj^z%IiL20mrzS2Ar+^!L%Tpz{~UJ3Dy<0*gH-&o2J;Auj(i1HOnrn0mR#8b4W zUul6xQza@*)WVV+={tq?W*M7f+wEuPl@-aESGH33zvQ#hZcoq3zE_En`qEh%9+gCS zzJ+GzA#m~do{9JMXaO4ETZsFSGE#wah}zBKO!p&OXY+bKxd~3}J1&t)UQE7xPKYj|6S8hG4fISa8m0^dVVy~SgsT-cVN^t~j6Vl-;Ij!w^p?)C#9E3ttCPHi z1YRUF2;-iKV_b)(@seMzW#!d0O%J0T7#eHpV)kB+H>8D9B3Y}v!h%Z`1jxH^MPImu z9(s2P1>_HLpEh=?YTLaan@+}Mv0_p*%?Qbp8GR3q)cN39RH%ZBA08av!~$-uukT^m zHgIy8%7vb0&gCY`qn>jhoREtn`0Xr6MM0t)dt>IX(}!lHfN8Zqft?%e0nKQWacNtn zpo=5#N$@NcblWmTm5svhMHuFEQ+G0I393qYwPE~q;yS@IS!+K&s2MM`FU$EyRCV={h{SkIz4hU>mBy^K-%n?Id`#2g%bq7^ zjMGEC6U`vJDBL%d6C*^JJ;EI;i(L{^)l?>8Mv|D{&z7qCZOI&EL`{V36Z|lLImdoe z2{7>pyIc_h;bLIMb2zWaev?z;jfy&dg=ALCTf%b>)G6@TYkw(8WW~Q)u@4^yi|b9rCtAn)pu0{3*S?OBHU8Xc??Bk)1g!?%h$e9=SLs?{GnI5Evceu_WIfFJJV6b0)qSlM+nx((w_Xd}lG#=xK89pYK z%z1?NsH;4uCBgO!b?Oq*5E?IS2{pOG!1nv<9N%Z3(#bGB2pe)PyE^Q#Vxkj{RGVbk zUfa0b%E&is3jpdPt9o*G7YX?L%7M+r;a@@;!52UFn^^@OXCV7yndzi_<0&}x<@3a+ zg6o&^+ng*p%Kf!EcOz6UQOT}GzfzQ|Xe*2a6H44Bn!kN3ulvIL;DCpHEulljcwtFC z!kQKBRafa7k>cd(b9ou_9QUlMa(l>C-@)Z1A}jwk4)3hysOuhM+CqBS44#QqpQFg1 z3WYi{UyrI|boODFkiOcfm)I9ftW3vVn&~7hHTBY>DH4InvbcwPUS+|@w$GFk_HlDK z>2;bo4901||E~R0|1qsob8JU2p4+m=9MH>fQq!~Q^A>9Cy3)K515SZgi!=wj=46SP zn(D%b>n)K3oP^nsdNUI(I?JW6@%;{PT6E8-lGm+6;r9kU>MtXojv%?{IB8R0X{y3a06fsk5Fo&)jOP5z5SrzAiO>`@th9_(Zb+u^;9wOyeV3?s0<5;D&`!8~eerwqt5xN7OrE``Ais?WXhn zw%iK6>P^k^2Ab;~E<;Y`pPVl`-DN?#|FH_t_PYURP>Z|2FfC79 zx!x4HyL6dJQ@UF~Fn|%A=S;j}ladBP9+F@5fp27@8KhqD@RZHCX+B=YkqWswH}I-9 zIb5r0B0;;%6D@hRtQSNlV&f5m##^C&TnQ&_J>ESO1~2{2_X@1m`l7d5ul6JSM@L7k z=gLe@4^}e1k+V$}>ay*(-3IWqoa!+6tUo$GSQ-1lqE;l?yFL)tfI|4)DYx9@wM7zm zfh{H`)_gjt2Htetz>Y3Fp0ez64$~4d6Z(=-u+5!#$N2KUD9=hbKN1?o_AQ z0fj%I-ec)f^~?JN$ZIMbV|))g@F+6Hz4l8IxD2zUuMg#5 zFjy`~$oJG1?yy+fFRiAkIt^4ticAnNMbN_SrdV_1b(EqRA{XYe6(ZtwRAGsU#Yby> zO0_EL>UxaOQ|;y3r$T~x9~)_Og+fSe^QNAOZwJfdrYHO8lrC+DUqYW|j#8fj zCI75DLz5#~1X8-DI-Zd+g@n)wf7H6XyoA?|EiDiq z`fcq;m7xUgVz|1muWvA2M>$Ly3LX45R~eavN)*4``jT5?=Yf{?18VrJrQZuL&L4X} zL^QVzN^$=48b??6PhF?A4XQK-Wx~+*e-B+u4xGiFJEe~o)8Ikvd4x9!L6T24V3nM4##2o#_rr+y7s=S>p5x1{ej-3r#A0hYE zU&}QY>TU}u!Mx?Ee5eldwK{&^>*n&uX+|0}xa?vmvnZq*mX%pmNLnP8JYl|I4r8b%cSZg%j-b|?+69fa;BB!3KyNG+gz~CLwxMF`# zLfF|%%SUHb0r_vZX@Y%!KUr!zPI=oRZa6SP&`Y?J+7*B>qY01{06I5}b~(h{m=Vys z{>jW>m)IFM8zRY76Q|zpol)+_ooV$-qh8JAr+S0@NUrQstxH@3?@qOY)v_zWb7Re8 zU7CmVBLs(s^@@6Be%6TQM{}m$s$2spY&_OP$ELcbGBMYkPc6RWzbnsfGrPNgi=DF& zbWz{>=34&D^vB(mHEAr>c|!`4|9|e{f1oq|caQSqsa^@vDGUz$nN;#wIw#n#MZ|2c z${SK$qz7k_$Bxm^jMNA&(C}oz`LNxDkNUFY^Gz&vUXydf{89t|R2~O9b3yvU+BFo#^C!x@C5JG-XBNyP zM?GSl=z0CX)~RQ{WddF{Hiu7neWeS|Z^o29n@%S`9vK~+2J=tyS1c@QxU{G|p!lK_ zYG+F*fMV5ii+OK5oKveUY0uafsBkmHTUF4%yJY2a5SOshPw^)tv+bWDBWRHSSU>9&ei5n5w zD%B|RJDj+%=Em*(=rvDGx*aZ>CWU8*B6j;RVU;Y~JyO`_3b^fYna+eVR8hbl`iSSv=3f>Z-zcP7=n8 zn=Y)C)zQ&3@gJRCnNA9Ag*R{id{cT-6pqs}idpdF+{IcsNeX1f@7M4PwaAj~ z70o}1b>aqs;(B^1LS;k1&Z0hKBEg<{v6T3ujqGK_-pdxngd=`yG1ikxCppU%ueVO` zYz|2SPluJ*d+-LvKrd_d*rg9k%>h+$e>PT3))RgDyD6=$ejp%aO*>*yI{|kcwHoY6 zXlH1?xJ=oysJ)NkL!fng-v;7qf`BTgfkm{m1h8CB`zshAv;_FeX*TmCgvxz<^W^JCtcKJ_Sq97ZE5UyS1G72>XjH+dSR;h~`Mke5!CtAd6IZnEuw5 zuO#HF(xvTtTcZu}5yD8&JZ1f1P_J8TvS})rN!PisC(a+|7a2rB^cN4`O@7zjb$?ll z^G@?66-e&8k@#%Y^N%=?3Zq=VaM8ZTUgG%2egb0!uJZM z?)S-^o8r@Q7BgYi4rNCuz@6|J3X36Sv37f6f2>@St{`oksQ;yfvzq68Y-9V1Sw2V|Y{{(*t_3*5dR&Yd;n*?RJb z)IJ46j5ivUTUp*7qI`)ZzAvKwGQm~)UoUPY6J zyNqr%^ohr>6+Ngs=3_(h2?|Dq9ACCvK|z!kv##($a_J45SSKma)RLP||G9wheb4Ig zI^t0CWP6_Ic}16;OO9k(8aK7y0?mKw+h#vZ36wtc@8cSKCi?=A<5O^L#ro#UgN(%W$Dm>E~h%t zb1|$Kjix_X@oM#g@lz2N&kB>L@fOZ1ti>B#&dk1wT40pa-)Jn0F@TcK7cVh6sYlTC zB{BroMB)VU8^>p=1}K z&O-UxUBonC)MGC>ck*A!!n@v(hIFC&onzzMgwwbCoVVm%BhZ|EtmaLV&XQj%GCu-^Ojzby- zzm-Q|fE9+W^EC1J*dgO%SMb{V{?~yApd#puvU7oy#E&d5#@=`+N zH=bl3%&;rbvRvX_jRYzK5RfOg|HwaJL?6=j3()+%S=32Ft1<;b>q5%@ai8v3N^J=< zls_Ytyd|I@PGPb>Y?KUd?tF?VtC`5Rzj(7;T|$VoutEA#nK_ZvNuG9o|Atp0a`NeH zQ=Up8b+Xs_p#v9uEU?l%ZTyA-*VzL189XE1LnnSLK*9SitmtJ6m zPMq?qk?9+nR+jO~NU;Dss_b;-H{*eIb4m>o@^!?NI&nnb8Ip$qqe`0@oK5M#-!G}N z$BWAOpZ!Bl>^OP(A(uvFw}$MIfAN@hDnkSh>h=x+u0zMytC9>qsDrc>kEFsmlsu8G zn>#qJqC2Z04Ty$ci@Hf|C8^nyqyUAJT1H9|sa||$@lczQ<@t8`&c}_S(TQ>}FgThb-~H}Hz@@ZSuwS)$UnobpoHyP0OS2!$lIBJV8TMj|vb8y1};Wu{r3 zTU!_Km$;ZOZmqvJdbUVJ@`W;;>YP`@bA0X*XFO=TN5!dW>agCA{Q&1NBbNt1@*JY? z6f3ALYeq(Pn)oZ_qKj4`K0eg@=I@l7H{8~Gb(uv2po@Bk;|yrUjzN?qFKp&PO2g|Z zvV!gpAEGIdioJyDn;8VE1HAZ(tVs|4@2KMBH=Nuk?7IGMi7NeTrkjLMr2e*UXHlcH ziG!sepJEF*<3H2NEJvKKZ!>;Ar#m80&*Pr4W6$InkD^J&<1YeatE({;RE~sU&Lf!3 zKC8X4vnhbU7W(bD-^2|cboh|We9*<4YTN#qcaVALd?O4c64($o#KR|0ksm;2fe%&P ze(O1RT5)s~IC$v}i&qVpLb#`X#A=zqubs!(8wOVst**DhA5|HL7S z;I_JAByG9N;f)SkP^S4s`-x3=>9<95!Cmm%HS-QC4Tc6zqPSr@HutB0^%mg>BqB)^5tWb+jyMnaMdG`@<*9%kb8OFjCN7xYc#wa?U3JQ1RBr#jiM z=;wcDb`f0xH2Ksn^SNMdc@t%2^|t@aAZay&FI@zA+q>3iShAnUZtHX=qkQhmaIr>K zcImoHDAbUCi;2l}S{xkC$cRD4ger%Gppc=Y9%}#Hy#9APk~cVUb(Oa{VLIVI zs<08j!$DMu!a^8Q2~Fh}KVN_RO`Cl?l$0pt6#4&dRQT?lkefUJwk?-nx16ER!qcBi RfQ>UqML|QpO!nR9{{u);vqAs> literal 0 HcmV?d00001 diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 888ece8..00e7bf6 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -229,21 +229,36 @@ def handleFunctionCall(self, stmt, tgt): # Copying the return values in their respective placeholders def handleReturnRead(self, stmt, tgt): - for rval in reversed(stmt.returnValues): - rval = str(rval).replace(":", "") + + print(f"Read Return: {stmt.returnValues}") + cnt=self.call_stack.pop() + rval=stmt.returnValues[0] + rval = str(rval).replace(":", "") + if(cnt==1): exec(f"self.prg.{rval} = self.call_stack.pop()") + else: + exec(f"self.prg.{rval} = self.call_stack[-{cnt}:]") + self.call_stack=self.call_stack[:-cnt] + return 1 + def handleFunctionReturn(self, stmt, tgt): + + print(f"Function Return: {stmt}") # Restore the previous program context rval_list = [] + cnt=0 for rval in stmt.returnValues: + cnt=cnt+1 rval_value = addContext(rval) exec(f"self.return_value = {rval_value}") rval_list.append(self.return_value) self.prg = self.call_stack.pop() self.pc = self.call_stack.pop() self.call_stack.extend(rval_list) + self.call_stack.append(cnt) + return 0 # Copying the parameters in their respective placeholders @@ -290,6 +305,10 @@ def handleClassDeclaration(self, stmt, tgt): rhs_classname = addContext(objectAttr.class_name).replace("self.prg.", "") init_body += f" self.{lhs} = class_list.{rhs_classname}()\n" + if className not in self.class_attributes: + self.class_attributes[className] = [] + self.class_attributes[className].append((lhs, f"{rhs_classname}()", className)) + # init_body += f" self.{lhs} = None\n" init_method += "):\n" # Close the __init__ method signature From 8bf84d7c890926eb5dd0dba3f5bd40032287c38a Mon Sep 17 00:00:00 2001 From: manandraj20 Date: Mon, 21 Apr 2025 10:10:18 +0530 Subject: [PATCH 41/47] added new issues --- ChironCore/example/issues.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChironCore/example/issues.txt b/ChironCore/example/issues.txt index 7248de6..016a030 100644 --- a/ChironCore/example/issues.txt +++ b/ChironCore/example/issues.txt @@ -4,7 +4,7 @@ 4. Setting objects to N0ne in declaration is not done yet 5. instruction_list can contain both function declaration and classDeclaration this can cause problems 6. Multiple class inheritance is not yet supported! [fixed] -7. return is compulsory in function declaration +7. return is compulsory in function declaration with at least one return value 8. Solution to Avoid Unexpected Changes in Mutable Class Variables: use __init__ method during class declaration [fixed] 9. Writing self is compulsory in methods of class parameters 10. class must have at least one assignment statement [fixed] @@ -16,6 +16,7 @@ 16. commenting now supported [fixed] 17. first all the declaration will be processed and then the instructions! 18. Strictly enforce the keywords like return and def to not be used as function of class names +19. There should be at least one instruction apart from function and class definitions in the program From e579edb33136b3038cf830450b6ab53b81b17b92 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Mon, 21 Apr 2025 12:41:41 +0530 Subject: [PATCH 42/47] private attributes in ch diagram --- ChironCore/class_hierarchy.png | Bin 7839 -> 114 bytes ChironCore/example/demo/class_hierarchy.tl | 12 +++- ChironCore/interpreter.py | 62 +++++++++++++++------ 3 files changed, 57 insertions(+), 17 deletions(-) diff --git a/ChironCore/class_hierarchy.png b/ChironCore/class_hierarchy.png index f7ecdd75d3b7cb1b907600e69b7a16eea7e0c2ea..bcaf83aaf3dd108d317bd69727e2a778cfb11d12 100644 GIT binary patch delta 102 zcmbPlTcp?-;OEZECB?BA+OE2+vSno8KF?-Ub*Cs4sF%Uh)z4*}Q$iB}Db^gX literal 7839 zcmch6bx@RH*Y^qtN(%zgA_CIV%}ST_0)m9nh;+w-NT?tsEJ&Ah$I{*1C9x>IfHW*D zEPOZ5H}lLl^Syt+v$K28TyyW4bDjL1-}$Dcp+tmFgAW3Mh*Xs2b$}-Z_~tyo1%72J zpZEa}Tyr%gdC=|MC$l9#4g_L=sL0Deyi@-z`}jjPS}u;plAx@#Y7ekfUnTUjMtpku zREPU>0rxWn`HmtjZn$ZSV_PxS4ZeZ>TeXPkT7B&$EgYHB2Vdh&44-|)!g^1lCVM`x zCoqPw=x>jCNE$Z~l6r7;wi+$wmas*5nQkMt<B~E4zJ>;2iTHczL(`r)c+dB{9XtHoY^kauzRgQ zMWQ8-AM{1hTVT*4RznGT_JOQ%-}2N`ex#-v|EuzDaa}RqR_gq0IwcrJ z!l?1#1II{;$W~<^gT>BtVTnmo!uq;p7!hsnZ0TEG??85T_7cPDFzp;gy(TVAFh(#- zt6*XAp$ng?cLu_|GSkjz-7St){fU4zp(^|4ND38d&1t1It?d?b-~x^!JyYlmmQI+S zhJd2z#K;Uc&wLGQKT_YxskRwoWn*LeKpWlH_139{VupLZ$%}VP@`Nx;>#LOC`Adsl zLR09O-gN*Nv^!h6wwdCT*W8@ybF#@7cylc-D#1inY>JEVJ7~dcKbtcn3BmTAuXz8M zg5v06EjlMY+h#1C%ebEOlSz{&pXc72-e^WfBw6$2W(pylXbiQ0_2EI_ZAyN+Z#WUH z@JqYN=K-jum3x`-=Hr<%pkKMUu?eiv3}us! zx@weMQ!)z#_dZ(fuVRu5D~O_(P?QFvmfY~a(s3eo&?t)4k7wC=A~cb7lHM`uDZ+g2 z+gi1b%Y&(6ZsUSPi9I)i%?@B+?g89qUrW+%`eobZ|{oRjfaGDURV>yMStt zI++J8D)UgZfEZmAhtl#~xmoneL7!zf&xbF>^q~0`KM@eF+{Ug!iIs|q3Jz9KGNs|y z2>q4<|9(p?f*QL67FN&yAB9kXK%J1NxoNMHAFdEVi?@FR+w8&o*lriks|D{ zkVFu*dH;8F*U(tl^PaQzVuSL{qdrC(Al~B>5`F;E6cuqxjo?K!`$Qs3pQe!Ozil#d zGc!Nctpub%ug>|r_KkF=#6%)ti_$bl44d*C>}t zj4j~T8~Ep0Z9m5&?y(axVqFZ!pfLehK_Jhjmf3Sd82b7OA6h__gQ6OAtTSlzFrd9l z>y;hyRdd*3kR+4*@{haP@_ajVoch1zrZ6s(_XTm4vx1oBbwef(v6luL{^ydbykl(9 zm92{l&pO@@zsoSv=k!N&dJ`c9=%R$8 zj1XDyr0;Kay{p3Y``gonP0b*KC^6~An(Ao_E@b!}dp<0uO;yLb{?>7dYme8&>KHHMEH?vm!sZOlB4o~bVzs0Rp!Vb@ zgxVzj^z%IiL20mrzS2Ar+^!L%Tpz{~UJ3Dy<0*gH-&o2J;Auj(i1HOnrn0mR#8b4W zUul6xQza@*)WVV+={tq?W*M7f+wEuPl@-aESGH33zvQ#hZcoq3zE_En`qEh%9+gCS zzJ+GzA#m~do{9JMXaO4ETZsFSGE#wah}zBKO!p&OXY+bKxd~3}J1&t)UQE7xPKYj|6S8hG4fISa8m0^dVVy~SgsT-cVN^t~j6Vl-;Ij!w^p?)C#9E3ttCPHi z1YRUF2;-iKV_b)(@seMzW#!d0O%J0T7#eHpV)kB+H>8D9B3Y}v!h%Z`1jxH^MPImu z9(s2P1>_HLpEh=?YTLaan@+}Mv0_p*%?Qbp8GR3q)cN39RH%ZBA08av!~$-uukT^m zHgIy8%7vb0&gCY`qn>jhoREtn`0Xr6MM0t)dt>IX(}!lHfN8Zqft?%e0nKQWacNtn zpo=5#N$@NcblWmTm5svhMHuFEQ+G0I393qYwPE~q;yS@IS!+K&s2MM`FU$EyRCV={h{SkIz4hU>mBy^K-%n?Id`#2g%bq7^ zjMGEC6U`vJDBL%d6C*^JJ;EI;i(L{^)l?>8Mv|D{&z7qCZOI&EL`{V36Z|lLImdoe z2{7>pyIc_h;bLIMb2zWaev?z;jfy&dg=ALCTf%b>)G6@TYkw(8WW~Q)u@4^yi|b9rCtAn)pu0{3*S?OBHU8Xc??Bk)1g!?%h$e9=SLs?{GnI5Evceu_WIfFJJV6b0)qSlM+nx((w_Xd}lG#=xK89pYK z%z1?NsH;4uCBgO!b?Oq*5E?IS2{pOG!1nv<9N%Z3(#bGB2pe)PyE^Q#Vxkj{RGVbk zUfa0b%E&is3jpdPt9o*G7YX?L%7M+r;a@@;!52UFn^^@OXCV7yndzi_<0&}x<@3a+ zg6o&^+ng*p%Kf!EcOz6UQOT}GzfzQ|Xe*2a6H44Bn!kN3ulvIL;DCpHEulljcwtFC z!kQKBRafa7k>cd(b9ou_9QUlMa(l>C-@)Z1A}jwk4)3hysOuhM+CqBS44#QqpQFg1 z3WYi{UyrI|boODFkiOcfm)I9ftW3vVn&~7hHTBY>DH4InvbcwPUS+|@w$GFk_HlDK z>2;bo4901||E~R0|1qsob8JU2p4+m=9MH>fQq!~Q^A>9Cy3)K515SZgi!=wj=46SP zn(D%b>n)K3oP^nsdNUI(I?JW6@%;{PT6E8-lGm+6;r9kU>MtXojv%?{IB8R0X{y3a06fsk5Fo&)jOP5z5SrzAiO>`@th9_(Zb+u^;9wOyeV3?s0<5;D&`!8~eerwqt5xN7OrE``Ais?WXhn zw%iK6>P^k^2Ab;~E<;Y`pPVl`-DN?#|FH_t_PYURP>Z|2FfC79 zx!x4HyL6dJQ@UF~Fn|%A=S;j}ladBP9+F@5fp27@8KhqD@RZHCX+B=YkqWswH}I-9 zIb5r0B0;;%6D@hRtQSNlV&f5m##^C&TnQ&_J>ESO1~2{2_X@1m`l7d5ul6JSM@L7k z=gLe@4^}e1k+V$}>ay*(-3IWqoa!+6tUo$GSQ-1lqE;l?yFL)tfI|4)DYx9@wM7zm zfh{H`)_gjt2Htetz>Y3Fp0ez64$~4d6Z(=-u+5!#$N2KUD9=hbKN1?o_AQ z0fj%I-ec)f^~?JN$ZIMbV|))g@F+6Hz4l8IxD2zUuMg#5 zFjy`~$oJG1?yy+fFRiAkIt^4ticAnNMbN_SrdV_1b(EqRA{XYe6(ZtwRAGsU#Yby> zO0_EL>UxaOQ|;y3r$T~x9~)_Og+fSe^QNAOZwJfdrYHO8lrC+DUqYW|j#8fj zCI75DLz5#~1X8-DI-Zd+g@n)wf7H6XyoA?|EiDiq z`fcq;m7xUgVz|1muWvA2M>$Ly3LX45R~eavN)*4``jT5?=Yf{?18VrJrQZuL&L4X} zL^QVzN^$=48b??6PhF?A4XQK-Wx~+*e-B+u4xGiFJEe~o)8Ikvd4x9!L6T24V3nM4##2o#_rr+y7s=S>p5x1{ej-3r#A0hYE zU&}QY>TU}u!Mx?Ee5eldwK{&^>*n&uX+|0}xa?vmvnZq*mX%pmNLnP8JYl|I4r8b%cSZg%j-b|?+69fa;BB!3KyNG+gz~CLwxMF`# zLfF|%%SUHb0r_vZX@Y%!KUr!zPI=oRZa6SP&`Y?J+7*B>qY01{06I5}b~(h{m=Vys z{>jW>m)IFM8zRY76Q|zpol)+_ooV$-qh8JAr+S0@NUrQstxH@3?@qOY)v_zWb7Re8 zU7CmVBLs(s^@@6Be%6TQM{}m$s$2spY&_OP$ELcbGBMYkPc6RWzbnsfGrPNgi=DF& zbWz{>=34&D^vB(mHEAr>c|!`4|9|e{f1oq|caQSqsa^@vDGUz$nN;#wIw#n#MZ|2c z${SK$qz7k_$Bxm^jMNA&(C}oz`LNxDkNUFY^Gz&vUXydf{89t|R2~O9b3yvU+BFo#^C!x@C5JG-XBNyP zM?GSl=z0CX)~RQ{WddF{Hiu7neWeS|Z^o29n@%S`9vK~+2J=tyS1c@QxU{G|p!lK_ zYG+F*fMV5ii+OK5oKveUY0uafsBkmHTUF4%yJY2a5SOshPw^)tv+bWDBWRHSSU>9&ei5n5w zD%B|RJDj+%=Em*(=rvDGx*aZ>CWU8*B6j;RVU;Y~JyO`_3b^fYna+eVR8hbl`iSSv=3f>Z-zcP7=n8 zn=Y)C)zQ&3@gJRCnNA9Ag*R{id{cT-6pqs}idpdF+{IcsNeX1f@7M4PwaAj~ z70o}1b>aqs;(B^1LS;k1&Z0hKBEg<{v6T3ujqGK_-pdxngd=`yG1ikxCppU%ueVO` zYz|2SPluJ*d+-LvKrd_d*rg9k%>h+$e>PT3))RgDyD6=$ejp%aO*>*yI{|kcwHoY6 zXlH1?xJ=oysJ)NkL!fng-v;7qf`BTgfkm{m1h8CB`zshAv;_FeX*TmCgvxz<^W^JCtcKJ_Sq97ZE5UyS1G72>XjH+dSR;h~`Mke5!CtAd6IZnEuw5 zuO#HF(xvTtTcZu}5yD8&JZ1f1P_J8TvS})rN!PisC(a+|7a2rB^cN4`O@7zjb$?ll z^G@?66-e&8k@#%Y^N%=?3Zq=VaM8ZTUgG%2egb0!uJZM z?)S-^o8r@Q7BgYi4rNCuz@6|J3X36Sv37f6f2>@St{`oksQ;yfvzq68Y-9V1Sw2V|Y{{(*t_3*5dR&Yd;n*?RJb z)IJ46j5ivUTUp*7qI`)ZzAvKwGQm~)UoUPY6J zyNqr%^ohr>6+Ngs=3_(h2?|Dq9ACCvK|z!kv##($a_J45SSKma)RLP||G9wheb4Ig zI^t0CWP6_Ic}16;OO9k(8aK7y0?mKw+h#vZ36wtc@8cSKCi?=A<5O^L#ro#UgN(%W$Dm>E~h%t zb1|$Kjix_X@oM#g@lz2N&kB>L@fOZ1ti>B#&dk1wT40pa-)Jn0F@TcK7cVh6sYlTC zB{BroMB)VU8^>p=1}K z&O-UxUBonC)MGC>ck*A!!n@v(hIFC&onzzMgwwbCoVVm%BhZ|EtmaLV&XQj%GCu-^Ojzby- zzm-Q|fE9+W^EC1J*dgO%SMb{V{?~yApd#puvU7oy#E&d5#@=`+N zH=bl3%&;rbvRvX_jRYzK5RfOg|HwaJL?6=j3()+%S=32Ft1<;b>q5%@ai8v3N^J=< zls_Ytyd|I@PGPb>Y?KUd?tF?VtC`5Rzj(7;T|$VoutEA#nK_ZvNuG9o|Atp0a`NeH zQ=Up8b+Xs_p#v9uEU?l%ZTyA-*VzL189XE1LnnSLK*9SitmtJ6m zPMq?qk?9+nR+jO~NU;Dss_b;-H{*eIb4m>o@^!?NI&nnb8Ip$qqe`0@oK5M#-!G}N z$BWAOpZ!Bl>^OP(A(uvFw}$MIfAN@hDnkSh>h=x+u0zMytC9>qsDrc>kEFsmlsu8G zn>#qJqC2Z04Ty$ci@Hf|C8^nyqyUAJT1H9|sa||$@lczQ<@t8`&c}_S(TQ>}FgThb-~H}Hz@@ZSuwS)$UnobpoHyP0OS2!$lIBJV8TMj|vb8y1};Wu{r3 zTU!_Km$;ZOZmqvJdbUVJ@`W;;>YP`@bA0X*XFO=TN5!dW>agCA{Q&1NBbNt1@*JY? z6f3ALYeq(Pn)oZ_qKj4`K0eg@=I@l7H{8~Gb(uv2po@Bk;|yrUjzN?qFKp&PO2g|Z zvV!gpAEGIdioJyDn;8VE1HAZ(tVs|4@2KMBH=Nuk?7IGMi7NeTrkjLMr2e*UXHlcH ziG!sepJEF*<3H2NEJvKKZ!>;Ar#m80&*Pr4W6$InkD^J&<1YeatE({;RE~sU&Lf!3 zKC8X4vnhbU7W(bD-^2|cboh|We9*<4YTN#qcaVALd?O4c64($o#KR|0ksm;2fe%&P ze(O1RT5)s~IC$v}i&qVpLb#`X#A=zqubs!(8wOVst**DhA5|HL7S z;I_JAByG9N;f)SkP^S4s`-x3=>9<95!Cmm%HS-QC4Tc6zqPSr@HutB0^%mg>BqB)^5tWb+jyMnaMdG`@<*9%kb8OFjCN7xYc#wa?U3JQ1RBr#jiM z=;wcDb`f0xH2Ksn^SNMdc@t%2^|t@aAZay&FI@zA+q>3iShAnUZtHX=qkQhmaIr>K zcImoHDAbUCi;2l}S{xkC$cRD4ger%Gppc=Y9%}#Hy#9APk~cVUb(Oa{VLIVI zs<08j!$DMu!a^8Q2~Fh}KVN_RO`Cl?l$0pt6#4&dRQT?lkefUJwk?-nx16ER!qcBi RfQ>UqML|QpO!nR9{{u);vqAs> diff --git a/ChironCore/example/demo/class_hierarchy.tl b/ChironCore/example/demo/class_hierarchy.tl index c09a79a..97dcaa9 100644 --- a/ChironCore/example/demo/class_hierarchy.tl +++ b/ChironCore/example/demo/class_hierarchy.tl @@ -20,6 +20,16 @@ class :BankAccount { return -1 ] } + def __withdraw(:self, :amt, :minBalance, :fee) { + :total = :amt + :fee + if :self.:balance - :total >= :minBalance [ + :self.:balance = :self.:balance - :total + return 0 + ] + else [ + return -1 + ] + } } @@ -71,4 +81,4 @@ print(:bal1) :chkAcc.deposit(200) :chkAcc.withdraw(600) :bal2 = :chkAcc.getBalance() -print(:bal2) +print(:bal2) \ No newline at end of file diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 00e7bf6..101306d 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -200,7 +200,8 @@ def handleFunctionDeclaration(self, stmt, tgt): arity = len(stmt.params) if class_name not in self.class_methods: self.class_methods[class_name] = [] - self.class_methods[class_name].append((method_name, arity)) + is_private = method_name.startswith("__") + self.class_methods[class_name].append((method_name, arity, is_private)) return tgt @@ -296,7 +297,8 @@ def handleClassDeclaration(self, stmt, tgt): init_body += f" self.{attr_name} = {attr_value}\n" if className not in self.class_attributes: self.class_attributes[className] = [] - self.class_attributes[className].append((attr_name, attr_value, className)) + is_private = attr_name.startswith("__") + self.class_attributes[className].append((attr_name, attr_value, className, is_private)) # Handle object attributes for objectAttr in stmt.objectAttributes: @@ -307,7 +309,8 @@ def handleClassDeclaration(self, stmt, tgt): init_body += f" self.{lhs} = class_list.{rhs_classname}()\n" if className not in self.class_attributes: self.class_attributes[className] = [] - self.class_attributes[className].append((lhs, f"{rhs_classname}()", className)) + is_private = lhs.startswith("__") + self.class_attributes[className].append((lhs, f"{rhs_classname}()", className, is_private)) # init_body += f" self.{lhs} = None\n" @@ -389,26 +392,38 @@ def get_all_methods(self, class_name): methods = {} # Add methods defined in this class first (they override inherited ones) if class_name in self.class_methods: - for method, arity in self.class_methods[class_name]: - methods[(method, arity)] = class_name - # Add inherited methods from base classes, in order + for method, arity, is_private in self.class_methods[class_name]: + + methods[(method, arity)] = (class_name, is_private) + + # Add inherited methods from base classes, only for non-private methods + for base in self.class_hierarchy[class_name]: + base_methods = self.get_all_methods(base) - for (method, arity), defining_class in base_methods.items(): - if (method, arity) not in methods: - methods[(method, arity)] = defining_class + + for (method, arity), (defining_class, is_private) in base_methods.items(): + + if not is_private and (method, arity) not in methods: + + methods[(method, arity)] = (defining_class, is_private) return methods def get_all_attributes(self, class_name): if class_name not in self.class_hierarchy: return [] attributes = self.class_attributes.get(class_name, []) - # Add inherited attributes from base classes, avoiding duplicates + # Add inherited attributes from base classes, avoiding duplicates, only for public attributes + for base in self.class_hierarchy[class_name]: + base_attributes = self.get_all_attributes(base) - for attr_name, attr_value, defining_class in base_attributes: - if not any(a[0] == attr_name for a in attributes): - attributes.append((attr_name, attr_value, defining_class)) + + for attr_name, attr_value, defining_class, is_private in base_attributes: + + if not is_private and not any(a[0] == attr_name for a in attributes): + + attributes.append((attr_name, attr_value, defining_class, is_private)) return attributes def print_class_hierarchy(self): @@ -422,17 +437,32 @@ def print_class_hierarchy(self): self.class_colors[class_name] = "#{:06x}".format(random.randint(0, 0xFFFFFF)) for class_name in self.class_hierarchy: + methods = self.get_all_methods(class_name) + attributes = self.get_all_attributes(class_name) + + # Include all attributes (public and private) defined in this class + + all_attributes = self.class_attributes.get(class_name, []) + label = f"<{class_name}
" # Newline after class name + # Methods first - for (method, arity), defining_class in sorted(methods.items()): + + for (method, arity), (defining_class, is_private) in sorted(methods.items()): + class_color = self.class_colors.get(defining_class, "#000000") + label += f"{method}({arity})
" + # Blank line + label += "

" - # Attributes next - for attr_name, attr_value, defining_class in attributes: + + # Attributes next (including private from this class) + + for attr_name, attr_value, defining_class, is_private in all_attributes: class_color = self.class_colors.get(defining_class, "#000000") label += f"{attr_name} = {attr_value}
" label += ">" From 3f6fc810392141e874f98c4803875ca9d95ab771 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Mon, 21 Apr 2025 13:18:50 +0530 Subject: [PATCH 43/47] small feature --- ChironCore/ChironAST/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 50b83d1..cbc9862 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -108,7 +108,7 @@ def visitDataLocationAccess(self, ctx: tlangParser.DataLocationAccessContext): i += 1 # Move to expression inside brackets # Visit and evaluate expression expr = self.visit(ctx.children[i]) - access_chain.append([expr.val]) # Store index as a list + access_chain.append([expr]) # Store index as a list i += 1 # Skip closing ']' i += 1 # Move to the next child return ChironAST.DataLocationAccess(base, access_chain) From cb51f7c5749db551f27f2ce78e06cb27234bb7a9 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Tue, 22 Apr 2025 00:54:01 +0530 Subject: [PATCH 44/47] feature enchancement --- ChironCore/ChironAST/ChironAST.py | 2 +- ChironCore/ChironAST/builder.py | 59 ++++++++++++++++++++----------- ChironCore/interpreter.py | 3 ++ ChironCore/turtparse/tlang.g4 | 6 ++-- 4 files changed, 46 insertions(+), 24 deletions(-) diff --git a/ChironCore/ChironAST/ChironAST.py b/ChironCore/ChironAST/ChironAST.py index 1bcd046..c1e0e3f 100644 --- a/ChironCore/ChironAST/ChironAST.py +++ b/ChironCore/ChironAST/ChironAST.py @@ -344,7 +344,7 @@ def __init__(self, var, access_chain): self.access_chain = access_chain # List of attribute names or indices def __str__(self): - result = self.var + result = str(self.var) for access in self.access_chain: if isinstance(access, list): # Array indexing indices_str = "".join(f"[{idx}]" for idx in access) diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index cbc9862..072f1e4 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -88,7 +88,11 @@ def visitAssignment(self, ctx: tlangParser.AssignmentContext): return [(ChironAST.AssignmentCommand(lval, rval), 1)] def visitDataLocationAccess(self, ctx: tlangParser.DataLocationAccessContext): - base = ctx.baseVar().VAR().getText() + + + + base=ctx.baseVar().VAR().getText() + # Traverse through the nested access ('.' for attributes, '[]' for indices) access_chain = [] i = 1 # Start from second child (skip baseVar) @@ -114,23 +118,31 @@ def visitDataLocationAccess(self, ctx: tlangParser.DataLocationAccessContext): return ChironAST.DataLocationAccess(base, access_chain) def visitMethodCaller(self, ctx: tlangParser.MethodCallerContext): - access_chain = [] - i = 0 - while i < len(ctx.children): - child = ctx.children[i] - if isinstance(child, TerminalNodeImpl): - # Current child must be a VAR (attribute access) - access_chain.append(ctx.children[i].getText()) - i += 1 # skip '.' - elif child.getText() == '[': - # Array access: Process the expression inside `[]` - i += 1 # Move to expression inside brackets - # Visit and evaluate expression - expr = self.visit(ctx.children[i]) - access_chain.append([expr.val]) # Store index as a list - i += 2 # Skip closing ']' - i += 1 # Move to the next child - return ChironAST.MethodCaller(access_chain) + + if ctx.dataLocationAccess(): + return self.visit(ctx.dataLocationAccess()) + if ctx.VAR(): + var=ctx.VAR().getText() + return ChironAST.DataLocationAccess(var, []) + return None + # access_chain = [] + # i = 0 + # while i < len(ctx.children): + # child = ctx.children[i] + # if isinstance(child, TerminalNodeImpl): + # # Current child must be a VAR (attribute access) + # access_chain.append(ctx.children[i].getText()) + # i += 1 # skip '.' + # elif child.getText() == '[': + # # Array access: Process the expression inside `[]` + # i += 1 # Move to expression inside brackets + # # Visit and evaluate expression + # expr = self.visit(ctx.children[i]) + # access_chain.append([expr.val]) # Store index as a list + # i += 2 # Skip closing ']' + # i += 1 # Move to the next child + # return ChironAST.MethodCaller(access_chain) + def visitObjectInstantiation(self, ctx: tlangParser.ObjectInstantiationContext): # Extract the left-hand side (target variable or object access) @@ -182,24 +194,31 @@ def visitValue(self, ctx: tlangParser.ValueContext): def visitFunctionCallExpr(self, ctx: tlangParser.FunctionCallContext): # TODO: Refactoring, this function has similar body as visitFunctionCall + functionName = ctx.NAME().getText() + # the object invoking the method, in case the function call is a method call methodCaller = self.visitMethodCaller( ctx.methodCaller()) if ctx.methodCaller().children is not None else None + + functionArgs = [self.visit(arg) for arg in ctx.arguments( ).expression()] if ctx.arguments() is not None else [] - # if the function is a method call, insert the caller object as the first argument + # if the function is a method call, insert the caller object as the first argument (self) if methodCaller: functionArgs.insert(0, methodCaller) # call private methods with mangled names # eg, :self.__privateMethod() will be called as :self._className__privateMethod() - if len(methodCaller.access_chain) == 1 and methodCaller.access_chain[0] == ":self" and functionName.startswith("__"): + # if len(methodCaller.access_chain) == 1 and methodCaller.access_chain[0] == ":self" and functionName.startswith("__"): + # functionName = f"_{self.classRegister}{functionName}" + if methodCaller.var == ":self" and functionName.startswith("__"): functionName = f"_{self.classRegister}{functionName}" # create a virtual register to store the return value returnLocation = ChironAST.Var(":__reg_" + str(self.virtualRegCount)) self.virtualRegCount += 1 self.subStmtList.extend([(ChironAST.FunctionCallCommand(functionName, functionArgs, methodCaller), 1)] + [(ChironAST.ReadReturnCommand([returnLocation]), 1)]) + return returnLocation def visitFunctionCall(self, ctx:tlangParser.FunctionCallContext): diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 101306d..98b3ff4 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -187,9 +187,12 @@ def handleFunctionDeclaration(self, stmt, tgt): # mangle the name of private method as _ClassName__methodName if "@" in stmt.name and stmt.name.split("@")[1].startswith("__"): class_name, method_name = stmt.name.split("@") + function_name = class_name+ "@" + "_" + class_name.replace(":","") + method_name else: function_name = stmt.name + + self.function_addresses[function_name + "_" + str(len(stmt.params))] = self.pc + 1 # body of the function starts from next instruction diff --git a/ChironCore/turtparse/tlang.g4 b/ChironCore/turtparse/tlang.g4 index 960ad02..adaf245 100644 --- a/ChironCore/turtparse/tlang.g4 +++ b/ChironCore/turtparse/tlang.g4 @@ -89,9 +89,9 @@ classAttributeDeclaration : assignment | objectInstantiation ; objectInstantiation : lvalue '=' 'new' VAR '(' ')' ; -dataLocationAccess : baseVar ('.' VAR | '[' expression ']')+ ; +dataLocationAccess : baseVar ('.' VAR | '[' expression ']')+ ; -baseVar : VAR ; +baseVar : VAR ; lvalue : VAR @@ -100,7 +100,7 @@ lvalue // function call functionCall : methodCaller NAME '(' arguments ')' ; -methodCaller : ((VAR | '[' expression ']') '.')* ; +methodCaller : (( VAR | dataLocationAccess ) '.')? ; // function declaration From 039c989cfb15bcb9dbee6e17f871a100173ad510 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Tue, 22 Apr 2025 04:14:41 +0530 Subject: [PATCH 45/47] minor enhancement and examples --- ChironCore/example/exampleSE.tl | 116 ++++++++++++++++++++++++++++++-- ChironCore/interpreter.py | 13 ++-- 2 files changed, 118 insertions(+), 11 deletions(-) diff --git a/ChironCore/example/exampleSE.tl b/ChironCore/example/exampleSE.tl index 81e650c..3b07d82 100644 --- a/ChironCore/example/exampleSE.tl +++ b/ChironCore/example/exampleSE.tl @@ -1,7 +1,109 @@ -:x = 3 -:y = :x -if :x <= 42 [ - :y = :y + 40 -] else [ - :y = :y + 22 -] +class :__Node { + :x = 0 + :y = 0 +} + + + + +def drawSquare(:__x, :__y, :__r) { + penup + goto(:__x - :__r, :__y + :__r) + pendown + repeat 4 [ + forward (2 * :__r) + right 90 + ] + return 0 +} + +def drawLine(:__x1, :__y1, :__x2, :__y2) { + penup + goto(:__x1, :__y1) + pendown + goto(:__x2, :__y2) + return 0 +} + + +def saveNode(:__x, :__y,:__allNodes,:cnt) { + :__n = new :__Node() + :__n.:x = :__x + :__n.:y = :__y + :__allNodes[:cnt]=:__n + return 0 +} + +def crossNode(:__x, :__y, :__r) { + drawLine(:__x - :__r, :__y + :__r, :__x + :__r, :__y - :__r) + drawLine(:__x - :__r, :__y - :__r, :__x + :__r, :__y + :__r) + return 0 +} + + +def drawTree(:__x, :__y, :__r, :__depth, :__spread, :__allNodes,:cnt) { + drawSquare(:__x, :__y, :__r) + saveNode(:__x, :__y,:__allNodes,:cnt) + if :__depth > 1 [ + :__offset = :__spread / 2 + :__dy = 80 + :__lx = :__x - :__offset + :__rx = :__x + :__offset + :__cy = :__y - :__dy + drawLine(:__x - :__r, :__y - :__r, :__lx - :__r, :__cy + :__r) + drawLine(:__x + :__r, :__y - :__r, :__rx + :__r, :__cy + :__r) + drawTree(:__lx, :__cy, :__r, :__depth - 1, :__spread / 2, :__allNodes,2*:cnt+1) + drawTree(:__rx, :__cy, :__r, :__depth - 1, :__spread / 2, :__allNodes,2*:cnt+2) + ] + return 0 +} + +def dfsmark(:node, :__allNodes, :target) { + if :node >= 7 [ + return 0 + ] + + :cur = :__allNodes[:node] + + if :cur.:x == :target.:x && :cur.:y == :target.:y [ + crossNode(:cur.:x, :cur.:y, 20) + return 1 + ] + + crossNode(:cur.:x, :cur.:y, 20) + + :lhs = 2 * :node + 1 + :rhs = 2 * :node + 2 + + :l=dfsmark(:lhs, :__allNodes, :target) + :r=dfsmark(:rhs, :__allNodes, :target) + + if :l == 1 [ + return 1 + ] + if :r== 1 [ + return 1 + ] + + return 0 +} + + + +:n = new :__Node() + +:__allNodes = [:n, :n , :n, :n , :n, :n , :n ] + +:cnt = 0 +drawTree(0, 250, 20, 3, 240,:__allNodes,:cnt) + +:target = new :__Node() + +:target.:x=:__allNodes[4].:x +:target.:y=:__allNodes[4].:y + + +:r= dfsmark(0,:__allNodes,:target) + +print(:r) + diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 98b3ff4..6041411 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -28,6 +28,7 @@ def __init__(self, irHandler, params): self.pc = 0 self.t_screen = turtle.getscreen() self.trtl = turtle.Turtle() + self.trtl.speed(0) self.trtl.shape("turtle") self.trtl.color("blue", "yellow") self.trtl.fillcolor("green") @@ -217,6 +218,7 @@ def handleFunctionCall(self, stmt, tgt): # Save the arguments on the call stack for arg in stmt.args: arg_value = addContext(arg) + print(arg_value) exec(f"self.argument = {arg_value}") self.call_stack.append(self.argument) # Jump to the function address @@ -340,19 +342,22 @@ def handleClassDeclaration(self, stmt, tgt): return 1 def handleObjectInstantiation(self, stmt, tgt): - lhs = str(stmt.target).replace(":", "") + # lhs = str(stmt.target).replace(":", "") + lhs=addContext(str(stmt.target)) rhs = addContext(stmt.class_name).replace( "self.prg.", "self.class_list.") - exec(f"self.prg.{lhs} = {rhs}()") + exec(f"{lhs} = {rhs}()") return 1 def handleAssignment(self, stmt, tgt): print(" Assignment Statement") - lhs = str(stmt.lvar).replace(":", "") + # lhs = str(stmt.lvar).replace(":", "") + lhs = addContext(str(stmt.lvar)) + rhs = addContext(stmt.rexpr) print(lhs, rhs, "Assignment") # exec("setattr(self.prg,\"%s\",%s)" % (lhs,rhs)) - exec(f"self.prg.{lhs} = {rhs}") + exec(f"{lhs} = {rhs}") return 1 def handlePrint(self, stmt, tgt): From e825edc26461d0462fc4b275e56e3f704ef20157 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Tue, 22 Apr 2025 07:44:18 +0530 Subject: [PATCH 46/47] minor improve --- ChironCore/ChironAST/builder.py | 12 +++++++----- ChironCore/example/exampleSE.tl | 25 ++++++++++++++++--------- ChironCore/interpreter.py | 28 +++++++++++++++------------- 3 files changed, 38 insertions(+), 27 deletions(-) diff --git a/ChironCore/ChironAST/builder.py b/ChironCore/ChironAST/builder.py index 072f1e4..47d4e69 100644 --- a/ChironCore/ChironAST/builder.py +++ b/ChironCore/ChironAST/builder.py @@ -45,15 +45,15 @@ def processInstructionBlock(self, items): Shared utility for processing declaration or instruction blocks. Appends the resulting instructions and sub-statements to the main statement list. """ - stmtList = [] + stmtListi = [] for item in items: currStmtList = self.visit(item) if not isinstance(currStmtList,list): currStmtList=[] - stmtList.extend(self.subStmtList + currStmtList) + stmtListi.extend(self.subStmtList + currStmtList) self.subStmtList = [] self.virtualRegCount = 0 - return stmtList + return stmtListi def visitDeclaration_list(self, ctx: tlangParser.Declaration_listContext): return self.processInstructionBlock(ctx.declaration()) @@ -239,11 +239,13 @@ def visitPrintStatement(self, ctx: tlangParser.PrintStatementContext): def visitIfConditional(self, ctx: tlangParser.IfConditionalContext): condObj = ChironAST.ConditionCommand(self.visit(ctx.expression())) + a=[] if self.subStmtList: - self.stmtList.extend(self.subStmtList) + a.extend(self.subStmtList) self.subStmtList=[] thenInstrList = self.visit(ctx.strict_ilist()) - return [(condObj, len(thenInstrList) + 1)] + thenInstrList + x= a+[(condObj, len(thenInstrList) + 1)] + thenInstrList + return x def visitIfElseConditional(self, ctx: tlangParser.IfElseConditionalContext): condObj = ChironAST.ConditionCommand(self.visit(ctx.expression())) diff --git a/ChironCore/example/exampleSE.tl b/ChironCore/example/exampleSE.tl index 3b07d82..2d2cab6 100644 --- a/ChironCore/example/exampleSE.tl +++ b/ChironCore/example/exampleSE.tl @@ -4,7 +4,14 @@ class :__Node { } - +def drawV(:__x, :__y, :__r) { + penup + goto(:__x - :__r, :__y + :__r) + pendown + goto(:__x, :__y - :__r) + goto(:__x + :__r, :__y + :__r) + return 0 +} def drawSquare(:__x, :__y, :__r) { penup @@ -59,7 +66,7 @@ def drawTree(:__x, :__y, :__r, :__depth, :__spread, :__allNodes,:cnt) { } def dfsmark(:node, :__allNodes, :target) { - if :node >= 7 [ + if :node >=7 [ return 0 ] @@ -70,18 +77,18 @@ def dfsmark(:node, :__allNodes, :target) { return 1 ] - crossNode(:cur.:x, :cur.:y, 20) + drawV(:cur.:x, :cur.:y, 20) :lhs = 2 * :node + 1 :rhs = 2 * :node + 2 + - :l=dfsmark(:lhs, :__allNodes, :target) - :r=dfsmark(:rhs, :__allNodes, :target) - if :l == 1 [ + if dfsmark(:lhs, :__allNodes, :target) == 1 [ return 1 ] - if :r== 1 [ + + if dfsmark(:rhs, :__allNodes, :target)== 1 [ return 1 ] @@ -99,8 +106,8 @@ drawTree(0, 250, 20, 3, 240,:__allNodes,:cnt) :target = new :__Node() -:target.:x=:__allNodes[4].:x -:target.:y=:__allNodes[4].:y +:target.:x=:__allNodes[3].:x +:target.:y=:__allNodes[3].:y :r= dfsmark(0,:__allNodes,:target) diff --git a/ChironCore/interpreter.py b/ChironCore/interpreter.py index 6041411..b8775cf 100644 --- a/ChironCore/interpreter.py +++ b/ChironCore/interpreter.py @@ -119,12 +119,15 @@ def __init__(self, irHandler, params): if self.args is not None and self.args.hooks: self.chironhook = Chironhooks.ConcreteChironHooks() self.pc = 0 + # print("###########################Intermediate Representation (IR):#############") + # for index, instruction in enumerate(self.ir): + # print(f"{index}: {instruction} | {instruction[0]}") def interpret(self): - print("Program counter : ", self.pc) + # print("Program counter : ", self.pc) stmt, tgt = self.ir[self.pc] - print(stmt, stmt.__class__.__name__, tgt) + # print(stmt, stmt.__class__.__name__, tgt) self.sanityCheck(self.ir[self.pc]) @@ -218,7 +221,6 @@ def handleFunctionCall(self, stmt, tgt): # Save the arguments on the call stack for arg in stmt.args: arg_value = addContext(arg) - print(arg_value) exec(f"self.argument = {arg_value}") self.call_stack.append(self.argument) # Jump to the function address @@ -236,7 +238,7 @@ def handleFunctionCall(self, stmt, tgt): # Copying the return values in their respective placeholders def handleReturnRead(self, stmt, tgt): - print(f"Read Return: {stmt.returnValues}") + # print(f"Read Return: {stmt.returnValues}") cnt=self.call_stack.pop() rval=stmt.returnValues[0] rval = str(rval).replace(":", "") @@ -251,7 +253,7 @@ def handleReturnRead(self, stmt, tgt): def handleFunctionReturn(self, stmt, tgt): - print(f"Function Return: {stmt}") + # print(f"Function Return: {stmt}") # Restore the previous program context rval_list = [] cnt=0 @@ -350,45 +352,45 @@ def handleObjectInstantiation(self, stmt, tgt): return 1 def handleAssignment(self, stmt, tgt): - print(" Assignment Statement") + # print(" Assignment Statement") # lhs = str(stmt.lvar).replace(":", "") lhs = addContext(str(stmt.lvar)) rhs = addContext(stmt.rexpr) - print(lhs, rhs, "Assignment") + print(lhs, rhs, "Assignment Statement") # exec("setattr(self.prg,\"%s\",%s)" % (lhs,rhs)) exec(f"{lhs} = {rhs}") return 1 def handlePrint(self, stmt, tgt): - print(" PrintCommand") + # print(" PrintCommand") expr = addContext(stmt.expr) print("Executing print with expression:", expr) exec("print(%s)" % expr) return 1 def handleCondition(self, stmt, tgt): - print(" Branch Instruction") + # print(" Branch Instruction") condstr = addContext(stmt) exec("self.cond_eval = %s" % (condstr)) return 1 if self.cond_eval else tgt def handleMove(self, stmt, tgt): - print(" MoveCommand") + # print(" MoveCommand") exec("self.trtl.%s(%s)" % (stmt.direction, addContext(stmt.expr))) return 1 def handleNoOpCommand(self, stmt, tgt): - print(" No-Op Command") + # print(" No-Op Command") return 1 def handlePen(self, stmt, tgt): - print(" PenCommand") + # print(" PenCommand") exec("self.trtl.%s()" % (stmt.status)) return 1 def handleGotoCommand(self, stmt, tgt): - print(" GotoCommand") + # print(" GotoCommand") xcor = addContext(stmt.xcor) ycor = addContext(stmt.ycor) exec("self.trtl.goto(%s, %s)" % (xcor, ycor)) From 13155f57b5b5ca9fec5798a078aa706e148a2029 Mon Sep 17 00:00:00 2001 From: luthanhar Date: Wed, 23 Apr 2025 00:43:46 +0530 Subject: [PATCH 47/47] adding examples --- ChironCore/example/demo/Binary_Tree.tl | 45 +++++++++++++++++++ .../{class_methods.tl => class_pentagon.tl} | 0 ChironCore/example/demo/functions.tl | 16 ------- ChironCore/example/demo/overloading.tl | 41 +++++++++++++++++ .../demo/{general.tl => star_in_sq.tl} | 0 ChironCore/example/demo/test.tl | 11 +++-- ChironCore/example/kachuapur.tl | 5 +-- 7 files changed, 95 insertions(+), 23 deletions(-) create mode 100644 ChironCore/example/demo/Binary_Tree.tl rename ChironCore/example/demo/{class_methods.tl => class_pentagon.tl} (100%) delete mode 100644 ChironCore/example/demo/functions.tl create mode 100644 ChironCore/example/demo/overloading.tl rename ChironCore/example/demo/{general.tl => star_in_sq.tl} (100%) diff --git a/ChironCore/example/demo/Binary_Tree.tl b/ChironCore/example/demo/Binary_Tree.tl new file mode 100644 index 0000000..7558c16 --- /dev/null +++ b/ChironCore/example/demo/Binary_Tree.tl @@ -0,0 +1,45 @@ +def drawSquare(:x, :y, :len) { + penup + goto(:x - :len/2, :y + :len/2) + pendown + repeat 4 [ + forward :len + right 90 + ] + return 0 +} + +def drawTree(:x, :y, :len, :depth, :spread) { + drawSquare(:x, :y, :len) + + if :depth > 1 [ + :dy = 80 + :nextY = :y - :dy + :offset = :spread / 2 + + :lx = :x - :offset + + penup + goto(:x, :y - :len/2) + pendown + goto(:lx, :nextY + :len/2) + + drawTree(:lx, :nextY, :len, :depth - 1, :spread / 2) + + goto(:x, :y - :len/2) + + :rx = :x + :offset + + penup + goto(:x, :y - :len/2) + pendown + goto(:rx, :nextY + :len/2) + + drawTree(:rx, :nextY, :len, :depth - 1, :spread / 2) + + goto(:x, :y - :len/2) + ] + return 0 +} + +drawTree(0, 250, 40, 4, 240) diff --git a/ChironCore/example/demo/class_methods.tl b/ChironCore/example/demo/class_pentagon.tl similarity index 100% rename from ChironCore/example/demo/class_methods.tl rename to ChironCore/example/demo/class_pentagon.tl diff --git a/ChironCore/example/demo/functions.tl b/ChironCore/example/demo/functions.tl deleted file mode 100644 index cf524ac..0000000 --- a/ChironCore/example/demo/functions.tl +++ /dev/null @@ -1,16 +0,0 @@ -def drawSide(:length) { - forward :length - right 90 - return 0 -} -def drawSide(:length,:righti) { - forward :length - right :righti - return 0 -} - -:length = 250 -:righti = 45 -drawSide(:length) -drawSide(:length,:righti) -drawSide(:length) diff --git a/ChironCore/example/demo/overloading.tl b/ChironCore/example/demo/overloading.tl new file mode 100644 index 0000000..6a1ba63 --- /dev/null +++ b/ChironCore/example/demo/overloading.tl @@ -0,0 +1,41 @@ +def draw(:r) { + + :circumference = 2 * 3.14 * :r + :steps = 36 + :stepLength = :circumference / :steps + :turnAngle = 360 / :steps + + repeat :steps [ + forward(:stepLength) + right(:turnAngle) + ] + return 0 + +} + +def draw(:w, :h) { + forward(:w) + right(90) + forward(:h) + right(90) + forward(:w) + right(90) + forward(:h) + right(90) + return 0 +} + +def draw(:a, :b, :c) { + forward(:a) + right(120) + forward(:b) + right(120) + forward(:c) + right(120) + return 0 +} + + +draw(100) +draw(100,100) +draw(100,100,100) \ No newline at end of file diff --git a/ChironCore/example/demo/general.tl b/ChironCore/example/demo/star_in_sq.tl similarity index 100% rename from ChironCore/example/demo/general.tl rename to ChironCore/example/demo/star_in_sq.tl diff --git a/ChironCore/example/demo/test.tl b/ChironCore/example/demo/test.tl index 147eb7f..f3002d7 100644 --- a/ChironCore/example/demo/test.tl +++ b/ChironCore/example/demo/test.tl @@ -1,6 +1,9 @@ -if :x=2 [ - print(2) +if :x=0 == :y=:z=3 [ + print(:y) ] else [ - print(4) -] \ No newline at end of file + print(:x) + repeat 4 [ + forward 100 + right 90 + ]] \ No newline at end of file diff --git a/ChironCore/example/kachuapur.tl b/ChironCore/example/kachuapur.tl index b9d7a2f..6cbb899 100644 --- a/ChironCore/example/kachuapur.tl +++ b/ChironCore/example/kachuapur.tl @@ -1,6 +1,5 @@ -:i = [1,[2,3,4],3,4] +:i = [0,[2,3,4],3,4] :i[1][0] = 30 -print(:i[0]=90) -:j= :i[0] = :k = 6 + :i[0] +:j= :i[0] = :k = 6 + :i[2*1+1*:i[0]] print(:j) print(:i) \ No newline at end of file