Closed siuying closed 10 years ago
This is indeed an issue with your grammar not being LALR1. What I'd suggest you do is to instead use your tokeniser delegate to remove whitespace tokens except in any locations where the whitespace has a meaning (and in fact, even in these cases, to use it to refactor your whitespace into something more structured). Then your grammar does not need to deal with whitespace at all. Hope that helps.
@beelsebob Thanks, this help!
I'm working on a grammar that should accept optional white space. I added the optional white space rule and the parser complain error "Could not insert reduce in action table for state 4, token #".
I could not tell if this is problem in grammar or it is not supported by CoreParse. Appreciate any pointer to this error!
Before I added optional space:
After I added optional space, parser return error:
Full grammar: https://github.com/siuying/CSSSelectorConverter/blob/core-parse/CSSSelectorConverter/CSSSelectorGrammar.txt