- debugmsg("symbol duplicate", LOGLEVEL_DUPLICATE);
- return new symbol(*this);
-}
-
-void symbol::print(std::ostream & os, unsigned upper_precedence) const
-{
- debugmsg("symbol print",LOGLEVEL_PRINT);
- os << name;
-}
-
-void symbol::printraw(std::ostream & os) const
-{
- debugmsg("symbol printraw",LOGLEVEL_PRINT);
- os << class_name() << "(" << "name=" << name << ",serial=" << serial
- << ",hash=" << hashvalue << ",flags=" << flags << ")";
-}
-
-void symbol::printtree(std::ostream & os, unsigned indent) const
-{
- debugmsg("symbol printtree",LOGLEVEL_PRINT);
- os << std::string(indent,' ') << name << " (symbol): "
- << "serial=" << serial
- << ", hash=" << hashvalue
- << " (0x" << std::hex << hashvalue << std::dec << ")"
- << ", flags=" << flags << std::endl;
-}
-
-void symbol::printcsrc(std::ostream & os, unsigned type, unsigned upper_precedence) const
-{
- debugmsg("symbol print csrc", LOGLEVEL_PRINT);
- os << name;
+ if (is_a<print_tree>(c)) {
+
+ c.s << std::string(level, ' ') << name << " (" << class_name() << ")"
+ << ", serial=" << serial
+ << 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 != default_TeX_name())
+ c.s << "','" << TeX_name;
+ c.s << "')";
+ } else
+ c.s << name;