Commit c9a4564b authored by LucasDANIELE's avatar LucasDANIELE
Browse files

Ajout comparaison

parent 5387786c
......@@ -103,13 +103,51 @@ void lire() throws IdentifiantException,TypeIncompatibleException,TypeIncompatib
}
{
(
e=somme()
e=comparaison()
)
{
System.out.println(e.evaluer(mem));
}
}
Expression comparaison() throws IdentifiantException:
{
Expression g,d;
Token t;
}
{
g=somme()
(
(
t=<EST_EGAL>
| t=<DIFF>
| t=<SINF>
| t=<INF>
| t=<SSUP>
| t=<SUP>
)
d=somme(){
switch (t.kind) {
case EST_EGAL:
return new Egalite(g,d);
case DIFF:
return new Difference(g,d);
case SINF:
return new PlusPetit(g,d);
case INF:
return new PlusPetitOuEgale(g,d);
case SSUP:
return new PlusGrand(g,d);
case SUP:
return new PlusGrandOuEgale(g,d);
}
}
)?
{
return g;
}
}
Expression somme() throws IdentifiantException:
{
Expression g,d;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment