News for hackers. Stuff that matters.
Re:Pratt parsing is a black box by direwolf20 on Tuesday November 03, 2026 @06:48PM (#50359835)
Executing the operation inside the semantic action only works for simple calculators. Otherwise you have the problem that the line of code may run multiple times even though it's only parsed once. Usually you make the semantic actions build an AST (a data structure holding the structure of the program, e.g. new BinaryExpression(left_ast, '+', right_ast)

There are no comments on this comment yet.