Last updated: 26 July 2010
Forth Foundation Library
Introduction
The Forth Foundation Library (FFL) is a general purpose library. Its main purpose is to make it easier to develop Forth applications. To that end the library has modules for data types, data collections, hashes, random generators, XML/HTML parser and generator, unit test, input and output streams, regular expressions and decompression.
Documentation
- Getting started manual
- Overview of all the modules with word description and examples
- Overview of all the words in the library
- Overview of the supported forth engines
Download
Version 0.8.0: list
Version 0.7.0: ffl-0.7.0.tar.gz or ffl-0.7.0.zip
Example
The following example shows the use of the regular expression module. It should give you an idea about using the library. For many modules there is a small example present in the library.
include ffl/rgx.fs
\ Create a regular expression variable rgx1
rgx-create rgx1
\ Compile a regular expression and check the result
s" ((a*)b)*" rgx1 rgx-compile [IF]
.( Expression successful compiled) cr
[ELSE]
.( Compilation failed on position:) . cr
[THEN]
\ Match case sensitive a test string
s" abb" rgx1 rgx-cmatch? [IF]
.( Test string matched) cr
[ELSE]
.( No match) cr
[THEN]
\ Create a regular expression variable on the heap
rgx-new value rgx2
\ Compile a regular expression for matching a float number
s" [-+\s]?\d+(\.\d+)?" rgx2 rgx-compile [IF]
.( Expression successful compiled) cr
[ELSE]
.( Compilation failed on position:) . cr
[THEN]
\ Match a float number
s" -12.47" rgx2 rgx-cmatch? [IF]
.( Float number matched) cr
[ELSE]
.( No match) cr
[THEN]
\ Free the variable from the heap
rgx2 rgx-free
Issue Tracker
If anyone wishes to report an error or suggest an improvement or feature, please use the Issue Tracker or contact me via the email address below.
Repository
To keep updated with the latest improvements and bug fixes, please visit the subversion repository.