eg-03_while.html


001| '''
001| name:       @while
001| namesig:    @while**<*
001| typesig:    @while*one*any<*bool
001| 
001| name:       @until
001| namesig:    @until**<*
001| typesig:    @until*one*any<*bool
001| 
001| 01| @@while
001| 02| >>  *one expr
001| 03| >>  *any list
001| 04| <<  *bool swx = t:expr;
001| 05| =? swx
001| 06| .   list
001| 07| .   set:sxw t:expr;
001| 00|
001| 01| @@until
001| 02| >>  *one expr
001| 03| >>  *any list
001| 04| <<  *bool swx = f:expr;
001| 05| =? swx
001| 06| .   list
001| 07| .   set:sxw f:expr;
001| 
001| '''

002| A_while = ('while', '**<*', '*one*any<*bool')
003| A_until = ('until', '**<*', '*one*any<*bool')
004| 
005| codeblock =[   ('REF', 'any', 0)                                                   #0
006| ,   ('REF', 'any', 1)                                                   #1
007| ,   ('MSG', 'true', ('while',0), [0])                                   #2
008| ,   ('LST', 1, ('while',2))                                             #3
009| ,   ('OBJ', 'bool', 2, ('while',3))                                     #4
010| ,   ('MSG', 'true', ('while',0), [])                                    #5
011| ,   ('MSG', 'set', ('while',4), [1,('while',5)])                        #6
012| ,   ('LST', 3, ('while',4), ('while',1), ('while',5), '?')              #7
013| ]
014| nametable = {'expr':('while',0), 'list':('while',1), 'swx':('while',4)}
015| 
016| initlist = [('while',0), ('while',1), ('while',4)]
017| exitlist = [('while',4)]
018| argslist = [['while',2,('while',7)]]
019| 
020| action = ('ACT', A_while, argslist, exitlist, codeblock, nametable)
021| 
022| codeblock =[   ('REF', 'any', 0)                                                   #0
023| ,   ('REF', 'any', 1)                                                   #1
024| ,   ('MSG', 'false', ('until',0), [])                                   #2
025| ,   ('LST', 1, ('until',2))                                             #3
026| ,   ('OBJ', 'bool', 2, ('until',3))                                     #4
027| ,   ('MSG', 'false', ('until',0), [])                                   #5
028| ,   ('MSG', 'set', ('until',4), [1,('until',5)])                        #6
029| ,   ('LST', 3, ('until',4), ('until',1), ('until',5), '?')              #7
030| ]
031| nametable = {'expr':('until',0), 'list':('until',1), 'swx':('until',4)}
032| 
033| initlist = [('until',0), ('until',1), ('until',4)]
034| exitlist = [('until',4)]
035| argslist = [['until',2,('until',7)]]
036| 
037| action = ('ACT', A_until, argslist, exitlist, codeblock, nametable)
038| 
039| 
040| ## Call 1:
041| actor1 = ('TOR', A_while, [('while',('addr',9999),('addr',9999))])
042| 
043| 
044| 
045| '''eof'''
046|