I've never used it, but PL/I' preprocessor and ASMG's preprocessor ,
If I recall correctly, both worked this way. The text of the arguments
and the actual input stream were available for manipulation. The
return value (or emitted strings) were used as input to the parser.

This would be quite close to a BEGIN time subroutine with the rest
of the input stream supplied as a FILEHANDLE. This could allow those
folks who want to turn perl into a different language, enough rope.

<chaim>

>>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:

DS> At 09:38 PM 8/4/00 +0200, Jean-Louis Leroy wrote:
>> Dan Sugalski <[EMAIL PROTECTED]> writes:
>> 
>> > This does complicate the job of the parser/lexer rather
>> > considerably.
>> 
>> Why? Isn't it 'just' a matter or making the lexer read from a
>> hot-redirectable input stream?

DS> If it is, then it's not that big a deal, nor would it be all that useful. 
DS> Wiht substitutions it's more than that, and if we're going to do this, we 
DS> ought *not* essentially duplicate C's #define stuff. Macros mean the parser 
DS> needs to keep source around, possibly snapshot its current state and then 
DS> do an on-the-fly rework of the input buffers. (Maybe. Depends on what this 
DS> does)

DS> The cleverer the preprocessor, the more work the lexer/parser needs to do. 
DS> Which is dandy but, as I said, if you're going to do it, do it once and do 
DS> it with some force.





-- 
Chaim Frenkel                                        Nonlinear Knowledge, Inc.
[EMAIL PROTECTED]                                               +1-718-236-0183

Reply via email to