AESL Compiler

Classes

struct  Aseba::ArrayReadNode
struct  Aseba::ArrayWriteNode
struct  Aseba::AssignmentNode
struct  Aseba::BinaryArithmeticNode
struct  Aseba::BlockNode
 Node for "block", i.e. a vector of statements. More...
struct  Aseba::BytecodeElement
 A bytecode element. More...
struct  Aseba::BytecodeVector
 Bytecode array in the form of a dequeue, for construction. More...
struct  Aseba::CallNode
struct  Aseba::CallSubNode
struct  Aseba::CommonDefinitions
 Definitions common to several nodes, such as events or some constants. More...
class  Aseba::Compiler
 Aseba Event Scripting Language compiler. More...
struct  Aseba::EmitNode
struct  Aseba::Error
 Compilation error. More...
struct  Aseba::EventDeclNode
struct  Aseba::FoldedIfWhenNode
struct  Aseba::FoldedWhileNode
struct  Aseba::IfWhenNode
struct  Aseba::ImmediateNode
struct  Aseba::LoadNode
struct  Aseba::NamedValue
 A name - value pair. More...
struct  Aseba::NamedValuesVector
 Generic vector of name - value pairs. More...
struct  Aseba::Node
 An abstract node of syntax tree. More...
struct  Aseba::PreLinkBytecode
 Bytecode use for compilation previous to linking. More...
struct  Aseba::ProgramNode
 Node for "program", i.e. a block node with some special behaviour later on. More...
struct  Aseba::SourcePos
 Position in a source file or string. First is line, second is column. More...
struct  Aseba::StoreNode
struct  Aseba::SubDeclNode
struct  Aseba::TargetDescription
 Description of target VM. More...
struct  Aseba::UnaryArithmeticNode
struct  Aseba::WhileNode

Typedefs

typedef NamedValue Aseba::ConstantDefinition
 An constant definition is a name - value pair.
typedef NamedValuesVector Aseba::ConstantsDefinitions
 Vector of constants definitions.
typedef NamedValue Aseba::EventDescription
 An event description is a name - value pair.
typedef NamedValuesVector Aseba::EventsDescriptionsVector
 Vector of events descriptions.
typedef std::vector< short int > Aseba::VariablesDataVector
 Vector of data of variables.
typedef std::vector< std::string > Aseba::VariablesNamesVector
 Vector of names of variables.

Functions

 Aseba::ArrayReadNode::ArrayReadNode (const SourcePos &sourcePos, unsigned arrayAddr, unsigned arraySize, const std::string &arrayName)
 Constructor.
 Aseba::ArrayWriteNode::ArrayWriteNode (const SourcePos &sourcePos, unsigned arrayAddr, unsigned arraySize, const std::string &arrayName)
 Constructor.
 Aseba::BinaryArithmeticNode::BinaryArithmeticNode (const SourcePos &sourcePos, AsebaBinaryOperator op, Node *left, Node *right)
 Constructor.
std::string Aseba::binaryOperatorToString (AsebaBinaryOperator op)
 Return the string corresponding to the binary operator.
void Aseba::Compiler::buildMaps ()
 Build variables and functions maps.
 Aseba::CallNode::CallNode (const SourcePos &sourcePos, unsigned funcId)
 Constructor.
 Aseba::CallSubNode::CallSubNode (const SourcePos &sourcePos, unsigned subroutineId)
 Constructor.
bool Aseba::Compiler::compile (std::istream &source, BytecodeVector &bytecode, unsigned &allocatedVariablesCount, Error &errorDescription, std::ostream *dump=0)
 Aseba::Compiler::Compiler ()
 Constructor. You must setup a description using setTargetDescription() before any call to compile().
bool Aseba::NamedValuesVector::contains (const std::string &s, size_t *position=0) const
void Aseba::BinaryArithmeticNode::deMorganNotRemoval ()
 Recursively apply de Morgan law as long as nodes are logic operations, and then invert comparisons.
void Aseba::Compiler::disassemble (BytecodeVector &bytecode, const PreLinkBytecode &preLinkBytecode, std::ostream &dump) const
 Disassemble a microcontroller bytecode and dump it.
virtual void Aseba::Node::dump (std::ostream &dest, unsigned &indent) const
 Dump this node and the rest of the tree.
virtual void Aseba::CallNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::ArrayWriteNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::ArrayReadNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::StoreNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::LoadNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::ImmediateNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::UnaryArithmeticNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::BinaryArithmeticNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::CallSubNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::SubDeclNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::EmitNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::EventDeclNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::FoldedWhileNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::WhileNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::FoldedIfWhenNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::IfWhenNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::AssignmentNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::ProgramNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual void Aseba::BlockNode::emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
 Aseba::EventDeclNode::EventDeclNode (const SourcePos &sourcePos, unsigned eventId=0)
 Constructor.
void Aseba::Node::expectType (const Node::ReturnType &expected, const Node::ReturnType &type) const
 Check for a specific type, throw an exception otherwise.
void Aseba::PreLinkBytecode::fixup (const Compiler::SubroutineTable &subroutineTable)
static BinaryArithmeticNode * Aseba::BinaryArithmeticNode::fromAddExpression (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)
 Create a binary arithmetic node for add/sub operation op.
static BinaryArithmeticNode * Aseba::BinaryArithmeticNode::fromComparison (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)
 Create a binary arithmetic node for comparaison operation op.
static BinaryArithmeticNode * Aseba::BinaryArithmeticNode::fromMultExpression (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)
 Create a binary arithmetic node for mult/div/mod operation op.
static BinaryArithmeticNode * Aseba::BinaryArithmeticNode::fromShiftExpression (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)
 Create a binary arithmetic node for shift operation op.
virtual unsigned Aseba::CallNode::getStackDepth () const
 Return the stack depth requirement for this node and its children.
virtual unsigned Aseba::LoadNode::getStackDepth () const
 Return the stack depth requirement for this node and its children.
virtual unsigned Aseba::ImmediateNode::getStackDepth () const
 Return the stack depth requirement for this node and its children.
virtual unsigned Aseba::BinaryArithmeticNode::getStackDepth () const
 Return the stack depth requirement for this node and its children.
virtual unsigned Aseba::FoldedWhileNode::getStackDepth () const
 Return the stack depth requirement for this node and its children.
virtual unsigned Aseba::FoldedIfWhenNode::getStackDepth () const
 Return the stack depth requirement for this node and its children.
virtual unsigned Aseba::Node::getStackDepth () const
 Return the stack depth requirement for this node and its children.
template<typename T >
bool Aseba::isPOT (T number)
 Return true if number is a power of two.
bool Aseba::Compiler::link (const PreLinkBytecode &preLinkBytecode, BytecodeVector &bytecode)
 Create the final bytecode for a microcontroller.
virtual Node * Aseba::CallNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::ArrayWriteNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::ArrayReadNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::StoreNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::LoadNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::ImmediateNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::UnaryArithmeticNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::BinaryArithmeticNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::CallSubNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::SubDeclNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::EmitNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::EventDeclNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::FoldedWhileNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::WhileNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::FoldedIfWhenNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::IfWhenNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::AssignmentNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
virtual Node * Aseba::BlockNode::optimize (std::ostream *dump)
 Optimize this node, return the optimized node.
 Aseba::PreLinkBytecode::PreLinkBytecode ()
 Add init event and point to currentBytecode it.
void Aseba::Compiler::setCommonDefinitions (const CommonDefinitions *definitions)
 Set the common definitions, such as events or some constants.
void Aseba::Compiler::setTargetDescription (const TargetDescription *description)
 Set the description of the target as returned by the microcontroller. You must call this function before any call to compile().
template<typename T >
unsigned Aseba::shiftFromPOT (T number)
 If number is a power of two, number = (1 << shift) and this function returns shift, otherwise return value is undefined.
 Aseba::SubDeclNode::SubDeclNode (const SourcePos &sourcePos, unsigned subroutineId)
 Constructor.
virtual std::string Aseba::CallNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::ArrayWriteNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::ArrayReadNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::StoreNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::LoadNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::ImmediateNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::UnaryArithmeticNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::BinaryArithmeticNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::CallSubNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::SubDeclNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::EmitNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::EventDeclNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::FoldedWhileNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::WhileNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::FoldedIfWhenNode::toString () const
 Return a string representation of this node.
virtual std::string Aseba::IfWhenNode::toString () const
 Return a string representation of this node.
std::string Aseba::Error::toString () const
 Return a string describing the error.
std::string Aseba::SourcePos::toString () const
 Return the string version of this position.
virtual ReturnType Aseba::UnaryArithmeticNode::typeCheck () const
 Typecheck this node, throw an exception if there is any type violation.
virtual ReturnType Aseba::BinaryArithmeticNode::typeCheck () const
 Typecheck this node, throw an exception if there is any type violation.
virtual ReturnType Aseba::WhileNode::typeCheck () const
 Typecheck this node, throw an exception if there is any type violation.
virtual ReturnType Aseba::IfWhenNode::typeCheck () const
 Typecheck this node, throw an exception if there is any type violation.
virtual ReturnType Aseba::Node::typeCheck () const
 Typecheck this node, throw an exception if there is any type violation.
std::string Aseba::Node::typeName (const Node::ReturnType &type) const
 Return the name of a type.
 Aseba::UnaryArithmeticNode::UnaryArithmeticNode (const SourcePos &sourcePos, AsebaUnaryOperator op, Node *child)
 Constructor.
std::string Aseba::unaryOperatorToString (AsebaUnaryOperator op)
 Return the string corresponding to the unary operator.
bool Aseba::Compiler::verifyStackCalls (PreLinkBytecode &preLinkBytecode)
 Verify that no call path can create a stack overflow.
virtual Aseba::Node::~Node ()
 Destructor, delete all children.

Detailed Description


Typedef Documentation

typedef NamedValue Aseba::ConstantDefinition

An constant definition is a name - value pair.

Definition at line 172 of file compiler.h.

typedef NamedValuesVector Aseba::ConstantsDefinitions

Vector of constants definitions.

Definition at line 184 of file compiler.h.

typedef NamedValue Aseba::EventDescription

An event description is a name - value pair.

Definition at line 169 of file compiler.h.

typedef NamedValuesVector Aseba::EventsDescriptionsVector

Vector of events descriptions.

Definition at line 181 of file compiler.h.

typedef std::vector< short int > Aseba::VariablesDataVector

Vector of data of variables.

Definition at line 199 of file compiler.h.

typedef std::vector< std::string > Aseba::VariablesNamesVector

Vector of names of variables.

Definition at line 156 of file compiler.h.


Function Documentation

Aseba::ArrayReadNode::ArrayReadNode ( const SourcePos sourcePos,
unsigned  arrayAddr,
unsigned  arraySize,
const std::string &  arrayName 
) [inherited]

Constructor.

Definition at line 137 of file tree-build.cpp.

Aseba::ArrayWriteNode::ArrayWriteNode ( const SourcePos sourcePos,
unsigned  arrayAddr,
unsigned  arraySize,
const std::string &  arrayName 
) [inherited]

Constructor.

Definition at line 147 of file tree-build.cpp.

Aseba::BinaryArithmeticNode::BinaryArithmeticNode ( const SourcePos sourcePos,
AsebaBinaryOperator  op,
Node left,
Node right 
) [inherited]

Constructor.

Definition at line 76 of file tree-build.cpp.

std::string Aseba::binaryOperatorToString ( AsebaBinaryOperator  op  ) 

Return the string corresponding to the binary operator.

void Aseba::Compiler::buildMaps (  )  [protected, inherited]

Build variables and functions maps.

Definition at line 460 of file compiler.cpp.

Aseba::CallNode::CallNode ( const SourcePos sourcePos,
unsigned  funcId 
) [inherited]

Constructor.

Definition at line 157 of file tree-build.cpp.

Aseba::CallSubNode::CallSubNode ( const SourcePos sourcePos,
unsigned  subroutineId 
) [inherited]

Constructor.

Definition at line 68 of file tree-build.cpp.

bool Aseba::Compiler::compile ( std::istream &  source,
BytecodeVector bytecode,
unsigned &  allocatedVariablesCount,
Error errorDescription,
std::ostream *  dump = 0 
) [inherited]

Compile a new condition

Parameters:
source stream to read the source code from
bytecode destination array for bytecode
allocatedVariablesCount amount of allocated variables
errorDescription error is copied there on error
dump stream to send dump messages to
Returns:
returns true on success

Definition at line 85 of file compiler.cpp.

Aseba::Compiler::Compiler (  )  [inherited]

Constructor. You must setup a description using setTargetDescription() before any call to compile().

Definition at line 59 of file compiler.cpp.

bool Aseba::NamedValuesVector::contains ( const std::string &  s,
size_t *  position = 0 
) const [inherited]

Definition at line 44 of file compiler.cpp.

void Aseba::BinaryArithmeticNode::deMorganNotRemoval (  )  [inherited]

Recursively apply de Morgan law as long as nodes are logic operations, and then invert comparisons.

Definition at line 326 of file tree-optimize.cpp.

void Aseba::Compiler::disassemble ( BytecodeVector bytecode,
const PreLinkBytecode preLinkBytecode,
std::ostream &  dump 
) const [protected, inherited]

Disassemble a microcontroller bytecode and dump it.

Definition at line 288 of file compiler.cpp.

void Aseba::Node::dump ( std::ostream &  dest,
unsigned &  indent 
) const [virtual, inherited]

Dump this node and the rest of the tree.

Definition at line 76 of file tree-dump.cpp.

void Aseba::CallNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 411 of file tree-emit.cpp.

void Aseba::ArrayWriteNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 397 of file tree-emit.cpp.

void Aseba::ArrayReadNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 383 of file tree-emit.cpp.

void Aseba::StoreNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 376 of file tree-emit.cpp.

void Aseba::LoadNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 364 of file tree-emit.cpp.

void Aseba::ImmediateNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 340 of file tree-emit.cpp.

void Aseba::UnaryArithmeticNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 332 of file tree-emit.cpp.

void Aseba::BinaryArithmeticNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 318 of file tree-emit.cpp.

void Aseba::CallSubNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 310 of file tree-emit.cpp.

void Aseba::SubDeclNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 299 of file tree-emit.cpp.

void Aseba::EmitNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 290 of file tree-emit.cpp.

void Aseba::EventDeclNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 279 of file tree-emit.cpp.

void Aseba::FoldedWhileNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 220 of file tree-emit.cpp.

void Aseba::WhileNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 214 of file tree-emit.cpp.

void Aseba::FoldedIfWhenNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 129 of file tree-emit.cpp.

void Aseba::IfWhenNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 123 of file tree-emit.cpp.

void Aseba::AssignmentNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Definition at line 116 of file tree-emit.cpp.

void Aseba::ProgramNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Reimplemented from Aseba::BlockNode.

Definition at line 88 of file tree-emit.cpp.

void Aseba::BlockNode::emit ( PreLinkBytecode bytecodes  )  const [virtual, inherited]

Generate bytecode.

Implements Aseba::Node.

Reimplemented in Aseba::ProgramNode.

Definition at line 82 of file tree-emit.cpp.

Aseba::EventDeclNode::EventDeclNode ( const SourcePos sourcePos,
unsigned  eventId = 0 
) [inherited]

Constructor.

Definition at line 52 of file tree-build.cpp.

void Aseba::Node::expectType ( const Node::ReturnType expected,
const Node::ReturnType type 
) const [inherited]

Check for a specific type, throw an exception otherwise.

Definition at line 44 of file tree-typecheck.cpp.

void Aseba::PreLinkBytecode::fixup ( const Compiler::SubroutineTable subroutineTable  )  [inherited]

Fixup prelinked bytecodes by making sure that each vector is closed correctly, i.e. with a STOP for events and a RET for subroutines

Definition at line 42 of file tree-emit.cpp.

BinaryArithmeticNode * Aseba::BinaryArithmeticNode::fromAddExpression ( const SourcePos sourcePos,
Compiler::Token::Type  op,
Node left,
Node right 
) [static, inherited]

Create a binary arithmetic node for add/sub operation op.

Definition at line 107 of file tree-build.cpp.

BinaryArithmeticNode * Aseba::BinaryArithmeticNode::fromComparison ( const SourcePos sourcePos,
Compiler::Token::Type  op,
Node left,
Node right 
) [static, inherited]

Create a binary arithmetic node for comparaison operation op.

Definition at line 85 of file tree-build.cpp.

BinaryArithmeticNode * Aseba::BinaryArithmeticNode::fromMultExpression ( const SourcePos sourcePos,
Compiler::Token::Type  op,
Node left,
Node right 
) [static, inherited]

Create a binary arithmetic node for mult/div/mod operation op.

Definition at line 118 of file tree-build.cpp.

BinaryArithmeticNode * Aseba::BinaryArithmeticNode::fromShiftExpression ( const SourcePos sourcePos,
Compiler::Token::Type  op,
Node left,
Node right 
) [static, inherited]

Create a binary arithmetic node for shift operation op.

Definition at line 96 of file tree-build.cpp.

unsigned Aseba::CallNode::getStackDepth (  )  const [virtual, inherited]

Return the stack depth requirement for this node and its children.

