# Craft A Language **Repository Path**: ldfee/Craft-A-Language ## Basic Information - **Project Name**: Craft A Language - **Description**: No description available - **Primary Language**: C++ - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-10-12 - **Last Updated**: 2022-10-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Craft A Language #### 介绍 极客时间《手把手带你写一门计算机语言》课程CPP版,使用C++17 语法 改写from RichardGong/Craft A Language #### 软件架构 软件架构说明 #### 安装教程 1. 编译:`make -j` 2. 执行:`play.exe -h` 查看使用方法 ``` usage: play.exe [-f source_file] [-i] [-a] [-V] [-v bytecode_file] [-b bytecode_file] [-h] -f compile the src file -i compile and run by interpretor -a compile and output to srcfile.s -v read bytecode file and execute -b compile src file to bytecode and output to -V verbose mode -h print message above ``` 3. 清除:`make clean` 4. 使用举例 >+ example1: 解释运行 example_fibo.ts 文件 >> play.exe -f example_fibo.ts -i >+ example2: 将 example_fibo.ts 文件 编译成字节码文件 example_fibo.bc >> play.exe -f example_fibo.ts -b example_fibo.bc >+ example3: 执行节码文件 example_fibo.bc >> play.exe -v example_fibo.bc >+ example4: 将 example_fibo.ts 文件 编译成汇编文件 example_fibo.ts.s >> play.exe -f example_fibo.ts -a >+ example5: 将example_fibo.ts.s 文件编译成可执行文件 example_fibo >> cd rt; make clean; make example_fibo; ./example_fibo #### 使用说明 目前字节码和汇编文件不支持浮点数,所以最好不要运行运行浮点数的脚本。 请购买正版极客时间《手把手带你写一门计算机语言》课程,支持宫文学老师