├── AUTHORS ├── COPYING ├── ChangeLog ├── NEWS ├── README ├── dist ├── engines ├── SwiftForth │ ├── config.fs │ └── make.fs ├── VFXForth │ ├── config.fs │ └── make.fs ├── Win32Forth │ ├── config.fs │ └── make.fs ├── alf │ ├── config.fs │ └── make.fs ├── bigforth │ ├── config.fs │ └── make.fs ├── fina │ ├── config.fs │ └── make.fs ├── flk │ ├── config.fs │ └── make.fs ├── general │ └── config.fs ├── gforth │ ├── changelog.Debian │ ├── config.fs │ ├── control │ ├── copyright │ ├── distdeb │ └── make.fs ├── iForth │ ├── config.fs │ └── make.fs ├── lxf │ ├── config.fs │ └── make.fs ├── minForth │ ├── config.fs │ └── make.fs ├── pfe │ ├── config.fs │ └── make.fs └── spf │ ├── config.fs │ └── make.fs ├── examples ├── a32_expl.fs ├── act_expl.fs ├── arg_expl.fs ├── b64_expl.fs ├── bar_expl.fs ├── bct_expl.fs ├── bis_expl.fs ├── bnt_expl.fs ├── car_expl.fs ├── cbf_expl.fs ├── chs_expl.fs ├── dcl_expl.fs ├── dnl_expl.fs ├── dom_expl.fs ├── dos_expl.fs ├── enm_expl.fs ├── fsdocgen.fs ├── fsm_expl.fs ├── gmo_expl.fs ├── gsv10_expl.fs ├── gsv12_expl.fs ├── gsv13_expl.fs ├── gsv14_expl.fs ├── gsv16_expl.fs ├── gsv17_expl.fs ├── gsv18_expl.fs ├── gsv19_expl.fs ├── gsv20_expl.fs ├── gsv21_expl.fs ├── gsv23_expl.fs ├── gsv24_expl.fs ├── gsv26_expl.fs ├── gsv27_expl.fs ├── gsv2_expl.fs ├── gsv3_expl.fs ├── gsv4_expl.fs ├── gsv5_expl.fs ├── gsv6_expl.fs ├── gsv7_expl.fs ├── gsv8_expl.fs ├── gsv99_expl.fs ├── gsv9_expl.fs ├── gsv_expl.fs ├── gtk-server.cfg ├── gzipped.gz ├── hct_expl.fs ├── hnt_expl.fs ├── index.html ├── info.xpm ├── jis_expl.fs ├── jos_expl.fs ├── lbf_expl.fs ├── log_expl.fs ├── md5_expl.fs ├── msc_expl.fs ├── nl.mo ├── rdg_expl.fs ├── rgx_expl.fs ├── scf_expl.fs ├── scl_expl.fs ├── sh1_expl.fs ├── sh2_expl.fs ├── snl_expl.fs ├── spf_expl.fs ├── stt_expl.fs ├── test.xml ├── tis_expl.fs ├── trk2rte.fs ├── xis_expl.fs ├── xos_expl.fs └── zif_expl.fs ├── ffl ├── a32.fs ├── acn.fs ├── act.fs ├── arg.fs ├── b64.fs ├── bar.fs ├── bci.fs ├── bcn.fs ├── bct.fs ├── bis.fs ├── bni.fs ├── bnn.fs ├── bnt.fs ├── car.fs ├── cbf.fs ├── chr.fs ├── chs.fs ├── config.fs ├── cpx.fs ├── crc.fs ├── dci.fs ├── dcl.fs ├── dcn.fs ├── dni.fs ├── dnl.fs ├── dnn.fs ├── docs ├── dom.fs ├── dos.fs ├── dti.fs ├── dtm.fs ├── enm.fs ├── est.fs ├── ffl.fs ├── frc.fs ├── fsm.fs ├── fst.fs ├── ftr.fs ├── fwt.fs ├── gmo.fs ├── gsv.fs ├── gzf.fs ├── gzi.fs ├── hci.fs ├── hcn.fs ├── hct.fs ├── hni.fs ├── hnn.fs ├── hnt.fs ├── jis.fs ├── jos.fs ├── lbf.fs ├── log.fs ├── make.fs ├── md5.fs ├── msc.fs ├── nci.fs ├── ncn.fs ├── nct.fs ├── nfe.fs ├── nfs.fs ├── nni.fs ├── nnn.fs ├── nnt.fs ├── rdg.fs ├── rgx.fs ├── rng.fs ├── scf.fs ├── sci.fs ├── scl.fs ├── scn.fs ├── sh1.fs ├── sh2.fs ├── sni.fs ├── snl.fs ├── snn.fs ├── spf.fs ├── stc.fs ├── str.fs ├── stt.fs ├── tis.fs ├── tlb.fs ├── tmr.fs ├── tos.fs ├── trm.fs ├── tst.fs ├── xis.fs ├── xos.fs └── zif.fs ├── html ├── a32.html ├── acn.html ├── act.html ├── arg.html ├── b64.html ├── bar.html ├── bci.html ├── bcn.html ├── bct.html ├── bis.html ├── bni.html ├── bnn.html ├── bnt.html ├── car.html ├── cbf.html ├── chr.html ├── chs.html ├── config.html ├── cpx.html ├── crc.html ├── dci.html ├── dcl.html ├── dcn.html ├── dni.html ├── dnl.html ├── dnn.html ├── dom.html ├── dos.html ├── dti.html ├── dtm.html ├── enm.html ├── est.html ├── ffl.html ├── frc.html ├── fsm.html ├── fst.html ├── ftr.html ├── fwt.html ├── gmo.html ├── gsv.html ├── gzf.html ├── gzi.html ├── hci.html ├── hcn.html ├── hct.html ├── hni.html ├── hnn.html ├── hnt.html ├── index.html ├── jis.html ├── jos.html ├── lbf.html ├── log.html ├── make.html ├── manual.html ├── md5.html ├── msc.html ├── nci.html ├── ncn.html ├── nct.html ├── nfe.html ├── nfs.html ├── nni.html ├── nnn.html ├── nnt.html ├── rdg.html ├── rgx.html ├── rng.html ├── scf.html ├── sci.html ├── scl.html ├── scn.html ├── sh1.html ├── sh2.html ├── sni.html ├── snl.html ├── snn.html ├── spf.html ├── stc.html ├── str.html ├── stt.html ├── tis.html ├── tlb.html ├── tmr.html ├── tos.html ├── trm.html ├── tst.html ├── words.html ├── xis.html ├── xos.html └── zif.html ├── test ├── README ├── a32_test.fs ├── act_test.fs ├── arg_test.fs ├── b64_test.fs ├── bar_test.fs ├── bct_test.fs ├── bis_test.fs ├── bnt_test.fs ├── car_test.fs ├── cbf_test.fs ├── chr_test.fs ├── chs_test.fs ├── cpx_test.fs ├── crc_test.fs ├── dcl_test.fs ├── dnl_test.fs ├── dom_test.fs ├── dos_test.fs ├── dtm_test.fs ├── est_test.fs ├── ffl_test.fs ├── fixed.gz ├── frc_test.fs ├── fsm_test.fs ├── fwt_test.fs ├── gmo_test.fs ├── gzipped.gz ├── hct_test.fs ├── jis_test.fs ├── jos_test.fs ├── lbf_test.fs ├── log_test.fs ├── md5_test.fs ├── msc_test.fs ├── nct_test.fs ├── nl.mo ├── nl.po ├── nnt_test.fs ├── rdg_test.fs ├── rgx_test.fs ├── rng_test.fs ├── scf_test.fs ├── scl_test.fs ├── sh1_test.fs ├── sh2_test.fs ├── snl_test.fs ├── spf_test.fs ├── stored.gz ├── str_test.fs ├── stt_test.fs ├── test.xml ├── tis_test.fs ├── tmr_test.fs ├── tos_test.fs ├── xis_test.fs ├── xos_test.fs └── zif_test.fs └── tex ├── forth-refcard1.tex └── forth-refcard2.tex /AUTHORS: -------------------------------------------------------------------------------- 1 | Forth Foundation Library is created by: 2 | 3 | Dick van Oudheusden 4 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | see http://code.google.com/p/ffl/wiki/News 2 | -------------------------------------------------------------------------------- /dist: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | package=ffl 4 | version=0.9.0 5 | 6 | dest=${package}-${version} 7 | 8 | mkdir ${dest} 9 | mkdir ${dest}/ffl 10 | mkdir ${dest}/test 11 | mkdir ${dest}/html 12 | mkdir ${dest}/examples 13 | mkdir ${dest}/engines 14 | mkdir ${dest}/engines/gforth 15 | mkdir ${dest}/engines/bigforth 16 | mkdir ${dest}/engines/pfe 17 | mkdir ${dest}/engines/Win32Forth 18 | mkdir ${dest}/engines/fina 19 | mkdir ${dest}/engines/minForth 20 | mkdir ${dest}/engines/iForth 21 | mkdir ${dest}/engines/spf 22 | mkdir ${dest}/engines/flk 23 | mkdir ${dest}/engines/lxf 24 | mkdir ${dest}/engines/VFXForth 25 | 26 | cp AUTHORS COPYING NEWS README ChangeLog ${dest} 27 | cp ffl/*.fs ${dest}/ffl 28 | cp ffl/ffl.api ${dest}/ffl 29 | cp test/*.fs ${dest}/test 30 | cp html/*.html ${dest}/html 31 | cp examples/*.fs ${dest}/examples 32 | 33 | cp engines/gforth/*.fs ${dest}/engines/gforth 34 | cp engines/bigforth/*.fs ${dest}/engines/bigforth 35 | cp engines/pfe/*.fs ${dest}/engines/pfe 36 | cp engines/Win32Forth/*.fs ${dest}/engines/Win32Forth 37 | cp engines/fina/*.fs ${dest}/engines/fina 38 | cp engines/minForth/*.fs ${dest}/engines/minForth 39 | cp engines/iForth/*.fs ${dest}/engines/iForth 40 | cp engines/spf/*.fs ${dest}/engines/spf 41 | cp engines/flk/*.fs ${dest}/engines/flk 42 | cp engines/lxf/*.fs ${dest}/engines/lxf 43 | cp engines/VFXForth/*.fs ${dest}/engines/VFXForth 44 | 45 | cp test/nl.po ${dest}/test 46 | cp test/nl.mo ${dest}/test 47 | cp test/test.xml ${dest}/test 48 | cp test/stored.gz ${dest}/test 49 | cp test/fixed.gz ${dest}/test 50 | cp test/gzipped.gz ${dest}/test 51 | 52 | cp examples/test.xml ${dest}/examples 53 | cp examples/nl.mo ${dest}/examples 54 | cp examples/index.html ${dest}/examples 55 | cp examples/gzipped.gz ${dest}/examples 56 | cp examples/info.xpm ${dest}/examples 57 | cp examples/gtk-server.cfg ${dest}/examples 58 | 59 | tar cvzf ${package}-${version}.tar.gz ${dest} 60 | 61 | 62 | todos ${dest}/AUTHORS 63 | todos ${dest}/COPYING 64 | todos ${dest}/NEWS 65 | todos ${dest}/README 66 | todos ${dest}/ChangeLog 67 | todos ${dest}/ffl/*.fs 68 | todos ${dest}/test/*.fs 69 | todos ${dest}/examples/*.fs 70 | 71 | todos ${dest}/engines/gforth/*.fs 72 | todos ${dest}/engines/bigforth/*.fs 73 | todos ${dest}/engines/pfe/*.fs 74 | todos ${dest}/engines/Win32Forth/*.fs 75 | todos ${dest}/engines/fina/*.fs 76 | todos ${dest}/engines/minForth/*.fs 77 | todos ${dest}/engines/iForth/*.fs 78 | todos ${dest}/engines/spf/*.fs 79 | todos ${dest}/engines/flk/*.fs 80 | todos ${dest}/engines/lxf/*.fs 81 | todos ${dest}/engines/VFXForth/*.fs 82 | 83 | zip -r ${package}-${version}.zip ${dest} 84 | 85 | rm -rf ${dest} 86 | -------------------------------------------------------------------------------- /engines/SwiftForth/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for SwiftForth 4 | \ 5 | \ Copyright (C) 2012 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-03-02 15:03:02 $ $Revision: 1.6 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | .( Forth Foundation Library: ) cr 28 | 29 | counter 30 | 31 | unused 32 | 33 | include ffl/ffl.fs 34 | 35 | unused - 36 | 37 | 38 | .( Compilation Size: ) . .( bytes) cr 39 | 40 | counter swap - 41 | 42 | .( Compilation Time: ) . .( msec) cr 43 | 44 | \ ============================================================================== 45 | 46 | -------------------------------------------------------------------------------- /engines/VFXForth/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for VFX Forth 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2006-12-23 18:24:27 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | [defined] Target_386_Windows [if] 28 | : ms@ ( -- ms ) GetTickCount ; 29 | [then] 30 | 31 | [defined] Target_386_Linux [if] 32 | : ms@ ( -- ms ) ticks ; 33 | [then] 34 | 35 | 36 | .( Forth Foundation Library: ) cr 37 | 38 | ms@ 39 | 40 | unused 41 | 42 | include ffl/ffl.fs 43 | 44 | unused - 45 | 46 | 47 | .( Compilation Size: ) . .( bytes) cr 48 | 49 | ms@ swap - 50 | 51 | .( Compilation Time: ) . .( msec) cr 52 | 53 | \ ============================================================================== 54 | 55 | 56 | -------------------------------------------------------------------------------- /engines/Win32Forth/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for Win32Forth 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2006-12-23 18:24:27 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | .( Forth Foundation Library: ) cr 28 | 29 | ms@ 30 | 31 | unused 32 | 33 | include ffl/ffl.fs 34 | 35 | unused - 36 | 37 | 38 | .( Compilation Size: ) . .( bytes) cr 39 | 40 | ms@ swap - 41 | 42 | .( Compilation Time: ) . .( msec) cr 43 | 44 | \ ============================================================================== 45 | 46 | 47 | -------------------------------------------------------------------------------- /engines/alf/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for alf 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-02-03 07:19:45 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | .( Forth Foundation Library: ) cr 28 | 29 | ms@ 30 | 31 | unused 32 | 33 | include ffl/ffl.fs 34 | 35 | unused - 36 | 37 | 38 | .( Compilation Size: ) . .( bytes) cr 39 | 40 | ms@ swap - 41 | 42 | .( Compilation Time: ) . .( msec) cr 43 | 44 | \ ============================================================================== 45 | 46 | -------------------------------------------------------------------------------- /engines/bigforth/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for bigforth 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2006-12-23 18:24:27 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | : (ms@) 28 | timer@ >us 1 1000 m*/ drop 29 | ; 30 | 31 | 32 | (ms@) 33 | 34 | unused 35 | 36 | include ffl/ffl.fs 37 | 38 | unused - 39 | 40 | 41 | .( Compilation size: ) . .( bytes) cr 42 | 43 | (ms@) swap - 44 | 45 | .( Compilation time: ) u. .( msec) cr 46 | 47 | \ ============================================================================== 48 | 49 | -------------------------------------------------------------------------------- /engines/fina/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for fina 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-01-28 19:52:35 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/config.fs 28 | .( Forth Foundation Library: ) cr 29 | ms@ 30 | 31 | unused 32 | 33 | include ffl/ffl.fs 34 | 35 | unused - 36 | 37 | 38 | .( Compilation Size: ) . .( bytes) cr 39 | 40 | ms@ swap - 41 | 42 | .( Compilation Time: ) . .( msec) cr 43 | 44 | \ ============================================================================== 45 | -------------------------------------------------------------------------------- /engines/flk/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for flk 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-04-30 06:15:13 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | : timer@ 28 | time_of_day 29 | swap 1000 um* 30 | rot 1000 / 31 | m+ drop 32 | ; 33 | 34 | .( Forth Foundation Library: ) cr 35 | timer@ 36 | cunused 37 | unused 38 | 39 | include ffl/ffl.fs 40 | 41 | unused - swap 42 | cunused - + 43 | 44 | .( Compilation Size: ) . .( bytes) cr 45 | 46 | timer@ swap - 47 | 48 | .( Compilation Time: ) . .( msec) cr 49 | 50 | \ ============================================================================== 51 | 52 | -------------------------------------------------------------------------------- /engines/gforth/changelog.Debian: -------------------------------------------------------------------------------- 1 | No special Debian changes. 2 | -------------------------------------------------------------------------------- /engines/gforth/control: -------------------------------------------------------------------------------- 1 | Package: ffl-gforth 2 | Source: ffl 3 | Version: 0.9.0-1 4 | Architecture: all 5 | Maintainer: Dick van Oudheusden 6 | Installed-Size: 1900 7 | Depends: gforth 8 | Section: interpreters 9 | Priority: optional 10 | Homepage: http://code.google.com/p/ffl/ 11 | Description: Forth Foundation Library 12 | Library of useful Forth words, configured for gforth. 13 | . 14 | A set of general-purpose library modules for ANS Forth. 15 | Covered areas include: 16 | * basic data types 17 | * collections 18 | * hashes 19 | * pseudo random generators 20 | * gunzip interface 21 | * message catalog 22 | * xml/html parser 23 | * xml-dom 24 | * regular expressions 25 | * streams 26 | * unit tests 27 | . 28 | This package provides the architecture-independent Forth library. 29 | -------------------------------------------------------------------------------- /engines/gforth/copyright: -------------------------------------------------------------------------------- 1 | Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 2 | Name: ffl-gforth 3 | Maintainer: Dick van Oudheusden 4 | Source: http://code.google.com/p/ffl/ 5 | 6 | Files: * 7 | Copyright: 2005-2010 Dick van Oudheusden 8 | License: GPL-2+ 9 | 10 | License: GPL-2+ 11 | This program is free software; you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation; either version 2 of the License, or 14 | (at your option) any later version. 15 | . 16 | This program is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | GNU General Public License for more details. 20 | . 21 | You should have received a copy of the GNU General Public License along 22 | with this program; if not, write to the Free Software Foundation, Inc., 23 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | . 25 | On Debian systems, the full text of the GNU General Public 26 | License version 2 can be found in the file 27 | `/usr/share/common-licenses/GPL-2'. 28 | 29 | -------------------------------------------------------------------------------- /engines/gforth/distdeb: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | version=0.9.0 4 | 5 | rm -rf debian 6 | rm ffl-gforth_${version}-1_all.deb 7 | 8 | debian=debian/DEBIAN 9 | mkdir -p ${debian} 10 | cp control ${debian} 11 | 12 | site=debian/usr/share/gforth/site-forth/ffl 13 | mkdir -p ${site} 14 | cp ../../ffl/*.fs ${site} 15 | 16 | tests=debian/usr/share/ffl/${version}/test 17 | mkdir -p ${tests} 18 | cp ../../test/*.fs ${tests} 19 | cp ../../test/nl.po ${tests} 20 | cp ../../test/nl.mo ${tests} 21 | cp ../../test/test.xml ${tests} 22 | cp ../../test/stored.gz ${tests} 23 | cp ../../test/fixed.gz ${tests} 24 | cp ../../test/gzipped.gz ${tests} 25 | 26 | examples=debian/usr/share/ffl/${version}/examples 27 | mkdir -p ${examples} 28 | cp ../../examples/*.fs ${examples} 29 | cp ../../examples/test.xml ${examples} 30 | cp ../../examples/nl.mo ${examples} 31 | cp ../../examples/index.html ${examples} 32 | cp ../../examples/gzipped.gz ${examples} 33 | cp ../../examples/info.xpm ${examples} 34 | cp ../../examples/gtk-server.cfg ${examples} 35 | 36 | docs=debian/usr/share/doc/ffl 37 | mkdir -p ${docs} 38 | cp ../../html/*.html ${docs} 39 | cp ../../README ${docs} 40 | cp copyright ${docs} 41 | cp ../../ChangeLog ${docs}/changelog 42 | gzip ${docs}/changelog 43 | cp changelog.Debian ${docs} 44 | 45 | fakeroot dpkg-deb --build debian 46 | 47 | mv debian.deb ffl-gforth_${version}-1_all.deb 48 | 49 | -------------------------------------------------------------------------------- /engines/gforth/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for gforth 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-03-02 15:03:02 $ $Revision: 1.6 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include tags.fs 28 | 29 | .( Forth Foundation Library: ) cr 30 | utime 31 | 32 | unused 33 | 34 | include ffl/ffl.fs 35 | 36 | unused - 37 | 38 | 39 | .( Compilation Size: ) . .( bytes) cr 40 | 41 | utime 2swap d- 1 1000 m*/ 42 | 43 | .( Compilation Time: ) d. .( msec) cr 44 | 45 | \ ============================================================================== 46 | 47 | -------------------------------------------------------------------------------- /engines/iForth/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for iForth 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-03-23 07:19:36 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | cr .( Forth Foundation Library: ) 28 | ms? 29 | 30 | unused 31 | 32 | include ffl-0.9.0/ffl.fs 33 | 34 | unused - 35 | 36 | 37 | cr .( Compilation Size: ) . .( bytes) 38 | 39 | ms? swap - 40 | 41 | cr .( Compilation Time: ) . .( msec) 42 | 43 | \ ============================================================================== 44 | 45 | -------------------------------------------------------------------------------- /engines/lxf/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for lxf 4 | \ 5 | \ Copyright (C) 2008 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-05-24 11:01:18 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | 28 | .( Forth Foundation Library: ) cr 29 | ms@ 30 | 31 | .mem 32 | 33 | include ffl/ffl.fs 34 | 35 | .mem 36 | 37 | ms@ swap - 38 | 39 | .( Compilation Time: ) . .( msec) cr 40 | 41 | \ ============================================================================== 42 | 43 | -------------------------------------------------------------------------------- /engines/minForth/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for minForth 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-04-01 04:40:12 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | .( Forth Foundation Library: ) cr 28 | msecs 29 | 30 | unused unused-n 31 | 32 | include ffl/ffl.fs 33 | 34 | unused-n - swap unused - + 35 | 36 | .( Compilation Size: ) . .( bytes) cr 37 | 38 | msecs swap - 39 | 40 | .( Compilation Time: ) . .( msec) cr 41 | 42 | \ ============================================================================== 43 | 44 | -------------------------------------------------------------------------------- /engines/pfe/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for pfe 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2006-12-23 18:24:27 $ $Revision: 1.4 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | .( Forth Foundation Library: ) cr 28 | 29 | : timer@ 30 | gettimeofday 1000 * swap 1000 / + 31 | ; 32 | 33 | timer@ 34 | 35 | unused 36 | 37 | include ffl/ffl.fs 38 | 39 | unused - 40 | 41 | 42 | .( Compilation Size: ) . .( bytes) cr 43 | 44 | timer@ swap - 45 | 46 | .( Compilation Time: ) u. .( msec) cr 47 | 48 | \ ============================================================================== 49 | 50 | -------------------------------------------------------------------------------- /engines/spf/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for sp-forth 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-05-04 09:42:22 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | REQUIRE ffl.version ffl/config.fs 28 | 29 | ms@ 30 | 31 | unused 32 | 33 | include ffl/ffl.fs 34 | 35 | unused - 36 | 37 | 38 | .( Compilation size: ) . .( bytes) cr 39 | 40 | ms@ swap - 41 | 42 | .( Compilation time: ) u. .( msec) cr 43 | 44 | \ ============================================================================== 45 | 46 | -------------------------------------------------------------------------------- /examples/a32_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ a32_expl - the Adler32 example in the ffl 4 | \ 5 | \ Copyright (C) 2008 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-04-05 08:05:28 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/a32.fs 28 | 29 | 30 | \ Create an Adler32 variable ad1 in the dictionary 31 | 32 | a32-create ad1 33 | 34 | \ Update the variable with data 35 | 36 | s" The quick brown fox jumps over the lazy dog" ad1 a32-update 37 | 38 | \ Finish the Adler32 calculation resulting in unsigned 32 bit word 39 | \ on the stack representing the value 40 | 41 | ad1 a32-finish 42 | 43 | \ Convert the value to a hex string and print 44 | 45 | a32+to-string type cr 46 | 47 | 48 | 49 | \ Create an Adler32 variable on the heap 50 | 51 | a32-new value ad2 52 | 53 | \ Update the variable with multiple data 54 | 55 | s" The quick brown fox " ad2 a32-update 56 | s" jumps over the lazy dog" ad2 a32-update 57 | 58 | \ Finish the calculation 59 | 60 | ad2 a32-finish 61 | 62 | \ Convert the value to a hex string and print 63 | 64 | a32+to-string type cr 65 | 66 | \ Free the variable from the heap 67 | 68 | ad2 a32-free 69 | -------------------------------------------------------------------------------- /examples/b64_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ b64_expl - the Base64 example in the ffl 4 | \ 5 | \ Copyright (C) 2009 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-04-05 08:05:28 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/b64.fs 28 | 29 | 30 | \ Create a string in the dictionary for storing the encoded characters 31 | 32 | str-create inbase64 33 | 34 | \ Encode the string: The quick brown fox jumps over the lazy dog 35 | 36 | s" The quick brown fox jumps over the lazy dog" inbase64 b64-encode 37 | 38 | \ Print the result 39 | 40 | .( Base64 encoding of 'The quick brown fox jumps over the lazy dog' is: ) type cr 41 | 42 | \ The result is also stored in inbase64 43 | 44 | .( inbase64 contents: ) inbase64 str-get type cr 45 | 46 | 47 | \ Create a string on the heap for storing the decoded characters 48 | 49 | str-new value frombase64 50 | 51 | \ Decode the encoded string of The quick brown fox jumps over the lazy dog 52 | 53 | s" VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw==" frombase64 b64-decode 54 | 55 | .( Base64 decoding of 'VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw==' is: ) type cr 56 | 57 | \ The result is also stored in frombase64 58 | 59 | .( frombase64 contents: ) frombase64 str-get type cr 60 | 61 | \ Free the string from the heap 62 | 63 | frombase64 str-free 64 | -------------------------------------------------------------------------------- /examples/bar_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ bar_expl - the bit array example in the ffl 4 | \ 5 | \ Copyright (C) 2008 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-10-05 06:34:20 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/bar.fs 28 | 29 | 30 | \ Create a bit array with 15 bits [0..14] in the dictionary 31 | 32 | 15 bar-create bar1 33 | 34 | 35 | \ Set bit 1, 4..8, 12 and 14 in the array 36 | 37 | 1 bar1 bar-set-bit 38 | 5 4 bar1 bar-set-bits 39 | 40 | 12 14 2 bar1 bar-set-list \ new in version 3 41 | 42 | \ Count the number of bits set 43 | 44 | .( There are ) bar1 bar-count . .( bits set in the array.) cr 45 | 46 | \ Check for bits 47 | 48 | 6 bar1 bar-get-bit [IF] 49 | .( Bit 6 is set in the array.) cr 50 | [ELSE] 51 | .( Bit 6 is not set in the array.) cr 52 | [THEN] 53 | 54 | 13 bar1 bar-get-bit [IF] 55 | .( Bit 13 is set in the array.) cr 56 | [ELSE] 57 | .( Bit 13 is not set in the array.) cr 58 | [THEN] 59 | 60 | 61 | \ Create a bit array with 8 bits on the heap 62 | 63 | 8 bar-new value bar2 64 | 65 | \ Set all bits in the array 66 | 67 | bar2 bar-set 68 | 69 | \ Reset bits 5..7 in the array 70 | 71 | 3 5 bar2 bar-reset-bits 72 | 73 | \ Print the bit array by executing bar-emit for every bit in the array 74 | 75 | : bar-emit ( flag -- ) 76 | 1 AND [char] 0 + emit 77 | ; 78 | 79 | .( Bit array: ) ' bar-emit bar2 bar-execute cr 80 | 81 | \ Hamming distance 82 | 83 | .( Hamming distance: ) 84 | bar2 bar1 bar^xor \ new in version 3 85 | bar1 bar-count . cr 86 | 87 | \ Free the array from the heap 88 | 89 | bar2 bar-free 90 | 91 | -------------------------------------------------------------------------------- /examples/bis_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ bis_expl - the bit input stream example in the ffl 4 | \ 5 | \ Copyright (C) 2008 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-09-07 06:52:17 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/bis.fs 28 | 29 | 30 | \ Create an bit input stream variable bis1 in the dictionary 31 | 32 | bis-create bis1 33 | 34 | \ Give the stream some input data (note: the stream does not make a copy of the data) 35 | 36 | : bis-ab ( -- c-addr u ) s" ab" ; 37 | 38 | bis-ab bis1 bis-set 39 | 40 | \ Try reading 10 bits from the stream 41 | 42 | 10 bis1 bis-need-bits [IF] 43 | .( There are 10 bits available in the buffer. ) cr 44 | [ELSE] 45 | .( There are not enough bits availabe in the buffer, refill.) cr 46 | [THEN] 47 | 48 | \ Read the bits from the stream 49 | 50 | .( The 10 bits from the stream:) 10 bis1 bis-fetch-bits . cr 51 | 52 | \ Indicate the the 10 bits are processed 53 | 54 | 10 bis1 bis-next-bits 55 | 56 | \ Try reading another 10 bits from the stream 57 | 58 | 10 bis1 bis-need-bits [IF] 59 | .( There are another 10 bits available in the buffer.) cr 60 | [ELSE] 61 | .( There are not enough bits available in the buffer, refill.) cr 62 | [THEN] 63 | 64 | \ Refill the input stream 65 | 66 | : bis-cd ( -- c-addr u) s" cd" ; 67 | 68 | bis-cd bis1 bis-set 69 | 70 | \ Again try reading another 10 bits from the stream 71 | 72 | 10 bis1 bis-need-bits [IF] 73 | .( There are another 10 bits available in the buffer.) cr 74 | [ELSE] 75 | .( There are not enough bits available in the buffer, refill.) cr 76 | [THEN] 77 | 78 | \ Read the bits from the stream and indicate that the bits are processed 79 | 80 | .( The 10 bits from the stream:) 10 bis1 bis-fetch-bits . cr 81 | 82 | \ Indicate the the 10 bits are processed 83 | 84 | 10 bis1 bis-next-bits 85 | 86 | -------------------------------------------------------------------------------- /examples/chs_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ chs_expl - the character set example in the ffl 4 | \ 5 | \ Copyright (C) 2008 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-10-05 06:34:20 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/chs.fs 28 | 29 | 30 | \ Create a character set variable chs1 in the dictionary 31 | 32 | chs-create chs1 33 | 34 | \ Set 'a', '*', 'q', 'w' and '0'..'9' in the set 35 | 36 | char a chs1 chs-set-char 37 | char * chs1 chs-set-char 38 | 39 | char 9 char 0 chs1 chs-set-chars 40 | 41 | s" qw" chs1 chs-set-string 42 | 43 | \ Check for characters in the set 44 | 45 | char 7 chs1 chs-char? [IF] 46 | .( Character '7' is in the set ) cr 47 | [ELSE] 48 | .( Character '7' is not in the set ) cr 49 | [THEN] 50 | 51 | char ; chs1 chs-char? [IF] 52 | .( Character ';' is in the set ) cr 53 | [ELSE] 54 | .( Character ';' is not in the set ) cr 55 | [THEN] 56 | 57 | \ Create a character set on the heap 58 | 59 | chs-new value chs2 60 | 61 | \ Use the space and xdigit classes to fill the set 62 | 63 | chs1 chs-set-space 64 | chs1 chs-set-xdigit 65 | 66 | \ Invert the set so that the set contains no spaces and xdigits 67 | 68 | chs1 chs-invert 69 | 70 | \ Print the set contents by excecuting chs-emit for every character in the set 71 | 72 | : chs-emit ( char -- ) 73 | dup chr-print? IF 74 | emit 75 | ELSE 76 | [char] < emit 0 .r [char] > emit 77 | THEN 78 | ; 79 | 80 | .( Set:) ' chs-emit chs1 chs-execute cr 81 | 82 | \ Free the set from the heap 83 | 84 | chs2 chs-free 85 | 86 | -------------------------------------------------------------------------------- /examples/dcl_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ dcl_expl - the cell based double linked list example in the ffl 4 | \ 5 | \ Copyright (C) 2010 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-04-10 16:12:01 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/dcl.fs 28 | include ffl/rng.fs 29 | 30 | 31 | \ Example: sort a cell based double linked list with 1001 random numbers 32 | 33 | 34 | \ Create the double linked list on the heap 35 | 36 | dcl-new value nlist 37 | 38 | \ Create the pseudo random generator in the dictionary with seed 9898 39 | 40 | 9898 rng-create nrng 41 | 42 | \ Insert 1001 numbers in the nlist 43 | 44 | : nlist-insert ( n -- = Insert n random numbers in nlist ) 45 | 0 DO 46 | nrng rng-next-number \ Generate random number and .. 47 | nlist dcl-append \ .. append to the list 48 | LOOP 49 | ; 50 | 51 | 1001 nlist-insert 52 | 53 | \ Check the number of numbers out of sequence 54 | 55 | : nnode-out-sequence ( n1 n2 flag n3 -- n4 n5 true = Count the number of out of sequence number, n1: count n2:previous number n3: number ) 56 | swap IF 57 | tuck > IF >r 1+ r> THEN \ Compare current number with previous number increment counter if out of sequence 58 | ELSE 59 | nip \ First call, no check 60 | THEN 61 | true 62 | ; 63 | 64 | .( Before sorting there are ) 0 0 false ' nnode-out-sequence nlist dcl-execute 2drop . .( numbers out of sequence. ) cr 65 | 66 | \ Sort the list using the <=> word 67 | 68 | ' <=> nlist dcl-sort 69 | 70 | \ Check the number of numbers out of sequence again 71 | 72 | .( After sorting there are ) 0 0 false ' nnode-out-sequence nlist dcl-execute 2drop . .( numbers out of sequence. ) cr 73 | 74 | \ Reverse the list 75 | 76 | nlist dcl-reverse 77 | 78 | \ Check the number of out of sequence numbers again 79 | 80 | .( After reversing there are ) 0 0 false ' nnode-out-sequence nlist dcl-execute 2drop . .( numbers out of sequence. ) cr 81 | 82 | \ Cleanup the list 83 | 84 | nlist dcl-free 85 | 86 | -------------------------------------------------------------------------------- /examples/dos_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ dos_expl - the date output stream example in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-11-22 19:15:25 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/dos.fs 28 | include ffl/gmo.fs 29 | 30 | 31 | 32 | \ Example 1: Format the output with words 33 | 34 | \ Create the date and output stream in the dictionary 35 | 36 | dtm-create dtm1 37 | tos-create tos1 38 | 39 | \ Set the date with 22 november 2007 15:00:59 40 | 41 | 0 59 00 15 22 dtm.may 2007 dtm1 dtm-set 42 | 43 | \ Format the output stream 44 | 45 | dtm1 tos1 dos-write-date-time 46 | 47 | tos1 str-get type cr \ Shows: 2007/05/22 15:00:59 48 | 49 | tos1 tos-rewrite \ Clean the stream 50 | 51 | dtm1 tos1 dos-write-weekday-name 52 | 53 | tos1 str-get type cr \ Shows: Tuesday 54 | 55 | 56 | 57 | \ Example 2: Format the output with a string format 58 | 59 | tos1 tos-rewrite 60 | 61 | dtm1 s" %a %b %e %H:%M:%S %Y" tos1 dos-write-format 62 | 63 | tos1 str-get type cr \ Shows: Tue May 22 15:00:59 2007 64 | 65 | 66 | 67 | \ Example 3: Use a message catalog for localisation of dates 68 | 69 | msc-create en>nl \ Create the message catalog 70 | 71 | s" nl.mo" en>nl gmo-read throw \ Import the nl.mo file in the catalog 72 | 73 | en>nl tos1 tos-msc! \ Let the ouput stream use the message catalog 74 | 75 | 76 | tos1 tos-rewrite \ Clear the output stream 77 | 78 | dtm1 s" %a %b %e %H:%M:%S %Y" tos1 dos-write-format 79 | 80 | tos1 str-get type cr \ Shows: din mei 22 15:00:59 2007 (dutch) 81 | -------------------------------------------------------------------------------- /examples/enm_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ enm_expl - the enumeration example in the ffl 4 | \ 5 | \ Copyright (C) 2008 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-02-24 07:43:43 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/enm.fs 28 | 29 | 30 | \ Example: number names 31 | 32 | begin-enumeration 33 | enum: zero \ Default: an enum start with 0 34 | enum: one 35 | enum: two 36 | enum: three 37 | enum: four 38 | enum: five 39 | end-enumeration 40 | 41 | .( Enum zero: ) zero . .( and three: ) three . cr 42 | 43 | 44 | \ Example: month names 45 | 46 | begin-enumeration 47 | 1 48 | >enum: january \ Start this enumeration with 1 49 | enum: february 50 | enum: march 51 | enum: april 52 | enum: may 53 | enum: june 54 | enum: july 55 | enum: august 56 | enum: september 57 | enum: october 58 | enum: november 59 | enum: december 60 | end-enumeration 61 | 62 | .( January: ) january . .( and december: ) december . cr 63 | -------------------------------------------------------------------------------- /examples/gmo_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ gmo_expl - the gettexts mo-file import example in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-11-17 07:47:22 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/gmo.fs 28 | 29 | 30 | \ Example: import nl.mo file in a message catalog 31 | 32 | msc-new value en>nl \ Create a message catalog on the heap 33 | 34 | s" nl.mo" en>nl gmo-read throw \ Import the nl.mo file in the catalog 35 | 36 | s" Sunday" en>nl msc-translate type cr \ Use the catalog for the translations 37 | 38 | en>nl msc-free \ Free the message catalog from the heap 39 | -------------------------------------------------------------------------------- /examples/gsv17_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ gsv17_expl - the gtk-server file chooser example in the ffl 4 | \ 5 | \ Copyright (C) 2009 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2009-05-28 17:35:58 $ $Revision: 1.11 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/gsv.fs 28 | 29 | \ Open the connection to the gtk-server and load all definitions from the gtk-server.cfg file 30 | 31 | s" gtk-server.cfg" s" ffl-fifo" gsv+open 0= [IF] 32 | 33 | : example 34 | gtk_init \ Initialise toolkit 35 | \ Open file chooser dialog 36 | GTK_RESPONSE_ACCEPT s" gtk-open" GTK_RESPONSE_CANCEL s" gtk-cancel" GTK_FILE_CHOOSER_ACTION_OPEN 0 s" Open File" gtk_file_chooser_dialog_new >r 37 | 38 | r@ gtk_dialog_run GTK_RESPONSE_ACCEPT = IF 39 | ." Open file:" r@ gtk_file_chooser_get_filename type cr 40 | THEN 41 | 42 | r> gtk_widget_destroy 43 | 44 | 0 gtk_exit 45 | ; 46 | 47 | example 48 | 49 | gsv+close drop 50 | 51 | [ELSE] 52 | .( No gtk-server fifo, is the gtk-server running ? ) cr 53 | [THEN] 54 | 55 | 56 | \ ============================================================================== 57 | -------------------------------------------------------------------------------- /examples/gsv20_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ gsv20_expl - the gtk-server frame example in the ffl 4 | \ 5 | \ Copyright (C) 2009 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2009-05-28 17:35:58 $ $Revision: 1.11 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/gsv.fs 28 | 29 | \ Open the connection to the gtk-server and load all definitions from the gtk-server.cfg file 30 | 31 | s" gtk-server.cfg" s" ffl-fifo" gsv+open 0= [IF] 32 | 33 | : event>widget ( c-addr u -- n = Convert the event string to a widget id ) 34 | 0. 2swap >number 2drop d>s 35 | ; 36 | 37 | 38 | 0 value window \ Widgets/events 39 | 40 | 41 | : example 42 | gtk_init \ Initialise toolkit 43 | 44 | GTK_WINDOW_TOPLEVEL gtk_window_new to window 45 | 46 | s" Frame Example" window gtk_window_set_title 47 | 48 | 300 300 window gtk_widget_set_size_request 49 | 50 | 10 window gtk_container_set_border_width 51 | 52 | \ Create a Frame 53 | s" " gtk_frame_new >r 54 | r@ window gtk_container_add 55 | 56 | \ Set the frame's label 57 | s" GTK Frame Widget" r@ gtk_frame_set_label 58 | 59 | \ Align the label at the right of the frame 60 | 0.0E+0 1.0E+0 r@ gtk_frame_set_label_align 61 | 62 | \ Set the style of the frame 63 | GTK_SHADOW_ETCHED_OUT r@ gtk_frame_set_shadow_type 64 | 65 | r> gtk_widget_show 66 | 67 | \ Display the window 68 | window gtk_widget_show 69 | 70 | \ main loop 71 | BEGIN 72 | s" WAIT" gtk_server_callback 73 | event>widget window = \ Done if window event 74 | UNTIL 75 | 76 | 0 gtk_exit 77 | ; 78 | 79 | example 80 | 81 | gsv+close drop 82 | 83 | [ELSE] 84 | .( No gtk-server fifo, is the gtk-server running ? ) cr 85 | [THEN] 86 | 87 | 88 | \ ============================================================================== 89 | -------------------------------------------------------------------------------- /examples/gsv21_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ gsv21_expl - the gtk-server aspect frame example in the ffl 4 | \ 5 | \ Copyright (C) 2009 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2009-05-28 17:35:58 $ $Revision: 1.11 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/gsv.fs 28 | 29 | \ Open the connection to the gtk-server and load all definitions from the gtk-server.cfg file 30 | 31 | s" gtk-server.cfg" s" ffl-fifo" gsv+open 0= [IF] 32 | 33 | : event>widget ( c-addr u -- n = Convert the event string to a widget id ) 34 | 0. 2swap >number 2drop d>s 35 | ; 36 | 37 | 38 | 0 value window \ Widgets/events 39 | 40 | 41 | : example 42 | gtk_init \ Initialise toolkit 43 | 44 | GTK_WINDOW_TOPLEVEL gtk_window_new to window 45 | 46 | s" Aspect Frame" window gtk_window_set_title 47 | 48 | 10 window gtk_container_set_border_width 49 | 50 | \ Create an aspect_frame and add it to our toplevel window 51 | 52 | false 2.0E+0 0.5E+0 0.5E+0 s" 2x1" gtk_aspect_frame_new >r 53 | 54 | r@ window gtk_container_add 55 | 56 | \ Now add a child widget to the aspect frame 57 | 58 | gtk_drawing_area_new >r 59 | 60 | \ Ask for a 200x200 window, but the AspectFrame will give us a 200x100 window since we are forcing a 2x1 aspect ratio 61 | 200 200 r@ gtk_widget_set_size_request 62 | r@ r'@ gtk_container_add 63 | r> gtk_widget_show 64 | 65 | r> gtk_widget_show \ aspect frame 66 | 67 | window gtk_widget_show 68 | 69 | \ main loop 70 | BEGIN 71 | s" WAIT" gtk_server_callback 72 | event>widget window = \ only one event 73 | UNTIL 74 | 75 | 0 gtk_exit 76 | ; 77 | 78 | example 79 | 80 | gsv+close drop 81 | 82 | [ELSE] 83 | .( No gtk-server fifo, is the gtk-server running ? ) cr 84 | [THEN] 85 | 86 | 87 | \ ============================================================================== 88 | -------------------------------------------------------------------------------- /examples/gzipped.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irdvo/ffl/753d418081a48afe8c86196261fda3299d93ac98/examples/gzipped.gz -------------------------------------------------------------------------------- /examples/info.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * open_dir_xpm[] = { 3 | "16 16 34 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #B6BB9A", 7 | "@ c #9A9D82", 8 | "# c #9DA285", 9 | "$ c #858871", 10 | "% c #A9AC97", 11 | "& c #90937A", 12 | "* c #A1A588", 13 | "= c #8D9178", 14 | "- c #81846F", 15 | "; c #696B5A", 16 | "> c #595B4C", 17 | ", c #313229", 18 | "' c #868972", 19 | ") c #DBDEC5", 20 | "! c #DFE2CD", 21 | "~ c #CED3B2", 22 | "{ c #505144", 23 | "] c #606152", 24 | "^ c #E3E5D4", 25 | "/ c #C7CDA4", 26 | "( c #A5AA85", 27 | "_ c #C3C99E", 28 | ": c #55574A", 29 | "< c #D6D8C9", 30 | "[ c #787C61", 31 | "} c #353535", 32 | "| c #A0A487", 33 | "1 c #4D4F44", 34 | "2 c #D7DBC0", 35 | "3 c #686B54", 36 | "4 c #B7BAA3", 37 | "5 c #8A8F70", 38 | " ", 39 | " ", 40 | " .... ", 41 | " .+@+@. ", 42 | " .#$#$#$...... ", 43 | " .%&*&*&*=-&-;.", 44 | " ...........>,'.", 45 | ".)!~!~!~!~!~.{].", 46 | ".^/(_(_(_(_(.{:.", 47 | " .<_(_(_(_(_[.:.", 48 | " }!|_(_(_(_(_.1.", 49 | " }2(_(_(_(_(3..", 50 | " .4(5(5(5(5(5..", 51 | " ............ ", 52 | " ", 53 | " "}; 54 | -------------------------------------------------------------------------------- /examples/jis_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ jos_expl - the json output stream example in the ffl 4 | \ 5 | \ Copyright (C) 2010 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-01-13 08:09:33 $ $Revision: 1.3 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/jis.fs 28 | 29 | 30 | \ Example : Parse a json string 31 | 32 | 33 | \ Create the json input stream in the dictionary 34 | 35 | jis-create jis1 36 | 37 | \ Feed the parser with a string 38 | 39 | s\" {\"value\":10,\"flag\":false,\"array\":[1,2,3.1],\"string\":\"hello\",\"empty\":\"\"}" jis1 jis-set-string 40 | 41 | \ Parse the string and print the parsed tokens 42 | 43 | : json-parse ( -- = Parse the string ) 44 | BEGIN 45 | jis1 jis-read 46 | dup jis.error <> over jis.done <> AND 47 | WHILE 48 | CASE 49 | jis.start-object OF ." Start Object" ENDOF 50 | jis.start-array OF ." Start array" ENDOF 51 | jis.name OF ." Name : " type ENDOF 52 | jis.string OF ." String : " type ENDOF 53 | jis.number OF ." Number : " . ENDOF 54 | jis.double OF ." Double : " d. ENDOF 55 | jis.float OF ." Float : " f. ENDOF 56 | jis.boolean OF ." Boolean : " . ENDOF 57 | jis.null OF ." Null" ENDOF 58 | jis.end-object OF ." End Object" ENDOF 59 | jis.end-array OF ." End Array" ENDOF 60 | ." Token:" dup . 61 | ENDCASE 62 | cr 63 | REPEAT 64 | drop 65 | ; 66 | 67 | json-parse 68 | -------------------------------------------------------------------------------- /examples/jos_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ jos_expl - the json output stream example in the ffl 4 | \ 5 | \ Copyright (C) 2010 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-01-13 08:09:33 $ $Revision: 1.3 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/jos.fs 28 | 29 | 30 | \ Example : Write json output 31 | 32 | 33 | \ Create the json output stream in the dictionary 34 | 35 | jos-create jos1 36 | 37 | jos1 jos-write-start-object \ Write the start of a json object 38 | 39 | s" number" jos1 jos-write-name \ Write a number with its value 40 | 5 jos1 jos-write-number 41 | 42 | s" array" jos1 jos-write-name \ Write an array with three members 43 | jos1 jos-write-start-array 44 | 7 jos1 jos-write-number 45 | true jos1 jos-write-boolean 46 | s" hello" jos1 jos-write-string 47 | jos1 jos-write-end-array 48 | 49 | jos1 jos-write-end-object \ Write the end of the object 50 | 51 | jos1 str-get type cr \ Type the json output 52 | -------------------------------------------------------------------------------- /examples/log_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ log_expl - the logging example in the ffl 4 | \ 5 | \ Copyright (C) 2008 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-10-22 16:48:40 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/log.fs 28 | 29 | 30 | .( Logging to the console:) cr 31 | 32 | log-to-console 33 | 34 | warning" Warning message" 35 | 36 | log.error log-from-level \ Log only errors and higher 37 | 38 | warning" Skip warning message" 39 | 40 | error" Error message" 41 | 42 | log.trace log-from-level \ Log all events 43 | 44 | 45 | .( Logging to file "log.tmp" ) cr 46 | 47 | s" log.tmp" w/o create-file 0= [IF] 48 | dup log-to-file 49 | 50 | trace" Trace message" 51 | 52 | info" Info message" 53 | 54 | close-file drop 55 | [ELSE] 56 | drop 57 | .( Error: could not create "log.tmp" ) cr 58 | [THEN] 59 | 60 | 61 | .( Logging to rolling files: log.1 log.2 and log.3, 5 entries per file .." ) cr 62 | 63 | s" log" 3 5 log-to-rolling 64 | 65 | 3 log-stack-depth \ Log also the stack contents, maximum 3 values 66 | 67 | : do-18logs 68 | 18 0 DO 69 | info" Infos message via rolling files" 70 | LOOP 71 | ; 72 | 73 | 23 56 \ Put some example values on the stack for the logger 74 | 75 | do-18logs \ Generate 18 log messages in the rolling files 76 | 77 | 2drop 78 | 79 | 80 | .( Logging to callback ) cr 81 | 82 | : callback ( c-addr u -- ) 83 | ." Logging:" type cr \ Callback shows the message on the console 84 | ; 85 | 86 | ' callback log-to-callback 87 | 88 | 0 log-stack-depth \ Stop logging the stack contents 89 | 90 | error" Error message via callback" 91 | 92 | debug" Debug message via callback" 93 | 94 | -------------------------------------------------------------------------------- /examples/md5_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ md5_expl - the MD5 example in the ffl 4 | \ 5 | \ Copyright (C) 2009 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2009-03-24 18:24:03 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/md5.fs 28 | 29 | \ Create a MD5 variable md1 in the dictionary 30 | 31 | md5-create md1 32 | 33 | \ Update the variable with data 34 | 35 | s" The quick brown fox jumps over the lazy dog" md1 md5-update 36 | 37 | \ Finish the MD5 calculation resulting in four unsigned 32 bit words 38 | \ on the stack representing the hash value 39 | 40 | md1 md5-finish 41 | 42 | \ Convert the hash value to a hex string and print it 43 | 44 | md5+to-string type cr 45 | 46 | 47 | 48 | \ Create a MD5 variable on the heap 49 | 50 | md5-new value md2 51 | 52 | \ Update the variable with multiple data 53 | 54 | s" The quick brown fox " md2 md5-update 55 | s" jumps over the lazy dog" md2 md5-update 56 | 57 | \ Finish the calculation 58 | 59 | md2 md5-finish 60 | 61 | \ Convert the hash value to a hex string and print 62 | 63 | md5+to-string type cr 64 | 65 | \ Free the variable from the heap 66 | 67 | md2 md5-free 68 | -------------------------------------------------------------------------------- /examples/msc_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ msc_expl - the message catalog example in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-03-04 18:39:16 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/msc.fs 28 | 29 | 30 | \ Example 1 : translation of english to dutch 31 | 32 | 33 | \ Create the message catalog in the dictionary 34 | 35 | msc-create en>nl 36 | 37 | 38 | \ Add translations to the catalog 39 | 40 | s" yes" s" ja" en>nl msc-add 41 | s" no" s" nee" en>nl msc-add 42 | s" tree" s" boom" en>nl msc-add 43 | s" bike" s" fiets" en>nl msc-add 44 | 45 | \ Translate messages 46 | 47 | s" yes" en>nl msc-translate type cr 48 | s" bike" en>nl msc-translate type cr 49 | s" house" en>nl msc-translate type cr \ if not in the catalog, the orignal message is returned 50 | 51 | 52 | 53 | \ Example 2 : entity references in html 54 | 55 | \ Create the message catalog on the heap 56 | 57 | msc-new value entity 58 | 59 | 60 | \ Add the references in the catalog 61 | 62 | s" lt" s" <" entity msc-add 63 | s" gt" s" >" entity msc-add 64 | s" amp" s" &" entity msc-add 65 | s" quot" char " pad c! pad 1 entity msc-add 66 | 67 | 68 | \ Convert the references 69 | 70 | s" lt" entity msc-translate type cr 71 | s" quot" entity msc-translate type cr 72 | 73 | 74 | \ Free the catalog from the heap 75 | 76 | entity msc-free 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /examples/nl.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irdvo/ffl/753d418081a48afe8c86196261fda3299d93ac98/examples/nl.mo -------------------------------------------------------------------------------- /examples/rdg_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ rdg_expl - the pseudo random distribution generator example in the ffl 4 | \ 5 | \ Copyright (C) 2008 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-01-06 06:37:25 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/rng.fs 28 | include ffl/rdg.fs 29 | 30 | 31 | \ Create a random generator variable in the dictionary with seed 5489 32 | 33 | 5489 rng-create rng1 34 | 35 | \ Create a distributed random generator in the dictionary with the rng1 random generator 36 | \ The distributed random generator expects the state and the word that generates random 37 | \ numbers in the range [0..1>. 38 | 39 | rng1 ' rng-next-float rdg-create rdg1 40 | 41 | \ Generate a normal or gaussian random number with mean 1.0 and stddev 0.5 42 | 43 | 1E+0 0.5E+0 rdg1 rdg-normal f. cr 44 | 45 | \ Generate an exponential random number with mean 2.0 46 | 47 | 2E+0 rdg1 rdg-exponential f. cr 48 | 49 | \ Generate a gamma random number with alpha 2.0 and beta 0.5 50 | 51 | 2E+0 0.5E+0 rdg1 rdg-gamma f. cr 52 | 53 | \ Generate a beta random number with alpha 2.0 and beta 0.5 54 | 55 | 2E+0 0.5E+0 rdg1 rdg-beta f. cr 56 | 57 | \ Generate a binomial random number with probability 0.4 and trails 15 58 | 59 | 0.4E+0 15 rdg1 rdg-binomial u. cr 60 | 61 | \ Generate a poisson random number with mean 17.0 62 | 63 | 17E+0 rdg1 rdg-poisson u. cr 64 | 65 | \ Generate a pareto random number with alpha 3.5 and beta 2.0 66 | 67 | 3.5E+0 2E+0 rdg1 rdg-pareto f. cr 68 | 69 | \ Generate a weibull random number with alpha 3.5 and beta 2.0 70 | 71 | 3.5E+0 2E+0 rdg1 rdg-weibull f. cr 72 | 73 | 74 | 75 | \ Create a distributed random generator variable on the heap 76 | 77 | rng1 ' rng-next-float rdg-new value rdg2 78 | 79 | \ Generate an uniform random number in the range of [34.5,34.6> 80 | 81 | 34.5E+0 34.6E+0 rdg2 rdg-uniform f. cr 82 | 83 | \ Free the variable from the heap 84 | 85 | rdg2 rdg-free 86 | 87 | -------------------------------------------------------------------------------- /examples/rgx_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ rgx_expl - the regular expression example in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-10-06 18:22:09 $ $Revision: 1.3 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/rgx.fs 28 | 29 | \ Create a regular expression variable rgx1 30 | 31 | rgx-create rgx1 32 | 33 | \ Compile a regular expression and check the result 34 | 35 | s" ((a*)b)*" rgx1 rgx-compile [IF] 36 | .( Expression successful compiled) cr 37 | [ELSE] 38 | .( Compilation failed on position:) . cr 39 | [THEN] 40 | 41 | \ Match case sensitive a test string 42 | 43 | s" abb" rgx1 rgx-cmatch? [IF] 44 | .( Test string matched) cr 45 | [ELSE] 46 | .( No match) cr 47 | [THEN] 48 | 49 | 50 | 51 | \ Create a regular expression variable on the heap 52 | 53 | rgx-new value rgx2 54 | 55 | \ Compile a regular expression for matching a float number 56 | 57 | s" [-+\s]?\d+(\.\d+)?" rgx2 rgx-compile [IF] 58 | .( Expression successful compiled) cr 59 | [ELSE] 60 | .( Compilation failed on position:) . cr 61 | [THEN] 62 | 63 | \ Match a float number 64 | 65 | s" -12.47" rgx2 rgx-cmatch? [IF] 66 | .( Float number matched) cr 67 | [ELSE] 68 | .( No match) cr 69 | [THEN] 70 | 71 | \ Free the variable from the heap 72 | 73 | rgx2 rgx-free 74 | 75 | -------------------------------------------------------------------------------- /examples/scf_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ scf_expl - the sscanf example in the ffl 4 | \ 5 | \ Copyright (C) 2009 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-09-22 18:46:53 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/scf.fs 28 | 29 | \ Conversions 30 | .( Scan the string : ) 31 | s" 10 a hello CE 55 20" 2dup type \ the source string 32 | .( with the specifiers: ) 33 | s" %d %c %s %x %o %ld" 2dup type cr \ the specifier string 34 | 35 | scf+scan \ scan the source string with the specifier string 36 | 37 | .( Number of conversions: ) . cr \ the number of conversions done by scf+scan 38 | .( Double: ) d. cr \ the results 39 | .( Octal: ) . cr 40 | .( Hex: ) . cr 41 | .( String: ) type cr 42 | .( Character: ) emit cr 43 | .( Decimal: ) . cr 44 | 45 | \ Float conversions 46 | [DEFINED] >float [IF] 47 | .( Scan floats ) cr 48 | s" 10 20.1 -30.3E+5" s" %e %e %e" scf+scan 49 | .( Number of floats: ) . 50 | .( values: ) f. f. f. cr 51 | [THEN] 52 | 53 | \ Matching and conversion 54 | .( Match and scan, with parsing word ) cr 55 | s" %var = 20 (24)" scf" %%%s = %d [%o]" 56 | 57 | .( Number of conversions: ) . \ Only 2 conversion due to mismatch of '[' 58 | .( values: ) . type cr 59 | -------------------------------------------------------------------------------- /examples/scl_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ scl_expl - the cell based single linked list example in the ffl 4 | \ 5 | \ Copyright (C) 2010 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-04-10 16:12:01 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/scl.fs 28 | include ffl/rng.fs 29 | 30 | 31 | \ Example: sort a cell based single linked list with 1001 random numbers 32 | 33 | 34 | \ Create the single linked list on the heap 35 | 36 | scl-new value nlist 37 | 38 | \ Create the pseudo random generator in the dictionary with seed 5498 39 | 40 | 5498 rng-create nrng 41 | 42 | \ Insert 1001 numbers in the nlist 43 | 44 | : nlist-insert ( n -- = Insert n random numbers in nlist ) 45 | 0 DO 46 | nrng rng-next-number \ Generate random number and .. 47 | nlist scl-append \ .. append to the list 48 | LOOP 49 | ; 50 | 51 | 1001 nlist-insert 52 | 53 | \ Check the number of numbers out of sequence 54 | 55 | : nnode-out-sequence ( n1 n2 flag n3 -- n4 n5 true = Count the number of out of sequence number, n1: count n2:previous number n3: number ) 56 | swap IF 57 | tuck > IF >r 1+ r> THEN \ Compare current number with previous number increment counter if out of sequence 58 | ELSE 59 | nip \ First call, no check 60 | THEN 61 | true 62 | ; 63 | 64 | .( Before sorting there are ) 0 0 false ' nnode-out-sequence nlist scl-execute 2drop . .( numbers out of sequence. ) cr 65 | 66 | \ Sort the list using the <=> word 67 | 68 | ' <=> nlist scl-sort 69 | 70 | \ Check the number of numbers out of sequence again 71 | 72 | .( After sorting there are ) 0 0 false ' nnode-out-sequence nlist scl-execute 2drop . .( numbers out of sequence. ) cr 73 | 74 | \ Cleanup the list 75 | 76 | nlist scl-free 77 | 78 | -------------------------------------------------------------------------------- /examples/sh1_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ sh1_expl - the SHA-1 example in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-06-08 06:50:00 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/sh1.fs 28 | 29 | \ Create a SHA-1 variable sh1 in the dictionary 30 | 31 | sh1-create sh1 32 | 33 | \ Update the variable with data 34 | 35 | s" The quick brown fox jumps over the lazy dog" sh1 sh1-update 36 | 37 | \ Finish the SHA-1 calculation resulting in 5 unsigned 32 bit words 38 | \ on the stack representing the hash value 39 | 40 | sh1 sh1-finish 41 | 42 | \ Convert the hash value to a hex string and print 43 | 44 | sh1+to-string type cr 45 | 46 | 47 | 48 | \ Create a SHA-1 variable on the heap 49 | 50 | sh1-new value sh2 51 | 52 | \ Update the variable with multiple data 53 | 54 | s" The quick brown fox " sh2 sh1-update 55 | s" jumps over the lazy dog" sh2 sh1-update 56 | 57 | \ Finish the calculation 58 | 59 | sh2 sh1-finish 60 | 61 | \ Convert the hash value to a hex string and print 62 | 63 | sh1+to-string type cr 64 | 65 | \ Free the variable from the heap 66 | 67 | sh2 sh1-free 68 | -------------------------------------------------------------------------------- /examples/sh2_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ sh2_expl - the SHA-256 example in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-06-08 06:49:35 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/sh2.fs 28 | 29 | \ Create a SHA-256 variable sh1 in the dictionary 30 | 31 | sh2-create sh1 32 | 33 | \ Update the variable with data 34 | 35 | s" The quick brown fox jumps over the lazy dog" sh1 sh2-update 36 | 37 | \ Finish the SHA-256 calculation resulting in 8 unsigned 32 bit words 38 | \ on the stack representing the hash value 39 | 40 | sh1 sh2-finish 41 | 42 | \ Convert the hash value to a hex string and print 43 | 44 | sh2+to-string type cr 45 | 46 | 47 | 48 | \ Create a SHA-256 variable on the heap 49 | 50 | sh2-new value sh2 51 | 52 | \ Update the variable with multiple data 53 | 54 | s" The quick brown fox " sh2 sh2-update 55 | s" jumps over the lazy dog" sh2 sh2-update 56 | 57 | \ Finish the calculation 58 | 59 | sh2 sh2-finish 60 | 61 | \ Convert the hash value to a hex string and print 62 | 63 | sh2+to-string type cr 64 | 65 | \ Free the variable from the heap 66 | 67 | sh2 sh2-free 68 | -------------------------------------------------------------------------------- /examples/spf_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ spf_expl - the sprintf example in the ffl 4 | \ 5 | \ Copyright (C) 2008 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-09-22 18:46:53 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/spf.fs 28 | 29 | str-new value spf1 \ Create string as destination 30 | 31 | .( Format numbers : ) 32 | [DEFINED] represent [IF] 33 | 18E+0 15 15 10 8 1 s" %d %u %o %x %X %E" spf1 spf-set \ Format the numbers 34 | [ELSE] 35 | 15 15 10 8 1 s" %d %u %o %x %X" spf1 spf-set \ Format the numbers 36 | [THEN] 37 | 38 | spf1 str-get type cr \ Print the result 39 | 40 | .( Format strings and characters : ) 41 | char ! s" Hello" s" %s %c" spf1 spf-set \ Format strings and characters 42 | 43 | spf1 str-get type cr \ Print result 44 | 45 | .( Format numbers with signs : ) 46 | -30 20 10 s" %+d % d %d" spf1 spf-set \ Format numbers with signs 47 | 48 | spf1 str-get type cr \ Print result 49 | 50 | .( Leading and trailing zeros and spaces: ) 51 | -40 -30 20 10 s" %5d %-+5d %05d %5d" spf1 spf-set \ Format numbers with leading and trailing spaces 52 | 53 | spf1 str-get type cr 54 | 55 | .( Format with parsing word : ) 56 | time&date spf1 spf" %04d-%02d-%2d %02d:%02d:%02d" \ Format date & time 57 | 58 | spf1 str-get type cr \ Print result 59 | 60 | -------------------------------------------------------------------------------- /examples/stt_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ stt_expl - the stringtable example in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2009-05-20 13:27:22 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/stt.fs 28 | 29 | \ Example : the names of the months in a stringtable 30 | 31 | \ Create the stringtable in the dictionary 32 | 33 | begin-stringtable months 34 | +" January" 35 | +" February" 36 | +" March" 37 | +" April" 38 | +" May" 39 | +" June" 40 | +" July" 41 | +" August" 42 | +" September" 43 | +" October" 44 | +" November" 45 | +" December" 46 | end-stringtable 47 | 48 | \ Fetch strings from the stringtable 49 | 50 | 0 months type cr \ January 51 | 11 months type cr \ December 52 | 53 | -------------------------------------------------------------------------------- /examples/test.xml: -------------------------------------------------------------------------------- 1 | Breakfasttwo eggs & bacon or sausage & toast & hash browns$6.95 2 | 3 | -------------------------------------------------------------------------------- /examples/xis_expl.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ xis_expl - the text input stream example in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-11-16 18:55:14 $ $Revision: 1.5 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/xis.fs 28 | 29 | 30 | \ Example: Read a XML/HTML file 31 | 32 | \ Create a XML/HTML input stream on the heap 33 | 34 | xis-new value xis1 35 | 36 | 37 | \ Setup the reader callback word for reading from file 38 | 39 | : file-reader ( fileid -- c-addr u | 0 ) 40 | pad 64 rot read-file throw 41 | dup IF 42 | pad swap 43 | THEN 44 | ; 45 | 46 | 47 | 48 | s" test.xml" r/o open-file throw value xis.file \ Open the file 49 | 50 | xis.file ' file-reader xis1 xis-set-reader \ Use the xml reader with a file 51 | 52 | true xis1 xis-strip! \ Strip leading and trailing whitespace in the text 53 | 54 | : file-parse ( -- = Parse the xml file ) 55 | BEGIN 56 | xis1 xis-read \ Read the next token from the file 57 | dup xis.error <> over xis.done <> AND \ Done when ready or error 58 | WHILE 59 | xis+dump-read-parameters \ Dump the next token with its parameters 60 | 61 | REPEAT 62 | 63 | xis.error = IF 64 | ." Error parsing the file." cr 65 | ELSE 66 | ." File succesfully parsed." cr 67 | THEN 68 | ; 69 | 70 | \ Parse the file 71 | 72 | file-parse 73 | 74 | 75 | \ Done, close the file 76 | 77 | xis.file close-file throw 78 | 79 | 80 | \ Free the stream from the heap 81 | 82 | xis1 xis-free 83 | 84 | -------------------------------------------------------------------------------- /ffl/acn.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ acn - the AVL binary tree cell node module in the ffl 4 | \ 5 | \ Copyright (C) 2006 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-04-30 06:15:13 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | 28 | include ffl/config.fs 29 | 30 | 31 | [UNDEFINED] acn.version [IF] 32 | 33 | 34 | include ffl/stc.fs 35 | include ffl/bcn.fs 36 | 37 | 38 | ( acn = AVL binary tree cell node module ) 39 | ( The acn module implements a node in an AVL binary tree. The acn structure ) 40 | ( extends the bcn structure. ) 41 | 42 | 43 | 2 constant acn.version 44 | 45 | 46 | ( AVL Tree node structure ) 47 | 48 | begin-structure acn% ( -- n = Get the required space for an acn node ) 49 | bcn% 50 | +field acn>node \ Extend the the bcn structure with .. 51 | cfield: acn>balance \ .. the balance factor (-1,0,1) 52 | end-structure 53 | 54 | 55 | 56 | ( Node creation, initialisation and destruction ) 57 | 58 | : acn-init ( x1 x2 acn1 acn2 -- = Initialise the node acn2 with the parent acn1, key x2 and data x1 ) 59 | >r 60 | r@ bcn-init 61 | r> acn>balance 0! 62 | ; 63 | 64 | 65 | : acn-new ( x1 x2 acn1 -- acn2 = Create a new node acn2 on the heap with parent acn1, key x2 and data x1 ) 66 | acn% allocate throw >r r@ acn-init r> 67 | ; 68 | 69 | 70 | : acn-free ( acn -- = Free the node from the heap ) 71 | free throw 72 | ; 73 | 74 | 75 | ( Private words ) 76 | 77 | : acn-balance@ ( acn -- n = Get the balance of the node ) 78 | acn>balance @ 79 | ; 80 | 81 | 82 | ( Inspection ) 83 | 84 | : acn-dump ( acn -- = Dump the node ) 85 | ." acn:" dup . cr 86 | dup acn>node bcn-dump 87 | ." balance:" acn>balance ? cr 88 | ; 89 | 90 | [THEN] 91 | 92 | \ ============================================================================== 93 | -------------------------------------------------------------------------------- /ffl/bcn.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ bcn - the Binary tree cell node in the ffl 4 | \ 5 | \ Copyright (C) 2006-2008 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-04-15 17:13:54 $ $Revision: 1.7 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | 28 | include ffl/config.fs 29 | 30 | 31 | [UNDEFINED] bcn.version [IF] 32 | 33 | 34 | include ffl/bnn.fs 35 | 36 | 37 | ( bcn = Binary cell tree node ) 38 | ( The bcn module implements a node in an unbalanced binary tree that can ) 39 | ( cell wide data. ) 40 | 41 | 1 constant bcn.version 42 | 43 | 44 | ( Node structure ) 45 | 46 | begin-structure bcn% ( -- n = Get the required space for a bcn node ) 47 | bnn% 48 | +field bcn>bnn \ Extend the bnn structure with .. 49 | field: bcn>cell \ .. cell data 50 | end-structure 51 | 52 | 53 | 54 | ( Node creation, initialisation and destruction ) 55 | 56 | : bcn-init ( x1 x2 bcn1 bcn2 -- = Initialise the node bcn2 with the parent bcn1, key x2 and data x1 ) 57 | >r 58 | r@ bnn-init 59 | r> bcn>cell ! 60 | ; 61 | 62 | 63 | : bcn-new ( x1 x2 bcn1 -- bcn2 = Create a new node on the heap with the parent bcn1, key x2 and data x1 ) 64 | bcn% allocate throw >r r@ bcn-init r> 65 | ; 66 | 67 | 68 | : bcn-free ( bcn -- = Free the node from the heap ) 69 | free throw 70 | ; 71 | 72 | 73 | ( Members words ) 74 | 75 | : bcn-cell@ ( bcn1 -- bcn2 = Get the left node from the node bcn1) 76 | bcn>cell @ 77 | ; 78 | 79 | 80 | : bcn-cell! ( bcn1 -- bcn2 = Get the right node from the node bcn1) 81 | bcn>cell ! 82 | ; 83 | 84 | 85 | ( Inspection ) 86 | 87 | : bcn-dump ( bcn -- = Dump the node ) 88 | dup bnn-dump 89 | ." cell :" bcn>cell ? cr 90 | ; 91 | 92 | [THEN] 93 | 94 | \ ============================================================================== 95 | -------------------------------------------------------------------------------- /ffl/dcn.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ dcn - the double linked cell list node in the ffl 4 | \ 5 | \ Copyright (C) 2006 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-12-09 07:23:15 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/config.fs 28 | 29 | 30 | [UNDEFINED] dcn.version [IF] 31 | 32 | 33 | include ffl/dnn.fs 34 | 35 | 36 | ( dcn = Double Linked Cell List Node ) 37 | ( The dcn module implements a node in a dcl list.) 38 | 39 | 40 | 1 constant dcn.version 41 | 42 | 43 | ( Node structure ) 44 | 45 | begin-structure dcn% ( -- n = Get the required space for a dcn node ) 46 | dnn% 47 | +field dcn>dnn \ extend the dnn structure with .. 48 | field: dcn>cell \ .. a cell 49 | end-structure 50 | 51 | 52 | ( Node creation, initialisation and destruction ) 53 | 54 | : dcn-init ( x dcn -- = Initialise the node with data x ) 55 | dup dnn-init 56 | dcn>cell ! 57 | ; 58 | 59 | 60 | : dcn-new ( x -- dcn = Create a new node on the heap with data x ) 61 | dcn% allocate throw tuck dcn-init 62 | ; 63 | 64 | 65 | : dcn-free ( dcn -- = Free the node from the heap ) 66 | free throw 67 | ; 68 | 69 | 70 | ( Members words ) 71 | 72 | : dcn-cell@ ( dcn -- x = Get the cell data x from the node ) 73 | dcn>cell @ 74 | ; 75 | 76 | 77 | : dcn-cell! ( x dcn -- = Set the cell data x in the node ) 78 | dcn>cell ! 79 | ; 80 | 81 | 82 | ( Inspection ) 83 | 84 | : dcn-dump ( dcn -- = Dump the node ) 85 | dup dnn-dump 86 | ." cell :" dcn>cell ? cr 87 | ; 88 | 89 | [THEN] 90 | 91 | \ ============================================================================== 92 | -------------------------------------------------------------------------------- /ffl/dnn.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ dnn - the generic double linked list node in the ffl 4 | \ 5 | \ Copyright (C) 2006 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-01-09 19:30:48 $ $Revision: 1.4 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/config.fs 28 | 29 | 30 | [UNDEFINED] dnn.version [IF] 31 | 32 | 33 | include ffl/stc.fs 34 | 35 | 36 | ( dnn = Generic Double Linked List Node ) 37 | ( The dnn module implements a node in a dnl list. ) 38 | 39 | 40 | 1 constant dnn.version 41 | 42 | 43 | ( Node structure ) 44 | 45 | begin-structure dnn% ( -- n = Get the required space for a dnn structure ) 46 | field: dnn>next 47 | field: dnn>prev 48 | end-structure 49 | 50 | 51 | ( Node creation, initialisation and destruction ) 52 | 53 | : dnn-init ( dnn -- = Initialise the node ) 54 | dup dnn>next nil! 55 | dnn>prev nil! 56 | ; 57 | 58 | 59 | : dnn-new ( -- dnn = Create a new node on the heap ) 60 | dnn% allocate throw dup dnn-init 61 | ; 62 | 63 | 64 | : dnn-free ( dnn -- = Free the node from the heap ) 65 | free throw 66 | ; 67 | 68 | 69 | ( Members words ) 70 | 71 | : dnn-next@ ( dnn1 -- dnn2 = Get the next node dnn2 from node dnn1) 72 | dnn>next @ 73 | ; 74 | 75 | 76 | : dnn-next! ( dnn1 dnn2 -- = Set for node dnn2 the next node to dnn1 ) 77 | dnn>next ! 78 | ; 79 | 80 | 81 | : dnn-prev@ ( dnn1 -- dnn2 = Get from node dnn1 the previous node ) 82 | dnn>prev @ 83 | ; 84 | 85 | 86 | : dnn-prev! ( dnn1 dnn2 -- = Set for node dnn2 the previous node to dnn1 ) 87 | dnn>prev ! 88 | ; 89 | 90 | 91 | ( Inspection ) 92 | 93 | : dnn-dump ( dnn -- = Dump the node ) 94 | ." dnn:" dup . cr 95 | ." next :" dup dnn>next ? cr 96 | ." prev :" dnn>prev ? cr 97 | ; 98 | 99 | [THEN] 100 | 101 | \ ============================================================================== 102 | -------------------------------------------------------------------------------- /ffl/docs: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | gforth ../examples/fsdocgen.fs ../html/ ../examples/ *.fs 4 | gforth ../examples/fsdocgen.fs ../../../github/ffl/docs ../examples/ *.fs 5 | 6 | -------------------------------------------------------------------------------- /ffl/enm.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ enm - the enumeration module in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-12-12 19:36:38 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/config.fs 28 | 29 | 30 | [UNDEFINED] enm.version [IF] 31 | 32 | 33 | ( enm = Enumerations ) 34 | ( The enm module implements simple enumerations. ) 35 | 36 | 37 | 1 constant enm.version 38 | 39 | 40 | ( Enumerations syntax words ) 41 | 42 | : begin-enumeration ( -- enum-sys = Start an enumeration definition, the first enumeration will start from 0 ) 43 | 0 44 | ; 45 | 46 | 47 | : end-enumeration ( enum-sys -- = End an enumeration definition ) 48 | drop 49 | ; 50 | 51 | 52 | ( Enumeration definition words ) 53 | 54 | : enum: ( enum-sys "name" -- enum-sys ; -- n = Define an enumeration, increment for the next enumeration, return the enum value ) 55 | dup constant 56 | 1+ 57 | ; 58 | 59 | 60 | : >enum: ( enum-sys n "name" -- enum-sys ; -- n = Define an enumeration starting with n, return the enum value ) 61 | nip 62 | enum: 63 | ; 64 | 65 | [THEN] 66 | 67 | \ ============================================================================== 68 | -------------------------------------------------------------------------------- /ffl/hcn.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ hcn - the hash table cell node in the ffl 4 | \ 5 | \ Copyright (C) 2006 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-02-21 20:31:18 $ $Revision: 1.10 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/config.fs 28 | 29 | 30 | [UNDEFINED] hcn.version [IF] 31 | 32 | 33 | include ffl/hnn.fs 34 | 35 | ( hcn = Hash Table Cell Node ) 36 | ( The hcn module implements a node that stores cell wide data in a hash table.) 37 | 38 | 39 | 2 constant hcn.version 40 | 41 | 42 | ( Hash table node structure ) 43 | 44 | begin-structure hcn% ( - n = Get the required space for a hcn node ) 45 | hnn% 46 | +field hcn>hnn \ the hcn node extends the hnn node 47 | field: hcn>cell \ the cell data 48 | end-structure 49 | 50 | 51 | ( Node creation, initialisation and destruction ) 52 | 53 | : hcn-init ( x c-addr u u2 hcn -- = Initialise the node with the hash u2, the key c-addr u and cell data x ) 54 | >r 55 | r@ hnn-init 56 | r> hcn>cell ! 57 | ; 58 | 59 | 60 | : hcn-(free) ( hcn -- = Free the key from the heap ) 61 | hnn-(free) 62 | ; 63 | 64 | 65 | : hcn-new ( x c-addr u u2 -- hcn = Create a new node on the heap with the hash u2, the key c-addr u and cell data x ) 66 | hcn% allocate throw dup >r hcn-init r> 67 | ; 68 | 69 | 70 | : hcn-free ( hcn -- = Free the node from the heap ) 71 | dup hcn-(free) 72 | 73 | free throw 74 | ; 75 | 76 | 77 | ( Private words ) 78 | 79 | : hcn-cell@ ( hcn -- x = Get the cell value from the node ) 80 | hcn>cell @ 81 | ; 82 | 83 | 84 | ( Inspection ) 85 | 86 | : hcn-dump ( hcn -- = Dump the node ) 87 | dup hnn-dump 88 | ." cell :" hcn>cell ? cr 89 | ; 90 | 91 | [THEN] 92 | 93 | \ ============================================================================== 94 | -------------------------------------------------------------------------------- /ffl/make.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ make - the 'make' source file for gforth 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-03-02 15:03:02 $ $Revision: 1.6 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include tags.fs 28 | 29 | .( Forth Foundation Library: ) cr 30 | utime 31 | 32 | unused 33 | 34 | include ffl/ffl.fs 35 | 36 | unused - 37 | 38 | 39 | .( Compilation Size: ) . .( bytes) cr 40 | 41 | utime 2swap d- 1 1000 m*/ 42 | 43 | .( Compilation Time: ) d. .( msec) cr 44 | 45 | \ ============================================================================== 46 | 47 | -------------------------------------------------------------------------------- /ffl/ncn.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ ncn - the n-Tree cell node in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-12-09 07:23:16 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/config.fs 28 | 29 | 30 | [UNDEFINED] ncn.version [IF] 31 | 32 | 33 | include ffl/nnn.fs 34 | 35 | 36 | ( ncn = n-Tree cell node ) 37 | ( The ncn module implements a node in a n-tree nct that stores a cell value.) 38 | 39 | 40 | 1 constant ncn.version 41 | 42 | 43 | ( Node structure ) 44 | 45 | begin-structure ncn% ( -- n = Get the required space for a ncn node ) 46 | nnn% 47 | +field ncn>nnn \ Extend the nnn structure with .. 48 | field: ncn>cell \ .. a cell 49 | end-structure 50 | 51 | 52 | ( Node creation, initialisation and destruction ) 53 | 54 | : ncn-init ( x ncn -- = Initialise the node with data x) 55 | dup nnn-init 56 | ncn>cell ! 57 | ; 58 | 59 | 60 | : ncn-new ( x -- ncn = Create a new node on the heap with data x) 61 | ncn% allocate throw tuck ncn-init 62 | ; 63 | 64 | 65 | : ncn-free ( ncn -- = Free the node from the heap ) 66 | free throw 67 | ; 68 | 69 | 70 | ( Members words ) 71 | 72 | : ncn-cell@ ( ncn -- x = Get the cell data from the node ) 73 | ncn>cell @ 74 | ; 75 | 76 | 77 | : ncn-cell! ( x ncn -- = Set the cell data x in the node ) 78 | ncn>cell ! 79 | ; 80 | 81 | 82 | ( Inspection ) 83 | 84 | : ncn-dump ( ncn -- = Dump the node ) 85 | dup nnn-dump 86 | ." cell :" ncn>cell ? cr 87 | ; 88 | 89 | [THEN] 90 | 91 | \ ============================================================================== 92 | -------------------------------------------------------------------------------- /ffl/scn.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ scn - the single linked cell node in the ffl 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-12-09 07:23:16 $ $Revision: 1.6 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/config.fs 28 | 29 | 30 | [UNDEFINED] scn.version [IF] 31 | 32 | 33 | include ffl/snn.fs 34 | 35 | 36 | ( scn = Single Linked Cell Node ) 37 | ( The scn module implements a node in the single linked list scl. ) 38 | 39 | 40 | 2 constant scn.version 41 | 42 | 43 | ( Node structure ) 44 | 45 | begin-structure scn% ( -- n = Get the required space for a scn node ) 46 | snn% 47 | +field scn>snn \ Extend the snn structure with .. 48 | field: scn>cell \ .. a cell 49 | end-structure 50 | 51 | 52 | ( Node creation, initialisation and destruction ) 53 | 54 | : scn-init ( x scn -- = Initialise the node with cell data x ) 55 | dup snn-init 56 | scn>cell ! 57 | ; 58 | 59 | 60 | : scn-new ( x -- scn = Create a new node on the heap with cell data x ) 61 | scn% allocate throw tuck scn-init 62 | ; 63 | 64 | 65 | : scn-free ( scn -- = Free the node from the heap ) 66 | free throw 67 | ; 68 | 69 | 70 | ( Members words ) 71 | 72 | : scn-cell@ ( scn -- x = Get the cell data x from the node ) 73 | scn>cell @ 74 | ; 75 | 76 | 77 | : scn-cell! ( x scn -- = Set the cell data x in the node ) 78 | scn>cell ! 79 | ; 80 | 81 | 82 | ( Inspection ) 83 | 84 | : scn-dump ( scn -- = Dump the node ) 85 | dup snn-dump 86 | ." cell :" scn>cell ? cr 87 | ; 88 | 89 | [THEN] 90 | 91 | \ ============================================================================== 92 | -------------------------------------------------------------------------------- /ffl/snn.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ snn - the generic single linked node in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-01-09 19:30:48 $ $Revision: 1.3 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/config.fs 28 | 29 | 30 | [UNDEFINED] snn.version [IF] 31 | 32 | 33 | include ffl/stc.fs 34 | 35 | 36 | ( snn = Generic Single Linked List Node ) 37 | ( The snn module implements a node in a generic single linked list snl. ) 38 | 39 | 40 | 1 constant snn.version 41 | 42 | 43 | ( Node structure ) 44 | 45 | begin-structure snn% ( - n = Get the required space for a snn node ) 46 | field: snn>next 47 | end-structure 48 | 49 | 50 | ( Node creation, initialisation and destruction ) 51 | 52 | : snn-init ( snn -- = Initialise the node ) 53 | snn>next nil! 54 | ; 55 | 56 | 57 | : snn-new ( -- snn = Create a new node on the heap ) 58 | snn% allocate throw dup snn-init 59 | ; 60 | 61 | 62 | : snn-free ( snn -- = Free the node from the heap ) 63 | free throw 64 | ; 65 | 66 | 67 | ( Member words ) 68 | 69 | : snn-next@ ( snn1 -- snn2 = Get the next node snn2 from the node snn1 ) 70 | snn>next @ 71 | ; 72 | 73 | 74 | : snn-next! ( snn1 snn2 -- = Set for the node snn1 the next node to snn2 ) 75 | snn>next ! 76 | ; 77 | 78 | 79 | ( Inspection ) 80 | 81 | : snn-dump ( snn -- = Dump the single list node ) 82 | ." snn:" dup . cr 83 | ." next :" snn>next ? cr 84 | ; 85 | 86 | [THEN] 87 | 88 | \ ============================================================================== 89 | -------------------------------------------------------------------------------- /ffl/stt.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ stt - the stringtable in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU Lesser General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 3 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ Lesser General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU Lesser General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2009-05-20 13:27:22 $ $Revision: 1.4 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | 28 | include ffl/config.fs 29 | 30 | 31 | [UNDEFINED] stt.version [IF] 32 | 33 | include ffl/est.fs 34 | 35 | ( stt = Stringtable module ) 36 | ( The stt module implements a stringtable with counted strings. The code is ) 37 | ( inspired by Wil Badens stringtable. ) 38 | 39 | 40 | 3 constant stt.version 41 | 42 | 43 | ( Stringtable syntax words ) 44 | 45 | : begin-stringtable ( "name" -- stringtable-sys ; n -- c-addr u = Start a named stringtable definition; return the nth string ) 46 | create 47 | here 48 | cell allot 49 | here \ stringtable-sys: a-addr (start) a-addr (strings) 50 | does> 51 | @ 52 | swap cells + 53 | @ count 54 | ; 55 | 56 | 57 | : +stt ( c-addr u -- = Place the string as counted string in the stringtable ) 58 | here 59 | over char+ allot 60 | 2dup c! 61 | char+ swap cmove 62 | align 63 | ; 64 | 65 | 66 | : +" ( "ccc" -- = Parse ccc delimited by double quote and place the string as counted string in the stringtable ) 67 | [char] " parse 68 | +stt 69 | ; 70 | 71 | 72 | : +\" ( "ccc" -- = Parse ccc with escaped characters delimited by double quote and place the string as counted string in the stringtable ) 73 | parse\" 74 | +stt 75 | ; 76 | 77 | 78 | : end-stringtable ( stringtable-sys -- = End the stringtable definition ) 79 | here rot ! \ Set the offset 80 | here swap 81 | BEGIN 82 | 2dup <> 83 | WHILE 84 | dup , \ Store the start of the strings 85 | count chars + aligned \ Move to the next string 86 | REPEAT 87 | 2drop 88 | ; 89 | 90 | [THEN] 91 | 92 | \ ============================================================================== 93 | 94 | -------------------------------------------------------------------------------- /html/acn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | acn -- AVL binary tree cell node module 5 | 6 | 7 | 8 | 9 |

