[gforth] / gforth / kernel / doers.fs  

gforth: gforth/kernel/doers.fs


1 : anton 1.2 \ run-time code for defining words
2 :    
3 : anton 1.8 \ Copyright (C) 1995,1996,1997,1998,1999,2000,2003 Free Software Foundation, Inc.
4 : anton 1.2
5 :     \ This file is part of Gforth.
6 :    
7 :     \ Gforth is free software; you can redistribute it and/or
8 :     \ modify it under the terms of the GNU General Public License
9 :     \ as published by the Free Software Foundation; either version 2
10 :     \ of the License, or (at your option) any later version.
11 :    
12 :     \ This program is distributed in the hope that it will be useful,
13 :     \ but WITHOUT ANY WARRANTY; without even the implied warranty of
14 :     \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 :     \ GNU General Public License for more details.
16 :    
17 :     \ You should have received a copy of the GNU General Public License
18 :     \ along with this program; if not, write to the Free Software
19 : anton 1.6 \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
20 : pazsan 1.1
21 :    
22 :     \ If we leave out the compiler we need the runtime code for our defining
23 :     \ words. This file defines the defining words without the
24 :     \ interpretative/compiling part.
25 :    
26 :     has? compiler 0= [IF]
27 :    
28 :     \ fillers for interpreter only mode
29 : jwilke 1.3 \D compileddofillers .( Do-Fillers: )
30 : pazsan 1.1
31 :     : (does>) ;
32 :    
33 : jwilke 1.3 doer? :dofield 0= [IF] \D compileddofillers .( DOFIELD )
34 : pazsan 1.1 | : (Field) DOES> @ + ;
35 :     [THEN]
36 :    
37 : jwilke 1.3 doer? :dodefer 0= [IF] \D compileddofillers .( DODEFER )
38 : pazsan 1.1 | : Defer ( "name" -- ) DOES> @ execute ;
39 :     [THEN]
40 :    
41 : jwilke 1.3 \D compileddofillers .( DO2CON )
42 :     | : 2Constant ( w1 w2 "name" -- )
43 : pazsan 1.1 DOES> ( -- w1 w2 )
44 :     2@ ;
45 :    
46 : jwilke 1.3 doer? :docon 0= [IF] \D compileddofillers .( DOCON )
47 : pazsan 1.1 | : (Constant) DOES> @ ;
48 :     [THEN]
49 :    
50 : jwilke 1.3 doer? :douser 0= [IF] \D compileddofillers .( DOUSER )
51 : jwilke 1.4 | : User DOES> @ [IFDEF] up@ up@ [ELSE] up @ [THEN] + ;
52 : pazsan 1.1 [THEN]
53 :    
54 : jwilke 1.3 doer? :dovar 0= [IF] \D compileddofillers .( DOVAR )
55 : pazsan 1.1 | : Create ( "name" -- ) \ core
56 :     DOES> ;
57 :    
58 : jwilke 1.3 \D compileddofillers .( .)
59 : pazsan 1.1 [THEN]

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help