recognizers
A collection of recognizers
\ check for the 'c' syntax for single
\ characters. Assumes 1 char = 1
S" ./Recognizer-gforth.4th" INCLUDED
\ S" ./Recognizer-vfx.4th" INCLUDED
: rec:char ( addr len -- n r:num | r:fail )
3 = if \ a three character string
dup c@ [char] ' = if \ starts with a '
dup 2 + c@ [char] ' = if \ and ends with a '
1+ c@ r:num exit
then
then
then
drop r:fail
;
VERBOSE ON
T{ S" 'z'" rec:char -> char z r:num }T
T{ S" 'z '" rec:char -> r:fail }T
by mtrute
Versions
2.1.0, 2.0.0, 1.4.5, 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.4.0, 1.3.2, 1.3.1, 1.3.0, 1.2.1, 1.2.0, 1.1.0, 1.0.1, 1.0.0
Download current as zip
Tags
recognizer, recognizerstack, stack
Dependencies
ttester 1.x.x, stack 1.x.x
Dependents
None