virtual void print(std::ostream &os) const { table->print(os); StringExpr *field = dynamic_cast<StringExpr *>(index); if (field != NULL && field->validIdentifier()) os << "." << field->text->str; else os << "[" << *index << "]"; }
void print(std::ostream &os) const { os << "{"; mapping_list::const_iterator i = mappings.begin(); while (i != mappings.end()) { if (i->first != NULL) { StringExpr *field = dynamic_cast<StringExpr *>(i->first); if (field != NULL && field->validIdentifier()) os << " " << field->text->str; else os << " [" << *i->first << "]"; os << " ="; } os << " " << *i->second; i++; if (i != mappings.end()) os << ","; } os << " }"; }