Skip to content

API: Against a reproducer in a token descriptor for postpone #19

@ruv

Description

@ruv

A significant use case for Recognizer API is replacing the system's lexeme translator, a core part of the Forth text interpreter (for example, to produce a different format of code during compilation, e.g. for cross-compilation, see also a discussion in comp.lang.forth in 2020).

Let's consider a Recognizer API that employs token descriptors which are explicitly bases on three components (that are provided when a descriptor is defined).

So, to generate a different format of code during compilation, a program sets the system to use a recognizer that returns descriptors having special these three components.

One of these components is an action that is used by postpone, so a user can be sure that postpone from the host system will work correctly and it will generate code in the new format (according to the descriptor).

But, if the action used by postpone is a reproducer, then the postpone word will fail to generate correct code, since it will use the compile, word from the host system (either directly, or via the auto-generated "postponer").

If the provided action is a postponer (a full postpone action), this scenario will work correctly.


The bottom line is that if the API requires a user to provide a reproducer for a new token descriptor (to make postpone applicable), it makes impression that postpone will always work correctly for the corresponding lexeme, but it's wrong in edge cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions