lex token id / [a-z] / ignore / [\n\t ] / end def start [id*] parse S: start[stdin] for Id: id in ((start in S)) { print[ @Id ] Id = cons id "s" } print[ @S ] context on_heap S: start end on_heap newHeap( S: start ) { OnHeap: on_heap = new on_heap() OnHeap->S = S return OnHeap } OnHeap: on_heap = newHeap( S ) for Id: id in OnHeap->S { print[ @Id ] Id = cons id "s" } print[ @S ] int main( S: start ) { OnHeap: on_heap = new on_heap() OnHeap->S = S for Id: id in OnHeap->S { print[ @Id ] Id = cons id "s" } print[ @S ] } main( S ) int someRefs( S1: ref, S2: ref, S3: ref, S4: ref ) { print[ @S1 ] print[ @S2 ] print[ @S3 ] print[ @S4 ] } cons S1: start "a b cons S2: start "c d cons S3: start "e f cons S4: start "g h someRefs( start in S1, start in S2, start in S3, start in S4 ) #### IN #### x y #### EXP #### x y x y x y x y x y x y a b c d e f g h