todo declaration c pt

This commit is contained in:
trochas
2025-04-10 11:13:09 +02:00
parent ecdb8ac687
commit 9905831b24
5 changed files with 72 additions and 45 deletions

View File

@@ -54,25 +54,27 @@ public class Program{
}
}
//Declaration
public static record DeclarationImp(Type t, ArrayList<String> s) implements Declaration{
@Override
public <H, S> S accept(DeclVisitor<H, S> v, H h) {
return v.visitDeclaration(this, h);
}
}
//Instructions
public static record Return_instrImp(Expression e) implements Instruction{
public <H, S> S accept(InstrVisitor<H, S> v, H h) {
return v.visitReturn(this,h);
}
}
public static record AssignImp(String t, Expression e) implements Instruction{
public <H, S> S accept(InstrVisitor<H, S> v, H h) {
return v.visitAssign(this, h);
}
}
public static record DeclarationImp(Type t, ArrayList<String> s) implements Instruction{
@Override
public <H, S> S accept(InstrVisitor<H, S> v, H h) {
return v.visitDeclaration(this, h);
}
}
public static record PrintImp(ArrayList<Object> t) implements Instruction{
@Override