mjplusplus  v0.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
firm::visitor::VariableDeclVisitor Class Reference

#include <VariableDeclVisitor.hpp>

Inheritance diagram for firm::visitor::VariableDeclVisitor:
firm::visitor::VisitorWithResultNode firm::visitor::FirmVisitor ast::ASTVisitor

Public Member Functions

 VariableDeclVisitor (ir_node *current_this)
 
virtual void visit (shptr< ast::FieldDeclaration const > fieldDeclaration)
 
virtual void visit (shptr< ast::stmt::LVDStatement const > lvdStatement)
 
virtual void visit (shptr< ast::TypeIdent const > typeIdent)
 
- Public Member Functions inherited from firm::visitor::VisitorWithResultNode
 VisitorWithResultNode ()
 
ir_node * getResultNode () const
 
ir_type * getResultType () const
 
void setDoStore (bool s)
 
int getVarNum () const
 
- Public Member Functions inherited from firm::visitor::FirmVisitor
 FirmVisitor ()
 
virtual void setOwner (ir_type *owner)
 
virtual ir_type * getOwner () const
 
- Public Member Functions inherited from ast::ASTVisitor
virtual void visit (shptr< Node const > node)
 
virtual void visit (shptr< Arguments const > node)
 
virtual void visit (shptr< be::BinaryExpression const > node)
 
virtual void visit (shptr< be::AndAnd const > node)
 
virtual void visit (shptr< be::Eq const > node)
 
virtual void visit (shptr< be::EqEq const > node)
 
virtual void visit (shptr< be::GreaterThan const > node)
 
virtual void visit (shptr< be::GreaterThanEq const > node)
 
virtual void visit (shptr< be::Invalid const > node)
 
virtual void visit (shptr< be::LessThan const > node)
 
virtual void visit (shptr< be::LessThanEq const > node)
 
virtual void visit (shptr< be::Minus const > node)
 
virtual void visit (shptr< be::Mod const > node)
 
virtual void visit (shptr< be::Mult const > node)
 
virtual void visit (shptr< be::NotEq const > node)
 
virtual void visit (shptr< be::OrOr const > node)
 
virtual void visit (shptr< be::Plus const > node)
 
virtual void visit (shptr< be::Slash const > node)
 
virtual void visit (shptr< ClassDeclaration const > node)
 
virtual void visit (shptr< ClassMember const > node)
 
virtual void visit (shptr< Expression const > node)
 
virtual void visit (shptr< Ident const > node)
 
virtual void visit (shptr< MainMethodDeclaration const > node)
 
virtual void visit (shptr< MethodDeclaration const > node)
 
virtual void visit (shptr< pe::PrimaryExpression const > node)
 
virtual void visit (shptr< pe::Bool const > node)
 
virtual void visit (shptr< pe::Ident const > node)
 
virtual void visit (shptr< pe::Integer const > node)
 
virtual void visit (shptr< pe::MethodInvocation const > node)
 
virtual void visit (shptr< pe::NewArrayExpression const > node)
 
virtual void visit (shptr< pe::NewObjectExpression const > node)
 
virtual void visit (shptr< pe::Object const > node)
 
virtual void visit (shptr< po::PostfixExpression const > node)
 
virtual void visit (shptr< po::PostfixOp const > node)
 
virtual void visit (shptr< po::ArrayAccess const > node)
 
virtual void visit (shptr< po::FieldAccess const > node)
 
virtual void visit (shptr< po::MethodInvocation const > node)
 
virtual void visit (shptr< Program const > node)
 
virtual void visit (shptr< stmt::Statement const > node)
 
virtual void visit (shptr< stmt::Block const > node)
 
virtual void visit (shptr< stmt::ExpressionStatement const > node)
 
virtual void visit (shptr< stmt::IfStatement const > node)
 
virtual void visit (shptr< stmt::LVDStatement const > node)
 
virtual void visit (shptr< stmt::ReturnStatement const > node)
 
virtual void visit (shptr< stmt::WhileStatement const > node)
 
virtual void visit (shptr< Type const > node)
 
virtual void visit (shptr< ue::UnaryExpression const > node)
 
virtual void visit (shptr< ue::Neg const > node)
 
virtual void visit (shptr< ue::Not const > node)
 

Protected Member Functions

void visitLVDStatementOrTypeIdent (shptr< ast::VariableDeclaration const > variableDeclaration, std::string varName)
 

Protected Attributes

ir_node * current_this
 
ir_node * store_value
 
- Protected Attributes inherited from firm::visitor::VisitorWithResultNode
ir_node * resultNode
 
ir_type * resultType
 
bool doStore
 
int varNum
 
- Protected Attributes inherited from firm::visitor::FirmVisitor
ir_type * owner
 

Constructor & Destructor Documentation

firm::visitor::VariableDeclVisitor::VariableDeclVisitor ( ir_node *  current_this)

Constructs a VariableDeclVisitor with a current this node.

Parameters
thecurrent this node

Member Function Documentation

void firm::visitor::VariableDeclVisitor::visit ( shptr< ast::FieldDeclaration const >  fieldDeclaration)
virtual

Accesses the field that belongs to the visited FieldDeclaration. Sets the resultNode and -Type to the node and type of the field entity.

Parameters
fieldDeclarationthe visited FieldDeclaration

Reimplemented from ast::ASTVisitor.

void firm::visitor::VariableDeclVisitor::visit ( shptr< ast::stmt::LVDStatement const >  lvdStatement)
virtual

Evaluates the visited LVDStatement by retrieving the variables position and type in the current context from the FirmInterface based on the variable's name/type. If doStore, then varNum is set to position. Else the returnNode is set to the value at the position.

Parameters
lvdStatementthe visited LVDStatement
See also
FirmInterface
VariableDeclVisitor::visitLVDStatementOrTypeIdent
void firm::visitor::VariableDeclVisitor::visit ( shptr< ast::TypeIdent const >  typeIdent)
virtual

Evaluates the visited TypeIdent by retrieving the variables position and type in the current context from the FirmInterface based on the variable's name/type. If doStore, then varNum is set to position. Else the returnNode is set to the value at the position.

Parameters
typeIdentthe visited TypeIdent
See also
FirmInterface
VariableDeclVisitor::visitLVDStatementOrTypeIdent

Reimplemented from ast::ASTVisitor.

void firm::visitor::VariableDeclVisitor::visitLVDStatementOrTypeIdent ( shptr< ast::VariableDeclaration const >  variableDeclaration,
std::string  varName 
)
protected

Evaluates the given VariableDeclaration by retrieving the variables position and type in the current context from the FirmInterface based on the variable's name/type. If doStore, then varNum is set to position. Else the returnNode is set to the value at the position.

Parameters
variableDeclarationthe given VariableDeclaration
varNamethe variable's name
See also
FirmInterface

Member Data Documentation

ir_node* firm::visitor::VariableDeclVisitor::current_this
protected

the current this node

ir_node* firm::visitor::VariableDeclVisitor::store_value
protected

the store value


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