Module description

10 |
acn -- AVL binary tree cell node module
11 |
12 | The acn module implements a node in an AVL binary tree. The acn structure 13 | extends the bcn structure. 14 |
15 |
16 |
17 |

AVL Tree node structure

18 |
19 |
acn% ( -- n )
20 |
Get the required space for an acn node
21 |
22 |

Node creation, initialisation and destruction

23 |
24 |
acn-init ( x1 x2 acn1 acn2 -- )
25 |
Initialise the node acn2 with the parent acn1, key x2 and data x1
26 |
27 |
28 |
acn-new ( x1 x2 acn1 -- acn2 )
29 |
Create a new node acn2 on the heap with parent acn1, key x2 and data x1
30 |
31 |
32 |
acn-free ( acn -- )
33 |
Free the node from the heap
34 |
35 |

Inspection

36 |
37 |
acn-dump ( acn -- )
38 |
Dump the node
39 |
40 |
41 |

Generated by fsdocgen 0.1.0

42 | 43 | 44 | -------------------------------------------------------------------------------- /html/bci.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bci -- Binary cell tree iterator 5 | 6 | 7 | 8 | 9 |

Module description

10 |
bci -- Binary cell tree iterator
11 |
12 | The bci module implements an iterator on the [bct] binary tree. 13 |
14 |
15 |
16 |

