compiler construction - Operator Precedence Parser: Where do we keep reduced tokens? -
an op precedence parser has stack , input buffer. i believe after popping, "id" token reduced variable "e". for every pop of "id" token stack after seeing mathematical operator in input, popped token kept? if input id+id*id$ , time $ reached, "id"s have been popped. kept? assuming goal build ast, id s (and other operand tokens such literal constants) put ast node created reduction. if you're directly evaluating or generating three-address code or ..., answer differ slightly. however, broad outline same: operator-precedence parsing bottom-up parse algorithm in right-hand side of production reduced corresponding non-terminal (on left-hand side of production) when it's last input symbol has been read (and lookahead indicates correct action reduction).