casacore
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::TaQLNodeHandler Class Reference

More...

#include <TaQLNodeHandler.h>

Public Member Functions

virtual ~TaQLNodeHandler ()
 
TaQLNodeResult handleTree (const TaQLNode &tree, const std::vector< const Table * > &)
 Handle and process the raw parse tree. More...
 
virtual TaQLNodeResult visitConstNode (const TaQLConstNodeRep &node)
 Define the functions to visit each node type. More...
 
virtual TaQLNodeResult visitRegexNode (const TaQLRegexNodeRep &node)
 
virtual TaQLNodeResult visitUnaryNode (const TaQLUnaryNodeRep &node)
 
virtual TaQLNodeResult visitBinaryNode (const TaQLBinaryNodeRep &node)
 
virtual TaQLNodeResult visitMultiNode (const TaQLMultiNodeRep &node)
 
virtual TaQLNodeResult visitFuncNode (const TaQLFuncNodeRep &node)
 
virtual TaQLNodeResult visitRangeNode (const TaQLRangeNodeRep &node)
 
virtual TaQLNodeResult visitIndexNode (const TaQLIndexNodeRep &node)
 
virtual TaQLNodeResult visitKeyColNode (const TaQLKeyColNodeRep &node)
 
virtual TaQLNodeResult visitTableNode (const TaQLTableNodeRep &node)
 
virtual TaQLNodeResult visitColNode (const TaQLColNodeRep &node)
 
virtual TaQLNodeResult visitColumnsNode (const TaQLColumnsNodeRep &node)
 
virtual TaQLNodeResult visitJoinNode (const TaQLJoinNodeRep &node)
 
virtual TaQLNodeResult visitGroupNode (const TaQLGroupNodeRep &node)
 
virtual TaQLNodeResult visitSortKeyNode (const TaQLSortKeyNodeRep &node)
 
virtual TaQLNodeResult visitSortNode (const TaQLSortNodeRep &node)
 
virtual TaQLNodeResult visitLimitOffNode (const TaQLLimitOffNodeRep &node)
 
virtual TaQLNodeResult visitGivingNode (const TaQLGivingNodeRep &node)
 
virtual TaQLNodeResult visitUpdExprNode (const TaQLUpdExprNodeRep &node)
 
virtual TaQLNodeResult visitSelectNode (const TaQLSelectNodeRep &node)
 
virtual TaQLNodeResult visitUpdateNode (const TaQLUpdateNodeRep &node)
 
virtual TaQLNodeResult visitInsertNode (const TaQLInsertNodeRep &node)
 
virtual TaQLNodeResult visitDeleteNode (const TaQLDeleteNodeRep &node)
 
virtual TaQLNodeResult visitCountNode (const TaQLCountNodeRep &node)
 
virtual TaQLNodeResult visitCalcNode (const TaQLCalcNodeRep &node)
 
virtual TaQLNodeResult visitCreTabNode (const TaQLCreTabNodeRep &node)
 
virtual TaQLNodeResult visitColSpecNode (const TaQLColSpecNodeRep &node)
 
virtual TaQLNodeResult visitRecFldNode (const TaQLRecFldNodeRep &node)
 
virtual TaQLNodeResult visitUnitNode (const TaQLUnitNodeRep &node)
 
virtual TaQLNodeResult visitAltTabNode (const TaQLAltTabNodeRep &node)
 
virtual TaQLNodeResult visitAddColNode (const TaQLAddColNodeRep &node)
 
virtual TaQLNodeResult visitSetKeyNode (const TaQLSetKeyNodeRep &node)
 
virtual TaQLNodeResult visitRenDropNode (const TaQLRenDropNodeRep &node)
 
virtual TaQLNodeResult visitAddRowNode (const TaQLAddRowNodeRep &node)
 
virtual TaQLNodeResult visitConcTabNode (const TaQLConcTabNodeRep &node)
 
virtual TaQLNodeResult visitShowNode (const TaQLShowNodeRep &node)
 
virtual TaQLNodeResult visitCopyColNode (const TaQLCopyColNodeRep &node)
 
virtual TaQLNodeResult visitDropTabNode (const TaQLDropTabNodeRep &node)
 
- Public Member Functions inherited from casacore::TaQLNodeVisitor
virtual ~TaQLNodeVisitor ()
 

Static Public Member Functions

static const TaQLNodeHRValuegetHR (const TaQLNodeResult &)
 Get the actual result object from the result. More...
 

Private Member Functions

TableParseSelectpushStack (TableParseSelect::CommandType)
 Push a new TableParseSelect on the stack. More...
 
TableParseSelecttopStack () const
 Get the top of the TableParseSelect stack. More...
 
void popStack ()
 Pop the top from the TableParseSelect stack. More...
 
void clearStack ()
 Clear the select stack. More...
 
TaQLNodeResult handleSelect (const TaQLSelectNodeRep &node, Bool doExec)
 Handle the select command. More...
 
