A dynamically extensible approach to parsing textual input consisting of a
predictive parser and associated predictive parser generator is provided.
The combination, together with a plug-in/resolver architecture, provides
the ability to handle a set of languages that is vastly larger than that
conventionally handled by predictive parsing techniques. The generator
accepts extended BNF language specifications containing embedded reverse
polish plug-in call specifications giving the plug-in number to be called
as well as an arbitrary textual parameter to be passed to the plug-in.
The parser supports the ability to register a `resolver` function as well
as one or more custom reverse-polish plug-in handlers which are passed
the textual parameter(s) specified in the extended BNF as well as having
full control over the parsing and evaluation stacks. The `resolver` is
with a `no action` parameter when the parser first encounters a token in
the input stream and may modify the token as necessary. The resolver is
also called when the parser must evaluate or assigu an entry on the
evaluation stack at which time it can implement additional behaviors
depending on the language or environment. Finally the `resolver` is
called when the parse terminates. The `resolver` is the primary mechanism
whereby more complex languages can be handled and is also a key part of
connecting to external systems or storage when the parser is used in an
interpreted context. The reverse polish plug-in functions are provided
with an API to allow full control over and access to the parser stacks
and can rapidly be configured to implement almost any language
constructs.