From 4b6942160e3d01772a51ccea7b08994d3c31c7a2 Mon Sep 17 00:00:00 2001 From: trochas Date: Fri, 25 Apr 2025 15:25:48 +0200 Subject: [PATCH] correction params --- src/main/antlr/VSLParser.g | 4 ++-- src/main/java/TP2/asd/PrettyprinterVisitor.java | 4 ++-- src/main/java/TP2/asd/Program.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/antlr/VSLParser.g b/src/main/antlr/VSLParser.g index 044fc97..f3df107 100644 --- a/src/main/antlr/VSLParser.g +++ b/src/main/antlr/VSLParser.g @@ -64,9 +64,9 @@ functions returns [ArrayList 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); } ; diff --git a/src/main/java/TP2/asd/PrettyprinterVisitor.java b/src/main/java/TP2/asd/PrettyprinterVisitor.java index fba5042..7dee6f4 100644 --- a/src/main/java/TP2/asd/PrettyprinterVisitor.java +++ b/src/main/java/TP2/asd/PrettyprinterVisitor.java @@ -37,7 +37,7 @@ public class PrettyprinterVisitor implements ProgramVisitor, String str= indent + "PROTO "+proto.type().accept(this, "")+ " "+ proto.nom() + "("; for(int i=0; i, String str = indent+"FUNC " + fun.type().accept(this,"")+ " " + fun.nom() +"("; for(int i=0; i params) implements Prototype{ + public static record PrototypeImp(Type type, String nom, ArrayList params) implements Prototype{ @Override public S accept(PrototypeVisitor v, H h) { return v.visitPrototype(this,h);