void handleTableName (TaQLNodeHRValue *hrval, const TaQLNode &node)
 Handle a table name or temptable number in the given node and put it in the value result. More...
 
void handleTables (const TaQLMultiNode &, Bool addToFromList=True)
 Handle a MultiNode containing table info. More...
 
Table makeConcatTable (const TaQLMultiNodeRep &node)
 Make a ConcatTable from a nested set of tables. More...
 
void handleWhere (const TaQLNode &)
 Handle the WHERE clause. More...
 
void handleHaving (const TaQLNode &)
 Handle the HAVING clause. More...
 
void handleUpdate (const TaQLMultiNode &)
 Handle the UPDATE SET clause. More...
 
void handleInsCol (const TaQLMultiNode &)
 Handle the INSERT columns. More...
 
void handleInsVal (const TaQLNode &)
 Handle the INSERT values. More...
 
void handleLikeDrop (const TaQLMultiNode &node)
 Handle the possible LIKE table DROP COLUMN part. More...
 
void handleColSpecs (const TaQLMultiNode &)
 Handle a column specification in a create table or add column. More...
 
Record handleMultiRecFld (const TaQLNode &node)
 Handle a Multi RecFld representing a Record. More...
 

Private Attributes

std::vector< TableParseSelect * > itsStack
 
std::vector< const Table * > itsTempTables
 

Additional Inherited Members

- Protected Member Functions inherited from casacore::TaQLNodeVisitor
TaQLNodeResult visitNode (const TaQLNode &node)
 A convenience function to visit the given node using this visitor. More...
 

Detailed Description

Class to handle the nodes in the raw TaQL parse tree.

Intended use:

Internal

Review Status

Test programs:
tTableGram

Prerequisite

Synopsis

TaQLNodeHandler is a specialization of class TaQLNodeVisitor. It processes the raw TaQL parse tree generated by TableGram. The processing is done in a recursive way. It starts at the top (which is a SELECT, UPDATE, etc. expression) and the processing results of a query are stored in a TableParseSelect object. These objects are kept in a stack for possible nested queries. After a query is fully processed, it is executed. Usually the result is a table; only a CALC command gives a TableExprNode as result.

Motivation

Separating the raw query parsing from the query processing has several advantages compared to the old situation where parsing and processing were combined.

Definition at line 95 of file TaQLNodeHandler.h.

Constructor & Destructor Documentation

◆ ~TaQLNodeHandler()

virtual casacore::TaQLNodeHandler::~TaQLNodeHandler ( )
virtual

Member Function Documentation

◆ clearStack()

void casacore::TaQLNodeHandler::clearStack ( )
private

Clear the select stack.

◆ getHR()

const TaQLNodeHRValue & casacore::TaQLNodeHandler::getHR ( const TaQLNodeResult res)
inlinestatic

Get the actual result object from the result.

Definition at line 324 of file TaQLNodeHandler.h.

References casacore::TaQLNodeResult::getRep().

◆ handleColSpecs()

void casacore::TaQLNodeHandler::handleColSpecs ( const TaQLMultiNode )
private

Handle a column specification in a create table or add column.

◆ handleHaving()

void casacore::TaQLNodeHandler::handleHaving ( const TaQLNode )
private

Handle the HAVING clause.

◆ handleInsCol()

void casacore::TaQLNodeHandler::handleInsCol ( const TaQLMultiNode )
private

Handle the INSERT columns.

◆ handleInsVal()

void casacore::TaQLNodeHandler::handleInsVal ( const TaQLNode )
private

Handle the INSERT values.

◆ handleLikeDrop()

void casacore::TaQLNodeHandler::handleLikeDrop ( const TaQLMultiNode node)
private

Handle the possible LIKE table DROP COLUMN part.

◆ handleMultiRecFld()

Record casacore::TaQLNodeHandler::handleMultiRecFld ( const TaQLNode node)
private

Handle a Multi RecFld representing a Record.

◆ handleSelect()

TaQLNodeResult casacore::TaQLNodeHandler::handleSelect ( const TaQLSelectNodeRep node,
Bool  doExec 
)
private

Handle the select command.

Optionally the command is not executed (needed for the EXISTS operator).

◆ handleTableName()

void casacore::TaQLNodeHandler::handleTableName ( TaQLNodeHRValue hrval,
const TaQLNode node 
)
private

Handle a table name or temptable number in the given node and put it in the value result.

◆ handleTables()

void casacore::TaQLNodeHandler::handleTables ( const TaQLMultiNode ,
Bool  addToFromList = True 
)
private

Handle a MultiNode containing table info.

◆ handleTree()

TaQLNodeResult casacore::TaQLNodeHandler::handleTree ( const TaQLNode tree,
const std::vector< const Table * > &   
)

Handle and process the raw parse tree.

The result contains a Table or TableExprNode object.

◆ handleUpdate()

void casacore::TaQLNodeHandler::handleUpdate ( const TaQLMultiNode )
private

Handle the UPDATE SET clause.

◆ handleWhere()

