LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
Natural representation for conditionals. More...
#include <exp.hh>
Public Member Functions | |
Cx (tree::Cjump::Relop op, const tree::rExp &left, const tree::rExp &right) | |
virtual tree::rExp | un_ex () override |
To convert a conditional into an expression means return 0 or 1. | |
virtual tree::rStm | un_nx () override |
Pretend THIS was an Nx: return the statement part. | |
virtual tree::rStm | un_cx (const temp::Label &t, const temp::Label &f) override |
Pretend THIS was a Cx: return the branching such that the resulting code jump to t if the conditional is satisfied, f otherwise. | |
virtual std::ostream & | dump (std::ostream &ostr) const override |
Private Attributes | |
tree::Cjump::Relop | op_ |
tree::rExp | left_ |
tree::rExp | right_ |
Natural representation for conditionals.
|
inline |
|
overridevirtual |
Implements translate::Exp.
|
overridevirtual |
Pretend THIS was a Cx: return the branching such that the resulting code jump to t if the conditional is satisfied, f otherwise.
Implements translate::Exp.
References left_, op_, and right_.
Referenced by translate::Ex::un_cx().
|
overridevirtual |
To convert a conditional into an expression means return 0 or 1.
Implements translate::Exp.
|
overridevirtual |
Pretend THIS was an Nx: return the statement part.
Implements translate::Exp.
|
private |