Exemple #1
0
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);
}
Exemple #2
0
void NassiIfBrick::GetStrukTeX(wxString &str, wxUint32 n = 0)
{
    for ( wxUint32 i = 0 ; i < n ; i++ )
        str += _T(" ");
    str += _T("\\ifthenelse{3}{3}");
    str += (_T("{") + *(GetTextByNumber(0)) + _T("}"));
    str += (_T("{") + *(GetTextByNumber(2)) + _T("}"));
    str += (_T("{") + *(GetTextByNumber(4)) + _T("}\n"));

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

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

    child = GetChild(1);
    if ( child )
        child->GetStrukTeX(str, n+2);

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

    NassiBrick *next = GetNext();
    if ( next )
        next->GetStrukTeX(str, n);
}
Exemple #3
0
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);
}
Exemple #4
0
void NassiContinueBrick::GetStrukTeX(wxString &str, wxUint32 n = 0)
{
    /// is not siported by struktex
    NassiBrick *next = GetNext();
    if ( next )
        next->GetStrukTeX(str, n);
}
Exemple #5
0
void NassiWhileBrick::GetStrukTeX(wxString &str, wxUint32 n = 0)
{
    for ( wxUint32 i = 0 ; i < n ; i++ )
        str += _T(" ");
    str += _T("\\while{");
    str += *(GetTextByNumber(0));
    str += _T("}\n");

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

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

    NassiBrick *next = GetNext();
    if ( next )
        next->GetStrukTeX(str, n);
}
Exemple #6
0
void NassiBreakBrick::GetStrukTeX(wxString &str, wxUint32 n = 0)
{
    for ( wxUint32 i = 0 ; i < n ; i++ )
        str += _T(" ");
    str += _T("\\exit{");
    str += *(GetTextByNumber(0));
    str += _T("}\n");

    NassiBrick *next = GetNext();
    if ( next )
        next->GetStrukTeX(str, n);
}
Exemple #7
0
void NassiForBrick::GetStrukTeX(wxString &str, wxUint32 n = 0)
{
    ///instruction
    for ( wxUint32 i = 0 ; i < n ; i++ )
        str += _T(" ");
    str += _T("\\assign{");
    str += *(GetTextByNumber(2)); //init comment
    str += _T("}\n");

    ///loop
    for ( wxUint32 i = 0 ; i < n ; i++ )
        str += _T(" ");
    str += _T("\\while{");
    str += *(GetTextByNumber(0)); //main comment
    str += _T("}\n");

    ///child
    NassiBrick *child = GetChild(0);
    if ( child )
        child->GetStrukTeX(str, n+2);
    ///instruction at end
    for (wxUint32 i = 0 ; i < n+2 ; i++ )
        str+= _T(" ");
    str+= _T("\\assign{");
    str += *(GetTextByNumber(4)); //inst comment
    str += _T("}\n");

    ///end of loop
    for ( wxUint32 i = 0 ; i < n ; i++ )
        str += _T(" ");
    str += _T("\\whileend\n");

    ///next brick
    NassiBrick *next = GetNext();
    if ( next )
        next->GetStrukTeX(str, n);
}
Exemple #8
0
void NassiBrick::GetStrukTeX(wxString &str, wxUint32 n = 0)
{
    NassiBrick *next = GetNext();
    if ( next )
        next->GetStrukTeX(str, n);
}