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

#include <UnaryExpression.hpp>

Inheritance diagram for ast::ue::Neg:
ast::ue::UnaryExpression ast::Expression ast::Node ast::PositionAwareNode

Public Member Functions

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

- Static Public Member Functions inherited from ast::ue::UnaryExpression
static shptr< ExpressioncreateUnaryExpr (shptr< Expression > child, shptr< vec< lexer::Token::Token_type >> operator_types)
 
- Protected Types inherited from ast::ue::UnaryExpression
enum  Unary_Operator { UNARY_NOT, UNARY_MINUS }
 
- Protected Member Functions inherited from ast::ue::UnaryExpression
 UnaryExpression (shptr< Expression > child, int size)
 
void toString (std::ostream &out, unsigned int indent, std::string op, bool special=false) const
 
- Protected Attributes inherited from ast::ue::UnaryExpression
shptr< Expressionchild
 
int size
 
- Protected Attributes inherited from ast::PositionAwareNode
source_position_t position
 

Constructor & Destructor Documentation

ast::ue::Neg::Neg ( shptr< Expression child,
int  size 
)

Member Function Documentation

void ast::ue::Neg::accept ( ASTVisitor visitor) const
virtual

Reimplemented from ast::Expression.

shptr< Type > ast::ue::Neg::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.

void ast::ue::Neg::toString ( std::ostream &  out,
unsigned int  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::ue::UnaryExpression.


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