Iterator Structure

17 |
18 |
bci% ( -- n )
19 |
Get the required space for a bci variable
20 |
21 |

Iterator creation, initialisation and destruction

22 |
23 |
bci-init ( bct bci -- )
24 |
Initialise the iterator with a binary tree
25 |
26 |
27 |
bci-create ( bct "<spaces>name" -- ; -- bci )
28 |
Create a named iterator in the dictionary with a binary tree
29 |
30 |
31 |
bci-new ( bct -- bci )
32 |
Create an iterator on the heap with a binary tree
33 |
34 |
35 |
bci-free ( bci -- )
36 |
Free the iterator from the heap
37 |
38 |

Iterator words

39 |
40 |
bci-get ( bci -- false | x true )
41 |
Get the cell data x from the current node
42 |
43 |
44 |
bci-key ( bci -- false | x true )
45 |
Get the key x from the current node
46 |
47 |
48 |
bci-set ( x bci -- )
49 |
Set the cell data x for the current node
50 |
51 |
52 |
bci-first ( bci -- x true | false )
53 |
Move the iterator to the first node, return the cell data x
54 |
55 |
56 |
bci-next ( bci -- x true | false )
57 |
Move the iterator to the next node, return the cell data x
58 |
59 |
60 |
bci-move ( x bci -- flag )
61 |
Move the iterator to the next node with the cell data x
62 |
63 |
64 |
bci-prev ( bci -- x true | false )
65 |
Move the iterator to the previous node, return the cell data x
66 |
67 |
68 |
bci-last ( bci -- x true | false )
69 |
Move the iterator to the last node, return the cell data x
70 |
71 |
72 |
bci-first? ( bci -- flag )
73 |
Check if the iterator is on the first node
74 |
75 |
76 |
bci-last? ( bci -- flag )
77 |
Check if the iterator is on the last node
78 |
79 |

