From 696cb75b46c0c7575ab298443d2af89dfb67b16c Mon Sep 17 00:00:00 2001 From: aranega Date: Sun, 22 Sep 2024 21:02:53 -0600 Subject: [PATCH] Add partial evaluation of some expressions --- Makefile | 6 + OclExpression.g4 | 345 +++++---- pyecoreocl/compiler.py | 25 +- pyecoreocl/parser/OclExpression.interp | 2 +- pyecoreocl/parser/OclExpressionParser.py | 847 +++++++++++++---------- tests/test_expressions_strict.py | 4 + 6 files changed, 697 insertions(+), 532 deletions(-) diff --git a/Makefile b/Makefile index 842e5f4..c6e0993 100644 --- a/Makefile +++ b/Makefile @@ -6,3 +6,9 @@ pyecoreocl/parser/OclExpressionParser.py: OclExpression.g4 clean: rm -f pyecoreocl/parser/OclExpression* + +test: + python -m pytest -s + +cache_clean_test: + rm -rf tests/__pycache__ && python -m pytest -s \ No newline at end of file diff --git a/OclExpression.g4 b/OclExpression.g4 index 61ba745..b7a42fd 100644 --- a/OclExpression.g4 +++ b/OclExpression.g4 @@ -1,183 +1,230 @@ grammar OclExpression; -oclExp: - primaryExp # PrimaryExpression -| unrestrictedName # SimpleName -| (unrestrictedName '::')+ unreservedName # FullQualifiedName -| expression=oclExp argExp # CallExpression -| expression=oclExp '.' attname=unrestrictedName argExp # MethodCall -| expression=oclExp '.' attname=unrestrictedName # AttributeNavigation -| expression=oclExp '->' attname=unrestrictedName argExp # CollectionCall -| operator='-' expression=oclExp # UnaryOperation -| operator='not' expression=oclExp # UnaryOperation -| left=oclExp operator='*' right=oclExp # ArithmeticBinaryOperation -| left=oclExp operator='/' right=oclExp # ArithmeticBinaryOperation -| left=oclExp operator='+' right=oclExp # ArithmeticBinaryOperation -| left=oclExp operator='-' right=oclExp # ArithmeticBinaryOperation -| left=oclExp operator='<' right=oclExp # ComparisonBinaryOperation -| left=oclExp operator='>' right=oclExp # ComparisonBinaryOperation -| left=oclExp operator='<=' right=oclExp # ComparisonBinaryOperation -| left=oclExp operator='>=' right=oclExp # ComparisonBinaryOperation -| left=oclExp operator='=' right=oclExp # ComparisonBinaryOperation -| left=oclExp operator='<>' right=oclExp # ComparisonBinaryOperation -| left=oclExp operator='and' right=oclExp # BooleanBinaryOperation -| left=oclExp operator='or' right=oclExp # BooleanBinaryOperation -| left=oclExp operator='xor' right=oclExp # BooleanBinaryOperation -| left=oclExp operator='implies' right=oclExp # BooleanBinaryOperation -; +@parser::header { +OBJ = object +CANNOT_EVAL = object() # define a sentinel object + +def has_result(*args): + return all(e.r is not None and e.r is not CANNOT_EVAL for e in args) + +def f(vs, ts, eval): + for v, t in zip(vs, ts): + if v is CANNOT_EVAL or not isinstance(v, t): + return CANNOT_EVAL + return eval(*vs) +} + +oclExp + returns[r]: + n = primaryExp {$r = $n.r} # PrimaryExpression + | unrestrictedName {$r = CANNOT_EVAL} # SimpleName + | (unrestrictedName '::')+ unreservedName {$r = CANNOT_EVAL} # FullQualifiedName + | expression = oclExp argExp {$r = CANNOT_EVAL} # CallExpression + | expression = oclExp '.' attname = unrestrictedName argExp {$r = CANNOT_EVAL} # MethodCall + | expression = oclExp '.' attname = unrestrictedName {$r = CANNOT_EVAL} # AttributeNavigation + | expression = oclExp '->' attname = unrestrictedName argExp {$r = CANNOT_EVAL} # CollectionCall + | operator = '-' expression = oclExp {$r = f(($expression.r,), ((int, float),), lambda n: -n)} # UnaryOperation + | operator = 'not' expression = oclExp {$r = f(($expression.r,), (bool,), lambda n: not n)} # UnaryOperation + | left = oclExp operator = '*' right = oclExp {$r = f(($left.r, $right.r), (int, int), lambda l, r: l * r)} # ArithmeticBinaryOperation + | left = oclExp operator = '/' right = oclExp {$r = f(($left.r, $right.r), (int, int), lambda l, r: l / r)} # ArithmeticBinaryOperation + | left = oclExp operator = '+' right = oclExp {$r = f(($left.r, $right.r), (int, int), lambda l, r: l + r)} # ArithmeticBinaryOperation + | left = oclExp operator = '-' right = oclExp {$r = f(($left.r, $right.r), (int, int), lambda l, r: l - r)} # ArithmeticBinaryOperation + | left = oclExp operator = '<' right = oclExp {$r = f(($left.r, $right.r), (OBJ, OBJ), lambda l, r: l < r)} # ComparisonBinaryOperation + | left = oclExp operator = '>' right = oclExp {$r = f(($left.r, $right.r), (OBJ, OBJ), lambda l, r: l > r)} # ComparisonBinaryOperation + | left = oclExp operator = '<=' right = oclExp {$r = f(($left.r, $right.r), (OBJ, OBJ), lambda l, r: l <= r)} # ComparisonBinaryOperation + | left = oclExp operator = '>=' right = oclExp {$r = f(($left.r, $right.r), (OBJ, OBJ), lambda l, r: l >= r)} # ComparisonBinaryOperation + | left = oclExp operator = '=' right = oclExp {$r = f(($left.r, $right.r), (OBJ, OBJ), lambda l, r: l == r)} # ComparisonBinaryOperation + | left = oclExp operator = '<>' right = oclExp {$r = f(($left.r, $right.r), (OBJ, OBJ), lambda l, r: l != r)} # ComparisonBinaryOperation + | left = oclExp operator = 'and' right = oclExp {$r = f(($left.r, $right.r), (bool, bool), lambda l, r: l and r)} # BooleanBinaryOperation + | left = oclExp operator = 'or' right = oclExp {$r = f(($left.r, $right.r), (bool, bool), lambda l, r: l or r)} # BooleanBinaryOperation + | left = oclExp operator = 'xor' right = oclExp # BooleanBinaryOperation + | left = oclExp operator = 'implies' right = oclExp # BooleanBinaryOperation; argExp: - '(' (body+=oclExp (',' body+=oclExp)*)? ')' # ArgumentsExp -| '(' varnames+=unreservedName (',' varnames+=unreservedName )* (':' typeExpCS)? ( ';' iterator=unreservedName (':' typeExpCS)? '=' initializer=oclExp)? '|' body=oclExp ')' # LambdaExp -; - -primaryExp: - selfExp -| nestedExp -| primitiveLiteralExp -| tupleLiteralExp -| collectionLiteralExp -| typeLiteralExp -| letExp -| ifExp -; - -selfExp: - 'self' -; - -nestedExp: - '(' nested=oclExp ')' -; - -primitiveLiteralExp: - numberLiteralExpCS # NumberLiteral -| booleanLiteralExpCS # BooleanLiteral -| stringLiteralExpCS # StringLiteral -| unlimitedNaturalLiteralCS # UnlimitedNaturalLiteral -| invalidLiteralExpCS # InvalidLiteral -| nullLiteralExpCS # NullLiteral -; + '(' (body += oclExp (',' body += oclExp)*)? ')' # ArgumentsExp + | '(' varnames += unreservedName ( + ',' varnames += unreservedName + )* (':' typeExpCS)? ( + ';' iterator = unreservedName (':' typeExpCS)? '=' initializer = oclExp + )? '|' body = oclExp ')' # LambdaExp; + +primaryExp + returns[r]: + selfExp + | n_ = nestedExp {$r = $n_.r} + | n = primitiveLiteralExp {$r = $n.r} + | tupleLiteralExp + | collectionLiteralExp + | typeLiteralExp + | letExp + | ifExp; + +selfExp: 'self'; + +nestedExp returns [r]: '(' nested = oclExp ')' {$r = $nested.r}; + +primitiveLiteralExp + returns[r]: + n = numberLiteralExpCS {$r = $n.r} # NumberLiteral + | n = booleanLiteralExpCS {$r = $n.text == 'true'} # BooleanLiteral + | n = stringLiteralExpCS {$r = $n.text} # StringLiteral + | unlimitedNaturalLiteralCS {$r = CANNOT_EVALUTATE} # UnlimitedNaturalLiteral + | invalidLiteralExpCS {$r=None} # InvalidLiteral + | nullLiteralExpCS {$r=None} # NullLiteral; tupleLiteralExp: - 'Tuple' '{' tupleLiteralPartCS (',' tupleLiteralPartCS)*'}' -; + 'Tuple' '{' tupleLiteralPartCS (',' tupleLiteralPartCS)* '}'; tupleLiteralPartCS: - unrestrictedName (':' typeExpCS)? '=' primaryExp -; + unrestrictedName (':' typeExpCS)? '=' primaryExp; collectionLiteralExp: - collectionTypeCS '{' (expressions+=collectionLiteralPartCS (',' expressions+=collectionLiteralPartCS)*)? '}' -; + collectionTypeCS '{' ( + expressions += collectionLiteralPartCS ( + ',' expressions += collectionLiteralPartCS + )* + )? '}'; collectionTypeCS: - collectionTypeIdentifier ('(' typeExpCS ')'|'<' typeExpCS '>')? -; + collectionTypeIdentifier ( + '(' typeExpCS ')' + | '<' typeExpCS '>' + )?; primitiveTypeCS: - 'String' # StringType -| 'Integer' # IntegerType -| 'UnlimitedNatural' # UnlimitedNaturalType -| 'Boolean' # BooleanType -| 'Real' # RealType -| 'OclAny' # OCLAnyType -| 'OclInvalid' # OCLInvalidType -| 'OclMessage' # OCLMessage -| 'OclSelf' # OCLSelf -| 'OclVoid' # OCLVoid -; + 'String' # StringType + | 'Integer' # IntegerType + | 'UnlimitedNatural' # UnlimitedNaturalType + | 'Boolean' # BooleanType + | 'Real' # RealType + | 'OclAny' # OCLAnyType + | 'OclInvalid' # OCLInvalidType + | 'OclMessage' # OCLMessage + | 'OclSelf' # OCLSelf + | 'OclVoid' # OCLVoid; collectionTypeIdentifier: - 'Collection' # CollectionType -| 'Bag' # BagType -| 'OrderedSet' # OrderedSetType -| 'Sequence' # SequenceType -| 'Set' # SetType -; + 'Collection' # CollectionType + | 'Bag' # BagType + | 'OrderedSet' # OrderedSetType + | 'Sequence' # SequenceType + | 'Set' # SetType; collectionLiteralPartCS: - oclExp -| inf=oclExp isInterval='..' sup=oclExp -; + oclExp + | inf = oclExp isInterval = '..' sup = oclExp; -typeLiteralExp: - typeLiteralCS -; +typeLiteralExp: typeLiteralCS; letExp: - 'let' variables+=letVariableCS (',' variables+=letVariableCS)* 'in' oclExp -; + 'let' variables += letVariableCS ( + ',' variables += letVariableCS + )* 'in' oclExp; -letVariableCS: - unrestrictedName (':' typeExpCS)? '=' oclExp -; +letVariableCS: unrestrictedName (':' typeExpCS)? '=' oclExp; -typeExpCS: - typeLiteralCS -| typeNameExpCS -; +typeExpCS: typeLiteralCS | typeNameExpCS; typeNameExpCS: - unrestrictedName -| typeNameExpCS ('::' unreservedName)+ -; + unrestrictedName + | typeNameExpCS ('::' unreservedName)+; -typeLiteralCS: - collectionTypeCS -| primitiveTypeCS -| tupleTypeCS -; +typeLiteralCS: collectionTypeCS | primitiveTypeCS | tupleTypeCS; tupleTypeCS: - 'Tuple' ('(' tuplePartCS (',' tuplePartCS)* ')' -| '<' tuplePartCS (',' tuplePartCS)* '>')? -; - -tuplePartCS: - unrestrictedName ':' typeExpCS -; - -ifExp: - 'if' condition=oclExp 'then' body=oclExp 'else' else_=oclExp 'endif' -; - -numberLiteralExpCS: - INT -| FLOAT -; - -stringLiteralExpCS: - STRING -; - -booleanLiteralExpCS: - 'true'|'false' -; - -unlimitedNaturalLiteralCS: - '*' -; - -invalidLiteralExpCS: - 'invalid' -; - -nullLiteralExpCS: - 'null' -; - -unrestrictedName: ~('('|')'|'true'|'false'|'and'|'else'|'endif'|'false'|'if'|'implies'|'in'|'invalid'|'let'|'not'|'null'|'or'|'self'|'then'|'true'|'xor'|'Bag'|'Boolean'|'Collection'|'Integer'|'Lambda'|'OclAny'|'OclInvalid'|'OclMessage'|'OclSelf'|'OclVoid'|'OrderedSet'|'Real'|'Sequence'|'Set'|'String'|'Tuple'|'UnlimitedNatural'); -unreservedName: ~('('|')'|'and'|'else'|'endif'|'false'|'if'|'implies'|'in'|'invalid'|'let'|'not'|'null'|'or'|'self'|'then'|'true'|'xor'); + 'Tuple' ( + '(' tuplePartCS (',' tuplePartCS)* ')' + | '<' tuplePartCS (',' tuplePartCS)* '>' + )?; + +tuplePartCS: unrestrictedName ':' typeExpCS; + +ifExp returns [r]: + 'if' condition = oclExp 'then' body = oclExp 'else' else_ = oclExp 'endif'; + +numberLiteralExpCS + returns[r]: + INT {$r=int($INT.text)} + | FLOAT {$r=float($FLOAT.text)}; + +stringLiteralExpCS: STRING; + +booleanLiteralExpCS: 'true' | 'false'; + +unlimitedNaturalLiteralCS: '*'; + +invalidLiteralExpCS: 'invalid'; + +nullLiteralExpCS: 'null'; + +unrestrictedName: + ~( + '(' + | ')' + | 'true' + | 'false' + | 'and' + | 'else' + | 'endif' + | 'false' + | 'if' + | 'implies' + | 'in' + | 'invalid' + | 'let' + | 'not' + | 'null' + | 'or' + | 'self' + | 'then' + | 'true' + | 'xor' + | 'Bag' + | 'Boolean' + | 'Collection' + | 'Integer' + | 'Lambda' + | 'OclAny' + | 'OclInvalid' + | 'OclMessage' + | 'OclSelf' + | 'OclVoid' + | 'OrderedSet' + | 'Real' + | 'Sequence' + | 'Set' + | 'String' + | 'Tuple' + | 'UnlimitedNatural' + ); +unreservedName: + ~( + '(' + | ')' + | 'and' + | 'else' + | 'endif' + | 'false' + | 'if' + | 'implies' + | 'in' + | 'invalid' + | 'let' + | 'not' + | 'null' + | 'or' + | 'self' + | 'then' + | 'true' + | 'xor' + ); STRING: '\'' ~[']* '\''; SPECIAL_VARNAME: '_' STRING; VARNAME: [a-zA-Z_][a-zA-Z_0-9]*; INT: [0-9]+; -FLOAT: INT ('.' INT)? (('e'|'E') ('+'|'-')? INT)?; +FLOAT: INT ('.' INT)? (('e' | 'E') ('+' | '-')? INT)?; -// COMMENT:LINE_COMMENT|BLOCK_COMMENT|DOCU_COMMENT; -// LINE_COMMENT:'--' .*? '\n'; -// BLOCK_COMMENT: '/*' .*? '*/'; -// DOCU_COMMENT: '/**' .*? '*/'; -WS: [ \n\t\r]+ -> skip; +// COMMENT:LINE_COMMENT|BLOCK_COMMENT|DOCU_COMMENT; LINE_COMMENT:'--' .*? '\n'; BLOCK_COMMENT: '/*' +// .*? '*/'; DOCU_COMMENT: '/**' .*? '*/'; +WS: [ \n\t\r]+ -> skip; \ No newline at end of file diff --git a/pyecoreocl/compiler.py b/pyecoreocl/compiler.py index 3c7b933..5bfd81e 100644 --- a/pyecoreocl/compiler.py +++ b/pyecoreocl/compiler.py @@ -2,6 +2,7 @@ from .dummy_rules import RuleSet, default_collection_call, default_primitive_call from .parser import OclExpressionVisitor, OclExpressionParser, OclExpressionLexer +from .parser.OclExpressionParser import CANNOT_EVAL, has_result class DummyVisitor(OclExpressionVisitor): @@ -23,6 +24,9 @@ def unindent(self): self.ind = self.ind[2:] def visitUnaryOperation(self, ctx): + if has_result(ctx): + self.inline(f"{ctx.r}") + return operator = ctx.operator.text space = "" if operator == "-" else " " self.inline(f"{operator}{space}") @@ -43,6 +47,9 @@ def visitPrimaryExpression(self, ctx): return self.visitChildren(ctx) def visitArithmeticBinaryOperation(self, ctx): + if has_result(ctx): + self.inline(f"{ctx.r}") + return self.visit(ctx.left) self.inline(f" {ctx.operator.text} ") self.visit(ctx.right) @@ -54,6 +61,9 @@ def visitFullQualifiedName(self, ctx): self.inline(ctx.text.replace("::", ".")) def visitComparisonBinaryOperation(self, ctx): + if has_result(ctx): + self.inline(f"{ctx.r}") + return self.visit(ctx.left) operator = ctx.operator.text operator = operator if operator != "=" else "==" @@ -68,6 +78,9 @@ def visitCollectionCall(self, ctx): rule(self, ctx) def visitBooleanBinaryOperation(self, ctx): + if has_result(ctx): + self.inline(f"{ctx.r}") + return operator = ctx.operator.text if operator == "implies": self.inline("((not ") @@ -117,13 +130,13 @@ def visitSelfExp(self, ctx): self.inline("self") def visitNumberLiteral(self, ctx): - self.inline(ctx.text) + self.inline(f"{ctx.r}") def visitStringLiteral(self, ctx): self.inline(ctx.text) def visitBooleanLiteral(self, ctx): - self.inline(ctx.text.capitalize()) + self.inline(f"{ctx.r}") def visitUnlimitedNaturalLiteral(self, ctx): return self.visitChildren(ctx) @@ -242,6 +255,14 @@ def visitTuplePartCS(self, ctx): return self.visitChildren(ctx) def visitIfExp(self, ctx): + if isinstance(ctx.condition.r, bool): + if ctx.condition.r: + self.visit(ctx.body) + ctx.r = ctx.body.r + else: + self.visit(ctx.else_) + ctx.r = ctx.else_.r + return self.visit(ctx.body) self.inline(" if ") self.visit(ctx.condition) diff --git a/pyecoreocl/parser/OclExpression.interp b/pyecoreocl/parser/OclExpression.interp index 29e7cb0..a083340 100644 --- a/pyecoreocl/parser/OclExpression.interp +++ b/pyecoreocl/parser/OclExpression.interp @@ -160,4 +160,4 @@ unreservedName atn: -[4, 1, 61, 377, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 4, 0, 67, 8, 0, 11, 0, 12, 0, 68, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 0, 77, 8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 136, 8, 0, 10, 0, 12, 0, 139, 9, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 145, 8, 1, 10, 1, 12, 1, 148, 9, 1, 3, 1, 150, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 157, 8, 1, 10, 1, 12, 1, 160, 9, 1, 1, 1, 1, 1, 3, 1, 164, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 170, 8, 1, 1, 1, 1, 1, 1, 1, 3, 1, 175, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 181, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 191, 8, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 205, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 212, 8, 6, 10, 6, 12, 6, 215, 9, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 3, 7, 222, 8, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 232, 8, 8, 10, 8, 12, 8, 235, 9, 8, 3, 8, 237, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 250, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 262, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 269, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 276, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 5, 14, 284, 8, 14, 10, 14, 12, 14, 287, 9, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 3, 15, 295, 8, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 3, 16, 302, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 4, 17, 310, 8, 17, 11, 17, 12, 17, 311, 5, 17, 314, 8, 17, 10, 17, 12, 17, 317, 9, 17, 1, 18, 1, 18, 1, 18, 3, 18, 322, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 5, 19, 329, 8, 19, 10, 19, 12, 19, 332, 9, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 5, 19, 340, 8, 19, 10, 19, 12, 19, 343, 9, 19, 1, 19, 1, 19, 3, 19, 347, 8, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 0, 2, 0, 34, 30, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 0, 4, 1, 0, 59, 60, 1, 0, 51, 52, 6, 0, 5, 5, 15, 19, 21, 21, 25, 26, 29, 43, 45, 55, 5, 0, 5, 5, 15, 19, 21, 21, 25, 25, 45, 54, 419, 0, 76, 1, 0, 0, 0, 2, 180, 1, 0, 0, 0, 4, 190, 1, 0, 0, 0, 6, 192, 1, 0, 0, 0, 8, 194, 1, 0, 0, 0, 10, 204, 1, 0, 0, 0, 12, 206, 1, 0, 0, 0, 14, 218, 1, 0, 0, 0, 16, 226, 1, 0, 0, 0, 18, 240, 1, 0, 0, 0, 20, 261, 1, 0, 0, 0, 22, 268, 1, 0, 0, 0, 24, 275, 1, 0, 0, 0, 26, 277, 1, 0, 0, 0, 28, 279, 1, 0, 0, 0, 30, 291, 1, 0, 0, 0, 32, 301, 1, 0, 0, 0, 34, 303, 1, 0, 0, 0, 36, 321, 1, 0, 0, 0, 38, 323, 1, 0, 0, 0, 40, 348, 1, 0, 0, 0, 42, 352, 1, 0, 0, 0, 44, 360, 1, 0, 0, 0, 46, 362, 1, 0, 0, 0, 48, 364, 1, 0, 0, 0, 50, 366, 1, 0, 0, 0, 52, 368, 1, 0, 0, 0, 54, 370, 1, 0, 0, 0, 56, 372, 1, 0, 0, 0, 58, 374, 1, 0, 0, 0, 60, 61, 6, 0, -1, 0, 61, 77, 3, 4, 2, 0, 62, 77, 3, 56, 28, 0, 63, 64, 3, 56, 28, 0, 64, 65, 5, 1, 0, 0, 65, 67, 1, 0, 0, 0, 66, 63, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 66, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 71, 3, 58, 29, 0, 71, 77, 1, 0, 0, 0, 72, 73, 5, 4, 0, 0, 73, 77, 3, 0, 0, 16, 74, 75, 5, 5, 0, 0, 75, 77, 3, 0, 0, 15, 76, 60, 1, 0, 0, 0, 76, 62, 1, 0, 0, 0, 76, 66, 1, 0, 0, 0, 76, 72, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 77, 137, 1, 0, 0, 0, 78, 79, 10, 14, 0, 0, 79, 80, 5, 6, 0, 0, 80, 136, 3, 0, 0, 15, 81, 82, 10, 13, 0, 0, 82, 83, 5, 7, 0, 0, 83, 136, 3, 0, 0, 14, 84, 85, 10, 12, 0, 0, 85, 86, 5, 8, 0, 0, 86, 136, 3, 0, 0, 13, 87, 88, 10, 11, 0, 0, 88, 89, 5, 4, 0, 0, 89, 136, 3, 0, 0, 12, 90, 91, 10, 10, 0, 0, 91, 92, 5, 9, 0, 0, 92, 136, 3, 0, 0, 11, 93, 94, 10, 9, 0, 0, 94, 95, 5, 10, 0, 0, 95, 136, 3, 0, 0, 10, 96, 97, 10, 8, 0, 0, 97, 98, 5, 11, 0, 0, 98, 136, 3, 0, 0, 9, 99, 100, 10, 7, 0, 0, 100, 101, 5, 12, 0, 0, 101, 136, 3, 0, 0, 8, 102, 103, 10, 6, 0, 0, 103, 104, 5, 13, 0, 0, 104, 136, 3, 0, 0, 7, 105, 106, 10, 5, 0, 0, 106, 107, 5, 14, 0, 0, 107, 136, 3, 0, 0, 6, 108, 109, 10, 4, 0, 0, 109, 110, 5, 15, 0, 0, 110, 136, 3, 0, 0, 5, 111, 112, 10, 3, 0, 0, 112, 113, 5, 16, 0, 0, 113, 136, 3, 0, 0, 4, 114, 115, 10, 2, 0, 0, 115, 116, 5, 17, 0, 0, 116, 136, 3, 0, 0, 3, 117, 118, 10, 1, 0, 0, 118, 119, 5, 18, 0, 0, 119, 136, 3, 0, 0, 2, 120, 121, 10, 20, 0, 0, 121, 136, 3, 2, 1, 0, 122, 123, 10, 19, 0, 0, 123, 124, 5, 2, 0, 0, 124, 125, 3, 56, 28, 0, 125, 126, 3, 2, 1, 0, 126, 136, 1, 0, 0, 0, 127, 128, 10, 18, 0, 0, 128, 129, 5, 2, 0, 0, 129, 136, 3, 56, 28, 0, 130, 131, 10, 17, 0, 0, 131, 132, 5, 3, 0, 0, 132, 133, 3, 56, 28, 0, 133, 134, 3, 2, 1, 0, 134, 136, 1, 0, 0, 0, 135, 78, 1, 0, 0, 0, 135, 81, 1, 0, 0, 0, 135, 84, 1, 0, 0, 0, 135, 87, 1, 0, 0, 0, 135, 90, 1, 0, 0, 0, 135, 93, 1, 0, 0, 0, 135, 96, 1, 0, 0, 0, 135, 99, 1, 0, 0, 0, 135, 102, 1, 0, 0, 0, 135, 105, 1, 0, 0, 0, 135, 108, 1, 0, 0, 0, 135, 111, 1, 0, 0, 0, 135, 114, 1, 0, 0, 0, 135, 117, 1, 0, 0, 0, 135, 120, 1, 0, 0, 0, 135, 122, 1, 0, 0, 0, 135, 127, 1, 0, 0, 0, 135, 130, 1, 0, 0, 0, 136, 139, 1, 0, 0, 0, 137, 135, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 1, 1, 0, 0, 0, 139, 137, 1, 0, 0, 0, 140, 149, 5, 19, 0, 0, 141, 146, 3, 0, 0, 0, 142, 143, 5, 20, 0, 0, 143, 145, 3, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 148, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 150, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 149, 141, 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 181, 5, 21, 0, 0, 152, 153, 5, 19, 0, 0, 153, 158, 3, 58, 29, 0, 154, 155, 5, 20, 0, 0, 155, 157, 3, 58, 29, 0, 156, 154, 1, 0, 0, 0, 157, 160, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 163, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 161, 162, 5, 22, 0, 0, 162, 164, 3, 32, 16, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 174, 1, 0, 0, 0, 165, 166, 5, 23, 0, 0, 166, 169, 3, 58, 29, 0, 167, 168, 5, 22, 0, 0, 168, 170, 3, 32, 16, 0, 169, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 172, 5, 13, 0, 0, 172, 173, 3, 0, 0, 0, 173, 175, 1, 0, 0, 0, 174, 165, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 177, 5, 24, 0, 0, 177, 178, 3, 0, 0, 0, 178, 179, 5, 21, 0, 0, 179, 181, 1, 0, 0, 0, 180, 140, 1, 0, 0, 0, 180, 152, 1, 0, 0, 0, 181, 3, 1, 0, 0, 0, 182, 191, 3, 6, 3, 0, 183, 191, 3, 8, 4, 0, 184, 191, 3, 10, 5, 0, 185, 191, 3, 12, 6, 0, 186, 191, 3, 16, 8, 0, 187, 191, 3, 26, 13, 0, 188, 191, 3, 28, 14, 0, 189, 191, 3, 42, 21, 0, 190, 182, 1, 0, 0, 0, 190, 183, 1, 0, 0, 0, 190, 184, 1, 0, 0, 0, 190, 185, 1, 0, 0, 0, 190, 186, 1, 0, 0, 0, 190, 187, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 189, 1, 0, 0, 0, 191, 5, 1, 0, 0, 0, 192, 193, 5, 25, 0, 0, 193, 7, 1, 0, 0, 0, 194, 195, 5, 19, 0, 0, 195, 196, 3, 0, 0, 0, 196, 197, 5, 21, 0, 0, 197, 9, 1, 0, 0, 0, 198, 205, 3, 44, 22, 0, 199, 205, 3, 48, 24, 0, 200, 205, 3, 46, 23, 0, 201, 205, 3, 50, 25, 0, 202, 205, 3, 52, 26, 0, 203, 205, 3, 54, 27, 0, 204, 198, 1, 0, 0, 0, 204, 199, 1, 0, 0, 0, 204, 200, 1, 0, 0, 0, 204, 201, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, 203, 1, 0, 0, 0, 205, 11, 1, 0, 0, 0, 206, 207, 5, 26, 0, 0, 207, 208, 5, 27, 0, 0, 208, 213, 3, 14, 7, 0, 209, 210, 5, 20, 0, 0, 210, 212, 3, 14, 7, 0, 211, 209, 1, 0, 0, 0, 212, 215, 1, 0, 0, 0, 213, 211, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 216, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 216, 217, 5, 28, 0, 0, 217, 13, 1, 0, 0, 0, 218, 221, 3, 56, 28, 0, 219, 220, 5, 22, 0, 0, 220, 222, 3, 32, 16, 0, 221, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 224, 5, 13, 0, 0, 224, 225, 3, 4, 2, 0, 225, 15, 1, 0, 0, 0, 226, 227, 3, 18, 9, 0, 227, 236, 5, 27, 0, 0, 228, 233, 3, 24, 12, 0, 229, 230, 5, 20, 0, 0, 230, 232, 3, 24, 12, 0, 231, 229, 1, 0, 0, 0, 232, 235, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 237, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 236, 228, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 238, 1, 0, 0, 0, 238, 239, 5, 28, 0, 0, 239, 17, 1, 0, 0, 0, 240, 249, 3, 22, 11, 0, 241, 242, 5, 19, 0, 0, 242, 243, 3, 32, 16, 0, 243, 244, 5, 21, 0, 0, 244, 250, 1, 0, 0, 0, 245, 246, 5, 9, 0, 0, 246, 247, 3, 32, 16, 0, 247, 248, 5, 10, 0, 0, 248, 250, 1, 0, 0, 0, 249, 241, 1, 0, 0, 0, 249, 245, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 19, 1, 0, 0, 0, 251, 262, 5, 29, 0, 0, 252, 262, 5, 30, 0, 0, 253, 262, 5, 31, 0, 0, 254, 262, 5, 32, 0, 0, 255, 262, 5, 33, 0, 0, 256, 262, 5, 34, 0, 0, 257, 262, 5, 35, 0, 0, 258, 262, 5, 36, 0, 0, 259, 262, 5, 37, 0, 0, 260, 262, 5, 38, 0, 0, 261, 251, 1, 0, 0, 0, 261, 252, 1, 0, 0, 0, 261, 253, 1, 0, 0, 0, 261, 254, 1, 0, 0, 0, 261, 255, 1, 0, 0, 0, 261, 256, 1, 0, 0, 0, 261, 257, 1, 0, 0, 0, 261, 258, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 260, 1, 0, 0, 0, 262, 21, 1, 0, 0, 0, 263, 269, 5, 39, 0, 0, 264, 269, 5, 40, 0, 0, 265, 269, 5, 41, 0, 0, 266, 269, 5, 42, 0, 0, 267, 269, 5, 43, 0, 0, 268, 263, 1, 0, 0, 0, 268, 264, 1, 0, 0, 0, 268, 265, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 267, 1, 0, 0, 0, 269, 23, 1, 0, 0, 0, 270, 276, 3, 0, 0, 0, 271, 272, 3, 0, 0, 0, 272, 273, 5, 44, 0, 0, 273, 274, 3, 0, 0, 0, 274, 276, 1, 0, 0, 0, 275, 270, 1, 0, 0, 0, 275, 271, 1, 0, 0, 0, 276, 25, 1, 0, 0, 0, 277, 278, 3, 36, 18, 0, 278, 27, 1, 0, 0, 0, 279, 280, 5, 45, 0, 0, 280, 285, 3, 30, 15, 0, 281, 282, 5, 20, 0, 0, 282, 284, 3, 30, 15, 0, 283, 281, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 288, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 288, 289, 5, 46, 0, 0, 289, 290, 3, 0, 0, 0, 290, 29, 1, 0, 0, 0, 291, 294, 3, 56, 28, 0, 292, 293, 5, 22, 0, 0, 293, 295, 3, 32, 16, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 297, 5, 13, 0, 0, 297, 298, 3, 0, 0, 0, 298, 31, 1, 0, 0, 0, 299, 302, 3, 36, 18, 0, 300, 302, 3, 34, 17, 0, 301, 299, 1, 0, 0, 0, 301, 300, 1, 0, 0, 0, 302, 33, 1, 0, 0, 0, 303, 304, 6, 17, -1, 0, 304, 305, 3, 56, 28, 0, 305, 315, 1, 0, 0, 0, 306, 309, 10, 1, 0, 0, 307, 308, 5, 1, 0, 0, 308, 310, 3, 58, 29, 0, 309, 307, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 314, 1, 0, 0, 0, 313, 306, 1, 0, 0, 0, 314, 317, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 35, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 318, 322, 3, 18, 9, 0, 319, 322, 3, 20, 10, 0, 320, 322, 3, 38, 19, 0, 321, 318, 1, 0, 0, 0, 321, 319, 1, 0, 0, 0, 321, 320, 1, 0, 0, 0, 322, 37, 1, 0, 0, 0, 323, 346, 5, 26, 0, 0, 324, 325, 5, 19, 0, 0, 325, 330, 3, 40, 20, 0, 326, 327, 5, 20, 0, 0, 327, 329, 3, 40, 20, 0, 328, 326, 1, 0, 0, 0, 329, 332, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 333, 1, 0, 0, 0, 332, 330, 1, 0, 0, 0, 333, 334, 5, 21, 0, 0, 334, 347, 1, 0, 0, 0, 335, 336, 5, 9, 0, 0, 336, 341, 3, 40, 20, 0, 337, 338, 5, 20, 0, 0, 338, 340, 3, 40, 20, 0, 339, 337, 1, 0, 0, 0, 340, 343, 1, 0, 0, 0, 341, 339, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 344, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 344, 345, 5, 10, 0, 0, 345, 347, 1, 0, 0, 0, 346, 324, 1, 0, 0, 0, 346, 335, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 39, 1, 0, 0, 0, 348, 349, 3, 56, 28, 0, 349, 350, 5, 22, 0, 0, 350, 351, 3, 32, 16, 0, 351, 41, 1, 0, 0, 0, 352, 353, 5, 47, 0, 0, 353, 354, 3, 0, 0, 0, 354, 355, 5, 48, 0, 0, 355, 356, 3, 0, 0, 0, 356, 357, 5, 49, 0, 0, 357, 358, 3, 0, 0, 0, 358, 359, 5, 50, 0, 0, 359, 43, 1, 0, 0, 0, 360, 361, 7, 0, 0, 0, 361, 45, 1, 0, 0, 0, 362, 363, 5, 56, 0, 0, 363, 47, 1, 0, 0, 0, 364, 365, 7, 1, 0, 0, 365, 49, 1, 0, 0, 0, 366, 367, 5, 6, 0, 0, 367, 51, 1, 0, 0, 0, 368, 369, 5, 53, 0, 0, 369, 53, 1, 0, 0, 0, 370, 371, 5, 54, 0, 0, 371, 55, 1, 0, 0, 0, 372, 373, 8, 2, 0, 0, 373, 57, 1, 0, 0, 0, 374, 375, 8, 3, 0, 0, 375, 59, 1, 0, 0, 0, 30, 68, 76, 135, 137, 146, 149, 158, 163, 169, 174, 180, 190, 204, 213, 221, 233, 236, 249, 261, 268, 275, 285, 294, 301, 311, 315, 321, 330, 341, 346] \ No newline at end of file +[4, 1, 61, 437, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 4, 0, 71, 8, 0, 11, 0, 12, 0, 72, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 0, 86, 8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 175, 8, 0, 10, 0, 12, 0, 178, 9, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 184, 8, 1, 10, 1, 12, 1, 187, 9, 1, 3, 1, 189, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 196, 8, 1, 10, 1, 12, 1, 199, 9, 1, 1, 1, 1, 1, 3, 1, 203, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 209, 8, 1, 1, 1, 1, 1, 1, 1, 3, 1, 214, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 220, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 234, 8, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 261, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 268, 8, 6, 10, 6, 12, 6, 271, 9, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 3, 7, 278, 8, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 288, 8, 8, 10, 8, 12, 8, 291, 9, 8, 3, 8, 293, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 306, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 318, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 325, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 332, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 5, 14, 340, 8, 14, 10, 14, 12, 14, 343, 9, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 3, 15, 351, 8, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 3, 16, 358, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 4, 17, 366, 8, 17, 11, 17, 12, 17, 367, 5, 17, 370, 8, 17, 10, 17, 12, 17, 373, 9, 17, 1, 18, 1, 18, 1, 18, 3, 18, 378, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 5, 19, 385, 8, 19, 10, 19, 12, 19, 388, 9, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 5, 19, 396, 8, 19, 10, 19, 12, 19, 399, 9, 19, 1, 19, 1, 19, 3, 19, 403, 8, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 421, 8, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 0, 2, 0, 34, 30, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 0, 3, 1, 0, 51, 52, 6, 0, 5, 5, 15, 19, 21, 21, 25, 26, 29, 43, 45, 55, 5, 0, 5, 5, 15, 19, 21, 21, 25, 25, 45, 54, 480, 0, 85, 1, 0, 0, 0, 2, 219, 1, 0, 0, 0, 4, 233, 1, 0, 0, 0, 6, 235, 1, 0, 0, 0, 8, 237, 1, 0, 0, 0, 10, 260, 1, 0, 0, 0, 12, 262, 1, 0, 0, 0, 14, 274, 1, 0, 0, 0, 16, 282, 1, 0, 0, 0, 18, 296, 1, 0, 0, 0, 20, 317, 1, 0, 0, 0, 22, 324, 1, 0, 0, 0, 24, 331, 1, 0, 0, 0, 26, 333, 1, 0, 0, 0, 28, 335, 1, 0, 0, 0, 30, 347, 1, 0, 0, 0, 32, 357, 1, 0, 0, 0, 34, 359, 1, 0, 0, 0, 36, 377, 1, 0, 0, 0, 38, 379, 1, 0, 0, 0, 40, 404, 1, 0, 0, 0, 42, 408, 1, 0, 0, 0, 44, 420, 1, 0, 0, 0, 46, 422, 1, 0, 0, 0, 48, 424, 1, 0, 0, 0, 50, 426, 1, 0, 0, 0, 52, 428, 1, 0, 0, 0, 54, 430, 1, 0, 0, 0, 56, 432, 1, 0, 0, 0, 58, 434, 1, 0, 0, 0, 60, 61, 6, 0, -1, 0, 61, 62, 3, 4, 2, 0, 62, 63, 6, 0, -1, 0, 63, 86, 1, 0, 0, 0, 64, 65, 3, 56, 28, 0, 65, 66, 6, 0, -1, 0, 66, 86, 1, 0, 0, 0, 67, 68, 3, 56, 28, 0, 68, 69, 5, 1, 0, 0, 69, 71, 1, 0, 0, 0, 70, 67, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 74, 1, 0, 0, 0, 74, 75, 3, 58, 29, 0, 75, 76, 6, 0, -1, 0, 76, 86, 1, 0, 0, 0, 77, 78, 5, 4, 0, 0, 78, 79, 3, 0, 0, 16, 79, 80, 6, 0, -1, 0, 80, 86, 1, 0, 0, 0, 81, 82, 5, 5, 0, 0, 82, 83, 3, 0, 0, 15, 83, 84, 6, 0, -1, 0, 84, 86, 1, 0, 0, 0, 85, 60, 1, 0, 0, 0, 85, 64, 1, 0, 0, 0, 85, 70, 1, 0, 0, 0, 85, 77, 1, 0, 0, 0, 85, 81, 1, 0, 0, 0, 86, 176, 1, 0, 0, 0, 87, 88, 10, 14, 0, 0, 88, 89, 5, 6, 0, 0, 89, 90, 3, 0, 0, 15, 90, 91, 6, 0, -1, 0, 91, 175, 1, 0, 0, 0, 92, 93, 10, 13, 0, 0, 93, 94, 5, 7, 0, 0, 94, 95, 3, 0, 0, 14, 95, 96, 6, 0, -1, 0, 96, 175, 1, 0, 0, 0, 97, 98, 10, 12, 0, 0, 98, 99, 5, 8, 0, 0, 99, 100, 3, 0, 0, 13, 100, 101, 6, 0, -1, 0, 101, 175, 1, 0, 0, 0, 102, 103, 10, 11, 0, 0, 103, 104, 5, 4, 0, 0, 104, 105, 3, 0, 0, 12, 105, 106, 6, 0, -1, 0, 106, 175, 1, 0, 0, 0, 107, 108, 10, 10, 0, 0, 108, 109, 5, 9, 0, 0, 109, 110, 3, 0, 0, 11, 110, 111, 6, 0, -1, 0, 111, 175, 1, 0, 0, 0, 112, 113, 10, 9, 0, 0, 113, 114, 5, 10, 0, 0, 114, 115, 3, 0, 0, 10, 115, 116, 6, 0, -1, 0, 116, 175, 1, 0, 0, 0, 117, 118, 10, 8, 0, 0, 118, 119, 5, 11, 0, 0, 119, 120, 3, 0, 0, 9, 120, 121, 6, 0, -1, 0, 121, 175, 1, 0, 0, 0, 122, 123, 10, 7, 0, 0, 123, 124, 5, 12, 0, 0, 124, 125, 3, 0, 0, 8, 125, 126, 6, 0, -1, 0, 126, 175, 1, 0, 0, 0, 127, 128, 10, 6, 0, 0, 128, 129, 5, 13, 0, 0, 129, 130, 3, 0, 0, 7, 130, 131, 6, 0, -1, 0, 131, 175, 1, 0, 0, 0, 132, 133, 10, 5, 0, 0, 133, 134, 5, 14, 0, 0, 134, 135, 3, 0, 0, 6, 135, 136, 6, 0, -1, 0, 136, 175, 1, 0, 0, 0, 137, 138, 10, 4, 0, 0, 138, 139, 5, 15, 0, 0, 139, 140, 3, 0, 0, 5, 140, 141, 6, 0, -1, 0, 141, 175, 1, 0, 0, 0, 142, 143, 10, 3, 0, 0, 143, 144, 5, 16, 0, 0, 144, 145, 3, 0, 0, 4, 145, 146, 6, 0, -1, 0, 146, 175, 1, 0, 0, 0, 147, 148, 10, 2, 0, 0, 148, 149, 5, 17, 0, 0, 149, 175, 3, 0, 0, 3, 150, 151, 10, 1, 0, 0, 151, 152, 5, 18, 0, 0, 152, 175, 3, 0, 0, 2, 153, 154, 10, 20, 0, 0, 154, 155, 3, 2, 1, 0, 155, 156, 6, 0, -1, 0, 156, 175, 1, 0, 0, 0, 157, 158, 10, 19, 0, 0, 158, 159, 5, 2, 0, 0, 159, 160, 3, 56, 28, 0, 160, 161, 3, 2, 1, 0, 161, 162, 6, 0, -1, 0, 162, 175, 1, 0, 0, 0, 163, 164, 10, 18, 0, 0, 164, 165, 5, 2, 0, 0, 165, 166, 3, 56, 28, 0, 166, 167, 6, 0, -1, 0, 167, 175, 1, 0, 0, 0, 168, 169, 10, 17, 0, 0, 169, 170, 5, 3, 0, 0, 170, 171, 3, 56, 28, 0, 171, 172, 3, 2, 1, 0, 172, 173, 6, 0, -1, 0, 173, 175, 1, 0, 0, 0, 174, 87, 1, 0, 0, 0, 174, 92, 1, 0, 0, 0, 174, 97, 1, 0, 0, 0, 174, 102, 1, 0, 0, 0, 174, 107, 1, 0, 0, 0, 174, 112, 1, 0, 0, 0, 174, 117, 1, 0, 0, 0, 174, 122, 1, 0, 0, 0, 174, 127, 1, 0, 0, 0, 174, 132, 1, 0, 0, 0, 174, 137, 1, 0, 0, 0, 174, 142, 1, 0, 0, 0, 174, 147, 1, 0, 0, 0, 174, 150, 1, 0, 0, 0, 174, 153, 1, 0, 0, 0, 174, 157, 1, 0, 0, 0, 174, 163, 1, 0, 0, 0, 174, 168, 1, 0, 0, 0, 175, 178, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 1, 1, 0, 0, 0, 178, 176, 1, 0, 0, 0, 179, 188, 5, 19, 0, 0, 180, 185, 3, 0, 0, 0, 181, 182, 5, 20, 0, 0, 182, 184, 3, 0, 0, 0, 183, 181, 1, 0, 0, 0, 184, 187, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 188, 180, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 220, 5, 21, 0, 0, 191, 192, 5, 19, 0, 0, 192, 197, 3, 58, 29, 0, 193, 194, 5, 20, 0, 0, 194, 196, 3, 58, 29, 0, 195, 193, 1, 0, 0, 0, 196, 199, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 202, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 200, 201, 5, 22, 0, 0, 201, 203, 3, 32, 16, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 213, 1, 0, 0, 0, 204, 205, 5, 23, 0, 0, 205, 208, 3, 58, 29, 0, 206, 207, 5, 22, 0, 0, 207, 209, 3, 32, 16, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 211, 5, 13, 0, 0, 211, 212, 3, 0, 0, 0, 212, 214, 1, 0, 0, 0, 213, 204, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 216, 5, 24, 0, 0, 216, 217, 3, 0, 0, 0, 217, 218, 5, 21, 0, 0, 218, 220, 1, 0, 0, 0, 219, 179, 1, 0, 0, 0, 219, 191, 1, 0, 0, 0, 220, 3, 1, 0, 0, 0, 221, 234, 3, 6, 3, 0, 222, 223, 3, 8, 4, 0, 223, 224, 6, 2, -1, 0, 224, 234, 1, 0, 0, 0, 225, 226, 3, 10, 5, 0, 226, 227, 6, 2, -1, 0, 227, 234, 1, 0, 0, 0, 228, 234, 3, 12, 6, 0, 229, 234, 3, 16, 8, 0, 230, 234, 3, 26, 13, 0, 231, 234, 3, 28, 14, 0, 232, 234, 3, 42, 21, 0, 233, 221, 1, 0, 0, 0, 233, 222, 1, 0, 0, 0, 233, 225, 1, 0, 0, 0, 233, 228, 1, 0, 0, 0, 233, 229, 1, 0, 0, 0, 233, 230, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 232, 1, 0, 0, 0, 234, 5, 1, 0, 0, 0, 235, 236, 5, 25, 0, 0, 236, 7, 1, 0, 0, 0, 237, 238, 5, 19, 0, 0, 238, 239, 3, 0, 0, 0, 239, 240, 5, 21, 0, 0, 240, 241, 6, 4, -1, 0, 241, 9, 1, 0, 0, 0, 242, 243, 3, 44, 22, 0, 243, 244, 6, 5, -1, 0, 244, 261, 1, 0, 0, 0, 245, 246, 3, 48, 24, 0, 246, 247, 6, 5, -1, 0, 247, 261, 1, 0, 0, 0, 248, 249, 3, 46, 23, 0, 249, 250, 6, 5, -1, 0, 250, 261, 1, 0, 0, 0, 251, 252, 3, 50, 25, 0, 252, 253, 6, 5, -1, 0, 253, 261, 1, 0, 0, 0, 254, 255, 3, 52, 26, 0, 255, 256, 6, 5, -1, 0, 256, 261, 1, 0, 0, 0, 257, 258, 3, 54, 27, 0, 258, 259, 6, 5, -1, 0, 259, 261, 1, 0, 0, 0, 260, 242, 1, 0, 0, 0, 260, 245, 1, 0, 0, 0, 260, 248, 1, 0, 0, 0, 260, 251, 1, 0, 0, 0, 260, 254, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 261, 11, 1, 0, 0, 0, 262, 263, 5, 26, 0, 0, 263, 264, 5, 27, 0, 0, 264, 269, 3, 14, 7, 0, 265, 266, 5, 20, 0, 0, 266, 268, 3, 14, 7, 0, 267, 265, 1, 0, 0, 0, 268, 271, 1, 0, 0, 0, 269, 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 272, 1, 0, 0, 0, 271, 269, 1, 0, 0, 0, 272, 273, 5, 28, 0, 0, 273, 13, 1, 0, 0, 0, 274, 277, 3, 56, 28, 0, 275, 276, 5, 22, 0, 0, 276, 278, 3, 32, 16, 0, 277, 275, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 280, 5, 13, 0, 0, 280, 281, 3, 4, 2, 0, 281, 15, 1, 0, 0, 0, 282, 283, 3, 18, 9, 0, 283, 292, 5, 27, 0, 0, 284, 289, 3, 24, 12, 0, 285, 286, 5, 20, 0, 0, 286, 288, 3, 24, 12, 0, 287, 285, 1, 0, 0, 0, 288, 291, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 293, 1, 0, 0, 0, 291, 289, 1, 0, 0, 0, 292, 284, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 295, 5, 28, 0, 0, 295, 17, 1, 0, 0, 0, 296, 305, 3, 22, 11, 0, 297, 298, 5, 19, 0, 0, 298, 299, 3, 32, 16, 0, 299, 300, 5, 21, 0, 0, 300, 306, 1, 0, 0, 0, 301, 302, 5, 9, 0, 0, 302, 303, 3, 32, 16, 0, 303, 304, 5, 10, 0, 0, 304, 306, 1, 0, 0, 0, 305, 297, 1, 0, 0, 0, 305, 301, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 19, 1, 0, 0, 0, 307, 318, 5, 29, 0, 0, 308, 318, 5, 30, 0, 0, 309, 318, 5, 31, 0, 0, 310, 318, 5, 32, 0, 0, 311, 318, 5, 33, 0, 0, 312, 318, 5, 34, 0, 0, 313, 318, 5, 35, 0, 0, 314, 318, 5, 36, 0, 0, 315, 318, 5, 37, 0, 0, 316, 318, 5, 38, 0, 0, 317, 307, 1, 0, 0, 0, 317, 308, 1, 0, 0, 0, 317, 309, 1, 0, 0, 0, 317, 310, 1, 0, 0, 0, 317, 311, 1, 0, 0, 0, 317, 312, 1, 0, 0, 0, 317, 313, 1, 0, 0, 0, 317, 314, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 317, 316, 1, 0, 0, 0, 318, 21, 1, 0, 0, 0, 319, 325, 5, 39, 0, 0, 320, 325, 5, 40, 0, 0, 321, 325, 5, 41, 0, 0, 322, 325, 5, 42, 0, 0, 323, 325, 5, 43, 0, 0, 324, 319, 1, 0, 0, 0, 324, 320, 1, 0, 0, 0, 324, 321, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 324, 323, 1, 0, 0, 0, 325, 23, 1, 0, 0, 0, 326, 332, 3, 0, 0, 0, 327, 328, 3, 0, 0, 0, 328, 329, 5, 44, 0, 0, 329, 330, 3, 0, 0, 0, 330, 332, 1, 0, 0, 0, 331, 326, 1, 0, 0, 0, 331, 327, 1, 0, 0, 0, 332, 25, 1, 0, 0, 0, 333, 334, 3, 36, 18, 0, 334, 27, 1, 0, 0, 0, 335, 336, 5, 45, 0, 0, 336, 341, 3, 30, 15, 0, 337, 338, 5, 20, 0, 0, 338, 340, 3, 30, 15, 0, 339, 337, 1, 0, 0, 0, 340, 343, 1, 0, 0, 0, 341, 339, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 344, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 344, 345, 5, 46, 0, 0, 345, 346, 3, 0, 0, 0, 346, 29, 1, 0, 0, 0, 347, 350, 3, 56, 28, 0, 348, 349, 5, 22, 0, 0, 349, 351, 3, 32, 16, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 353, 5, 13, 0, 0, 353, 354, 3, 0, 0, 0, 354, 31, 1, 0, 0, 0, 355, 358, 3, 36, 18, 0, 356, 358, 3, 34, 17, 0, 357, 355, 1, 0, 0, 0, 357, 356, 1, 0, 0, 0, 358, 33, 1, 0, 0, 0, 359, 360, 6, 17, -1, 0, 360, 361, 3, 56, 28, 0, 361, 371, 1, 0, 0, 0, 362, 365, 10, 1, 0, 0, 363, 364, 5, 1, 0, 0, 364, 366, 3, 58, 29, 0, 365, 363, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 370, 1, 0, 0, 0, 369, 362, 1, 0, 0, 0, 370, 373, 1, 0, 0, 0, 371, 369, 1, 0, 0, 0, 371, 372, 1, 0, 0, 0, 372, 35, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 374, 378, 3, 18, 9, 0, 375, 378, 3, 20, 10, 0, 376, 378, 3, 38, 19, 0, 377, 374, 1, 0, 0, 0, 377, 375, 1, 0, 0, 0, 377, 376, 1, 0, 0, 0, 378, 37, 1, 0, 0, 0, 379, 402, 5, 26, 0, 0, 380, 381, 5, 19, 0, 0, 381, 386, 3, 40, 20, 0, 382, 383, 5, 20, 0, 0, 383, 385, 3, 40, 20, 0, 384, 382, 1, 0, 0, 0, 385, 388, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 386, 387, 1, 0, 0, 0, 387, 389, 1, 0, 0, 0, 388, 386, 1, 0, 0, 0, 389, 390, 5, 21, 0, 0, 390, 403, 1, 0, 0, 0, 391, 392, 5, 9, 0, 0, 392, 397, 3, 40, 20, 0, 393, 394, 5, 20, 0, 0, 394, 396, 3, 40, 20, 0, 395, 393, 1, 0, 0, 0, 396, 399, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 397, 398, 1, 0, 0, 0, 398, 400, 1, 0, 0, 0, 399, 397, 1, 0, 0, 0, 400, 401, 5, 10, 0, 0, 401, 403, 1, 0, 0, 0, 402, 380, 1, 0, 0, 0, 402, 391, 1, 0, 0, 0, 402, 403, 1, 0, 0, 0, 403, 39, 1, 0, 0, 0, 404, 405, 3, 56, 28, 0, 405, 406, 5, 22, 0, 0, 406, 407, 3, 32, 16, 0, 407, 41, 1, 0, 0, 0, 408, 409, 5, 47, 0, 0, 409, 410, 3, 0, 0, 0, 410, 411, 5, 48, 0, 0, 411, 412, 3, 0, 0, 0, 412, 413, 5, 49, 0, 0, 413, 414, 3, 0, 0, 0, 414, 415, 5, 50, 0, 0, 415, 43, 1, 0, 0, 0, 416, 417, 5, 59, 0, 0, 417, 421, 6, 22, -1, 0, 418, 419, 5, 60, 0, 0, 419, 421, 6, 22, -1, 0, 420, 416, 1, 0, 0, 0, 420, 418, 1, 0, 0, 0, 421, 45, 1, 0, 0, 0, 422, 423, 5, 56, 0, 0, 423, 47, 1, 0, 0, 0, 424, 425, 7, 0, 0, 0, 425, 49, 1, 0, 0, 0, 426, 427, 5, 6, 0, 0, 427, 51, 1, 0, 0, 0, 428, 429, 5, 53, 0, 0, 429, 53, 1, 0, 0, 0, 430, 431, 5, 54, 0, 0, 431, 55, 1, 0, 0, 0, 432, 433, 8, 1, 0, 0, 433, 57, 1, 0, 0, 0, 434, 435, 8, 2, 0, 0, 435, 59, 1, 0, 0, 0, 31, 72, 85, 174, 176, 185, 188, 197, 202, 208, 213, 219, 233, 260, 269, 277, 289, 292, 305, 317, 324, 331, 341, 350, 357, 367, 371, 377, 386, 397, 402, 420] \ No newline at end of file diff --git a/pyecoreocl/parser/OclExpressionParser.py b/pyecoreocl/parser/OclExpressionParser.py index e3bd3f0..63b678b 100644 --- a/pyecoreocl/parser/OclExpressionParser.py +++ b/pyecoreocl/parser/OclExpressionParser.py @@ -8,146 +8,178 @@ else: from typing.io import TextIO + +OBJ = object +CANNOT_EVAL = object() # define a sentinel object + +def has_result(*args): + return all(e.r is not None and e.r is not CANNOT_EVAL for e in args) + +def f(vs, ts, eval): + for v, t in zip(vs, ts): + if v is CANNOT_EVAL or not isinstance(v, t): + return CANNOT_EVAL + return eval(*vs) + def serializedATN(): return [ - 4,1,61,377,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 4,1,61,437,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13, 2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20, 7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26, - 2,27,7,27,2,28,7,28,2,29,7,29,1,0,1,0,1,0,1,0,1,0,1,0,4,0,67,8,0, - 11,0,12,0,68,1,0,1,0,1,0,1,0,1,0,1,0,3,0,77,8,0,1,0,1,0,1,0,1,0, + 2,27,7,27,2,28,7,28,2,29,7,29,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, + 0,1,0,4,0,71,8,0,11,0,12,0,72,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, + 0,1,0,1,0,3,0,86,8,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, + 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, - 1,0,1,0,1,0,1,0,1,0,5,0,136,8,0,10,0,12,0,139,9,0,1,1,1,1,1,1,1, - 1,5,1,145,8,1,10,1,12,1,148,9,1,3,1,150,8,1,1,1,1,1,1,1,1,1,1,1, - 5,1,157,8,1,10,1,12,1,160,9,1,1,1,1,1,3,1,164,8,1,1,1,1,1,1,1,1, - 1,3,1,170,8,1,1,1,1,1,1,1,3,1,175,8,1,1,1,1,1,1,1,1,1,3,1,181,8, - 1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,3,2,191,8,2,1,3,1,3,1,4,1,4,1, - 4,1,4,1,5,1,5,1,5,1,5,1,5,1,5,3,5,205,8,5,1,6,1,6,1,6,1,6,1,6,5, - 6,212,8,6,10,6,12,6,215,9,6,1,6,1,6,1,7,1,7,1,7,3,7,222,8,7,1,7, - 1,7,1,7,1,8,1,8,1,8,1,8,1,8,5,8,232,8,8,10,8,12,8,235,9,8,3,8,237, - 8,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,3,9,250,8,9,1,10, - 1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,10,3,10,262,8,10,1,11, - 1,11,1,11,1,11,1,11,3,11,269,8,11,1,12,1,12,1,12,1,12,1,12,3,12, - 276,8,12,1,13,1,13,1,14,1,14,1,14,1,14,5,14,284,8,14,10,14,12,14, - 287,9,14,1,14,1,14,1,14,1,15,1,15,1,15,3,15,295,8,15,1,15,1,15,1, - 15,1,16,1,16,3,16,302,8,16,1,17,1,17,1,17,1,17,1,17,1,17,4,17,310, - 8,17,11,17,12,17,311,5,17,314,8,17,10,17,12,17,317,9,17,1,18,1,18, - 1,18,3,18,322,8,18,1,19,1,19,1,19,1,19,1,19,5,19,329,8,19,10,19, - 12,19,332,9,19,1,19,1,19,1,19,1,19,1,19,1,19,5,19,340,8,19,10,19, - 12,19,343,9,19,1,19,1,19,3,19,347,8,19,1,20,1,20,1,20,1,20,1,21, - 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,22,1,22,1,23,1,23,1,24,1,24, - 1,25,1,25,1,26,1,26,1,27,1,27,1,28,1,28,1,29,1,29,1,29,0,2,0,34, - 30,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42, - 44,46,48,50,52,54,56,58,0,4,1,0,59,60,1,0,51,52,6,0,5,5,15,19,21, - 21,25,26,29,43,45,55,5,0,5,5,15,19,21,21,25,25,45,54,419,0,76,1, - 0,0,0,2,180,1,0,0,0,4,190,1,0,0,0,6,192,1,0,0,0,8,194,1,0,0,0,10, - 204,1,0,0,0,12,206,1,0,0,0,14,218,1,0,0,0,16,226,1,0,0,0,18,240, - 1,0,0,0,20,261,1,0,0,0,22,268,1,0,0,0,24,275,1,0,0,0,26,277,1,0, - 0,0,28,279,1,0,0,0,30,291,1,0,0,0,32,301,1,0,0,0,34,303,1,0,0,0, - 36,321,1,0,0,0,38,323,1,0,0,0,40,348,1,0,0,0,42,352,1,0,0,0,44,360, - 1,0,0,0,46,362,1,0,0,0,48,364,1,0,0,0,50,366,1,0,0,0,52,368,1,0, - 0,0,54,370,1,0,0,0,56,372,1,0,0,0,58,374,1,0,0,0,60,61,6,0,-1,0, - 61,77,3,4,2,0,62,77,3,56,28,0,63,64,3,56,28,0,64,65,5,1,0,0,65,67, - 1,0,0,0,66,63,1,0,0,0,67,68,1,0,0,0,68,66,1,0,0,0,68,69,1,0,0,0, - 69,70,1,0,0,0,70,71,3,58,29,0,71,77,1,0,0,0,72,73,5,4,0,0,73,77, - 3,0,0,16,74,75,5,5,0,0,75,77,3,0,0,15,76,60,1,0,0,0,76,62,1,0,0, - 0,76,66,1,0,0,0,76,72,1,0,0,0,76,74,1,0,0,0,77,137,1,0,0,0,78,79, - 10,14,0,0,79,80,5,6,0,0,80,136,3,0,0,15,81,82,10,13,0,0,82,83,5, - 7,0,0,83,136,3,0,0,14,84,85,10,12,0,0,85,86,5,8,0,0,86,136,3,0,0, - 13,87,88,10,11,0,0,88,89,5,4,0,0,89,136,3,0,0,12,90,91,10,10,0,0, - 91,92,5,9,0,0,92,136,3,0,0,11,93,94,10,9,0,0,94,95,5,10,0,0,95,136, - 3,0,0,10,96,97,10,8,0,0,97,98,5,11,0,0,98,136,3,0,0,9,99,100,10, - 7,0,0,100,101,5,12,0,0,101,136,3,0,0,8,102,103,10,6,0,0,103,104, - 5,13,0,0,104,136,3,0,0,7,105,106,10,5,0,0,106,107,5,14,0,0,107,136, - 3,0,0,6,108,109,10,4,0,0,109,110,5,15,0,0,110,136,3,0,0,5,111,112, - 10,3,0,0,112,113,5,16,0,0,113,136,3,0,0,4,114,115,10,2,0,0,115,116, - 5,17,0,0,116,136,3,0,0,3,117,118,10,1,0,0,118,119,5,18,0,0,119,136, - 3,0,0,2,120,121,10,20,0,0,121,136,3,2,1,0,122,123,10,19,0,0,123, - 124,5,2,0,0,124,125,3,56,28,0,125,126,3,2,1,0,126,136,1,0,0,0,127, - 128,10,18,0,0,128,129,5,2,0,0,129,136,3,56,28,0,130,131,10,17,0, - 0,131,132,5,3,0,0,132,133,3,56,28,0,133,134,3,2,1,0,134,136,1,0, - 0,0,135,78,1,0,0,0,135,81,1,0,0,0,135,84,1,0,0,0,135,87,1,0,0,0, - 135,90,1,0,0,0,135,93,1,0,0,0,135,96,1,0,0,0,135,99,1,0,0,0,135, - 102,1,0,0,0,135,105,1,0,0,0,135,108,1,0,0,0,135,111,1,0,0,0,135, - 114,1,0,0,0,135,117,1,0,0,0,135,120,1,0,0,0,135,122,1,0,0,0,135, - 127,1,0,0,0,135,130,1,0,0,0,136,139,1,0,0,0,137,135,1,0,0,0,137, - 138,1,0,0,0,138,1,1,0,0,0,139,137,1,0,0,0,140,149,5,19,0,0,141,146, - 3,0,0,0,142,143,5,20,0,0,143,145,3,0,0,0,144,142,1,0,0,0,145,148, - 1,0,0,0,146,144,1,0,0,0,146,147,1,0,0,0,147,150,1,0,0,0,148,146, - 1,0,0,0,149,141,1,0,0,0,149,150,1,0,0,0,150,151,1,0,0,0,151,181, - 5,21,0,0,152,153,5,19,0,0,153,158,3,58,29,0,154,155,5,20,0,0,155, - 157,3,58,29,0,156,154,1,0,0,0,157,160,1,0,0,0,158,156,1,0,0,0,158, - 159,1,0,0,0,159,163,1,0,0,0,160,158,1,0,0,0,161,162,5,22,0,0,162, - 164,3,32,16,0,163,161,1,0,0,0,163,164,1,0,0,0,164,174,1,0,0,0,165, - 166,5,23,0,0,166,169,3,58,29,0,167,168,5,22,0,0,168,170,3,32,16, - 0,169,167,1,0,0,0,169,170,1,0,0,0,170,171,1,0,0,0,171,172,5,13,0, - 0,172,173,3,0,0,0,173,175,1,0,0,0,174,165,1,0,0,0,174,175,1,0,0, - 0,175,176,1,0,0,0,176,177,5,24,0,0,177,178,3,0,0,0,178,179,5,21, - 0,0,179,181,1,0,0,0,180,140,1,0,0,0,180,152,1,0,0,0,181,3,1,0,0, - 0,182,191,3,6,3,0,183,191,3,8,4,0,184,191,3,10,5,0,185,191,3,12, - 6,0,186,191,3,16,8,0,187,191,3,26,13,0,188,191,3,28,14,0,189,191, - 3,42,21,0,190,182,1,0,0,0,190,183,1,0,0,0,190,184,1,0,0,0,190,185, - 1,0,0,0,190,186,1,0,0,0,190,187,1,0,0,0,190,188,1,0,0,0,190,189, - 1,0,0,0,191,5,1,0,0,0,192,193,5,25,0,0,193,7,1,0,0,0,194,195,5,19, - 0,0,195,196,3,0,0,0,196,197,5,21,0,0,197,9,1,0,0,0,198,205,3,44, - 22,0,199,205,3,48,24,0,200,205,3,46,23,0,201,205,3,50,25,0,202,205, - 3,52,26,0,203,205,3,54,27,0,204,198,1,0,0,0,204,199,1,0,0,0,204, - 200,1,0,0,0,204,201,1,0,0,0,204,202,1,0,0,0,204,203,1,0,0,0,205, - 11,1,0,0,0,206,207,5,26,0,0,207,208,5,27,0,0,208,213,3,14,7,0,209, - 210,5,20,0,0,210,212,3,14,7,0,211,209,1,0,0,0,212,215,1,0,0,0,213, - 211,1,0,0,0,213,214,1,0,0,0,214,216,1,0,0,0,215,213,1,0,0,0,216, - 217,5,28,0,0,217,13,1,0,0,0,218,221,3,56,28,0,219,220,5,22,0,0,220, - 222,3,32,16,0,221,219,1,0,0,0,221,222,1,0,0,0,222,223,1,0,0,0,223, - 224,5,13,0,0,224,225,3,4,2,0,225,15,1,0,0,0,226,227,3,18,9,0,227, - 236,5,27,0,0,228,233,3,24,12,0,229,230,5,20,0,0,230,232,3,24,12, - 0,231,229,1,0,0,0,232,235,1,0,0,0,233,231,1,0,0,0,233,234,1,0,0, - 0,234,237,1,0,0,0,235,233,1,0,0,0,236,228,1,0,0,0,236,237,1,0,0, - 0,237,238,1,0,0,0,238,239,5,28,0,0,239,17,1,0,0,0,240,249,3,22,11, - 0,241,242,5,19,0,0,242,243,3,32,16,0,243,244,5,21,0,0,244,250,1, - 0,0,0,245,246,5,9,0,0,246,247,3,32,16,0,247,248,5,10,0,0,248,250, - 1,0,0,0,249,241,1,0,0,0,249,245,1,0,0,0,249,250,1,0,0,0,250,19,1, - 0,0,0,251,262,5,29,0,0,252,262,5,30,0,0,253,262,5,31,0,0,254,262, - 5,32,0,0,255,262,5,33,0,0,256,262,5,34,0,0,257,262,5,35,0,0,258, - 262,5,36,0,0,259,262,5,37,0,0,260,262,5,38,0,0,261,251,1,0,0,0,261, - 252,1,0,0,0,261,253,1,0,0,0,261,254,1,0,0,0,261,255,1,0,0,0,261, - 256,1,0,0,0,261,257,1,0,0,0,261,258,1,0,0,0,261,259,1,0,0,0,261, - 260,1,0,0,0,262,21,1,0,0,0,263,269,5,39,0,0,264,269,5,40,0,0,265, - 269,5,41,0,0,266,269,5,42,0,0,267,269,5,43,0,0,268,263,1,0,0,0,268, - 264,1,0,0,0,268,265,1,0,0,0,268,266,1,0,0,0,268,267,1,0,0,0,269, - 23,1,0,0,0,270,276,3,0,0,0,271,272,3,0,0,0,272,273,5,44,0,0,273, - 274,3,0,0,0,274,276,1,0,0,0,275,270,1,0,0,0,275,271,1,0,0,0,276, - 25,1,0,0,0,277,278,3,36,18,0,278,27,1,0,0,0,279,280,5,45,0,0,280, - 285,3,30,15,0,281,282,5,20,0,0,282,284,3,30,15,0,283,281,1,0,0,0, - 284,287,1,0,0,0,285,283,1,0,0,0,285,286,1,0,0,0,286,288,1,0,0,0, - 287,285,1,0,0,0,288,289,5,46,0,0,289,290,3,0,0,0,290,29,1,0,0,0, - 291,294,3,56,28,0,292,293,5,22,0,0,293,295,3,32,16,0,294,292,1,0, - 0,0,294,295,1,0,0,0,295,296,1,0,0,0,296,297,5,13,0,0,297,298,3,0, - 0,0,298,31,1,0,0,0,299,302,3,36,18,0,300,302,3,34,17,0,301,299,1, - 0,0,0,301,300,1,0,0,0,302,33,1,0,0,0,303,304,6,17,-1,0,304,305,3, - 56,28,0,305,315,1,0,0,0,306,309,10,1,0,0,307,308,5,1,0,0,308,310, - 3,58,29,0,309,307,1,0,0,0,310,311,1,0,0,0,311,309,1,0,0,0,311,312, - 1,0,0,0,312,314,1,0,0,0,313,306,1,0,0,0,314,317,1,0,0,0,315,313, - 1,0,0,0,315,316,1,0,0,0,316,35,1,0,0,0,317,315,1,0,0,0,318,322,3, - 18,9,0,319,322,3,20,10,0,320,322,3,38,19,0,321,318,1,0,0,0,321,319, - 1,0,0,0,321,320,1,0,0,0,322,37,1,0,0,0,323,346,5,26,0,0,324,325, - 5,19,0,0,325,330,3,40,20,0,326,327,5,20,0,0,327,329,3,40,20,0,328, - 326,1,0,0,0,329,332,1,0,0,0,330,328,1,0,0,0,330,331,1,0,0,0,331, - 333,1,0,0,0,332,330,1,0,0,0,333,334,5,21,0,0,334,347,1,0,0,0,335, - 336,5,9,0,0,336,341,3,40,20,0,337,338,5,20,0,0,338,340,3,40,20,0, - 339,337,1,0,0,0,340,343,1,0,0,0,341,339,1,0,0,0,341,342,1,0,0,0, - 342,344,1,0,0,0,343,341,1,0,0,0,344,345,5,10,0,0,345,347,1,0,0,0, - 346,324,1,0,0,0,346,335,1,0,0,0,346,347,1,0,0,0,347,39,1,0,0,0,348, - 349,3,56,28,0,349,350,5,22,0,0,350,351,3,32,16,0,351,41,1,0,0,0, - 352,353,5,47,0,0,353,354,3,0,0,0,354,355,5,48,0,0,355,356,3,0,0, - 0,356,357,5,49,0,0,357,358,3,0,0,0,358,359,5,50,0,0,359,43,1,0,0, - 0,360,361,7,0,0,0,361,45,1,0,0,0,362,363,5,56,0,0,363,47,1,0,0,0, - 364,365,7,1,0,0,365,49,1,0,0,0,366,367,5,6,0,0,367,51,1,0,0,0,368, - 369,5,53,0,0,369,53,1,0,0,0,370,371,5,54,0,0,371,55,1,0,0,0,372, - 373,8,2,0,0,373,57,1,0,0,0,374,375,8,3,0,0,375,59,1,0,0,0,30,68, - 76,135,137,146,149,158,163,169,174,180,190,204,213,221,233,236,249, - 261,268,275,285,294,301,311,315,321,330,341,346 + 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,5,0,175,8,0,10,0, + 12,0,178,9,0,1,1,1,1,1,1,1,1,5,1,184,8,1,10,1,12,1,187,9,1,3,1,189, + 8,1,1,1,1,1,1,1,1,1,1,1,5,1,196,8,1,10,1,12,1,199,9,1,1,1,1,1,3, + 1,203,8,1,1,1,1,1,1,1,1,1,3,1,209,8,1,1,1,1,1,1,1,3,1,214,8,1,1, + 1,1,1,1,1,1,1,3,1,220,8,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1, + 2,1,2,1,2,3,2,234,8,2,1,3,1,3,1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,5,1, + 5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,3,5,261, + 8,5,1,6,1,6,1,6,1,6,1,6,5,6,268,8,6,10,6,12,6,271,9,6,1,6,1,6,1, + 7,1,7,1,7,3,7,278,8,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,8,5,8,288,8, + 8,10,8,12,8,291,9,8,3,8,293,8,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,9, + 1,9,1,9,1,9,3,9,306,8,9,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,10, + 1,10,1,10,3,10,318,8,10,1,11,1,11,1,11,1,11,1,11,3,11,325,8,11,1, + 12,1,12,1,12,1,12,1,12,3,12,332,8,12,1,13,1,13,1,14,1,14,1,14,1, + 14,5,14,340,8,14,10,14,12,14,343,9,14,1,14,1,14,1,14,1,15,1,15,1, + 15,3,15,351,8,15,1,15,1,15,1,15,1,16,1,16,3,16,358,8,16,1,17,1,17, + 1,17,1,17,1,17,1,17,4,17,366,8,17,11,17,12,17,367,5,17,370,8,17, + 10,17,12,17,373,9,17,1,18,1,18,1,18,3,18,378,8,18,1,19,1,19,1,19, + 1,19,1,19,5,19,385,8,19,10,19,12,19,388,9,19,1,19,1,19,1,19,1,19, + 1,19,1,19,5,19,396,8,19,10,19,12,19,399,9,19,1,19,1,19,3,19,403, + 8,19,1,20,1,20,1,20,1,20,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, + 1,22,1,22,1,22,1,22,3,22,421,8,22,1,23,1,23,1,24,1,24,1,25,1,25, + 1,26,1,26,1,27,1,27,1,28,1,28,1,29,1,29,1,29,0,2,0,34,30,0,2,4,6, + 8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50, + 52,54,56,58,0,3,1,0,51,52,6,0,5,5,15,19,21,21,25,26,29,43,45,55, + 5,0,5,5,15,19,21,21,25,25,45,54,480,0,85,1,0,0,0,2,219,1,0,0,0,4, + 233,1,0,0,0,6,235,1,0,0,0,8,237,1,0,0,0,10,260,1,0,0,0,12,262,1, + 0,0,0,14,274,1,0,0,0,16,282,1,0,0,0,18,296,1,0,0,0,20,317,1,0,0, + 0,22,324,1,0,0,0,24,331,1,0,0,0,26,333,1,0,0,0,28,335,1,0,0,0,30, + 347,1,0,0,0,32,357,1,0,0,0,34,359,1,0,0,0,36,377,1,0,0,0,38,379, + 1,0,0,0,40,404,1,0,0,0,42,408,1,0,0,0,44,420,1,0,0,0,46,422,1,0, + 0,0,48,424,1,0,0,0,50,426,1,0,0,0,52,428,1,0,0,0,54,430,1,0,0,0, + 56,432,1,0,0,0,58,434,1,0,0,0,60,61,6,0,-1,0,61,62,3,4,2,0,62,63, + 6,0,-1,0,63,86,1,0,0,0,64,65,3,56,28,0,65,66,6,0,-1,0,66,86,1,0, + 0,0,67,68,3,56,28,0,68,69,5,1,0,0,69,71,1,0,0,0,70,67,1,0,0,0,71, + 72,1,0,0,0,72,70,1,0,0,0,72,73,1,0,0,0,73,74,1,0,0,0,74,75,3,58, + 29,0,75,76,6,0,-1,0,76,86,1,0,0,0,77,78,5,4,0,0,78,79,3,0,0,16,79, + 80,6,0,-1,0,80,86,1,0,0,0,81,82,5,5,0,0,82,83,3,0,0,15,83,84,6,0, + -1,0,84,86,1,0,0,0,85,60,1,0,0,0,85,64,1,0,0,0,85,70,1,0,0,0,85, + 77,1,0,0,0,85,81,1,0,0,0,86,176,1,0,0,0,87,88,10,14,0,0,88,89,5, + 6,0,0,89,90,3,0,0,15,90,91,6,0,-1,0,91,175,1,0,0,0,92,93,10,13,0, + 0,93,94,5,7,0,0,94,95,3,0,0,14,95,96,6,0,-1,0,96,175,1,0,0,0,97, + 98,10,12,0,0,98,99,5,8,0,0,99,100,3,0,0,13,100,101,6,0,-1,0,101, + 175,1,0,0,0,102,103,10,11,0,0,103,104,5,4,0,0,104,105,3,0,0,12,105, + 106,6,0,-1,0,106,175,1,0,0,0,107,108,10,10,0,0,108,109,5,9,0,0,109, + 110,3,0,0,11,110,111,6,0,-1,0,111,175,1,0,0,0,112,113,10,9,0,0,113, + 114,5,10,0,0,114,115,3,0,0,10,115,116,6,0,-1,0,116,175,1,0,0,0,117, + 118,10,8,0,0,118,119,5,11,0,0,119,120,3,0,0,9,120,121,6,0,-1,0,121, + 175,1,0,0,0,122,123,10,7,0,0,123,124,5,12,0,0,124,125,3,0,0,8,125, + 126,6,0,-1,0,126,175,1,0,0,0,127,128,10,6,0,0,128,129,5,13,0,0,129, + 130,3,0,0,7,130,131,6,0,-1,0,131,175,1,0,0,0,132,133,10,5,0,0,133, + 134,5,14,0,0,134,135,3,0,0,6,135,136,6,0,-1,0,136,175,1,0,0,0,137, + 138,10,4,0,0,138,139,5,15,0,0,139,140,3,0,0,5,140,141,6,0,-1,0,141, + 175,1,0,0,0,142,143,10,3,0,0,143,144,5,16,0,0,144,145,3,0,0,4,145, + 146,6,0,-1,0,146,175,1,0,0,0,147,148,10,2,0,0,148,149,5,17,0,0,149, + 175,3,0,0,3,150,151,10,1,0,0,151,152,5,18,0,0,152,175,3,0,0,2,153, + 154,10,20,0,0,154,155,3,2,1,0,155,156,6,0,-1,0,156,175,1,0,0,0,157, + 158,10,19,0,0,158,159,5,2,0,0,159,160,3,56,28,0,160,161,3,2,1,0, + 161,162,6,0,-1,0,162,175,1,0,0,0,163,164,10,18,0,0,164,165,5,2,0, + 0,165,166,3,56,28,0,166,167,6,0,-1,0,167,175,1,0,0,0,168,169,10, + 17,0,0,169,170,5,3,0,0,170,171,3,56,28,0,171,172,3,2,1,0,172,173, + 6,0,-1,0,173,175,1,0,0,0,174,87,1,0,0,0,174,92,1,0,0,0,174,97,1, + 0,0,0,174,102,1,0,0,0,174,107,1,0,0,0,174,112,1,0,0,0,174,117,1, + 0,0,0,174,122,1,0,0,0,174,127,1,0,0,0,174,132,1,0,0,0,174,137,1, + 0,0,0,174,142,1,0,0,0,174,147,1,0,0,0,174,150,1,0,0,0,174,153,1, + 0,0,0,174,157,1,0,0,0,174,163,1,0,0,0,174,168,1,0,0,0,175,178,1, + 0,0,0,176,174,1,0,0,0,176,177,1,0,0,0,177,1,1,0,0,0,178,176,1,0, + 0,0,179,188,5,19,0,0,180,185,3,0,0,0,181,182,5,20,0,0,182,184,3, + 0,0,0,183,181,1,0,0,0,184,187,1,0,0,0,185,183,1,0,0,0,185,186,1, + 0,0,0,186,189,1,0,0,0,187,185,1,0,0,0,188,180,1,0,0,0,188,189,1, + 0,0,0,189,190,1,0,0,0,190,220,5,21,0,0,191,192,5,19,0,0,192,197, + 3,58,29,0,193,194,5,20,0,0,194,196,3,58,29,0,195,193,1,0,0,0,196, + 199,1,0,0,0,197,195,1,0,0,0,197,198,1,0,0,0,198,202,1,0,0,0,199, + 197,1,0,0,0,200,201,5,22,0,0,201,203,3,32,16,0,202,200,1,0,0,0,202, + 203,1,0,0,0,203,213,1,0,0,0,204,205,5,23,0,0,205,208,3,58,29,0,206, + 207,5,22,0,0,207,209,3,32,16,0,208,206,1,0,0,0,208,209,1,0,0,0,209, + 210,1,0,0,0,210,211,5,13,0,0,211,212,3,0,0,0,212,214,1,0,0,0,213, + 204,1,0,0,0,213,214,1,0,0,0,214,215,1,0,0,0,215,216,5,24,0,0,216, + 217,3,0,0,0,217,218,5,21,0,0,218,220,1,0,0,0,219,179,1,0,0,0,219, + 191,1,0,0,0,220,3,1,0,0,0,221,234,3,6,3,0,222,223,3,8,4,0,223,224, + 6,2,-1,0,224,234,1,0,0,0,225,226,3,10,5,0,226,227,6,2,-1,0,227,234, + 1,0,0,0,228,234,3,12,6,0,229,234,3,16,8,0,230,234,3,26,13,0,231, + 234,3,28,14,0,232,234,3,42,21,0,233,221,1,0,0,0,233,222,1,0,0,0, + 233,225,1,0,0,0,233,228,1,0,0,0,233,229,1,0,0,0,233,230,1,0,0,0, + 233,231,1,0,0,0,233,232,1,0,0,0,234,5,1,0,0,0,235,236,5,25,0,0,236, + 7,1,0,0,0,237,238,5,19,0,0,238,239,3,0,0,0,239,240,5,21,0,0,240, + 241,6,4,-1,0,241,9,1,0,0,0,242,243,3,44,22,0,243,244,6,5,-1,0,244, + 261,1,0,0,0,245,246,3,48,24,0,246,247,6,5,-1,0,247,261,1,0,0,0,248, + 249,3,46,23,0,249,250,6,5,-1,0,250,261,1,0,0,0,251,252,3,50,25,0, + 252,253,6,5,-1,0,253,261,1,0,0,0,254,255,3,52,26,0,255,256,6,5,-1, + 0,256,261,1,0,0,0,257,258,3,54,27,0,258,259,6,5,-1,0,259,261,1,0, + 0,0,260,242,1,0,0,0,260,245,1,0,0,0,260,248,1,0,0,0,260,251,1,0, + 0,0,260,254,1,0,0,0,260,257,1,0,0,0,261,11,1,0,0,0,262,263,5,26, + 0,0,263,264,5,27,0,0,264,269,3,14,7,0,265,266,5,20,0,0,266,268,3, + 14,7,0,267,265,1,0,0,0,268,271,1,0,0,0,269,267,1,0,0,0,269,270,1, + 0,0,0,270,272,1,0,0,0,271,269,1,0,0,0,272,273,5,28,0,0,273,13,1, + 0,0,0,274,277,3,56,28,0,275,276,5,22,0,0,276,278,3,32,16,0,277,275, + 1,0,0,0,277,278,1,0,0,0,278,279,1,0,0,0,279,280,5,13,0,0,280,281, + 3,4,2,0,281,15,1,0,0,0,282,283,3,18,9,0,283,292,5,27,0,0,284,289, + 3,24,12,0,285,286,5,20,0,0,286,288,3,24,12,0,287,285,1,0,0,0,288, + 291,1,0,0,0,289,287,1,0,0,0,289,290,1,0,0,0,290,293,1,0,0,0,291, + 289,1,0,0,0,292,284,1,0,0,0,292,293,1,0,0,0,293,294,1,0,0,0,294, + 295,5,28,0,0,295,17,1,0,0,0,296,305,3,22,11,0,297,298,5,19,0,0,298, + 299,3,32,16,0,299,300,5,21,0,0,300,306,1,0,0,0,301,302,5,9,0,0,302, + 303,3,32,16,0,303,304,5,10,0,0,304,306,1,0,0,0,305,297,1,0,0,0,305, + 301,1,0,0,0,305,306,1,0,0,0,306,19,1,0,0,0,307,318,5,29,0,0,308, + 318,5,30,0,0,309,318,5,31,0,0,310,318,5,32,0,0,311,318,5,33,0,0, + 312,318,5,34,0,0,313,318,5,35,0,0,314,318,5,36,0,0,315,318,5,37, + 0,0,316,318,5,38,0,0,317,307,1,0,0,0,317,308,1,0,0,0,317,309,1,0, + 0,0,317,310,1,0,0,0,317,311,1,0,0,0,317,312,1,0,0,0,317,313,1,0, + 0,0,317,314,1,0,0,0,317,315,1,0,0,0,317,316,1,0,0,0,318,21,1,0,0, + 0,319,325,5,39,0,0,320,325,5,40,0,0,321,325,5,41,0,0,322,325,5,42, + 0,0,323,325,5,43,0,0,324,319,1,0,0,0,324,320,1,0,0,0,324,321,1,0, + 0,0,324,322,1,0,0,0,324,323,1,0,0,0,325,23,1,0,0,0,326,332,3,0,0, + 0,327,328,3,0,0,0,328,329,5,44,0,0,329,330,3,0,0,0,330,332,1,0,0, + 0,331,326,1,0,0,0,331,327,1,0,0,0,332,25,1,0,0,0,333,334,3,36,18, + 0,334,27,1,0,0,0,335,336,5,45,0,0,336,341,3,30,15,0,337,338,5,20, + 0,0,338,340,3,30,15,0,339,337,1,0,0,0,340,343,1,0,0,0,341,339,1, + 0,0,0,341,342,1,0,0,0,342,344,1,0,0,0,343,341,1,0,0,0,344,345,5, + 46,0,0,345,346,3,0,0,0,346,29,1,0,0,0,347,350,3,56,28,0,348,349, + 5,22,0,0,349,351,3,32,16,0,350,348,1,0,0,0,350,351,1,0,0,0,351,352, + 1,0,0,0,352,353,5,13,0,0,353,354,3,0,0,0,354,31,1,0,0,0,355,358, + 3,36,18,0,356,358,3,34,17,0,357,355,1,0,0,0,357,356,1,0,0,0,358, + 33,1,0,0,0,359,360,6,17,-1,0,360,361,3,56,28,0,361,371,1,0,0,0,362, + 365,10,1,0,0,363,364,5,1,0,0,364,366,3,58,29,0,365,363,1,0,0,0,366, + 367,1,0,0,0,367,365,1,0,0,0,367,368,1,0,0,0,368,370,1,0,0,0,369, + 362,1,0,0,0,370,373,1,0,0,0,371,369,1,0,0,0,371,372,1,0,0,0,372, + 35,1,0,0,0,373,371,1,0,0,0,374,378,3,18,9,0,375,378,3,20,10,0,376, + 378,3,38,19,0,377,374,1,0,0,0,377,375,1,0,0,0,377,376,1,0,0,0,378, + 37,1,0,0,0,379,402,5,26,0,0,380,381,5,19,0,0,381,386,3,40,20,0,382, + 383,5,20,0,0,383,385,3,40,20,0,384,382,1,0,0,0,385,388,1,0,0,0,386, + 384,1,0,0,0,386,387,1,0,0,0,387,389,1,0,0,0,388,386,1,0,0,0,389, + 390,5,21,0,0,390,403,1,0,0,0,391,392,5,9,0,0,392,397,3,40,20,0,393, + 394,5,20,0,0,394,396,3,40,20,0,395,393,1,0,0,0,396,399,1,0,0,0,397, + 395,1,0,0,0,397,398,1,0,0,0,398,400,1,0,0,0,399,397,1,0,0,0,400, + 401,5,10,0,0,401,403,1,0,0,0,402,380,1,0,0,0,402,391,1,0,0,0,402, + 403,1,0,0,0,403,39,1,0,0,0,404,405,3,56,28,0,405,406,5,22,0,0,406, + 407,3,32,16,0,407,41,1,0,0,0,408,409,5,47,0,0,409,410,3,0,0,0,410, + 411,5,48,0,0,411,412,3,0,0,0,412,413,5,49,0,0,413,414,3,0,0,0,414, + 415,5,50,0,0,415,43,1,0,0,0,416,417,5,59,0,0,417,421,6,22,-1,0,418, + 419,5,60,0,0,419,421,6,22,-1,0,420,416,1,0,0,0,420,418,1,0,0,0,421, + 45,1,0,0,0,422,423,5,56,0,0,423,47,1,0,0,0,424,425,7,0,0,0,425,49, + 1,0,0,0,426,427,5,6,0,0,427,51,1,0,0,0,428,429,5,53,0,0,429,53,1, + 0,0,0,430,431,5,54,0,0,431,55,1,0,0,0,432,433,8,1,0,0,433,57,1,0, + 0,0,434,435,8,2,0,0,435,59,1,0,0,0,31,72,85,174,176,185,188,197, + 202,208,213,219,233,260,269,277,289,292,305,317,324,331,341,350, + 357,367,371,377,386,397,402,420 ] class OclExpressionParser ( Parser ): @@ -307,6 +339,7 @@ class OclExpContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + self.r = None def getRuleIndex(self): @@ -315,6 +348,7 @@ def getRuleIndex(self): def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) + self.r = ctx.r class UnaryOperationContext(OclExpContext): @@ -378,6 +412,7 @@ class PrimaryExpressionContext(OclExpContext): def __init__(self, parser, ctx:ParserRuleContext): # actually a OclExpressionParser.OclExpContext super().__init__(parser) + self.n = None # PrimaryExpContext self.copyFrom(ctx) def primaryExp(self): @@ -653,7 +688,7 @@ def oclExp(self, _p:int=0): self.enterRecursionRule(localctx, 0, self.RULE_oclExp, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 76 + self.state = 85 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,1,self._ctx) if la_ == 1: @@ -662,64 +697,69 @@ def oclExp(self, _p:int=0): _prevctx = localctx self.state = 61 - self.primaryExp() + localctx.n = self.primaryExp() + localctx.r = localctx.n.r pass elif la_ == 2: localctx = OclExpressionParser.SimpleNameContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 62 + self.state = 64 self.unrestrictedName() + localctx.r = CANNOT_EVAL pass elif la_ == 3: localctx = OclExpressionParser.FullQualifiedNameContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 66 + self.state = 70 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 63 + self.state = 67 self.unrestrictedName() - self.state = 64 + self.state = 68 self.match(OclExpressionParser.T__0) else: raise NoViableAltException(self) - self.state = 68 + self.state = 72 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,0,self._ctx) - self.state = 70 + self.state = 74 self.unreservedName() + localctx.r = CANNOT_EVAL pass elif la_ == 4: localctx = OclExpressionParser.UnaryOperationContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 72 + self.state = 77 localctx.operator = self.match(OclExpressionParser.T__3) - self.state = 73 + self.state = 78 localctx.expression = self.oclExp(16) + localctx.r = f((localctx.expression.r,), ((int, float),), lambda n: -n) pass elif la_ == 5: localctx = OclExpressionParser.UnaryOperationContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 74 + self.state = 81 localctx.operator = self.match(OclExpressionParser.T__4) - self.state = 75 + self.state = 82 localctx.expression = self.oclExp(15) + localctx.r = f((localctx.expression.r,), (bool,), lambda n: not n) pass self._ctx.stop = self._input.LT(-1) - self.state = 137 + self.state = 176 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,3,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -727,188 +767,200 @@ def oclExp(self, _p:int=0): if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 135 + self.state = 174 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,2,self._ctx) if la_ == 1: localctx = OclExpressionParser.ArithmeticBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 78 + self.state = 87 if not self.precpred(self._ctx, 14): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 14)") - self.state = 79 + self.state = 88 localctx.operator = self.match(OclExpressionParser.T__5) - self.state = 80 + self.state = 89 localctx.right = self.oclExp(15) + localctx.r = f((localctx.left.r, localctx.right.r), (int, int), lambda l, r: l * r) pass elif la_ == 2: localctx = OclExpressionParser.ArithmeticBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 81 + self.state = 92 if not self.precpred(self._ctx, 13): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 13)") - self.state = 82 + self.state = 93 localctx.operator = self.match(OclExpressionParser.T__6) - self.state = 83 + self.state = 94 localctx.right = self.oclExp(14) + localctx.r = f((localctx.left.r, localctx.right.r), (int, int), lambda l, r: l / r) pass elif la_ == 3: localctx = OclExpressionParser.ArithmeticBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 84 + self.state = 97 if not self.precpred(self._ctx, 12): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 12)") - self.state = 85 + self.state = 98 localctx.operator = self.match(OclExpressionParser.T__7) - self.state = 86 + self.state = 99 localctx.right = self.oclExp(13) + localctx.r = f((localctx.left.r, localctx.right.r), (int, int), lambda l, r: l + r) pass elif la_ == 4: localctx = OclExpressionParser.ArithmeticBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 87 + self.state = 102 if not self.precpred(self._ctx, 11): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 11)") - self.state = 88 + self.state = 103 localctx.operator = self.match(OclExpressionParser.T__3) - self.state = 89 + self.state = 104 localctx.right = self.oclExp(12) + localctx.r = f((localctx.left.r, localctx.right.r), (int, int), lambda l, r: l - r) pass elif la_ == 5: localctx = OclExpressionParser.ComparisonBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 90 + self.state = 107 if not self.precpred(self._ctx, 10): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 10)") - self.state = 91 + self.state = 108 localctx.operator = self.match(OclExpressionParser.T__8) - self.state = 92 + self.state = 109 localctx.right = self.oclExp(11) + localctx.r = f((localctx.left.r, localctx.right.r), (OBJ, OBJ), lambda l, r: l < r) pass elif la_ == 6: localctx = OclExpressionParser.ComparisonBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 93 + self.state = 112 if not self.precpred(self._ctx, 9): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 9)") - self.state = 94 + self.state = 113 localctx.operator = self.match(OclExpressionParser.T__9) - self.state = 95 + self.state = 114 localctx.right = self.oclExp(10) + localctx.r = f((localctx.left.r, localctx.right.r), (OBJ, OBJ), lambda l, r: l > r) pass elif la_ == 7: localctx = OclExpressionParser.ComparisonBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 96 + self.state = 117 if not self.precpred(self._ctx, 8): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 8)") - self.state = 97 + self.state = 118 localctx.operator = self.match(OclExpressionParser.T__10) - self.state = 98 + self.state = 119 localctx.right = self.oclExp(9) + localctx.r = f((localctx.left.r, localctx.right.r), (OBJ, OBJ), lambda l, r: l <= r) pass elif la_ == 8: localctx = OclExpressionParser.ComparisonBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 99 + self.state = 122 if not self.precpred(self._ctx, 7): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 7)") - self.state = 100 + self.state = 123 localctx.operator = self.match(OclExpressionParser.T__11) - self.state = 101 + self.state = 124 localctx.right = self.oclExp(8) + localctx.r = f((localctx.left.r, localctx.right.r), (OBJ, OBJ), lambda l, r: l >= r) pass elif la_ == 9: localctx = OclExpressionParser.ComparisonBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 102 + self.state = 127 if not self.precpred(self._ctx, 6): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 6)") - self.state = 103 + self.state = 128 localctx.operator = self.match(OclExpressionParser.T__12) - self.state = 104 + self.state = 129 localctx.right = self.oclExp(7) + localctx.r = f((localctx.left.r, localctx.right.r), (OBJ, OBJ), lambda l, r: l == r) pass elif la_ == 10: localctx = OclExpressionParser.ComparisonBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 105 + self.state = 132 if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 106 + self.state = 133 localctx.operator = self.match(OclExpressionParser.T__13) - self.state = 107 + self.state = 134 localctx.right = self.oclExp(6) + localctx.r = f((localctx.left.r, localctx.right.r), (OBJ, OBJ), lambda l, r: l != r) pass elif la_ == 11: localctx = OclExpressionParser.BooleanBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 108 + self.state = 137 if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") - self.state = 109 + self.state = 138 localctx.operator = self.match(OclExpressionParser.T__14) - self.state = 110 + self.state = 139 localctx.right = self.oclExp(5) + localctx.r = f((localctx.left.r, localctx.right.r), (bool, bool), lambda l, r: l and r) pass elif la_ == 12: localctx = OclExpressionParser.BooleanBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 111 + self.state = 142 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 112 + self.state = 143 localctx.operator = self.match(OclExpressionParser.T__15) - self.state = 113 + self.state = 144 localctx.right = self.oclExp(4) + localctx.r = f((localctx.left.r, localctx.right.r), (bool, bool), lambda l, r: l or r) pass elif la_ == 13: localctx = OclExpressionParser.BooleanBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 114 + self.state = 147 if not self.precpred(self._ctx, 2): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 2)") - self.state = 115 + self.state = 148 localctx.operator = self.match(OclExpressionParser.T__16) - self.state = 116 + self.state = 149 localctx.right = self.oclExp(3) pass @@ -916,13 +968,13 @@ def oclExp(self, _p:int=0): localctx = OclExpressionParser.BooleanBinaryOperationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 117 + self.state = 150 if not self.precpred(self._ctx, 1): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 1)") - self.state = 118 + self.state = 151 localctx.operator = self.match(OclExpressionParser.T__17) - self.state = 119 + self.state = 152 localctx.right = self.oclExp(2) pass @@ -930,62 +982,66 @@ def oclExp(self, _p:int=0): localctx = OclExpressionParser.CallExpressionContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.expression = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 120 + self.state = 153 if not self.precpred(self._ctx, 20): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 20)") - self.state = 121 + self.state = 154 self.argExp() + localctx.r = CANNOT_EVAL pass elif la_ == 16: localctx = OclExpressionParser.MethodCallContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.expression = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 122 + self.state = 157 if not self.precpred(self._ctx, 19): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 19)") - self.state = 123 + self.state = 158 self.match(OclExpressionParser.T__1) - self.state = 124 + self.state = 159 localctx.attname = self.unrestrictedName() - self.state = 125 + self.state = 160 self.argExp() + localctx.r = CANNOT_EVAL pass elif la_ == 17: localctx = OclExpressionParser.AttributeNavigationContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.expression = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 127 + self.state = 163 if not self.precpred(self._ctx, 18): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 18)") - self.state = 128 + self.state = 164 self.match(OclExpressionParser.T__1) - self.state = 129 + self.state = 165 localctx.attname = self.unrestrictedName() + localctx.r = CANNOT_EVAL pass elif la_ == 18: localctx = OclExpressionParser.CollectionCallContext(self, OclExpressionParser.OclExpContext(self, _parentctx, _parentState)) localctx.expression = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_oclExp) - self.state = 130 + self.state = 168 if not self.precpred(self._ctx, 17): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 17)") - self.state = 131 + self.state = 169 self.match(OclExpressionParser.T__2) - self.state = 132 + self.state = 170 localctx.attname = self.unrestrictedName() - self.state = 133 + self.state = 171 self.argExp() + localctx.r = CANNOT_EVAL pass - self.state = 139 + self.state = 178 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,3,self._ctx) @@ -1097,100 +1153,100 @@ def argExp(self): self.enterRule(localctx, 2, self.RULE_argExp) self._la = 0 # Token type try: - self.state = 180 + self.state = 219 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,10,self._ctx) if la_ == 1: localctx = OclExpressionParser.ArgumentsExpContext(self, localctx) self.enterOuterAlt(localctx, 1) - self.state = 140 + self.state = 179 self.match(OclExpressionParser.T__18) - self.state = 149 + self.state = 188 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & 4573616527824683006) != 0): - self.state = 141 + self.state = 180 localctx._oclExp = self.oclExp(0) localctx.body.append(localctx._oclExp) - self.state = 146 + self.state = 185 self._errHandler.sync(self) _la = self._input.LA(1) while _la==20: - self.state = 142 + self.state = 181 self.match(OclExpressionParser.T__19) - self.state = 143 + self.state = 182 localctx._oclExp = self.oclExp(0) localctx.body.append(localctx._oclExp) - self.state = 148 + self.state = 187 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 151 + self.state = 190 self.match(OclExpressionParser.T__20) pass elif la_ == 2: localctx = OclExpressionParser.LambdaExpContext(self, localctx) self.enterOuterAlt(localctx, 2) - self.state = 152 + self.state = 191 self.match(OclExpressionParser.T__18) - self.state = 153 + self.state = 192 localctx._unreservedName = self.unreservedName() localctx.varnames.append(localctx._unreservedName) - self.state = 158 + self.state = 197 self._errHandler.sync(self) _la = self._input.LA(1) while _la==20: - self.state = 154 + self.state = 193 self.match(OclExpressionParser.T__19) - self.state = 155 + self.state = 194 localctx._unreservedName = self.unreservedName() localctx.varnames.append(localctx._unreservedName) - self.state = 160 + self.state = 199 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 163 + self.state = 202 self._errHandler.sync(self) _la = self._input.LA(1) if _la==22: - self.state = 161 + self.state = 200 self.match(OclExpressionParser.T__21) - self.state = 162 + self.state = 201 self.typeExpCS() - self.state = 174 + self.state = 213 self._errHandler.sync(self) _la = self._input.LA(1) if _la==23: - self.state = 165 + self.state = 204 self.match(OclExpressionParser.T__22) - self.state = 166 + self.state = 205 localctx.iterator = self.unreservedName() - self.state = 169 + self.state = 208 self._errHandler.sync(self) _la = self._input.LA(1) if _la==22: - self.state = 167 + self.state = 206 self.match(OclExpressionParser.T__21) - self.state = 168 + self.state = 207 self.typeExpCS() - self.state = 171 + self.state = 210 self.match(OclExpressionParser.T__12) - self.state = 172 + self.state = 211 localctx.initializer = self.oclExp(0) - self.state = 176 + self.state = 215 self.match(OclExpressionParser.T__23) - self.state = 177 + self.state = 216 localctx.body = self.oclExp(0) - self.state = 178 + self.state = 217 self.match(OclExpressionParser.T__20) pass @@ -1210,6 +1266,9 @@ class PrimaryExpContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + self.r = None + self.n_ = None # NestedExpContext + self.n = None # PrimitiveLiteralExpContext def selfExp(self): return self.getTypedRuleContext(OclExpressionParser.SelfExpContext,0) @@ -1268,54 +1327,56 @@ def primaryExp(self): localctx = OclExpressionParser.PrimaryExpContext(self, self._ctx, self.state) self.enterRule(localctx, 4, self.RULE_primaryExp) try: - self.state = 190 + self.state = 233 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,11,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 182 + self.state = 221 self.selfExp() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 183 - self.nestedExp() + self.state = 222 + localctx.n_ = self.nestedExp() + localctx.r = localctx.n_.r pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 184 - self.primitiveLiteralExp() + self.state = 225 + localctx.n = self.primitiveLiteralExp() + localctx.r = localctx.n.r pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 185 + self.state = 228 self.tupleLiteralExp() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 186 + self.state = 229 self.collectionLiteralExp() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 187 + self.state = 230 self.typeLiteralExp() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 188 + self.state = 231 self.letExp() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 189 + self.state = 232 self.ifExp() pass @@ -1363,7 +1424,7 @@ def selfExp(self): self.enterRule(localctx, 6, self.RULE_selfExp) try: self.enterOuterAlt(localctx, 1) - self.state = 192 + self.state = 235 self.match(OclExpressionParser.T__24) except RecognitionException as re: localctx.exception = re @@ -1380,6 +1441,7 @@ class NestedExpContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + self.r = None self.nested = None # OclExpContext def oclExp(self): @@ -1412,12 +1474,13 @@ def nestedExp(self): self.enterRule(localctx, 8, self.RULE_nestedExp) try: self.enterOuterAlt(localctx, 1) - self.state = 194 + self.state = 237 self.match(OclExpressionParser.T__18) - self.state = 195 + self.state = 238 localctx.nested = self.oclExp(0) - self.state = 196 + self.state = 239 self.match(OclExpressionParser.T__20) + localctx.r = localctx.nested.r except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -1433,6 +1496,7 @@ class PrimitiveLiteralExpContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + self.r = None def getRuleIndex(self): @@ -1441,6 +1505,7 @@ def getRuleIndex(self): def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) + self.r = ctx.r @@ -1448,6 +1513,7 @@ class StringLiteralContext(PrimitiveLiteralExpContext): def __init__(self, parser, ctx:ParserRuleContext): # actually a OclExpressionParser.PrimitiveLiteralExpContext super().__init__(parser) + self.n = None # StringLiteralExpCSContext self.copyFrom(ctx) def stringLiteralExpCS(self): @@ -1473,6 +1539,7 @@ class BooleanLiteralContext(PrimitiveLiteralExpContext): def __init__(self, parser, ctx:ParserRuleContext): # actually a OclExpressionParser.PrimitiveLiteralExpContext super().__init__(parser) + self.n = None # BooleanLiteralExpCSContext self.copyFrom(ctx) def booleanLiteralExpCS(self): @@ -1573,6 +1640,7 @@ class NumberLiteralContext(PrimitiveLiteralExpContext): def __init__(self, parser, ctx:ParserRuleContext): # actually a OclExpressionParser.PrimitiveLiteralExpContext super().__init__(parser) + self.n = None # NumberLiteralExpCSContext self.copyFrom(ctx) def numberLiteralExpCS(self): @@ -1600,44 +1668,50 @@ def primitiveLiteralExp(self): localctx = OclExpressionParser.PrimitiveLiteralExpContext(self, self._ctx, self.state) self.enterRule(localctx, 10, self.RULE_primitiveLiteralExp) try: - self.state = 204 + self.state = 260 self._errHandler.sync(self) token = self._input.LA(1) if token in [59, 60]: localctx = OclExpressionParser.NumberLiteralContext(self, localctx) self.enterOuterAlt(localctx, 1) - self.state = 198 - self.numberLiteralExpCS() + self.state = 242 + localctx.n = self.numberLiteralExpCS() + localctx.r = localctx.n.r pass elif token in [51, 52]: localctx = OclExpressionParser.BooleanLiteralContext(self, localctx) self.enterOuterAlt(localctx, 2) - self.state = 199 - self.booleanLiteralExpCS() + self.state = 245 + localctx.n = self.booleanLiteralExpCS() + localctx.r = (None if localctx.n is None else self._input.getText(localctx.n.start,localctx.n.stop)) == 'true' pass elif token in [56]: localctx = OclExpressionParser.StringLiteralContext(self, localctx) self.enterOuterAlt(localctx, 3) - self.state = 200 - self.stringLiteralExpCS() + self.state = 248 + localctx.n = self.stringLiteralExpCS() + localctx.r = (None if localctx.n is None else self._input.getText(localctx.n.start,localctx.n.stop)) pass elif token in [6]: localctx = OclExpressionParser.UnlimitedNaturalLiteralContext(self, localctx) self.enterOuterAlt(localctx, 4) - self.state = 201 + self.state = 251 self.unlimitedNaturalLiteralCS() + localctx.r = CANNOT_EVALUTATE pass elif token in [53]: localctx = OclExpressionParser.InvalidLiteralContext(self, localctx) self.enterOuterAlt(localctx, 5) - self.state = 202 + self.state = 254 self.invalidLiteralExpCS() + localctx.r=None pass elif token in [54]: localctx = OclExpressionParser.NullLiteralContext(self, localctx) self.enterOuterAlt(localctx, 6) - self.state = 203 + self.state = 257 self.nullLiteralExpCS() + localctx.r=None pass else: raise NoViableAltException(self) @@ -1692,25 +1766,25 @@ def tupleLiteralExp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 206 + self.state = 262 self.match(OclExpressionParser.T__25) - self.state = 207 + self.state = 263 self.match(OclExpressionParser.T__26) - self.state = 208 + self.state = 264 self.tupleLiteralPartCS() - self.state = 213 + self.state = 269 self._errHandler.sync(self) _la = self._input.LA(1) while _la==20: - self.state = 209 + self.state = 265 self.match(OclExpressionParser.T__19) - self.state = 210 + self.state = 266 self.tupleLiteralPartCS() - self.state = 215 + self.state = 271 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 216 + self.state = 272 self.match(OclExpressionParser.T__27) except RecognitionException as re: localctx.exception = re @@ -1767,21 +1841,21 @@ def tupleLiteralPartCS(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 218 + self.state = 274 self.unrestrictedName() - self.state = 221 + self.state = 277 self._errHandler.sync(self) _la = self._input.LA(1) if _la==22: - self.state = 219 + self.state = 275 self.match(OclExpressionParser.T__21) - self.state = 220 + self.state = 276 self.typeExpCS() - self.state = 223 + self.state = 279 self.match(OclExpressionParser.T__12) - self.state = 224 + self.state = 280 self.primaryExp() except RecognitionException as re: localctx.exception = re @@ -1839,33 +1913,33 @@ def collectionLiteralExp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 226 + self.state = 282 self.collectionTypeCS() - self.state = 227 + self.state = 283 self.match(OclExpressionParser.T__26) - self.state = 236 + self.state = 292 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,16,self._ctx) if la_ == 1: - self.state = 228 + self.state = 284 localctx._collectionLiteralPartCS = self.collectionLiteralPartCS() localctx.expressions.append(localctx._collectionLiteralPartCS) - self.state = 233 + self.state = 289 self._errHandler.sync(self) _la = self._input.LA(1) while _la==20: - self.state = 229 + self.state = 285 self.match(OclExpressionParser.T__19) - self.state = 230 + self.state = 286 localctx._collectionLiteralPartCS = self.collectionLiteralPartCS() localctx.expressions.append(localctx._collectionLiteralPartCS) - self.state = 235 + self.state = 291 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 238 + self.state = 294 self.match(OclExpressionParser.T__27) except RecognitionException as re: localctx.exception = re @@ -1917,25 +1991,25 @@ def collectionTypeCS(self): self.enterRule(localctx, 18, self.RULE_collectionTypeCS) try: self.enterOuterAlt(localctx, 1) - self.state = 240 + self.state = 296 self.collectionTypeIdentifier() - self.state = 249 + self.state = 305 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,17,self._ctx) if la_ == 1: - self.state = 241 + self.state = 297 self.match(OclExpressionParser.T__18) - self.state = 242 + self.state = 298 self.typeExpCS() - self.state = 243 + self.state = 299 self.match(OclExpressionParser.T__20) elif la_ == 2: - self.state = 245 + self.state = 301 self.match(OclExpressionParser.T__8) - self.state = 246 + self.state = 302 self.typeExpCS() - self.state = 247 + self.state = 303 self.match(OclExpressionParser.T__9) @@ -2191,67 +2265,67 @@ def primitiveTypeCS(self): localctx = OclExpressionParser.PrimitiveTypeCSContext(self, self._ctx, self.state) self.enterRule(localctx, 20, self.RULE_primitiveTypeCS) try: - self.state = 261 + self.state = 317 self._errHandler.sync(self) token = self._input.LA(1) if token in [29]: localctx = OclExpressionParser.StringTypeContext(self, localctx) self.enterOuterAlt(localctx, 1) - self.state = 251 + self.state = 307 self.match(OclExpressionParser.T__28) pass elif token in [30]: localctx = OclExpressionParser.IntegerTypeContext(self, localctx) self.enterOuterAlt(localctx, 2) - self.state = 252 + self.state = 308 self.match(OclExpressionParser.T__29) pass elif token in [31]: localctx = OclExpressionParser.UnlimitedNaturalTypeContext(self, localctx) self.enterOuterAlt(localctx, 3) - self.state = 253 + self.state = 309 self.match(OclExpressionParser.T__30) pass elif token in [32]: localctx = OclExpressionParser.BooleanTypeContext(self, localctx) self.enterOuterAlt(localctx, 4) - self.state = 254 + self.state = 310 self.match(OclExpressionParser.T__31) pass elif token in [33]: localctx = OclExpressionParser.RealTypeContext(self, localctx) self.enterOuterAlt(localctx, 5) - self.state = 255 + self.state = 311 self.match(OclExpressionParser.T__32) pass elif token in [34]: localctx = OclExpressionParser.OCLAnyTypeContext(self, localctx) self.enterOuterAlt(localctx, 6) - self.state = 256 + self.state = 312 self.match(OclExpressionParser.T__33) pass elif token in [35]: localctx = OclExpressionParser.OCLInvalidTypeContext(self, localctx) self.enterOuterAlt(localctx, 7) - self.state = 257 + self.state = 313 self.match(OclExpressionParser.T__34) pass elif token in [36]: localctx = OclExpressionParser.OCLMessageContext(self, localctx) self.enterOuterAlt(localctx, 8) - self.state = 258 + self.state = 314 self.match(OclExpressionParser.T__35) pass elif token in [37]: localctx = OclExpressionParser.OCLSelfContext(self, localctx) self.enterOuterAlt(localctx, 9) - self.state = 259 + self.state = 315 self.match(OclExpressionParser.T__36) pass elif token in [38]: localctx = OclExpressionParser.OCLVoidContext(self, localctx) self.enterOuterAlt(localctx, 10) - self.state = 260 + self.state = 316 self.match(OclExpressionParser.T__37) pass else: @@ -2399,37 +2473,37 @@ def collectionTypeIdentifier(self): localctx = OclExpressionParser.CollectionTypeIdentifierContext(self, self._ctx, self.state) self.enterRule(localctx, 22, self.RULE_collectionTypeIdentifier) try: - self.state = 268 + self.state = 324 self._errHandler.sync(self) token = self._input.LA(1) if token in [39]: localctx = OclExpressionParser.CollectionTypeContext(self, localctx) self.enterOuterAlt(localctx, 1) - self.state = 263 + self.state = 319 self.match(OclExpressionParser.T__38) pass elif token in [40]: localctx = OclExpressionParser.BagTypeContext(self, localctx) self.enterOuterAlt(localctx, 2) - self.state = 264 + self.state = 320 self.match(OclExpressionParser.T__39) pass elif token in [41]: localctx = OclExpressionParser.OrderedSetTypeContext(self, localctx) self.enterOuterAlt(localctx, 3) - self.state = 265 + self.state = 321 self.match(OclExpressionParser.T__40) pass elif token in [42]: localctx = OclExpressionParser.SequenceTypeContext(self, localctx) self.enterOuterAlt(localctx, 4) - self.state = 266 + self.state = 322 self.match(OclExpressionParser.T__41) pass elif token in [43]: localctx = OclExpressionParser.SetTypeContext(self, localctx) self.enterOuterAlt(localctx, 5) - self.state = 267 + self.state = 323 self.match(OclExpressionParser.T__42) pass else: @@ -2486,22 +2560,22 @@ def collectionLiteralPartCS(self): localctx = OclExpressionParser.CollectionLiteralPartCSContext(self, self._ctx, self.state) self.enterRule(localctx, 24, self.RULE_collectionLiteralPartCS) try: - self.state = 275 + self.state = 331 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,20,self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 270 + self.state = 326 self.oclExp(0) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 271 + self.state = 327 localctx.inf = self.oclExp(0) - self.state = 272 + self.state = 328 localctx.isInterval = self.match(OclExpressionParser.T__43) - self.state = 273 + self.state = 329 localctx.sup = self.oclExp(0) pass @@ -2552,7 +2626,7 @@ def typeLiteralExp(self): self.enterRule(localctx, 26, self.RULE_typeLiteralExp) try: self.enterOuterAlt(localctx, 1) - self.state = 277 + self.state = 333 self.typeLiteralCS() except RecognitionException as re: localctx.exception = re @@ -2610,27 +2684,27 @@ def letExp(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 279 + self.state = 335 self.match(OclExpressionParser.T__44) - self.state = 280 + self.state = 336 localctx._letVariableCS = self.letVariableCS() localctx.variables.append(localctx._letVariableCS) - self.state = 285 + self.state = 341 self._errHandler.sync(self) _la = self._input.LA(1) while _la==20: - self.state = 281 + self.state = 337 self.match(OclExpressionParser.T__19) - self.state = 282 + self.state = 338 localctx._letVariableCS = self.letVariableCS() localctx.variables.append(localctx._letVariableCS) - self.state = 287 + self.state = 343 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 288 + self.state = 344 self.match(OclExpressionParser.T__45) - self.state = 289 + self.state = 345 self.oclExp(0) except RecognitionException as re: localctx.exception = re @@ -2687,21 +2761,21 @@ def letVariableCS(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 291 + self.state = 347 self.unrestrictedName() - self.state = 294 + self.state = 350 self._errHandler.sync(self) _la = self._input.LA(1) if _la==22: - self.state = 292 + self.state = 348 self.match(OclExpressionParser.T__21) - self.state = 293 + self.state = 349 self.typeExpCS() - self.state = 296 + self.state = 352 self.match(OclExpressionParser.T__12) - self.state = 297 + self.state = 353 self.oclExp(0) except RecognitionException as re: localctx.exception = re @@ -2752,17 +2826,17 @@ def typeExpCS(self): localctx = OclExpressionParser.TypeExpCSContext(self, self._ctx, self.state) self.enterRule(localctx, 32, self.RULE_typeExpCS) try: - self.state = 301 + self.state = 357 self._errHandler.sync(self) token = self._input.LA(1) if token in [26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43]: self.enterOuterAlt(localctx, 1) - self.state = 299 + self.state = 355 self.typeLiteralCS() pass elif token in [1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 20, 22, 23, 24, 27, 28, 44, 56, 57, 58, 59, 60, 61]: self.enterOuterAlt(localctx, 2) - self.state = 300 + self.state = 356 self.typeNameExpCS(0) pass else: @@ -2827,10 +2901,10 @@ def typeNameExpCS(self, _p:int=0): self.enterRecursionRule(localctx, 34, self.RULE_typeNameExpCS, _p) try: self.enterOuterAlt(localctx, 1) - self.state = 304 + self.state = 360 self.unrestrictedName() self._ctx.stop = self._input.LT(-1) - self.state = 315 + self.state = 371 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,25,self._ctx) while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: @@ -2840,27 +2914,27 @@ def typeNameExpCS(self, _p:int=0): _prevctx = localctx localctx = OclExpressionParser.TypeNameExpCSContext(self, _parentctx, _parentState) self.pushNewRecursionContext(localctx, _startState, self.RULE_typeNameExpCS) - self.state = 306 + self.state = 362 if not self.precpred(self._ctx, 1): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 1)") - self.state = 309 + self.state = 365 self._errHandler.sync(self) _alt = 1 while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 307 + self.state = 363 self.match(OclExpressionParser.T__0) - self.state = 308 + self.state = 364 self.unreservedName() else: raise NoViableAltException(self) - self.state = 311 + self.state = 367 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,24,self._ctx) - self.state = 317 + self.state = 373 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,25,self._ctx) @@ -2917,22 +2991,22 @@ def typeLiteralCS(self): localctx = OclExpressionParser.TypeLiteralCSContext(self, self._ctx, self.state) self.enterRule(localctx, 36, self.RULE_typeLiteralCS) try: - self.state = 321 + self.state = 377 self._errHandler.sync(self) token = self._input.LA(1) if token in [39, 40, 41, 42, 43]: self.enterOuterAlt(localctx, 1) - self.state = 318 + self.state = 374 self.collectionTypeCS() pass elif token in [29, 30, 31, 32, 33, 34, 35, 36, 37, 38]: self.enterOuterAlt(localctx, 2) - self.state = 319 + self.state = 375 self.primitiveTypeCS() pass elif token in [26]: self.enterOuterAlt(localctx, 3) - self.state = 320 + self.state = 376 self.tupleTypeCS() pass else: @@ -2988,49 +3062,49 @@ def tupleTypeCS(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 323 + self.state = 379 self.match(OclExpressionParser.T__25) - self.state = 346 + self.state = 402 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,29,self._ctx) if la_ == 1: - self.state = 324 + self.state = 380 self.match(OclExpressionParser.T__18) - self.state = 325 + self.state = 381 self.tuplePartCS() - self.state = 330 + self.state = 386 self._errHandler.sync(self) _la = self._input.LA(1) while _la==20: - self.state = 326 + self.state = 382 self.match(OclExpressionParser.T__19) - self.state = 327 + self.state = 383 self.tuplePartCS() - self.state = 332 + self.state = 388 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 333 + self.state = 389 self.match(OclExpressionParser.T__20) elif la_ == 2: - self.state = 335 + self.state = 391 self.match(OclExpressionParser.T__8) - self.state = 336 + self.state = 392 self.tuplePartCS() - self.state = 341 + self.state = 397 self._errHandler.sync(self) _la = self._input.LA(1) while _la==20: - self.state = 337 + self.state = 393 self.match(OclExpressionParser.T__19) - self.state = 338 + self.state = 394 self.tuplePartCS() - self.state = 343 + self.state = 399 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 344 + self.state = 400 self.match(OclExpressionParser.T__9) @@ -3084,11 +3158,11 @@ def tuplePartCS(self): self.enterRule(localctx, 40, self.RULE_tuplePartCS) try: self.enterOuterAlt(localctx, 1) - self.state = 348 + self.state = 404 self.unrestrictedName() - self.state = 349 + self.state = 405 self.match(OclExpressionParser.T__21) - self.state = 350 + self.state = 406 self.typeExpCS() except RecognitionException as re: localctx.exception = re @@ -3105,6 +3179,7 @@ class IfExpContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + self.r = None self.condition = None # OclExpContext self.body = None # OclExpContext self.else_ = None # OclExpContext @@ -3142,19 +3217,19 @@ def ifExp(self): self.enterRule(localctx, 42, self.RULE_ifExp) try: self.enterOuterAlt(localctx, 1) - self.state = 352 + self.state = 408 self.match(OclExpressionParser.T__46) - self.state = 353 + self.state = 409 localctx.condition = self.oclExp(0) - self.state = 354 + self.state = 410 self.match(OclExpressionParser.T__47) - self.state = 355 + self.state = 411 localctx.body = self.oclExp(0) - self.state = 356 + self.state = 412 self.match(OclExpressionParser.T__48) - self.state = 357 + self.state = 413 localctx.else_ = self.oclExp(0) - self.state = 358 + self.state = 414 self.match(OclExpressionParser.T__49) except RecognitionException as re: localctx.exception = re @@ -3171,6 +3246,9 @@ class NumberLiteralExpCSContext(ParserRuleContext): def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): super().__init__(parent, invokingState) self.parser = parser + self.r = None + self._INT = None # Token + self._FLOAT = None # Token def INT(self): return self.getToken(OclExpressionParser.INT, 0) @@ -3202,16 +3280,25 @@ def numberLiteralExpCS(self): localctx = OclExpressionParser.NumberLiteralExpCSContext(self, self._ctx, self.state) self.enterRule(localctx, 44, self.RULE_numberLiteralExpCS) - self._la = 0 # Token type try: - self.enterOuterAlt(localctx, 1) - self.state = 360 - _la = self._input.LA(1) - if not(_la==59 or _la==60): - self._errHandler.recoverInline(self) + self.state = 420 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [59]: + self.enterOuterAlt(localctx, 1) + self.state = 416 + localctx._INT = self.match(OclExpressionParser.INT) + localctx.r=int((None if localctx._INT is None else localctx._INT.text)) + pass + elif token in [60]: + self.enterOuterAlt(localctx, 2) + self.state = 418 + localctx._FLOAT = self.match(OclExpressionParser.FLOAT) + localctx.r=float((None if localctx._FLOAT is None else localctx._FLOAT.text)) + pass else: - self._errHandler.reportMatch(self) - self.consume() + raise NoViableAltException(self) + except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -3257,7 +3344,7 @@ def stringLiteralExpCS(self): self.enterRule(localctx, 46, self.RULE_stringLiteralExpCS) try: self.enterOuterAlt(localctx, 1) - self.state = 362 + self.state = 422 self.match(OclExpressionParser.STRING) except RecognitionException as re: localctx.exception = re @@ -3303,7 +3390,7 @@ def booleanLiteralExpCS(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 364 + self.state = 424 _la = self._input.LA(1) if not(_la==51 or _la==52): self._errHandler.recoverInline(self) @@ -3353,7 +3440,7 @@ def unlimitedNaturalLiteralCS(self): self.enterRule(localctx, 50, self.RULE_unlimitedNaturalLiteralCS) try: self.enterOuterAlt(localctx, 1) - self.state = 366 + self.state = 426 self.match(OclExpressionParser.T__5) except RecognitionException as re: localctx.exception = re @@ -3398,7 +3485,7 @@ def invalidLiteralExpCS(self): self.enterRule(localctx, 52, self.RULE_invalidLiteralExpCS) try: self.enterOuterAlt(localctx, 1) - self.state = 368 + self.state = 428 self.match(OclExpressionParser.T__52) except RecognitionException as re: localctx.exception = re @@ -3443,7 +3530,7 @@ def nullLiteralExpCS(self): self.enterRule(localctx, 54, self.RULE_nullLiteralExpCS) try: self.enterOuterAlt(localctx, 1) - self.state = 370 + self.state = 430 self.match(OclExpressionParser.T__53) except RecognitionException as re: localctx.exception = re @@ -3489,7 +3576,7 @@ def unrestrictedName(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 372 + self.state = 432 _la = self._input.LA(1) if _la <= 0 or (((_la) & ~0x3f) == 0 and ((1 << _la) & 72040001418788896) != 0): self._errHandler.recoverInline(self) @@ -3540,7 +3627,7 @@ def unreservedName(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 374 + self.state = 434 _la = self._input.LA(1) if _la <= 0 or (((_la) & ~0x3f) == 0 and ((1 << _la) & 35993612683542560) != 0): self._errHandler.recoverInline(self) diff --git a/tests/test_expressions_strict.py b/tests/test_expressions_strict.py index 3b772ba..249cc8b 100644 --- a/tests/test_expressions_strict.py +++ b/tests/test_expressions_strict.py @@ -60,3 +60,7 @@ def test__booleans(): assert (!true implies false!) is False assert (!false implies true!) is True + + +def test__int_constant_eval(): + assert !(4 + 5) - 1! == 8 \ No newline at end of file