Loading ...
Sorry, an error occurred while loading the content.

7389Simple parsing grammar question

Expand Messages
  • Joel Reymont
    Mar 1 3:26 AM
    • 0 Attachment
      Folks,

      I have a rule like this in my .mly file:

      sections:
      | sections section EOF { $1 @ $2 }
      | EOF { [] }
      | { [] }

      My idea is to say that there can be zero or more sections before the
      end of file. My parser doesn't seem to work without the last bit,
      i.e. "| { [] }" but I don't understand why.

      Can someone offer an explanation?

      Thanks, Joel

      --
      http://wagerlabs.com/