Back to problems

Implement a Rule Parser and Evaluator

Object-Oriented Programming · Stripe · Medium

Problem: Create a Rule Expression Parser and Evaluater You receive a rule written as text along with a runtime context that maps variable identifiers to values. Build a parser and evaluator that decides whether that rule produces true or false for the supplied context. Your implementation should provide: Parsing: Convert the textual rule into a structure that can be evaluated, such as an AST. Evaluation: Run that structure using the given context and produce a boolean…

Checking your access…