This commit is contained in:
Vu Tuan Minh
2025-04-01 18:17:15 +02:00
parent 3f9072c7bd
commit ef07343d9f
5 changed files with 22 additions and 13 deletions

View File

@@ -1,9 +1,17 @@
package TP2.asd;
import java.util.ArrayList;
import java.util.List;
import TP2.asd.Interface.*;
public class Program{
public static record ProgramImp(ArrayList<Instruction> instructions){
public <H, S> S accept(ProgramVisitor<H, S> v, H h) {
return v.visitProgram(this, h);
}
}
public static record Function(Type type, String nom, ArrayList<Instruction> instructions){
public Function(Type type, String name, Instruction instruction) {
this(type, name, new ArrayList<>() {{ add(instruction); }});