--- gforth/prims2x.fs 2001/04/30 13:48:56 1.95 +++ gforth/prims2x.fs 2001/12/24 20:39:29 1.103 @@ -53,21 +53,14 @@ warnings off -[IFUNDEF] vocabulary \ we are executed just with kernel image - \ load the rest that is needed - \ (require fails because this file is needed from a - \ different directory with the wordlibraries) -include ./search.fs -include ./extend.fs -include ./stuff.fs -[THEN] - -[IFUNDEF] environment? -include ./environ.fs +[IFUNDEF] try +include startup.fs [THEN] : struct% struct ; \ struct is redefined in gray +warnings off + include ./gray.fs 32 constant max-effect \ number of things on one side of a stack effect @@ -654,7 +647,7 @@ stack inst-stream IP Cell 2drop type ; : print-entry ( -- ) - ." I_" prim prim-c-name 2@ type ." :" ; + ." LABEL(" prim prim-c-name 2@ type ." ):" ; : output-c ( -- ) print-entry ." /* " prim prim-name 2@ type ." ( " prim prim-stack-string 2@ type ." ) */" cr @@ -710,6 +703,13 @@ stack inst-stream IP Cell endif ." }" cr ; +: output-superend ( -- ) + \ output flag specifying whether the current word ends a dynamic superinst + prim prim-c-code 2@ s" SET_IP" search nip nip + prim prim-c-code 2@ s" SUPER_END" search nip nip or 0<> + prim prim-c-code 2@ s" SUPER_CONTINUE" search nip nip 0= and + negate 0 .r ." , /* " prim prim-name 2@ type ." */" cr ; + : gen-arg-parm { item -- } item item-stack @ inst-stream = if ." , " item item-type @ type-c-name 2@ type space @@ -774,7 +774,7 @@ stack inst-stream IP Cell \ cr ; : output-label ( -- ) - ." (Label)&&I_" prim prim-c-name 2@ type ." ," cr ; + ." INST_ADDR(" prim prim-c-name 2@ type ." )," cr ; : output-alias ( -- ) ( primitive-number @ . ." alias " ) ." Primitive " prim prim-name 2@ type cr ; @@ -806,6 +806,11 @@ stack inst-stream IP Cell name-line @ 0 .r ." ,0" cr ; +: output-vi-tag ( -- ) + name-filename 2@ type #tab emit + prim prim-name 2@ type #tab emit + ." /^" prim prim-name 2@ type ." *(/" cr ; + [IFDEF] documentation : register-doc ( -- ) prim prim-name 2@ documentation ['] create insert-wordlist @@ -1183,7 +1188,13 @@ Variable c-flag THEN }} )) <- if-comment -(( (( eval-comment || forth-comment || c-comment || else-comment || if-comment )) ?? nonl ** )) <- comment-body +(( (( ` g || ` G )) {{ start }} nonl ** + {{ end + forth-flag @ IF ." group " type cr THEN + c-flag @ IF ." GROUP(" type ." )" cr THEN }} +)) <- group-comment + +(( (( eval-comment || forth-comment || c-comment || else-comment || if-comment || group-comment )) ?? nonl ** )) <- comment-body (( ` \ comment-body nleof )) <- comment ( -- ) @@ -1227,7 +1238,7 @@ warnings @ [IF] [THEN] -\ run with out of box gforth 0.5.0 +\ run with gforth-0.5.0 (slurp-file is missing) [IFUNDEF] slurp-file : slurp-file ( c-addr1 u1 -- c-addr2 u2 ) \ c-addr1 u1 is the filename, c-addr2 u2 is the file's contents