Ignore:
Timestamp:
Dec 28, 2020, 4:13:58 PM (10 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
6ae5c22
Parents:
b6460bf (diff), bf1914e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/stack.hfa

    rb6460bf r3e36f22  
    22
    33#include "bits/collection.hfa"
     4
     5// A Stack(T) is a Collection(T) defining the ordering that nodes are returned by drop() in the reverse order from those
     6// added by add(). T must be a public descendant of uColable.
     7
     8// The implementation is a typical singly-linked list, except the next field of the last element points to itself
     9// instead of being null.
    410
    511forall( dtype T | { T *& Next ( T * ); } ) {
     
    5864} // distribution
    5965
     66// A StackIter(T) is a subclass of ColIter(T) that generates the elements of a Stack(T).  It returns the elements in the
     67// order returned by drop().
    6068
    6169forall( dtype T | { T *& Next ( T * ); } ) {
     
    6977                } // post: curr == 0p
    7078
    71                 // create an iterator active in Stack s
     79                // create an iterator active in stack s
    7280                void ?{}( StackIter(T) & si, Stack(T) & s ) with( si ) {
    7381                        curr = &head( s );
     
    7886                } // post: curr = {e in s}
    7987
    80                 // make existing iterator active in Stack q
     88                // make existing iterator active in stack s
    8189                void over( StackIter(T) & si, Stack(T) & s ) with( si ) {
    8290                        curr = &head( s );
    8391                } // post: curr = {e in s}
    8492
    85                 bool ?>>?( StackIter(T) & si, T && tp ) with( si ) {
     93                bool ?|?( StackIter(T) & si, T && tp ) with( si ) {
    8694                        if ( curr ) {
    8795                                &tp = Curr( si );
Note: See TracChangeset for help on using the changeset viewer.