include random.hsf
\ parser routines
: totag
[char] < PARSE pad place \ parse input up to '<' char
-1 >in +! \ move the interpreter pointer back 1 char
pad count type ;
: '"' [char] " emit ;
: '"..' '"' space ; \ output a quote char with trailing space
: toquote \ parse input to " then print as quoted text
'"' [char] " PARSE pad place
pad count type '"..' ;
: > [char] > emit space ; \ output the '>' with trailing space
\ Create some HTML extensions to the Forth interpreter
:
" cr ;
: " cr ; : ." " cr ;
: | ." | " totag ; : | ." " cr ;
: ." " ; : ." " ;
: | ." | " ; : | ." " cr ;
: ." " ;
: cr ." " totag ; : ." " cr ;
\ Write the source code that generates HTML in our EXTENDED FORTH
cr
This table was created with FORTH HTML tags
| |
." A" |
." B" |
." C" |
| 1 . |
1000 RND . |
1000 RND . |
1000 RND . |
| 2 . |
1000 RND . |
1000 RND . |
1000 RND . |
| 3 . |
1000 RND . |
1000 RND . |
1000 RND . |
|