#include <operators.h>
Inheritance diagram for Operation:


Strict comparison operators | |
Non-strict comparison operators | |
Arithmetic operators | |
Logical operators | |
Bitwise operators | |
Miscellaneous operators | |
Public Types | |
| enum | OpKind { __NO_OP__, __FIRST_OP__, __COMPARISON_START__ = __FIRST_OP__, LESS_THAN_OP = __COMPARISON_START__, LESS_OR_EQUAL_OP, NOT_EQUAL_OP, EQUAL_OP, GREATER_OR_EQUAL_OP, GREATER_THAN_OP, META_EQUAL_OP, IS_OP = META_EQUAL_OP, META_NOT_EQUAL_OP, ISNT_OP = META_NOT_EQUAL_OP, __COMPARISON_END__ = ISNT_OP, __ARITHMETIC_START__, UNARY_PLUS_OP = __ARITHMETIC_START__, UNARY_MINUS_OP, ADDITION_OP, SUBTRACTION_OP, MULTIPLICATION_OP, DIVISION_OP, MODULUS_OP, __ARITHMETIC_END__ = MODULUS_OP, __LOGIC_START__, LOGICAL_NOT_OP = __LOGIC_START__, LOGICAL_OR_OP, LOGICAL_AND_OP, __LOGIC_END__ = LOGICAL_AND_OP, __BITWISE_START__, BITWISE_NOT_OP = __BITWISE_START__, BITWISE_OR_OP, BITWISE_XOR_OP, BITWISE_AND_OP, LEFT_SHIFT_OP, RIGHT_SHIFT_OP, URIGHT_SHIFT_OP, __BITWISE_END__ = URIGHT_SHIFT_OP, __MISC_START__, PARENTHESES_OP = __MISC_START__, SUBSCRIPT_OP, TERNARY_OP, __MISC_END__ = TERNARY_OP, __LAST_OP__ = __MISC_END__ } |
| List of supported operators. More... | |
Public Member Functions | |
| Operation (const Operation &op) | |
| Copy Constructor. | |
| ~Operation () | |
| Destructor. | |
| Operation & | operator= (const Operation &op) |
| Assignment operator. | |
| void | GetComponents (OpKind &, ExprTree *&, ExprTree *&, ExprTree *&) const |
| Deconstructor to obtain the components of an operation node. | |
| virtual ExprTree * | Copy () const |
| Make a deep copy of the expression. | |
| bool | CopyFrom (const Operation &op) |
| virtual bool | SameAs (const ExprTree *tree) const |
| Is this ExprTree the same as the tree? | |
Static Public Member Functions | |
| Operation * | MakeOperation (OpKind kind, ExprTree *e1=NULL, ExprTree *e2=NULL, ExprTree *e3=NULL) |
| Factory method to create an operation expression node. | |
| void | Operate (OpKind op, Value &op1, Value &op2, Value &result) |
| Convenience method which operates on binary operators. | |
| void | Operate (OpKind op, Value &op1, Value &op2, Value &op3, Value &result) |
| Convenience method which operates on ternary operators. | |
| bool | IsStrictOperator (OpKind) |
| Predicate which tests if an operator is strict. | |
| int | PrecedenceLevel (OpKind) |
| Gets the precedence level of an operator. | |
Protected Member Functions | |
| Operation () | |
| Constructor. | |
Friends | |
| bool | operator== (const Operation &op1, const Operation &op2) |
|
|
||||||||||||||||||||
|
Deconstructor to obtain the components of an operation node.
|
|
|
Predicate which tests if an operator is strict.
|
|
||||||||||||||||||||
|
Factory method to create an operation expression node.
|
|
||||||||||||||||||||||||
|
Convenience method which operates on ternary operators.
|
|
||||||||||||||||||||
|
Convenience method which operates on binary operators.
|
|
|
Gets the precedence level of an operator. Higher precedences get higher values. (See K&R, p.53)
|
|
|
Is this ExprTree the same as the tree?
Implements ExprTree. |