?? asmgen.h
字號:
#ifndef MY_ASMGEN_H_
#define MY_ASMGEN_H_
/**: File: asmGen.h
&
* This is 80X86 ASM code generator
*
* author: lonelyforest
* data: 2006.4.23
*/
#include "Analyzer.h"
//----------------------------------------------------------------------------
class asmGen {
public:
//------------------------------------------------------------------------
asmGen(const string &filename);
~asmGen();
void codeGen(); // main interface, create syntaxtree, gen asm code
//-----------------------------------------------------------------------
void noListFile() { analyze->noListFile(); }
void noTreeFile() { analyze->noTreeFile(); }
void noSymbolFile(){ analyze->noSymbolFile();}
void noCodeFile() { traceCode = false; }
//-----------------------------------------------------------------------
bool is_good()const { return is_good_ && analyze->is_good(); }
int errCount()const{ return err+analyze->errCount(); }
int warnCount()const{ return warn+analyze->warnCount(); }
//------------------------------------------------------------------------
protected:
//------------------------------------------------------------------------
void x86Gen();
void emitComment(const char *eCmt);
void emitCode(const char *eCde);
//------------------------------------------------------------------------
void x86GenPre();
void x86GenCode();
//------------------------------------------------------------------------
void x86GenData(TreeNode *tree);
void x86GenVar(TreeNode *tree);
void x86GenFun(TreeNode *tree, bool pre);
//------------------------------------------------------------------------
void x86GenSE(TreeNode *tree);
void x86GenStmt(TreeNode *tree);
void x86GenExp(TreeNode *tree);
//------------------------------------------------------------------------
void read_int();
void write_int();
//------------------------------------------------------------------------
bool isLeft(TreeNode *node);
protected:
Analyzer *analyze;
TreeNode *tree_;
//------------------------------------------------------------------------
string codefile;
ofstream code_;
//------------------------------------------------------------------------
int err;
int warn;
int cL; // current label number;
bool traceCode;
bool is_good_;
//----------------------------------------------------------------------------
};
//----------------------------------------------------------------------------
#endif // end #ifndef MY_ASMGEN_H_
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -