Changeset 547 for branches/xtext-MDT/org.modelica.xtext.core
- Timestamp:
- 11/17/09 00:24:33 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/xtext-MDT/org.modelica.xtext.core/src/org/modelica/xtext/ModelicaAST.xtext
r544 r547 90 90 91 91 ClassDefinitionDerived returns ClassDef::DERIVED : 92 EQUALSattributes=ElementAttributes typeSpec=TypeSpecification92 '=' attributes=ElementAttributes typeSpec=TypeSpecification 93 93 ('(' arguments+=ElementArg (',' arguments+=ElementArg)* ')')? comment=Comment 94 94 ; 95 95 96 96 ClassDefinitionEnum returns ClassDef::ENUMERATION : 97 EQUALS'enumeration' '(' enumLiterals=EnumerationDefinition ')' comment=Comment97 '=' 'enumeration' '(' enumLiterals=EnumerationDefinition ')' comment=Comment 98 98 ; 99 99 100 100 ClassDefinitionOverload returns ClassDef::OVERLOAD : 101 EQUALS'overload' '(' functionNames+=Path (',' functionNames+=Path)* ')' comment=Comment101 '=' 'overload' '(' functionNames+=Path (',' functionNames+=Path)* ')' comment=Comment 102 102 ; 103 103 104 104 // CHECK Comment? 105 105 ClassDefinitionPartialDer returns ClassDef::PDER : 106 EQUALS'der' '(' functionName=Path (',' vars+=IDENT)+ ')'106 '=' 'der' '(' functionName=Path (',' vars+=IDENT)+ ')' 107 107 ; 108 108 // CHECK Comment or StringComment … … 122 122 EnumerationDefinition returns EnumDef::uEnumDef : 123 123 {EnumDef::ENUMLITERALS} enumLiterals+=EnumLiteral (',' enumLiterals+=EnumLiteral)* 124 | {EnumDef::ENUM_COLON} COLON124 | {EnumDef::ENUM_COLON} ':' 125 125 ; 126 126 … … 154 154 // FIXME Figure out the text thing 155 155 // fix redeclareKeyword>s< ?=('redeclare')? 156 Element returns Element::uElement :157 ElementElement156 //Element returns Element::uElement : 157 // ElementElement 158 158 //|{TEXT} 159 159 //|{DEFINEUNIT} 160 ;160 //; 161 161 162 162 // FIXME constrainedby clause 163 Element Element returns Element::ELEMENT:164 specification=(ElementSpecificationImport|ElementSpecificationExtends) innerOuter=InnerOuterUnspecified165 | redeclareKeywords=RedeclareKeyword? finalPrefix?=('final')?163 Element returns Element::uElement: 164 {Element::ELEMENT} specification=(ElementSpecificationImport|ElementSpecificationExtends) innerOuter=InnerOuterUnspecified 165 |{Element::ELEMENT} redeclareKeywords=RedeclareKeyword? finalPrefix?=('final')? 166 166 innerOuter=InnerOuter specification=(ElementSpecificationClassDefinition | ElementSpecificationComponents) 167 | redeclareKeywords=(RedeclareReplaceableKeyword | ReplaceableKeyword) innerOuter=InnerOuter167 |{Element::ELEMENT} redeclareKeywords=(RedeclareReplaceableKeyword | ReplaceableKeyword) innerOuter=InnerOuter 168 168 specification=(ElementSpecificationClassDefinition | ElementSpecificationComponents) 169 169 //('constrainedby' name=IDENT constrainClass=ConstrainClass)? … … 216 216 // FIXME the unqualified import- perhaps in a M2M transformation 217 217 Import returns Import::uImport : 218 {Import::NAMED_IMPORT} name=IDENT EQUALSpath=Path218 {Import::NAMED_IMPORT} name=IDENT '=' path=Path 219 219 |{Import::QUAL_IMPORT} path=Path 220 220 //|{UNQUAL_IMPORT} path=Path … … 324 324 325 325 AlgorithmReturn returns AlgorithmStatement::ALG_RETURN : 326 'return'326 {AlgorithmStatement::ALG_RETURN} 'return' 327 327 ; 328 328 329 329 AlgorithmWhile returns AlgorithmStatement::ALG_WHILE : 330 'while' boolExpr=Expression 'loop' (whileBody+=AlgorithmItem)* 'end' 'while'330 {AlgorithmStatement::ALG_WHILE} 'while' boolExpr=Expression 'loop' (whileBody+=AlgorithmItem)* 'end' 'while' 331 331 ; 332 332 333 333 AlgorithmBreak returns AlgorithmStatement::ALG_BREAK : 334 'break'334 {AlgorithmStatement::ALG_BREAK} 'break' 335 335 ; 336 336 337 337 Modification returns Modifications::uModification : 338 338 {Modifications::CLASSMOD} ( 339 '(' elementArgList+=ElementArg (',' elementArgList+=ElementArg)* ')' ( EQUALSexpOption=Expression)?340 | ( EQUALS|ASSIGN) expOption=Expression)339 '(' elementArgList+=ElementArg (',' elementArgList+=ElementArg)* ')' ('=' expOption=Expression)? 340 | ('='|':=') expOption=Expression) 341 341 ; 342 342 … … 396 396 397 397 ArrayDim returns ArrayDim::ArrayDim : 398 ('[' subscripts+=Subscript (',' subscripts+=Subscript)* ']')?398 {ArrayDim::ArrayDim} ('[' subscripts+=Subscript (',' subscripts+=Subscript)* ']')? 399 399 ; 400 400 … … 511 511 512 512 ExprTuple returns Exp::TUPLE : 513 '(' expressions+=Expression (',' expressions+=Expression)* ')'513 {Exp::TUPLE} '(' expressions+=Expression (',' expressions+=Expression)* ')' 514 514 ; 515 515 516 516 ExprEnd returns Exp::END : 517 'end'517 {Exp::END} 'end' 518 518 ; 519 519 … … 550 550 551 551 OperatorAdd returns Operator::ADD : 552 '+'552 {Operator::ADD} '+' 553 553 ; 554 554 555 555 OperatorSub returns Operator::SUB : 556 '-'556 {Operator::SUB} '-' 557 557 ; 558 558 559 559 OperatorMul returns Operator::MUL : 560 '*'560 {Operator::MUL} '*' 561 561 ; 562 562 563 563 OperatorDiv returns Operator::DIV : 564 '/'564 {Operator::DIV} '/' 565 565 ; 566 566 567 567 OperatorPow returns Operator::POW : 568 '^'568 {Operator::POW} '^' 569 569 ; 570 570 571 571 OperatorUnPlus returns Operator::UPLUS : 572 '+'572 {Operator::UPLUS} '+' 573 573 ; 574 574 575 575 OperatorUnMinus returns Operator::UMINUS : 576 '-'576 {Operator::UMINUS} '-' 577 577 ; 578 578 579 579 OperatorAddEW returns Operator::ADD_EW : 580 '.+'580 {Operator::ADD_EW} '.+' 581 581 ; 582 582 583 583 OperatorSubEW returns Operator::SUB_EW : 584 '.-'584 {Operator::SUB_EW} '.-' 585 585 ; 586 586 587 587 OperatorMulEW returns Operator::MUL_EW : 588 '.*'588 {Operator::MUL_EW} '.*' 589 589 ; 590 590 591 591 OperatorDivEW returns Operator::DIV_EW : 592 './'592 {Operator::DIV_EW} './' 593 593 ; 594 594 595 595 OperatorPowEW returns Operator::POW_EW : 596 '.^'596 {Operator::POW_EW} '.^' 597 597 ; 598 598 599 599 OperatorUnPlusEW returns Operator::UPLUS_EW : 600 '.+'600 {Operator::UPLUS_EW} '.+' 601 601 ; 602 602 603 603 OperatorUnMinusEW returns Operator::UMINUS_EW : 604 '.-'604 {Operator::UMINUS_EW} '.-' 605 605 ; 606 606 607 607 OperatorAnd returns Operator::AND : 608 'and'608 {Operator::AND} 'and' 609 609 ; 610 610 611 611 OperatorOr returns Operator::OR : 612 'or'612 {Operator::OR} 'or' 613 613 ; 614 614 615 615 OperatorNot returns Operator::NOT : 616 'not'616 {Operator::NOT} 'not' 617 617 ; 618 618 619 619 OperatorLess returns Operator::LESS : 620 LESS620 {Operator::LESS} '<' 621 621 ; 622 622 623 623 OperatorLessEq returns Operator::LESSEQ : 624 LESSEQ624 {Operator::LESSEQ} '<=' 625 625 ; 626 626 OperatorGreater returns Operator::GREATER : 627 GREATER627 {Operator::GREATER} '>' 628 628 ; 629 629 630 630 OperatorGreaterEq returns Operator::GREATEREQ : 631 GREATEREQ631 {Operator::GREATEREQ} '>=' 632 632 ; 633 633 OperatorEqual returns Operator::EQUAL : 634 EQEQ634 {Operator::EQUAL} '==' 635 635 ; 636 636 637 637 OperatorNotEqual returns Operator::NEQUAL : 638 LESSGT638 {Operator::NEQUAL} ('><'|'!=') 639 639 ; 640 640 … … 700 700 701 701 ExternalDeclaration returns ExternalDecl::uExternalDecl : 702 {ExternalDecl::EXTERNALDECL} (lang=STRING)? ((output_=ComponentRef EQUALS)? funcName=IDENT702 {ExternalDecl::EXTERNALDECL} (lang=STRING)? ((output_=ComponentRef '=')? funcName=IDENT 703 703 '(' args+=Expression (',' args+=Expression)* ')')? (annotation_=Annotation)? 704 704 ; … … 766 766 **********************************/ 767 767 768 terminal DOT : '.' ; 769 terminal LPAR : '(' ; 770 terminal RPAR : ')' ; 771 terminal LBRACK : '[' ; 772 terminal RBRACK : ']' ; 773 terminal LBRACE : '{' ; 774 terminal RBRACE : '}' ; 775 terminal EQUALS : '=' ; 776 terminal ASSIGN : ':=' ; 777 terminal COMMA : ',' ; 778 terminal COLON : ':' ; 779 terminal SEMICOLON : ';' ; 768 /* 769 terminal DOT : '.' ; 770 terminal LPAR : '(' ; 771 terminal RPAR : ')' ; 772 terminal LBRACK : '[' ; 773 terminal RBRACK : ']' ; 774 terminal LBRACE : '{' ; 775 terminal RBRACE : '}' ; 776 terminal EQUALS : '=' ; 777 terminal ASSIGN : ':=' ; 778 terminal COMMA : ',' ; 779 terminal COLON : ':' ; 780 terminal SEMICOLON : ';' ; 781 */ 780 782 /* elementwise operators */ 781 terminal PLUS_EW : '.+' ; /* Modelica 3.0 */ 782 terminal MINUS_EW : '.-' ; /* Modelica 3.0 */ 783 terminal STAR_EW : '.*' ; /* Modelica 3.0 */ 784 terminal SLASH_EW : './' ; /* Modelica 3.0 */ 785 terminal POWER_EW : '.^' ; /* Modelica 3.0 */ 786 783 784 //terminal PLUS_EW : '.+' ; /* Modelica 3.0 */ 785 //terminal MINUS_EW : '.-' ; /* Modelica 3.0 */ 786 //terminal STAR_EW : '.*' ; /* Modelica 3.0 */ 787 //terminal SLASH_EW : './' ; /* Modelica 3.0 */ 788 //terminal POWER_EW : '.^' ; /* Modelica 3.0 */ 789 790 /* 787 791 terminal STAR : '*'('.')? ; 788 792 terminal MINUS : '-'('.')? ; … … 796 800 terminal POWER : '^'('.')? ; 797 801 terminal SLASH : '/'('.')? ; 798 802 */ 799 803 terminal ANY_OTHER: .;
Note: See TracChangeset
for help on using the changeset viewer.