Recognizers

The goal of a recognizer is to dynamically extent the Forth command interpreter and make it understand and handle new data formats as well as new synatax’s. The present, 2nd generation recognizers achieve this by generalizing the classic interpreter with an API to factor the components. Recognizers are portable across different forth’s.

Recognizers are not a new concept for forth. They have been discussed earlier.

More recognizer examples are available at The Forth Net.

Version 4

The Euroforth 2017 suggested some small wording changes and initiated a spin off stack RFD resulting in a much smaller recognizer RFD.

Version 4 (pdf), (txt)

Forth source code and test code require Stack.frt and tester.fs.

Most changes are only wording changes. More important is that the stack managing words are omitted. They are expected to re-appaear in a separate stack RFD.

v3 v4
recognizer: rectype:
do-recognizer recognize
r>* rectype>*
r:fail rectype-null

non-normative wording changes

v3 v4
rec:word rec-find
r:word rectype-xt
r:num rectype-num
r:dnum rectype-dnum
r:float rectype-float
r:name rectype-nt

The following words are removed from this RFD. The replacement words are subject to further discussion and probably will change in the future.

v3 v4
recognizer stack (*)
set-recognizer set-stack (*)
get-recognizer get-stack (*)

Outdated

The 1st formal RFD (pdf), (txt) was published at october, 3 2014. Version 2 (pdf), (txt) has been published on september, 20 2015. It improves the proposed standard section and adds a long chapter discussing the recognizer design based on feedback from version 1. The 3rd version has been started immediately after v2 due to a suggestion changing the POSTPONE action. Version 3 (pdf), (txt).

The Sourcecode requires Stack.frt. In the Recognizer-Test are many tests and example implementation for gforth, MPE’s vfxlin and Swift-Forth from Forth Inc.

The papers linked below give some historical background information.

Namespace RFD

An inofficial Namespace RFD.