You need to build a pascal compiler.
How to parse and interpret a Pascal program definition?
How to parse and interpret compound statements?
How to parse and interpret assignment statements, including variables?
A bit about symbol tables and how to store and lookup variables?
You can use this as a guide (goes through part 9)
https://ruslanspivak.com/lsbasi-part1/