資源簡介
這是一份完全自主知識產權的tiny+源代碼,僅供參考,大作業還是要自己認真做滴~
代碼片段和文件信息
#include?“scanner.h“
#include?“parser.h“
#include?“Code.h“
string?Code::getLabel()
{
string?temp;
temp=“L“+int2str(labelIndex);
labelIndex++;
return?temp;
}
string?Code::getTempName()
{
string?temp=“T“;
temp=“T“+int2str(tempIndex);
tempIndex++;
return?temp;
}
void?Code::generateCode(string?filePath)
{
Parser::TreeNode*?node=parser.scanFile(filePath);
EXP?exp;
if(node->child[0]!=NULL)
node=node->child[0];
exp=stmtSequence(node);
cout<<“===============code?printing......=========“< cout< cout<<“================finished=============“< }
Code::EXP?Code::stmtSequence(Parser::TreeNode*?node)
{
EXP?exp;
exp.name=““;
exp.code=statement(node).code;
while(node->sibling!=NULL)
{
node=node->sibling;
exp.code+=sta
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????117??2011-01-08?22:30??b.txt
?????文件???????5072??2011-01-08?22:42??Code.cpp
?????文件????????818??2011-01-08?20:27??Code.h
?????文件???????1053??2011-03-09?22:03??main.cpp
?????文件???????8821??2011-01-08?21:51??parser.cpp
?????文件???????1281??2011-01-08?21:41??parser.h
?????文件???????3267??2011-01-08?20:27??scanner.cpp
?????文件???????2409??2011-01-08?03:26??scanner.h
?????文件?????????32??2011-01-08?22:26??test.txt
?????文件????????124??2011-01-08?22:08??a.txt
?????文件????????376??2011-03-09?22:07??請閱讀此文件.txt
-----------?---------??----------?-----??----
????????????????23370????????????????????11
評論
共有 條評論