Reimplemented from Aseba::Node.

Definition at line 443 of file tree-emit.cpp.

unsigned Aseba::LoadNode::getStackDepth (  )  const [virtual, inherited]

Return the stack depth requirement for this node and its children.

Reimplemented from Aseba::Node.

Definition at line 370 of file tree-emit.cpp.

unsigned Aseba::ImmediateNode::getStackDepth (  )  const [virtual, inherited]

Return the stack depth requirement for this node and its children.

Reimplemented from Aseba::Node.

Definition at line 358 of file tree-emit.cpp.

unsigned Aseba::BinaryArithmeticNode::getStackDepth (  )  const [virtual, inherited]

Return the stack depth requirement for this node and its children.

Reimplemented from Aseba::Node.

Definition at line 326 of file tree-emit.cpp.

unsigned Aseba::FoldedWhileNode::getStackDepth (  )  const [virtual, inherited]

Return the stack depth requirement for this node and its children.

Reimplemented from Aseba::Node.

Definition at line 271 of file tree-emit.cpp.

unsigned Aseba::FoldedIfWhenNode::getStackDepth (  )  const [virtual, inherited]

Return the stack depth requirement for this node and its children.

Reimplemented from Aseba::Node.

Definition at line 204 of file tree-emit.cpp.

unsigned Aseba::Node::getStackDepth (  )  const [virtual, inherited]

Return the stack depth requirement for this node and its children.

Reimplemented in Aseba::FoldedIfWhenNode, Aseba::FoldedWhileNode, Aseba::BinaryArithmeticNode, Aseba::ImmediateNode, Aseba::LoadNode, and Aseba::CallNode.

Definition at line 73 of file tree-emit.cpp.

template<typename T >
bool Aseba::isPOT ( number  )  [inline]

Return true if number is a power of two.

Definition at line 35 of file power-of-two.h.

bool Aseba::Compiler::link ( const PreLinkBytecode preLinkBytecode,
BytecodeVector bytecode 
) [protected, inherited]

Create the final bytecode for a microcontroller.

Definition at line 212 of file compiler.cpp.

Node * Aseba::CallNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 472 of file tree-optimize.cpp.

Node * Aseba::ArrayWriteNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 442 of file tree-optimize.cpp.

Node * Aseba::ArrayReadNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 412 of file tree-optimize.cpp.

Node * Aseba::StoreNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 407 of file tree-optimize.cpp.

Node * Aseba::LoadNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 402 of file tree-optimize.cpp.

Node * Aseba::ImmediateNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 397 of file tree-optimize.cpp.

Node * Aseba::UnaryArithmeticNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 352 of file tree-optimize.cpp.

Node * Aseba::BinaryArithmeticNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 250 of file tree-optimize.cpp.

Node * Aseba::CallSubNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 245 of file tree-optimize.cpp.

Node * Aseba::SubDeclNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 240 of file tree-optimize.cpp.

Node * Aseba::EmitNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 235 of file tree-optimize.cpp.

Node * Aseba::EventDeclNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 230 of file tree-optimize.cpp.

Node * Aseba::FoldedWhileNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 224 of file tree-optimize.cpp.

Node * Aseba::WhileNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 172 of file tree-optimize.cpp.

Node * Aseba::FoldedIfWhenNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 166 of file tree-optimize.cpp.

Node * Aseba::IfWhenNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 82 of file tree-optimize.cpp.

Node * Aseba::AssignmentNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 73 of file tree-optimize.cpp.

Node * Aseba::BlockNode::optimize ( std::ostream *  dump  )  [virtual, inherited]

Optimize this node, return the optimized node.

Implements Aseba::Node.

Definition at line 45 of file tree-optimize.cpp.

Aseba::PreLinkBytecode::PreLinkBytecode (  )  [inherited]

Add init event and point to currentBytecode it.

Definition at line 34 of file tree-emit.cpp.

void Aseba::Compiler::setCommonDefinitions ( const CommonDefinitions definitions  )  [inherited]

Set the common definitions, such as events or some constants.

Definition at line 73 of file compiler.cpp.

void Aseba::Compiler::setTargetDescription ( const TargetDescription description  )  [inherited]

Set the description of the target as returned by the microcontroller. You must call this function before any call to compile().

Definition at line 66 of file compiler.cpp.

template<typename T >
unsigned Aseba::shiftFromPOT ( number  )  [inline]

If number is a power of two, number = (1 << shift) and this function returns shift, otherwise return value is undefined.

