[gforth] / gforth / kernel / comp.fs  

gforth: gforth/kernel/comp.fs

Diff for /gforth/kernel/comp.fs between version 1.9 and 1.10

version 1.9, Wed Feb 3 23:32:24 1999 UTC version 1.10, Tue Mar 23 20:24:24 1999 UTC
Line 126 
Line 126 
 \ \ literals                                                    17dec92py  \ \ literals                                                    17dec92py
   
 : Literal  ( compilation n -- ; run-time -- n ) \ core  : Literal  ( compilation n -- ; run-time -- n ) \ core
     \G Compile appropriate code such that, at run-time, n is placed      \G Compile appropriate code such that, at run-time, @var{n} is placed
     \G on the stack. Interpretation semantics are undefined.      \G on the stack. Interpretation semantics are undefined.
     postpone lit  , ; immediate restrict      postpone lit  , ; immediate restrict
   
Line 134 
Line 134 
     postpone lit A, ; immediate restrict      postpone lit A, ; immediate restrict
   
 : char   ( '<spaces>ccc' -- c ) \ core  : char   ( '<spaces>ccc' -- c ) \ core
     \G Skip leading spaces. Parse the string ccc and return c, the      \G Skip leading spaces. Parse the string @var{ccc} and return @var{c}, the
     \G display code representing the first character of ccc.      \G display code representing the first character of @var{ccc}.
     bl word char+ c@ ;      bl word char+ c@ ;
   
 : [char] ( compilation '<spaces>ccc' -- ; run-time -- c ) \ core bracket-char  : [char] ( compilation '<spaces>ccc' -- ; run-time -- c ) \ core bracket-char
     \G Compilation: skip leading spaces. Parse the string ccc. Run-time:      \G Compilation: skip leading spaces. Parse the string
     \G return c, the display code representing the first character of ccc.      \G @var{ccc}. Run-time: return @var{c}, the display code
     \G Interpretation semantics for this word are undefined.      \G representing the first character of @var{ccc}.  Interpretation
       \G semantics for this word are undefined.
     char postpone Literal ; immediate restrict      char postpone Literal ; immediate restrict
   
 \ \ threading                                                   17mar93py  \ \ threading                                                   17mar93py
Line 152 
Line 153 
     0 A, 0 ,  code-address! ;      0 A, 0 ,  code-address! ;
   
 : compile, ( xt -- )    \ core-ext      compile-comma  : compile, ( xt -- )    \ core-ext      compile-comma
     \G  Blah, blah.      \G  Compile the word represented by the execution token, @var{xt}.
     A, ;      A, ;
   
 : !does    ( addr -- ) \ gforth store-does  : !does    ( addr -- ) \ gforth store-does
Line 168 
Line 169 
     r> dup cell+ >r @ compile, ;      r> dup cell+ >r @ compile, ;
   
 : postpone, ( w xt -- ) \ gforth        postpone-comma  : postpone, ( w xt -- ) \ gforth        postpone-comma
     \g Compiles the compilation semantics represented by @var{w xt}.      \g Compile the compilation semantics represented by @var{w xt}.
     dup ['] execute =      dup ['] execute =
     if      if
         drop compile,          drop compile,
Line 228 
Line 229 
 \ \ recurse                                                     17may93jaw  \ \ recurse                                                     17may93jaw
   
 : recurse ( compilation -- ; run-time ?? -- ?? ) \ core  : recurse ( compilation -- ; run-time ?? -- ?? ) \ core
     \g calls the current definition.      \g Call the current definition.
     lastxt compile, ; immediate restrict      lastxt compile, ; immediate restrict
   
 \ \ compiler loop  \ \ compiler loop
Line 266 
Line 267 
   here over char+ allot  place align ;    here over char+ allot  place align ;
   
 : SLiteral ( Compilation c-addr1 u ; run-time -- c-addr2 u ) \ string  : SLiteral ( Compilation c-addr1 u ; run-time -- c-addr2 u ) \ string
     \G Compilation: compile the string specified by c-addr1, u into      \G Compilation: compile the string specified by @var{c-addr1},
     \G the current definition. Run-time: return c-addr2 u describing      \G @var{u} into the current definition. Run-time: return
     \G the address and length of the string.      \G @var{c-addr2 u} describing the address and length of the
       \G string.
     postpone (S") here over char+ allot  place align ;      postpone (S") here over char+ allot  place align ;
                                              immediate restrict                                               immediate restrict
   
 \ \ abort"                                                      22feb93py  \ \ abort"                                                      22feb93py
   
 : abort" ( compilation 'ccc"' -- ; run-time f -- ) \ core,exception-ext abort-quote  : abort" ( compilation 'ccc"' -- ; run-time f -- ) \ core,exception-ext abort-quote
       \G If any bit of @var{f} is non-zero, perform the function of @code{-2 throw},
       \G displaying the string @var{ccc} if there is no exception frame on the
       \G exception stack.
     postpone (abort") ," ;        immediate restrict      postpone (abort") ," ;        immediate restrict
   
 \ \ Header states                                               23feb93py  \ \ Header states                                               23feb93py
Line 294 
Line 299 
     last @ dup 0= abort" last word was headerless" cell+ ;      last @ dup 0= abort" last word was headerless" cell+ ;
   
 : immediate ( -- ) \ core  : immediate ( -- ) \ core
       \G Make the compilation semantics of a word be to @code{execute}
       \G the execution semantics.
     immediate-mask lastflags cset ;      immediate-mask lastflags cset ;
   
 : restrict ( -- ) \ gforth  : restrict ( -- ) \ gforth
       \G A synonym for @code{compile-only}
     restrict-mask lastflags cset ;      restrict-mask lastflags cset ;
 ' restrict alias compile-only ( -- ) \ gforth  ' restrict alias compile-only ( -- ) \ gforth
   \G Remove the interpretation semantics of a word.
   
 \ \ Create Variable User Constant                               17mar93py  \ \ Create Variable User Constant                               17mar93py
   
Line 456 
Line 465 
     dup wordlist-map @ rehash-method perform ;      dup wordlist-map @ rehash-method perform ;
   
 ' reveal alias recursive ( compilation -- ; run-time -- ) \ gforth  ' reveal alias recursive ( compilation -- ; run-time -- ) \ gforth
 \g makes the current definition visible, enabling it to call itself  \g Make the current definition visible, enabling it to call itself
 \g recursively.  \g recursively.
         immediate restrict          immediate restrict


Generate output suitable for use with a patch program
Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help