main() parse command line define global scope define internal types, struct, functions repeat until EOF Scope::parsevaldecl() - parse a declaration Scope::parsedecl() parse storage class (extern, static, typedef, virtual) Scope::parsecvmoddedtype() - parse type + const / volatile repeat until semi-colon parse *'s and embedded consts, volatiles parse function or variable name ...including possible struct:: prefix parse possible [ array size ] parse possible ( param list ) parse possible { function body } FuncDecl::parseFuncBody() declare void *__retaddr to hold return address declare __return label to jump to on return if instance, declare structtype *const this FuncDecl::parseStatement() - build abstract syntax tree resolve forward reference gotos FuncDecl::generfunc() - generate primitives FuncDecl::optprims() - optimize primitives FuncDecl::allocfunc() - allocate variables on stack for each prim, Prim::assemprim() - convert prims to machine lang MachFile::optmachs() - optimize machine language squeeze some redundant instructions out assign stack locations fix up direct addressing where possible assign hardware registers some more squeezing shorten branches where possible for each mach, Mach::dumpmach() - output assembly language