add parser
This commit is contained in:
@@ -88,6 +88,27 @@ public class Program{
|
||||
}
|
||||
}
|
||||
|
||||
public static record IfThenImp(Expression e, Instruction i1) implements Instruction {
|
||||
@Override
|
||||
public <H, S> S accept(InstrVisitor<H, S> v, H h) {
|
||||
return v.visitIfThen(this, h);
|
||||
}
|
||||
}
|
||||
|
||||
public static record IfThenElseImp(Expression e, Instruction i1, Instruction i2) implements Instruction {
|
||||
@Override
|
||||
public <H, S> S accept(InstrVisitor<H, S> v, H h) {
|
||||
return v.visitIfThenElse(this, h);
|
||||
}
|
||||
}
|
||||
|
||||
public static record WhileImp(Expression e, Instruction i1) implements Instruction {
|
||||
@Override
|
||||
public <H, S> S accept(InstrVisitor<H, S> v, H h) {
|
||||
return v.visitWhile(this, h);
|
||||
}
|
||||
}
|
||||
|
||||
//Type
|
||||
public static record Type_voidImp() implements Type{
|
||||
@Override
|
||||
@@ -103,4 +124,5 @@ public class Program{
|
||||
return v.visitInt(this, h);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user