Tiger est un langage informatique, et non l'animal correspondant!

FAQ Tiger Compiler Project

Section générale sur Tiger

3.3.4 - Modifications dans le fichier print-visitor.hh (pour passer les tests 12 et 50):
//------ CUT HERE----------------------------
public:
PrintVisitor (std::ostream& ostr, bool display_escapes_p = false) :
DefaultVisitor (),
_ostr (ostr),
_display_escapes_p (display_escapes_p),
_tab (0) /* here is da modif ... */


// --------------------------------

(vers la fin ... )

//------ CUT HERE-------------------
/*-------------------.
| Indentation code. |
`-------------------*/
protected:
int _tab;
void _inc ()
{
++_tab;
}
void _dec ()
{
--_tab;
assert (_tab >= 0);
}
void _endl ()
{
const unsigned tab_len = 3;
_ostr << endl;
for (unsigned i = 0; i < tab_len * _tab; ++i)
_ostr << ' ';
}
void _inc_endl ()
{
_inc (); _endl ();
}
void _dec_endl ()
{
_dec (); _endl ();
}
};

}

//-----------------------------------



Merci ŕ tous les participants de cette FAQ sur Tiger: notre professeur Akim Demaille,
Sébastien Moncel et Arnaud Meyer, ingénieur informatique EPITA promo 2003.

Valid XHTML 1.0!   Valid CSS!