本文整理汇总了C++中Tokenizer::getIdName方法的典型用法代码示例。如果您正苦于以下问题:C++ Tokenizer::getIdName方法的具体用法?C++ Tokenizer::getIdName怎么用?C++ Tokenizer::getIdName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tokenizer
的用法示例。
在下文中一共展示了Tokenizer::getIdName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseIDForDS
ID* ID::parseIDForDS()
{
string idName=t.getIdName();
for(int k=0; k<idCount; k++)
{
if(idName==eIDs[k]->name) {
cout<<"Error - variable has already been declared"<<endl;
exit(0);
}
ID *nID = new ID(idName);
eIDs[idCount++]=nID;
return nID;
}
}
示例2: parseIDForSS
ID* ID::parseIDForSS()
{
string idName=t.getIdName();
for(int k=0; k<idCount; k++)
{
if(idName==eIDs[k]->name) {
t.skipToken();
return eIDs[k];
}
else {
cout<<"Error - variable has already been declared"<<endl;
exit(0);
}
}
}
示例3: printStmt
void Stmt::printStmt()
{
curToken=t.getToken();
if(curToken == 32){
cout<<t.getIdName();
t.skipToken();
curToken=t.getToken();
#ifdef ENABLE_DEBUG_PRINT
cout<<" curToken-printStmt- Var "<<curToken<<endl;
#endif
assign.printAssign();
}
else if(curToken==5) {
cout<<" if ";
t.skipToken();
cond.printCondition();
curToken=t.getToken();
while(curToken != 3) {
this->getIfInstanceStmt()->printIF();
t.skipToken();
curToken=t.getToken();
#ifdef ENABLE_DEBUG_PRINT
cout<<" curToken-printStmt- if "<<curToken<<endl;
#endif
if(curToken == 6){ cout<<" then "<<endl; t.skipToken(); }
else if(curToken == 3) { cout<<" end "; }
else if(curToken == 12) { cout<<" ; "<<endl; }
}
}
else if(curToken==8) {
cout<<" while ";
t.skipToken();
curToken=t.getToken();
while(curToken != 3){
this->getLoopInstanceStmt()->printLoop();
t.skipToken();
curToken=t.getToken();
#ifdef ENABLE_DEBUG_PRINT
cout<<" curToken-printStmt- while "<<curToken<<endl;
#endif
if(curToken == 9){ cout<<" loop "<<endl; t.skipToken(); }
else if(curToken == 3) { cout<<" end "; }
else if(curToken == 12) { cout<<" ; "<<endl; }
}
}
else if(curToken==10) {
cout<<" read ";
t.skipToken();
curToken=t.getToken();
while(curToken != 12){
in.printIN();
t.skipToken();
curToken=t.getToken();
#ifdef ENABLE_DEBUG_PRINT
cout<<" curToken-printStmt- read "<<curToken<<endl;
#endif
if(curToken==12) { cout<<"; "<<endl; }
else if(curToken==13) { cout<<", "; }
else if(curToken==14) { cout<<" = "; }
}
}
else if(curToken==11) {
cout<<" write ";
t.skipToken();
curToken=t.getToken();
#ifdef ENABLE_DEBUG_PRINT
cout<<" curToken-printStmt- write "<<curToken<<endl;
#endif
out.printOUT();
}
}