title: Recursive Descent Parser using Python and PLY
body: <p>I apologize for my very basic question but, I'm really struggling here.  I need to make a recursive descent parser.  I'm working in Python and using PLY.  My grammar follows:</p>
  
  <p>&lt; list > → (&lt; sequence >) | ()</p>
  
  <p>&lt; sequence > → &lt; listelement > , &lt; sequence > | &lt; listelement ></p>
  
  <p>&lt; listelement > → &lt; list > | NUMBER</p>
  
  <p>Would that look something like this?  Am I way off?  The end goal is to read a list into a data structure and then print it out.</p>
  
  <pre>
  def p_list(p)
      'list : "("sequence")" | "("")"'
  
  def p_sequence(p)
      'sequence : list_el","sequence | list_el'
  
  def p_list_el(p)
      'list_el : list | NUMBER'
  </pre>
  
  <p>If anyone was wondering what the full solution was I'll post it shortly.</p>