LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ast::OpExp Class Reference

OpExp. More...

#include <op-exp.hh>

Inheritance diagram for ast::OpExp:
Collaboration diagram for ast::OpExp:

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 Expleft_get () const
 Return left operand.
Expleft_get ()
 Return left operand.
OpExp::Oper oper_get () const
 Return operator.
const Expright_get () const
 Return right operand.
Expright_get ()
 Return right operand.
Accessors.
const Locationlocation_get () const
 Return scanner position information.
void location_set (const Location &)
 Set scanner position information.

Protected Attributes

Expleft_
 Left operand.
OpExp::Oper oper_
 Operator.
Expright_
 Right operand.
Location location_
 Scanner position information.

Detailed Description

Member Enumeration Documentation

Operator qualifier.

Enumerator:
add 

"+"

sub 

"-"

mul 

"*"

div 

"/"

eq 

"="

ne 

"<>"

lt 

"<"

le 

"<="

gt 

">"

ge 

">="

Constructor & Destructor Documentation

ast::OpExp::OpExp ( const Location location,
Exp left,
OpExp::Oper  oper,
Exp right 
)

Construct an OpExp node.

ast::OpExp::~OpExp ( )
virtual

Destroy an OpExp node.

References left_, and right_.

Member Function Documentation

void ast::OpExp::accept ( ConstVisitor v) const
overridevirtual

Accept a const visitor v.

Implements ast::Exp.

void ast::OpExp::accept ( Visitor v)
overridevirtual

Accept a non-const visitor v.

Implements ast::Exp.

const Exp & ast::OpExp::left_get ( ) const
inline

Return left operand.

References left_.

Referenced by astclone::Cloner::operator()(), and translate::Translator::operator()().

Exp & ast::OpExp::left_get ( )
inline

Return left operand.

References left_.

const Location & ast::Ast::location_get ( ) const
inlineinherited
void ast::Ast::location_set ( const Location location)
inlineinherited

Set scanner position information.

References ast::Ast::location_.

OpExp::Oper ast::OpExp::oper_get ( ) const
inline

Return operator.

References oper_.

Referenced by astclone::Cloner::operator()().

const Exp & ast::OpExp::right_get ( ) const
inline

Return right operand.

References right_.

Referenced by astclone::Cloner::operator()(), and translate::Translator::operator()().

Exp & ast::OpExp::right_get ( )
inline

Return right operand.

References right_.

Member Data Documentation

Exp* ast::OpExp::left_
protected

Left operand.

Referenced by left_get(), and ~OpExp().

Location ast::Ast::location_
protectedinherited
OpExp::Oper ast::OpExp::oper_
protected

Operator.

Referenced by oper_get().

Exp* ast::OpExp::right_
protected

Right operand.

Referenced by right_get(), and ~OpExp().


The documentation for this class was generated from the following files: