LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
Node that has a value, contrary to Stm. More...
#include <exp.hh>
Public Member Functions | |
Exp () | |
virtual | ~Exp () |
void | child_push_back (const rTree &tree) |
tree_list_type & | children_get () |
const tree_list_type & | children_get () const |
rTree & | child_get (int nth) |
rTree | child_get (int nth) const |
rTree & | left_get () |
rTree & | right_get () |
void | parent_get_assert () const |
Tree * | parent_get () |
const Tree * | parent_get () const |
void | parent_set (Tree *parent) |
void | replace_by (const rTree &tree) |
virtual std::ostream & | tag_print (std::ostream &o) const =0 |
Report on o the kind of this instruction. | |
virtual std::ostream & | dump (std::ostream &o) const |
Report this instruction on o. | |
temp::Temp & | asm_get () |
void | asm_set (const temp::Temp &temp) |
void * | state_get () const |
void *& | state_get () |
bool | reducible_get () const |
void | reducible_set (bool b) |
Protected Attributes | |
tree_list_type | children_ |
The arguments. | |
Tree * | parent_ = nullptr |
The Tree instruction this is a child from. | |
temp::Temp * | temp_ = nullptr |
The Temp for asm output. | |
void * | state_ = nullptr |
The state for asm output. | |
bool | reducible_ = true |
Tell if the tree is reducible. |
Kinds of Tree nodes. | |
virtual kind_tree_type | kind_get () const =0 |
The kind of this instruction. | |
enum | kind_tree_type { const_kind, name_kind, temp_kind, binop_kind, mem_kind, call_kind, eseq_kind, move_kind, sxp_kind, jump_kind, cjump_kind, seq_kind, label_kind } |
The kinds of Tree instuctions. More... |
|
inherited |
The kinds of Tree instuctions.
These flags are used to facilitate the pattern matching during instruction selection. This method is not very clean nevertheless this way is cleaner and more efficient than the use of dynamic_cast<>().
|
inline |
|
virtual |
|
inlineinherited |
References tree::Tree::temp_.
|
inlineinherited |
References tree::Tree::temp_.
|
inlineinherited |
References tree::Tree::children_, and postcondition.
Referenced by tree::Move::dst_get(), tree::Sxp::exp_get(), tree::Mem::exp_get(), tree::Jump::exp_get(), tree::Eseq::exp_get(), tree::Cjump::flip(), tree::Cjump::label_false_get(), tree::Jump::label_get(), tree::Cjump::label_true_get(), tree::Binop::left_get(), tree::Cjump::left_get(), tree::Tree::left_get(), tree::Binop::right_get(), tree::Cjump::right_get(), tree::Tree::right_get(), tree::Move::src_get(), and tree::Eseq::stm_get().
|
inlineinherited |
References tree::Tree::children_, and postcondition.
|
inlineinherited |
References tree::Tree::children_.
Referenced by tree::Binop::Binop(), tree::Call::Call(), tree::Cjump::Cjump(), tree::Eseq::Eseq(), tree::Jump::Jump(), tree::Mem::Mem(), tree::Move::Move(), tree::Seq::push_back(), and tree::Sxp::Sxp().
|
inlineinherited |
References tree::Tree::children_.
Referenced by canon::Canon::assemble_stm(), tree::Call::dump(), and tree::Seq::dump().
|
inlineinherited |
References tree::Tree::children_.
|
virtualinherited |
Report this instruction on o.
Reimplemented in tree::Seq, tree::Eseq, and tree::Call.
References tree::Tree::children_, misc::decindent(), misc::incendl(), and tree::Tree::tag_print().
Referenced by tree::operator<<().
|
pure virtualinherited |
The kind of this instruction.
Implemented in tree::Cjump, tree::Binop, tree::Seq, tree::Jump, tree::Eseq, tree::Move, tree::Mem, tree::Sxp, tree::Temp, tree::Call, tree::Label, tree::Name, and tree::Const.
|
inlineinherited |
References tree::Tree::child_get().
|
inlineinherited |
References tree::Tree::parent_.
|
inlineinherited |
References tree::Tree::parent_.
|
inherited |
References misc::decindent(), misc::incendl(), tree::Tree::parent_, and precondition.
Referenced by tree::Tree::replace_by().
|
inlineinherited |
References tree::Tree::parent_.
|
inlineinherited |
References tree::Tree::reducible_.
|
inlineinherited |
References tree::Tree::children_, and tree::Tree::reducible_.
|
inherited |
|
inlineinherited |
References tree::Tree::child_get().
|
inlineinherited |
References tree::Tree::state_.
|
inlineinherited |
References tree::Tree::state_.
|
pure virtualinherited |
Report on o the kind of this instruction.
Implemented in tree::Cjump, tree::Binop, tree::Seq, tree::Jump, tree::Eseq, tree::Move, tree::Mem, tree::Sxp, tree::Temp, tree::Call, tree::Label, tree::Name, and tree::Const.
Referenced by tree::Tree::dump().
|
protectedinherited |
|
protectedinherited |
The Tree instruction this is a child from.
Referenced by tree::Tree::parent_get(), tree::Tree::parent_get_assert(), tree::Tree::parent_set(), and tree::Tree::replace_by().
|
protectedinherited |
Tell if the tree is reducible.
Referenced by tree::Tree::reducible_get(), and tree::Tree::reducible_set().
|
protectedinherited |
The state for asm output.
Referenced by tree::Tree::state_get().
|
protectedinherited |
The Temp for asm output.
Referenced by tree::Tree::asm_get(), tree::Tree::asm_set(), and tree::Tree::~Tree().