mjplusplus
v0.4.1
|
#include <StatementVisitor.hpp>
Public Member Functions | |
StatementVisitor (MemberVisitor &memberVisitor) | |
virtual void | visit (shptr< const ast::stmt::IfStatement > ifStatement) |
virtual void | visit (shptr< const ast::stmt::WhileStatement > whileStmt) |
virtual void | visit (shptr< const ast::stmt::ReturnStatement > returnStmt) |
virtual void | visit (shptr< const ast::stmt::Block > blockStmt) |
virtual void | visit (shptr< const ast::stmt::ExpressionStatement > exprStmt) |
virtual void | visit (shptr< const ast::stmt::LVDStatement > lvdStmt) |
![]() | |
FirmVisitor () | |
virtual void | setOwner (ir_type *owner) |
virtual ir_type * | getOwner () const |
![]() | |
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< FieldDeclaration 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< TypeIdent 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 | visitThenOrElse (ir_node *thenOrElseBlock, shptr< const ast::stmt::Statement > thenOrElseStmt, ir_node *exitBlock) |
Protected Attributes | |
MemberVisitor & | memberVisitor |
![]() | |
ir_type * | owner |
firm::visitor::StatementVisitor::StatementVisitor | ( | MemberVisitor & | memberVisitor | ) |
Constrcuts a StatementVisitor with the given MemberVisitor. Sets the owner to the MemberVisitor's owner.
memberVisitor | the given MemberVisitor |
|
virtual |
Evaluates the condition of the visited IfStatement using a BoolExpressionVisitor and then evaluates the BlockStatement of the then and/or else-blocks. Afterwards it matures and sets the current block accordingly.
ifStatement | the visited IfStatement |
|
virtual |
Evaluates the condition of the visited WhileStatement using a BoolExpressionVisitor and then evaluates the WhileStatement's BlockStatment. Afterwards it matures and sets the current block accordingly. To prevent issues with infinite loops, the while-condition block is kept alive.
whileStmt | the visited WhileStatement |
|
virtual |
Creates a Return node using the visited ReturnStatement by evaluating its expression using an ExpressionVisitor. This Return node is used as "end node" of the current function graph.
returnStmt | the visited ReturnStatement |
|
virtual |
Iterates over the statements in the visited Block.
blockStmt | the visited Block |
|
virtual |
Evaluates the expression of the visited ExpressionStatement using an ExpressionVisitor.
exprStmt | the visited ExpressionStatement |
|
virtual |
Retrieves the variables position in the current context from the FirmInterface based on the visited LVDStatement's name. If the LVDStatement has an initialization, the value at the variable's position is set to the value of the initialization's expression. This is evaluated using an ExpressionVisitor. If there is no initialization, then the value is set to a null-node.
lvdStmt | the visited LVDStatement |
|
protected |
Create, mature and set as current a firm block for a then or else statement
thenOrElseStmt | The then or else statement of an ast::IfStatement |
precedingProjection | The Firm projection node to use as predecessor for the then/else block |
exitBlock | The exitBlock to use as successor for the Jump node |
|
protected |
The calling MemberVisitor