From the "The wonder of the dancing bear" department:
Surprising myself, I've managed to write a command-line Spin compiler. It takes Spin source and generates a .eeprom file.
It runs on Windows with the .Net framework (and on Linux with Mono).
At the moment, I think it will parse anything that Proptool will, and it should generate identical bytecode (except for maybe the least-significant bit in floating-point constants).
If you have nothing better to do, please try it out on some of your Spin files and let me know if it chokes on them. (Note: Error messages may be very cryptic!)
This post is updated with the most recent version.
For more information, see the Homespun page on the Propeller wiki: http://propeller.wikispaces.com/Homespun+Spin+Compiler
Edit: Version 0.16
- added "@@@" (absolute hub address) operator
- corrected object ordering bug
Edit: Version 0.17
- presence of @@@ disables duplicate object elimination
Edit: Version 0.18
- Library search paths: /L option and SPINLIB environment variable
- #define/#ifdef etc.
- /d option now produces listing file with SPIN opcodes
- warns on data truncation
Edit: Version 0.19
- experimental support for multidimensional VAR arrays
Edit: Version 0.20
- changed array syntax from a[noparse][[/noparse]i][noparse][[/noparse]j][noparse][[/noparse]k] to a[noparse][[/noparse]i,j,k]
Edit: Version 0.21
- command line options now must start with -, not /
- -L option and library path must now be separated (-L path, not -Lpath as in previous versions)
- -i0, -i1, -i2, -i3 options to control informational messages
- output file no longer contains ".out" in its name (e.g. now test.eeprom, not test.out.eeprom)
- -b option writes .binary file instead of .eeprom file
- various cosmetic changes requested by Praxis
- experimental object sharing
Edit: Version 0.22
Edit: Version 0.23
- bug fix: now appends '\' to library paths if necessary.
Edit: Version 0.24
- bug fix: "NOT x := y" now parses as "NOT (x := y)" to match Proptool.
- now supports "0x" prefix for hex numbers in addition to "$".
Edit: Version 0.25x
Edit: Version 0.27
- fixed listing bug.
- fixed code generation for NEXT/QUIT inside CASE.
Edit: Version 0.28
- Added #include directive.
- Can #define symbols on command line (-D option).
- #defined symbols are visible to sub-objects.
- Added TESTN instruction.
- -L now appends \ or / as appropriate.
- Prints size of output file.
Edit: Version 0.29
- Added -c option to write .dat file.
Edit: Version 0.30
Edit: Version 0.31
- Corrected #elseifdef code; added #elseifndef condition.
- Released source under MIT license.
Details here: http://propeller.wikispaces.com/Homespun+Spin+Compiler
Attached to this post are the executable and source files (C#).
Post Edited (mpark) : 10/5/2009 5:06:00 AM GMT