Back to problems

Design a mini compiler/interpreter

Algorithm · Applied Intuition · Hard

Implement an interpreter for a compact expression language. The input is a program given as a string that may span multiple lines. The language provides: integer constants such as 42 variables and assignment, for example x = 3 + 4 binary arithmetic operators +, -, *, and / with standard precedence and parentheses unary negation, such as -x a print(expr) statement that outputs one integer Your solution should be built as a pipeline: a lexer that tokenizes the source a parser…

Checking your access…