Sphinx‎ > ‎Documentation‎ > ‎Reference‎ > ‎


Codegen.bin is the second phase of the compiler. It takes a .tok file generated by lex.bin and compiles it to a .sob file. On successful completion, codegen.bin can automatically run link.bin (of course, linking should only be done on the top object, not child objects, so don't use the /l option too freely).
Typically you will never run codegen.bin directly. Instead you will use the c and cl commands (provided by sphinx.bin) which run codegen.bin for you.
codegen filename [options]
  • /l -- run link.bin automatically on successful completion.
  • /s n -- set stack size to n bytes (default is 2300). If codegen.bin fails because of stack overflow, run it again with a larger stack. n must be a multiple of 4.
  • /t n -- set symbol table size to n bytes (default is 6000). If codegen.bin fails because the symbol table becomes full, run it again with a larger symbol table. n must be a multiple of 4.
  • /v n -- set verbosity to 0, 1, 2, or higher (default is 0). The higher the verbosity, the more messages codegen.bin prints as it runs.
codegen howdy /v 3 /t 7000
This command compiles howdy.tok and produces howdy.sob. While running, codegen.bin prints many informative(?) messages. The symbol table size is 7,000 bytes.
Note that you do not have to add ".tok" to the input filename. Codegen.bin will add it automatically.