parser + asd non testé non builder
This commit is contained in:
@@ -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> {
|
||||
}
|
||||
Reference in New Issue
Block a user