title: write recursive Parser with pyparsing
body: <p>I'm trying to understand the <code>Forward()</code> element from pyparsing. Suppose I have this simple BNF:</p>
  
  <pre><code>identifier  =
    "a..z,$,_"  &lt;  "a..z,$,_,0..9"  &gt;
  
  package_name = 
    identifier 
    /  ( package_name  "." identifier )
  </code></pre>
  
  <p>and I try to parse a simple package like <code>java.lang.String</code> I get either just <code>java</code> as result or never return from recursion.
  I tried it like this:</p>
  
  <pre><code>from pyparsing import alphas,alphanums, Word, Forward, ZeroOrMore, Group, Literal
  
  identifier=Word(alphas+"$_",alphanums+"$_")
  dot=Literal(".")
  
  package_name = Forward()
  definition = package_name+dot+identifier
  package_name &lt;&lt; Group(identifier+ZeroOrMore(definition))
  
  package_name.parseString("java.lang.String")
  </code></pre>
  
  <p>will print [['java']]</p>
  
  <pre><code>from pyparsing import alphas,alphanums, Word, Forward, ZeroOrMore, Group, Literal
  
  identifier=Word(alphas+"$_",alphanums+"$_")
  dot=Literal(".")
  
  package_name = Forward()
  definition = identifier^package_name+dot+identifier
  package_name &lt;&lt; definition
  
  package_name.parseString("java.lang.String")
  </code></pre>
  
  <p>will reach recursion limit</p>
  
  <p>how does this <code>Forward</code> placeholder work?</p>