Inspection

80 |
81 |
bci-dump ( bci -- )
82 |
Dump the iterator variable
83 |
84 |
85 |

Generated by fsdocgen 0.1.0

86 | 87 | 88 | -------------------------------------------------------------------------------- /html/bcn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bcn -- Binary cell tree node 5 | 6 | 7 | 8 | 9 |

Module description

10 |
bcn -- Binary cell tree node
11 |
12 | The bcn module implements a node in an unbalanced binary tree that can 13 | cell wide data. 14 |
15 |
16 |
17 |

Node structure

18 |
19 |
bcn% ( -- n )
20 |
Get the required space for a bcn node
21 |
22 |

Node creation, initialisation and destruction

23 |
24 |
bcn-init ( x1 x2 bcn1 bcn2 -- )
25 |
Initialise the node bcn2 with the parent bcn1, key x2 and data x1
26 |
27 |
28 |
bcn-new ( x1 x2 bcn1 -- bcn2 )
29 |
Create a new node on the heap with the parent bcn1, key x2 and data x1
30 |
31 |
32 |
bcn-free ( bcn -- )
33 |
Free the node from the heap
34 |
35 |

Members words

36 |
37 |
bcn-cell@ ( bcn1 -- bcn2 )
38 |
Get the left node from the node bcn1
39 |
40 |
41 |
bcn-cell! ( bcn1 -- bcn2 )
42 |
Get the right node from the node bcn1
43 |
44 |