Definition at line 46 of file power-of-two.h.

Aseba::SubDeclNode::SubDeclNode ( const SourcePos sourcePos,
unsigned  subroutineId 
) [inherited]

Constructor.

Definition at line 60 of file tree-build.cpp.

std::string Aseba::CallNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 186 of file tree-dump.cpp.

std::string Aseba::ArrayWriteNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 181 of file tree-dump.cpp.

std::string Aseba::ArrayReadNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 176 of file tree-dump.cpp.

std::string Aseba::StoreNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 171 of file tree-dump.cpp.

std::string Aseba::LoadNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 166 of file tree-dump.cpp.

std::string Aseba::ImmediateNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 161 of file tree-dump.cpp.

std::string Aseba::UnaryArithmeticNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 154 of file tree-dump.cpp.

std::string Aseba::BinaryArithmeticNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 147 of file tree-dump.cpp.

std::string Aseba::CallSubNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 142 of file tree-dump.cpp.

std::string Aseba::SubDeclNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 137 of file tree-dump.cpp.

std::string Aseba::EmitNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 129 of file tree-dump.cpp.

std::string Aseba::EventDeclNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 121 of file tree-dump.cpp.

std::string Aseba::FoldedWhileNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 114 of file tree-dump.cpp.

std::string Aseba::WhileNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 108 of file tree-dump.cpp.

std::string Aseba::FoldedIfWhenNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 97 of file tree-dump.cpp.

std::string Aseba::IfWhenNode::toString (  )  const [virtual, inherited]

Return a string representation of this node.

Implements Aseba::Node.

Definition at line 87 of file tree-dump.cpp.

std::string Aseba::Error::toString (  )  const [inherited]

Return a string describing the error.

Return the string version of this error.

Definition at line 33 of file errors.cpp.

std::string Aseba::SourcePos::toString (  )  const [inherited]

Return the string version of this position.

Definition at line 32 of file compiler.cpp.

Node::ReturnType Aseba::UnaryArithmeticNode::typeCheck (  )  const [virtual, inherited]

Typecheck this node, throw an exception if there is any type violation.

Reimplemented from Aseba::Node.

Definition at line 115 of file tree-typecheck.cpp.

Node::ReturnType Aseba::BinaryArithmeticNode::typeCheck (  )  const [virtual, inherited]

Typecheck this node, throw an exception if there is any type violation.

Reimplemented from Aseba::Node.

Definition at line 75 of file tree-typecheck.cpp.

Node::ReturnType Aseba::WhileNode::typeCheck (  )  const [virtual, inherited]

Typecheck this node, throw an exception if there is any type violation.

Reimplemented from Aseba::Node.

Definition at line 67 of file tree-typecheck.cpp.

Node::ReturnType Aseba::IfWhenNode::typeCheck (  )  const [virtual, inherited]

Typecheck this node, throw an exception if there is any type violation.

Reimplemented from Aseba::Node.

Definition at line 59 of file tree-typecheck.cpp.

Node::ReturnType Aseba::Node::typeCheck (  )  const [virtual, inherited]

Typecheck this node, throw an exception if there is any type violation.

Reimplemented in Aseba::IfWhenNode, Aseba::WhileNode, Aseba::BinaryArithmeticNode, Aseba::UnaryArithmeticNode, Aseba::ImmediateNode, Aseba::LoadNode, Aseba::ArrayReadNode, and Aseba::CallNode.

Definition at line 50 of file tree-typecheck.cpp.

std::string Aseba::Node::typeName ( const Node::ReturnType type  )  const [inherited]

Return the name of a type.

Definition at line 33 of file tree-typecheck.cpp.

Aseba::UnaryArithmeticNode::UnaryArithmeticNode ( const SourcePos sourcePos,
AsebaUnaryOperator  op,
Node child 
) [inherited]

Constructor.

Definition at line 129 of file tree-build.cpp.

std::string Aseba::unaryOperatorToString ( AsebaUnaryOperator  op  ) 

Return the string corresponding to the unary operator.

bool Aseba::Compiler::verifyStackCalls ( PreLinkBytecode preLinkBytecode  )  [protected, inherited]

Verify that no call path can create a stack overflow.

Definition at line 35 of file analysis.cpp.

Aseba::Node::~Node (  )  [virtual, inherited]

Destructor, delete all children.

Definition at line 43 of file tree-build.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


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