correction params

This commit is contained in:
trochas
2025-04-25 15:25:48 +02:00
parent 99a0283990
commit 4b6942160e
3 changed files with 5 additions and 5 deletions

View File

@@ -64,9 +64,9 @@ functions returns [ArrayList<Function> out]
;
function returns [Function out]:
FUNCTION t=type i=ident ParO liste_param ParF instr= instruction
FUNCTION t=type i=ident ParO v=liste_param ParF instr= instruction
{
$out=new FunctionImp($t.return_type, $i.out, $vars_locaux.out, $instr.out);
$out=new FunctionImp($t.return_type, $i.out, $v.out, $instr.out);
}
;

View File

@@ -37,7 +37,7 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
String str= indent + "PROTO "+proto.type().accept(this, "")+ " "+ proto.nom() + "(";
for(int i=0; i<proto.params().size();i++){
str+=proto.params().get(i);
str+=proto.params().get(i).accept(this, "");
if((i<proto.params().size()-1)){
str+=", ";
}
@@ -51,7 +51,7 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
String str = indent+"FUNC " + fun.type().accept(this,"")+ " " + fun.nom() +"(";
for(int i=0; i<fun.params().size();i++){
str+=fun.params().get(i);
str+=fun.params().get(i).accept(this, "");
if((i<fun.params().size()-1)){
str+=", ";
}

View File

@@ -25,7 +25,7 @@ public class Program{
}
//Prototype
public static record PrototypeImp(Type type, String nom, ArrayList<String> params) implements Prototype{
public static record PrototypeImp(Type type, String nom, ArrayList<VarImp> params) implements Prototype{
@Override
public <H, S> S accept(PrototypeVisitor<H, S> v, H h) {
return v.visitPrototype(this,h);