Main Page | Class Hierarchy | Class List | File List | Class Members

ExprListIterator Class Reference

An iterator for an ExprList--deprecated: you should use the STL-like iterators now. More...

#include <exprList.h>

Collaboration diagram for ExprListIterator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ExprListIterator ()
 Constructor.

 ExprListIterator (const ExprList *l)
 Constructor which initializes the iterator.

 ~ExprListIterator ()
 Destructor.

void Initialize (const ExprList *l)
 Initializes the object to iterate over an expression list; the iterator begins at the "before first" position.

void ToFirst ()
 Positions the iterator to the first element.

void ToAfterLast ()
 Positions the iterator to the "after last" position.

bool ToNth (int n)
 Positions the iterator at the n'th expression of the list (assuming 0-based index.

const ExprTreeNextExpr ()
 Gets the next expression in the list.

const ExprTreeCurrentExpr () const
 Gets the expression currently pointed to.

const ExprTreePrevExpr ()
 Gets the previous expression in the list.

bool NextValue (Value &v, EvalState *es=NULL)
 Gets the value of the next expression in the list.

bool CurrentValue (Value &v, EvalState *es=NULL)
 Gets the value of the expression currently pointed to.

bool PrevValue (Value &v, EvalState *es=NULL)
 Gets the value of the previous expression in the list.

bool NextValue (Value &v, ExprTree *&t, EvalState *es=NULL)
 Gets the value of the next expression in the list, and identifies sub-expressions that caused the value.

bool CurrentValue (Value &v, ExprTree *&t, EvalState *es=NULL)
 Gets the value of the expression currently pointed to, and identifies sub-expressions that caused the value.

bool PrevValue (Value &v, ExprTree *&t, EvalState *es=NULL)
 Gets the value of the previous expression in the list, and identifies sub-expressions that caused that value.

bool IsAtFirst () const
 Predicate to check the position of the iterator.

bool IsAfterLast () const
 Predicate to check the position of the iterator.


Detailed Description

An iterator for an ExprList--deprecated: you should use the STL-like iterators now.


Constructor & Destructor Documentation

ExprListIterator::ExprListIterator const ExprList l  ) 
 

Constructor which initializes the iterator.

Parameters:
l The list to be iterated over (i.e., the iteratee).
See also:
initialize


Member Function Documentation

const ExprTree* ExprListIterator::CurrentExpr  )  const
 

Gets the expression currently pointed to.

Returns:
The expression currently pointed to.

bool ExprListIterator::CurrentValue Value v,
ExprTree *&  t,
EvalState *  es = NULL
 

Gets the value of the expression currently pointed to, and identifies sub-expressions that caused the value.

Parameters:
v The value of the expression.
t The expression composed of the significant sub-expressions.
es The EvalState object which caches values of expressions. Ordinarily, this parameter will not be supplied by the user, and an internal EvalState object will be used.
Returns:
true if the operation succeeded, false otherwise.

bool ExprListIterator::CurrentValue Value v,
EvalState *  es = NULL
 

Gets the value of the expression currently pointed to.

Parameters:
v The value of the expression.
es The EvalState object which caches values of expressions. Ordinarily, this parameter will not be supplied by the user, and an internal EvalState object will be used.
Returns:
true if the operation succeeded, false otherwise.

void ExprListIterator::Initialize const ExprList l  ) 
 

Initializes the object to iterate over an expression list; the iterator begins at the "before first" position.

This method must be called before the iterator is usable. (The iteration methods return false if the iterator has not been initialized.) This method may be called any number of times, with different expression lists as arguments.

Parameters:
l The expression list to iterate over (i.e., the iteratee).

bool ExprListIterator::IsAfterLast  )  const
 

Predicate to check the position of the iterator.

Returns:
true iff the iterator is after the last element.

bool ExprListIterator::IsAtFirst  )  const
 

Predicate to check the position of the iterator.

Returns:
true iff the iterator is before the first element.

const ExprTree* ExprListIterator::NextExpr  ) 
 

Gets the next expression in the list.

Returns:
The next expression in the list, or NULL if the iterator has crossed the last expression in the list.

bool ExprListIterator::NextValue Value v,
ExprTree *&  t,
EvalState *  es = NULL
 

Gets the value of the next expression in the list, and identifies sub-expressions that caused the value.

Parameters:
v The value of the expression.
t The expression composed of the significant sub-expressions.
es The EvalState object which caches values of expressions. Ordinarily, this parameter will not be supplied by the user, and an internal EvalState object will be used.
Returns:
false if the iterator has crossed the last expression in the list, or true otherwise.

bool ExprListIterator::NextValue Value v,
EvalState *  es = NULL
 

Gets the value of the next expression in the list.

Parameters:
v The value of the expression.
es The EvalState object which caches values of expressions. Ordinarily, this parameter will not be supplied by the user, and an internal EvalState object will be used.
Returns:
false if the iterator has crossed the last expression in the list, or true otherwise.

const ExprTree* ExprListIterator::PrevExpr  ) 
 

Gets the previous expression in the list.

Returns:
The previous expression in the list, or NULL if the iterator has crossed the first expression in the list.

bool ExprListIterator::PrevValue Value v,
ExprTree *&  t,
EvalState *  es = NULL
 

Gets the value of the previous expression in the list, and identifies sub-expressions that caused that value.

Parameters:
v The value of the expression.
t The expression composed of the significant sub-expressions.
es The EvalState object which caches values of expressions. Ordinarily, this parameter will not be supplied by the user, and an internal EvalState object will be used.
Returns:
false if the iterator has crossed the first expression in the list, or true otherwise.

bool ExprListIterator::PrevValue Value v,
EvalState *  es = NULL
 

Gets the value of the previous expression in the list.

Parameters:
v The value of the expression.
es The EvalState object which caches values of expressions. Ordinarily, this parameter will not be supplied by the user, and an internal EvalState object will be used.
Returns:
false if the iterator has crossed the first expression in the list, or true otherwise.

bool ExprListIterator::ToNth int  n  ) 
 

Positions the iterator at the n'th expression of the list (assuming 0-based index.

Parameters:
n The index of the expression to retrieve.
Returns:
true if the iterator was successfully positioned at the n'th element, and false otherwise.


The documentation for this class was generated from the following file: