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

type bool and int done

parent 652cd9b7
No related branches found
No related tags found
No related merge requests found
public class booleen extends tdstype{
public booleen() {
super("booleen");
}
}
public class entier extends tdstype{
public entier() {
super("entier");
}
}
public abstract class tdstype{
String type;
public tdstype(String type) {
this.type = type;
}
// /**
// * Get the binary operator
// */
// public String operateur() {
// return "entier";
// }
// /**
// * Accepts a AST visitor
// */
// Object accept(ASTVisitor visitor){
// return visitor.visit(this);
// }
}
programme Program
entier z;
debutprg
c = 1;
si c alors c = 2;sinon c = 0;
......
......@@ -70,8 +70,8 @@ declar_var ::= type l_ident SEMICOLON {: :};
l_ident ::= IDENT {: :}
| l_ident COMMA IDENT {: :};
type ::= TINTEGER {: :}
| TBOOLEAN {: :};
type ::= TINTEGER {: RESULT = (new entier());:}
| TBOOLEAN {: RESULT = (new booleen());:};
declar_const ::= CONSTANT type IDENT EQUAL expr SEMICOLON {: :};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment