### PL0编译器
1. 概述
- 山东大学编译原理课程实验
- 词法分析lex,语法分析parse,语义分析parse,虚拟机执行vm
2. 使用
- 进入PL0_Compiler\test\cmake-build-debug目录
- 命令行输入
```shell
#测试功能,编译执行自带的6个PL0文件
./test
#编译执行指定的PL0文件,中间结果存储在同目录下
./test filename
```
3. 测试功能说明
> 测试6个文件,输入文件存放在input文件夹
词法分析文件存放在lex文件夹
语法分析文件存放在parse文件夹
符号表文件存放在table文件夹语义分析生成中间代码文件存放在code文件夹
VM虚拟机运行
> PL0_code.in文件进行乘除、求公因数、阶乘运算
PL0_code0.in看不懂,随便输吧
PL0_code1.in文件输入一个数b,判断b是否为0,如果为0则退出。如果b不为0则输出(b + 10) * 2
PL0_code2.in输出1到10的乘方
PL0_code3.in输出100以内的素数
PL0_code4.in输入一个数b,b!=0时输出(b + 10) * 2,b=0时退出
***
### PL0 compiler
1. Overview
* Shandong University Compilation Principle Course Experiment
* Lexical analysis lex, syntax analysis parse, semantic analysis parse, virtual machine execution vm
2. Use
* Enter the PL0_Compiler\test\cmake-build-debug directory
* Command line input
```shell
#Test function, compile and execute the 6 PL0 files that come with it
./test
#Compile and execute the specified PL0 file, and the intermediate results are stored in the same directory
./test filename
```
3. Test function description
> Test 6 files, the input files are stored in the input folder
Lexical analysis files are stored in the lex folder
The grammatical analysis file is stored in the parse folder
The symbol table file is stored in the table folder, and the semantic analysis generated intermediate code files are stored in the code folder
VM virtual machine running
> PL0_code.in file for multiplication and division, finding common factors, factorial operations
PL0_code0.in can’t understand, just lose
Input a number b in the PL0_code1.in file, judge whether b is 0, and exit if it is 0. If b is not 0, output (b + 10) * 2
PL0_code2.in outputs the power of 1 to 10
PL0_code3.in outputs prime numbers within 100
PL0_code4.in input a number b, output when b!=0 (b + 10) * 2, exit when b=0
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
山东大学SDU编译原理课程实验-内含源码和说明书.zip (93个子文件)
测试模式运行截图
PL0_code(乘除公约数乘方).png 15KB
PL0_code1(加10乘2).png 12KB
PL0_code0.png 11KB
PL0_code3(100以内的素数).png 23KB
PL0_code4(加10乘2).png 12KB
PL0_code2(1到10的乘方).png 14KB
编译原理实验报告.docx 215KB
test
CMakeLists.txt 160B
data.h 2KB
lex.cpp 10KB
parse.h 1KB
cmake-build-debug
table
PL0_code3.out 0B
PL0_code1.out 0B
PL0_code4.out 0B
PL0_code2.out 0B
PL0_code0.out 0B
PL0_code.out 0B
test.cbp 6KB
test.exe 105KB
CMakeFiles
Makefile2 3KB
3.14.5
CMakeRCCompiler.cmake 232B
CompilerIdC
CMakeCCompilerId.c 20KB
a.exe 42KB
CMakeCXXCompiler.cmake 5KB
CMakeSystem.cmake 380B
CMakeCCompiler.cmake 2KB
CMakeDetermineCompilerABI_C.bin 41KB
CompilerIdCXX
CMakeCXXCompilerId.cpp 19KB
feature_tests.c 688B
CMakeDirectoryInformation.cmake 645B
cmake.check_cache 85B
feature_tests.cxx 10KB
feature_tests.bin 44KB
test.dir
main.cpp.obj 23KB
CXX.includecache 284B
objects.a 81KB
link.txt 425B
depend.internal 609B
linklibs.rsp 98B
objects1.rsp 130B
depend.make 587B
lex.cpp.obj 13KB
flags.make 209B
parse.cpp.obj 31KB
DependInfo.cmake 929B
vm.cpp.obj 13KB
cmake_clean.cmake 385B
build.make 7KB
progress.make 106B
Makefile.cmake 3KB
progress.marks 2B
CMakeOutput.log 76KB
clion-log.txt 263B
clion-environment.txt 53B
TargetDirectories.txt 207B
cmake_install.cmake 1KB
Makefile 7KB
input
PL0_code4.in 157B
PL0_code1.in 157B
PL0_code.in 773B
PL0_code3.in 351B
PL0_code2.in 169B
PL0_code0.in 170B
lex
PL0_code3.out 372B
PL0_code1.out 165B
PL0_code4.out 162B
PL0_code2.out 158B
PL0_code0.out 246B
PL0_code.out 906B
parse
PL0_code3.out 3KB
PL0_code1.out 1KB
PL0_code4.out 1KB
PL0_code2.out 1KB
PL0_code0.out 2KB
PL0_code.out 8KB
CMakeCache.txt 46KB
code
PL0_code3.out 318B
PL0_code1.out 144B
PL0_code4.out 144B
PL0_code2.out 142B
PL0_code0.out 259B
PL0_code.out 802B
lex.h 274B
parse.cpp 23KB
main.cpp 3KB
.idea
vcs.xml 183B
workspace.xml 6KB
misc.xml 240B
test.iml 97B
modules.xml 260B
vm.cpp 5KB
vm.h 437B
README.md 2KB
共 93 条
- 1
资源评论
小码蚁.
- 粉丝: 2584
- 资源: 4344
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功