Skip to content
Snippets Groups Projects
Commit fc9753d6 authored by ZaynouneFatimaZahrae's avatar ZaynouneFatimaZahrae
Browse files

testing again

parent 8cf159de
No related branches found
No related tags found
No related merge requests found
......@@ -979,16 +979,14 @@ public class Sc2sa extends DepthFirstAdapter
@Override
public void caseADeclavariableDecvar(ADeclavariableDecvar node)
{
inADeclavariableDecvar(node);
if(node.getType() != null)
{
//decvar = {declavariable} type id |type id crochetg nombre crochetd ;
Type type = null;
node.getType().apply(this);
}
if(node.getId() != null)
{
node.getId().apply(this);
}
outADeclavariableDecvar(node);
type = this.returnType;
returnValue = new SaDecVarSimple(node.getId().getText(),type);
}
public void inADecvar(ADecvar node)
......@@ -1004,28 +1002,12 @@ public class Sc2sa extends DepthFirstAdapter
@Override
public void caseADecvar(ADecvar node)
{
inADecvar(node);
if(node.getType() != null)
{
//decvar = {declavariable} type id |type id crochetg nombre crochetd ;
Type type = null;
node.getType().apply(this);
}
if(node.getId() != null)
{
node.getId().apply(this);
}
if(node.getCrochetg() != null)
{
node.getCrochetg().apply(this);
}
if(node.getNombre() != null)
{
node.getNombre().apply(this);
}
if(node.getCrochetd() != null)
{
node.getCrochetd().apply(this);
}
outADecvar(node);
type = this.returnType;
returnValue = new SaDecTab(node.getId().getText(),type,Integer.parseInt(node.getNombre().getText()));
}
public void inATypeType(ATypeType node)
......@@ -1081,36 +1063,7 @@ public class Sc2sa extends DepthFirstAdapter
@Override
public void caseADeclafoncDecfonc(ADeclafoncDecfonc node)
{
inADeclafoncDecfonc(node);
if(node.getTypeopt() != null)
{
node.getTypeopt().apply(this);
}
if(node.getId() != null)
{
node.getId().apply(this);
}
if(node.getGparenthese() != null)
{
node.getGparenthese().apply(this);
}
if(node.getFirstldec() != null)
{
node.getFirstldec().apply(this);
}
if(node.getDparenthese() != null)
{
node.getDparenthese().apply(this);
}
if(node.getSecondldec() != null)
{
node.getSecondldec().apply(this);
}
if(node.getBloc() != null)
{
node.getBloc().apply(this);
}
outADeclafoncDecfonc(node);
new SaDecFonc()
}
public void inATypeoptTypeopt(ATypeoptTypeopt node)
......@@ -1127,10 +1080,7 @@ public class Sc2sa extends DepthFirstAdapter
public void caseATypeoptTypeopt(ATypeoptTypeopt node)
{
inATypeoptTypeopt(node);
if(node.getType() != null)
{
node.getType().apply(this);
}
outATypeoptTypeopt(node);
}
......@@ -1168,16 +1118,16 @@ public class Sc2sa extends DepthFirstAdapter
@Override
public void caseALstdeclacvarLdec(ALstdeclacvarLdec node)
{
inALstdeclacvarLdec(node);
if(node.getDecvar() != null)
{
//ldec = {lstdeclacvar} decvar suitedec | epsilon ;
SaDecVar op1 = null;
SaLDecVar op2 = null;
node.getDecvar().apply(this);
}
if(node.getSuitedec() != null)
{
op1 = (SaDecVar) this.returnValue;
node.getSuitedec().apply(this);
}
outALstdeclacvarLdec(node);
op2 = (SaLDecVar) this.returnValue;
returnValue = new SaLDecVar(op1,op2);
}
public void inALdec(ALdec node)
......@@ -1214,20 +1164,17 @@ public class Sc2sa extends DepthFirstAdapter
@Override
public void caseASuitedeclvarSuitedec(ASuitedeclvarSuitedec node)
{
inASuitedeclvarSuitedec(node);
if(node.getVirgule() != null)
{
node.getVirgule().apply(this);
}
if(node.getDecvar() != null)
{
//suitedec = {suitedeclvar} virgule decvar suitedec |epsilon ;
//ldec = {lstdeclacvar} decvar suitedec | epsilon ;
SaDecVar op1 = null;
SaLDecVar op2 = null;
//node.getVirgule().apply(this);
node.getDecvar().apply(this);
}
if(node.getSuitedec() != null)
{
op1 = (SaDecVar) this.returnValue;
node.getSuitedec().apply(this);
}
outASuitedeclvarSuitedec(node);
op2 = (SaLDecVar) this.returnValue;
returnValue = new SaLDecVar(op1,op2);
}
public void inASuitedec(ASuitedec node)
......@@ -1263,17 +1210,16 @@ public class Sc2sa extends DepthFirstAdapter
@Override
public void caseALstdecfncLdf(ALstdecfncLdf node)
{
inALstdecfncLdf(node);
if(node.getDecfonc() != null)
{
{;
//ldf = {lstdecfnc} decfonc ldf | epsilon
SaDecFonc op1 = null;
SaLDecFonc op2 = null;
node.getDecfonc().apply(this);
}
if(node.getLdf() != null)
{
op1 = (SaDecFonc) this.returnValue;
node.getLdf().apply(this);
}
outALstdecfncLdf(node);
op2 = (SaLDecFonc) this.returnValue;
returnValue = new SaLDecFonc(op1,op2);
}
public void inALdf(ALdf node)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment