// show tree in text form
// System.out.println(tree.toStringTree(parser));
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);
}