Ignore:
Timestamp:
11/17/09 00:24:33 (15 years ago)
Author:
nasko
Message:

Some changes in the ModelicaAST.xtext and the MANIFEST.MF files to fit the newer version. Still problem at with parsing at runtime

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/xtext-MDT/org.modelica.xtext.core/src/org/modelica/xtext/ModelicaAST.xtext

    r544 r547  
    9090   
    9191ClassDefinitionDerived returns ClassDef::DERIVED :
    92     EQUALS attributes=ElementAttributes typeSpec=TypeSpecification
     92    '=' attributes=ElementAttributes typeSpec=TypeSpecification
    9393    ('(' arguments+=ElementArg (',' arguments+=ElementArg)* ')')?  comment=Comment
    9494    ;
    9595
    9696ClassDefinitionEnum returns ClassDef::ENUMERATION :
    97     EQUALS 'enumeration' '(' enumLiterals=EnumerationDefinition ')' comment=Comment
     97    '=' 'enumeration' '(' enumLiterals=EnumerationDefinition ')' comment=Comment
    9898    ;
    9999
    100100ClassDefinitionOverload returns ClassDef::OVERLOAD :
    101     EQUALS 'overload' '(' functionNames+=Path (',' functionNames+=Path)* ')' comment=Comment
     101    '=' 'overload' '(' functionNames+=Path (',' functionNames+=Path)* ')' comment=Comment
    102102    ;
    103103
    104104// CHECK Comment?
    105105ClassDefinitionPartialDer returns ClassDef::PDER :
    106     EQUALS 'der' '(' functionName=Path (',' vars+=IDENT)+ ')'
     106    '=' 'der' '(' functionName=Path (',' vars+=IDENT)+ ')'
    107107    ;
    108108// CHECK Comment or StringComment
     
    122122EnumerationDefinition returns EnumDef::uEnumDef :
    123123    {EnumDef::ENUMLITERALS} enumLiterals+=EnumLiteral (',' enumLiterals+=EnumLiteral)*
    124     | {EnumDef::ENUM_COLON} COLON
     124    | {EnumDef::ENUM_COLON} ':'
    125125    ;
    126126
     
    154154// FIXME Figure out the text thing
    155155// fix redeclareKeyword>s< ?=('redeclare')?
    156 Element returns Element::uElement :
    157     ElementElement
     156//Element returns Element::uElement :
     157//  ElementElement
    158158    //|{TEXT}
    159159    //|{DEFINEUNIT}
    160     ;
     160    //;
    161161   
    162162// FIXME constrainedby clause   
    163 ElementElement returns Element::ELEMENT :
    164     specification=(ElementSpecificationImport|ElementSpecificationExtends) innerOuter=InnerOuterUnspecified
    165     |redeclareKeywords=RedeclareKeyword? finalPrefix?=('final')?
     163Element returns Element::uElement:
     164    {Element::ELEMENT} specification=(ElementSpecificationImport|ElementSpecificationExtends) innerOuter=InnerOuterUnspecified
     165    |{Element::ELEMENT} redeclareKeywords=RedeclareKeyword? finalPrefix?=('final')?
    166166        innerOuter=InnerOuter specification=(ElementSpecificationClassDefinition | ElementSpecificationComponents)
    167     |redeclareKeywords=(RedeclareReplaceableKeyword | ReplaceableKeyword) innerOuter=InnerOuter
     167    |{Element::ELEMENT} redeclareKeywords=(RedeclareReplaceableKeyword | ReplaceableKeyword) innerOuter=InnerOuter
    168168        specification=(ElementSpecificationClassDefinition | ElementSpecificationComponents)
    169169        //('constrainedby' name=IDENT  constrainClass=ConstrainClass)?
     
    216216// FIXME the unqualified import- perhaps in a M2M transformation
    217217Import returns Import::uImport :
    218     {Import::NAMED_IMPORT} name=IDENT EQUALS path=Path
     218    {Import::NAMED_IMPORT} name=IDENT '=' path=Path
    219219    |{Import::QUAL_IMPORT} path=Path
    220220    //|{UNQUAL_IMPORT} path=Path
     
    324324
    325325AlgorithmReturn returns AlgorithmStatement::ALG_RETURN :
    326     'return'
     326    {AlgorithmStatement::ALG_RETURN} 'return'
    327327    ;
    328328
    329329AlgorithmWhile 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'
    331331    ;
    332332
    333333AlgorithmBreak returns AlgorithmStatement::ALG_BREAK :
    334     'break'
     334    {AlgorithmStatement::ALG_BREAK} 'break'
    335335    ;
    336336
    337337Modification returns Modifications::uModification :
    338338    {Modifications::CLASSMOD}   (
    339     '(' elementArgList+=ElementArg (',' elementArgList+=ElementArg)* ')' (EQUALS expOption=Expression)?
    340     | (EQUALS|ASSIGN) expOption=Expression)
     339    '(' elementArgList+=ElementArg (',' elementArgList+=ElementArg)* ')' ('=' expOption=Expression)?
     340    | ('='|':=') expOption=Expression)
    341341    ;
    342342   
     
    396396   
    397397ArrayDim returns ArrayDim::ArrayDim :
    398     ('[' subscripts+=Subscript (',' subscripts+=Subscript)* ']')?
     398    {ArrayDim::ArrayDim} ('[' subscripts+=Subscript (',' subscripts+=Subscript)* ']')?
    399399    ;   
    400400
     
    511511   
    512512ExprTuple returns Exp::TUPLE :
    513     '(' expressions+=Expression (',' expressions+=Expression)* ')'
     513    {Exp::TUPLE} '(' expressions+=Expression (',' expressions+=Expression)* ')'
    514514    ;
    515515   
    516516ExprEnd returns Exp::END :
    517     'end'
     517    {Exp::END} 'end'
    518518    ;
    519519   
     
    550550   
    551551OperatorAdd returns Operator::ADD :
    552     '+'
     552    {Operator::ADD} '+'
    553553    ;
    554554   
    555555OperatorSub returns Operator::SUB :
    556     '-'
     556    {Operator::SUB} '-'
    557557    ;
    558558   
    559559OperatorMul returns Operator::MUL :
    560     '*'
     560    {Operator::MUL} '*'
    561561    ;
    562562   
    563563OperatorDiv returns Operator::DIV :
    564     '/'
     564    {Operator::DIV} '/'
    565565    ;
    566566   
    567567OperatorPow returns Operator::POW :
    568     '^'
     568    {Operator::POW} '^'
    569569    ;
    570570
    571571OperatorUnPlus returns Operator::UPLUS :
    572     '+'
     572    {Operator::UPLUS} '+'
    573573    ;
    574574
    575575OperatorUnMinus returns Operator::UMINUS :
    576     '-'
     576    {Operator::UMINUS} '-'
    577577    ;
    578578
    579579OperatorAddEW returns Operator::ADD_EW :
    580     '.+'
     580    {Operator::ADD_EW} '.+'
    581581    ;
    582582   
    583583OperatorSubEW returns Operator::SUB_EW :
    584     '.-'
     584    {Operator::SUB_EW} '.-'
    585585    ;
    586586   
    587587OperatorMulEW returns Operator::MUL_EW :
    588     '.*'
     588    {Operator::MUL_EW} '.*'
    589589    ;
    590590   
    591591OperatorDivEW returns Operator::DIV_EW :
    592     './'
     592    {Operator::DIV_EW} './'
    593593    ;
    594594   
    595595OperatorPowEW returns Operator::POW_EW :
    596     '.^'
     596    {Operator::POW_EW} '.^'
    597597    ;
    598598
    599599OperatorUnPlusEW returns Operator::UPLUS_EW :
    600     '.+'
     600    {Operator::UPLUS_EW} '.+'
    601601    ;
    602602
    603603OperatorUnMinusEW returns Operator::UMINUS_EW :
    604     '.-'
     604    {Operator::UMINUS_EW} '.-'
    605605    ;
    606606
    607607OperatorAnd returns Operator::AND :
    608     'and'
     608    {Operator::AND} 'and'
    609609    ;
    610610
    611611OperatorOr returns Operator::OR :
    612     'or'
     612    {Operator::OR} 'or'
    613613    ;
    614614   
    615615OperatorNot returns Operator::NOT :
    616     'not'
     616    {Operator::NOT} 'not'
    617617    ;
    618618   
    619619OperatorLess returns Operator::LESS :
    620     LESS
     620    {Operator::LESS} '<'
    621621    ;
    622622   
    623623OperatorLessEq returns Operator::LESSEQ :
    624     LESSEQ
     624    {Operator::LESSEQ} '<='
    625625    ;
    626626OperatorGreater returns Operator::GREATER :
    627     GREATER
     627    {Operator::GREATER} '>'
    628628    ;
    629629   
    630630OperatorGreaterEq returns Operator::GREATEREQ :
    631     GREATEREQ
     631    {Operator::GREATEREQ} '>='
    632632    ;
    633633OperatorEqual returns Operator::EQUAL :
    634     EQEQ
     634    {Operator::EQUAL} '=='
    635635    ;
    636636   
    637637OperatorNotEqual returns Operator::NEQUAL :
    638     LESSGT
     638    {Operator::NEQUAL} ('><'|'!=')
    639639    ;
    640640
     
    700700
    701701ExternalDeclaration returns ExternalDecl::uExternalDecl :
    702     {ExternalDecl::EXTERNALDECL} (lang=STRING)? ((output_=ComponentRef EQUALS)? funcName=IDENT
     702    {ExternalDecl::EXTERNALDECL} (lang=STRING)? ((output_=ComponentRef '=')? funcName=IDENT
    703703    '(' args+=Expression (',' args+=Expression)* ')')? (annotation_=Annotation)?
    704704    ;
     
    766766**********************************/
    767767 
    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/*
     769terminal    DOT     : '.'           ; 
     770terminal    LPAR        : '('       ;
     771terminal    RPAR        : ')'       ;
     772terminal    LBRACK  : '['       ;
     773terminal    RBRACK  : ']'       ;
     774terminal    LBRACE  : '{'       ;
     775terminal    RBRACE  : '}'       ;
     776terminal    EQUALS  : '='       ;
     777terminal    ASSIGN  : ':='      ;
     778terminal    COMMA       : ','       ;
     779terminal    COLON       : ':'       ;
     780terminal    SEMICOLON   : ';'       ;
     781*/
    780782  /* 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/* 
    787791terminal STAR       : '*'('.')?                 ;
    788792terminal MINUS      : '-'('.')?                 ;
     
    796800terminal POWER      : '^'('.')?                 ;
    797801terminal SLASH      : '/'('.')?                 ;
    798 
     802*/
    799803terminal ANY_OTHER: .;
Note: See TracChangeset for help on using the changeset viewer.