I've written a Python program to parse the XML token specifications used by TokenIDE, and produce a (f)lex based lexical analyzer on the fly.
I've tested it with both the pure-basic and default library-enabled token sets without difficulty, and I have no reason to believe it should have problems with Grammer, Axe, or even Prizm BASIC tokens.
Current caveats:
The output is a .bin file suitable to fed to binpack8x, wabbitsign, or the TI-header-writer of your choice (don't know what this toolchain would be for Prizm). Wabbit will complain that your file doesn't begin with $BB$6D, since it isn't used to BASIC programs instead of assembly programs, but it will do it's job anyway. Also, not sure if this is a caveat, but your programs will probably be locked by default on calculator, since most assembly oriented signing/header-generating tools do that to keep you from mucking about with the hex.
In the long haul, I would like to use this tool to add lexical analysis and "compiling" abilities for TI-Basic to other programming text editors (probably vim and Komodo Edit first).
I've tested it with both the pure-basic and default library-enabled token sets without difficulty, and I have no reason to believe it should have problems with Grammer, Axe, or even Prizm BASIC tokens.
Current caveats:
- The maximum token size is 8 bytes (or more technically, the size of a long int on your compiler), if this ever needs to be changed, it can be, but I don't foresee that being a problem in the near future, and this way was much faster to code.
- As far as I can tell, the lexer just strips unrecognized characters from the output. Additionally, it currently doesn't work with the alternative attributes, only those specified as the "string" attribute of the main <Token> element for each token, but I think can add support for that tomorrow without too much work, before I upload it.
- No parsing or syntactic analysis yet. So if you use comments as supported by TokenIDE, they won't get automatically excluded like they should.
The output is a .bin file suitable to fed to binpack8x, wabbitsign, or the TI-header-writer of your choice (don't know what this toolchain would be for Prizm). Wabbit will complain that your file doesn't begin with $BB$6D, since it isn't used to BASIC programs instead of assembly programs, but it will do it's job anyway. Also, not sure if this is a caveat, but your programs will probably be locked by default on calculator, since most assembly oriented signing/header-generating tools do that to keep you from mucking about with the hex.
In the long haul, I would like to use this tool to add lexical analysis and "compiling" abilities for TI-Basic to other programming text editors (probably vim and Komodo Edit first).