ParseTreeWalker walker = new ParseTreeWalker();
SymbolTable symtab = new SymbolTable();
DefPhase def = new DefPhase(symtab);
walker.walk(def, tree);
// create next phase and feed symbol table info from def to ref phase
RefPhase ref = new RefPhase(symtab, def.scopes);
walker.walk(ref, tree);
}