/* Affichage d'un if then else */ void pprintIf(TreeP tree) { /* instruction if */ printIndentation(); printf("SI "); pprint(getChild(tree, 0)); printf(" ALORS\n"); /*debut du bloc d'instructions*/ indent++; pprint(getChild(tree, 1)); indent--; /* y a-t-il un bloc 'else' ? */ if(tree->nbChildren==3){ printf("\n"); printIndentation(); printf("SINON\n"); /* debut du bloc else */ indent++; pprint(getChild(tree, 2)); indent--; } /* fin du dernier bloc defini */ printf("\n"); printIndentation(); printf("FINDESI"); }
/* Affichage de la boucle faire - tantque */ void pprintFaireTantQue(TreeP tree) { printIndentation(); printf("FAIRE\n"); indent++; pprint(getChild(tree,0)); indent--; printf("\n"); printIndentation(); printf("TANTQUE "); pprint(getChild(tree,1)); printf("FINTANTQUE"); }
/* Affichage de la boucle pour */ void pprintPour(TreeP tree) { printIndentation(); printf("POUR %s ALLANT DE %d A %d FAIRE \n",getChild(tree, 0)->u.str, getChild(tree, 1)->u.val, getChild(tree, 2)->u.val); indent ++; pprint(getChild(tree, 3)); indent--; printf("\n"); printIndentation(); printf("FINPOUR"); }
ArrayFormatter::~ArrayFormatter() { if (used()) { stream().put('\n'); } printIndentation(indentLevel()); stream().put(']'); }
/* Affichage d'un PUT */ void pprintPUT(TreeP tree) { /* ecriture de la chaine de formattage */ printIndentation(); printf("ECRIRE("); pprint(getChild(tree,0)); printf(");"); }
void pprintAffectation(TreeP tree){ int old_indent = indent; printIndentation(); pprint(getChild(tree,0)); printf(" := "); indent = 0; pprint(getChild(tree,1)); indent = old_indent; if(getChild(tree, 1)->op != AFF) printf(";"); }
void Printer::printHexAddr(const void *address, const char *name) const { printIndentation(); if (name != NULL) { *d_stream_p << name << " = "; } Printer_Helper::print(*d_stream_p, address, -d_levelPlusOne, d_spacesPerLevel); }
void CqASCII::printRequest( const char *cp, EqFunctions ) { printIndentation(); OUT << cp; }