Changeset 552 for branches/xtext-MDT/org.modelica.xtext.core/src
- Timestamp:
- 12/05/09 14:23:12 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/xtext-MDT/org.modelica.xtext.core/src/org/modelica/xtext/ModelicaAST.xtext
r550 r552 133 133 |{ClassPart::PROTECTED} 'protected' (contents+=ElementItem)* 134 134 |{ClassPart::EQUATIONS} 'equation' (contents+=EquationItem)* 135 |{ClassPart::INITIALEQUATIONS} 'initial' 'equation' (contents+=EquationItem)*135 //|{ClassPart::INITIALEQUATIONS} 'initial' 'equation' (contents+=EquationItem)* 136 136 |{ClassPart::ALGORITHMS} 'algorithm' (contents+=AlgorithmItem)* 137 137 |{ClassPart::INITIALALGORITHMS} 'initial' 'algorithm' (contents+=AlgorithmItem)* … … 167 167 | (redeclareKeywords=RedeclareReplaceableKeyword | redeclareKeywords=ReplaceableKeyword) innerOuter=InnerOuter 168 168 (specification=ElementSpecificationClassDefinition | specification=ElementSpecificationComponents) 169 ; 170 171 //('constrainedby' name=IDENT constrainClass=ConstrainClass)? 169 constrainClass=ConstrainClass? 170 ; 171 172 ConstrainClass returns ConstrainClass::uConstrainClass : 173 {ConstrainClass::CONSTRAINCLASS} elementSpec=ElementSpecificationConstrainedby comment=Comment? 174 ; 175 172 176 /* 173 ConstrainClass returns uConstrainClass :174 {CONSTRAINCLASS} elementSpec=ElementSpecification comment=Comment175 ;176 */177 178 179 177 ElementSpecification returns ElementSpec::uElementSpec : 180 178 ElementSpecificationImport … … 183 181 |ElementSpecificationComponents 184 182 ; 185 183 */ 186 184 ElementSpecificationImport returns ElementSpec::uElementSpec : 187 185 {ElementSpec::IMPORT} 'import' import_=Import comment=Comment … … 193 191 ; 194 192 195 /* FIXME check the 'replaceable' */ 193 ElementSpecificationConstrainedby returns ElementSpec::uElementSpec : 194 {ElementSpec::EXTENDS} 'constrainedby' path=Path ( '(' 195 elementArg+=ElementArg (',' elementArg+=ElementArg)* ')' )? annotationOpt=Annotation? 196 ; 197 198 /* FIXME 'replaceable' both here and in InnerClass */ 196 199 ElementSpecificationClassDefinition returns ElementSpec::uElementSpec : 197 200 {ElementSpec::CLASSDEF} /*replaceable_?=('replaceable')?*/ class_=InnerClass … … 245 248 Equation returns Equation::uEquation : 246 249 EquationIf | EquationEquals | EquationConnect | EquationFor | EquationWhenEq 247 | EquationNoRetCall //FIXME what is this doing?250 | EquationNoRetCall 248 251 //|EqFailure 249 252 ; … … 309 312 ; 310 313 311 AlgorithmFor returns AlgorithmStatement:: ALG_FOR:312 'for' iterators=ForIterators 'loop' (forBody+=AlgorithmItem)* 'end' 'for'314 AlgorithmFor returns AlgorithmStatement::uAlgorithmStatement : 315 {AlgorithmStatement::ALG_FOR} 'for' iterators=ForIterators 'loop' (forBody+=AlgorithmItem)* 'end' 'for' 313 316 ; 314 317 … … 341 344 ; 342 345 343 // TODO componentRef? constrain part344 346 ElementArg returns ElementArg::uElementArg : 345 347 {ElementArg::MODIFICATION} each_=Each finalItem?=('final')? … … 349 351 redeclareKeywords=( ReplaceableKeyword | RedeclareReplaceableKeyword ) 350 352 elementSpec=( ElementSpecificationClassDefinition | ElementSpecificationComponents1 ) 351 /* constrainClass=ConstrainClass? */353 constrainClass=ConstrainClass? 352 354 |{ElementArg::REDECLARATION} each_=Each finalItem?=('final') redeclareKeywords=RedeclareKeyword 353 355 elementSpec=( ElementSpecificationClassDefinition | ElementSpecificationComponents1 ) … … 414 416 415 417 ExprRange returns Exp::uExp : 416 ExprLogical ({Exp::RANGE.start=current} ':' step=ExprLogical (':' stop=ExprLogical)? )? 418 ExprLogical ({Exp::RANGE.start=current} ':' stop=ExprLogical 419 | {Exp::RANGE.start=current} ':' step=ExprLogical ':' stop=ExprLogical )? 417 420 ; 418 421 … … 432 435 ExprRelation returns Exp::uExp : 433 436 ExprArithmetic 434 ({Exp::RELATION.exp1=current} op=( OperatorLess | OperatorLessEq | OperatorGreater | OperatorGreaterEq 435 | OperatorEqual | OperatorNotEqual ) exp2=ExprArithmetic)? 437 ({Exp::RELATION.exp1=current} op=OperatorLogical exp2=ExprArithmetic)? 436 438 ; 437 439 438 440 ExprArithmetic returns Exp::uExp : 439 441 ExprUnaryArithmetic 440 ({Exp::BINARY.exp1=current} op= (OperatorAdd | OperatorSub | OperatorAddEW | OperatorSubEW)exp2=ExprArithmetic2)?442 ({Exp::BINARY.exp1=current} op=OperatorAddSub exp2=ExprArithmetic2)? 441 443 ; 442 444 443 445 ExprArithmetic2 returns Exp::uExp : 444 446 ExprArithmeticTerm 445 ({Exp::BINARY.exp1=current} op= (OperatorAdd | OperatorSub | OperatorAddEW | OperatorSubEW)exp2=ExprArithmetic2)?447 ({Exp::BINARY.exp1=current} op=OperatorAddSub exp2=ExprArithmetic2)? 446 448 ; 447 449 … … 483 485 484 486 ExprComponentRef returns Exp::uExp : 485 {Exp::CREF} componentRe g=ComponentRef487 {Exp::CREF} componentRef=ComponentRef 486 488 ; 487 489 … … 548 550 Operators 549 551 */ 552 553 OperatorLogical returns Operator::uOperator: 554 {Operator::LESS} '<' | {Operator::LESSEQ} '<=' | {Operator::GREATER} '>' 555 | {Operator::GREATEREQ} '>=' | {Operator::EQUAL} '==' | {Operator::NEQUAL} ('><'|'!=') 556 ; 557 558 OperatorAddSub returns Operator::uOperator: 559 {Operator::ADD} '+' | {Operator::SUB} '-' | {Operator::ADD_EW} '.+' | {Operator::SUB_EW} '.-' 560 ; 561 550 562 551 563 OperatorAdd returns Operator::ADD : … … 620 632 {Operator::LESS} '<' 621 633 ; 622 634 623 635 OperatorLessEq returns Operator::LESSEQ : 624 636 {Operator::LESSEQ} '<=' … … 647 659 ComponentReferenceQualified 648 660 |{ComponentRef::CREF_IDENT} 649 name=IDENT ('[' subscripts+=Subscript (',' subscripts+=Subscript)* ']')?661 ref=IDENT ('[' subscripts+=Subscript (',' subscripts+=Subscript)* ']')? 650 662 // {WILD} 651 663 ; … … 653 665 ComponentReferenceQualified returns ComponentRef::uComponentRef : 654 666 {ComponentRef::CREF_QUAL} 655 name=IDENT ('[' subscripts+=Subscript (',' subscripts+=Subscript)* ']')?667 ref=IDENT ('[' subscripts+=Subscript (',' subscripts+=Subscript)* ']')? 656 668 '.' componentRef=ComponentRef 657 669 ; … … 680 692 |{Restriction::R_FUNCTION} 'function' 681 693 |{Restriction::R_ENUMERATION} 'enumeration' 682 //|{R _PREDEFINED_INT} 'Integer'683 //|{R _PREDEFINED_REAL} 'Real'684 //|{R _PREDEFINED_STRING} 'String'685 //|{R _PREDEFINED_BOOL} 'Boolean'694 //|{Restriction::R_PREDEFINED_INT} 'Integer' 695 //|{Restriction::R_PREDEFINED_REAL} 'Real' 696 //|{Restriction::R_PREDEFINED_STRING} 'String' 697 //|{Restriction::R_PREDEFINED_BOOL} 'Boolean' 686 698 ; 687 699 … … 710 722 */ 711 723 724 ForIterators returns Iterators::ForIterators : 725 forIterator+=ForIterator (',' forIterator+=ForIterator)* 726 ; 727 712 728 ForIterator returns Iterators::ForIterator : 713 729 tuple=ForIteratorTuple 714 ;715 716 ForIterators returns Iterators::ForIterators :717 forIterator+=ForIterator (',' forIterator+=ForIterator)*718 730 ; 719 731
Note: See TracChangeset
for help on using the changeset viewer.