Public Member Functions | Static Public Member Functions | Public Attributes
Aseba::BinaryArithmeticNode Struct Reference

#include <tree.h>

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

List of all members.

Public Member Functions

 BinaryArithmeticNode (const SourcePos &sourcePos)
 BinaryArithmeticNode (const SourcePos &sourcePos, AsebaBinaryOperator op, Node *left, Node *right)
 Constructor.
void deMorganNotRemoval ()
 Recursively apply de Morgan law as long as nodes are logic operations, and then invert comparisons.
virtual void emit (PreLinkBytecode &bytecodes) const
 Generate bytecode.
virtual NodeexpandToAsebaTree (std::wostream *dump, unsigned int index=0)
 expand to left[index] (op) right[index]
virtual unsigned getStackDepth () const
 Return the stack depth requirement for this node and its children.
virtual Nodeoptimize (std::wostream *dump)
 Optimize this node, return the optimized node.
virtual BinaryArithmeticNodeshallowCopy ()
 Return a shallow copy of the object (children point to the same objects)
virtual std::wstring toNodeName () const
 Return a string representation of the name of this node.
virtual std::wstring toWString () const
 Return a string representation of this node.
virtual ReturnType typeCheck () const
 Typecheck this node, throw an exception if there is any type violation.

Static Public Member Functions

static BinaryArithmeticNodefromAddExpression (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)
 Create a binary arithmetic node for add/sub operation op.
static BinaryArithmeticNodefromBinaryExpression (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)
 Create a binary arithmetic node for or/xor/and operation op.
static BinaryArithmeticNodefromComparison (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)
 Create a binary arithmetic node for comparaison operation op.
static BinaryArithmeticNodefromMultExpression (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)
 Create a binary arithmetic node for mult/div/mod operation op.
static BinaryArithmeticNodefromShiftExpression (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)
 Create a binary arithmetic node for shift operation op.

Public Attributes

AsebaBinaryOperator op
 operator

Detailed Description

Node for binary arithmetic. children[0] is left expression children[1] is right expression

Definition at line 295 of file tree.h.


Constructor & Destructor Documentation

Definition at line 299 of file tree.h.


Member Function Documentation

Node * Aseba::BinaryArithmeticNode::expandToAsebaTree ( std::wostream *  dump,
unsigned int  index = 0 
) [virtual]

expand to left[index] (op) right[index]

Reimplemented from Aseba::Node.

Definition at line 69 of file tree-expand.cpp.

Return a shallow copy of the object (children point to the same objects)

Implements Aseba::Node.

Definition at line 301 of file tree.h.

virtual std::wstring Aseba::BinaryArithmeticNode::toNodeName ( ) const [inline, virtual]

Return a string representation of the name of this node.

Implements Aseba::Node.

Definition at line 311 of file tree.h.


Member Data Documentation

operator

Definition at line 297 of file tree.h.


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


aseba
Author(s): Stéphane Magnenat
autogenerated on Sun Oct 5 2014 23:46:39