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


C++ NassiBrick类代码示例

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


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

示例1: _T

void NassiSwitchBrick::GetStrukTeX(wxString &str, wxUint32 n = 0)
{
    for ( wxUint32 i = 0 ; i < n ; i++ )
        str += _T(" ");
    str += _T("\\case{4}");
    str += _T("{") + wxString::Format(_T("%d"), GetChildCount()) + _T("}");
    str += _T("{") + *(GetTextByNumber(0)) + _T("}");
    str += _T("{") + *(GetTextByNumber(2)) + _T("}\n");

    NassiBrick *child = GetChild(0);
    if ( child )
        child->GetStrukTeX(str, n+2);

    for ( wxUint32 i = 1 ; i < GetChildCount() ; i++ )
    {
        for ( wxUint32 k = 0 ; k < n ; k++ )
            str += _T(" ");
        str += _T("\\switch{") + *(GetTextByNumber(2*(i+1))) + _T("}\n");
        child = GetChild(i);
        if ( child )
            child->GetStrukTeX(str, n+2);
    }

    for ( wxUint32 i = 0 ; i < n ; i++ )
        str += _T(" ");
    str += _T("\\caseend\n");

    NassiBrick *next = GetNext();
    if ( next )
        next->GetStrukTeX(str, n);
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:31,代码来源:bricks.cpp

示例2: SaveCommentString

void NassiIfBrick::SaveSource(wxTextOutputStream &text_stream, wxUint32 n)
{
    SaveCommentString(text_stream, Comment, n);

    wxString src = _T("if ") + Source;
    SaveSourceString(text_stream, src, n);

    SaveCommentString(text_stream, TrueCommentText, n+4);

    NassiBrick *child = GetChild(0);
    if ( child )
    {
        SaveSourceString(text_stream, _T("{"), n);
        child->SaveSource(text_stream, n+4);
        SaveSourceString(text_stream, _T("}"), n);
    }
    else
        SaveSourceString(text_stream, _T(";"), n+4);

    child = GetChild(1);
    if ( child )
    {
        SaveSourceString(text_stream, _T("else\n{"), n);

        SaveCommentString(text_stream, FalseCommentText, n+4);
        child->SaveSource(text_stream, n+4);

        SaveSourceString(text_stream, _T("}"), n);
    }


    NassiBrick::SaveSource(text_stream, n);
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:33,代码来源:bricks.cpp

示例3: GetNext

void NassiContinueBrick::GetStrukTeX(wxString &str, wxUint32 n = 0)
{
    /// is not siported by struktex
    NassiBrick *next = GetNext();
    if ( next )
        next->GetStrukTeX(str, n);
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:7,代码来源:bricks.cpp

示例4: GetChild

void NassiBlockBrick::GetStrukTeX(wxString &str, wxUint32 n = 0)
{
    NassiBrick *child = GetChild(0);
    if ( child )
        child->GetStrukTeX(str, n);

    NassiBrick *next = GetNext();
    if ( next )
        next->GetStrukTeX(str, n);
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:10,代码来源:bricks.cpp

示例5: operator

void CreateNassiIfThenText::operator() ( wxChar const * /*first*/, wxChar const * /*last*/ ) const
{
    NassiBrick *parent;
    parent = m_brick->GetParent();

    parent->SetTextByNumber(m_c_str, 2);
    parent->SetTextByNumber(m_s_str, 3);
    m_c_str.clear();
    m_s_str.clear();
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:10,代码来源:parseactions.cpp

示例6: NassiSwitchBrick

void CreateNassiSwitchBrick::operator() ( wxChar const * /*first*/, wxChar const * /*last*/ ) const
{
    NassiBrick *brick = new NassiSwitchBrick();
    m_brick->SetNext(brick);
    brick->SetTextByNumber(m_c_str, 0);
    brick->SetTextByNumber(m_s_str, 1);
    m_c_str.clear();
    m_s_str.clear();
    m_brick = brick;
    brick = new NassiInstructionBrick();
    m_brick->AddChild(0);
    m_brick->SetChild(brick, 0);
    m_brick = brick;
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:14,代码来源:parseactions.cpp

示例7: NassiWhileBrick

//void CreateNassiWhileBrick::operator()(iterator_t first, iterator_t const& last)const
void CreateNassiWhileBrick::operator() ( wxChar const *first, wxChar const *last ) const
{
    NassiBrick *brick = new NassiWhileBrick();
    m_brick->SetNext( brick );
    brick->SetTextByNumber(m_c_str, 0);
    brick->SetTextByNumber(m_s_str, 1);
    m_c_str.clear();
    m_s_str.clear();
    m_brick = brick;

    brick = new NassiInstructionBrick();
    m_brick->SetChild(brick);
    m_brick = brick;
}
开发者ID:BackupTheBerlios,项目名称:nassiplugin-svn,代码行数:15,代码来源:parseactions.cpp

示例8: NassiSwitchBrick

//void CreateNassiSwitchBrick::operator()(iterator_t first, iterator_t const& last)const
void CreateNassiSwitchBrick::operator() ( wxChar const *first, wxChar const *last ) const
{
    NassiBrick *brick = new NassiSwitchBrick();
    m_brick->SetNext(brick);
    brick->SetTextByNumber(m_c_str, 0);
    brick->SetTextByNumber(m_s_str, 1);
    m_c_str.clear();
    m_s_str.clear();
    m_brick = brick;
    brick = new NassiInstructionBrick();
    m_brick->AddChild(0);
    m_brick->SetChild(brick, 0);
    m_brick = brick;
    //wxMessageBox(_T("Switch brick"), _T("Created:"));
}
开发者ID:BackupTheBerlios,项目名称:nassiplugin-svn,代码行数:16,代码来源:parseactions.cpp

示例9: NassiBlockBrick

void CreateNassiBlockBrick::DoCreate() const
{
    NassiBrick *brick = new NassiBlockBrick();
    m_brick->SetNext( brick );
    brick->SetTextByNumber(m_c_str, 0);
    brick->SetTextByNumber(m_s_str, 1);
    m_c_str.clear();
    m_s_str.clear();
    m_brick = brick;

    brick = new NassiInstructionBrick();
    brick->SetTextByNumber( _("created by CreateNassiBlockBrick"), 0);
    m_brick->SetChild(brick);
    m_brick = brick;
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:15,代码来源:parseactions.cpp

示例10: inp

//static
NassiBrick *NassiBrick::SetData(wxInputStream &stream)
{
    wxUint32 n;
    NassiBrick *brick;
    wxTextInputStream inp(stream);
    inp >> n;
    switch ( n )
    {
        case NASSI_BRICK_INSTRUCTION:
            brick = new NassiInstructionBrick();
            break;
        case NASSI_BRICK_CONTINUE:
            brick = new NassiContinueBrick();
            break;
        case NASSI_BRICK_BREAK:
            brick = new NassiBreakBrick();
            break;
        case NASSI_BRICK_RETURN:
            brick = new NassiReturnBrick();
            break;
        case NASSI_BRICK_WHILE:
            brick = new NassiWhileBrick();
            break;
        case NASSI_BRICK_DOWHILE:
            brick = new NassiDoWhileBrick();
            break;
        case NASSI_BRICK_FOR:
            brick = new NassiForBrick();
            break;
        case NASSI_BRICK_BLOCK:
            brick = new NassiBlockBrick();
            break;
        case NASSI_BRICK_IF:
            brick = new NassiIfBrick();
            break;
        case NASSI_BRICK_SWITCH:
            brick = new NassiSwitchBrick();
            break;
        case NASSI_BRICK_ESC:
        default:
            brick = nullptr;
    }
    if ( brick )
        brick->Deserialize(stream);
    return ( brick );
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:47,代码来源:bricks.cpp

示例11: NassiIfBrick

//void CreateNassiIfBrick::operator()(iterator_t first, iterator_t const& last)const
void CreateNassiIfBrick::operator() ( wxChar const *first, wxChar const *last ) const
{
    //wxMessageDialog dlg(NULL, _T("open begin"), _T("test"));
    //dlg.ShowModal();
    NassiBrick *brick = new NassiIfBrick();
    m_brick->SetNext( brick );
    brick->SetTextByNumber(m_c_str, 0);
    brick->SetTextByNumber(m_s_str, 1);
    m_c_str.clear();
    m_s_str.clear();
    m_brick = brick;

    brick = new NassiInstructionBrick();
    m_brick->SetChild(brick, 0);
    m_brick = brick;
    //wxMessageDialog dlg2(NULL, _T("open end"), _T("test"));
    //dlg2.ShowModal();
}
开发者ID:BackupTheBerlios,项目名称:nassiplugin-svn,代码行数:19,代码来源:parseactions.cpp


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