parser + asd non testé non builder

This commit is contained in:
Vu Tuan Minh
2025-04-01 16:52:50 +02:00
parent 95fee3f1ae
commit 02d57fa858
13 changed files with 1374 additions and 60 deletions

View File

@@ -1,9 +1,38 @@
package TP2.asd;
import java.util.Map;
interface Expression {
public <H,S> S accept(ExprVisitor<H,S> v, H h);
}
interface Instruction {
public String prettyprinter();
public <H,S> S accept(InstrVisitor<H,S> v, H h);
}
interface ProgramVisitor<H,S> {
public S visitProgram(Program p, H h);
public S visitFunction(Function f, H h);
}
interface InstrVisitor<H,S>{
public S visitReturn(Return_instr e, H h);
}
interface ExprVisitor<H,S> {
public S visitConst(Const e,H h);
public S visitBinOp(BinopExpression e, H h);
}
interface Type{
public String prettyprinter();
}
enum Op {PLUS, MINUS, TIMES,DIV}
//Eval
interface ExprEval extends ExprVisitor<Map<String, Integer>, Integer> {
}
interface TypeCheck extends ExprVisitor<Map<String, Type>, Type> {
}