<?xml version="1.0" encoding="windows-1252"?>
<node id="678271" title="Re: RFC: Parsing with perl - Regexes and beyond" created="2008-04-03 17:21:39" updated="2008-04-03 13:21:39">
<type id="11">
note</type>
<author id="512600">
pKai</author>
<data>
<field name="doctext">
&lt;blockquote&gt;The first two definitions are recursive, so they are not "regular" any more.&lt;/blockquote&gt;
&lt;p&gt;You can argue that the first production is "tail recursive" which does not pose a problem with respect to regularity. Like a tail recursive function can be transformed into a loop.&lt;/p&gt;
&lt;p&gt;The non-regularity comes with the 2nd production.&lt;/p&gt;
&lt;blockquote&gt;&lt;c&gt;term        -&gt; '(' term ')'&lt;/c&gt;&lt;/blockquote&gt;
&lt;p&gt;The point is that &lt;c&gt;term&lt;/c&gt; can grow to arbitrary length and we still should keep the correspondence between the two parentheses, which is not possible with (CS)-Regexes ("pumping lemma").&lt;p&gt;
&lt;p&gt;This last observation is the border where you need a CFL-parser and would be lost with Regexes alone.&lt;/p&gt;</field>
<field name="root_node">
678119</field>
<field name="parent_node">
678119</field>
</data>
</node>
