TaQLNode.h
Classes
- TaQLNode -- Envelope class for a node in the raw TaQL parse tree. (full description)
- TaQLConstNode -- Envelope class for a node containing a constant value. (full description)
- TaQLMultiNode -- Envelope class for a node containing a select command. (full description)
- TaQLSelectNode -- Envelope class for a node containing a list of nodes. (full description)
Interface
- Public Members
- TaQLNode() : itsRep(0)
- TaQLNode (TaQLNodeRep* rep)
- TaQLNode (const TaQLNode& that)
- TaQLNode& operator= (const TaQLNode& that)
- ~TaQLNode()
- static TaQLNode parse (const String& command)
- Bool isValid() const
- char nodeType() const
- const TaQLNodeRep* getRep() const
- TaQLNodeResult visit (TaQLNodeVisitor& visitor) const
- void show (std::ostream& os) const
- void save (AipsIO& aio) const
- static TaQLNode restore (AipsIO& aio)
- Private Members
- static void clearNodesCreated()
- Public Members
- void saveNode (AipsIO& aio) const
- static TaQLNode restoreNode (AipsIO& aio)
- static TaQLMultiNode restoreMultiNode (AipsIO& aio)
Review Status
- Programs:
- Tests:
Prerequisite
Synopsis
The result of parsing a TaQL command is stored in TaQLNode objects.
Each part of the command can have its own specialized
TaQLNodeRep object, which forms
the letter in the TaQLNode envelope.
The actual scanning/parsing of the command is done using flex/bison
as defined in the TableGram files.
Motivation
The letter-envelope idiom (counted pointer) makes if much easier
to keep track of memory, especially in the case of exceptions.
Member Description
Default constructor.
Construct for given letter. It takes over the pointer.
TaQLNode (const TaQLNode& that)
Copy constructor (reference semantics).
TaQLNode& operator= (const TaQLNode& that)
Assignment (reference semantics).
Destructor deletes the letter if no more references.
static TaQLNode parse (const String& command)
Parse a TaQL command and return the result.
An exception is thrown in case of parse errors.
Does the envelope contain a letter?
Return the type of letter.
Get read access to the letter.
void show (std::ostream& os) const
Print the node (recursively) in the given stream.
Save and restore the entire tree.
Helper functions for save/restore of tree.
Interface
- explicit TaQLConstNode (TaQLConstNodeRep* rep)
- void setIsTableName()
- const String& getString() const
Review Status
- Programs:
- Tests:
Synopsis
This is a specialization of the envelope class
TaQLNode for a node containing
a constant value.
Member Description
explicit TaQLConstNode (TaQLConstNodeRep* rep)
Interface
- TaQLMultiNode()
- explicit TaQLMultiNode (Bool isSetOrArray)
- TaQLMultiNode (TaQLMultiNodeRep* rep)
- void add (const TaQLNode& node)
- void add (TaQLNodeRep* noderep)
- void setIsSetOrArray()
- void setPPFix (const String& prefix, const String& postfix)
- const TaQLMultiNodeRep* getMultiRep() const
Review Status
- Programs:
- Tests:
Synopsis
This is a specialization of the envelope class
TaQLNode for a node containing
a select command.
Member Description
explicit TaQLMultiNode (Bool isSetOrArray)
Interface
- TaQLSelectNode (TaQLSelectNodeRep* rep)
- void setBrackets()
- void setNoExecute()
- void setFromExecute()
Review Status
- Programs:
- Tests:
Synopsis
This is a specialization of the envelope class
TaQLNode for a node containing
a list of nodes.
Member Description