version 1.5, 2001/06/16 22:53:38
|
version 1.13, 2007/12/31 19:02:25
|
Line 1
|
Line 1
|
\ quote: S" and ." words |
\ quote: S" and ." words |
|
|
\ Copyright (C) 1996,1998,1999 Free Software Foundation, Inc. |
\ Copyright (C) 1996,1998,1999,2002,2003,2007 Free Software Foundation, Inc. |
|
|
\ This file is part of Gforth. |
\ This file is part of Gforth. |
|
|
\ Gforth is free software; you can redistribute it and/or |
\ Gforth is free software; you can redistribute it and/or |
\ modify it under the terms of the GNU General Public License |
\ modify it under the terms of the GNU General Public License |
\ as published by the Free Software Foundation; either version 2 |
\ as published by the Free Software Foundation, either version 3 |
\ of the License, or (at your option) any later version. |
\ of the License, or (at your option) any later version. |
|
|
\ This program is distributed in the hope that it will be useful, |
\ This program is distributed in the hope that it will be useful, |
Line 15
|
Line 15
|
\ GNU General Public License for more details. |
\ GNU General Public License for more details. |
|
|
\ You should have received a copy of the GNU General Public License |
\ You should have received a copy of the GNU General Public License |
\ along with this program; if not, write to the Free Software |
\ along with this program. If not, see http://www.gnu.org/licenses/. |
\ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. |
|
|
|
\ this file comes last, because these words override cross' words. |
\ this file comes last, because these words override cross' words. |
|
|
require ./vars.fs |
require ./vars.fs |
|
|
|
: CLiteral ( Compilation c-addr1 u ; run-time -- c-addr ) |
|
2>r postpone ahead here 2r> s, >r postpone then |
|
r> postpone literal ; immediate restrict |
|
|
|
: SLiteral ( Compilation c-addr1 u ; run-time -- c-addr2 u ) \ string |
|
\G Compilation: compile the string specified by @i{c-addr1}, |
|
\G @i{u} into the current definition. Run-time: return |
|
\G @i{c-addr2 u} describing the address and length of the |
|
\G string. |
|
tuck 2>r postpone ahead here 2r> chars mem, align >r postpone then |
|
r> postpone literal postpone literal ; immediate restrict |
|
|
|
\ \ abort" 22feb93py |
|
|
|
: abort" ( compilation 'ccc"' -- ; run-time f -- ) \ core,exception-ext abort-quote |
|
\G If any bit of @i{f} is non-zero, perform the function of @code{-2 throw}, |
|
\G displaying the string @i{ccc} if there is no exception frame on the |
|
\G exception stack. |
|
postpone if [char] " parse postpone cliteral postpone c(abort") |
|
postpone then ; immediate restrict |
|
|
\ create s"-buffer /line chars allot |
\ create s"-buffer /line chars allot |
has? compiler 0= |
has? compiler 0= |
[IF] : s" [ELSE] :noname [THEN] |
[IF] : s" [ELSE] :noname [THEN] |
Line 49 interpret/compile: S" ( compilation 'ccc
|
Line 69 interpret/compile: S" ( compilation 'ccc
|
[THEN] |
[THEN] |
|
|
:noname [char] " parse type ; |
:noname [char] " parse type ; |
:noname postpone (.") ," align ; |
:noname [char] " parse postpone sLiteral postpone type ; |
interpret/compile: ." ( compilation 'ccc"' -- ; run-time -- ) \ core dot-quote |
interpret/compile: ." ( compilation 'ccc"' -- ; run-time -- ) \ core dot-quote |
\G Compilation: Parse a string @i{ccc} delimited by a " (double |
\G Compilation: Parse a string @i{ccc} delimited by a " (double |
\G quote). At run-time, display the string. Interpretation semantics |
\G quote). At run-time, display the string. Interpretation semantics |