>My use for Inline::Yacc would be as a speedy replacement for parsers
>that are currently using Parse::RecDesccent (or Parse::Yapp, even more
>directly).

One of the things I hope we'll see with Inline::Yacc is that grammars
can simply be transfered between Parse::Yapp and Inline::Yacc. From
Inline::Yacc's point of view such grammars would fit into the special
case that "all semantic actions are written in Perl".

In a first attempt, I thought of a simple "converter" to perform the
translation, which would have to be started explicitly by a grammars
author when he wants to switch between Parse::Yapp and Inline::Yacc.
But thought on consequently this leads to the even better solution of
making it happen transparently, for example this way:

Parse::Yapp usually builds a parser module from a grammar which is then
used by the software at runtime. This generated module essentially
consists of a general parser engine and a data representation of the
initial grammar which controls how the engine parses input. (The engine
code can be loaded via "use" or made part of the generated module.)

What if Parse::Yapp would detect if Inline::Yacc is installed or not
(similar to a future Inline version as suggested by Brian). Depending
on the result (or options), it could generate its traditional pure Perl
parser module or a module using Inline::Yacc.

This way, one and the same grammar code could be used to build either a
highly portable Perl parser or a fast version running C parser code.
Existing Parse::Yapp code could be accelerated by just reprocessing it
with an updated version of Parse::Yapp. And if the call of the parser
module generator tool "yapp" would be delayed until a CPAN module
installation is prepared via "perl Makefile.PL", the *final users* perl
configuration could determine what parser is used by the module finally
installed. (This might be the only way to ship such a module a portable
way ;-)

Does this sound useful? If yes, I suggest to invite Francois
Desarmien, the author of Parse::Yapp, to take part in the definition of
Inline::Yacc's design, especially for actions (and lexers) written in
Perl.

             Jochen
















Reply via email to