This is more of an "in principle" question than a practical one. Is the order in which Yacc reduces productions, and reads new tokens from the lexer defined. That is, if I had the following set of tokens:
INTEGER_BEGIN
INTEGER_VALUE
LESS_THAN
INTEGER_BEGIN
INTEGER_VALUE
Can Yacc, within its semantics, read the LESS_THAN
token from the lexer, before it reduces INTEGER BEGIN INTEGER_VALUE
to a single thing, given a set of productions like:
expr : expr LESS_THAN expr
| integer
integer : INTEGER_BEGIN INTEGER_VALUE
Do the rules for this change if these are defined with semantic actions?