Loading...
Searching...
No Matches
casacore::TaQLNodeHandler Class Reference
tables package (libcasa_tables) » TaQL_module » TaQL_module_internal_classes

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.
virtual TaQLNodeResult | visitConstNode (const TaQLConstNodeRep &node)
| Define the functions to visit each node type.
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 TaQLNodeHRValue & | getHR (const TaQLNodeResult &)
| Get the actual result object from the result.

## Private Member Functions

TableParseQuery * | pushStack (TableParseQuery::CommandType)
| Push a new TableParseQuery on the stack.
TableParseQuery * | topStack () const
| Get the top of the TableParseQuery stack.
void | popStack ()
| Pop the top from the TableParseQuery stack.
void | clearStack ()
| Clear the select stack.
TaQLNodeResult | handleSelect (const TaQLSelectNodeRep &node, Bool doExec)
| Handle the select command.
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.
void | handleTables (const TaQLMultiNode &, Bool addToFromList=True)
| Handle a MultiNode containing table info.
void | handleJoins (const TaQLMultiNode &node)
| Handle a MultiNoide containing joins.
Table | makeConcatTable (const TaQLMultiNodeRep &node)
| Make a ConcatTable from a nested set of tables.
void | handleWhere (const TaQLNode &)
| Handle the WHERE clause.
void | handleHaving (const TaQLNode &)
| Handle the HAVING clause.
void | handleUpdate (const TaQLMultiNode &)
| Handle the UPDATE SET clause.
void | handleInsCol (const TaQLMultiNode &)
| Handle the INSERT columns.
void | handleInsVal (const TaQLNode &)
| Handle the INSERT values.
void | handleLikeDrop (const TaQLMultiNode &node)
| Handle the possible LIKE table DROP COLUMN part.
void | handleColSpecs (const TaQLMultiNode &)
| Handle a column specification in a create table or add column.
Record | handleMultiRecFld (const TaQLNode &node)
| Handle a Multi RecFld representing a Record.
TableExprNode | handleIdFunc (const TaQLFuncNodeRep &node)
| Handle the MSID function.

## Private Attributes

std::vector< TableParseQuery * > | 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.

## Detailed Description

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

### Intended use:

Internal

### Review Status

Test programs:
  tTableGram

### Prerequisite

- TaQLNode
- Note 199 describing TaQL

### 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 TableParseQuery 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.

- The full command is parsed before any processing is done. So in case of a parse error, no possibly expensive processing has been done yet.
- In the future query optimization can be done in an easier way.
- Nested parsing is not possible. In case a Table is opened with a virtual TaQL column, the parsing of that TaQL string does not interfere with parsing the TaQL command.
- It is possible to use expressions in the column list. That could not be done before, because the column list was parsed/processed before the table list.

Definition at line 93 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 | ) |

inline static

Get the actual result object from the result.

Definition at line 327 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.

## handleIdFunc()

TableExprNode casacore::TaQLNodeHandler::handleIdFunc | ( | const TaQLFuncNodeRep & | node | ) |

private

Handle the MSID function.

## handleInsCol()

void casacore::TaQLNodeHandler::handleInsCol | ( | const TaQLMultiNode & |  | ) |

private

Handle the INSERT columns.

## handleInsVal()

void casacore::TaQLNodeHandler::handleInsVal | ( | const TaQLNode & |  | ) |

private

Handle the INSERT values.

## handleJoins()

void casacore::TaQLNodeHandler::handleJoins | ( | const TaQLMultiNode & | node | ) |

private

Handle a MultiNoide containing joins.

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

References casacore::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.

References casacore::True.

## 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 TableParseQuery stack.

## pushStack()

TableParseQuery * casacore::TaQLNodeHandler::pushStack | ( | TableParseQuery::CommandType |  | ) |

private

Push a new TableParseQuery on the stack.

## topStack()

TableParseQuery * casacore::TaQLNodeHandler::topStack | ( |  | ) | const

private

Get the top of the TableParseQuery stack.

## visitAddColNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitAddRowNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitAltTabNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitBinaryNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitCalcNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitColNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitColSpecNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitColumnsNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitConcTabNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## 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

Implements casacore::TaQLNodeVisitor.

## visitCountNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitCreTabNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitDeleteNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitDropTabNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitFuncNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitGivingNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitGroupNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitIndexNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitInsertNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitJoinNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitKeyColNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitLimitOffNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitMultiNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitRangeNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitRecFldNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitRegexNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitRenDropNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitSelectNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitSetKeyNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitShowNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitSortKeyNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitSortNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitTableNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitUnaryNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitUnitNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitUpdateNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## visitUpdExprNode()

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

virtual

Implements casacore::TaQLNodeVisitor.

## Member Data Documentation

## itsStack

std::vector<TableParseQuery*> casacore::TaQLNodeHandler::itsStack

private

Definition at line 207 of file TaQLNodeHandler.h.

## itsTempTables

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

private

Definition at line 209 of file TaQLNodeHandler.h.

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

- tables/TaQL/TaQLNodeHandler.h