当前位置: 首页>>代码示例>>C++>>正文


C++ Label::Print方法代码示例

本文整理汇总了C++中Label::Print方法的典型用法代码示例。如果您正苦于以下问题:C++ Label::Print方法的具体用法?C++ Label::Print怎么用?C++ Label::Print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Label的用法示例。


在下文中一共展示了Label::Print方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: subprogram_declaration

//---------------------------------------------------------------------
//---------------------------------------------------------------------
void subprogram_declaration(SubprogramSymbol* S,List<Exp*>* compound_statement)
{   //-----------------------------------------------------------------------
    //Create a list of expressions containing the subprogram prolog, the 
    //compound statement of the subprogram itself, and the subprogram epilog 
    //making the entire subprogram.
    //-----------------------------------------------------------------------
    //First, verify that all is well in the trace file for the prolog,
    //compound_statement, and the epilog.
    //-----------------------------------------------------------------------
    List<Exp*>* prolog=subprogram_prolog(S);
    o << endl << "prolog";
    prolog->Print(o);
    o << endl << "compound_statement";
    compound_statement->Print(o);
    List<Exp*>* epilog=subprogram_epilog(S,compound_statement);
    o << endl << "epilog";
    epilog->Print(o);
    //-----------------------------------------------------------------------
    //Now, concatenate the prolog, compound_statement, and the epilog into
    //a single list.
    //-----------------------------------------------------------------------
    List <Exp*>* L=new List<Exp*>;
    L->Append(prolog);
    L->Append(compound_statement);
    L->Append(epilog);
    //-----------------------------------------------------------------------
    //Now, print the subprogram to the PCode File
    //-----------------------------------------------------------------------
    L->Print(pfs);

    ST.Print(o);            //Print the symbol table at this lexical level
    ST.PopLocality();         //Pop the current locality
}
开发者ID:drenfro87,项目名称:TD,代码行数:35,代码来源:subprogram_declaration.cpp

示例2: program

//---------------------------------------------------------------------
//---------------------------------------------------------------------
void program(SubprogramSymbol* S,List<Exp*>* compound_statement)
{
    //-----------------------------------------------------------------------
    //First, verify that all is well in the trace file for the prolog,
    //compound_statement, and the epilog.
    //-----------------------------------------------------------------------
    List<Exp*>* prolog=subprogram_prolog(S);
    o << endl << "prolog";
    prolog->Print(o);

    o << endl << "compound_statement";
    compound_statement->Print(o);

    List<Exp*>* epilog=subprogram_epilog(S,compound_statement);
    o << endl << "epilog";
    epilog->Print(o);

    List<Exp*>* programepilog=program_epilog(S);
    o << endl << "program epilog";
    programepilog->Print(o);
    //-----------------------------------------------------------------------
    //Now, concatenate the prolog, compound_statement, and the epilog into
    //a single list.
    //-----------------------------------------------------------------------
    List <Exp*>* L=new List<Exp*>;
    L->Append(prolog);
    L->Append(compound_statement);
    L->Append(epilog);
    L->Append(programepilog);
    //-----------------------------------------------------------------------
    //Now, print the subprogram to the PCode File
    //-----------------------------------------------------------------------
    L->Print(pfs);


    ST.Print(o);            //Print Locality 1
    ST.PopLocality();
    ST.Print(o);            //Print Locality 0
}
开发者ID:drenfro87,项目名称:TD,代码行数:41,代码来源:program.cpp


注:本文中的Label::Print方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。