Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
elftosb::ExprASTNode Class Reference

Abstract base class for all expression AST nodes. More...

#include <ElftosbAST.h>

+ Inheritance diagram for elftosb::ExprASTNode:
+ Collaboration diagram for elftosb::ExprASTNode:

Public Member Functions

 ExprASTNode (const ExprASTNode &other)
 
virtual std::string nodeName () const
 Returns the name of the object's class.
 
virtual ExprASTNodereduce (EvalContext &context)
 Evaluate the expression and produce a result node to replace this one. More...
 
int_size_t resultIntSize (int_size_t a, int_size_t b)
 
- Public Member Functions inherited from elftosb::ASTNode
 ASTNode ()
 Default constructor.
 
 ASTNode (ASTNode *parent)
 Constructor taking a parent node.
 
 ASTNode (const ASTNode &other)
 Copy constructor.
 
virtual ~ASTNode ()
 Destructor.
 
virtual ASTNodeclone () const =0
 Returns an exact duplicate of this object.
 
virtual ASTNodegetParent () const
 
virtual void setParent (ASTNode *newParent)
 
virtual void printTree () const
 
virtual void printTree (int indent) const
 
virtual void setLocation (token_loc_t &loc)
 
virtual void setLocation (token_loc_t &first, token_loc_t &last)
 
virtual void setLocation (ASTNode *loc)
 
virtual void setLocation (ASTNode *first, ASTNode *last)
 
virtual token_loc_tgetLocation ()
 
virtual const token_loc_tgetLocation () const
 
virtual int getFirstLine ()
 
virtual int getLastLine ()
 

Additional Inherited Members

- Protected Member Functions inherited from elftosb::ASTNode
void printIndent (int indent) const
 Prints indent number of spaces.
 
- Protected Attributes inherited from elftosb::ASTNode
ASTNodem_parent
 Pointer to parent node of this object. May be NULL.
 
token_loc_t m_location
 Location of this node in the source file.
 

Detailed Description

Abstract base class for all expression AST nodes.

Member Function Documentation

virtual ExprASTNode* elftosb::ExprASTNode::reduce ( EvalContext context)
inlinevirtual

Evaluate the expression and produce a result node to replace this one.

The default implementation simply return this node unmodified. This method is responsible for deleting any nodes that are no longer needed. (?) how to delete this?

Reimplemented in elftosb::IntSizeExprASTNode, elftosb::BinaryOpExprASTNode, elftosb::SizeofOperatorASTNode, elftosb::DefinedOperatorASTNode, elftosb::SourceFileFunctionASTNode, elftosb::BooleanNotExprASTNode, elftosb::NegativeExprASTNode, elftosb::SymbolRefExprASTNode, and elftosb::VariableExprASTNode.


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