Exemplo n.º 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");

}
Exemplo n.º 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");
}
Exemplo n.º 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");
}
Exemplo n.º 4
0
ArrayFormatter::~ArrayFormatter()
{
    if (used()) {
        stream().put('\n');
    }
    printIndentation(indentLevel());
    stream().put(']');
}
Exemplo n.º 5
0
/* Affichage d'un PUT */
void pprintPUT(TreeP tree) {
  
  /* ecriture de la chaine de formattage */
  printIndentation();
  printf("ECRIRE(");
  pprint(getChild(tree,0));
  printf(");");

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