void casacore::TaQLNodeHandler::handleWhere ( const TaQLNode )
private

Handle the WHERE clause.

◆ makeConcatTable()

Table casacore::TaQLNodeHandler::makeConcatTable ( const TaQLMultiNodeRep node)
private

Make a ConcatTable from a nested set of tables.

◆ popStack()

void casacore::TaQLNodeHandler::popStack ( )
private

Pop the top from the TableParseSelect stack.

◆ pushStack()

TableParseSelect* casacore::TaQLNodeHandler::pushStack ( TableParseSelect::CommandType  )
private

Push a new TableParseSelect on the stack.

◆ topStack()

TableParseSelect* casacore::TaQLNodeHandler::topStack ( ) const
private

Get the top of the TableParseSelect stack.

◆ visitAddColNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitAddColNode ( const TaQLAddColNodeRep node)
virtual

◆ visitAddRowNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitAddRowNode ( const TaQLAddRowNodeRep node)
virtual

◆ visitAltTabNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitAltTabNode ( const TaQLAltTabNodeRep node)
virtual

◆ visitBinaryNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitBinaryNode ( const TaQLBinaryNodeRep node)
virtual

◆ visitCalcNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitCalcNode ( const TaQLCalcNodeRep node)
virtual

◆ visitColNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitColNode ( const TaQLColNodeRep node)
virtual

◆ visitColSpecNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitColSpecNode ( const TaQLColSpecNodeRep node)
virtual

◆ visitColumnsNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitColumnsNode ( const TaQLColumnsNodeRep node)
virtual

◆ visitConcTabNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitConcTabNode ( const TaQLConcTabNodeRep node)
virtual

◆ visitConstNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitConstNode ( const TaQLConstNodeRep node)
virtual

Define the functions to visit each node type.

Implements casacore::TaQLNodeVisitor.

◆ visitCopyColNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitCopyColNode ( const TaQLCopyColNodeRep node)
virtual

◆ visitCountNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitCountNode ( const TaQLCountNodeRep node)
virtual

◆ visitCreTabNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitCreTabNode ( const TaQLCreTabNodeRep node)
virtual

◆ visitDeleteNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitDeleteNode ( const TaQLDeleteNodeRep node)
virtual

◆ visitDropTabNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitDropTabNode ( const TaQLDropTabNodeRep node)
virtual

◆ visitFuncNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitFuncNode ( const TaQLFuncNodeRep node)
virtual

◆ visitGivingNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitGivingNode ( const TaQLGivingNodeRep node)
virtual

◆ visitGroupNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitGroupNode ( const TaQLGroupNodeRep node)
virtual

◆ visitIndexNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitIndexNode ( const TaQLIndexNodeRep node)
virtual

◆ visitInsertNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitInsertNode ( const TaQLInsertNodeRep node)
virtual

◆ visitJoinNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitJoinNode ( const TaQLJoinNodeRep node)
virtual

◆ visitKeyColNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitKeyColNode ( const TaQLKeyColNodeRep node)
virtual

◆ visitLimitOffNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitLimitOffNode ( const TaQLLimitOffNodeRep node)
virtual

◆ visitMultiNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitMultiNode ( const TaQLMultiNodeRep node)
virtual

◆ visitRangeNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitRangeNode ( const TaQLRangeNodeRep node)
virtual

◆ visitRecFldNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitRecFldNode ( const TaQLRecFldNodeRep node)
virtual

◆ visitRegexNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitRegexNode ( const TaQLRegexNodeRep node)
virtual

◆ visitRenDropNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitRenDropNode ( const TaQLRenDropNodeRep node)
virtual

◆ visitSelectNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitSelectNode ( const TaQLSelectNodeRep node)
virtual

◆ visitSetKeyNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitSetKeyNode ( const TaQLSetKeyNodeRep node)
virtual

◆ visitShowNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitShowNode ( const TaQLShowNodeRep node)
virtual

◆ visitSortKeyNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitSortKeyNode ( const TaQLSortKeyNodeRep node)
virtual

◆ visitSortNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitSortNode ( const TaQLSortNodeRep node)
virtual

◆ visitTableNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitTableNode ( const TaQLTableNodeRep node)
virtual

◆ visitUnaryNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitUnaryNode ( const TaQLUnaryNodeRep node)
virtual

◆ visitUnitNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitUnitNode ( const TaQLUnitNodeRep node)
virtual

◆ visitUpdateNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitUpdateNode ( const TaQLUpdateNodeRep node)
virtual

◆ visitUpdExprNode()

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitUpdExprNode ( const TaQLUpdExprNodeRep node)
virtual

Member Data Documentation

◆ itsStack

std::vector<TableParseSelect*> casacore::TaQLNodeHandler::itsStack
private

Definition at line 204 of file TaQLNodeHandler.h.

◆ itsTempTables

std::vector<const Table*> casacore::TaQLNodeHandler::itsTempTables
private

Definition at line 206 of file TaQLNodeHandler.h.


The documentation for this class was generated from the following file: