Changeset c5cb943d in mainline for uspace/dist/src/sysel/lib/map.sy


Ignore:
Timestamp:
2010-06-09T19:01:08Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1113c9e
Parents:
051bc69a
Message:

Update SBI to rev. 291.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/dist/src/sysel/lib/map.sy

    r051bc69a rc5cb943d  
    9191                end
    9292        end
     93
     94        fun GetEnumerator() : IEnumerator/tkey is
     95                return new MapEnumerator/tkey/tvalue(data.get_first());
     96        end
    9397end
    9498
     
    97101        var Value : tvalue;
    98102end
     103
     104class MapEnumerator/tkey/tvalue : IEnumerator/tkey is
     105        var first : ListNode/(MapPair/tkey/tvalue);
     106        var current : ListNode/(MapPair/tkey/tvalue);
     107        var started : bool;
     108
     109        new(first_node : ListNode/(MapPair/tkey/tvalue)) is
     110                first = first_node;
     111                current = nil;
     112                started = false;
     113        end
     114
     115        fun MoveNext() : bool is
     116                if started then
     117                        current = current.Next;
     118                else
     119                        current = first;
     120                        started = true;
     121                end
     122
     123                return current != nil;
     124        end
     125
     126        prop Data : tkey is
     127                get is
     128                        return current.Data.Key;
     129                end
     130        end
     131end
Note: See TracChangeset for help on using the changeset viewer.