예제 #1
0
파일: Main.cpp 프로젝트: bholl/zeroc-ice
void
CodeVisitor::visitConst(const ConstPtr& p)
{
    string name = getName(p);
    string type = getTypeVar(p);
    string abs = getAbsolute(p, _ns);

    startNamespace(p);

    _out << sp << nl << "if(!defined('" << escapeName(abs) << "'))";
    _out << sb;
    if(_ns)
    {
        _out << sp << nl << "define(__NAMESPACE__ . '\\\\" << name << "', ";
    }
    else
    {
        _out << sp << nl << "define('" << name << "', ";
    }

    writeConstantValue(p->type(), p->valueType(), p->value());

    _out << ");";
    _out << eb;

    endNamespace();
}
예제 #2
0
void
Slice::Ruby::CodeVisitor::visitConst(const ConstPtr& p)
{
    Slice::TypePtr type = p->type();
    string name = fixIdent(p->name(), IdentToUpper);

    _out << sp << nl << name << " = ";
    writeConstantValue(type, p->valueType(), p->value());
}
예제 #3
0
파일: Checksum.cpp 프로젝트: wuhua988/icm
void Slice::ChecksumVisitor::visitConst(const ConstPtr& p)
{
  ostringstream ostr;
  ostr << "const " << typeToString(p->type()) << ' ' << p->name() << " = " << p->value() << endl;
  updateMap(p->scoped(), ostr.str());
}