📄 gencode.h
字号:
#include "stdio.h"
#include "Analyze.h"
class VM;
class GenCode{
private:
FILE * codefile;
int IP,MP; //IP是代码地址,MP是内存指针
Analyze *analyze;
public:
Instruction *codes;
GenCode(){};
void Init(FILE *file,Analyze *analyze);
void genStmt( TreeNode * tree);
void genExp( TreeNode * tree);
void cGen( TreeNode * tree);
void codeGen(TreeNode * syntaxTree); //代码生成主函数
void emitCode(char *op,int p1,int p2); //生成一句三元式指令
void backPatch(int loc); //回填函数
void printCodes();
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -