Beispiel #1
0
/* 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");

}
Beispiel #2
0
/* 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");
}
Beispiel #3
0
/* 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(']');
}
Beispiel #5
0
/* Affichage d'un PUT */
void pprintPUT(TreeP tree) {
  
  /* ecriture de la chaine de formattage */
  printIndentation();
  printf("ECRIRE(");
  pprint(getChild(tree,0));
  printf(");");

}
Beispiel #6
0
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(";");
}
Beispiel #7
0
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);
}
Beispiel #8
0
void CqASCII::printRequest( const char *cp, EqFunctions )
{
	printIndentation();
	OUT << cp;
}