home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
EFFO
/
pd6.lzh
/
LIB
/
TILE
/
enumerates.f83
< prev
next >
Wrap
Text File
|
1989-12-21
|
2KB
|
63 lines
\
\ ENUMERATE VARIABLES
\
\ Copyright (c) 1989 by Mikael R.K. Patel
\
\ Computer Aided Design Laboratory (CADLAB)
\ Department of Computer and Information Science
\ Linkoping University
\ S-581 83 LINKOPING
\ SWEDEN
\
\ Email: mip@ida.liu.se
\
\ Started on: 30 June 1988
\
\ Last updated on: 24 November 1989
\
\ Dependencies:
\ (forth) none
\
\ Description:
\ Forth level definition of enumerate types and variables.
\
\ Copying:
\ This program is free software; you can redistribute it and\or modify
\ it under the terms of the GNU General Public License as published by
\ the Free Software Foundation; either version 1, or (at your option)
\ any later version.
\
\ This program is distributed in the hope that it will be useful,
\ but WITHOUT ANY WARRANTY; without even the implied warranty of
\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\ GNU General Public License for more details.
\
\ You should have received a copy of the GNU General Public License
\ along with this program; see the file COPYING. If not, write to
\ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.( Loading Enumeration definitions...) cr
vocabulary enumerates
enumerates definitions
: enum.type ( -- id0)
create 0 ( Create symbol and start definition)
does> drop variable ; ( Create variable for enumerate type)
: enum.null ( id1 -- id2)
1+ ; ( Advance to next identity)
: enum ( id1 -- id2)
dup constant enum.null ; ( Create an item and advance ident.)
: >enum ( value -- )
constant ; ( Create an item using value given)
: enum.end ( id3 -- )
drop ; ( Drop identity value)
forth only