Inspection

45 |
46 |
bcn-dump ( bcn -- )
47 |
Dump the node
48 |
49 |
50 |

Generated by fsdocgen 0.1.0

51 | 52 | 53 | -------------------------------------------------------------------------------- /html/bni.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bni -- Generic binary tree iterator 5 | 6 | 7 | 8 | 9 |

Module description

10 |
bni -- Generic binary tree iterator
11 |
12 | The bni module implements an iterator on the generic binary tree [bnt]. 13 |
14 |
15 |
16 |

Iterator Structure

17 |
18 |
bni% ( -- n )
19 |
Get the required space for a bni variable
20 |
21 |

Iterator creation, initialisation and destruction

22 |
23 |
bni-init ( bnt bni -- )
24 |
Initialise the iterator with a binary tree
25 |
26 |
27 |
bni-create ( bnt "<spaces>name" -- ; -- bni )
28 |
Create a named iterator in the dictionary with a binary tree
29 |
30 |
31 |
bni-new ( bnt -- bni )
32 |
Create an iterator on the heap with a binary tree
33 |
34 |
35 |
bni-free ( bni -- )
36 |
Free the iterator from the heap
37 |
38 |

Iterator words

39 |
40 |
bni-get ( bni -- bnn | nil )
41 |
Get the current node from the iterator
42 |
43 |
44 |
bni-key ( bni -- false | x true )
45 |
Get the key x from the current node
46 |
47 |
48 |
bni-first ( bni -- bnn | nil )
49 |
Move the iterator to the first node, return this node
50 |
51 |
52 |
bni-next ( bni -- bnn | nil )
53 |
Move the iterator to the next node, return this node
54 |
55 |
56 |
bni-prev ( bni -- bnn | nil )
57 |
Move the iterator to the previous node, return this node
58 |
59 |
60 |
bni-last ( bni -- bnn | nil )
61 |
Move the iterator to the last node, return this node
62 |
63 |
64 |
bni-first? ( bni -- flag )
65 |
Check if the iterator is on the first node
66 |
67 |
68 |
bni-last? ( bni -- flag )
69 |
Check if the iterator is on the last node
70 |
71 |

Inspection

72 |
73 |
bni-dump ( bni -- )
74 |
Dump the iterator variable
75 |
76 |
77 |

Generated by fsdocgen 0.1.0

78 | 79 | 80 | -------------------------------------------------------------------------------- /html/bnn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bnn -- Generic binary tree node 5 | 6 | 7 | 8 | 9 |

Module description

10 |
bnn -- Generic binary tree node
11 |
12 | The bnn module implements a node in a generic unbalanced binary tree. 13 |
14 |
15 |
16 |

Node structure

17 |
18 |
bnn% ( -- n )
19 |
Get the required space for a bnn node
20 |
21 |

Node creation, initialisation and destruction

22 |
23 |
bnn-init ( x bnn1 bnn2 -- )
24 |
Initialise the node bnn2 with parent bnn1 and key x
25 |
26 |
27 |
bnn-new ( x bnn1 -- bnn2 )
28 |
Create a new node on the heap with parent bnn1 and key x
29 |
30 |
31 |
bnn-free ( bnn -- )
32 |
Free the node from the heap
33 |
34 |

Member words

35 |
36 |
bnn-key@ ( bnn -- x )
37 |
Get the key from the node
38 |
39 |

Inspection

40 |
41 |
bnn-dump ( bnn -- )
42 |
Dump the node
43 |
44 |
45 |

Generated by fsdocgen 0.1.0

46 | 47 | 48 | -------------------------------------------------------------------------------- /html/crc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | crc -- 32-bit Cyclic Redundancy Check 5 | 6 | 7 | 8 | 9 |

Module description

10 |
crc -- 32-bit Cyclic Redundancy Check
11 |
12 | The crc module implements a 32-bit cyclic redundancy check calculation. 13 |
14 |
15 |
16 |

CRC-32 Structure

17 |
18 |
crc% ( -- n )
19 |
Get the required space for a crc-32 variable
20 |
21 |

CRC-32 variable creation, initialisation and destruction

22 |
23 |
crc-init ( crc -- )
24 |
Initialise the crc
25 |
26 |
27 |
crc-create ( "<spaces>name" -- ; -- crc )
28 |
Create a named crc variable in the dictionary
29 |
30 |
31 |
crc-(free) ( crc -- )
32 |
Free the internal table from the heap
33 |
34 |
35 |
crc-new ( -- crc )
36 |
Create a new crc variable on the heap
37 |
38 |
39 |
crc-free ( crc -- )
40 |
Free the crc from the heap
41 |
42 |

Member words

43 |
44 |
crc-poly! ( u crc -- )
45 |
Use the polynomial u for the crc
46 |
47 |
48 |
crc-poly@ ( crc -- u )
49 |
Get the polynomial u in the crc
50 |
51 |

CRC-32 words

52 |
53 |
crc-reset ( crc -- )
54 |
Reset the crc calculation
55 |
56 |
57 |
crc-update ( c-addr u crc -- )
58 |
Update the crc structure with more byte data
59 |
60 |
61 |
crc-finish ( crc -- u )
62 |
Finish the calculation, return the CRC32 result
63 |
64 |

Module words

65 |
66 |
crc+calc-poly ( u1 .. un n -- u )
67 |
Calculate the polynomial u
68 |
69 |
70 |
crc+calc-crc32 ( c-addr u -- u1 )
71 |
Calculate the CRC32 for byte data with default crc32 table
72 |
73 |
74 |

Generated by fsdocgen 0.1.0

75 | 76 | 77 | -------------------------------------------------------------------------------- /html/dci.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | dci -- Double Linked Cell List Iterator 5 | 6 | 7 | 8 | 9 |

Module description

10 |
dci -- Double Linked Cell List Iterator
11 |
12 | The dci module implements an iterator on the double linked cell list dcl. 13 |
14 |
15 |
16 |

Iterator structure

17 |
18 |
dci% ( -- n )
19 |
Get the required space for a dci variable
20 |
21 |

Iterator creation, initialisation and destruction

22 |
23 |
dci-init ( dcl dci -- )
24 |
Initialise the iterator with a dcl list
25 |
26 |
27 |
dci-create ( dcl "<spaces>name" -- ; -- dci )
28 |
Create a named iterator in the dictionary with a dcl list
29 |
30 |
31 |
dci-new ( dcl -- dci )
32 |
Create an iterator on the heap with a dcl list
33 |
34 |
35 |
dci-free ( dci -- )
36 |
Free the iterator from the heap
37 |
38 |

Member words

39 |
40 |
dci-get ( dci -- x true | false )
41 |
Get the cell data x from the current record
42 |
43 |
44 |
dci-set ( x dci -- )
45 |
Set the cell data x for the current record
46 |
47 |

Iterator words

48 |
49 |
dci-first ( dci -- x true | false )
50 |
Move the iterator to the first record, return the cell data x
51 |
52 |
53 |
dci-next ( dci -- x true | false )
54 |
Move the iterator to the next record, return the cell data x
55 |
56 |
57 |
dci-prev ( dci -- x true | false )
58 |
Move the iterator to the previous record, return the cell data x
59 |
60 |
61 |
dci-last ( dci -- x true | false )
62 |
Move the iterator to the last record, return the cell data x
63 |
64 |
65 |
dci-move ( x dci -- false )
66 |
Move the iterator to the next record with the cell data x
67 |
68 |
69 |
dci-first? ( dci -- flag )
70 |
Check if the iterator is on the first record
71 |
72 |
73 |
dci-last? ( dci -- flag )
74 |
Check if the iterator is on the last record
75 |
76 |
77 |
dci-insert-after ( x dci -- )
78 |
Insert the cell data x after the current record
79 |
80 |

Inspection

81 |
82 |
dci-dump ( dci -- )
83 |
Dump the iterator
84 |
85 |
86 |

Generated by fsdocgen 0.1.0

87 | 88 | 89 | -------------------------------------------------------------------------------- /html/dcn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | dcn -- Double Linked Cell List Node 5 | 6 | 7 | 8 | 9 |

Module description

10 |
dcn -- Double Linked Cell List Node
11 |
12 | The dcn module implements a node in a dcl list. 13 |
14 |
15 |
16 |

Node structure

17 |
18 |
dcn% ( -- n )
19 |
Get the required space for a dcn node
20 |
21 |

Node creation, initialisation and destruction

22 |
23 |
dcn-init ( x dcn -- )
24 |
Initialise the node with data x
25 |
26 |
27 |
dcn-new ( x -- dcn )
28 |
Create a new node on the heap with data x
29 |
30 |
31 |
dcn-free ( dcn -- )
32 |
Free the node from the heap
33 |
34 |

Members words

35 |
36 |
dcn-cell@ ( dcn -- x )
37 |
Get the cell data x from the node
38 |
39 |
40 |
dcn-cell! ( x dcn -- )
41 |
Set the cell data x in the node
42 |
43 |

Inspection

44 |
45 |
dcn-dump ( dcn -- )
46 |
Dump the node
47 |
48 |
49 |

Generated by fsdocgen 0.1.0

50 | 51 | 52 | -------------------------------------------------------------------------------- /html/dni.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | dni -- Generic Double Linked List Iterator 5 | 6 | 7 | 8 | 9 |

Module description

10 |
dni -- Generic Double Linked List Iterator
11 |
12 | The dni module implements an iterator on the generic double linked list [dnl]. 13 |
14 |
15 |
16 |

Iterator structure

17 |
18 |
dni% ( -- n )
19 |
Get the required space for a dni variable
20 |
21 |

Iterator creation, initialisation and destruction

22 |
23 |
dni-init ( dnl dni -- )
24 |
Initialise the iterator with a dnl list
25 |
26 |
27 |
dni-create ( dnl "<spaces>name" -- ; -- dni )
28 |
Create a named iterator in the dictionary with a dnl list
29 |
30 |
31 |
dni-new ( dnl -- dni )
32 |
Create an iterator on the heap
33 |
34 |
35 |
dni-free ( dni -- )
36 |
Free the iterator from the heap
37 |
38 |

Member words

39 |
40 |
dni-get ( dni -- dnn | nil )
41 |
Get the current node
42 |
43 |

Iterator words

44 |
45 |
dni-first ( dni -- dnn | nil )
46 |
Move the iterator to the first node, return this node
47 |
48 |
49 |
dni-next ( dni -- dnn | nil )
50 |
Move the iterator to the next node, return this node
51 |
52 |
53 |
dni-prev ( dni -- dnn | nil )
54 |
Move the iterator to the previous node, return this node
55 |
56 |
57 |
dni-last ( dni -- dnn | nil )
58 |
Move the iterator to the last node, return this node
59 |
60 |
61 |
dni-first? ( dni -- flag )
62 |
Check if the iterator is on the first node
63 |
64 |
65 |
dni-last? ( dni -- flag )
66 |
Check if the iterator is on the last node
67 |
68 |

Inspection

69 |
70 |
dni-dump ( dni -- )
71 |
Dump the iterator variable
72 |
73 |
74 |

Generated by fsdocgen 0.1.0

75 | 76 | 77 | -------------------------------------------------------------------------------- /html/dnn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | dnn -- Generic Double Linked List Node 5 | 6 | 7 | 8 | 9 |

Module description

10 |
dnn -- Generic Double Linked List Node
11 |
12 | The dnn module implements a node in a dnl list. 13 |
14 |
15 |
16 |

Node structure

17 |
18 |
dnn% ( -- n )
19 |
Get the required space for a dnn structure
20 |
21 |

Node creation, initialisation and destruction

22 |
23 |
dnn-init ( dnn -- )
24 |
Initialise the node
25 |
26 |
27 |
dnn-new ( -- dnn )
28 |
Create a new node on the heap
29 |
30 |
31 |
dnn-free ( dnn -- )
32 |
Free the node from the heap
33 |
34 |

Members words

35 |
36 |
dnn-next@ ( dnn1 -- dnn2 )
37 |
Get the next node dnn2 from node dnn1
38 |
39 |
40 |
dnn-next! ( dnn1 dnn2 -- )
41 |
Set for node dnn2 the next node to dnn1
42 |
43 |
44 |
dnn-prev@ ( dnn1 -- dnn2 )
45 |
Get from node dnn1 the previous node
46 |
47 |
48 |
dnn-prev! ( dnn1 dnn2 -- )
49 |
Set for node dnn2 the previous node to dnn1
50 |
51 |

Inspection

52 |
53 |
dnn-dump ( dnn -- )
54 |
Dump the node
55 |
56 |
57 |

Generated by fsdocgen 0.1.0

58 | 59 | 60 | -------------------------------------------------------------------------------- /html/est.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | est -- String with escaped characters 5 | 6 | 7 | 8 | 9 |

Module description

10 |
est -- String with escaped characters
11 |
12 | The est module implements a string with escaped characters. The code is 13 | inspired by the proposal for escaped strings by Stephen Pelc and Peter 14 | Knaggs. The following conversion characters are translated: 15 |
                                                                      
16 | \a  - bel = ascii 7                                                        
17 | \b  - backspace = ascii 8                                                  
18 | \e  - escape = ascii 27                                                    
19 | \f  - formfeed = ascii 12                                                  
20 | \l  - linefeed = ascii 10                                                  
21 | \m  - cr/lf = ascii 13,10                                                  
22 | \n  - new line                                                             
23 | \q  - quote = ascii 34                                                     
24 | \r  - cr = ascii 13                                                        
25 | \t  - ht = ascii 9                                                         
26 | \v  - vt = ascii 11                                                        
27 | \z  - nul = ascii 0                                                        
28 | \"  - quote = ascii 34                                                     
29 | xhh - hex digit                                                            
30 | \\  - backslash                                                            
31 | 
32 |
33 |
34 |
35 |

String words

36 |
37 |
parse-esc ( c-addr1 u1 c-addr2 -- c-addr3 u3 )
38 |
Parse the escaped character in string c-addr1 u1, store the result in string c-addr2 and return the remaining string c-addr3 u3
39 |
40 |
41 |
parse\" ( "ccc<quote>" -- c-addr u )
42 |
Parse the input stream for a escaped string
43 |
44 |
45 |
s\" ( "ccc<quote>" -- c-addr u )
46 |
Create a string with escaped characters
47 |
48 |
49 |
,\" ( "ccc<quote>" -- )
50 |
Store a string with escaped characters in the dictionary
51 |
52 |
53 |

Generated by fsdocgen 0.1.0

54 | 55 | 56 | -------------------------------------------------------------------------------- /html/ffl.html: -------------------------------------------------------------------------------- 1 |
2 |

