Project 5
P3
Position of the problem
Let the functions defined by
They will be defined in the symbol table by
And
P4
And in virtual machine by
Where
C1是(lit)的code field address
C2是+的cfa
C3是(fin)的cfa
C4是. 的cfa
所以我们得到
P5
P6 sivrai是if true的意思 sifaux是if false的意思
How to encode virtual machines to … if … [else …] then
The syntax in LAC is
or
Remember that the type returned must be calculable!
In the first case,
In the second case,
You also need to be able to handle nested conditions, and not get it wrong on the then and the else!
P7
P8
Conditional in the symbol table
需要声明的是: if, else and then are only usable during compilation!
Clearly, the types are
if (b --)
else (——)
ehen (——)
Note that then is not even encoded in the virtual machine! (If you’re missing, you can always create a function that does nothing!)
There must be a semantic error, if the if, else and then are not well organized (empty all the stacks).
P9
P10字符串
In compilation
In execution
P11
Using strings in compiled mode
No problem, it gives in virtual machine
其他还是一一对应
C1 is the Cfa of a function (str) which indicates that a string
P12
Where to put the chain as long as it is needed?
How to put strings without overlapping them?
P13
P14
Declaration不要求但是很有趣
后面的好像不需要了?我没仔细看,如果需要翻译我再翻译
/docProps/thumbnail.jpeg