#include <pretty.h>
Inheritance diagram for expression_addition_pretty:

Public Member Functions | |
| virtual | ~expression_addition_pretty () |
| expression_addition_pretty (const expression::pointer &lhs, const expression::pointer &rhs, translator_pretty *cntxt) | |
Protected Member Functions | |
| void | pre_order_traversal (int pprec) |
| void | logical_traversal (int pprec, label::pointer &true_branch, label::pointer &false_branch, bool fall_through_preference) |
| void | infix_order_traversal (int pprec) |
| void | post_order_traversal (int pprec) |
| expression::pointer | optimize () const |
Private Member Functions | |
| expression_addition_pretty () | |
| expression_addition_pretty (const expression_addition_pretty &) | |
| expression_addition_pretty & | operator= (const expression_addition_pretty &) |
Private Attributes | |
| translator_pretty & | pretty |
Definition at line 32 of file pretty.h.
| virtual expression_addition_pretty::~expression_addition_pretty | ( | ) | [virtual] |
The destructor.
| expression_addition_pretty::expression_addition_pretty | ( | const expression::pointer & | lhs, | |
| const expression::pointer & | rhs, | |||
| translator_pretty * | cntxt | |||
| ) |
The constructor.
| expression_addition_pretty::expression_addition_pretty | ( | ) | [private] |
The default constructor. Do not use.
| expression_addition_pretty::expression_addition_pretty | ( | const expression_addition_pretty & | ) | [private] |
The copy constructor. Do not use.
| void expression_addition_pretty::pre_order_traversal | ( | int | pprec | ) | [protected, virtual] |
The pre_order_traversal method is used to perform actions required before the left hand expression is traversed.
| pprec | The parent expressions precedence. Not much use to code generators, but essential for pretty printers to get the parentheses correct. |
Reimplemented from expression_addition.
| void expression_addition_pretty::logical_traversal | ( | int | pprec, | |
| label::pointer & | true_branch, | |||
| label::pointer & | false_branch, | |||
| bool | fall_through_preference | |||
| ) | [protected] |
| void expression_addition_pretty::infix_order_traversal | ( | int | pprec | ) | [protected, virtual] |
The infix_order_traversal method is used to perform actions required between the left and right hand expression traversals.
| pprec | The parent expressions precedence. |
Reimplemented from expression_addition.
| void expression_addition_pretty::post_order_traversal | ( | int | pprec | ) | [protected, virtual] |
The post_order_traversal method is used to perform actions required after the right hand expression has been traversed.
| pprec | The parent expressions precedence. Not much use to code generators, but essential for pretty printers to get the parentheses correct. |
Reimplemented from expression_addition.
| expression::pointer expression_addition_pretty::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.
| expression_addition_pretty& expression_addition_pretty::operator= | ( | const expression_addition_pretty & | ) | [private] |
The assignment operator. Do not use.
1.5.1