File:  [gforth] / gforth / kernel / doers.fs
Revision 1.7: download - view: text, annotated - select for diffs
Sun Mar 9 15:17:05 2003 UTC (21 years, 1 month ago) by anton
Branches: MAIN
CVS tags: v0-6-1, v0-6-0, HEAD
updated copyright years

    1: \ run-time code for defining words
    2: 
    3: \ Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
    4: 
    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: \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
   20: 
   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: \D compileddofillers .( Do-Fillers: )
   30: 
   31: : (does>) ;    
   32: 
   33: doer? :dofield 0= [IF] \D compileddofillers .( DOFIELD )
   34: | : (Field)  DOES> @ + ;
   35: [THEN]
   36: 
   37: doer? :dodefer 0= [IF] \D compileddofillers .( DODEFER )
   38: | : Defer ( "name" -- ) DOES> @ execute ;
   39: [THEN]
   40: 
   41: \D compileddofillers .( DO2CON )
   42: | : 2Constant ( w1 w2 "name" -- ) 
   43:     DOES> ( -- w1 w2 )
   44:         2@ ;
   45: 
   46: doer? :docon 0= [IF] \D compileddofillers .( DOCON )
   47: | : (Constant)  DOES> @ ;
   48: [THEN]
   49: 
   50: doer? :douser 0= [IF] \D compileddofillers .( DOUSER )
   51: | : User DOES> @ [IFDEF] up@ up@ [ELSE] up @ [THEN] + ;
   52: [THEN]
   53: 
   54: doer? :dovar 0= [IF] \D compileddofillers .( DOVAR )
   55: | : Create ( "name" -- ) \ core
   56:     DOES> ;
   57: 
   58: \D compileddofillers .( .)
   59: [THEN]

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>