"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I know my post is a little late...
Maybe we have a disctinction in our definition of "static parsing", but I think that no language can actually be statically unparseable as long there is a finite number of parsing rules. Under this condition, there should be a finite number of possible derivations for a certain number of generated symbols. In Kennedy's example : whatever / 25 ; # / ; die "this dies!"; Two interpretations are possible. There should not be any problem if the compiler find the two ways and produces a check branching to the two interpretations. Something like this: if (is_nullary(whatever)) { whatever / 25; } else { whatever (/ 25 ; # /); die "this dies!"; }When we think about it, the Perl interpreter already does this. So technicaly, parsing Perl is not a undecidable problem. You only proved that there could not be a single way to parse Perl - and yes, it is a problem for text editor's syntax-highlighting. In reply to Re: Perl Cannot Be Parsed: A Formal Proof
by ViciousFrank
|
|