--- Dave Whipp <[EMAIL PROTECTED]> wrote: > "Austin Hastings" <[EMAIL PROTECTED]> wrote: > > $.source = (new > Grammars::Language::C::Preprocessor).open($source); > > I find myself wondering if this is covered by the P6 equiv of > TieHandle. > I.e. is it just an input stream filter? >
Doubtful. Do you want to do this at the grammar level, or the file level? If you want it at the file level, you C<tie> a translator (ooh! my first p6 idiom!) to the file handle. If you want it at the grammar level (i.e., regardless of source, preprocess it for me) you want to have a composition mechanism. I can see coding tr(1) as a translator (duh!) but I think your C parser is always going to want the preprocessor attached. Finally! TRIMTOWTDI! (RI=really is) =Austin