print et Read en cours

This commit is contained in:
trochas
2025-04-08 13:05:11 +02:00
8 changed files with 74 additions and 5 deletions

View File

@@ -61,12 +61,24 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
@Override
public String visitPrint(PrintImp instr, String indent) {
String str = indent + "PRINT ";
for (String elem: instr.t()){
str += "\"" +elem +"\"";
for(int i = 0; i<instr.t().size(); i++){
String g = "";
Object o = instr.t().get(i);
if(o instanceof String){
str += "\"" + instr.t().get(i) +"\"";
}
else if(o instanceof Expression){
str += g + ((Expression)instr.t().get(i)).accept(this,"");
}
}
return str;
}
@Override
public String visitRead(ReadImp instr, String h) {
return "Tibo, tu peux implenter le truc stp";
}
//EXPRESSION
@Override