Wildcard Class Reference.all.h - Include all wildcard header files
More...
#include <Wildcard.h>
Inheritance diagram for Wildcard:
[legend]List of all members.
|
Public Member Functions |
| | Wildcard (OP_TYPE optype, const Type &type) |
| | Class Wildcard.
|
| Boolean | matched_exists () const |
| virtual Expression & | matched () const |
| virtual Boolean | _try_for_match (Expression &other, Boolean consider_side_effects)=0 |
| virtual Expression * | clone () const =0 |
| | Return a copy of myself.
|
| virtual Boolean | args_are_non_null () const |
| | Return true if the expression does not have any non-NULL subexpression arguments.
|
| virtual RefList< Expression > * | arg_refs () const |
| | Methods to be specified by derived classes.
|
| virtual void | convert (BinRep &, Symtab &) |
| | Read in the values of my fields and my subexpressions from the given BinRep object.
|
| virtual int | structures_OK () const =0 |
| | Return 1 if my structures are in a valid state.
|
| virtual void | print_debug (ostream &o, Boolean debug) const =0 |
| | debug indicates whether it should contain extra fields
|
| virtual Expression * | member_ref (const Symbol *) |
| | If Expression is an identifier with the given name or a multiple thereof, return the Identifier expression.
|
| virtual Boolean | is_side_effect_free (void) const |
| | Return TRUE if expression is side-effect free.
|
| virtual const ExprSignature & | update_signature ()=0 |
| | Update my signature and return it.
|
| virtual int | node_compare (const Expression &ex) const =0 |
| | Assuming that the the two expressions have the same operation and expression type, return either -1, 0, or 1, indicating that the other expression is less than, equal, or greater than myself.
|
Protected Member Functions |
| const ExprSignature & | _wildcard_update_signature () |
| virtual Expression * | _apply_rec (Expression *(*f)(Expression *)) |
| virtual Expression * | _fold_top (void) |
| | fold_top Fold all constants at the top level of my expression.
|
| virtual Expression * | _additive_inverse (void) |
| virtual Expression * | _logical_complement (void) |
| virtual Expression * | _divides_evenly (const Symbol *) |
| virtual Expression * | _divide_by_int (int &) |
| virtual int | _gcd (void) const |
| virtual Expression * | _distribute_top (void) |
| | distribute_top Distribute my arguments if I am a multiply expression.
|
| virtual Expression * | _combine_rec () |
| virtual Expression * | _combine_top () |
| | Methods used for simplification.
|
| virtual Expression * | _subst_var (const Symbol &, const Expression &) |
| virtual void | _backup_aux () |
| | Backs up an expression tree match, resetting matches made by wildcards.
|
| void | _clear () |
| | Clear any match found.
|
Protected Attributes |
| Expression * | _matched |
| | This field is NOT live for most subclasses of Wildcard, but is rather simply a pointer to a part of another structure, which may be cloned() and stuck into something else.
|
Friends |
| class | Expression |
Detailed Description
.all.h - Include all wildcard header files
Polaris Base - See also:
- Wildcard/Wildcard.all.h
Wildcard/Wildcard.all.h
This header file includes all wildcard header files. - Note:
- This file is NOT NECESSARY if the creation functions defined in Wildcard.h are used instead (for instance, the any_expr() function). Therefore, use of this header file is not necessarily recommended.
Definition at line 460 of file Wildcard.h.
Constructor & Destructor Documentation
| Wildcard::Wildcard |
( |
OP_TYPE |
optype, |
|
|
const Type & |
type |
|
) |
|
|
Member Function Documentation
| Boolean Wildcard::matched_exists |
( |
|
) |
const |
|
| Expression & Wildcard::matched |
( |
|
) |
const [virtual] |
|
| virtual Expression* Wildcard::clone |
( |
|
) |
const [pure virtual] |
|
| Boolean Wildcard::args_are_non_null |
( |
|
) |
const [virtual] |
|
|
|
Return true if the expression does not have any non-NULL subexpression arguments.
Reimplemented from Expression.
Definition at line 119 of file Wildcard.cc.
References True. |
|
|
Read in the values of my fields and my subexpressions from the given BinRep object.
Convert(BinRep) expects the BinRep to be referencing an expression set of the same type as the expression. On return, all data from the expression set has been inserted into the appropriate fields in the expression object. NOTE that this converts the expression to an intermediate form which may contain TableExpr objects.
Implements Expression.
Definition at line 132 of file Wildcard.cc. |
| virtual int Wildcard::structures_OK |
( |
|
) |
const [pure virtual] |
|
| virtual void Wildcard::print_debug |
( |
ostream & |
o, |
|
|
Boolean |
debug |
|
) |
const [pure virtual] |
|
|
|
If Expression is an identifier with the given name or a multiple thereof, return the Identifier expression.
Otherwise, return NULL.
Reimplemented from Expression.
Definition at line 138 of file Wildcard.cc. |
| Boolean Wildcard::is_side_effect_free |
( |
void |
|
) |
const [virtual] |
|
| virtual const ExprSignature& Wildcard::update_signature |
( |
|
) |
[pure virtual] |
|
| virtual int Wildcard::node_compare |
( |
const Expression & |
ex |
) |
const [pure virtual] |
|
|
|
Assuming that the the two expressions have the same operation and expression type, return either -1, 0, or 1, indicating that the other expression is less than, equal, or greater than myself.
Reimplemented from Expression.
Implemented in AnyExpr, AnyExprSubset, AnyOfType, AnySuchThat, and MultipleArgWildcard. |
| const ExprSignature & Wildcard::_wildcard_update_signature |
( |
|
) |
[protected] |
|
|
|
Clear any matches
Now figure out the new signature
Definition at line 954 of file Wildcard.cc.
References _clear(), Expression::_signature_live(), ExprSignature::clear(), ExprSignature::has_wildcard(), ExprSignature::merge(), Expression::op(), Expression::signature(), True, and Expression::type().
Referenced by AnyOfType::update_signature(), AnySuchThat::update_signature(), AnyExprSubset::update_signature(), and AnyExpr::update_signature(). |
|
|
No subexpressions to apply this function to
Definition at line 151 of file Wildcard.cc. |
| Expression * Wildcard::_fold_top |
( |
void |
|
) |
[protected, virtual] |
|
|
|
fold_top Fold all constants at the top level of my expression.
Subexpressions are not folded.
Reimplemented from Expression.
Definition at line 158 of file Wildcard.cc. |
| Expression * Wildcard::_additive_inverse |
( |
void |
|
) |
[protected, virtual] |
|
| Expression * Wildcard::_logical_complement |
( |
void |
|
) |
[protected, virtual] |
|
| Expression * Wildcard::_divide_by_int |
( |
int & |
|
) |
[protected, virtual] |
|
| int Wildcard::_gcd |
( |
void |
|
) |
const [protected, virtual] |
|
| Expression * Wildcard::_distribute_top |
( |
void |
|
) |
[protected, virtual] |
|
|
|
distribute_top Distribute my arguments if I am a multiply expression.
Otherwise do nothing.
Reimplemented from Expression.
Definition at line 200 of file Wildcard.cc. |
| Expression * Wildcard::_combine_rec |
( |
|
) |
[protected, virtual] |
|
| Expression * Wildcard::_combine_top |
( |
void |
|
) |
[protected, virtual] |
|
|
|
Methods used for simplification.
Subexpressions are not combined. However, I am responsible of assigning value numbers to subexpressions if I need to use them.
Reimplemented from Expression.
Definition at line 214 of file Wildcard.cc. |
| void Wildcard::_backup_aux |
( |
|
) |
[protected, virtual] |
|
|
|
Backs up an expression tree match, resetting matches made by wildcards.
Traverse this expression tree and reset all matches made by wildcards found there (through their overridden _backup_aux() function).
This traversal need only go as far as there are actually wildcards in the braches below (i.e. look at the signature).
Precondition: Signature is correct
Nothing to do for expressions with no children and for non-wildcards
Reimplemented from Expression.
Reimplemented in MultipleArgWildcard.
Definition at line 97 of file Wildcard.cc.
References _clear(). |
| void Wildcard::_clear |
( |
|
) |
[inline, protected] |
|
Friends And Related Function Documentation
Member Data Documentation
|
|
This field is NOT live for most subclasses of Wildcard, but is rather simply a pointer to a part of another structure, which may be cloned() and stuck into something else.
Definition at line 464 of file Wildcard.h.
Referenced by _clear(), matched(), matched_exists(), and Wildcard(). |
The documentation for this class was generated from the following files:
|