Nearly CC
An educational compiler skeleton
Public Member Functions | List of all members
HasOperand Class Reference

HasOperand is a base class for NodeBase, which in turn is a base class for Node. More...

#include "has_operand.h"

Inheritance diagram for HasOperand:
Inheritance graph
[legend]

Public Member Functions

void set_operand (const Operand &op)
 Set the Node's Operand. More...
 
bool has_operand () const
 Check whether this Node has a valid Operand. More...
 
const Operand get_operand () const
 Get this Node's Operand. More...
 

Detailed Description

HasOperand is a base class for NodeBase, which in turn is a base class for Node.

The idea is that each Node in an AST has an Operand which represents the location (register or memory) where the results of expression evaluation are stored. By default, the Operand is "invalid". The set_operand() member function must be called to set the Operand.

Member Function Documentation

◆ get_operand()

const Operand HasOperand::get_operand ( ) const
inline

Get this Node's Operand.

Returns
this Node's Operand

◆ has_operand()

bool HasOperand::has_operand ( ) const
inline

Check whether this Node has a valid Operand.

Returns
true if the Node has a valid Operand, false otherwise

◆ set_operand()

void HasOperand::set_operand ( const Operand op)
inline

Set the Node's Operand.

Parameters
opthe Operand to set

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