title: pyparsing ParseException: Expected end of line -- general questions
body: <p>I am a newbie to pyparsing and have been reading the examples, looking here and trying some things out.
  I created a grammar and provided a buffer.  I do however have a heavy background in lex/yacc from the old days.</p>
  
  <p>I have a general question or two.</p>
  
  <p>I'm currently seeing </p>
  
  <blockquote>
    <p>ParseException: Expected end of line (at char 7024), (line 213, col:2) </p>
  </blockquote>
  
  <p>and then it terminates </p>
  
  <p>Because of the nature of my buffer, newlines have meaning, I did:</p>
  
  <pre><code>ParserElement.setDefaultWhitespaceChars('') # &lt;-- zero len string
  </code></pre>
  
  <p>Does this error mean that somewhere in my productions, I have a rule that is looking for an <code>LineEnd()</code> and that rule happens to somehow be 'last'? </p>
  
  <p>The location it is dying is the 'end of file'.    I tried using <code>parseFile</code> but my file contains chars > ord(127) so instead I am loading it to memory, filtering all > ord(127) chars, then calling <code>parseString</code>.</p>
  
  <p>I tried turning on <code>verbose_stacktrace=True</code> for some of the elements of my grammar where I thought the problem originated.</p>
  
  <p>Is there a better way to track down the exact <code>ParserElement</code> it is trying to recognize when an error such as this occurs?  Or can I get a 'stack or most recently recognized production trace?</p>
  
  <p>I didn't realize I could edit up here...
  My crash is this:</p>
  
  <pre><code>[centos@new-host /tmp/sample]$  ./zooparser.py 
  !(zooparser.py) TEST test1: valid message type START
  Ready to roll
  Parsing This message: ( ignore leading&gt;&gt;&gt; and trailing &lt;&lt;&lt; ) &gt;&gt;&gt;
  
  ZOO/STATUS/FOOD ALLOCATION//
  TOPIC/BIRD FEED IS RUNNING LOW//
  FREE/WE HAVE DISCOVERED MOTHS INFESTED THE BIRDSEED AND IT IS NO
  LONGER USABLE.//
  
  &lt;&lt;&lt;
  Match {Group:({Group:({Group:({[LineEnd]... "ZOO" Group:({[LineEnd]... "/" [Group:({{{W:(abcd...) | LineEnd | "://" | " " | W:(!@#$...) | ":"}}... ["/"]...})]... {W:(abcd...) | LineEnd | "://" | "    " | W:(!@#$...)}}) "//"}) Group:({LineEnd "TOPIC" {Group:({[LineEnd]... Group:({"/" {W:(abcd...) | Group:({W:(abcd...) [{W:(abcd...)}...]... W:(abcd...)}) | Group:({{{"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'"}... | Group:({{"0123456789"}... ":"})} {W:(abcd...) | Group:({W:(abcd...) [{W:(abcd...)}...]... W:(abcd...)})}}) | "-"}})})}... [LineEnd]... "//"})}) [Group:({LineEnd "FREE" Group:({[LineEnd]... "/" [Group:({{{W:(abcd...) | LineEnd | "://" | "  " | W:(!@#$...) | ":"}}... ["/"]...})]... {W:(abcd...) | LineEnd | "://" | "    " | W:(!@#$...)}}) "//"})]...}) [LineEnd]... StringEnd} at loc 0(1,1)
  Match Group:({Group:({[LineEnd]... "ZOO" Group:({[LineEnd]... "/" [Group:({{{W:(abcd...) | LineEnd | "://" | "  " | W:(!@#$...) | ":"}}... ["/"]...})]... {W:(abcd...) | LineEnd | "://" | "    " | W:(!@#$...)}}) "//"}) Group:({LineEnd "TOPIC" {Group:({[LineEnd]... Group:({"/" {W:(abcd...) | Group:({W:(abcd...) [{W:(abcd...)}...]... W:(abcd...)}) | Group:({{{"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'"}... | Group:({{"0123456789"}... ":"})} {W:(abcd...) | Group:({W:(abcd...) [{W:(abcd...)}...]... W:(abcd...)})}}) | "-"}})})}... [LineEnd]... "//"})}) at loc 0(1,1)
  Match Group:({[LineEnd]... "ZOO" Group:({[LineEnd]... "/" [Group:({{{W:(abcd...) | LineEnd | "://" | "  " | W:(!@#$...) | ":"}}... ["/"]...})]... {W:(abcd...) | LineEnd | "://" | "    " | W:(!@#$...)}}) "//"}) at loc 0(1,1)
  Exception raised:None
  Exception raised:None
  Exception raised:None
  Traceback (most recent call last):
    File "./zooparser.py", line 319, in &lt;module&gt;
      test1(pgm)
    File "./zooparser.py", line 309, in test1
      test(pgm, zooMsg, 'test1: valid message type' )
    File "./zooparser.py", line 274, in test
      tokens = zg.getTokensFromBuffer(fileName)
    File "./zooparser.py", line 219, in getTokensFromBuffer
      tokens = self.text.parseString(filteredBuffer,parseAll=True)
    File "/usr/local/lib/python2.7/site-packages/pyparsing-1.5.7-py2.7.egg/pyparsing.py", line 1006, in parseString
      raise exc
  pyparsing.ParseException: Expected end of line (at char 148), (line:8, col:2)
  [centos@new-host /tmp/sample]$  
  </code></pre>
  
  <p>source:  see <a href="http://prj1.y23.org/zoo.zip" rel="nofollow">http://prj1.y23.org/zoo.zip</a></p>