casa
$Rev:20696$
|
Class to handle the nodes in the raw TaQL parse tree. 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 | 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) |
Static Public Member Functions | |
static const TaQLNodeHRValue & | getHR (const TaQLNodeResult &) |
Get the actual result object from the result. | |
Private Member Functions | |
TableParseSelect * | pushStack (TableParseSelect::CommandType) |
Push a new TableParseSelect on the stack. | |
TableParseSelect * | topStack () const |
Get the top of the TableParseSelect stack. | |
void | popStack () |
Pop the top from the TableParseSelect stack. | |
void | clearStack () |
Clear the select stack. | |
TaQLNodeResult | handleSelect (const TaQLSelectNodeRep &node, Bool doExec) |
Handle the select command. | |
void | handleTables (const TaQLMultiNode &) |
Handle a MultiNode containing table info. | |
void | handleWhere (const TaQLNode &) |
Handle the WHERE 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 | handleColSpec (const TaQLMultiNode &) |
Handle a column specification in a create table. | |
Record | handleRecord (const TaQLMultiNodeRep *) |
Handle a record specification. | |
void | handleRecFld (const TaQLNode &, Record &) |
Handle a record field and add it to the Record. | |
void | handleMultiRecFld (const String &fldName, const TaQLMultiNodeRep *node, Record &rec) |
Handle a record field with multiple values and add it to the Record. | |
int | checkConstDtype (int dt1, int dt2) |
Determine 'highest' constant data type and check if they match. | |
Private Attributes | |
std::vector< TableParseSelect * > | itsStack |
std::vector< const Table * > | itsTempTables |
Class to handle the nodes in the raw TaQL parse tree.
Internal
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.
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 93 of file TaQLNodeHandler.h.
virtual casa::TaQLNodeHandler::~TaQLNodeHandler | ( | ) | [virtual] |
int casa::TaQLNodeHandler::checkConstDtype | ( | int | dt1, |
int | dt2 | ||
) | [private] |
Determine 'highest' constant data type and check if they match.
void casa::TaQLNodeHandler::clearStack | ( | ) | [private] |
Clear the select stack.
const TaQLNodeHRValue & casa::TaQLNodeHandler::getHR | ( | const TaQLNodeResult & | res | ) | [inline, static] |
Get the actual result object from the result.
Definition at line 301 of file TaQLNodeHandler.h.
References casa::TaQLNodeResult::getRep().
void casa::TaQLNodeHandler::handleColSpec | ( | const TaQLMultiNode & | ) | [private] |
Handle a column specification in a create table.
void casa::TaQLNodeHandler::handleInsCol | ( | const TaQLMultiNode & | ) | [private] |
Handle the INSERT columns.
void casa::TaQLNodeHandler::handleInsVal | ( | const TaQLNode & | ) | [private] |
Handle the INSERT values.
void casa::TaQLNodeHandler::handleMultiRecFld | ( | const String & | fldName, |
const TaQLMultiNodeRep * | node, | ||
Record & | rec | ||
) | [private] |
Handle a record field with multiple values and add it to the Record.
The field can be a record or a vector of values.
void casa::TaQLNodeHandler::handleRecFld | ( | const TaQLNode & | , |
Record & | |||
) | [private] |
Handle a record field and add it to the Record.
Record casa::TaQLNodeHandler::handleRecord | ( | const TaQLMultiNodeRep * | ) | [private] |
Handle a record specification.
TaQLNodeResult casa::TaQLNodeHandler::handleSelect | ( | const TaQLSelectNodeRep & | node, |
Bool | doExec | ||
) | [private] |
Handle the select command.
Optionally the command is not executed (needed for the EXISTS operator).
void casa::TaQLNodeHandler::handleTables | ( | const TaQLMultiNode & | ) | [private] |
Handle a MultiNode containing table info.
TaQLNodeResult casa::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 casa::TaQLNodeHandler::handleUpdate | ( | const TaQLMultiNode & | ) | [private] |
Handle the UPDATE SET clause.
void casa::TaQLNodeHandler::handleWhere | ( | const TaQLNode & | ) | [private] |
Handle the WHERE clause.
void casa::TaQLNodeHandler::popStack | ( | ) | [private] |
Pop the top from the TableParseSelect stack.
Push a new TableParseSelect on the stack.
TableParseSelect* casa::TaQLNodeHandler::topStack | ( | ) | const [private] |
Get the top of the TableParseSelect stack.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitBinaryNode | ( | const TaQLBinaryNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitCalcNode | ( | const TaQLCalcNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitColNode | ( | const TaQLColNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitColSpecNode | ( | const TaQLColSpecNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitColumnsNode | ( | const TaQLColumnsNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitConstNode | ( | const TaQLConstNodeRep & | node | ) | [virtual] |
Define the functions to visit each node type.
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitCountNode | ( | const TaQLCountNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitCreTabNode | ( | const TaQLCreTabNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitDeleteNode | ( | const TaQLDeleteNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitFuncNode | ( | const TaQLFuncNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitGivingNode | ( | const TaQLGivingNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitIndexNode | ( | const TaQLIndexNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitInsertNode | ( | const TaQLInsertNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitJoinNode | ( | const TaQLJoinNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitKeyColNode | ( | const TaQLKeyColNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitLimitOffNode | ( | const TaQLLimitOffNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitMultiNode | ( | const TaQLMultiNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitRangeNode | ( | const TaQLRangeNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitRecFldNode | ( | const TaQLRecFldNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitRegexNode | ( | const TaQLRegexNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitSelectNode | ( | const TaQLSelectNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitSortKeyNode | ( | const TaQLSortKeyNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitSortNode | ( | const TaQLSortNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitTableNode | ( | const TaQLTableNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitUnaryNode | ( | const TaQLUnaryNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitUnitNode | ( | const TaQLUnitNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitUpdateNode | ( | const TaQLUpdateNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
virtual TaQLNodeResult casa::TaQLNodeHandler::visitUpdExprNode | ( | const TaQLUpdExprNodeRep & | node | ) | [virtual] |
Implements casa::TaQLNodeVisitor.
std::vector<TableParseSelect*> casa::TaQLNodeHandler::itsStack [private] |
Definition at line 191 of file TaQLNodeHandler.h.
std::vector<const Table*> casa::TaQLNodeHandler::itsTempTables [private] |
Definition at line 193 of file TaQLNodeHandler.h.