Generated by fsdocgen 0.1.0

3 | 4 | 5 | -------------------------------------------------------------------------------- /html/gmo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | gmo -- Gettexts mo-file import 5 | 6 | 7 | 8 | 9 |

Module description

10 |
gmo -- Gettexts mo-file import
11 |
12 | The gmo module implements the import of the contents of a gettexts mo-file 13 | into a message catalog. The mo-file uses 4 byte pointers and 1 byte 14 | characters, so this module has an environmental dependency. 15 |
16 |
17 |
18 |

Import

19 |
20 |
gmo-read ( c-addr u msc -- 0 | ior )
21 |
Read a mo-file named c-addr u and store the contents in the message catalog msc
22 |
23 |

Examples

24 |
25 | \ ==============================================================================
26 | \
27 | \         gmo_expl - the gettexts mo-file import example in the ffl
28 | \
29 | \               Copyright (C) 2007  Dick van Oudheusden
30 | \  
31 | \ This library is free software; you can redistribute it and/or
32 | \ modify it under the terms of the GNU General Public
33 | \ License as published by the Free Software Foundation; either
34 | \ version 2 of the License, or (at your option) any later version.
35 | \
36 | \ This library is distributed in the hope that it will be useful,
37 | \ but WITHOUT ANY WARRANTY; without even the implied warranty of
38 | \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
39 | \ General Public License for more details.
40 | \
41 | \ You should have received a copy of the GNU General Public
42 | \ License along with this library; if not, write to the Free
43 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
44 | \
45 | \ ==============================================================================
46 | \ 
47 | \  $Date: 2007-11-17 07:47:22 $ $Revision: 1.1 $
48 | \
49 | \ ==============================================================================
50 | 
51 | include ffl/gmo.fs
52 | 
53 | 
54 | \ Example: import nl.mo file in a message catalog
55 | 
56 | msc-new value en>nl                 \ Create a message catalog on the heap
57 | 
58 | s" nl.mo" en>nl gmo-read throw      \ Import the nl.mo file in the catalog
59 | 
60 | s" Sunday" en>nl msc-translate type cr  \ Use the catalog for the translations
61 | 
62 | en>nl msc-free                      \ Free the message catalog from the heap
63 | 
64 |
65 |

Generated by fsdocgen 0.1.0

66 | 67 | 68 | -------------------------------------------------------------------------------- /html/gzi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | gzi -- gzip Input Base Module 5 | 6 | 7 | 8 | 9 |

Module description

10 |
gzi -- gzip Input Base Module
11 |
12 | The gzi module implements the gzip inflate algorithm. The module is used 13 | for reading from a gzip file zif and, in a future 14 | version, from a stream zis. 15 |
16 |
17 |
18 |

gzi constants

19 |
20 |
gzi.ok ( -- n )
21 |
Decompression step is okee
22 |
23 |
24 |
gzi.done ( -- n )
25 |
Decompression is done
26 |
27 |
28 |
gzi.more ( -- n )
29 |
Decompression step needs more data
30 |
31 |
32 |
gzi.states ( -- n )
33 |
Decompression step states
34 |
35 |

gzi structure

36 |
37 |
gzi% ( -- n )
38 |
Get the required space for a gzi variable
39 |
40 |

gzip inflation variable creation, initialisation and destruction

41 |
42 |
gzi-init ( u gzi -- )
43 |
Initialise the gzip inflation variable with an initial output buffer size u
44 |
45 |
46 |
gzi-(free) ( gzi -- )
47 |
Free the internal, private variables from the heap
48 |
49 |
50 |
gzi-create ( "<spaces>name" u -- ; -- gzi )
51 |
Create a named gzip inflation variable in the dictionary with an initial output buffer size u
52 |
53 |
54 |
gzi-new ( -- gzi )
55 |
Create a new gzip inflation variable on the heap
56 |
57 |
58 |
gzi-free ( gzi -- )
59 |
Free the variable from the heap
60 |
61 |

Member words

62 |
63 |
gzi-lbf@ ( gzi -- lbf )
64 |
Get the output buffer
65 |
66 |

Inflate words

67 |
68 |
gzi-init-inflate ( gzi -- )
69 |
Start the inflation of data
70 |
71 |
72 |
gzi-inflate ( gzi -- ior )
73 |
Do the next step in inflating data, return the result code
74 |
75 |
76 |
gzi-reduce-output ( gzi -- )
77 |
Check if the output buffer can be reduced
78 |
79 |
80 |
gzi-end-inflate ( gzi -- )
81 |
Finish the inflation of data
82 |
83 |

Inspection

84 |
85 |
gzi-dump ( gzi -- )
86 |
Dump the gzi
87 |
88 |
89 |

Generated by fsdocgen 0.1.0

90 | 91 | 92 | -------------------------------------------------------------------------------- /html/hci.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | hci -- Hash Cell Table Iterator 5 | 6 | 7 | 8 | 9 |

Module description

10 |
hci -- Hash Cell Table Iterator
11 |
12 | The hci module implements an iterator on the hash cell table hct. 13 |
14 |
15 |
16 |

Iterator structure

17 |
18 |
hci% ( -- n )
19 |
Get the required space for a hash cell table iterator
20 |
21 |

Iterator creation, initialisation and destruction words

22 |
23 |
hci-init ( hct hci -- )
24 |
Initialise the iterator with a hash table
25 |
26 |
27 |
hci-create ( hct "<spaces>name" -- ; -- hci )
28 |
Create a named iterator in the dictionary on the hash table hct
29 |
30 |
31 |
hci-new ( hct -- hci )
32 |
Create an iterator on the heap on the hash table hct
33 |
34 |
35 |
hci-free ( hci -- )
36 |
Free the iterator from heap
37 |
38 |

Member words

39 |
40 |
hci-get ( hci -- false | x true )
41 |
Get the cell data x from the current record
42 |
43 |
44 |
hci-key ( hci -- c-addr u )
45 |
Get the key from the current record
46 |
47 |
48 |
hci-set ( x hci -- )
49 |
Set the cell data x in the current record
50 |
51 |

Iterator words

52 |
53 |
hci-first ( hci -- x true | false )
54 |
Move the iterator to the first record, return the cell data of this record
55 |
56 |
57 |
hci-next ( hci -- x true | false )
58 |
Move the iterator to the next record, return the cell data from this record
59 |
60 |
61 |
hci-move ( x hci -- flag )
62 |
Move the iterator to the next record with the cell data x, return success
63 |
64 |
65 |
hci-first? ( hci -- flag )
66 |
Check if the iterator is on the first record
67 |
68 |
69 |
hci-last? ( hci -- flag )
70 |
Check if the iterator is on the last record
71 |
72 |

Inspection

73 |
74 |
hci-dump ( hci -- )
75 |
Dump the iterator
76 |
77 |
78 |

Generated by fsdocgen 0.1.0

79 | 80 | 81 | -------------------------------------------------------------------------------- /html/hcn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | hcn -- Hash Table Cell Node 5 | 6 | 7 | 8 | 9 |

Module description

10 |
hcn -- Hash Table Cell Node
11 |
12 | The hcn module implements a node that stores cell wide data in a hash table. 13 |
14 |
15 |
16 |

Hash table node structure

17 |
18 |
hcn% ( - n )
19 |
Get the required space for a hcn node
20 |
21 |

Node creation, initialisation and destruction

22 |
23 |
hcn-init ( x c-addr u u2 hcn -- )
24 |
Initialise the node with the hash u2, the key c-addr u and cell data x
25 |
26 |
27 |
hcn-(free) ( hcn -- )
28 |
Free the key from the heap
29 |
30 |
31 |
hcn-new ( x c-addr u u2 -- hcn )
32 |
Create a new node on the heap with the hash u2, the key c-addr u and cell data x
33 |
34 |
35 |
hcn-free ( hcn -- )
36 |
Free the node from the heap
37 |
38 |

Inspection

39 |
40 |
hcn-dump ( hcn -- )
41 |
Dump the node
42 |
43 |
44 |

Generated by fsdocgen 0.1.0

45 | 46 | 47 | -------------------------------------------------------------------------------- /html/hni.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | hni -- Generic Hash Table Iterator 5 | 6 | 7 | 8 | 9 |

Module description

10 |
hni -- Generic Hash Table Iterator
11 |
12 | The hni module implements an iterator on the generic hash table hnt. 13 |
14 |
15 |
16 |

Iterator structure

17 |
18 |
hni% ( -- n )
19 |
Get the required space for a hash table base iterator variable
20 |
21 |

Iterator creation, initialisation and destruction words

22 |
23 |
hni-init ( hnt hni -- )
24 |
Initialise the iterator with the hash table hnt
25 |
26 |
27 |
hni-create ( hnt "<spaces>name" -- ; -- hni )
28 |
Create a named iterator in the dictionary on the hash table hnt
29 |
30 |
31 |
hni-new ( hnt -- hni )
32 |
Create an iterator on the heap on the hash table hnt
33 |
34 |
35 |
hni-free ( hni -- )
36 |
Free iterator from heap
37 |
38 |

Member words

39 |
40 |
hni-get ( hni -- hnn | nil )
41 |
Get the node from the current record
42 |
43 |
44 |
hni-key ( hni -- c-addr u )
45 |
Get the key from the current record
46 |
47 |

Iterator words

48 |
49 |
hni-first ( hni -- hnn | nil )
50 |
Move the iterator to the first record, return the node in this record
51 |
52 |
53 |
hni-next ( hni -- hnn | nil )
54 |
Move the iterator to the next record, return the node in this record
55 |
56 |
57 |
hni-first? ( hni -- flag )
58 |
Check if the iterator is on the first record
59 |
60 |
61 |
hni-last? ( hni -- flag )
62 |
Check if the iterator is on the last record
63 |
64 |

Inspection

65 |
66 |
hni-dump ( hni -- )
67 |
Dump the iterator
68 |
69 |
70 |

Generated by fsdocgen 0.1.0

71 | 72 | 73 | -------------------------------------------------------------------------------- /html/hnn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | hnn -- Generic Hash Table Node 5 | 6 | 7 | 8 | 9 |

Module description

10 |
hnn -- Generic Hash Table Node
11 |
12 | The hnn module implements a generic node in the hash table hnt. 13 |
14 |
15 |
16 |

Hash table node structure

17 |
18 |
hnn% ( -- n )
19 |
Get the required space for a hnn node
20 |
21 |

Node creation, initialisation and destruction

22 |
23 |
hnn-init ( c-addr u u2 hnn -- )
24 |
Initialise the node with the key c-addr u and hash u2
25 |
26 |
27 |
hnn-(free) ( hnn -- )
28 |
Free the key from the heap
29 |
30 |
31 |
hnn-new ( c-addr u u2 -- hnn )
32 |
Create a new node on the heap with the key c-addr u and hash u2
33 |
34 |
35 |
hnn-free ( hnn -- )
36 |
Free the node from the heap
37 |
38 |

Member words

39 |
40 |
hnn-key@ ( hnn -- c-addr u )
41 |
Get the key from the node
42 |
43 |

Inspection

44 |
45 |
hnn-dump ( hnn -- )
46 |
Dump the node
47 |
48 |
49 |

Generated by fsdocgen 0.1.0

50 | 51 | 52 | -------------------------------------------------------------------------------- /html/make.html: -------------------------------------------------------------------------------- 1 |
2 |

Generated by fsdocgen 0.1.0

3 | 4 | 5 | -------------------------------------------------------------------------------- /html/ncn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ncn -- n-Tree cell node 5 | 6 | 7 | 8 | 9 |

Module description

10 |
ncn -- n-Tree cell node
11 |
12 | The ncn module implements a node in a n-tree nct that stores a cell value. 13 |
14 |
15 |
16 |

Node structure

17 |
18 |
ncn% ( -- n )
19 |
Get the required space for a ncn node
20 |
21 |

Node creation, initialisation and destruction

22 |
23 |
ncn-init ( x ncn -- )
24 |
Initialise the node with data x
25 |
26 |
27 |
ncn-new ( x -- ncn )
28 |
Create a new node on the heap with data x
29 |
30 |
31 |
ncn-free ( ncn -- )
32 |
Free the node from the heap
33 |
34 |

Members words

35 |
36 |
ncn-cell@ ( ncn -- x )
37 |
Get the cell data from the node
38 |
39 |
40 |
ncn-cell! ( x ncn -- )
41 |
Set the cell data x in the node
42 |
43 |

Inspection

44 |
45 |
ncn-dump ( ncn -- )
46 |
Dump the node
47 |
48 |
49 |

Generated by fsdocgen 0.1.0

50 | 51 | 52 | -------------------------------------------------------------------------------- /html/nct.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | nct -- n-Tree cell module 5 | 6 | 7 | 8 | 9 |

Module description

10 |
nct -- n-Tree cell module
11 |
12 | The nct module implements a n-Tree that can store cell size data. It extends 13 | the base n-Tree module, with cell based words. For adding and removing cells 14 | to and from the tree, use the iterator nci. 15 |
16 |
17 |
18 |

Tree structure

19 |
20 |
nct% ( -- n )
21 |
Get the required space for a nct variable
22 |
23 |

Tree creation, initialisation and destruction

24 |
25 |
nct-init ( nct -- )
26 |
Initialise the tree
27 |
28 |
29 |
nct-(free) ( nct -- )
30 |
Free the nodes in the tree
31 |
32 |
33 |
nct-create ( "<spaces>name" -- ; -- nct )
34 |
Create a named n-tree in the dictionary
35 |
36 |
37 |
nct-new ( -- nct )
38 |
Create a new n-tree on the heap
39 |
40 |
41 |
nct-free ( nct -- )
42 |
Free the tree from the heap
43 |
44 |

Member words

45 |
46 |
nct-length@ ( nct -- u )
47 |
Get the number of nodes in the tree
48 |
49 |
50 |
nct-empty? ( nct -- flag )
51 |
Check for empty tree
52 |
53 |

Tree words

54 |
55 |
nct-clear ( nct -- )
56 |
Delete all nodes from the tree
57 |
58 |
59 |
nct-execute ( i*x xt nct -- j*x )
60 |
Execute xt for every node in tree
61 |
62 |
63 |
nct-execute? ( i*x xt nct -- j*x flag )
64 |
Execute xt for every node in the tree or until xt returns true, flag is true if xt returned true
65 |
66 |
67 |
nct-count ( x nct -- u )
68 |
Count the number of the occurrences of the cell data x in the tree
69 |
70 |
71 |
nct-has? ( x nct -- flag )
72 |
Check if the cell data x is present in the tree
73 |
74 |

Inspection

75 |
76 |
nct-dump ( nct -- )
77 |
Dump the tree
78 |
79 |
80 |

Generated by fsdocgen 0.1.0

81 | 82 | 83 | -------------------------------------------------------------------------------- /html/nnn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | nnn -- Generic n-Tree Node 5 | 6 | 7 | 8 | 9 |

Module description

10 |
nnn -- Generic n-Tree Node
11 |
12 | The nnn module implements a generic node in a n-tree nnt. 13 |
14 |
15 |
16 |

Node structure

17 |
18 |
nnn% ( -- n )
19 |
Get the required space for a nnn node
20 |
21 |

Node creation, initialisation and destruction

22 |
23 |
nnn-init ( nnn -- )
24 |
Initialise the node
25 |
26 |
27 |
nnn-new ( -- nnn )
28 |
Create a new node on the heap
29 |
30 |
31 |
nnn-free ( nnn -- )
32 |
Free the node from the heap
33 |
34 |

Members words

35 |
36 |
nnn-parent@ ( nnn1 -- nnn2 )
37 |
Get from node nnn1 the parent node
38 |
39 |
40 |
nnn-parent! ( nnn1 nnn2 -- )
41 |
Set for node nnn2 the parent to nnn1
42 |
43 |

Inspection

44 |
45 |
nnn-dump ( nnn -- )
46 |
Dump the node
47 |
48 |
49 |

Generated by fsdocgen 0.1.0

50 | 51 | 52 | -------------------------------------------------------------------------------- /html/nnt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | nnt -- Generic n-Tree 5 | 6 | 7 | 8 | 9 |

Module description

10 |
nnt -- Generic n-Tree
11 |
12 | The nnt module implements a n-Tree that can store variable size nodes. It 13 | is the base module for more specialized trees, for example the cel n-tree 14 | nct. Due to the structure of a n-tree the words for 15 | changing the tree, adding and removing children, are part of the iterator 16 | nni. 17 |
18 |
19 |
20 |

Tree structure

21 |
22 |
nnt% ( -- n )
23 |
Get the required space for a nnt variable
24 |
25 |

Tree creation, initialisation and destruction

26 |
27 |
nnt-init ( nnt -- )
28 |
Initialise the n-tree
29 |
30 |
31 |
nnt-(free) ( xt nnt -- )
32 |
Free all nodes in the tree with xt
33 |
34 |
35 |
nnt-create ( "<spaces>name" -- ; -- nnt )
36 |
Create a named n-tree in the dictionary
37 |
38 |
39 |
nnt-new ( -- nnt )
40 |
Create a new n-tree on the heap
41 |
42 |
43 |
nnt-free ( nnt -- )
44 |
Free the tree from the heap
45 |
46 |

Member words

47 |
48 |
nnt-length@ ( nnt -- u )
49 |
Get the number of nodes in the tree
50 |
51 |
52 |
nnt-empty? ( nnt -- flag )
53 |
Check for an empty tree
54 |
55 |
56 |
nnt-root@ ( nnt -- nnn | nil )
57 |
Get the root of the tree
58 |
59 |

Tree words

60 |
61 |
nnt-execute ( i*x xt nnt -- j*x )
62 |
Execute xt for every node in tree
63 |
64 |
65 |
nnt-execute? ( i*x xt nnt -- j*x flag )
66 |
Execute xt for every node in the tree or until xt returns true, flag is true if xt returned true
67 |
68 |

Inspection

69 |
70 |
nnt-dump ( nnt -- )
71 |
Dump the tree
72 |
73 |
74 |

Generated by fsdocgen 0.1.0

75 | 76 | 77 | -------------------------------------------------------------------------------- /html/rng.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | rng -- Pseudo random number generator module 5 | 6 | 7 | 8 | 9 |

Module description

10 |
rng -- Pseudo random number generator module
11 |
12 | The rng module implements a pseudo random number generator; 13 | it uses the Mersenne Twister as generator with a period of 2^19937 - 1. 14 |
15 |
16 |
17 |

Random generator structure

18 |
19 |
rng% ( -- n )
20 |
Get the required space for a rng variable
21 |
22 |

Random generator creation, initialisation and destruction

23 |
24 |
rng-init ( u rng -- )
25 |
Initialise the generator with the seed u
26 |
27 |
28 |
rng-create ( u "<spaces>name" -- ; -- rng )
29 |
Create a named random generator in the dictionary with seed u
30 |
31 |
32 |
rng-new ( u -- rng )
33 |
Create a new random generator on the heap with seed u
34 |
35 |
36 |
rng-free ( rng -- )
37 |
Free the random generator from the heap
38 |
39 |

Random generator words

