IfNode Class Reference

#include <IfNode.h>

Inheritance diagram for IfNode:

UniNode Node PrintHelperNode List of all members.

Public Types

 I_IF = 0
 I_IF_ELSE
 I_IF_ELSE_IF
 I_ELSE_IF
 I_ELSE_IF_ELSE
 I_ELSE
enum  iftype {
  I_IF = 0, I_IF_ELSE, I_IF_ELSE_IF, I_ELSE_IF,
  I_ELSE_IF_ELSE, I_ELSE
}

Public Member Functions

 IfNode (const iftype newItype, const uint32 newTargetOffset)
 IfNode (const uint32 opcode, const uint32 offset, const uint32 newTargetOffset)
 ~IfNode ()
void print_unk (Console &o, const uint32 isize) const
void print_asm (Console &o) const
void print_bin (ODequeDataSource &o) const
bool fold (DCUnit *unit, std::deque< Node * > &nodes)
bool fold_else (DCUnit *unit, std::deque< Node * > &nodes)
uint32 TargetOffset () const
void AddJmp (EndNode *jmp)
std::deque< Node * > & nodes ()
IfNodeelsen ()
void setAddSP (DCCallPostfixNode *newAddSP)

Public Attributes

iftype itype
IfNodeelsenode

Protected Attributes

std::deque< Node * > ifnodes

Private Attributes

uint32 targetOffset
EndNodejmpnode
DCCallPostfixNodeaddSP

Detailed Description

Definition at line 59 of file IfNode.h.


Member Enumeration Documentation

enum IfNode::iftype

Enumerator:
I_IF 
I_IF_ELSE 
I_IF_ELSE_IF 
I_ELSE_IF 
I_ELSE_IF_ELSE 
I_ELSE 

Definition at line 62 of file IfNode.h.


Constructor & Destructor Documentation

IfNode::IfNode ( const iftype  newItype,
const uint32  newTargetOffset 
) [inline]

Definition at line 64 of file IfNode.h.

IfNode::IfNode ( const uint32  opcode,
const uint32  offset,
const uint32  newTargetOffset 
) [inline]

Definition at line 68 of file IfNode.h.

References acceptOp(), I_IF, and itype.

IfNode::~IfNode (  )  [inline]

Definition at line 79 of file IfNode.h.


Member Function Documentation

void IfNode::AddJmp ( EndNode jmp  )  [inline]

Definition at line 94 of file IfNode.h.

References jmpnode.

IfNode* IfNode::elsen (  )  [inline]

Definition at line 97 of file IfNode.h.

bool IfNode::fold ( DCUnit unit,
std::deque< Node * > &  nodes 
) [virtual]

Implements Node.

Definition at line 200 of file IfNode.cpp.

References Node::fold_linenum(), UniNode::grab_n(), I_ELSE_IF, I_ELSE_IF_ELSE, I_IF, I_IF_ELSE, I_IF_ELSE_IF, ifnodes, itype, jmpnode, n, UniNode::node, and print_assert().

bool IfNode::fold_else ( DCUnit unit,
std::deque< Node * > &  nodes 
)

Definition at line 275 of file IfNode.cpp.

References I_ELSE, ifnodes, itype, print_assert(), and TargetOffset().

std::deque<Node *>& IfNode::nodes (  )  [inline]

Definition at line 96 of file IfNode.h.

References ifnodes.

void IfNode::print_asm ( Console o  )  const [virtual]

Reimplemented from Node.

Definition at line 130 of file IfNode.cpp.

References Node::_offset, I_ELSE, I_ELSE_IF, I_ELSE_IF_ELSE, I_IF, I_IF_ELSE, I_IF_ELSE_IF, ifnodes, itype, jmpnode, UniNode::node, EndNode::print_asm(), Node::print_asm(), Node::print_linenum_asm(), Console::Putchar(), Node::rtype(), Type::T_INVALID, and targetOffset.

void IfNode::print_bin ( ODequeDataSource o  )  const [virtual]

Implements Node.

Definition at line 172 of file IfNode.cpp.

References Node::_offset, I_ELSE_IF, I_ELSE_IF_ELSE, I_IF, I_IF_ELSE, I_IF_ELSE_IF, ifnodes, itype, jmpnode, UniNode::node, EndNode::print_bin(), Node::print_bin(), Node::print_linenum_bin(), Node::rtype(), Type::T_INVALID, targetOffset, ODequeDataSource::write1(), and ODequeDataSource::write2().

void IfNode::print_unk ( Console o,
const uint32  isize 
) const [virtual]

Implements Node.

Definition at line 36 of file IfNode.cpp.

References elsenode, I_ELSE, I_ELSE_IF, I_ELSE_IF_ELSE, I_IF, I_IF_ELSE, I_IF_ELSE_IF, ifnodes, indent(), itype, jmpnode, UniNode::node, Console::Print(), Node::print_linenum_unk(), EndNode::print_unk(), Node::print_unk(), Console::Printf(), Console::Putchar(), Node::rtype(), Type::T_INVALID, and targetOffset.

void IfNode::setAddSP ( DCCallPostfixNode newAddSP  )  [inline]

Definition at line 114 of file IfNode.h.

References addSP.

uint32 IfNode::TargetOffset (  )  const [inline]

Definition at line 87 of file IfNode.h.

References jmpnode, targetOffset, and EndNode::TargetOffset().

Referenced by fold_else().


Member Data Documentation

DCCallPostfixNode* IfNode::addSP [private]

Definition at line 122 of file IfNode.h.

Referenced by setAddSP().

IfNode* IfNode::elsenode

Definition at line 124 of file IfNode.h.

Referenced by print_unk().

std::deque<Node *> IfNode::ifnodes [protected]

Definition at line 114 of file IfNode.h.

Referenced by fold(), fold_else(), nodes(), print_asm(), print_bin(), and print_unk().

iftype IfNode::itype

Definition at line 97 of file IfNode.h.

Referenced by fold(), fold_else(), IfNode(), print_asm(), print_bin(), and print_unk().

EndNode* IfNode::jmpnode [private]

Definition at line 121 of file IfNode.h.

Referenced by AddJmp(), fold(), print_asm(), print_bin(), print_unk(), and TargetOffset().

uint32 IfNode::targetOffset [private]

Definition at line 120 of file IfNode.h.

Referenced by print_asm(), print_bin(), print_unk(), and TargetOffset().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:29:23 2007 for pentagram by  doxygen 1.4.7