|
The XML output of Project 10 was used to confirm the structure of your compiler is ready and to be used as a guide to build the recursive descent parser. The XML describes the recursive nature of the parsed Jack program (like statements are all contained within functions/methods/constructors which are all contained within classes). The starting code for Project 11 is, in general, a copy of Project 10. As you implement Project 11, the XML text will be removed and replaced with VM statements. Any XML related to structure (braces, commas, semicolons, etc) will completely go away for project 11.
I would recommend starting with a program like
class MyMain {
function int f1 () {
return 1;
}
}
and then seeing what the JackVM compiler does.
function MyMain.fn 0
push constant 1
return
Then build up the above example with gradually more programming elements. The symbol tables do not need to be implemented right away. Start with functions, constant expressions, function calls to get going.
|