40 |
41 |
rng-seed ( u rng -- )
42 |
Initialise the generator with the seed u
43 |
44 |
45 |
rng-next-number ( rng -- n )
46 |
Calculate the next pseudo random number, 32 bit
47 |
48 |
49 |
rng-next-float ( rng -- r )
50 |
Calculate the next pseudo random float number, range [0,1>
51 |
52 |

Inspection

53 |
54 |
rng-dump ( rng -- )
55 |
Dump the random generator
56 |
57 |
58 |

Generated by fsdocgen 0.1.0

59 | 60 | 61 | -------------------------------------------------------------------------------- /html/sci.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sci -- Single Linked Cell List Iterator 5 | 6 | 7 | 8 | 9 |

Module description

10 |
sci -- Single Linked Cell List Iterator
11 |
12 | The sci module implements an iterator on the single linked cell list scl. 13 |
14 |
15 |
16 |

Iterator structure

17 |
18 |
sci% ( -- n )
19 |
Get the required space for a sci variable
20 |
21 |

Iterator creation, initialisation and destruction

22 |
23 |
sci-init ( scl sci -- )
24 |
Initialise the iterator with a scl list
25 |
26 |
27 |
sci-create ( scl "<spaces>name" -- ; -- sci )
28 |
Create a named iterator in the dictionary on the scl list
29 |
30 |
31 |
sci-new ( scl -- sci )
32 |
Create an iterator on the heap on the scl list
33 |
34 |
35 |
sci-free ( sci -- )
36 |
Free the iterator from the heap
37 |
38 |

Member words

39 |
40 |
sci-get ( sci -- x true | false )
41 |
Get the cell data x from the current node
42 |
43 |
44 |
sci-set ( x sci -- )
45 |
Set the cell data x for the current node
46 |
47 |

Iterator words

48 |
49 |
sci-first ( sci -- x true | false )
50 |
Move the iterator to the first node, return the cell data x from this node
51 |
52 |
53 |
sci-next ( sci -- x true | false )
54 |
Move the iterator to the next node, return the cell data x from this node
55 |
56 |
57 |
sci-move ( x sci -- flag )
58 |
Move the iterator to the next node with the cell data x
59 |
60 |
61 |
sci-first? ( sci -- flag )
62 |
Check if the iterator is on the first node
63 |
64 |
65 |
sci-last? ( sci -- flag )
66 |
Check if the iterator is on the last node
67 |
68 |
69 |
sci-insert-after ( x sci -- )
70 |
Insert the cell data x after the current node
71 |
72 |

Inspection

73 |
74 |
sci-dump ( sci -- )
75 |
Dump the iterator
76 |
77 |
78 |

Generated by fsdocgen 0.1.0

79 | 80 | 81 | -------------------------------------------------------------------------------- /html/scn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | scn -- Single Linked Cell Node 5 | 6 | 7 | 8 | 9 |

Module description

10 |
scn -- Single Linked Cell Node
11 |
12 | The scn module implements a node in the single linked list scl. 13 |
14 |
15 |
16 |

Node structure

17 |
18 |
scn% ( -- n )
19 |
Get the required space for a scn node
20 |
21 |

Node creation, initialisation and destruction

22 |
23 |
scn-init ( x scn -- )
24 |
Initialise the node with cell data x
25 |
26 |
27 |
scn-new ( x -- scn )
28 |
Create a new node on the heap with cell data x
29 |
30 |
31 |
scn-free ( scn -- )
32 |
Free the node from the heap
33 |
34 |

Members words

35 |
36 |
scn-cell@ ( scn -- x )
37 |
Get the cell data x from the node
38 |
39 |
40 |
scn-cell! ( x scn -- )
41 |
Set the cell data x in the node
42 |
43 |

Inspection

44 |
45 |
scn-dump ( scn -- )
46 |
Dump the node
47 |
48 |
49 |

Generated by fsdocgen 0.1.0

50 | 51 | 52 | -------------------------------------------------------------------------------- /html/sni.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sni -- Generic Single Linked List Iterator 5 | 6 | 7 | 8 | 9 |

Module description

10 |
sni -- Generic Single Linked List Iterator
11 |
12 | The sni module implements an iterator on the generic single linked list snl. 13 |
14 |
15 |
16 |

Iterator structure

17 |
18 |
sni% ( -- n )
19 |
Get the required space for a sni variable
20 |
21 |

Iterator creation, initialisation and destruction

22 |
23 |
sni-init ( snl sni -- )
24 |
Initialise the iterator with a snl list
25 |
26 |
27 |
sni-create ( snl "<spaces>name" -- ; -- sni )
28 |
Create a named iterator in the dictionary on the snl list
29 |
30 |
31 |
sni-new ( snl -- sni )
32 |
Create an iterator on the snl list on the heap
33 |
34 |
35 |
sni-free ( sni -- )
36 |
Free the iterator from the heap
37 |
38 |

Member words

39 |
40 |
sni-get ( sni -- snn | nil )
41 |
Get the current node
42 |
43 |

Iterator words

44 |
45 |
sni-first ( sni -- snn | nil )
46 |
Move the iterator to the first node, return this node
47 |
48 |
49 |
sni-next ( sni -- snn | nil )
50 |
Move the iterator to the next node, return this node
51 |
52 |
53 |
sni-first? ( sni -- flag )
54 |
Check if the iterator is on the first node
55 |
56 |
57 |
sni-last? ( sni -- flag )
58 |
Check if the iterator is on the last node
59 |
60 |

Inspection

61 |
62 |
sni-dump ( sni -- )
63 |
Dump the iterator
64 |
65 |
66 |

Generated by fsdocgen 0.1.0

67 | 68 | 69 | -------------------------------------------------------------------------------- /html/snn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | snn -- Generic Single Linked List Node 5 | 6 | 7 | 8 | 9 |

Module description

10 |
snn -- Generic Single Linked List Node
11 |
12 | The snn module implements a node in a generic single linked list snl. 13 |
14 |
15 |
16 |

Node structure

17 |
18 |
snn% ( - n )
19 |
Get the required space for a snn node
20 |
21 |

Node creation, initialisation and destruction

22 |
23 |
snn-init ( snn -- )
24 |
Initialise the node
25 |
26 |
27 |
snn-new ( -- snn )
28 |
Create a new node on the heap
29 |
30 |
31 |
snn-free ( snn -- )
32 |
Free the node from the heap
33 |
34 |

Member words

35 |
36 |
snn-next@ ( snn1 -- snn2 )
37 |
Get the next node snn2 from the node snn1
38 |
39 |
40 |
snn-next! ( snn1 snn2 -- )
41 |
Set for the node snn1 the next node to snn2
42 |
43 |

Inspection

44 |
45 |
snn-dump ( snn -- )
46 |
Dump the single list node
47 |
48 |
49 |

Generated by fsdocgen 0.1.0

50 | 51 | 52 | -------------------------------------------------------------------------------- /html/tmr.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | tmr -- Timer module 5 | 6 | 7 | 8 | 9 |

Module description

10 |
tmr -- Timer module
11 |
12 | The tmr module implements a poll able interval timer. Due to the fact that 13 | the ANS standard does not define a way to fetch milliseconds, this module 14 | has a environmental dependency. 15 |
16 |
17 |
18 |

Timer structure

19 |
20 |
tmr% ( - n )
21 |
Get the required space for the timer variable
22 |
23 |

Timer variable creation, initialisation and destruction

24 |
25 |
tmr-init ( u tmr -- )
26 |
Initialise the timer with timeout u
27 |
28 |
29 |
tmr-create ( u "<spaces>name" -- ; -- tmr )
30 |
Create a named timer variable in the dictionary with timeout u
31 |
32 |
33 |
tmr-new ( u -- tmr )
34 |
Create a new timer variable on the heap with timeout u
35 |
36 |
37 |
tmr-free ( tmr -- )
38 |
Free the timer from the heap
39 |
40 |

Member words

41 |
42 |
tmr-timeout@ ( tmr -- u )
43 |
Get the timeout value from the timer
44 |
45 |
46 |
tmr-timer@ ( tmr -- u )
47 |
Get the running time u from the timer in ms, after last [re]start, expired? or wait
48 |
49 |

Timer words

50 |
51 |
tmr-start ( u tmr -- )
52 |
Start the timer with a timeout value u
53 |
54 |
55 |
tmr-restart ( tmr -- )
56 |
Restart the timer with the current timeout value
57 |
58 |
59 |
tmr-expired? ( tmr -- flag )
60 |
Check if the timer is expired, if so the timer is restarted
61 |
62 |
63 |
tmr-wait ( tmr -- )
64 |
Wait till the timer expires and restart the timer
65 |
66 |

Inspection

67 |
68 |
tmr-dump ( tmr -- )
69 |
Dump the tmr state
70 |
71 |
72 |

Generated by fsdocgen 0.1.0

73 | 74 | 75 | -------------------------------------------------------------------------------- /html/tst.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | tst -- Module testing 5 | 6 | 7 | 8 | 9 |

Module description

10 |
tst -- Module testing
11 |
12 | The tst module implements a module testing framework. 13 |
14 |
15 |
16 |

Test syntax words

17 |
18 |
t{ ( -- )
19 |
Start a test
20 |
21 |
22 |
}t ( i*x j*r -- )
23 |
Check for stack overflow
24 |
25 |

Test value words

26 |
27 |
?s ( n1 n2 -- )
28 |
Check for signed value on stack
29 |
30 |
31 |
?u ( u1 u2 -- )
32 |
Check for unsigned value on stack
33 |
34 |
35 |
?d ( d1 d2 -- )
36 |
Check for a signed double on stack
37 |
38 |
39 |
?ud ( ud1 ud2 -- )
40 |
Check for an unsigned double on stack
41 |
42 |
43 |
?0 ( x -- )
44 |
Check for zero value on stack
45 |
46 |
47 |
?nil ( addr -- )
48 |
Check for nil value on stack
49 |
50 |
51 |
?true ( flag -- )
52 |
Check for true value on stack
53 |
54 |
55 |
?false ( flag -- )
56 |
Check for false value on stack
57 |
58 |
59 |
?r ( r1 r2 -- )
60 |
Check for float value on stack
61 |
62 |
63 |
?str ( c-addr1 u1 c-addr2 u2 -- )
64 |
Check for a string on the stack
65 |
66 |

Test results words

67 |
68 |
tst-reset-tests ( -- )
69 |
Reset the test results
70 |
71 |
72 |
tst-get-result ( -- u1 u2 u3 )
73 |
Get the test results, return the test time u1, the number of tests u2 and the number of errors u3
74 |
75 |
76 |

Generated by fsdocgen 0.1.0

77 | 78 | 79 | -------------------------------------------------------------------------------- /test/README: -------------------------------------------------------------------------------- 1 | mo-file creation: 2 | msgfmt -v -c --no-hash -o nl.mo nl.po 3 | -------------------------------------------------------------------------------- /test/a32_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ a32_test - the test words for the a32 module in the ffl 4 | \ 5 | \ Copyright (C) 2008 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-04-05 08:05:28 $ $Revision: 1.1 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/a32.fs 28 | include ffl/tst.fs 29 | 30 | 31 | [DEFINED] a32.version [IF] 32 | 33 | .( Testing: a32) cr 34 | 35 | a32-create ad1 36 | 37 | hex 38 | 39 | t{ s" abc" ad1 a32-update }t 40 | 41 | t{ ad1 a32-finish 24D0127 ?u }t 42 | 43 | t{ ad1 a32-length@ 3 ?s }t 44 | 45 | t{ ad1 a32-reset }t 46 | 47 | t{ s" abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" ad1 a32-update }t 48 | 49 | t{ ad1 a32-finish 807416F9 ?u }t 50 | 51 | 52 | t{ ad1 a32-reset }t 53 | 54 | t{ s" abcd" ad1 a32-update }t 55 | t{ s" bcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" ad1 a32-update }t 56 | 57 | t{ ad1 a32-finish 807416F9 ?u }t 58 | 59 | 60 | t{ a32-new value ad2 }t 61 | 62 | decimal 63 | 64 | : a32-test 65 | 50000 0 DO 66 | s" aaaaaaaaaaaaaaaaaaaa" ad2 a32-update 67 | LOOP 68 | ; 69 | 70 | a32-test \ a million times "a" 71 | 72 | t{ ad2 a32-finish a32+to-string s" 15D870F9" ?str }t 73 | 74 | t{ ad2 a32-length@ 1000000 ?s }t 75 | 76 | t{ ad2 ad1 a32^combine hex CE9E87F1 ?u decimal }t 77 | 78 | t{ ad2 a32-reset }t 79 | 80 | 10000 chars allocate throw value a32-buf \ 10000 times highest byte 81 | a32-buf 10000 255 fill 82 | 83 | t{ a32-buf 10000 ad2 a32-update }t 84 | t{ ad2 a32-finish hex B623EB2B ?u decimal }t 85 | 86 | a32-buf free throw 87 | 88 | t{ ad2 a32-free }t 89 | 90 | [THEN] 91 | 92 | \ ============================================================================== 93 | -------------------------------------------------------------------------------- /test/arg_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ arg_test - the test words for the arg module in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2008-05-19 05:44:00 $ $Revision: 1.6 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/arg.fs 28 | include ffl/tst.fs 29 | 30 | 31 | [DEFINED] arg.version [IF] 32 | 33 | .( Testing: arg) cr 34 | 35 | t{ 60 TO arg.cols }t 36 | 37 | t{ s" test" s" [OPTION] .. [FILES]" s" v1.0" s" Report bugs to bugs@bugs.com" arg-new value arg1 }t 38 | 39 | 40 | t{ arg1 arg-add-help-option }t 41 | 42 | t{ arg1 arg-add-version-option }t 43 | 44 | 45 | t{ char a s" " s" test option a" true 4 arg1 arg-add-option }t 46 | 47 | t{ char b s" bold" s" test option b/bold" true 5 arg1 arg-add-option }t 48 | 49 | t{ char c s" caption" s" test option c/caption" false 6 arg1 arg-add-option }t 50 | 51 | t{ 0 s" verbose" s" test option verbose" true 7 arg1 arg-add-option }t 52 | 53 | t{ char f s" file=FILE" s" test option f/file" false 8 arg1 arg-add-option }t 54 | 55 | #args [IF] 56 | 57 | \ test with -ab -c TEST --verbose --file=FILE input 58 | 59 | \ t{ arg1 arg-print-help }t 60 | \ t{ arg1 arg-print-version }t 61 | 62 | t{ arg1 arg-parse 4 ?s }t 63 | t{ arg1 arg-parse 5 ?s }t 64 | t{ arg1 arg-parse 6 ?s s" TEST" ?str }t 65 | t{ arg1 arg-parse 7 ?s }t 66 | t{ arg1 arg-parse 8 ?s s" FILE" ?str }t 67 | t{ arg1 arg-parse arg.non-option ?s s" input" ?str }t 68 | t{ arg1 arg-parse arg.done ?s }t 69 | 70 | [THEN] 71 | 72 | t{ arg1 arg-free }t 73 | 74 | [THEN] 75 | 76 | \ ============================================================================== 77 | -------------------------------------------------------------------------------- /test/b64_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ b64_test - the test words for the b64 module in the ffl 4 | \ 5 | \ Copyright (C) 2009 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-12-24 19:32:12 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/b64.fs 28 | include ffl/tst.fs 29 | 30 | 31 | [DEFINED] b64.version [IF] 32 | 33 | .( Testing: b64) cr 34 | 35 | str-create b64-var 36 | 37 | t{ s" " b64-var b64-encode s" " ?str }t 38 | 39 | t{ s" f" b64-var b64-encode s" Zg==" ?str }t 40 | 41 | t{ s" fo" b64-var b64-encode s" Zm8=" ?str }t 42 | 43 | t{ s" foo" b64-var b64-encode s" Zm9v" ?str }t 44 | 45 | t{ s" foob" b64-var b64-encode s" Zm9vYg==" ?str }t 46 | 47 | t{ s" fooba" b64-var b64-encode s" Zm9vYmE=" ?str }t 48 | 49 | t{ s" foobar" b64-var b64-encode s" Zm9vYmFy" ?str }t 50 | 51 | hex 52 | create b64-test 53 | 92 c, fa c, 56 c, 45 c, 10 c, aa c, 2c c, d5 c, 00 c, 1f c, 6a c, 54 | decimal 55 | 56 | t{ b64-test 11 b64-var b64-encode s" kvpWRRCqLNUAH2o=" ?str }t 57 | 58 | t{ b64-var str-get s" kvpWRRCqLNUAH2o=" ?str }t 59 | 60 | \ decodes 61 | 62 | t{ s" " b64-var b64-decode s" " ?str }t 63 | 64 | t{ s" Zg==" b64-var b64-decode s" f" ?str }t 65 | 66 | t{ s" Zm8=" b64-var b64-decode s" fo" ?str }t 67 | 68 | t{ s" Zm9v" b64-var b64-decode s" foo" ?str }t 69 | 70 | t{ s" Zm9vYg==" b64-var b64-decode s" foob" ?str }t 71 | 72 | t{ s" Zm9vYmE=" b64-var b64-decode s" fooba" ?str }t 73 | 74 | t{ s" Zm9vYmFy" b64-var b64-decode s" foobar" ?str }t 75 | 76 | t{ s" kvpWRRCqLNUAH2o=" b64-var b64-decode b64-test 11 ?str }t 77 | 78 | t{ b64-var str-get b64-test 11 ?str }t 79 | 80 | [THEN] 81 | 82 | \ ============================================================================== 83 | 84 | -------------------------------------------------------------------------------- /test/crc_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ crc_test - the cyclic redundancy check test in the ffl 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2006-12-05 18:32:48 $ $Revision: 1.7 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/tst.fs 28 | include ffl/crc.fs 29 | 30 | [DEFINED] crc.version [IF] 31 | 32 | .( Testing: crc) cr 33 | 34 | hex 35 | t{ crc-create c1 }t 36 | 37 | t{ c1 crc-poly@ EDB88320 ?u }t 38 | 39 | t{ s" An Arbitrary String" c1 crc-update c1 crc-finish 6FBEAAE7 ?u }t 40 | t{ c1 crc-reset s" ZYXWVUTSRQPONMLKJIHGFEDBCA" c1 crc-update c1 crc-finish 99CDFDB2 ?u }t 41 | t{ c1 crc-reset s" 123456789" c1 crc-update c1 crc-finish CBF43926 ?u }t 42 | decimal 43 | 44 | t{ 32 26 23 22 16 12 11 10 8 7 5 4 2 1 0 15 crc+calc-poly hex EDB88320 decimal ?u }t 45 | 46 | hex 47 | t{ EDB88320 c1 crc-poly! }t 48 | 49 | t{ c1 crc-reset s" ZYXWVUTSRQPONMLKJIHGFEDBCA" c1 crc-update c1 crc-finish 99CDFDB2 ?u }t 50 | 51 | t{ s" An Arbitrary String" crc+calc-crc32 6FBEAAE7 ?u }t 52 | decimal 53 | 54 | [THEN] 55 | 56 | \ ============================================================================== 57 | -------------------------------------------------------------------------------- /test/est_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ est_test - the test words for the est module in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-12-24 19:32:12 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/est.fs 28 | include ffl/tst.fs 29 | 30 | 31 | .( Testing: est) cr 32 | 33 | : est_test1 34 | s\" a\a\b\e\f\q\r\t\v\"\xE0\\z" 35 | ; 36 | 37 | t{ est_test1 13 ?s value est1 }t 38 | 39 | : est-fetch ( n - c ) 40 | chars est1 + c@ 41 | ; 42 | 43 | t{ 0 est-fetch char a ?s }t 44 | t{ 1 est-fetch 7 ?s }t 45 | t{ 2 est-fetch 8 ?s }t 46 | t{ 3 est-fetch 27 ?s }t 47 | t{ 4 est-fetch 12 ?s }t 48 | t{ 5 est-fetch char " ?s }t 49 | t{ 6 est-fetch 13 ?s }t 50 | t{ 7 est-fetch 9 ?s }t 51 | t{ 8 est-fetch 11 ?s }t 52 | t{ 9 est-fetch char " ?s }t 53 | t{ 10 est-fetch 224 ?s }t 54 | t{ 11 est-fetch char \ ?s }t 55 | t{ 12 est-fetch char z ?s }t 56 | 57 | here to est1 58 | 59 | ,\" a\a\b\e\f\l\m\q\r\t\v\z\"\xE0\\z" 60 | 61 | t{ 0 est-fetch 17 ?s }t 62 | t{ 1 est-fetch char a ?s }t 63 | t{ 2 est-fetch 7 ?s }t 64 | t{ 3 est-fetch 8 ?s }t 65 | t{ 4 est-fetch 27 ?s }t 66 | t{ 5 est-fetch 12 ?s }t 67 | t{ 6 est-fetch 10 ?s }t 68 | t{ 7 est-fetch 13 ?s }t 69 | t{ 8 est-fetch 10 ?s }t 70 | t{ 9 est-fetch char " ?s }t 71 | t{ 10 est-fetch 13 ?s }t 72 | t{ 11 est-fetch 9 ?s }t 73 | t{ 12 est-fetch 11 ?s }t 74 | t{ 13 est-fetch 0 ?s }t 75 | t{ 14 est-fetch char " ?s }t 76 | t{ 15 est-fetch 224 ?s }t 77 | t{ 16 est-fetch char \ ?s }t 78 | t{ 17 est-fetch char z ?s }t 79 | 80 | here to est1 81 | 82 | ,\" \n" 83 | 84 | t{ est1 count end-of-line count ?str }t 85 | 86 | \ ============================================================================== 87 | -------------------------------------------------------------------------------- /test/ffl_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ ffl_test - the test-all source file in the ffl 4 | \ 5 | \ Copyright (C) 2005 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2009-05-23 05:37:24 $ $Revision: 1.47 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | 28 | 29 | include ffl/tst.fs 30 | 31 | tst-reset-tests 32 | 33 | \ the test sources 34 | 35 | include a32_test.fs 36 | include b64_test.fs 37 | include act_test.fs 38 | include arg_test.fs 39 | include bar_test.fs 40 | include bct_test.fs 41 | include bis_test.fs 42 | include bnt_test.fs 43 | include car_test.fs 44 | include cbf_test.fs 45 | include chr_test.fs 46 | include chs_test.fs 47 | include cpx_test.fs 48 | include crc_test.fs 49 | include dcl_test.fs 50 | include dnl_test.fs 51 | include dom_test.fs 52 | include dtm_test.fs 53 | include dos_test.fs 54 | include est_test.fs 55 | include frc_test.fs 56 | include fwt_test.fs 57 | include fsm_test.fs 58 | include hct_test.fs 59 | include jos_test.fs 60 | include lbf_test.fs 61 | include log_test.fs 62 | include md5_test.fs 63 | include msc_test.fs 64 | include gmo_test.fs 65 | include nct_test.fs 66 | include nnt_test.fs 67 | include rdg_test.fs 68 | include rgx_test.fs 69 | include rng_test.fs 70 | include scl_test.fs 71 | include snl_test.fs 72 | include sh1_test.fs 73 | include sh2_test.fs 74 | include spf_test.fs 75 | include str_test.fs 76 | include stt_test.fs 77 | include tis_test.fs 78 | include tmr_test.fs 79 | include tos_test.fs 80 | include xis_test.fs 81 | include xos_test.fs 82 | include zif_test.fs 83 | 84 | .( Forth Foundation Library Test: ) tst-get-result . .( errors in ) . .( tests took ) . .( ms.) cr 85 | 86 | bye 87 | 88 | \ ============================================================================== 89 | 90 | -------------------------------------------------------------------------------- /test/fixed.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irdvo/ffl/753d418081a48afe8c86196261fda3299d93ac98/test/fixed.gz -------------------------------------------------------------------------------- /test/gmo_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ gmo_test - the test words for the gmo module in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-12-24 19:32:12 $ $Revision: 1.4 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/gmo.fs 28 | include ffl/tst.fs 29 | 30 | 31 | [DEFINED] gmo.version [IF] 32 | 33 | bigendian? [IF] 34 | 35 | .( Testing: gmo skipped, no bigendian test file) cr 36 | 37 | [ELSE] 38 | 39 | .( Testing: gmo) cr 40 | 41 | t{ msc-new value msc2 }t 42 | 43 | t{ s" nl.mo" msc2 gmo-read ?0 }t 44 | 45 | t{ msc2 hnt-length@ 38 ?s }t 46 | 47 | \ msc2 msc-dump 48 | 49 | t{ s" Sunday" msc2 msc-translate s" zondag" ?str }t 50 | t{ s" Mar" msc2 msc-translate s" maa" ?str }t 51 | 52 | t{ msc2 msc-free }t 53 | 54 | [THEN] 55 | 56 | [THEN] 57 | 58 | \ ============================================================================== 59 | -------------------------------------------------------------------------------- /test/gzipped.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irdvo/ffl/753d418081a48afe8c86196261fda3299d93ac98/test/gzipped.gz -------------------------------------------------------------------------------- /test/md5_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ md5_test - the test words for the md5 module in the ffl 4 | \ 5 | \ Copyright (C) 2006 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-12-24 19:32:12 $ $Revision: 1.3 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/md5.fs 28 | include ffl/tst.fs 29 | 30 | 31 | [DEFINED] md5.version [IF] 32 | 33 | .( Testing: md5) cr 34 | 35 | md5-create m1 36 | 37 | hex 38 | 39 | t{ s" 0123456789012345678901234567890123456789012345678901234567890123" m1 md5-update }t 40 | 41 | t{ m1 md5-finish 548C5F53 ?u 3F9EE1AC ?u EADE0987 ?u 34FD7B7F ?u }t 42 | 43 | t{ m1 md5-reset }t 44 | 45 | t{ s" 01234567890123456789012345678901234567890123456789012345678901234567890" m1 md5-update }t 46 | 47 | t{ m1 md5-finish md5+to-string s" 8CA2DC1109EC719046F23D92EFE819F7" ?str }t 48 | 49 | t{ m1 md5-reset }t 50 | 51 | t{ s" 01234567890123456789012345678" m1 md5-update }t 52 | 53 | t{ s" 90123456789012345678901234567" m1 md5-update }t 54 | 55 | t{ s" 8901234567890" m1 md5-update }t 56 | 57 | t{ m1 md5-finish md5+to-string s" 8CA2DC1109EC719046F23D92EFE819F7" ?str }t 58 | 59 | t{ md5-new value m2 }t 60 | 61 | t{ s" Hello" m2 md5-update }t 62 | 63 | t{ m2 md5-finish D70478C4 ?u F8AB27A8 ?u 961261C4 ?u 53991A8B ?u }t 64 | 65 | t{ m2 md5-reset }t 66 | 67 | t{ s" 01234567890123456789012345678901234567890123456789012345" m2 md5-update }t 68 | 69 | t{ m2 md5-finish 98C6453 ?u 1B79B042 ?u E7107684 ?u B270F28A ?u }t 70 | 71 | t{ m2 md5-free }t 72 | 73 | decimal 74 | 75 | [THEN] 76 | 77 | \ ============================================================================== 78 | 79 | -------------------------------------------------------------------------------- /test/msc_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ msc_test - the test words for the msc module in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-12-24 19:32:12 $ $Revision: 1.5 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/msc.fs 28 | include ffl/tst.fs 29 | 30 | 31 | .( Testing: msc) cr 32 | 33 | t{ msc-new value msc1 }t 34 | 35 | \ Add translations 36 | 37 | t{ s" yes" s" ja" msc1 msc-add }t 38 | t{ s" no" s" nee" msc1 msc-add }t 39 | t{ s" tree" s" boom" msc1 msc-add }t 40 | 41 | \ Translate 42 | 43 | t{ s" no" msc1 msc-translate s" nee" ?str }t 44 | t{ s" tree" msc1 msc-translate s" boom" ?str }t 45 | t{ s" bike" msc1 msc-translate s" bike" ?str }t 46 | 47 | \ Translate? 48 | 49 | t{ s" no" msc1 msc-translate? ?true s" nee" ?str }t 50 | t{ s" tree" msc1 msc-translate? ?true s" boom" ?str }t 51 | t{ s" bike" msc1 msc-translate? ?false }t 52 | 53 | 54 | \ Update translations 55 | 56 | t{ s" no" s" neen" msc1 msc-add }t 57 | 58 | t{ s" no" msc1 msc-translate s" neen" ?str }t 59 | 60 | t{ s" no" s" nee" msc1 msc-add }t 61 | 62 | t{ s" no" msc1 msc-translate s" nee" ?str }t 63 | 64 | 65 | \ Remove translations 66 | 67 | t{ s" yes" msc1 msc-remove ?true }t 68 | t{ s" tree" msc1 msc-remove ?true }t 69 | t{ s" bike" msc1 msc-remove ?false }t 70 | 71 | t{ s" tree" msc1 msc-translate s" tree" ?str }t 72 | 73 | \ Free message catalog 74 | 75 | t{ msc1 msc-free }t 76 | 77 | \ ============================================================================== 78 | -------------------------------------------------------------------------------- /test/nl.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irdvo/ffl/753d418081a48afe8c86196261fda3299d93ac98/test/nl.mo -------------------------------------------------------------------------------- /test/nl.po: -------------------------------------------------------------------------------- 1 | # Dutch translation of days and months names for the ffl library 2 | # Copyright (C) 2007 Dick van Oudheusden 3 | # This file is distributed under the same license as the ffl library. 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: Forth Foundation Library\n" 8 | "PO-Revision-Date: 2007-11-17 07:30\n" 9 | "Last-Translator: Dick van Oudheusden\n" 10 | "Language-Team: Dutch\n" 11 | "MIME-Version: 1.0\n" 12 | "Content-Type: text/plain; charset=UTF-8\n" 13 | "Content-Transfer-Encoding: 8bit\n" 14 | 15 | #: 16 | msgid "Sun" 17 | msgstr "zon" 18 | 19 | #: 20 | msgid "Mon" 21 | msgstr "maa" 22 | 23 | #: 24 | msgid "Tue" 25 | msgstr "din" 26 | 27 | #: 28 | msgid "Wed" 29 | msgstr "woe" 30 | 31 | #: 32 | msgid "Thu" 33 | msgstr "don" 34 | 35 | #: 36 | msgid "Fri" 37 | msgstr "vri" 38 | 39 | #: 40 | msgid "Sat" 41 | msgstr "zat" 42 | 43 | #: 44 | msgid "Sunday" 45 | msgstr "zondag" 46 | 47 | #: 48 | msgid "Monday" 49 | msgstr "maandag" 50 | 51 | #: 52 | msgid "Tueday" 53 | msgstr "dinsdag" 54 | 55 | #: 56 | msgid "Wednesday" 57 | msgstr "woensdag" 58 | 59 | #: 60 | msgid "Thursday" 61 | msgstr "donderdag" 62 | 63 | #: 64 | msgid "Friday" 65 | msgstr "vrijdag" 66 | 67 | #: 68 | msgid "Saturday" 69 | msgstr "zaterdag" 70 | 71 | #: 72 | msgid "Jan" 73 | msgstr "jan" 74 | 75 | #: 76 | msgid "Feb" 77 | msgstr "feb" 78 | 79 | #: 80 | msgid "Mar" 81 | msgstr "maa" 82 | 83 | #: 84 | msgid "Apr" 85 | msgstr "apr" 86 | 87 | #: 88 | msgid "May" 89 | msgstr "mei" 90 | 91 | #: 92 | msgid "Jun" 93 | msgstr "jun" 94 | 95 | #: 96 | msgid "Jul" 97 | msgstr "jul" 98 | 99 | #: 100 | msgid "Aug" 101 | msgstr "aug" 102 | 103 | #: 104 | msgid "Sep" 105 | msgstr "sep" 106 | 107 | #: 108 | msgid "Oct" 109 | msgstr "oct" 110 | 111 | #: 112 | msgid "Nov" 113 | msgstr "nov" 114 | 115 | #: 116 | msgid "Dec" 117 | msgstr "dec" 118 | 119 | #: 120 | msgid "January" 121 | msgstr "januari" 122 | 123 | #: 124 | msgid "February" 125 | msgstr "februari" 126 | 127 | #: 128 | msgid "March" 129 | msgstr "maart" 130 | 131 | #: 132 | msgid "April" 133 | msgstr "april" 134 | 135 | #: 136 | msgid "June" 137 | msgstr "juni" 138 | 139 | #: 140 | msgid "July" 141 | msgstr "juli" 142 | 143 | #: 144 | msgid "August" 145 | msgstr "augustus" 146 | 147 | #: 148 | msgid "September" 149 | msgstr "september" 150 | 151 | #: 152 | msgid "October" 153 | msgstr "october" 154 | 155 | #: 156 | msgid "November" 157 | msgstr "november" 158 | 159 | #: 160 | msgid "December" 161 | msgstr "december" 162 | -------------------------------------------------------------------------------- /test/rng_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ rng_test - the test words for the rng module in the ffl 4 | \ 5 | \ Copyright (C) 2006 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-01-11 19:22:04 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/rng.fs 28 | include ffl/tst.fs 29 | 30 | 31 | [DEFINED] rng.version [IF] 32 | 33 | 34 | .( Testing: rng) cr 35 | 36 | t{ 5489 rng-create rng1 }t 37 | 38 | t{ rng1 rng-next-number 3499211612 ?u }t 39 | 40 | : rng-skip ( w:rng n - = skip n random numbers ) 41 | 0 DO 42 | dup rng-next-number drop 43 | LOOP 44 | drop 45 | ; 46 | 47 | t{ rng1 622 rng-skip }t 48 | 49 | t{ rng1 rng-next-number 4020325887 ?u }t 50 | t{ rng1 rng-next-number 4178893912 ?u }t 51 | t{ rng1 rng-next-number 610818241 ?u }t 52 | 53 | t{ rng1 9999 rng-skip }t 54 | 55 | t{ rng1 rng-next-number 862334504 ?u }t 56 | 57 | 58 | [DEFINED] rng-next-float [IF] 59 | t{ 19650218 rng-new value rng2 }t 60 | 61 | t{ rng2 rng-next-float 0.54146918e0 ?r }t 62 | 63 | t{ rng2 9999 rng-skip }t 64 | 65 | t{ rng2 rng-next-float 0.95790732e0 ?r }t 66 | 67 | t{ rng2 rng-free }t 68 | [THEN] 69 | 70 | [THEN] 71 | 72 | \ ============================================================================== 73 | -------------------------------------------------------------------------------- /test/sh1_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ sh1_test - the test words for the sh1 module in the ffl 4 | \ 5 | \ Copyright (C) 2006 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-12-24 19:32:12 $ $Revision: 1.5 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/sh1.fs 28 | include ffl/tst.fs 29 | 30 | 31 | [DEFINED] sh1.version [IF] 32 | 33 | .( Testing: sh1) cr 34 | 35 | sh1-create sh11 36 | 37 | hex 38 | 39 | t{ s" abc" sh11 sh1-update }t 40 | 41 | t{ sh11 sh1-finish 9CD0D89D ?u 7850C26C ?u BA3E2571 ?u 4706816A ?u A9993E36 ?u }t 42 | 43 | t{ sh11 sh1-reset }t 44 | 45 | t{ s" abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" sh11 sh1-update }t 46 | 47 | t{ sh11 sh1-finish E54670F1 ?u F95129E5 ?u BAAE4AA1 ?u 1C3BD26E ?u 84983E44 ?u }t 48 | 49 | t{ sh1-new value sh12 }t 50 | 51 | decimal 52 | 53 | : sh1-test 54 | 50000 0 DO 55 | s" aaaaaaaaaaaaaaaaaaaa" sh12 sh1-update 56 | LOOP 57 | ; 58 | 59 | sh1-test \ a million times "a", see test vectors 60 | 61 | t{ sh12 sh1-finish sh1+to-string s" 34AA973CD4C4DAA4F61EEB2BDBAD27316534016F" ?str }t 62 | 63 | t{ sh12 sh1-free }t 64 | 65 | [THEN] 66 | 67 | \ ============================================================================== 68 | 69 | -------------------------------------------------------------------------------- /test/sh2_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ sh2_test - the test words for the sh2 module in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2007-12-24 19:32:12 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/sh2.fs 28 | include ffl/tst.fs 29 | 30 | 31 | [DEFINED] sh2.version [IF] 32 | 33 | .( Testing: sh2) cr 34 | 35 | sh2-create sh21 36 | 37 | hex 38 | 39 | t{ s" " sh21 sh2-update }t \ see test vectors 1-0 40 | 41 | t{ sh21 sh2-finish 7852B855 ?u A495991B ?u 649B934C ?u 27AE41E4 ?u 42 | 996FB924 ?u 9AFBF4C8 ?u 98FC1C14 ?u E3B0C442 ?u }t 43 | 44 | 45 | t{ sh21 sh2-reset }t 46 | 47 | t{ s" abc" sh21 sh2-update }t \ see test vectors 1-2 48 | 49 | t{ sh21 sh2-finish F20015AD ?u B410FF61 ?u 96177A9C ?u B00361A3 ?u 50 | 5DAE2223 ?u 414140DE ?u 8F01CFEA ?u BA7816BF ?u }t 51 | 52 | 53 | t{ sh2-new value sh22 }t \ see test vector 1-5 54 | 55 | t{ s" abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" sh22 sh2-update }t 56 | 57 | t{ sh22 sh2-finish 19DB06C1 ?u F6ECEDD4 ?u 64FF2167 ?u A33CE459 ?u 58 | 0C3E6039 ?u E5C02693 ?u D20638B8 ?u 248D6A61 ?u }t 59 | 60 | 61 | decimal 62 | 63 | : sh2-test 64 | 31250 0 DO 65 | s" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" sh22 sh2-update 66 | LOOP 67 | ; 68 | 69 | t{ sh22 sh2-reset }t 70 | 71 | sh2-test \ million times "a", see test vectors 1-8 72 | 73 | t{ sh22 sh2-finish sh2+to-string s" CDC76E5C9914FB9281A1C7E284D73E67F1809A48A497200E046D39CCC7112CD0" ?str }t 74 | 75 | t{ sh22 sh2-free }t 76 | 77 | [THEN] 78 | 79 | \ ============================================================================== 80 | 81 | -------------------------------------------------------------------------------- /test/stored.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irdvo/ffl/753d418081a48afe8c86196261fda3299d93ac98/test/stored.gz -------------------------------------------------------------------------------- /test/stt_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ stt_test - the test words for the stt module in the ffl 4 | \ 5 | \ Copyright (C) 2007 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2009-05-20 13:27:22 $ $Revision: 1.3 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/stt.fs 28 | include ffl/tst.fs 29 | 30 | 31 | .( Testing: stt) cr 32 | 33 | begin-stringtable stt1 34 | +" Forth" 35 | +" Foundation" 36 | +" Library" 37 | +\" \x21" 38 | end-stringtable 39 | 40 | t{ 0 stt1 s" Forth" ?str }t 41 | t{ 1 stt1 s" Foundation" ?str }t 42 | t{ 2 stt1 s" Library" ?str }t 43 | t{ 3 stt1 s" !" ?str }t 44 | 45 | \ ============================================================================== 46 | -------------------------------------------------------------------------------- /test/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Starting Forth 8 | 9 | Leo Brodie 10 | 11 | 12 | Prentice-Hall 13 | "1981" 14 | 235 15 | This book is the best!. 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/tmr_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ tmr_test - the test words for the tmr module in the ffl 4 | \ 5 | \ Copyright (C) 2006 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2006-12-23 08:07:07 $ $Revision: 1.2 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/tmr.fs 28 | include ffl/tst.fs 29 | 30 | 31 | [DEFINED] tmr.version [IF] 32 | 33 | .( Testing: tmr) cr 34 | 35 | 300 tmr-create tmr1 \ 0.3 sec. 36 | 37 | t{ tmr1 tmr-expired? ?false }t 38 | 39 | 200 ms 40 | 41 | t{ tmr1 tmr-expired? ?false }t 42 | 43 | 200 ms 44 | 45 | t{ tmr1 tmr-expired? ?true }t 46 | 47 | 210 ms 48 | 49 | t{ tmr1 tmr-expired? ?true }t 50 | 51 | 300 ms 52 | 53 | t{ tmr1 tmr-restart }t 54 | 55 | t{ tmr1 tmr-timer@ 2 u< ?true }t 56 | 57 | t{ tmr1 tmr-expired? ?false }t 58 | 59 | t{ tmr1 tmr-timeout@ 300 ?u }t 60 | 61 | 62 | 63 | t{ 0 tmr-new value tmr2 }t 64 | 65 | 200 ms 66 | 67 | t{ tmr2 tmr-timer@ 250 u< ?true }t 68 | 69 | t{ 20 tmr2 tmr-start }t 70 | 71 | t{ tmr2 tmr-wait }t 72 | 73 | t{ tmr2 tmr-timer@ 2 u< ?true }t 74 | 75 | t{ tmr2 tmr-free }t 76 | 77 | [THEN] 78 | 79 | 80 | \ ============================================================================== 81 | 82 | -------------------------------------------------------------------------------- /test/zif_test.fs: -------------------------------------------------------------------------------- 1 | \ ============================================================================== 2 | \ 3 | \ gzf_test - the test words for the gzf module in the ffl 4 | \ 5 | \ Copyright (C) 2008 Dick van Oudheusden 6 | \ 7 | \ This library is free software; you can redistribute it and/or 8 | \ modify it under the terms of the GNU General Public 9 | \ License as published by the Free Software Foundation; either 10 | \ version 2 of the License, or (at your option) any later version. 11 | \ 12 | \ This library 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 GNU 15 | \ General Public License for more details. 16 | \ 17 | \ You should have received a copy of the GNU General Public 18 | \ License along with this library; if not, write to the Free 19 | \ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | \ 21 | \ ============================================================================== 22 | \ 23 | \ $Date: 2009-05-28 17:40:17 $ $Revision: 1.7 $ 24 | \ 25 | \ ============================================================================== 26 | 27 | include ffl/zif.fs 28 | include ffl/tst.fs 29 | include ffl/dtm.fs 30 | 31 | 32 | [DEFINED] zif.version [IF] 33 | 34 | 35 | .( Testing: gzf gzi zif) cr 36 | 37 | 38 | : zif-test-file ( c-addr u zif -- ior ) 39 | >r 40 | r/w create-file throw 41 | BEGIN 42 | pad 80 r@ zif-read-file 43 | dup 0= IF 44 | over 0> 45 | ELSE 46 | false 47 | THEN 48 | WHILE 49 | drop 50 | over pad -rot write-file throw 51 | REPEAT 52 | nip 53 | swap close-file throw 54 | rdrop 55 | ; 56 | 57 | 58 | t{ zif-create zif1 }t 59 | 60 | t{ s" unknown.gz" zif1 zif-open-file ?true }t 61 | 62 | 63 | 64 | t{ s" stored.gz" zif1 zif-open-file ?0 }t 65 | 66 | t{ zif1 zif-read-header ?0 }t 67 | 68 | t{ zif1 zif-gzf@ value gzf1 }t 69 | 70 | t{ gzf1 gzf-text@ ?0 }t 71 | 72 | t{ gzf1 gzf-os@ gzf.unix ?s }t 73 | 74 | t{ s" stored" zif1 zif-test-file ?0 }t 75 | 76 | t{ zif1 zif-close-file ?0 }t 77 | 78 | t{ zif1 zif-(free) }t 79 | 80 | 81 | 82 | t{ zif-new value zif2 }t 83 | 84 | t{ s" fixed.gz" zif2 zif-open-file ?0 }t 85 | 86 | t{ zif2 zif-read-header ?0 }t 87 | 88 | t{ s" fixed" zif2 zif-test-file ?0 }t 89 | 90 | t{ zif2 zif-close-file ?0 }t 91 | 92 | t{ zif2 zif-free }t 93 | 94 | 95 | 96 | t{ zif-new value zif3 }t 97 | 98 | t{ s" gzipped.gz" zif3 zif-open-file ?0 }t 99 | 100 | t{ zif3 zif-read-header ?0 }t 101 | 102 | t{ zif3 zif-gzf@ value gzf3 }t 103 | 104 | t{ gzf3 gzf-name@ s" COPYING" ?str }t 105 | 106 | t{ s" gzipped" zif3 zif-test-file ?0 }t 107 | 108 | t{ zif3 zif-close-file ?0 }t 109 | 110 | t{ zif3 zif-free }t 111 | 112 | [THEN] 113 | 114 | \ ============================================================================== 115 | --------------------------------------------------------------------------------