Sphinx is a Spin compiler that runs on the Propeller chip. It can compile complex and substantial programs (including those containing Propeller assembly language) such as the Parallax TV and graphics objects and even Sphinx itself.
In order to support compilation, Sphinx also performs some of the functions of an operating system. It provides a command-line shell, a text editor, disk utilities, and a memory-resident (well, cog-resident) I/O system.
Sphinx can run on basically any Propeller system that has an SD card interface, an NTSC video interface, and a PS/2 keyboard interface. Examples of commercial Sphinx-compatible systems include the HYDRA with SDMAX and the Hybrid board.
On booting up Sphinx, you will see a command-line shell. You can enter commands such as "cl filename" to compile and link a file, "dir" to list the files on the SD card, and "ed filename" to edit a file. A list of commands is at www.sphinxcompiler.com.
PC-based compilers such as the Propeller Tool compile Spin source directly to executable binary images. Sphinx cannot do this as it would generally require compiling multiple Spin files at the same time, and the Propeller does not have enough memory to accomplish this.
Instead, Sphinx compiles Spin source to Spin Object Binary files. This process can be done on one .spn file at a time. A separate link step combines .sob files into an executable .bin file.
The compilation process is performed by two programs. The first, lex, tokenizes the Spin source and produces an intermediate .tok file. The second, codegen, uses the .tok file and produces the .sob file. Codegen is a two-pass compiler, so generating a .tok file saves codegen the effort of tokenizing twice.
Linking is done by the program named link.
Example: consider a simple "Hello, world" program that uses the tv_text object. The tv_text object in turn uses the tv object.