本文整理汇总了C++中Label::New方法的典型用法代码示例。如果您正苦于以下问题:C++ Label::New方法的具体用法?C++ Label::New怎么用?C++ Label::New使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Label
的用法示例。
在下文中一共展示了Label::New方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: statement
//-------------------------------------------------------------------------
//Function statement implements the rule
//statement -> WHILE expression DO statement
// whilebegin:
// expression
// fjp "whileend"
// body_statement
// ujp "whilebegin"
// whileend:
//-------------------------------------------------------------------------
List<Exp*>* statement(Exp* expression,List<Exp*>* body_statement)
{ PCode* P;
Exp* E;
string whilebegin=L.New(); //Create whilebegin label
string whileend=L.New(); //Create whileend label
P=new PCode(whilebegin,"","","");
E=new Exp(ST.TVoid(),P);
List<Exp*>* WS=new List<Exp*>;
WS->Insert(E); //Insert whilebegin label
P=new PCode("","fjp","",whileend);
E=new Exp(expression,0,ST.TVoid(),P);
WS->Insert(E); //Insert while-test expression and false-jump
WS->Append(body_statement); //Append the while-body-statement
P=new PCode("","ujp","",whilebegin);
E=new Exp(ST.TVoid(),P);
WS->Insert(E); //Insert unconditional jump to while-test
P=new PCode(whileend,"","","");
E=new Exp(ST.TVoid(),P);
WS->Insert(E); //Insert whileend label
WS->Print(tfs);
return WS;
}
示例2:
//-----------------------------------------------------------------------------
//class SubprogramSymbol
//-----------------------------------------------------------------------------
SubprogramSymbol::SubprogramSymbol(symkind sk,string id,Typ* t)
:Sym(sk,id,t){elabel=L.New();splabel=L.New();eplabel=L.New();}
示例3:
//-----------------------------------------------------------------------------
//class SubprogramSymbol
//-----------------------------------------------------------------------------
SubprogramSymbol::SubprogramSymbol(symkind sk,string id,Typ* t,int ll)
:Sym(sk,id,t),lexicallevel(ll){elabel=L.New();splabel=L.New();eplabel=L.New();}