mjplusplus  v0.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
ast::pe::Bool Class Reference

#include <PrimaryExpression.hpp>

Inheritance diagram for ast::pe::Bool:
ast::pe::PrimaryExpression ast::Expression ast::Node ast::PositionAwareNode

Public Member Functions

 Bool (bool value, source_position_t position)
 
virtual void toString (std::ostream &out, unsigned int, bool=false) const
 
virtual shptr< Typeget_type (semantic::SemanticAnalysis &sa, shptr< semantic::symbol::SymbolTable > symbolTable) const
 
virtual bool isLValue () const
 
virtual std::pair< bool, bool > constBool () const
 
virtual bool getValue () const
 
virtual void accept (ASTVisitor &visitor) const
 
- Public Member Functions inherited from ast::pe::PrimaryExpression
 PrimaryExpression (source_position_t position)
 
virtual bool standalone () const
 
- Public Member Functions inherited from ast::Expression
 Expression (source_position_t position)
 
- Public Member Functions inherited from ast::PositionAwareNode
source_position_t getPosition () const
 
 PositionAwareNode (lexer::Token const &token)
 
 PositionAwareNode (source_position_t const &position)
 

Additional Inherited Members

- Protected Attributes inherited from ast::PositionAwareNode
source_position_t position
 

Constructor & Destructor Documentation

ast::pe::Bool::Bool ( bool  value,
source_position_t  position 
)

Member Function Documentation

void ast::pe::Bool::accept ( ASTVisitor visitor) const
virtual

Reimplemented from ast::Expression.

std::pair< bool, bool > ast::pe::Bool::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.

Reimplemented from ast::pe::PrimaryExpression.

shptr< Type > ast::pe::Bool::get_type ( semantic::SemanticAnalysis sa,
shptr< semantic::symbol::SymbolTable symbolTable 
) const
virtual

Idea: When getting the type of an Expression, the Expression checks if it's own and it's children Expressions type definitions are valid and then returns it's type. If something is invalid, an error is printed in the Expression that is invalid and an empty pointer is returned.

Implements ast::Expression.

bool ast::pe::Bool::getValue ( ) const
virtual
bool ast::pe::Bool::isLValue ( ) const
virtual

Implements ast::Expression.

void ast::pe::Bool::toString ( std::ostream &  out,
unsigned  indent,
bool  special = false 
) const
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.


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