Thanks, Ron, for the inspiration. After scanning your code I realized that this situation is even easier. All I need to do is when I hit the point where I want to tell these apart (both productions have the same token at this point), that I can recognize anything I want with lexeme_read, so I just need to decide whether I want to recognize this parse or the other. I don't even have to get into resolving ambiguous parses.
And I found that I can put the "no output parentheses" even around non-explicit lexical elements, so my little check above does not even end up in the parse tree. On Saturday, August 11, 2018 at 12:08:45 AM UTC-5, Thomas Weigert wrote: > > Sorry for the following beginner's question.... > > I have an ambiguous grammar which I would like to resolve during parsing. > > I arranged for an event to be triggered when I have seen enough so that I > can make a decision whether the current production will be the right one > (by considering context). I would like to in the event handler either > accept this lexeme (when I determine that this production is the correct > one) or reject this lexeme (when I determine that this production is the > wrong one). If I reject this lexeme, I hope that marpa will go on to try > the other production which will now be the correct one. > > Is this something reasonable to want to accomplish? If so, is there any > example I could emulate for this behavior. It is easy to accept the lexeme, > but I am having a hard time figuring out how to reject it and continue > trying. > > Thanks for any suggestions. > -- You received this message because you are subscribed to the Google Groups "marpa parser" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
