28 #ifndef TABLES_TAQLNODEHANDLER_H 29 #define TABLES_TAQLNODEHANDLER_H 32 #include <casacore/casa/aips.h> 33 #include <casacore/tables/TaQL/TaQLNodeVisitor.h> 34 #include <casacore/tables/TaQL/TaQLNodeDer.h> 35 #include <casacore/tables/TaQL/TableParse.h> 36 #include <casacore/tables/TaQL/ExprNode.h> 37 #include <casacore/tables/TaQL/ExprNodeSet.h> 38 #include <casacore/casa/Containers/Record.h> 44 class TaQLNodeHRValue;
102 const std::vector<const Table*>&);
237 : itsInt(-1), itsElem(0), itsSet(0), itsNames(0) {}
239 : itsInt(-1), itsExpr(expr), itsElem(0), itsSet(0), itsNames(0) {}
247 {
return itsString; }
253 {
return itsRecord; }
274 { itsAlias = alias; }
276 { itsDtype = dtype; }
278 { itsRecord = record; }
280 { itsTable = table; }
288 { itsNames = names; }
virtual TaQLNodeResult visitKeyColNode(const TaQLKeyColNodeRep &node)
void setExpr(const TableExprNode &expr)
A 1-D Specialization of the Array class.
Raw TaQL parse tree node defining a count command.
void popStack()
Pop the top from the TableParseSelect stack.
std::vector< TableParseSelect * > itsStack
Abstract base class to hold the result of a visit to the node tree.
TableExprNodeSetElem * itsElem
void setAlias(const String &alias)
const TableExprNodeSetElem * getElem() const
void setNames(Vector< String > *names)
Raw TaQL parse tree node defining a select command.
Main interface class to a read/write table.
void setElem(TableExprNodeSetElem *elem)
Raw TaQL parse tree node defining an update command.
void setString(const String &str)
virtual TaQLNodeResult visitConstNode(const TaQLConstNodeRep &node)
Define the functions to visit each node type.
virtual TaQLNodeResult visitDeleteNode(const TaQLDeleteNodeRep &node)
const Table & getTable() const
Class to hold multiple table expression nodes.
virtual TaQLNodeResult visitTableNode(const TaQLTableNodeRep &node)
const String & getAlias() const
Handle class for a table column expression tree.
void setExprSet(TableExprNodeSet *set)
void setRecord(const Record &record)
Raw TaQL parse tree node defining a range.
virtual TaQLNodeResult visitInsertNode(const TaQLInsertNodeRep &node)
Raw TaQL parse tree node defining a constant value.
virtual TaQLNodeResult visitSelectNode(const TaQLSelectNodeRep &node)
Raw TaQL parse tree node defining a create table command.
void handleHaving(const TaQLNode &)
Handle the HAVING clause.
const String & getString() const
Raw TaQL parse tree node defining an index in a array.
int checkConstDtype(int dt1, int dt2)
Determine 'highest' constant data type and check if they match.
virtual TaQLNodeResult visitSortNode(const TaQLSortNodeRep &node)
Raw TaQL parse tree node defining a calc command.
virtual TaQLNodeResult visitCreTabNode(const TaQLCreTabNodeRep &node)
Raw TaQL parse tree node defining a list of nodes.
virtual TaQLNodeResult visitUpdExprNode(const TaQLUpdExprNodeRep &node)
Record handleRecord(const TaQLMultiNodeRep *)
Handle a record specification.
void clearStack()
Clear the select stack.
std::vector< const Table * > itsTempTables
Select-class for flex/bison scanner/parser for TableParse.
Class to handle the nodes in the raw TaQL parse tree.
Raw TaQL parse tree node defining a delete command.
void handleUpdate(const TaQLMultiNode &)
Handle the UPDATE SET clause.
const TableExprNodeSet & getExprSet() const
TableParseSelect * pushStack(TableParseSelect::CommandType)
Push a new TableParseSelect on the stack.
virtual TaQLNodeResult visitRegexNode(const TaQLRegexNodeRep &node)
Envelope class for a node containing a select command.
Raw TaQL parse tree node defining a table.
const Vector< String > * getNames() const
const String & getDtype() const
Class to hold the table expression nodes for an element in a set.
virtual TaQLNodeResult visitMultiNode(const TaQLMultiNodeRep &node)
virtual TaQLNodeResult visitRangeNode(const TaQLRangeNodeRep &node)
virtual TaQLNodeResult visitGivingNode(const TaQLGivingNodeRep &node)
Raw TaQL parse tree node defining a groupby list.
Raw TaQL parse tree node defining a giving expression list.
const Record & getRecord() const
Raw TaQL parse tree node defining a unary operator.
Raw TaQL parse tree node defining a constant regex value.
Raw TaQL parse tree node defining a record field.
virtual TaQLNodeResult visitJoinNode(const TaQLJoinNodeRep &node)
virtual TaQLNodeResult visitBinaryNode(const TaQLBinaryNodeRep &node)
const TaQLNodeResultRep * getRep() const
Get the actual underlying object.
TaQLNodeResult handleSelect(const TaQLSelectNodeRep &node, Bool doExec)
Handle the select command.
virtual TaQLNodeResult visitIndexNode(const TaQLIndexNodeRep &node)
const TableExprNode & getExpr() const
Raw TaQL parse tree node defining a keyword or column name.
virtual TaQLNodeResult visitSortKeyNode(const TaQLSortKeyNodeRep &node)
virtual TaQLNodeResult visitUnaryNode(const TaQLUnaryNodeRep &node)
A hierarchical collection of named fields of various types.
bool Bool
Define the standard types used by Casacore.
Raw TaQL parse tree node defining a function.
virtual TaQLNodeResult visitUnitNode(const TaQLUnitNodeRep &node)
void handleInsVal(const TaQLNode &)
Handle the INSERT values.
void handleColSpec(const TaQLMultiNode &)
Handle a column specification in a create table.
virtual TaQLNodeResult visitRecFldNode(const TaQLRecFldNodeRep &node)
void setTable(const Table &table)
static const TaQLNodeHRValue & getHR(const TaQLNodeResult &)
Get the actual result object from the result.
Raw TaQL parse tree node defining a create column specification.
virtual TaQLNodeResult visitFuncNode(const TaQLFuncNodeRep &node)
Raw TaQL parse tree node defining a unit.
Raw TaQL parse tree node defining a column update expression.
virtual TaQLNodeResult visitColumnsNode(const TaQLColumnsNodeRep &node)
TaQLNodeResult handleTree(const TaQLNode &tree, const std::vector< const Table *> &)
Handle and process the raw parse tree.
virtual TaQLNodeResult visitColSpecNode(const TaQLColSpecNodeRep &node)
void handleRecFld(const TaQLNode &, Record &)
Handle a record field and add it to the Record.
Vector< String > * itsNames
virtual ~TaQLNodeHandler()
Int getInt() const
Get the values.
void setDtype(const String &dtype)
Envelope class to hold the result of a visit to the node tree.
Raw TaQL parse tree node defining a limit/offset expression.
TaQLNodeHRValue(const TableExprNode &expr)
void handleTables(const TaQLMultiNode &)
Handle a MultiNode containing table info.
TableExprNodeSet * itsSet
Raw TaQL parse tree node defining a sort key.
Raw TaQL parse tree node defining a sort list.
virtual TaQLNodeResult visitLimitOffNode(const TaQLLimitOffNodeRep &node)
String: the storage and methods of handling collections of characters.
Raw TaQL parse tree node defining a select column expression.
void setInt(Int ival)
Set the values.
Raw TaQL parse tree node defining a select column list.
virtual TaQLNodeResult visitGroupNode(const TaQLGroupNodeRep &node)
Raw TaQL parse tree node defining a join operation.
Envelope class for a node in the raw TaQL parse tree.
void handleMultiRecFld(const String &fldName, const TaQLMultiNodeRep *node, Record &rec)
Handle a record field with multiple values and add it to the Record.
void handleInsCol(const TaQLMultiNode &)
Handle the INSERT columns.
Class to visit the nodes in the raw TaQL parse tree.
Class containing the result value of the handling of a TaQLNode.
virtual TaQLNodeResult visitCalcNode(const TaQLCalcNodeRep &node)
TableParseSelect * topStack() const
Get the top of the TableParseSelect stack.
void handleWhere(const TaQLNode &)
Handle the WHERE clause.
Raw TaQL parse tree node defining a binary operator.
virtual TaQLNodeResult visitColNode(const TaQLColNodeRep &node)
this file contains all the compiler specific defines
virtual TaQLNodeResult visitCountNode(const TaQLCountNodeRep &node)
Raw TaQL parse tree node defining an insert command.
virtual TaQLNodeResult visitUpdateNode(const TaQLUpdateNodeRep &node)