Can I stop lookahead in menhir for a rule?

Menhir is based on LR(1), but I want to stop lookahead in some parser rules. My parser will update some mutable states during semantic actions, which will be used in lexer, but lookahead will process before my state updated. So the lexer may not work as expected.

Is there a way to stop lookahead in a parser rule? I tried to add dummy tokens at the end of the rule, but I cannot figure out how to get these dummy tokens from lexer :frowning:

Okay, I figured it out. Instead of using a dummy token, we can use midrule(page 19) to update mutable states before this rule is finished :smiling_face_with_three_hearts: