diff --git a/src/sa/Sc2sa.java b/src/sa/Sc2sa.java index 9145cf4121ad988bd413717492b5f93c55c70ae9..c1a3c88bc0ff9f530c555e02cb6ca790a102e02f 100644 --- a/src/sa/Sc2sa.java +++ b/src/sa/Sc2sa.java @@ -298,7 +298,7 @@ public class Sc2sa extends DepthFirstAdapter op1=(SaExp) this.returnValue ; node.getMult().apply(this); op2=(SaExp) this.returnValue ; - this.returnValue = new SaExpAdd(op1,op2); + this.returnValue = new SaExpSub(op1,op2); } @@ -343,7 +343,7 @@ public class Sc2sa extends DepthFirstAdapter op1=(SaExp) this.returnValue; node.getNeg().apply(this); op2=(SaExp) this.returnValue; - this.returnValue = new SaExpAdd(op1,op2); + this.returnValue = new SaExpMult(op1,op2); } public void inADiviserMult(ADiviserMult node) @@ -366,7 +366,7 @@ public class Sc2sa extends DepthFirstAdapter op1=(SaExp) this.returnValue; node.getNeg().apply(this); op2=(SaExp) this.returnValue; - this.returnValue = new SaExpAdd(op1,op2); + this.returnValue = new SaExpDiv(op1,op2); } public void inANegMult(ANegMult node) @@ -446,10 +446,7 @@ public class Sc2sa extends DepthFirstAdapter @Override public void caseAParentheseE6(AParentheseE6 node) { - node.getExp().apply(this); - - } public void inANombreE6(ANombreE6 node) @@ -468,7 +465,7 @@ public class Sc2sa extends DepthFirstAdapter int entier =0; inANombreE6 (node); entier = Integer.parseInt (node.getNombre () .getText ()) ; - this.returnValue = new SaExpInt (entier) ; + this.returnValue = new SaExpInt(entier) ; outANombreE6 (node); } @@ -495,11 +492,8 @@ public class Sc2sa extends DepthFirstAdapter public void inAFauxE6(AFauxE6 node) { - SaExp op1 = null ; - node.getFaux().apply(this); - op1 = (SaExp) this.returnValue ; + defaultIn(node); } - public void outAFauxE6(AFauxE6 node) { defaultOut(node); @@ -525,21 +519,21 @@ public class Sc2sa extends DepthFirstAdapter @Override public void caseALireE6(ALireE6 node) { - inALireE6(node); - if(node.getLire() != null) - { - node.getLire().apply(this); + inALireE6(node); + if(node.getLire() != null) + { + node.getLire().apply(this); + } + if(node.getGparenthese() != null) + { + node.getGparenthese().apply(this); + } + if(node.getDparenthese() != null) + { + node.getDparenthese().apply(this); + } + outALireE6(node); } - if(node.getGparenthese() != null) - { - node.getGparenthese().apply(this); - } - if(node.getDparenthese() != null) - { - node.getDparenthese().apply(this); - } - outALireE6(node); - } public void inAVarE6(AVarE6 node) {