LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
#include <op-exp.hh>
Public Types | |
enum | Oper { add, sub, mul, div, eq, ne, lt, le, gt, ge } |
Operator qualifier. More... |
Public Member Functions | |
Ctor & dtor. | |
OpExp (const Location &location, Exp *left, OpExp::Oper oper, Exp *right) | |
Construct an OpExp node. | |
virtual | ~OpExp () |
Destroy an OpExp node. | |
Visitors entry point. | |
virtual void | accept (ConstVisitor &v) const override |
Accept a const visitor v. | |
virtual void | accept (Visitor &v) override |
Accept a non-const visitor v. | |
Accessors. | |
const Exp & | left_get () const |
Return left operand. | |
Exp & | left_get () |
Return left operand. | |
OpExp::Oper | oper_get () const |
Return operator. | |
const Exp & | right_get () const |
Return right operand. | |
Exp & | right_get () |
Return right operand. | |
Accessors. | |
const Location & | location_get () const |
Return scanner position information. | |
void | location_set (const Location &) |
Set scanner position information. |
Protected Attributes | |
Exp * | left_ |
Left operand. | |
OpExp::Oper | oper_ |
Operator. | |
Exp * | right_ |
Right operand. | |
Location | location_ |
Scanner position information. |
enum ast::OpExp::Oper |
ast::OpExp::OpExp | ( | const Location & | location, |
Exp * | left, | ||
OpExp::Oper | oper, | ||
Exp * | right | ||
) |
Construct an OpExp node.
|
overridevirtual |
Accept a const visitor v.
Implements ast::Exp.
|
overridevirtual |
Accept a non-const visitor v.
Implements ast::Exp.
|
inline |
Return left operand.
References left_.
Referenced by astclone::Cloner::operator()(), and translate::Translator::operator()().
|
inlineinherited |
Return scanner position information.
References ast::Ast::location_.
Referenced by type::TypeChecker::error(), object::DesugarVisitor::operator()(), astclone::Cloner::operator()(), ast::DecsList::push_back(), ast::DecsList::push_front(), and type::TypeChecker::type_mismatch().
|
inlineinherited |
Set scanner position information.
References ast::Ast::location_.
|
inline |
|
inline |
Return right operand.
References right_.
Referenced by astclone::Cloner::operator()(), and translate::Translator::operator()().
|
protected |
Left operand.
Referenced by left_get(), and ~OpExp().
|
protectedinherited |
Scanner position information.
Referenced by ast::Ast::location_get(), ast::Ast::location_set(), ast::DecsList::push_back(), and ast::DecsList::push_front().
|
protected |
Operator.
Referenced by oper_get().
|
protected |
Right operand.
Referenced by right_get(), and ~OpExp().