mjplusplus  v0.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ast::be::BinaryExpression Class Referenceabstract

#include <BinaryExpression.hpp>

Inheritance diagram for ast::be::BinaryExpression:
ast::Expression ast::Node ast::PositionAwareNode ast::be::AndAnd ast::be::Eq ast::be::EqEq ast::be::GreaterThan ast::be::GreaterThanEq ast::be::Invalid ast::be::LessThan ast::be::LessThanEq ast::be::Minus ast::be::Mod ast::be::Mult ast::be::NotEq ast::be::OrOr ast::be::Plus ast::be::Slash

Public Member Functions

virtual bool isLValue () const
 
virtual bool standalone () const
 
virtual std::pair< bool, bool > constBool () const
 
shptr< ExpressiongetLeftChild () const
 
shptr< ExpressiongetRightChild () const
 
- Public Member Functions inherited from ast::Expression
 Expression (source_position_t position)
 
virtual shptr< Typeget_type (semantic::SemanticAnalysis &sa, shptr< semantic::symbol::SymbolTable > symbolTable) const =0
 
virtual void accept (ASTVisitor &visitor) const
 
- Public Member Functions inherited from ast::PositionAwareNode
source_position_t getPosition () const
 
 PositionAwareNode (lexer::Token const &token)
 
 PositionAwareNode (source_position_t const &position)
 

Static Public Member Functions

static shptr< BinaryExpressioncreateBinaryExpr (shptr< Expression > leftChild, shptr< Expression > rightChild, lexer::Token::Token_type operator_type)
 

Protected Member Functions

void toString (std::ostream &out, unsigned int indent, std::string op, bool special=false) const
 
virtual void toString (std::ostream &out, unsigned int indent, bool special=false) const =0
 
 BinaryExpression (shptr< Expression > leftChild, shptr< Expression > rightChild)
 

Protected Attributes

shptr< ExpressionleftChild
 
shptr< ExpressionrightChild
 
- Protected Attributes inherited from ast::PositionAwareNode
source_position_t position
 

Constructor & Destructor Documentation

ast::be::BinaryExpression::BinaryExpression ( shptr< Expression leftChild,
shptr< Expression rightChild 
)
protected

Member Function Documentation

std::pair< bool, bool > ast::be::BinaryExpression::constBool ( ) const
virtual

Special while check for definite return analysis: Return a pair<bool,bool>. The first bool signifies whether it is a constant bool expression, and in this case, the second bool is the result.

Implements ast::Expression.

Reimplemented in ast::be::OrOr, ast::be::AndAnd, ast::be::EqEq, and ast::be::NotEq.

shptr< BinaryExpression > ast::be::BinaryExpression::createBinaryExpr ( shptr< Expression leftChild,
shptr< Expression rightChild,
lexer::Token::Token_type  operator_type 
)
static
shptr< Expression > ast::be::BinaryExpression::getLeftChild ( ) const
shptr< Expression > ast::be::BinaryExpression::getRightChild ( ) const
bool ast::be::BinaryExpression::isLValue ( ) const
virtual

Implements ast::Expression.

bool ast::be::BinaryExpression::standalone ( ) const
virtual

Implements ast::Expression.

Reimplemented in ast::be::Eq.

void ast::be::BinaryExpression::toString ( std::ostream &  out,
unsigned int  indent,
std::string  op,
bool  special = false 
) const
protected
virtual void ast::be::BinaryExpression::toString ( std::ostream &  out,
unsigned int  indent,
bool  special = false 
) const
protectedpure virtual

writes a representation of the Node to out, including all children. special invokes "special" behavior for certain nodes MethodDeclaration: print static keyword Block & If: skip indentation Expression: don't print surrounding parens in addition Block doesn't print newline after trailing } if ~indent is passed instead of indent

Implements ast::Node.

Implemented in ast::be::Invalid, ast::be::OrOr, ast::be::AndAnd, ast::be::Mod, ast::be::GreaterThan, ast::be::GreaterThanEq, ast::be::Eq, ast::be::EqEq, ast::be::LessThan, ast::be::LessThanEq, ast::be::Slash, ast::be::Minus, ast::be::Plus, ast::be::Mult, and ast::be::NotEq.

Member Data Documentation

shptr<Expression> ast::be::BinaryExpression::leftChild
protected
shptr<Expression> ast::be::BinaryExpression::rightChild
protected

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