Autrijus Tang wrote:
On Tue, Jun 28, 2005 at 09:49:58AM +1000, Brad Bowman wrote:

Autrijus' journal mentions quasiquoting (Perl 5).


Yes... quasiquoting in Perl 5 is currently crudely emulated
by feeding things to PPI::Tokenizer and PPI::Transform. :-)

You're doing what now? :)

Just in case this ever comes up again, let me clear something up now. It's worth noting it once here for everyone.

PPI is not a code parser. By code parser I mean taking a string and turning it into working code. PPI is a document parser. It parses ONLY on syntax to form a model of a document. Any conclusions it might make on the structure of the resulting code are secondary.

It cannot determine implicit parameters for function calls, which also means it has difficulty or cannot determine operator precedence.

It is theoretically impossible to (document) parse Perl "fully" without also executing it, and even then perl doesn't (document) parse Perl, it just (code) parses Perl, or rather runs Perl.

So to summarise, PPI is of limited use when it comes to working with bytecode or something that will be executed. It is for working with documents, not code.

And I'm done here :)

Adam K

Reply via email to