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

#include <Expression.hpp>

Inheritance diagram for ast::Expression:
ast::Node ast::PositionAwareNode ast::be::BinaryExpression ast::pe::PrimaryExpression ast::po::PostfixExpression ast::ue::UnaryExpression 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 ast::pe::Bool ast::pe::Ident ast::pe::Integer ast::pe::MethodInvocation ast::pe::NewArrayExpression ast::pe::NewObjectExpression ast::pe::Object ast::ue::Neg ast::ue::Not

Public Member Functions

 Expression (source_position_t position)
 
virtual shptr< Typeget_type (semantic::SemanticAnalysis &sa, shptr< semantic::symbol::SymbolTable > symbolTable) const =0
 
virtual bool isLValue () const =0
 
virtual bool standalone () const =0
 
virtual std::pair< bool, bool > constBool () const =0
 
virtual void accept (ASTVisitor &visitor) const
 
- Public Member Functions inherited from ast::Node
virtual void toString (std::ostream &out, unsigned int indent, bool special=false) const =0
 
- 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::Expression::Expression ( source_position_t  position)

Member Function Documentation

void ast::Expression::accept ( ASTVisitor visitor) const
virtual
virtual std::pair<bool, bool> ast::Expression::constBool ( ) const
pure 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.

Implemented in ast::be::OrOr, ast::be::AndAnd, ast::be::EqEq, ast::ue::Not, ast::ue::UnaryExpression, ast::be::NotEq, ast::pe::Bool, ast::be::BinaryExpression, ast::po::PostfixExpression, and ast::pe::PrimaryExpression.

virtual shptr<Type> ast::Expression::get_type ( semantic::SemanticAnalysis sa,
shptr< semantic::symbol::SymbolTable symbolTable 
) const
pure 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.

Implemented in ast::be::Invalid, ast::be::OrOr, ast::be::AndAnd, ast::be::Mod, ast::be::GreaterThan, ast::be::GreaterThanEq, ast::be::Eq, ast::pe::MethodInvocation, ast::be::EqEq, ast::be::LessThan, ast::pe::NewObjectExpression, ast::be::LessThanEq, ast::pe::NewArrayExpression, ast::be::Slash, ast::pe::Integer, ast::be::Minus, ast::pe::Object, ast::ue::Neg, ast::be::Plus, ast::ue::Not, ast::be::Mult, ast::pe::Ident, ast::be::NotEq, ast::pe::Bool, and ast::po::PostfixExpression.

virtual bool ast::Expression::isLValue ( ) const
pure virtual
virtual bool ast::Expression::standalone ( ) const
pure virtual

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