"程序语言"这门课的课程实验。 给一个自定义语法的语言写一个解释器(Interpreter),首先写了Parser,然后存入剖析树(Parse Tree)对象中,最后根据Parse Tree的结构执行程序,计算出结果。 语法如下: ::= program (1) begin end ::= | (2) ::= | (3) ::= int ; (4) ::= | , (5) ::= |||| (6) ::= = ; (7) ::= if then e
In this book we will create a programming language together. We'll start with 0 lines of code and end up with a fully working interpreter for the Monkey* programming language.
Step by step. From tokens to output. All code shown and included. Fully t