Hey Aditya,
Sorry for the delay in responding.. life's been a bit up in the air for me the past couple of weeks..
Regarding your first question (WORD grammar returning None), what version of Modgrammar are you using? I cannot reproduce the behavior you mention using the current version of Modgrammar (0.10).
(Note that if you are using an old version (pre-0.10), parse_string behaved slightly differently, and you needed to tell it explicitly that there's no more input coming (by using the eof=True argument). Otherwise, it couldn't be sure that you weren't intending to call it again with more input (which might be more of the WORD). In this case it would return None to indicate that it needed more input to be sure whether it had matched the end of the grammar or not. In 0.10 the default behavior for parse_string was changed to assume eof=True, because this was the more common/expected case for most people. If you are not using 0.10 (which it sounds like you're not), I would highly recommend you upgrade Mhttps://
pythonhosted.org/modgrammar/tutorial.html#left-recursionodgrammar, as there are several improvements which make things easier to use in various ways.)
The good news is that in most cases, there are other ways to define the grammar which have the same end result, but don't rely on left-recursion to do the job. I have to admit, I'm having a little trouble wrapping my brain around the grammar you're wanting to use, so I'm not exactly sure, but it looks like you may be wanting to do something akin to infix math expressions, in which case you may want to take a look at the example of that in the Modgrammar docs for some ideas:
If that doesn't help, I might be able to provide some more suggestions if you can give me a better example of the sort of inputs you want to parse and the sort of output (parse trees) you're hoping to get out of them..
--Alex