Polaris: AnySuchThat Class Reference

AnySuchThat Class Reference

Wildcard expression for user-defined semantics. More...

#include <AnySuchThat.h>

Inheritance diagram for AnySuchThat:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 AnySuchThat (such_that_func func, const ExtraInfo &extra_info, const char *printable_condition=0)
 Constructor.
 AnySuchThat (const AnySuchThat &other)
virtual Expressionclone () const
 Return a copy of myself.
virtual void print_debug (ostream &o, Boolean debug) const
 debug indicates whether it should contain extra fields
virtual Boolean _try_for_match (Expression &e, Boolean consider_side_effects)
virtual int structures_OK () const
virtual const ExprSignatureupdate_signature ()
virtual int node_compare (const Expression &ex) const

Protected Attributes

such_that_func _func
ExtraInfo_info
String _printable_condition

Detailed Description

Wildcard expression for user-defined semantics.

Polaris Base

See also:
Wildcard/AnySuchThat.h

Wildcard/Wildcard.cc

Wildcard/AnySuchThat.h

Description

AnySuchThat is a wildcard expression which matches any expression passing user-defined semantics. The user gives the wildcard's constructor a function of type such_that_func (see Wildcard) plus extra arguments to be passed to the function (see Info). When an attempt is made to made an expression against this wildcard, the user-defined function is called with the expression and with the user-defined extra arguments as parameters. If the user-defined function returns True, the wildcard is considered a match, otherwise not.

For more details, please see Wildcard.

Definition at line 40 of file AnySuchThat.h.


Constructor & Destructor Documentation

AnySuchThat::AnySuchThat such_that_func  func,
const ExtraInfo extra_info,
const char *  printable_condition = 0
 

Constructor.

'func' is a user-defined function (see DESCRIPTION.) 'extra_info' contains arguments to be passed to 'func' 'printable_condition' is an optional printable representation of the condition function 'func', for example, "expr has no side-effects", or whatever. It's only use is in printing out the wildcard expression.

Referenced by clone().

AnySuchThat::AnySuchThat const AnySuchThat other  ) 
 

Definition at line 524 of file Wildcard.cc.

References Expression::clone().


Member Function Documentation

Expression * AnySuchThat::clone  )  const [virtual]
 

Return a copy of myself.

Implements Wildcard.

Definition at line 533 of file Wildcard.cc.

References AnySuchThat().

virtual void AnySuchThat::print_debug ostream &  o,
Boolean  debug
const [virtual]
 

debug indicates whether it should contain extra fields

Implements Wildcard.

virtual Boolean AnySuchThat::_try_for_match Expression e,
Boolean  consider_side_effects
[virtual]
 

Implements Wildcard.

int AnySuchThat::structures_OK void   )  const [virtual]
 

... What could go wrong that we could detect?

Implements Wildcard.

Definition at line 562 of file Wildcard.cc.

References True.

const ExprSignature & AnySuchThat::update_signature  )  [virtual]
 

Note: Equality is based on address for _func and _info, and the _printable_condition is entirely ignored

Implements Wildcard.

Definition at line 984 of file Wildcard.cc.

References _func, _info, Expression::_signature_live(), Wildcard::_wildcard_update_signature(), ExprSignature::merge(), and Expression::signature().

int AnySuchThat::node_compare const Expression ex  )  const [virtual]
 

Note: Equality is based on address for _func and _info, and the _printable_condition is entirely ignored

Implements Wildcard.

Definition at line 1033 of file Wildcard.cc.

References _func, _info, and SUCH_THAT_WC.


Member Data Documentation

such_that_func AnySuchThat::_func [protected]
 

Definition at line 42 of file AnySuchThat.h.

Referenced by node_compare(), and update_signature().

ExtraInfo* AnySuchThat::_info [protected]
 

Definition at line 43 of file AnySuchThat.h.

Referenced by node_compare(), and update_signature().

String AnySuchThat::_printable_condition [protected]
 

Definition at line 44 of file AnySuchThat.h.


The documentation for this class was generated from the following files:
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:06:41 2005