Hydrogen-python/README.md
2025-06-11 19:51:42 +08:00

24 lines
895 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# C(缩减版)语言编译器前端
## 是什么
NUAA 2017年编译原理课设词法分析使用正则表达式语法分析使用LL(1)文法分析器,
语义分析使用自上而下翻译,使用 Python 语言编写,面向配置化,稍加改造可以适用其他文法
## 怎么使用
```
git clone https://github.com/FlyAndNotDown/CSub-CompilerFrontend.git
```
在 PyCharm 中打开新建项目导入代码即可Python 使用版本为 3 以上,请不要使用 Python2 运行该项目
## 代码结构说明
* main.py 编译器主程序
* error.py 存放错误相关的类和代码
* test.c 要编译的文件
* lexical 词法分析
* syntax 语法分析
* semantic 语义分析
另外,三大分析中 rule.py 即是支持编译器的所有文法、词法、语义规则,加以改动即可面向一些其他的文法和语言使用
## 关于
NUAA 161520311 John Kindem