jsp c'est un arraylist de string ou varImp dans proto et func
This commit is contained in:
@@ -35,19 +35,29 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
|
||||
@Override
|
||||
public String visitPrototype(PrototypeImp proto, String indent){
|
||||
String str= indent + "PROTO "+proto.type().accept(this, "")+ " "+ proto.nom() + "(";
|
||||
|
||||
for(int i=0; i<proto.s().size();i++){
|
||||
str+=proto.s().get(i);
|
||||
if((i<proto.s().size()-1)){
|
||||
str+=", ";
|
||||
}
|
||||
}
|
||||
|
||||
return str+")";
|
||||
}
|
||||
|
||||
//FUNCTION
|
||||
@Override
|
||||
public String visitFunction(FunctionImp fun, String indent) {
|
||||
String str = indent+"FUNC " + fun.type().accept(this,"")+ " " + fun.nom() +"() ";
|
||||
String str = indent+"FUNC " + fun.type().accept(this,"")+ " " + fun.nom() +"(";
|
||||
|
||||
for(int i=0; i<fun.s().size();i++){
|
||||
str+=fun.s().get(i);
|
||||
if((i<fun.s().size()-1)){
|
||||
str+=", ";
|
||||
}
|
||||
}
|
||||
str+= ") ";
|
||||
str += fun.instruction().accept(this,indent)+"\n";
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user