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); }
void NassiSwitchBrick::SaveSource(wxTextOutputStream &text_stream, wxUint32 n) { SaveCommentString(text_stream, Comment, n); const wxString srce = _T("switch ( ") + Source + _T(" )\n{"); SaveSourceString(text_stream, srce, n); for ( wxUint32 i = 0 ; i < GetChildCount(); i++ ) { NassiBrick *child = GetChild(i); const wxString cmt(*GetTextByNumber((i+1)*2)); wxString src = *GetTextByNumber((i+1)*2+1); if ( src.StartsWith( _T("default") ) ) src = _T("default:"); else src = _T("case ") + src + _T(":"); SaveCommentString(text_stream, cmt, n); SaveSourceString(text_stream, src, n); if ( child ) child->SaveSource(text_stream, n+4); } SaveSourceString(text_stream, _T("}"), n); NassiBrick::SaveSource(text_stream, n); }
void NassiBlockBrick::SaveSource(wxTextOutputStream &text_stream, wxUint32 n) { SaveCommentString(text_stream, Comment, n); //SaveSourceString(text_stream, Source, n); SaveSourceString(text_stream, _T("{"), n); NassiBrick *child = GetChild(0); if ( child ) child->SaveSource(text_stream, n+4); SaveSourceString(text_stream, _T("}"), n); NassiBrick::SaveSource(text_stream, n); }
void NassiWhileBrick::SaveSource(wxTextOutputStream &text_stream, wxUint32 n) { SaveCommentString(text_stream, Comment, n); wxString src = _T("while ") + Source; SaveSourceString(text_stream,src, n); 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); NassiBrick::SaveSource(text_stream, n); }
void NassiBrick::SaveSource(wxTextOutputStream &text_stream, wxUint32 n) { NassiBrick *next = GetNext(); if ( next ) next->SaveSource(text_stream, n); }