On Mon, Jun 27, 2005 at 10:19:22AM -0700, Ron Smith wrote: > > Scott, it is "bad form" to post code that you have not tested. I copied > the above verbatim into an editor and every line in your test data > causes an "error" message. Moreover, there is nothing in your grammar > that handles "comments".
Hmmm. I had tested the code before sending, and it worked fine. I know better than to post untested code. > > Second if you really want help, telling the potential helper to go "ex > R3 Up" themselves is also not particularly helpful. Ex R3 up to you > too... "Ex R3 io" for the horse you rode in on. cute.... > > But assuming that you meant this somewhat in jest and that your mother > didn't raise you to have enough sense to be gracious, I'll provide a few > bread crumbs. Whoa. What I said was that, if my post was in bad form, you were free to tell _me_ 'ex R3 up'. I was trying to be gracious in apologising in advance for intruding into the world of experts. Viz: >>I've tried to distill the grammar down for this post, but again, I >>apologize if it is too long to digest. If you don't like it, you can >> ^^^ >>say, in our full grammar: ex R3 up. Please read before ranting. And you can leave my mother out of this, thanks. > Second, it seems that what you want to parse is inherently ambiguous > because there is no obvious difference between "n mu" and "nm" when you > discount white space. Right.... > > Fundamentally you need to decide if white-space is part of your > grammar. As is evident from my question, it is. > If so, then what will help to disambiguate this case is a look-ahead > that comprehends the white-space. If white space is not truly required, > than what you need is still a look-ahead, but something that parses > ahead to see if the "other" case is what *will* happen. I guess I was asking for the 'look-ahead that comprehends white-space'. I always thought a grammar was handed 'tokens', notjustawholebunchofstuffglommedtogetherinonestream;guessIwaswrong. > > However, in general, designing ambiguous grammars is something to > avoid. Fruit flies like a banana. Thanks for the crumbs, Scott.