Aseba::Node Struct Reference
[AESL Compiler]

An abstract node of syntax tree. More...

#include <tree.h>

Inheritance diagram for Aseba::Node:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::vector< Node * > NodesVector
 Vector for children of a node.
enum  ReturnType { TYPE_UNIT = 0, TYPE_BOOL, TYPE_INT }
 

A type a node can return.

More...

Public Member Functions

virtual void dump (std::ostream &dest, unsigned &indent) const
 Dump this node and the rest of the tree.
virtual void emit (PreLinkBytecode &bytecodes) const =0
 Generate bytecode.
void expectType (const Node::ReturnType &expected, const Node::ReturnType &type) const
 Check for a specific type, throw an exception otherwise.
virtual unsigned getStackDepth () const
 Return the stack depth requirement for this node and its children.
 Node (const SourcePos &sourcePos)
 Constructor.
virtual Nodeoptimize (std::ostream *dump)=0
 Optimize this node, return the optimized node.
virtual std::string toNodeName () const =0
 Return a string representation of the name of this node.
virtual std::string toString () const =0
 Return a string representation of this node.
virtual ReturnType typeCheck () const
 Typecheck this node, throw an exception if there is any type violation.
std::string typeName (const Node::ReturnType &type) const
 Return the name of a type.
virtual ~Node ()
 Destructor, delete all children.

Public Attributes

NodesVector children
 children of this node
SourcePos sourcePos
 position is source

Detailed Description

An abstract node of syntax tree.

Definition at line 47 of file tree.h.


Member Typedef Documentation

typedef std::vector<Node *> Aseba::Node::NodesVector

Vector for children of a node.

Definition at line 84 of file tree.h.


Member Enumeration Documentation

A type a node can return.

Enumerator:
TYPE_UNIT 
TYPE_BOOL 
TYPE_INT 

Definition at line 50 of file tree.h.


Constructor & Destructor Documentation

Aseba::Node::Node ( const SourcePos sourcePos  )  [inline]

Constructor.

Definition at line 58 of file tree.h.


Member Function Documentation

virtual void Aseba::Node::emit ( PreLinkBytecode bytecodes  )  const [pure virtual]
virtual Node* Aseba::Node::optimize ( std::ostream *  dump  )  [pure virtual]
virtual std::string Aseba::Node::toNodeName (  )  const [pure virtual]
virtual std::string Aseba::Node::toString (  )  const [pure virtual]

Member Data Documentation

children of this node

Definition at line 85 of file tree.h.

position is source

Definition at line 86 of file tree.h.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


asebaros
Author(s): $author
autogenerated on Mon Sep 5 08:42:14 2011