Design patterns·Who calls whom, and when
each node in the parsed expression knows how to evaluate itself, and evaluating the root walks the whole tree.
Interpreter pattern
Also calledinterpreter, expression tree evaluation
Representing a small language's grammar as a class per rule, each able to evaluate itself against a context. It is the least-used pattern in the catalogue — anything beyond a tiny grammar wants a real parser and a visitor over the AST — but the shape appears whenever a codebase grows a rules engine, a search filter syntax or a permission expression. Say plainly in an interview that you would recognise it and would not reach for it.