程序代写代做代考 chain P3

P3
Position of the problem
Let the functions defined by
Project 5
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
if else then
or
if then
Remember that the type returned must be calculable!
In the first case, and must have the same type!
In the second case, must return nothing!
You also need to be able to handle nested conditions, and not get it wrong on the then and the else!
if if else then…

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 ²»ÒªÇóµ«ÊǺÜÓÐȤ ºóÃæµÄºÃÏñ²»ÐèÒªÁË?ÎÒû×Ðϸ¿´£¬Èç¹ûÐèÒª·­ÒëÎÒÔÙ·­Òë