|
Lines 296-321
Link Here
|
| 296 |
sortedBy |
311 |
sortedBy |
| 297 |
|
312 |
|
| 298 |
closure |
313 |
closure |
| 299 |
|
|
|
| 300 |
oclIsKindOf |
| 301 |
oclIsTypeOf |
| 302 |
oclAsType |
| 303 |
oclIsNew |
| 304 |
oclIsUndefined |
| 305 |
oclIsInvalid |
| 306 |
oclIsInState |
| 307 |
allInstances |
| 308 |
|
| 309 |
String |
| 310 |
Integer |
| 311 |
UnlimitedNatural |
| 312 |
Real |
| 313 |
Boolean |
| 314 |
Tuple |
| 315 |
OclAny |
| 316 |
OclVoid |
| 317 |
OclInvalid |
| 318 |
OclMessage |
| 319 |
$End |
314 |
$End |
| 320 |
|
315 |
|
| 321 |
$Identifier |
316 |
$Identifier |
|
Lines 399-426
Link Here
|
| 399 |
-- and are commonly used in models such as the UML metamodel, itself |
394 |
-- and are commonly used in models such as the UML metamodel, itself |
| 400 |
-- |
395 |
-- |
| 401 |
|
396 |
|
| 402 |
binaryIdentifier -> oclIsUndefined |
397 |
binaryKeyword -> and |
| 403 |
binaryIdentifier -> oclIsInvalid |
398 |
binaryKeyword -> or |
| 404 |
binaryIdentifier -> oclIsNew |
399 |
binaryKeyword -> xor |
| 405 |
binaryIdentifier -> oclAsType |
400 |
binaryPunctuation -> EQUAL |
| 406 |
binaryIdentifier -> oclIsKindOf |
401 |
binaryPunctuation -> NOT_EQUAL |
| 407 |
binaryIdentifier -> oclIsTypeOf |
402 |
binaryPunctuation -> PLUS |
| 408 |
binaryIdentifier -> EQUAL |
403 |
binaryPunctuation -> MULTIPLY |
| 409 |
binaryIdentifier -> NOT_EQUAL |
404 |
binaryPunctuation -> DIVIDE |
| 410 |
binaryIdentifier -> PLUS |
405 |
binaryPunctuation -> GREATER |
| 411 |
binaryIdentifier -> MULTIPLY |
406 |
binaryPunctuation -> LESS |
| 412 |
binaryIdentifier -> DIVIDE |
407 |
binaryPunctuation -> GREATER_EQUAL |
| 413 |
binaryIdentifier -> GREATER |
408 |
binaryPunctuation -> LESS_EQUAL |
| 414 |
binaryIdentifier -> LESS |
|
|
| 415 |
binaryIdentifier -> GREATER_EQUAL |
| 416 |
binaryIdentifier -> LESS_EQUAL |
| 417 |
binaryIdentifier -> and |
| 418 |
binaryIdentifier -> or |
| 419 |
binaryIdentifier -> xor |
| 420 |
|
409 |
|
| 421 |
unaryIdentifier -> MINUS |
410 |
unaryKeyword -> not |
| 422 |
unaryIdentifier -> not |
411 |
unaryPunctuation -> MINUS |
| 423 |
|
412 |
|
|
|
413 |
iterateIdentifier -> iterate |
| 414 |
|
| 424 |
iteratorIdentifier -> forAll |
415 |
iteratorIdentifier -> forAll |
| 425 |
iteratorIdentifier -> exists |
416 |
iteratorIdentifier -> exists |
| 426 |
iteratorIdentifier -> isUnique |
417 |
iteratorIdentifier -> isUnique |
|
Lines 433-461
Link Here
|
| 433 |
iteratorIdentifier -> sortedBy |
424 |
iteratorIdentifier -> sortedBy |
| 434 |
iteratorIdentifier -> closure |
425 |
iteratorIdentifier -> closure |
| 435 |
|
426 |
|
| 436 |
keywordAsIdentifier1 -> iterate |
427 |
reservedKeyword -> binaryKeyword |
| 437 |
keywordAsIdentifier1 -> iteratorIdentifier |
428 |
reservedKeyword -> unaryKeyword |
| 438 |
keywordAsIdentifier1 -> allInstances |
429 |
-- Eliminate these for EssentialOCL |
| 439 |
keywordAsIdentifier1 -> body |
430 |
reservedKeyword -> body |
| 440 |
keywordAsIdentifier1 -> derive |
431 |
reservedKeyword -> context |
| 441 |
keywordAsIdentifier1 -> init |
432 |
reservedKeyword -> def |
| 442 |
keywordAsIdentifier1 -> Set |
433 |
reservedKeyword -> derive |
| 443 |
keywordAsIdentifier1 -> Bag |
434 |
reservedKeyword -> endpackage |
| 444 |
keywordAsIdentifier1 -> Sequence |
435 |
reservedKeyword -> init |
| 445 |
keywordAsIdentifier1 -> Collection |
436 |
reservedKeyword -> inv |
| 446 |
keywordAsIdentifier1 -> OrderedSet |
437 |
reservedKeyword -> package |
| 447 |
-------- |
438 |
reservedKeyword -> post |
| 448 |
keywordAsIdentifier -> keywordAsIdentifier1 |
439 |
reservedKeyword -> pre |
| 449 |
keywordAsIdentifier -> null |
440 |
reservedKeyword -> static |
| 450 |
|
441 |
|
| 451 |
binaryName -> simpleNameCS |
442 |
reservedPunctuation -> binaryPunctuation |
| 452 |
binaryName ::= binaryIdentifier |
443 |
reservedPunctuation -> unaryPunctuation |
| 453 |
/.$NewCase./ |
444 |
|
| 454 |
keywordAsName ::= keywordAsIdentifier |
445 |
reservedKeywordCS ::= reservedKeyword |
| 455 |
/.$NewCase./ |
|
|
| 456 |
keywordAsName1 ::= keywordAsIdentifier1 |
| 457 |
/.$NewCase./ |
446 |
/.$NewCase./ |
| 458 |
unaryName ::= unaryIdentifier |
447 |
reservedPunctuationCS ::= reservedPunctuation |
| 459 |
/.$BeginJava |
448 |
/.$BeginJava |
| 460 |
SimpleNameCS result = createSimpleNameCS( |
449 |
SimpleNameCS result = createSimpleNameCS( |
| 461 |
SimpleTypeEnum.IDENTIFIER_LITERAL, |
450 |
SimpleTypeEnum.IDENTIFIER_LITERAL, |
|
Lines 466-476
Link Here
|
| 466 |
$EndJava |
455 |
$EndJava |
| 467 |
./ |
456 |
./ |
| 468 |
|
457 |
|
| 469 |
iterateName ::= iterate |
458 |
iterateNameCS ::= iterateIdentifier |
| 470 |
/.$NewCase./ |
459 |
/.$NewCase./ |
| 471 |
iteratorName ::= iteratorIdentifier |
460 |
iteratorNameCS ::= iteratorIdentifier |
| 472 |
/.$NewCase./ |
|
|
| 473 |
oclIsInStateName ::= oclIsInState |
| 474 |
/.$BeginJava |
461 |
/.$BeginJava |
| 475 |
SimpleNameCS result = createSimpleNameCS( |
462 |
SimpleNameCS result = createSimpleNameCS( |
| 476 |
SimpleTypeEnum.KEYWORD_LITERAL, |
463 |
SimpleTypeEnum.KEYWORD_LITERAL, |
|
Lines 481-492
Link Here
|
| 481 |
$EndJava |
468 |
$EndJava |
| 482 |
./ |
469 |
./ |
| 483 |
|
470 |
|
|
|
471 |
literalSimpleNameCS -> booleanLiteralExpCS |
| 472 |
literalSimpleNameCS -> invalidLiteralExpCS |
| 473 |
literalSimpleNameCS -> nullLiteralExpCS |
| 474 |
|
| 475 |
notIteratorNorReservedSimpleNameCS -> collectionTypeIdentifierCS |
| 476 |
-- notIteratorNorReservedSimpleNameCS -> iterateNameCS |
| 477 |
-- notIteratorNorReservedSimpleNameCS -> iteratorNameCS |
| 478 |
notIteratorNorReservedSimpleNameCS -> literalSimpleNameCS |
| 479 |
-- notIteratorNorReservedSimpleNameCS -> reservedKeywordCS |
| 480 |
notIteratorNorReservedSimpleNameCS -> simpleIdentifierCS |
| 481 |
|
| 482 |
notLiteralNorReservedSimpleNameCS -> collectionTypeIdentifierCS |
| 483 |
notLiteralNorReservedSimpleNameCS -> iterateNameCS |
| 484 |
notLiteralNorReservedSimpleNameCS -> iteratorNameCS |
| 485 |
-- notLiteralNorReservedSimpleNameCS -> literalSimpleNameCS |
| 486 |
-- notLiteralNorReservedSimpleNameCS -> reservedKeywordCS |
| 487 |
notLiteralNorReservedSimpleNameCS -> simpleIdentifierCS -- IDENTIFIER, self, primitiveTypeCS |
| 488 |
|
| 489 |
notReservedSimpleNameCS -> notLiteralNorReservedSimpleNameCS |
| 490 |
notReservedSimpleNameCS -> literalSimpleNameCS |
| 491 |
|
| 492 |
simpleNameCS -> notReservedSimpleNameCS |
| 493 |
simpleNameCS -> reservedKeywordCS |
| 494 |
|
| 495 |
operationOrNotReservedSimpleNameCS -> notReservedSimpleNameCS |
| 496 |
operationOrNotReservedSimpleNameCS -> reservedKeywordCS |
| 497 |
operationOrNotReservedSimpleNameCS -> reservedPunctuationCS |
| 498 |
|
| 484 |
-- |
499 |
-- |
| 485 |
-- the 'operationCS' non-terminal is not referenced in this grammar |
500 |
-- the 'operationCS' non-terminal is not referenced in this grammar |
| 486 |
-- |
501 |
-- |
| 487 |
operationCS -> operationCS1 |
502 |
operationCS -> operationCS1 |
| 488 |
operationCS -> operationCS2 |
503 |
operationCS -> operationCS2 |
| 489 |
operationCS1 ::= IDENTIFIER '(' parametersCSopt ')' ':' typeCSopt |
504 |
operationCS1 ::= notReservedSimpleNameCS '(' variableListCSopt ')' ':' typeCSopt |
| 490 |
/.$BeginJava |
505 |
/.$BeginJava |
| 491 |
CSTNode result = createOperationCS( |
506 |
CSTNode result = createOperationCS( |
| 492 |
getTokenText($getToken(1)), |
507 |
getTokenText($getToken(1)), |
|
Lines 501-542
Link Here
|
| 501 |
$setResult(result); |
516 |
$setResult(result); |
| 502 |
$EndJava |
517 |
$EndJava |
| 503 |
./ |
518 |
./ |
| 504 |
operationCS2 ::= pathNameCS '::' simpleNameCS '(' parametersCSopt ')' ':' typeCSopt |
519 |
operationCS2 ::= qualifiedPathNameCS '(' variableListCSopt ')' ':' typeCSopt |
| 505 |
/.$BeginJava |
520 |
/.$BeginJava |
|
|
521 |
PathNameCS pathNameCS = (PathNameCS)$getSym(1); |
| 522 |
TypeCS typeCS = (TypeCS)$getSym(6); |
| 506 |
CSTNode result = createOperationCS( |
523 |
CSTNode result = createOperationCS( |
| 507 |
(PathNameCS)$getSym(1), |
524 |
pathNameCS, |
| 508 |
(SimpleNameCS)$getSym(3), |
525 |
removeLastSimpleNameCS(pathNameCS), |
| 509 |
(EList)$getSym(5), |
526 |
(EList)$getSym(3), |
| 510 |
(TypeCS)$getSym(8) |
527 |
typeCS |
| 511 |
); |
528 |
); |
| 512 |
if ($getSym(8) != null) { |
529 |
if (typeCS != null) { |
| 513 |
setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(8)); |
530 |
setOffsets(result, pathNameCS, typeCS); |
| 514 |
} else { |
531 |
} else { |
| 515 |
setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(7))); |
532 |
setOffsets(result, pathNameCS, getIToken($getToken(5))); |
| 516 |
} |
533 |
} |
| 517 |
$setResult(result); |
534 |
$setResult(result); |
| 518 |
$EndJava |
535 |
$EndJava |
| 519 |
./ |
536 |
./ |
| 520 |
|
537 |
|
| 521 |
|
|
|
| 522 |
parametersCSopt ::= $empty |
| 523 |
/.$EmptyListAction./ |
| 524 |
parametersCSopt -> parametersCS |
| 525 |
parametersCS ::= variableCS |
| 526 |
/.$BeginJava |
| 527 |
EList result = new BasicEList(); |
| 528 |
result.add($getSym(1)); |
| 529 |
$setResult(result); |
| 530 |
$EndJava |
| 531 |
./ |
| 532 |
parametersCS ::= parametersCS ',' variableCS |
| 533 |
/.$BeginJava |
| 534 |
EList result = (EList)$getSym(1); |
| 535 |
result.add($getSym(3)); |
| 536 |
$setResult(result); |
| 537 |
$EndJava |
| 538 |
./ |
| 539 |
|
| 540 |
simpleNameCSopt ::= $empty |
538 |
simpleNameCSopt ::= $empty |
| 541 |
/.$NullAction./ |
539 |
/.$NullAction./ |
| 542 |
simpleNameCSopt -> simpleNameCS |
540 |
simpleNameCSopt -> simpleNameCS |
|
Lines 583-610
Link Here
|
| 583 |
equalityWithLet ::= equalityExpCS '<>' relationalWithLet |
581 |
equalityWithLet ::= equalityExpCS '<>' relationalWithLet |
| 584 |
/.$NewCase./ |
582 |
/.$NewCase./ |
| 585 |
|
583 |
|
| 586 |
relationalExpCS -> ifExpCSPrec |
584 |
relationalExpCS -> additiveExpCS |
| 587 |
-- Note that ifExp already embeds let, so we needn't deal with it here |
|
|
| 588 |
relationalWithLet -> additiveWithLet |
585 |
relationalWithLet -> additiveWithLet |
| 589 |
relationalExpCS ::= relationalExpCS '>' ifExpCSPrec |
586 |
relationalExpCS ::= relationalExpCS '>' additiveExpCS |
| 590 |
/.$NewCase./ |
587 |
/.$NewCase./ |
| 591 |
relationalWithLet ::= relationalExpCS '>' additiveWithLet |
588 |
relationalWithLet ::= relationalExpCS '>' additiveWithLet |
| 592 |
/.$NewCase./ |
589 |
/.$NewCase./ |
| 593 |
relationalExpCS ::= relationalExpCS '<' ifExpCSPrec |
590 |
relationalExpCS ::= relationalExpCS '<' additiveExpCS |
| 594 |
/.$NewCase./ |
591 |
/.$NewCase./ |
| 595 |
relationalWithLet ::= relationalExpCS '<' additiveWithLet |
592 |
relationalWithLet ::= relationalExpCS '<' additiveWithLet |
| 596 |
/.$NewCase./ |
593 |
/.$NewCase./ |
| 597 |
relationalExpCS ::= relationalExpCS '>=' ifExpCSPrec |
594 |
relationalExpCS ::= relationalExpCS '>=' additiveExpCS |
| 598 |
/.$NewCase./ |
595 |
/.$NewCase./ |
| 599 |
relationalWithLet ::= relationalExpCS '>=' additiveWithLet |
596 |
relationalWithLet ::= relationalExpCS '>=' additiveWithLet |
| 600 |
/.$NewCase./ |
597 |
/.$NewCase./ |
| 601 |
relationalExpCS ::= relationalExpCS '<=' ifExpCSPrec |
598 |
relationalExpCS ::= relationalExpCS '<=' additiveExpCS |
| 602 |
/.$NewCase./ |
599 |
/.$NewCase./ |
| 603 |
relationalWithLet ::= relationalExpCS '<=' additiveWithLet |
600 |
relationalWithLet ::= relationalExpCS '<=' additiveWithLet |
| 604 |
/.$NewCase./ |
601 |
/.$NewCase./ |
| 605 |
|
|
|
| 606 |
ifExpCSPrec -> additiveExpCS |
| 607 |
ifExpCSPrec -> ifExpCS |
| 608 |
|
602 |
|
| 609 |
additiveExpCS -> multiplicativeExpCS |
603 |
additiveExpCS -> multiplicativeExpCS |
| 610 |
additiveWithLet -> multiplicativeWithLet |
604 |
additiveWithLet -> multiplicativeWithLet |
|
Lines 680-701
Link Here
|
| 680 |
./ |
674 |
./ |
| 681 |
|
675 |
|
| 682 |
dotArrowExpCS -> oclExpCS |
676 |
dotArrowExpCS -> oclExpCS |
| 683 |
dotArrowExpCS ::= dotArrowExpCS callExpCS |
677 |
dotArrowExpCS -> callExpCS |
| 684 |
/.$BeginJava |
678 |
dotArrowExpCS -> oclMessageExpCS |
| 685 |
CallExpCS result = (CallExpCS)$getSym(2); |
|
|
| 686 |
result.setSource((OCLExpressionCS)$getSym(1)); |
| 687 |
setOffsets(result, (CSTNode)$getSym(1), result); |
| 688 |
$setResult(result); |
| 689 |
$EndJava |
| 690 |
./ |
| 691 |
dotArrowExpCS ::= dotArrowExpCS messageExpCS |
| 692 |
/.$BeginJava |
| 693 |
MessageExpCS result = (MessageExpCS)$getSym(2); |
| 694 |
result.setTarget((OCLExpressionCS)$getSym(1)); |
| 695 |
setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(2)); |
| 696 |
$setResult(result); |
| 697 |
$EndJava |
| 698 |
./ |
| 699 |
dotArrowExpCS ::= NUMERIC_OPERATION '(' argumentsCSopt ')' |
679 |
dotArrowExpCS ::= NUMERIC_OPERATION '(' argumentsCSopt ')' |
| 700 |
/.$BeginJava |
680 |
/.$BeginJava |
| 701 |
// NUMERIC_OPERATION -> Integer '.' Identifier |
681 |
// NUMERIC_OPERATION -> Integer '.' Identifier |
|
Lines 739-763
Link Here
|
| 739 |
$EndJava |
719 |
$EndJava |
| 740 |
./ |
720 |
./ |
| 741 |
|
721 |
|
| 742 |
-- static operation call (@pre is not permitted in this context) |
722 |
oclExpCS -> ifExpCS |
| 743 |
dotArrowExpCS ::= pathNameCS '::' simpleNameCS '(' argumentsCSopt ')' |
723 |
oclExpCS -> associationClassCallExpCS |
| 744 |
/.$BeginJava |
|
|
| 745 |
OperationCallExpCS result = createOperationCallExpCS( |
| 746 |
(PathNameCS)$getSym(1), |
| 747 |
(SimpleNameCS)$getSym(3), |
| 748 |
(EList)$getSym(5) |
| 749 |
); |
| 750 |
setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(6))); |
| 751 |
result.setAccessor(DotOrArrowEnum.DOT_LITERAL); |
| 752 |
$setResult(result); |
| 753 |
$EndJava |
| 754 |
./ |
| 755 |
|
| 756 |
|
| 757 |
oclExpCS -> variableExpCS |
| 758 |
oclExpCS -> literalExpCS |
724 |
oclExpCS -> literalExpCS |
| 759 |
oclExpCS -> operationCallExpCS |
725 |
oclExpCS -> operationCallExpCS_DF |
| 760 |
oclExpCS -> keywordOperationCallExpCS |
726 |
oclExpCS -> operationCallExpCS_G |
| 761 |
|
727 |
|
| 762 |
oclExpCS ::= '(' oclExpressionCS ')' |
728 |
oclExpCS ::= '(' oclExpressionCS ')' |
| 763 |
/.$BeginJava |
729 |
/.$BeginJava |
|
Lines 770-778
Link Here
|
| 770 |
$EndJava |
736 |
$EndJava |
| 771 |
./ |
737 |
./ |
| 772 |
|
738 |
|
| 773 |
variableExpCS ::= simpleNameCS isMarkedPreCS |
739 |
associationClassCallExpCS ::= notLiteralNorReservedSimpleNameCS isMarkedPreCSopt |
| 774 |
/.$NewCase./ |
|
|
| 775 |
variableExpCS ::= keywordAsName1 isMarkedPreCS |
| 776 |
/.$BeginJava |
740 |
/.$BeginJava |
| 777 |
IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(2); |
741 |
IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(2); |
| 778 |
CSTNode result = createVariableExpCS( |
742 |
CSTNode result = createVariableExpCS( |
|
Lines 788-796
Link Here
|
| 788 |
$setResult(result); |
752 |
$setResult(result); |
| 789 |
$EndJava |
753 |
$EndJava |
| 790 |
./ |
754 |
./ |
| 791 |
variableExpCS ::= simpleNameCS '[' argumentsCS ']' isMarkedPreCS |
755 |
associationClassCallExpCS ::= notReservedSimpleNameCS '[' argumentsCS ']' isMarkedPreCSopt |
| 792 |
/.$NewCase./ |
|
|
| 793 |
variableExpCS ::= keywordAsName1 '[' argumentsCS ']' isMarkedPreCS |
| 794 |
/.$BeginJava |
756 |
/.$BeginJava |
| 795 |
IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(5); |
757 |
IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(5); |
| 796 |
CSTNode result = createVariableExpCS( |
758 |
CSTNode result = createVariableExpCS( |
|
Lines 807-815
Link Here
|
| 807 |
$EndJava |
769 |
$EndJava |
| 808 |
./ |
770 |
./ |
| 809 |
|
771 |
|
| 810 |
|
772 |
simpleIdentifierCS -> primitiveTypeCS |
| 811 |
simpleNameCS -> primitiveTypeCS |
773 |
simpleIdentifierCS ::= self |
| 812 |
simpleNameCS ::= self |
|
|
| 813 |
/.$BeginJava |
774 |
/.$BeginJava |
| 814 |
CSTNode result = createSimpleNameCS( |
775 |
CSTNode result = createSimpleNameCS( |
| 815 |
SimpleTypeEnum.SELF_LITERAL, |
776 |
SimpleTypeEnum.SELF_LITERAL, |
|
Lines 819-825
Link Here
|
| 819 |
$setResult(result); |
780 |
$setResult(result); |
| 820 |
$EndJava |
781 |
$EndJava |
| 821 |
./ |
782 |
./ |
| 822 |
simpleNameCS -> simpleIdentifierCS |
|
|
| 823 |
simpleIdentifierCS ::= IDENTIFIER |
783 |
simpleIdentifierCS ::= IDENTIFIER |
| 824 |
/.$BeginJava |
784 |
/.$BeginJava |
| 825 |
CSTNode result = createSimpleNameCS( |
785 |
CSTNode result = createSimpleNameCS( |
|
Lines 922-928
Link Here
|
| 922 |
$EndJava |
882 |
$EndJava |
| 923 |
./ |
883 |
./ |
| 924 |
|
884 |
|
| 925 |
pathNameCS ::= simpleIdentifierCS |
885 |
pathNameCS ::= notReservedSimpleNameCS |
| 926 |
/.$BeginJava |
886 |
/.$BeginJava |
| 927 |
SimpleNameCS simpleName = (SimpleNameCS)$getSym(1); |
887 |
SimpleNameCS simpleName = (SimpleNameCS)$getSym(1); |
| 928 |
PathNameCS result = createPathNameCS(simpleName); |
888 |
PathNameCS result = createPathNameCS(simpleName); |
|
Lines 930-936
Link Here
|
| 930 |
$setResult(result); |
890 |
$setResult(result); |
| 931 |
$EndJava |
891 |
$EndJava |
| 932 |
./ |
892 |
./ |
| 933 |
pathNameCS ::= pathNameCS '::' simpleNameCS |
893 |
qualifiedPathNameCS ::= pathNameCS '::' notReservedSimpleNameCS |
| 934 |
/.$BeginJava |
894 |
/.$BeginJava |
| 935 |
PathNameCS result = (PathNameCS)$getSym(1); |
895 |
PathNameCS result = (PathNameCS)$getSym(1); |
| 936 |
SimpleNameCS simpleName = (SimpleNameCS)$getSym(3); |
896 |
SimpleNameCS simpleName = (SimpleNameCS)$getSym(3); |
|
Lines 939-952
Link Here
|
| 939 |
$setResult(result); |
899 |
$setResult(result); |
| 940 |
$EndJava |
900 |
$EndJava |
| 941 |
./ |
901 |
./ |
| 942 |
|
902 |
pathNameCS -> qualifiedPathNameCS |
| 943 |
pathNameCSOpt ::= $empty |
|
|
| 944 |
/.$BeginJava |
| 945 |
CSTNode result = createPathNameCS(); |
| 946 |
$setResult(result); |
| 947 |
$EndJava |
| 948 |
./ |
| 949 |
pathNameCSOpt -> pathNameCS |
| 950 |
|
903 |
|
| 951 |
literalExpCS -> enumLiteralExpCS |
904 |
literalExpCS -> enumLiteralExpCS |
| 952 |
literalExpCS -> collectionLiteralExpCS |
905 |
literalExpCS -> collectionLiteralExpCS |
|
Lines 957-1010
Link Here
|
| 957 |
|
910 |
|
| 958 |
-- also covers the case of static attribute call, in which |
911 |
-- also covers the case of static attribute call, in which |
| 959 |
-- case @pre is not allowed anyway |
912 |
-- case @pre is not allowed anyway |
| 960 |
enumLiteralExpCS ::= pathNameCS '::' keywordAsName |
913 |
enumLiteralExpCS ::= qualifiedPathNameCS |
| 961 |
/.$NewCase./ |
|
|
| 962 |
enumLiteralExpCS ::= pathNameCS '::' simpleNameCS |
| 963 |
/.$BeginJava |
914 |
/.$BeginJava |
|
|
915 |
PathNameCS pathNameCS = (PathNameCS)$getSym(1); |
| 916 |
SimpleNameCS simpleNameCS = removeLastSimpleNameCS(pathNameCS); |
| 964 |
CSTNode result = createEnumLiteralExpCS( |
917 |
CSTNode result = createEnumLiteralExpCS( |
| 965 |
(PathNameCS)$getSym(1), |
918 |
pathNameCS, |
| 966 |
(SimpleNameCS)$getSym(3) |
919 |
simpleNameCS |
| 967 |
); |
920 |
); |
| 968 |
setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3)); |
921 |
setOffsets(result, pathNameCS, simpleNameCS); |
| 969 |
$setResult(result); |
922 |
$setResult(result); |
| 970 |
$EndJava |
923 |
$EndJava |
| 971 |
./ |
924 |
./ |
| 972 |
|
925 |
|
| 973 |
collectionLiteralExpCS ::= collectionTypeIdentifierCS '{' collectionLiteralPartsCSopt '}' |
926 |
collectionLiteralExpCS ::= collectionTypeIdentifierCS '{' collectionLiteralPartsCSopt '}' |
| 974 |
/.$BeginJava |
927 |
/.$BeginJava |
| 975 |
Object[] objs = (Object[])$getSym(1); |
928 |
CollectionTypeCS typeCS = (CollectionTypeCS)$getSym(1); |
| 976 |
CSTNode result = createCollectionLiteralExpCS( |
929 |
CSTNode result = createCollectionLiteralExpCS( |
| 977 |
(CollectionTypeIdentifierEnum)objs[1], |
930 |
typeCS, |
| 978 |
(EList)$getSym(3) |
931 |
(EList)$getSym(3) |
| 979 |
); |
932 |
); |
| 980 |
setOffsets(result, (IToken)objs[0], getIToken($getToken(4))); |
933 |
setOffsets(result, typeCS, getIToken($getToken(4))); |
| 981 |
$setResult(result); |
934 |
$setResult(result); |
| 982 |
$EndJava |
935 |
$EndJava |
| 983 |
./ |
936 |
./ |
| 984 |
|
937 |
|
| 985 |
collectionTypeIdentifierCS ::= Set |
938 |
collectionTypeIdentifierCS ::= Set |
| 986 |
/.$BeginJava |
939 |
/.$BeginJava |
| 987 |
$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.SET_LITERAL}); |
940 |
SimpleNameCS result = createCollectionTypeCS( |
|
|
941 |
CollectionTypeIdentifierEnum.SET_LITERAL, |
| 942 |
getTokenText($getToken(1)) |
| 943 |
); |
| 944 |
setOffsets(result, getIToken($getToken(1))); |
| 945 |
$setResult(result); |
| 988 |
$EndJava |
946 |
$EndJava |
| 989 |
./ |
947 |
./ |
| 990 |
collectionTypeIdentifierCS ::= Bag |
948 |
collectionTypeIdentifierCS ::= Bag |
| 991 |
/.$BeginJava |
949 |
/.$BeginJava |
| 992 |
$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.BAG_LITERAL}); |
950 |
SimpleNameCS result = createCollectionTypeCS( |
|
|
951 |
CollectionTypeIdentifierEnum.BAG_LITERAL, |
| 952 |
getTokenText($getToken(1)) |
| 953 |
); |
| 954 |
setOffsets(result, getIToken($getToken(1))); |
| 955 |
$setResult(result); |
| 993 |
$EndJava |
956 |
$EndJava |
| 994 |
./ |
957 |
./ |
| 995 |
collectionTypeIdentifierCS ::= Sequence |
958 |
collectionTypeIdentifierCS ::= Sequence |
| 996 |
/.$BeginJava |
959 |
/.$BeginJava |
| 997 |
$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.SEQUENCE_LITERAL}); |
960 |
SimpleNameCS result = createCollectionTypeCS( |
|
|
961 |
CollectionTypeIdentifierEnum.SEQUENCE_LITERAL, |
| 962 |
getTokenText($getToken(1)) |
| 963 |
); |
| 964 |
setOffsets(result, getIToken($getToken(1))); |
| 965 |
$setResult(result); |
| 998 |
$EndJava |
966 |
$EndJava |
| 999 |
./ |
967 |
./ |
| 1000 |
collectionTypeIdentifierCS ::= Collection |
968 |
collectionTypeIdentifierCS ::= Collection |
| 1001 |
/.$BeginJava |
969 |
/.$BeginJava |
| 1002 |
$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.COLLECTION_LITERAL}); |
970 |
SimpleNameCS result = createCollectionTypeCS( |
|
|
971 |
CollectionTypeIdentifierEnum.COLLECTION_LITERAL, |
| 972 |
getTokenText($getToken(1)) |
| 973 |
); |
| 974 |
setOffsets(result, getIToken($getToken(1))); |
| 975 |
$setResult(result); |
| 1003 |
$EndJava |
976 |
$EndJava |
| 1004 |
./ |
977 |
./ |
| 1005 |
collectionTypeIdentifierCS ::= OrderedSet |
978 |
collectionTypeIdentifierCS ::= OrderedSet |
| 1006 |
/.$BeginJava |
979 |
/.$BeginJava |
| 1007 |
$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL}); |
980 |
SimpleNameCS result = createCollectionTypeCS( |
|
|
981 |
CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL, |
| 982 |
getTokenText($getToken(1)) |
| 983 |
); |
| 984 |
setOffsets(result, getIToken($getToken(1))); |
| 985 |
$setResult(result); |
| 1008 |
$EndJava |
986 |
$EndJava |
| 1009 |
./ |
987 |
./ |
| 1010 |
|
988 |
|
|
Lines 1147-1289
Link Here
|
| 1147 |
$EndJava |
1125 |
$EndJava |
| 1148 |
./ |
1126 |
./ |
| 1149 |
|
1127 |
|
| 1150 |
|
1128 |
callExpCS -> loopExpCS |
| 1151 |
callExpCS ::= '->' featureCallExpCS |
1129 |
callExpCS -> propertyCallExpCS |
| 1152 |
/.$NewCase./ |
1130 |
callExpCS -> operationCallExpCS_B |
| 1153 |
callExpCS ::= '->' loopExpCS |
1131 |
callExpCS -> operationCallExpCS_CE |
| 1154 |
/.$BeginJava |
1132 |
callExpCS -> operationCallExpCS_IJ |
| 1155 |
CallExpCS result = (CallExpCS)$getSym(2); |
|
|
| 1156 |
result.setAccessor(DotOrArrowEnum.ARROW_LITERAL); |
| 1157 |
$setResult(result); |
| 1158 |
$EndJava |
| 1159 |
./ |
| 1160 |
callExpCS ::= '.' keywordOperationCallExpCS |
| 1161 |
/.$NewCase./ |
| 1162 |
callExpCS ::= '.' featureCallExpCS |
| 1163 |
/.$BeginJava |
| 1164 |
CallExpCS result = (CallExpCS)$getSym(2); |
| 1165 |
result.setAccessor(DotOrArrowEnum.DOT_LITERAL); |
| 1166 |
if (result instanceof OperationCallExpCS) { |
| 1167 |
((OperationCallExpCS)result).setIsAtomic(true); |
| 1168 |
} |
| 1169 |
$setResult(result); |
| 1170 |
$EndJava |
| 1171 |
./ |
| 1172 |
|
1133 |
|
| 1173 |
loopExpCS -> iteratorExpCS |
1134 |
loopExpCS -> iteratorExpCS |
| 1174 |
loopExpCS -> iterateExpCS |
1135 |
loopExpCS -> iterateExpCS |
| 1175 |
|
1136 |
|
| 1176 |
iteratorExpCS ::= iteratorName '(' oclExpressionCS ')' |
1137 |
iteratorExpCS ::= dotArrowExpCS '->' iteratorNameCS '(' oclExpressionCS ')' |
| 1177 |
/.$BeginJava |
1138 |
/.$BeginJava |
| 1178 |
SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); |
1139 |
OCLExpressionCS source = (OCLExpressionCS)$getSym(1); |
|
|
1140 |
SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3); |
| 1179 |
CSTNode result = createIteratorExpCS( |
1141 |
CSTNode result = createIteratorExpCS( |
|
|
1142 |
source, |
| 1180 |
simpleNameCS, |
1143 |
simpleNameCS, |
| 1181 |
null, |
1144 |
null, |
| 1182 |
null, |
1145 |
null, |
| 1183 |
(OCLExpressionCS)$getSym(3) |
1146 |
(OCLExpressionCS)$getSym(5) |
| 1184 |
); |
1147 |
); |
| 1185 |
setOffsets(result, simpleNameCS, getIToken($getToken(4))); |
1148 |
setOffsets(result, source, getIToken($getToken(6))); |
| 1186 |
$setResult(result); |
1149 |
$setResult(result); |
| 1187 |
$EndJava |
1150 |
$EndJava |
| 1188 |
./ |
1151 |
./ |
| 1189 |
iteratorExpCS ::= iteratorName '(' variableCS '|' oclExpressionCS ')' |
1152 |
iteratorExpCS ::= dotArrowExpCS '->' iteratorNameCS '(' variableCS '|' oclExpressionCS ')' |
| 1190 |
/.$BeginJava |
1153 |
/.$BeginJava |
| 1191 |
SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); |
1154 |
OCLExpressionCS source = (OCLExpressionCS)$getSym(1); |
|
|
1155 |
SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3); |
| 1192 |
CSTNode result = createIteratorExpCS( |
1156 |
CSTNode result = createIteratorExpCS( |
|
|
1157 |
source, |
| 1193 |
simpleNameCS, |
1158 |
simpleNameCS, |
| 1194 |
(VariableCS)$getSym(3), |
1159 |
(VariableCS)$getSym(5), |
| 1195 |
null, |
1160 |
null, |
| 1196 |
(OCLExpressionCS)$getSym(5) |
1161 |
(OCLExpressionCS)$getSym(7) |
| 1197 |
); |
1162 |
); |
| 1198 |
setOffsets(result, simpleNameCS, getIToken($getToken(6))); |
1163 |
setOffsets(result, source, getIToken($getToken(8))); |
| 1199 |
$setResult(result); |
1164 |
$setResult(result); |
| 1200 |
$EndJava |
1165 |
$EndJava |
| 1201 |
./ |
1166 |
./ |
| 1202 |
iteratorExpCS ::= iteratorName '(' variableCS ',' variableCS '|' oclExpressionCS ')' |
1167 |
iteratorExpCS ::= dotArrowExpCS '->' iteratorNameCS '(' variableCS ',' variableCS '|' oclExpressionCS ')' |
| 1203 |
/.$BeginJava |
1168 |
/.$BeginJava |
| 1204 |
SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); |
1169 |
OCLExpressionCS source = (OCLExpressionCS)$getSym(1); |
|
|
1170 |
SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3); |
| 1205 |
CSTNode result = createIteratorExpCS( |
1171 |
CSTNode result = createIteratorExpCS( |
|
|
1172 |
source, |
| 1206 |
simpleNameCS, |
1173 |
simpleNameCS, |
| 1207 |
(VariableCS)$getSym(3), |
|
|
| 1208 |
(VariableCS)$getSym(5), |
1174 |
(VariableCS)$getSym(5), |
| 1209 |
(OCLExpressionCS)$getSym(7) |
1175 |
(VariableCS)$getSym(7), |
|
|
1176 |
(OCLExpressionCS)$getSym(9) |
| 1210 |
); |
1177 |
); |
| 1211 |
setOffsets(result, simpleNameCS, getIToken($getToken(8))); |
1178 |
setOffsets(result, source, getIToken($getToken(10))); |
| 1212 |
$setResult(result); |
1179 |
$setResult(result); |
| 1213 |
$EndJava |
1180 |
$EndJava |
| 1214 |
./ |
1181 |
./ |
| 1215 |
|
1182 |
|
| 1216 |
iterateExpCS ::= iterateName '(' variableCS '|' oclExpressionCS ')' |
1183 |
iterateExpCS ::= dotArrowExpCS '->' iterateNameCS '(' variableCS '|' oclExpressionCS ')' |
| 1217 |
/.$BeginJava |
1184 |
/.$BeginJava |
| 1218 |
SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); |
1185 |
OCLExpressionCS source = (OCLExpressionCS)$getSym(1); |
|
|
1186 |
SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3); |
| 1219 |
CSTNode result = createIterateExpCS( |
1187 |
CSTNode result = createIterateExpCS( |
|
|
1188 |
source, |
| 1220 |
simpleNameCS, |
1189 |
simpleNameCS, |
| 1221 |
(VariableCS)$getSym(3), |
1190 |
(VariableCS)$getSym(5), |
| 1222 |
null, |
1191 |
null, |
| 1223 |
(OCLExpressionCS)$getSym(5) |
1192 |
(OCLExpressionCS)$getSym(7) |
| 1224 |
); |
1193 |
); |
| 1225 |
setOffsets(result, simpleNameCS, getIToken($getToken(6))); |
1194 |
setOffsets(result, source, getIToken($getToken(8))); |
| 1226 |
$setResult(result); |
1195 |
$setResult(result); |
| 1227 |
$EndJava |
1196 |
$EndJava |
| 1228 |
./ |
1197 |
./ |
| 1229 |
iterateExpCS ::= iterateName '(' variableCS ';' variableCS '|' oclExpressionCS ')' |
1198 |
iterateExpCS ::= dotArrowExpCS '->' iterateNameCS '(' variableCS ';' variableCS '|' oclExpressionCS ')' |
| 1230 |
/.$BeginJava |
1199 |
/.$BeginJava |
| 1231 |
SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); |
1200 |
OCLExpressionCS source = (OCLExpressionCS)$getSym(1); |
|
|
1201 |
SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3); |
| 1232 |
CSTNode result = createIterateExpCS( |
1202 |
CSTNode result = createIterateExpCS( |
|
|
1203 |
source, |
| 1233 |
simpleNameCS, |
1204 |
simpleNameCS, |
| 1234 |
(VariableCS)$getSym(3), |
|
|
| 1235 |
(VariableCS)$getSym(5), |
1205 |
(VariableCS)$getSym(5), |
| 1236 |
(OCLExpressionCS)$getSym(7) |
1206 |
(VariableCS)$getSym(7), |
|
|
1207 |
(OCLExpressionCS)$getSym(9) |
| 1237 |
); |
1208 |
); |
| 1238 |
setOffsets(result, simpleNameCS, getIToken($getToken(8))); |
1209 |
setOffsets(result, source, getIToken($getToken(10))); |
| 1239 |
$setResult(result); |
1210 |
$setResult(result); |
| 1240 |
$EndJava |
1211 |
$EndJava |
| 1241 |
./ |
1212 |
./ |
| 1242 |
|
1213 |
|
| 1243 |
variableCS ::= IDENTIFIER |
1214 |
-- Merging these as notReservedSimpleNameCS gives conflicts; why? LPG bug ?? |
|
|
1215 |
variableNameCS ::= booleanLiteralExpCS |
| 1216 |
/.$NewCase./ |
| 1217 |
variableNameCS ::= invalidLiteralExpCS |
| 1218 |
/.$NewCase./ |
| 1219 |
variableNameCS ::= nullLiteralExpCS |
| 1220 |
/.$NewCase./ |
| 1221 |
variableNameCS ::= notLiteralNorReservedSimpleNameCS |
| 1244 |
/.$BeginJava |
1222 |
/.$BeginJava |
| 1245 |
CSTNode result = createVariableCS( |
1223 |
SimpleNameCS name = (SimpleNameCS)$getSym(1); |
| 1246 |
getTokenText($getToken(1)), |
1224 |
CSTNode result = createVariableCS(name.getValue()); |
| 1247 |
null, |
1225 |
setOffsets(result, name); |
| 1248 |
null |
|
|
| 1249 |
); |
| 1250 |
setOffsets(result, getIToken($getToken(1))); |
| 1251 |
$setResult(result); |
1226 |
$setResult(result); |
| 1252 |
$EndJava |
1227 |
$EndJava |
| 1253 |
./ |
1228 |
./ |
| 1254 |
typedVariableCS ::= IDENTIFIER ':' typeCS |
1229 |
typedVariableCS ::= variableNameCS ':' typeCS |
| 1255 |
/.$BeginJava |
1230 |
/.$BeginJava |
| 1256 |
CSTNode result = createVariableCS( |
1231 |
VariableCS result = (VariableCS)$getSym(1); |
| 1257 |
getTokenText($getToken(1)), |
1232 |
TypeCS type = (TypeCS)$getSym(3); |
| 1258 |
(TypeCS)$getSym(3), |
1233 |
result.setTypeCS(type); |
| 1259 |
null |
1234 |
setOffsets(result, result, type); |
| 1260 |
); |
|
|
| 1261 |
setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(3)); |
| 1262 |
$setResult(result); |
1235 |
$setResult(result); |
| 1263 |
$EndJava |
1236 |
$EndJava |
| 1264 |
./ |
1237 |
./ |
|
|
1238 |
variableCS -> variableNameCS |
| 1265 |
variableCS -> typedVariableCS |
1239 |
variableCS -> typedVariableCS |
| 1266 |
variableCS ::= IDENTIFIER ':' typeCS '=' oclExpressionCS |
1240 |
variableCS2 -> variableCS |
| 1267 |
/.$BeginJava |
|
|
| 1268 |
CSTNode result = createVariableCS( |
| 1269 |
getTokenText($getToken(1)), |
| 1270 |
(TypeCS)$getSym(3), |
| 1271 |
(OCLExpressionCS)$getSym(5) |
| 1272 |
); |
| 1273 |
setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(5)); |
| 1274 |
$setResult(result); |
| 1275 |
$EndJava |
| 1276 |
./ |
| 1277 |
|
| 1278 |
-- this form of variable declaration is only used in tuple literals |
1241 |
-- this form of variable declaration is only used in tuple literals |
| 1279 |
variableCS2 ::= IDENTIFIER '=' oclExpressionCS |
1242 |
variableCS2 ::= variableNameCS '=' oclExpressionCS |
|
|
1243 |
/.$NewCase./ |
| 1244 |
variableCS ::= typedVariableCS '=' oclExpressionCS |
| 1280 |
/.$BeginJava |
1245 |
/.$BeginJava |
| 1281 |
CSTNode result = createVariableCS( |
1246 |
VariableCS result = (VariableCS)$getSym(1); |
| 1282 |
getTokenText($getToken(1)), |
1247 |
OCLExpressionCS initExpression = (OCLExpressionCS)$getSym(3); |
| 1283 |
null, |
1248 |
result.setInitExpression(initExpression); |
| 1284 |
(OCLExpressionCS)$getSym(3) |
1249 |
setOffsets(result, result, initExpression); |
| 1285 |
); |
|
|
| 1286 |
setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(3)); |
| 1287 |
$setResult(result); |
1250 |
$setResult(result); |
| 1288 |
$EndJava |
1251 |
$EndJava |
| 1289 |
./ |
1252 |
./ |
|
Lines 1292-1313
Link Here
|
| 1292 |
/.$NullAction./ |
1255 |
/.$NullAction./ |
| 1293 |
typeCSopt -> typeCS |
1256 |
typeCSopt -> typeCS |
| 1294 |
|
1257 |
|
| 1295 |
-- the order of these rules is important! Try to match primitives |
|
|
| 1296 |
-- first, then tuples (more complex), and finally collections. |
| 1297 |
-- Looking for type names in the Ecore model is a last resort |
| 1298 |
typeCS -> primitiveTypeCS |
| 1299 |
typeCS -> tupleTypeCS |
1258 |
typeCS -> tupleTypeCS |
| 1300 |
typeCS -> collectionTypeCS |
1259 |
typeCS -> collectionTypeCS |
| 1301 |
typeCS -> pathNameCS |
1260 |
typeCS -> qualifiedPathNameCS |
|
|
1261 |
typeCS ::= notReservedSimpleNameCS -- covers primitiveTypeCS |
| 1262 |
/.$BeginJava |
| 1263 |
CSTNode result = (CSTNode)$getSym(1); |
| 1264 |
if (!(result instanceof TypeCS)) { |
| 1265 |
PathNameCS pathNameCS = createPathNameCS((SimpleNameCS)result); |
| 1266 |
setOffsets(pathNameCS, result); |
| 1267 |
result = pathNameCS; |
| 1268 |
} |
| 1269 |
$setResult(result); |
| 1270 |
$EndJava |
| 1271 |
./ |
| 1302 |
|
1272 |
|
| 1303 |
collectionTypeCS ::= collectionTypeIdentifierCS '(' typeCS ')' |
1273 |
collectionTypeCS ::= collectionTypeIdentifierCS '(' typeCS ')' |
| 1304 |
/.$BeginJava |
1274 |
/.$BeginJava |
| 1305 |
Object[] objs = (Object[])$getSym(1); |
1275 |
CollectionTypeCS result = (CollectionTypeCS)$getSym(1); |
| 1306 |
CSTNode result = createCollectionTypeCS( |
1276 |
result.setTypeCS((TypeCS)$getSym(3)); |
| 1307 |
(CollectionTypeIdentifierEnum)objs[1], |
1277 |
setOffsets(result, result, getIToken($getToken(4))); |
| 1308 |
(TypeCS)$getSym(3) |
|
|
| 1309 |
); |
| 1310 |
setOffsets(result, (IToken)objs[0], getIToken($getToken(4))); |
| 1311 |
$setResult(result); |
1278 |
$setResult(result); |
| 1312 |
$EndJava |
1279 |
$EndJava |
| 1313 |
./ |
1280 |
./ |
|
Lines 1324-1329
Link Here
|
| 1324 |
variableListCSopt ::= $empty |
1291 |
variableListCSopt ::= $empty |
| 1325 |
/.$EmptyListAction./ |
1292 |
/.$EmptyListAction./ |
| 1326 |
variableListCSopt -> variableListCS |
1293 |
variableListCSopt -> variableListCS |
|
|
1294 |
variableListCS2 ::= variableCS2 |
| 1295 |
/.$NewCase./ |
| 1327 |
variableListCS ::= variableCS |
1296 |
variableListCS ::= variableCS |
| 1328 |
/.$BeginJava |
1297 |
/.$BeginJava |
| 1329 |
EList result = new BasicEList(); |
1298 |
EList result = new BasicEList(); |
|
Lines 1331-1336
Link Here
|
| 1331 |
$setResult(result); |
1300 |
$setResult(result); |
| 1332 |
$EndJava |
1301 |
$EndJava |
| 1333 |
./ |
1302 |
./ |
|
|
1303 |
variableListCS2 ::= variableListCS2 ',' variableCS2 |
| 1304 |
/.$NewCase./ |
| 1334 |
variableListCS ::= variableListCS ',' variableCS |
1305 |
variableListCS ::= variableListCS ',' variableCS |
| 1335 |
/.$BeginJava |
1306 |
/.$BeginJava |
| 1336 |
EList result = (EList)$getSym(1); |
1307 |
EList result = (EList)$getSym(1); |
|
Lines 1339-1380
Link Here
|
| 1339 |
$EndJava |
1310 |
$EndJava |
| 1340 |
./ |
1311 |
./ |
| 1341 |
|
1312 |
|
| 1342 |
-- this form of variable declaration list is only used in tuple literals |
1313 |
operationCallExpCS_B ::= dotArrowExpCS '->' notIteratorNorReservedSimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')' |
| 1343 |
variableListCS2 ::= variableCS2 |
|
|
| 1344 |
/.$NewCase./ |
| 1345 |
variableListCS2 ::= variableCS |
| 1346 |
/.$BeginJava |
1314 |
/.$BeginJava |
| 1347 |
EList result = new BasicEList(); |
1315 |
OCLExpressionCS source = (OCLExpressionCS)$getSym(1); |
| 1348 |
result.add($getSym(1)); |
1316 |
CSTNode result = createArrowOperationCallExpCS( |
|
|
1317 |
source, |
| 1318 |
(SimpleNameCS)$getSym(3), |
| 1319 |
(IsMarkedPreCS)$getSym(4), |
| 1320 |
(EList)$getSym(6) |
| 1321 |
); |
| 1322 |
setOffsets(result, source, getIToken($getToken(7))); |
| 1349 |
$setResult(result); |
1323 |
$setResult(result); |
| 1350 |
$EndJava |
1324 |
$EndJava |
| 1351 |
./ |
1325 |
./ |
| 1352 |
variableListCS2 ::= variableListCS2 ',' variableCS2 |
1326 |
operationCallExpCS_CE ::= dotArrowExpCS '.' operationOrNotReservedSimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')' |
| 1353 |
/.$NewCase./ |
|
|
| 1354 |
variableListCS2 ::= variableListCS2 ',' variableCS |
| 1355 |
/.$BeginJava |
1327 |
/.$BeginJava |
| 1356 |
EList result = (EList)$getSym(1); |
1328 |
OCLExpressionCS source = (OCLExpressionCS)$getSym(1); |
| 1357 |
result.add($getSym(3)); |
1329 |
CSTNode result = createDotOperationCallExpCS( |
|
|
1330 |
source, |
| 1331 |
null, |
| 1332 |
(SimpleNameCS)$getSym(3), |
| 1333 |
(IsMarkedPreCS)$getSym(4), |
| 1334 |
(EList)$getSym(6) |
| 1335 |
); |
| 1336 |
setOffsets(result, getIToken($getToken(1)), getIToken($getToken(7))); |
| 1358 |
$setResult(result); |
1337 |
$setResult(result); |
| 1359 |
$EndJava |
1338 |
$EndJava |
| 1360 |
./ |
1339 |
./ |
| 1361 |
|
1340 |
operationCallExpCS_DF ::= notReservedSimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')' |
| 1362 |
-- covers attributeCallExpCS and navigationCallExpCS |
|
|
| 1363 |
featureCallExpCS -> attrOrNavCallExpCS |
| 1364 |
|
| 1365 |
featureCallExpCS -> operationCallExpCS |
| 1366 |
featureCallExpCS ::= unaryName isMarkedPreCS '(' argumentsCSopt ')' |
| 1367 |
/.$NewCase./ |
| 1368 |
-- even though these operations do not use @pre or do not accept multiple arguments |
| 1369 |
-- in order to get better error reporting, the rule signature must comply with |
| 1370 |
-- the full rule of an operationCallExpCS |
| 1371 |
-- the alternative would be to remove these as keywords, but then the parser |
| 1372 |
-- would accept variable declarations where the var can be named "oclIsNew" for example |
| 1373 |
operationCallExpCS ::= binaryName isMarkedPreCS '(' argumentsCSopt ')' |
| 1374 |
/.$NewCase./ |
| 1375 |
keywordOperationCallExpCS ::= keywordAsName isMarkedPreCS '(' argumentsCSopt ')' |
| 1376 |
/.$BeginJava |
1341 |
/.$BeginJava |
| 1377 |
CSTNode result = createOperationCallExpCS( |
1342 |
CSTNode result = createDotOperationCallExpCS( |
|
|
1343 |
null, |
| 1344 |
null, |
| 1378 |
(SimpleNameCS)$getSym(1), |
1345 |
(SimpleNameCS)$getSym(1), |
| 1379 |
(IsMarkedPreCS)$getSym(2), |
1346 |
(IsMarkedPreCS)$getSym(2), |
| 1380 |
(EList)$getSym(4) |
1347 |
(EList)$getSym(4) |
|
Lines 1383-1452
Link Here
|
| 1383 |
$setResult(result); |
1350 |
$setResult(result); |
| 1384 |
$EndJava |
1351 |
$EndJava |
| 1385 |
./ |
1352 |
./ |
| 1386 |
|
1353 |
operationCallExpCS_G ::= qualifiedPathNameCS '(' argumentsCSopt ')' |
| 1387 |
stateExpCS ::= pathNameCSOpt |
|
|
| 1388 |
/.$BeginJava |
1354 |
/.$BeginJava |
| 1389 |
PathNameCS pathNameCS = (PathNameCS)$getSym(1); |
1355 |
PathNameCS pathNameCS = (PathNameCS)$getSym(1); |
| 1390 |
StateExpCS result = createStateExpCS(pathNameCS); |
1356 |
OperationCallExpCS result = createDotOperationCallExpCS( |
| 1391 |
setOffsets(result, pathNameCS); |
1357 |
null, |
|
|
1358 |
pathNameCS, |
| 1359 |
removeLastSimpleNameCS(pathNameCS), |
| 1360 |
null, |
| 1361 |
(EList)$getSym(3) |
| 1362 |
); |
| 1363 |
setOffsets(result, pathNameCS, getIToken($getToken(4))); |
| 1392 |
$setResult(result); |
1364 |
$setResult(result); |
| 1393 |
$EndJava |
1365 |
$EndJava |
| 1394 |
./ |
1366 |
./ |
| 1395 |
-- FIXME StateExpCS creates a needless irregularity; unwrap its content as an argument list |
1367 |
operationCallExpCS_IJ ::= dotArrowExpCS '.' qualifiedPathNameCS isMarkedPreCSopt '(' argumentsCSopt ')' |
| 1396 |
operationCallExpCS ::= oclIsInStateName isMarkedPreCS '(' stateExpCS ')' |
|
|
| 1397 |
/.$BeginJava |
1368 |
/.$BeginJava |
| 1398 |
SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); |
1369 |
PathNameCS pathNameCS = (PathNameCS)$getSym(3); |
| 1399 |
CSTNode result = createOperationCallExpCS( |
1370 |
OCLExpressionCS source = (OCLExpressionCS)$getSym(1); |
| 1400 |
simpleNameCS, |
1371 |
CallExpCS result = createDotOperationCallExpCS( |
| 1401 |
(IsMarkedPreCS)$getSym(2), |
1372 |
source, |
| 1402 |
(StateExpCS)$getSym(4) |
1373 |
pathNameCS, |
|
|
1374 |
removeLastSimpleNameCS(pathNameCS), |
| 1375 |
(IsMarkedPreCS)$getSym(4), |
| 1376 |
(EList)$getSym(6) |
| 1403 |
); |
1377 |
); |
| 1404 |
setOffsets(result, simpleNameCS, getIToken($getToken(5))); |
1378 |
setOffsets(result, source, getIToken($getToken(7))); |
| 1405 |
$setResult(result); |
1379 |
$setResult(result); |
| 1406 |
$EndJava |
1380 |
$EndJava |
| 1407 |
./ |
1381 |
./ |
| 1408 |
|
1382 |
|
| 1409 |
attrOrNavCallExpCS ::= simpleNameCS isMarkedPreCS |
1383 |
propertyCallExpCS ::= dotArrowExpCS '.' notReservedSimpleNameCS isMarkedPreCSopt |
| 1410 |
/.$NewCase./ |
|
|
| 1411 |
attrOrNavCallExpCS ::= keywordAsName isMarkedPreCS |
| 1412 |
/.$BeginJava |
1384 |
/.$BeginJava |
| 1413 |
IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(2); |
1385 |
OCLExpressionCS source = (OCLExpressionCS)$getSym(1); |
|
|
1386 |
IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(4); |
| 1414 |
CSTNode result = createFeatureCallExpCS( |
1387 |
CSTNode result = createFeatureCallExpCS( |
| 1415 |
(SimpleNameCS)$getSym(1), |
1388 |
source, |
|
|
1389 |
(SimpleNameCS)$getSym(3), |
| 1416 |
new BasicEList(), |
1390 |
new BasicEList(), |
| 1417 |
isMarkedPreCS |
1391 |
isMarkedPreCS |
| 1418 |
); |
1392 |
); |
| 1419 |
if (isMarkedPreCS != null) { |
1393 |
if (isMarkedPreCS != null) { |
| 1420 |
setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(2)); |
1394 |
setOffsets(result, source, isMarkedPreCS); |
| 1421 |
} else { |
1395 |
} else { |
| 1422 |
setOffsets(result, (CSTNode)$getSym(1)); |
1396 |
setOffsets(result, source, (SimpleNameCS)$getSym(3)); |
| 1423 |
} |
1397 |
} |
| 1424 |
$setResult(result); |
1398 |
$setResult(result); |
| 1425 |
$EndJava |
1399 |
$EndJava |
| 1426 |
./ |
1400 |
./ |
| 1427 |
attrOrNavCallExpCS ::= simpleNameCS '[' argumentsCS ']' isMarkedPreCS |
1401 |
propertyCallExpCS ::= dotArrowExpCS '.' notReservedSimpleNameCS '[' argumentsCS ']' isMarkedPreCSopt |
| 1428 |
/.$BeginJava |
1402 |
/.$BeginJava |
| 1429 |
IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(5); |
1403 |
OCLExpressionCS source = (OCLExpressionCS)$getSym(1); |
|
|
1404 |
IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(7); |
| 1430 |
CSTNode result = createFeatureCallExpCS( |
1405 |
CSTNode result = createFeatureCallExpCS( |
| 1431 |
(SimpleNameCS)$getSym(1), |
1406 |
source, |
| 1432 |
(EList)$getSym(3), |
1407 |
(SimpleNameCS)$getSym(3), |
|
|
1408 |
(EList)$getSym(5), |
| 1433 |
isMarkedPreCS |
1409 |
isMarkedPreCS |
| 1434 |
); |
1410 |
); |
| 1435 |
if (isMarkedPreCS != null) { |
1411 |
if (isMarkedPreCS != null) { |
| 1436 |
setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(5)); |
1412 |
setOffsets(result, source, isMarkedPreCS); |
| 1437 |
} else { |
1413 |
} else { |
| 1438 |
setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(4))); |
1414 |
setOffsets(result, source, getIToken($getToken(6))); |
| 1439 |
} |
1415 |
} |
| 1440 |
$setResult(result); |
1416 |
$setResult(result); |
| 1441 |
$EndJava |
1417 |
$EndJava |
| 1442 |
./ |
1418 |
./ |
| 1443 |
|
1419 |
|
| 1444 |
isMarkedPreCS ::= $empty |
1420 |
isMarkedPreCSopt ::= $empty |
| 1445 |
/.$BeginJava |
1421 |
/.$BeginJava |
| 1446 |
$setResult(null); |
1422 |
$setResult(null); |
| 1447 |
$EndJava |
1423 |
$EndJava |
| 1448 |
./ |
1424 |
./ |
| 1449 |
isMarkedPreCS ::= '@pre' |
1425 |
isMarkedPreCSopt ::= '@pre' |
| 1450 |
/.$BeginJava |
1426 |
/.$BeginJava |
| 1451 |
CSTNode result = createIsMarkedPreCS(); |
1427 |
CSTNode result = createIsMarkedPreCS(); |
| 1452 |
setOffsets(result, getIToken($getToken(1))); |
1428 |
setOffsets(result, getIToken($getToken(1))); |
|
Lines 1496-1511
Link Here
|
| 1496 |
$EndJava |
1472 |
$EndJava |
| 1497 |
./ |
1473 |
./ |
| 1498 |
|
1474 |
|
| 1499 |
messageExpCS ::= '^' simpleNameCS '(' oclMessageArgumentsCSopt ')' |
1475 |
oclMessageExpCS ::= dotArrowExpCS '^' simpleNameCS '(' oclMessageArgumentsCSopt ')' |
| 1500 |
/.$NewCase./ |
1476 |
/.$NewCase./ |
| 1501 |
messageExpCS ::= '^^' simpleNameCS '(' oclMessageArgumentsCSopt ')' |
1477 |
oclMessageExpCS ::= dotArrowExpCS '^^' simpleNameCS '(' oclMessageArgumentsCSopt ')' |
| 1502 |
/.$BeginJava |
1478 |
/.$BeginJava |
| 1503 |
CSTNode result = createMessageExpCS( |
1479 |
OCLExpressionCS target = (OCLExpressionCS)$getSym(1); |
| 1504 |
getIToken($getToken(1)).getKind() == $sym_type.TK_CARET, |
1480 |
MessageExpCS result = createMessageExpCS( |
| 1505 |
(SimpleNameCS)$getSym(2), |
1481 |
target, |
| 1506 |
(EList<OCLMessageArgCS>)$getSym(4) |
1482 |
getIToken($getToken(2)).getKind() == $sym_type.TK_CARET, |
|
|
1483 |
(SimpleNameCS)$getSym(3), |
| 1484 |
(EList<OCLMessageArgCS>)$getSym(5) |
| 1507 |
); |
1485 |
); |
| 1508 |
setOffsets(result, getIToken($getToken(1)), getIToken($getToken(5))); |
1486 |
setOffsets(result, target, getIToken($getToken(6))); |
| 1509 |
$setResult(result); |
1487 |
$setResult(result); |
| 1510 |
$EndJava |
1488 |
$EndJava |
| 1511 |
./ |
1489 |
./ |