Loading...
Searching...
No Matches
TaQLNodeVisitor.h
Go to the documentation of this file.
//# TaQLNodeVisitor.h: Class to visit the nodes in the raw TaQL parse tree
//# Copyright (C) 2005
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef TABLES_TAQLNODEVISITOR_H
#define TABLES_TAQLNODEVISITOR_H
//# Includes
#include <casacore/casa/aips.h>
#include <casacore/tables/TaQL/TaQLNode.h>
#include <casacore/tables/TaQL/TaQLNodeDer.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
// <summary>
// Class to visit the nodes in the raw TaQL parse tree.
// </summary>
// <use visibility=local>
// <reviewed reviewer="" date="" tests="tTableGram">
// </reviewed>
// <prerequisite>
//# Classes you should understand before using this one.
// <li> <linkto class=TaQLNode>TaQLNode</linkto>
// <li> Note 199 describing
// <a href="../notes/199.html">
// TaQL</a>
// </prerequisite>
// <synopsis>
// TaQLNodeVisitor is the abstract base class for classes that want to
// visit a TaQLNode tree, i.e. traverse the tree.
// Each visit results in a TaQLNodeResult object which acts as the basis
// for the actual result object.
// <br>
// A specialization of TaQLNodeVisitor (e.g. class
// <linkto class=TaQLNodeHandler>TaQLNodeHandler</linkto> needs to implement
// the various visitXXNode functions. A visit function will process a node
// which usually means visiting its children, etc..
// </synopsis>
// <motivation>
// The visitor design pattern separates the tree from the way it is processed.
// In this way any handler can be created. For instance, a query optimizer
// could be a future other handler.
// </motivation>
class TaQLNodeVisitor
{
public:
virtual ~TaQLNodeVisitor();
// Define the functions to visit each node type.
// <group>
virtual TaQLNodeResult visitConstNode (const TaQLConstNodeRep& node) = 0;
virtual TaQLNodeResult visitRegexNode (const TaQLRegexNodeRep& node) = 0;
virtual TaQLNodeResult visitUnaryNode (const TaQLUnaryNodeRep& node) = 0;
virtual TaQLNodeResult visitBinaryNode (const TaQLBinaryNodeRep& node) = 0;
virtual TaQLNodeResult visitMultiNode (const TaQLMultiNodeRep& node) = 0;
virtual TaQLNodeResult visitFuncNode (const TaQLFuncNodeRep& node) = 0;
virtual TaQLNodeResult visitRangeNode (const TaQLRangeNodeRep& node) = 0;
virtual TaQLNodeResult visitIndexNode (const TaQLIndexNodeRep& node) = 0;
virtual TaQLNodeResult visitKeyColNode (const TaQLKeyColNodeRep& node) = 0;
virtual TaQLNodeResult visitTableNode (const TaQLTableNodeRep& node) = 0;
virtual TaQLNodeResult visitColNode (const TaQLColNodeRep& node) = 0;
virtual TaQLNodeResult visitColumnsNode (const TaQLColumnsNodeRep& node) = 0;
virtual TaQLNodeResult visitJoinNode (const TaQLJoinNodeRep& node) = 0;
virtual TaQLNodeResult visitGroupNode (const TaQLGroupNodeRep& node) = 0;
virtual TaQLNodeResult visitSortKeyNode (const TaQLSortKeyNodeRep& node) = 0;
virtual TaQLNodeResult visitSortNode (const TaQLSortNodeRep& node) = 0;
virtual TaQLNodeResult visitLimitOffNode (const TaQLLimitOffNodeRep& node) = 0;
virtual TaQLNodeResult visitGivingNode (const TaQLGivingNodeRep& node) = 0;
virtual TaQLNodeResult visitUpdExprNode (const TaQLUpdExprNodeRep& node) = 0;
virtual TaQLNodeResult visitSelectNode (const TaQLSelectNodeRep& node) = 0;
virtual TaQLNodeResult visitUpdateNode (const TaQLUpdateNodeRep& node) = 0;
virtual TaQLNodeResult visitInsertNode (const TaQLInsertNodeRep& node) = 0;
virtual TaQLNodeResult visitDeleteNode (const TaQLDeleteNodeRep& node) = 0;
virtual TaQLNodeResult visitCountNode (const TaQLCountNodeRep& node) = 0;
virtual TaQLNodeResult visitCalcNode (const TaQLCalcNodeRep& node) = 0;
virtual TaQLNodeResult visitCreTabNode (const TaQLCreTabNodeRep& node) = 0;
virtual TaQLNodeResult visitColSpecNode (const TaQLColSpecNodeRep& node) = 0;
virtual TaQLNodeResult visitRecFldNode (const TaQLRecFldNodeRep& node) = 0;
virtual TaQLNodeResult visitUnitNode (const TaQLUnitNodeRep& node) = 0;
virtual TaQLNodeResult visitAltTabNode (const TaQLAltTabNodeRep& node) = 0;
virtual TaQLNodeResult visitAddColNode (const TaQLAddColNodeRep& node) = 0;
virtual TaQLNodeResult visitSetKeyNode (const TaQLSetKeyNodeRep& node) = 0;
virtual TaQLNodeResult visitRenDropNode (const TaQLRenDropNodeRep& node) = 0;
virtual TaQLNodeResult visitAddRowNode (const TaQLAddRowNodeRep& node) = 0;
virtual TaQLNodeResult visitConcTabNode (const TaQLConcTabNodeRep& node) = 0;
virtual TaQLNodeResult visitShowNode (const TaQLShowNodeRep& node) = 0;
virtual TaQLNodeResult visitCopyColNode (const TaQLCopyColNodeRep& node) = 0;
virtual TaQLNodeResult visitDropTabNode (const TaQLDropTabNodeRep& node) = 0;
// </group>
protected:
// A convenience function to visit the given node using this visitor.
TaQLNodeResult visitNode (const TaQLNode& node)
{ return node.visit (*this); }
};
} //# NAMESPACE CASACORE - END
#endif
casacore::TaQLAddColNodeRep
Raw TaQL parse tree node defining an alter table add column command.
Definition TaQLNodeDer.h:1169
casacore::TaQLAddRowNodeRep
Raw TaQL parse tree node defining an alter table add rows command.
Definition TaQLNodeDer.h:1252
casacore::TaQLAltTabNodeRep
Raw TaQL parse tree node defining an alter table command.
Definition TaQLNodeDer.h:1138
casacore::TaQLBinaryNodeRep
Raw TaQL parse tree node defining a binary operator.
Definition TaQLNodeDer.h:190
casacore::TaQLCalcNodeRep
Raw TaQL parse tree node defining a calc command.
Definition TaQLNodeDer.h:975
casacore::TaQLColNodeRep
Raw TaQL parse tree node defining a select column expression.
Definition TaQLNodeDer.h:482
casacore::TaQLColSpecNodeRep
Raw TaQL parse tree node defining a create column specification.
Definition TaQLNodeDer.h:1045
casacore::TaQLColumnsNodeRep
Raw TaQL parse tree node defining a select column list.
Definition TaQLNodeDer.h:514
casacore::TaQLConcTabNodeRep
Raw TaQL parse tree node defining an alter table command.
Definition TaQLNodeDer.h:1279
casacore::TaQLConstNodeRep
Definition TaQLNodeDer.h:60
casacore::TaQLCopyColNodeRep
Raw TaQL parse tree node defining an alter table copy column command.
Definition TaQLNodeDer.h:1337
casacore::TaQLCountNodeRep
Raw TaQL parse tree node defining a count command.
Definition TaQLNodeDer.h:837
casacore::TaQLCreTabNodeRep
Raw TaQL parse tree node defining a create table command.
Definition TaQLNodeDer.h:1009
casacore::TaQLDeleteNodeRep
Raw TaQL parse tree node defining a delete command.
Definition TaQLNodeDer.h:942
casacore::TaQLDropTabNodeRep
Raw TaQL parse tree node defining a DROP TABLE command.
Definition TaQLNodeDer.h:1365
casacore::TaQLFuncNodeRep
Raw TaQL parse tree node defining a function.
Definition TaQLNodeDer.h:293
casacore::TaQLGivingNodeRep
Raw TaQL parse tree node defining a giving expression list.
Definition TaQLNodeDer.h:670
casacore::TaQLGroupNodeRep
Raw TaQL parse tree node defining a groupby list.
Definition TaQLNodeDer.h:543
casacore::TaQLIndexNodeRep
Raw TaQL parse tree node defining an index in a array.
Definition TaQLNodeDer.h:360
casacore::TaQLInsertNodeRep
Raw TaQL parse tree node defining an insert command.
Definition TaQLNodeDer.h:907
casacore::TaQLJoinNodeRep
Raw TaQL parse tree node defining a join operation.
Definition TaQLNodeDer.h:391
casacore::TaQLKeyColNodeRep
Raw TaQL parse tree node defining a keyword or column name.
Definition TaQLNodeDer.h:420
casacore::TaQLLimitOffNodeRep
Raw TaQL parse tree node defining a limit/offset expression.
Definition TaQLNodeDer.h:641
casacore::TaQLMultiNodeRep
Raw TaQL parse tree node defining a list of nodes.
Definition TaQLNodeDer.h:246
casacore::TaQLNodeResult
Envelope class to hold the result of a visit to the node tree.
Definition TaQLNodeResult.h:105
casacore::TaQLNodeVisitor
Definition TaQLNodeVisitor.h:72
casacore::TaQLNodeVisitor::visitSortNode
virtual TaQLNodeResult visitSortNode(const TaQLSortNodeRep &node)=0
casacore::TaQLNodeVisitor::visitCountNode
virtual TaQLNodeResult visitCountNode(const TaQLCountNodeRep &node)=0
casacore::TaQLNodeVisitor::visitUnaryNode
virtual TaQLNodeResult visitUnaryNode(const TaQLUnaryNodeRep &node)=0
casacore::TaQLNodeVisitor::visitDropTabNode
virtual TaQLNodeResult visitDropTabNode(const TaQLDropTabNodeRep &node)=0
casacore::TaQLNodeVisitor::visitIndexNode
virtual TaQLNodeResult visitIndexNode(const TaQLIndexNodeRep &node)=0
casacore::TaQLNodeVisitor::visitAltTabNode
virtual TaQLNodeResult visitAltTabNode(const TaQLAltTabNodeRep &node)=0
casacore::TaQLNodeVisitor::visitCopyColNode
virtual TaQLNodeResult visitCopyColNode(const TaQLCopyColNodeRep &node)=0
casacore::TaQLNodeVisitor::visitNode
TaQLNodeResult visitNode(const TaQLNode &node)
A convenience function to visit the given node using this visitor.
Definition TaQLNodeVisitor.h:120
casacore::TaQLNodeVisitor::visitKeyColNode
virtual TaQLNodeResult visitKeyColNode(const TaQLKeyColNodeRep &node)=0
casacore::TaQLNodeVisitor::visitUpdExprNode
virtual TaQLNodeResult visitUpdExprNode(const TaQLUpdExprNodeRep &node)=0
casacore::TaQLNodeVisitor::visitConstNode
virtual TaQLNodeResult visitConstNode(const TaQLConstNodeRep &node)=0
Define the functions to visit each node type.
casacore::TaQLNodeVisitor::visitColNode
virtual TaQLNodeResult visitColNode(const TaQLColNodeRep &node)=0
casacore::TaQLNodeVisitor::visitConcTabNode
virtual TaQLNodeResult visitConcTabNode(const TaQLConcTabNodeRep &node)=0
casacore::TaQLNodeVisitor::visitColSpecNode
virtual TaQLNodeResult visitColSpecNode(const TaQLColSpecNodeRep &node)=0
casacore::TaQLNodeVisitor::visitRangeNode
virtual TaQLNodeResult visitRangeNode(const TaQLRangeNodeRep &node)=0
casacore::TaQLNodeVisitor::visitInsertNode
virtual TaQLNodeResult visitInsertNode(const TaQLInsertNodeRep &node)=0
casacore::TaQLNodeVisitor::visitSetKeyNode
virtual TaQLNodeResult visitSetKeyNode(const TaQLSetKeyNodeRep &node)=0
casacore::TaQLNodeVisitor::visitAddRowNode
virtual TaQLNodeResult visitAddRowNode(const TaQLAddRowNodeRep &node)=0
casacore::TaQLNodeVisitor::visitCreTabNode
virtual TaQLNodeResult visitCreTabNode(const TaQLCreTabNodeRep &node)=0
casacore::TaQLNodeVisitor::visitCalcNode
virtual TaQLNodeResult visitCalcNode(const TaQLCalcNodeRep &node)=0
casacore::TaQLNodeVisitor::visitDeleteNode
virtual TaQLNodeResult visitDeleteNode(const TaQLDeleteNodeRep &node)=0
casacore::TaQLNodeVisitor::~TaQLNodeVisitor
virtual ~TaQLNodeVisitor()
casacore::TaQLNodeVisitor::visitMultiNode
virtual TaQLNodeResult visitMultiNode(const TaQLMultiNodeRep &node)=0
casacore::TaQLNodeVisitor::visitBinaryNode
virtual TaQLNodeResult visitBinaryNode(const TaQLBinaryNodeRep &node)=0
casacore::TaQLNodeVisitor::visitSortKeyNode
virtual TaQLNodeResult visitSortKeyNode(const TaQLSortKeyNodeRep &node)=0
casacore::TaQLNodeVisitor::visitShowNode
virtual TaQLNodeResult visitShowNode(const TaQLShowNodeRep &node)=0
casacore::TaQLNodeVisitor::visitGroupNode
virtual TaQLNodeResult visitGroupNode(const TaQLGroupNodeRep &node)=0
casacore::TaQLNodeVisitor::visitLimitOffNode
virtual TaQLNodeResult visitLimitOffNode(const TaQLLimitOffNodeRep &node)=0
casacore::TaQLNodeVisitor::visitRenDropNode
virtual TaQLNodeResult visitRenDropNode(const TaQLRenDropNodeRep &node)=0
casacore::TaQLNodeVisitor::visitTableNode
virtual TaQLNodeResult visitTableNode(const TaQLTableNodeRep &node)=0
casacore::TaQLNodeVisitor::visitColumnsNode
virtual TaQLNodeResult visitColumnsNode(const TaQLColumnsNodeRep &node)=0
casacore::TaQLNodeVisitor::visitUnitNode
virtual TaQLNodeResult visitUnitNode(const TaQLUnitNodeRep &node)=0
casacore::TaQLNodeVisitor::visitRegexNode
virtual TaQLNodeResult visitRegexNode(const TaQLRegexNodeRep &node)=0
casacore::TaQLNodeVisitor::visitUpdateNode
virtual TaQLNodeResult visitUpdateNode(const TaQLUpdateNodeRep &node)=0
casacore::TaQLNodeVisitor::visitRecFldNode
virtual TaQLNodeResult visitRecFldNode(const TaQLRecFldNodeRep &node)=0
casacore::TaQLNodeVisitor::visitFuncNode
virtual TaQLNodeResult visitFuncNode(const TaQLFuncNodeRep &node)=0
casacore::TaQLNodeVisitor::visitAddColNode
virtual TaQLNodeResult visitAddColNode(const TaQLAddColNodeRep &node)=0
casacore::TaQLNodeVisitor::visitGivingNode
virtual TaQLNodeResult visitGivingNode(const TaQLGivingNodeRep &node)=0
casacore::TaQLNodeVisitor::visitSelectNode
virtual TaQLNodeResult visitSelectNode(const TaQLSelectNodeRep &node)=0
casacore::TaQLNodeVisitor::visitJoinNode
virtual TaQLNodeResult visitJoinNode(const TaQLJoinNodeRep &node)=0
casacore::TaQLNode
Definition TaQLNode.h:82
casacore::TaQLNode::visit
TaQLNodeResult visit(TaQLNodeVisitor &visitor) const
Let the visitor visit the node.
Definition TaQLNode.h:129
casacore::TaQLRangeNodeRep
Raw TaQL parse tree node defining a range.
Definition TaQLNodeDer.h:323
casacore::TaQLRecFldNodeRep
Raw TaQL parse tree node defining a record field.
Definition TaQLNodeDer.h:1076
casacore::TaQLRegexNodeRep
Raw TaQL parse tree node defining a constant regex value.
Definition TaQLNodeDer.h:117
casacore::TaQLRenDropNodeRep
Raw TaQL parse tree node defining an alter table rename or drop command.
Definition TaQLNodeDer.h:1197
casacore::TaQLSelectNodeRep
Raw TaQL parse tree node defining a select command.
Definition TaQLNodeDer.h:790
casacore::TaQLSetKeyNodeRep
Raw TaQL parse tree node defining an alter table set keyword command.
Definition TaQLNodeDer.h:1225
casacore::TaQLShowNodeRep
Raw TaQL parse tree node defining a show command.
Definition TaQLNodeDer.h:1310
casacore::TaQLSortKeyNodeRep
Raw TaQL parse tree node defining a sort key.
Definition TaQLNodeDer.h:575
casacore::TaQLSortNodeRep
Raw TaQL parse tree node defining a sort list.
Definition TaQLNodeDer.h:608
casacore::TaQLTableNodeRep
Raw TaQL parse tree node defining a table.
Definition TaQLNodeDer.h:450
casacore::TaQLUnaryNodeRep
Raw TaQL parse tree node defining a unary operator.
Definition TaQLNodeDer.h:153
casacore::TaQLUnitNodeRep
Raw TaQL parse tree node defining a unit.
Definition TaQLNodeDer.h:1110
casacore::TaQLUpdExprNodeRep
Raw TaQL parse tree node defining a column update expression.
Definition TaQLNodeDer.h:703
casacore::TaQLUpdateNodeRep
Raw TaQL parse tree node defining an update command.
Definition TaQLNodeDer.h:870
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28