Skip to content
Snippets Groups Projects
Commit 30863632 authored by BAUQUIN Niels's avatar BAUQUIN Niels
Browse files

dfg

parent 3fadd663
No related branches found
No related tags found
No related merge requests found
...@@ -144,7 +144,7 @@ public class Sc2sa extends DepthFirstAdapter ...@@ -144,7 +144,7 @@ public class Sc2sa extends DepthFirstAdapter
op1 = (SaExp) this.returnValue; op1 = (SaExp) this.returnValue;
node.getExp4().apply(this); node.getExp4().apply(this);
op2 = (SaExp) this.returnValue; op2 = (SaExp) this.returnValue;
this.returnValue = new SaExpAdd(op1, op2); this.returnValue = new SaExpSub(op1, op2);
outASubExp3(node); outASubExp3(node);
} }
...@@ -281,7 +281,7 @@ public class Sc2sa extends DepthFirstAdapter ...@@ -281,7 +281,7 @@ public class Sc2sa extends DepthFirstAdapter
inAFairetantqueIns(node); inAFairetantqueIns(node);
SaExp test = null; SaExp test = null;
SaInst faire = null; SaInst faire = null;
node.getTantque().apply(this); node.getExp().apply(this);
test = (SaExp) this.returnValue; test = (SaExp) this.returnValue;
node.getBloc().apply(this); node.getBloc().apply(this);
faire = (SaInst) this.returnValue; faire = (SaInst) this.returnValue;
...@@ -292,8 +292,11 @@ public class Sc2sa extends DepthFirstAdapter ...@@ -292,8 +292,11 @@ public class Sc2sa extends DepthFirstAdapter
@Override @Override
public void caseAFonctionIns(AFonctionIns node) { public void caseAFonctionIns(AFonctionIns node) {
inAFonctionIns(node); inAFonctionIns(node);
node.getId().apply(this); String id = node.getId().getText();
node.getGpar().apply(this); SaLExp args = null;
node.getLexp().apply(this);
args = (SaLExp) this.returnValue;
this.returnValue = new SaAppel(id, args);
outAFonctionIns(node); outAFonctionIns(node);
} }
...@@ -480,14 +483,14 @@ public class Sc2sa extends DepthFirstAdapter ...@@ -480,14 +483,14 @@ public class Sc2sa extends DepthFirstAdapter
@Override @Override
public void caseATypeTypeopt(ATypeTypeopt node) { public void caseATypeTypeopt(ATypeTypeopt node) {
inATypeTypeopt(node); inATypeTypeopt(node);
this.returnType = Type.NUL; if (node.getType() != null) {node.getType().apply(this);}
outATypeTypeopt(node); outATypeTypeopt(node);
} }
@Override @Override
public void caseAEpsilonTypeopt(AEpsilonTypeopt node) { public void caseAEpsilonTypeopt(AEpsilonTypeopt node) {
inAEpsilonTypeopt(node); inAEpsilonTypeopt(node);
this.returnValue = null; this.returnType = Type.NUL;
outAEpsilonTypeopt(node); outAEpsilonTypeopt(node);
} }
...@@ -552,6 +555,7 @@ public class Sc2sa extends DepthFirstAdapter ...@@ -552,6 +555,7 @@ public class Sc2sa extends DepthFirstAdapter
@Override @Override
public void caseAEpsilonLdecvar(AEpsilonLdecvar node) { public void caseAEpsilonLdecvar(AEpsilonLdecvar node) {
inAEpsilonLdecvar(node); inAEpsilonLdecvar(node);
this.returnValue = null; this.returnValue = null;
outAEpsilonLdecvar(node); outAEpsilonLdecvar(node);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment