Skip to content
Snippets Groups Projects
Commit 32cae712 authored by christia.agodomou's avatar christia.agodomou
Browse files

Declarations constante

parent 90cad13f
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ non terminal Unaire op_una; ...@@ -32,7 +32,7 @@ non terminal Unaire op_una;
non terminal Binaire op_bin; non terminal Binaire op_bin;
non terminal Relation relation; non terminal Relation relation;
non terminal l_ident; non terminal l_ident;
non terminal type; non terminal Ttype type;
// Precendences // Precendences
...@@ -73,7 +73,7 @@ l_ident ::= IDENT {: :} ...@@ -73,7 +73,7 @@ l_ident ::= IDENT {: :}
type ::= TINTEGER {: RESULT = (new entier());:} type ::= TINTEGER {: RESULT = (new entier());:}
| TBOOLEAN {: RESULT = (new booleen());:}; | TBOOLEAN {: RESULT = (new booleen());:};
declar_const ::= CONSTANT type IDENT EQUAL expr SEMICOLON {: :}; declar_const ::= CONSTANT type:t IDENT:id EQUAL expr:a SEMICOLON {: RESULT = new DeclarationConstant(t ,new Idf(id,"", idleft, idright),a,"",aleft,aright);:};
op_bin ::= expr:a PLUS expr:b {: RESULT = new Addition(a, b, "", aleft, aright); :} op_bin ::= expr:a PLUS expr:b {: RESULT = new Addition(a, b, "", aleft, aright); :}
| expr:a MINUS expr:b {: RESULT = new Soustraction(a, b, "", aleft, aright); :} | expr:a MINUS expr:b {: RESULT = new Soustraction(a, b, "", aleft, aright); :}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment