1 个不稳定发布版
0.1.0 | 2023年1月21日 |
---|
#40 in #formula
在 truemoji 中使用
27KB
560 行
Truemoji 核心库
该库包含 Truemoji 语言的规范和实现,Truemoji 是一种描述 命题逻辑 的语言。简单来说:我将命题逻辑运算符替换成了表情符号!
Truemoji 语言规范
<iff> := <implies> 🤝 <iff> | <implies>
<implies> := <or> 👉 <iff> | <or>
<or> := <and> 🙌 <or> | <and>
<and> := <not> 👏 <and> | <not>
<not> := 🚫 <formula> | <formula>
<formula> := [A-Za-z0-9] | 👍 | 👎 | 😮 <iff> 😶
参考资源
- https://adriann.github.io/rust_parser.html
- https://createlang.rs/01_calculator/ast.html
- https://pages.cs.wisc.edu/~fischer/cs536.s08/course.hold/html/NOTES/3.CFG.html#exp
库内容
该库实现了 Truemoji 语言的词法分析器、解析器和抽象语法树(AST)。只要每个公式都与一个布尔值相关联,就可以评估 AST 的真值。
依赖项
~1.5–2MB
~44K SLoC