// This file is copyrighted and is part of nzdis-oql package. // See the file LICENSE for copyright information and the terms and conditions for copying, distributing and modifications of nzdis-oql package. // @copyright@ package nzdis.lang.oql; /**/ import nzdis.lang.oql.analysis.DepthFirstAdapter; import nzdis.lang.oql.node.*; import java.util.Hashtable; /** * Projection extractor. Traverses the AST and collects all the * references to projection nodes. Should be fixed not to collect * inner queries projections. * *@author Mariusz Nowostawski *@version @version@ $Revision: 1.1 $ */ class ProjectionWalker extends DepthFirstAdapter { /** * String variable names without leading $ indexed by appropriate * AST nodes.*/ private Hashtable list = new Hashtable(); /** Returns the variable hash. */ public Hashtable getAllProjections(){ return this.list; } public void outAExprProjection(AExprProjection node){ this.list.put(node, node.getExpr()); } }