DEV Community


Discussion on: Pratt Parsing

jrop profile image
Jonathan Apodaca Author

A. In your lexer, you if you come across a "+", peek at the next char and check if it is a "+": if so, then consume it and emit "++" as a token, otherwise, just "+"
B. Implement both LED (infix) and NUD (prefix) for the same operator; your implementation will define the behavior of each to get the overall mixfix behavior!

Forem Open with the Forem app