moitie gragment 0

This commit is contained in:
Vu Tuan Minh
2025-04-02 15:06:29 +02:00
parent 52a5c00f74
commit d1b9ec0396
11 changed files with 444 additions and 336 deletions

View File

@@ -42,6 +42,11 @@ public class Program{
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 Type_voidImp() implements Type{
public String prettyprinter() {
@@ -88,6 +93,12 @@ public class Program{
ExprEval exprEval = new ExprEval();
return e.e().accept(exprEval, h);
}
@Override
public Integer visitAssign(AssignImp e, Map<String, Integer> h) {
//h.put(e.t(), e.e());
//TODO
return 1;
}
}
public static class ExprEval implements ExprVisitor<Map<String,Integer>,Integer>{