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 IRGenerator::accept(StringExpr& literal) { FNTRACE(); // loads a string literal result_ = get(literal.value()); }
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 << " }"; }
void ExprCompiler::visit(StringExpr& expr, int dest) { int index = chunk_->addConstant(new StringObject(expr.value())); write(expr, OP_CONSTANT, index, dest); }