#tibasic #ti83 #ti84

bin+lib tibrs

为TI图形计算器提供编译和反编译Tibasic源代码的功能

4个版本

0.1.3 2024年4月17日
0.1.2 2024年4月17日
0.1.1 2024年3月17日
0.1.0 2024年1月9日

#1504 in 解析器实现

MIT 许可证

17KB
292

tibrs

一个库和CLI,用于将TI-BASIC编译和反编译为TI-CONNECT之外的8xp。

安装

# add this crate to your project
$ cargo add tibrs

# install `tibc` binary
$ cargo install tibrs --bins
$ tibc --help # confirm installation

箱子使用


fn main() -> {
    let source = fs::read_to_string("~/path/to/source.tib").unwrap();
    let tokens: Vec<tibrs::TibToken> = tibrs::parse_str(source).unwrap();
    let buf: Vec<u8> = compile(tokens, "DEMONAME".as_bytes()).unwrap();

    fs::write("~/path/to/DEMONAME.8xp", buf).unwrap();
}

CLI使用

注意:当编译8xp文件时,tibc将从输出文件名的第一个8个字母推断出嵌入式PRGM变量的名称,首字母大写。

$ cargo install tibrs --bin tibc

# compile
$ tibc --compile --outfile DEMONAME.8xp source.tib

# decompile
$ tibc --decompile --outfile decomp.tib DEMONAME.8xp

参考

此二进制实现基于非常有用的Merthsoft TI Linkguide

依赖关系

~5.5MB
~102K SLoC