C/C++表达式解析(可用于脚本解析功能实现)

时间:2019-01-03 04:18:46
【文件属性】:

文件名称:C/C++表达式解析(可用于脚本解析功能实现)

文件大小:125KB

文件格式:ZIP

更新时间:2019-01-03 04:18:46

数值运算 逻辑判断 表达式 解析

A simple command line calculator that uses a recursive descent parser, written in C. Made as an exercise in tokenizing and parsing... ## Supported features Below is the BNF of the parser. The functions are named and behave the same as those found in C64 BASIC. expression = ["+"|"-"] term {("+"|"-"|"OR") term} . term = factor {( "*" | "/" | "AND" ) factor} . factor = func "(" expression ")" | number | "(" expression ")" . func = ABS | AND | ATN | COS | EXP | INT | LOG | NOT | OR | RND | SGN | SIN | SQR | TAN


【文件预览】:
expression-master
----t()
--------Makefile(755B)
--------main.c(2KB)
----src()
--------tokenizer.c(3KB)
--------parser.c(5KB)
--------main.c(1KB)
----expression.png(135KB)
----README.md(1KB)
----Makefile(1KB)
----.gitignore(168B)
----include()
--------tokenizer.h(512B)
--------parser.h(241B)

网友评论

  • 可以借鉴大概算法
  • 可以参考,不是很全!
  • 是用c写的,运行环境好像是linux?(看文件夹中的截图判断的)程序无任何注释,小白表示看不懂。然后又不能直接放在vs里运行……略郁闷 总体看着很高大上