Homework 4
This commit is contained in:
parent
0afc86ceeb
commit
72cc3206c4
125 changed files with 4200 additions and 1636 deletions
|
@ -16,6 +16,17 @@ public class AstVisitor<R,A> extends ExprVisitor<R,A> {
|
|||
return ast.accept(this, arg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides {@link ExprVisitor#visitChildren(Expr, Object)} and
|
||||
* delegates to the more general {@link #visitChildren(Ast, Object)}
|
||||
* with {@link Ast} parameter. This method is final to prevent
|
||||
* overriding only one of the two versions.
|
||||
*/
|
||||
@Override
|
||||
public final R visitChildren(Expr ast, A arg) {
|
||||
return visitChildren((Ast) ast, arg);
|
||||
}
|
||||
|
||||
/**
|
||||
* A handy function which visits the children of {@code ast},
|
||||
* providing "arg" to each of them. It returns the result of
|
||||
|
@ -45,6 +56,7 @@ public class AstVisitor<R,A> extends ExprVisitor<R,A> {
|
|||
|
||||
/**
|
||||
* The default action for expressions is to call this */
|
||||
@Override
|
||||
protected R dfltExpr(Expr ast, A arg) {
|
||||
return dflt(ast, arg);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue