- debugmsg("constant printraw",LOGLEVEL_PRINT);
- os << "constant(" << name << ")";
-}
-
-void constant::printtree(ostream & os, unsigned indent) const
-{
- debugmsg("constant printtree",LOGLEVEL_PRINT);
- os << string(indent,' ') << name
- << ", type=" << typeid(*this).name()
- << ", hash=" << hashvalue << " (0x" << hex << hashvalue << dec << ")"
- << ", flags=" << flags << endl;
-}
-
-void constant::printcsrc(ostream & os, unsigned type, unsigned upper_precedence) const
-{
- debugmsg("constant print csrc",LOGLEVEL_PRINT);
- os << name;
+ if (is_a<print_tree>(c)) {
+ c.s << std::string(level, ' ') << name << " (" << class_name() << ")"
+ << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec
+ << std::endl;
+ } else if (is_a<print_latex>(c)) {
+ c.s << TeX_name;
+ } else if (is_a<print_python_repr>(c)) {
+ c.s << class_name() << "('" << name << "'";
+ if (TeX_name != "\\mbox{" + name + "}")
+ c.s << ",TeX_name='" << TeX_name << "'";
+ c.s << ')';
+ } else
+ c.s << name;