A compiler for compiling TI NSpire Basic code from a more portable syntax.
This Python program is an attempt at creating a more portable
syntax for writing programs for the TI NSpire CX CAS
calculator. The reason I made this simple compiler is that the
original NSpire Basic syntax is not too great, since it uses
mathematical symbols not included in the standard ASCII character
set. There’s also a problem with the default NSpire Basic editor:
There’s no way to paste human readable code that’s not originally
copied from the default editor without breaking the code and messing
up the indentation in the process.
This compiler tries to solve these problems by:
The installation (or configuration) procedure is quite simple. The
steps to take are listed below.
sudo apt update && sudo apt install git python2.7 make
.git clone https://github.com/eerotal/nsbcomp.git
in your home directorynsbcomp.git
where it downloads thecd nsbcomp.git
to switch into the downloaded source directory andmake configure
.nsbcomp
is now ready to be used. There are some usage examples in theUsage examples
in this file.Option | Explanation |
---|---|
—in/-i | Input file(s). STDIN is used if this is omitted. Multiple files are concatenated. |
—out/-o | Output file. STDOUT is used if this is omitted. |
—verbose/-v | Print verbose messages to STDOUT. |
—preserve-tmp/-p | Preserve created temporary files on exit. Debug flag. |
—help/-h | Display a help message. |
python nsbcomp/nsbcomp.py -i examples/example.nssrc
examples/example.nssrc
and outputspython nsbcomp/nsbcomp.py -i examples/* -o out.nsmin
examples
directoryout.nsmin
. This program is licensed under the BSD 3-clause license. You can find
the whole license text in the file LICENSE.txt.
Copyright 2017 Eero Talus