<?xml version="1.0" encoding="windows-1252"?>
<node id="691380" title="Re: Perl Cannot Be Parsed: A Formal Proof" created="2008-06-11 00:24:38" updated="2008-06-10 20:24:38">
<type id="11">
note</type>
<author id="691378">
ViciousFrank</author>
<data>
<field name="doctext">
I know my post is a little late...
&lt;br/&gt;&lt;br/&gt;
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 :
&lt;br/&gt;&lt;br/&gt;
&lt;code&gt;whatever / 25 ; # / ; die "this dies!";&lt;/code&gt;
&lt;br/&gt;&lt;br/&gt;
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:
&lt;br/&gt;
&lt;pre&gt;if (is_nullary(whatever))
{
  whatever / 25;
}
else
{
  whatever (/ 25 ; # /);
  die "this dies!";
}&lt;/pre&gt;

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.</field>
<field name="root_node">
663393</field>
<field name="parent_node">
663393</field>
</data>
</node>
