#include <inc.h>
Inheritance diagram for expression_inc:

Public Member Functions | |
| virtual | ~expression_inc () |
| expression_inc (const type::pointer &tp, const expression::pointer &lhs, int rhs, const symbol *hint, translator_compile *cntxt) | |
Protected Member Functions | |
| void | traversal (int pprec) |
| expression::pointer | optimize () const |
| void | logical_traversal (int pprec, label::pointer &true_branch, label::pointer &false_branch, bool fall_through_preference) |
| int | get_precedence () const |
| type::pointer | get_type () const |
| bool | is_lvalue () const |
| side_effect_t | has_side_effect () const |
| const symbol * | get_symbol_hint () const |
| expression::pointer | get_lhs () const |
| int | get_rhs () const |
Private Member Functions | |
| expression_inc () | |
| expression_inc (const expression_inc &) | |
| expression_inc & | operator= (const expression_inc &) |
Private Attributes | |
| translator_compile & | code |
| type::pointer | tp |
| expression::pointer | lhs |
| int | rhs |
| const symbol * | hint |
Definition at line 32 of file inc.h.
| virtual expression_inc::~expression_inc | ( | ) | [virtual] |
The destructor.
| expression_inc::expression_inc | ( | const type::pointer & | tp, | |
| const expression::pointer & | lhs, | |||
| int | rhs, | |||
| const symbol * | hint, | |||
| translator_compile * | cntxt | |||
| ) |
The constructor.
| tp | The type of the resulting pointer | |
| lhs | The pointer expression to be added to | |
| rhs | the number of words to add to the pointer value | |
| hint | symbol hint for error messages | |
| cntxt | where to send our generated code |
| expression_inc::expression_inc | ( | ) | [private] |
The default constructor.
| expression_inc::expression_inc | ( | const expression_inc & | ) | [private] |
The copy constructor.
| void expression_inc::traversal | ( | int | pprec | ) | [protected, virtual] |
The traversal method may be used to traverse each of the declaractions in the list.
| pprec | The precedence of the parent expression node. |
Implements expression.
| expression::pointer expression_inc::optimize | ( | ) | const [protected, virtual] |
The optimize method may be used to evaluate constant expressions, or substitute more efficient expressions.
This is intended to be called by the translator:: expression_statement method, or similar, where the expression is in its final form, and will get no deeper. In other words, when all available information has been provided.
There is no default implementation, even though most optimize implementations return self(), because this gives the compiler no opportunity to remind the authors of new classes that they have forgotten something.
Implements expression.
| void expression_inc::logical_traversal | ( | int | pprec, | |
| label::pointer & | true_branch, | |||
| label::pointer & | false_branch, | |||
| bool | fall_through_preference | |||
| ) | [protected] |
| int expression_inc::get_precedence | ( | ) | const [protected, virtual] |
The get_precedence method is used to obtain the precedence of this expression node.
The highest precedence has the highest absolute value, the lowest precedence gets the lowest absolute value.
Implements expression.
| type::pointer expression_inc::get_type | ( | ) | const [protected, virtual] |
The get_type method is used to get the type of this expression.
Implements expression.
| bool expression_inc::is_lvalue | ( | ) | const [protected, virtual] |
The is_lvalue method is used to determine whether or not this expression is suitable to appear on the left hand side of an assignment expression.
Implements expression.
| side_effect_t expression_inc::has_side_effect | ( | ) | const [protected, virtual] |
The has_side_effect method is used to determine if an expression has any effect. It is used by the parse to produce "statement with no effect" warnings.
Implements expression.
| const symbol* expression_inc::get_symbol_hint | ( | ) | const [protected, virtual] |
The get_symbol_hint method is used to get the symbol associated with the expression.
Reimplemented from expression.
| expression::pointer expression_inc::get_lhs | ( | ) | const [inline, protected] |
| expression_inc& expression_inc::operator= | ( | const expression_inc & | ) | [private] |
The assignment operator.
translator_compile& expression_inc::code [private] |
type::pointer expression_inc::tp [private] |
expression::pointer expression_inc::lhs [private] |
int expression_inc::rhs [private] |
const symbol* expression_inc::hint [private] |
1.5.1