casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::TaQLNodeHandler Class Reference

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

#include <TaQLNodeHandler.h>

Inheritance diagram for casacore::TaQLNodeHandler:
casacore::TaQLNodeVisitor

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)
 
- 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 handleColSpecs (const TaQLMultiNode &)
 Handle a column specification in a create table. 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

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

Member Function Documentation

void casacore::TaQLNodeHandler::clearStack ( )
private

Clear the select stack.

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

Get the actual result object from the result.

Definition at line 319 of file TaQLNodeHandler.h.

References casacore::TaQLNodeResult::getRep().

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

Handle a column specification in a create table.

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

Handle the HAVING clause.

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

Handle the INSERT columns.

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

Handle the INSERT values.

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

Handle a Multi RecFld representing a Record.

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).

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.

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

Handle a MultiNode containing table info.

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.

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

Handle the UPDATE SET clause.

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

Handle the WHERE clause.

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

Make a ConcatTable from a nested set of tables.

void casacore::TaQLNodeHandler::popStack ( )
private

Pop the top from the TableParseSelect stack.

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

Push a new TableParseSelect on the stack.

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

Get the top of the TableParseSelect stack.

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitAddColNode ( const TaQLAddColNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitAddRowNode ( const TaQLAddRowNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitAltTabNode ( const TaQLAltTabNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitBinaryNode ( const TaQLBinaryNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitCalcNode ( const TaQLCalcNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitColNode ( const TaQLColNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitColSpecNode ( const TaQLColSpecNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitColumnsNode ( const TaQLColumnsNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitConcTabNode ( const TaQLConcTabNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitConstNode ( const TaQLConstNodeRep node)
virtual

Define the functions to visit each node type.

Implements casacore::TaQLNodeVisitor.

virtual TaQLNodeResult casacore::TaQLNodeHandler::visitCountNode ( const TaQLCountNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitCreTabNode ( const TaQLCreTabNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitDeleteNode ( const TaQLDeleteNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitFuncNode ( const TaQLFuncNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitGivingNode ( const TaQLGivingNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitGroupNode ( const TaQLGroupNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitIndexNode ( const TaQLIndexNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitInsertNode ( const TaQLInsertNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitJoinNode ( const TaQLJoinNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitKeyColNode ( const TaQLKeyColNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitLimitOffNode ( const TaQLLimitOffNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitMultiNode ( const TaQLMultiNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitRangeNode ( const TaQLRangeNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitRecFldNode ( const TaQLRecFldNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitRegexNode ( const TaQLRegexNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitRenDropNode ( const TaQLRenDropNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitSelectNode ( const TaQLSelectNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitSetKeyNode ( const TaQLSetKeyNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitShowNode ( const TaQLShowNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitSortKeyNode ( const TaQLSortKeyNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitSortNode ( const TaQLSortNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitTableNode ( const TaQLTableNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitUnaryNode ( const TaQLUnaryNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitUnitNode ( const TaQLUnitNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitUpdateNode ( const TaQLUpdateNodeRep node)
virtual
virtual TaQLNodeResult casacore::TaQLNodeHandler::visitUpdExprNode ( const TaQLUpdExprNodeRep node)
virtual

Member Data Documentation

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

Definition at line 199 of file TaQLNodeHandler.h.

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

Definition at line 201 of file TaQLNodeHandler.h.


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