Explain the core concepts of a compiler and describe how you would implement a basic compiler or parser to handle variables and expressions.
Implement compile_program(source), which parses valid statements containing integer literals, variables, assignments, arithmetic operators, and parentheses. Return stack-machine instructions using PUSH, LOAD, STORE, ADD, SUB, MUL, and DIV. Statements are separated by semicolons, and arithmetic precedence must be preserved.
Input: a string. Output: a list of instruction lists.
def compile_program(source):