Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- parameters and local variables 1
- el resto 0
- acabar typechecking
- ------- clase anterior -------------
- visitor TP TR
- visit(Arith,TP) : TR
- (astnode)
- <TP , TR> aceept (visitor, tp)
- override accept en todas las clases
- accept -> return visitor.visit(this);
- visit en concrete types (como recorfield)
- accept en ast y override en todas e interfaz del visitor con los ACEPPTS
- typecheckingvisitor implemenets visitor lvalue
- a expression le metemos set lvalue boolean y getlvalue
- visit (Arith a, Void v)
- a.getOP1().accept(this);
- a.getOP2().accept(this);
- a.setLvalue(false);
- visit (Variable v, Void i)
- v.setlvalue(true);
- visit (Assigment a, void i){
- a.left.accept(this,v)
- a.right.aceept(this,v)
- if (!a.left.lvalue = true)?
- new error
- }
- cambiar lista de dis por variabke
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement