void be_sequence::GenerateAuxTypes (be_ClientHeader & source) { ostream & os = source.Stream(); be_Tab tab(source); DDS_StdString baseName = BaseTypeName (); DDS_StdString seqName = localName; DDS_StdString varName = localName + "_var"; DDS_StdString outName = localName + "_out"; DDS_StdString templateBase = "DDS_DCPSSequence"; pbbool wideString = pbfalse; if (isStringSeq) { AST_Type* astbt = be_typedef::_astBase (base_type ()); be_string* sbt = be_string::_narrow (astbt); wideString = sbt->IsWide (); } if (isStringSeq && !IsBounded ()) { templateBase = wideString ? "DDS_DCPSUWStrSeq" : "DDS_DCPSUStrSeq"; } os << tab << "typedef " << templateBase << "_var < " << seqName << "> " << varName << ";" << nl; os << tab << "typedef " << templateBase << "_out < " << seqName << "> " << outName << ";" << nl; }
string Value::ToString(ValueType vtype, PrintPrefs &pp) const { if (IsRefNil(vtype)) return ref_ ? ref_->ToString(pp) : "nil"; switch (vtype) { case V_INT: return to_string(ival()); case V_FLOAT: return to_string_float(fval(), pp.decimals); case V_FUNCTION: return "<FUNCTION>"; default: return string("(") + BaseTypeName(vtype) + ")"; } }
string RefObj::ToString(PrintPrefs &pp) const { if (!this) return "nil"; switch (ti.t) { case V_BOXEDINT: { auto s = to_string(((BoxedInt *)this)->val); return pp.anymark ? "#" + s : s; } case V_BOXEDFLOAT: { auto s = to_string_float(((BoxedFloat *)this)->val, pp.decimals); return pp.anymark ? "#" + s : s; } case V_STRING: return ((LString *)this)->ToString(pp); case V_COROUTINE: return "(coroutine)"; case V_VECTOR: case V_STRUCT: return ((ElemObj *)this)->ToString(pp); default: return string("(") + BaseTypeName(ti.t) + ")"; } }
void ISymbol::MergeTypeInfo(ISymbolPtr c) { c->TypeName() = Name(); // Ignore, Name(), Namespace(), and Type() c->Abstract() = Abstract(); c->Atomic() = Atomic(); c->Attributes() = Attributes(); c->BaseTypeName() = BaseTypeName(); c->Compositor() = Compositor(); c->DerivedType() = DerivedType(); c->Enumerations() = Enumerations(); c->FacetKinds() = FacetKinds(); c->Facets() = Facets(); c->Global() = Global(); c->Level() = Level(); c->List() = List(); c->ListSize() = ListSize(); c->ListType() = ListType(); c->Optional() = Optional(); c->Parent() = Parent(); c->Parsed() = Parsed(); c->PrimitiveType() = PrimitiveType(); c->Required() = Required(); c->SimpleContent() = SimpleContent(); c->SimpleType() = SimpleType(); c->SqlCount() = SqlCount(); c->SqlType() = SqlType(); c->SubstitutionGroupAffiliation() = SubstitutionGroupAffiliation(); c->SubstitutionList() = SubstitutionList(); c->SubTypes() = SubTypes(); c->SuperTypes() = SuperTypes(); c->Variable() = Variable(); c->Visited() = Visited(); c->XercesType() = XercesType(); // These are element particle definitions // c->Dimension() = Dimension(); // always 1 //c->LowerBounds() = LowerBounds(); //c->UpperBounds() = UpperBounds(); //c->OuterElementName() = OuterElementName(); // c->OuterElementTypeName() = OuterElementTypeName(); }
void ISymbol::DeepCopy(ISymbolPtr c) { c->Name()=Name(); c->Abstract() = Abstract(); c->Atomic() = Atomic(); c->Attributes() = Attributes(); c->BaseTypeName() = BaseTypeName(); c->Compositor() = Compositor(); c->DerivedType() = DerivedType(); c->Dimension() = Dimension(); c->Enumerations() = Enumerations(); c->FacetKinds() = FacetKinds(); c->Facets() = Facets(); c->Global() = Global(); c->Level() = Level(); c->List() = List(); c->ListSize() = ListSize(); c->ListType() = ListType(); c->LowerBounds() = LowerBounds(); c->Namespace() = Namespace(); c->Optional() = Optional(); c->OuterElementName() = OuterElementName(); c->OuterElementTypeName() = OuterElementTypeName(); c->Parent() = Parent(); c->Parsed() = Parsed(); c->PrimitiveType() = PrimitiveType(); c->Required() = Required(); c->SimpleContent() = SimpleContent(); c->SimpleType() = SimpleType(); c->SqlCount() = SqlCount(); c->SqlType() = SqlType(); c->SubstitutionGroupAffiliation() = SubstitutionGroupAffiliation(); c->SubstitutionList() = SubstitutionList(); c->SubTypes() = SubTypes(); c->SuperTypes() = SuperTypes(); c->Type() = Type(); c->TypeName() = TypeName(); c->UpperBounds() = UpperBounds(); c->Variable() = Variable(); c->Visited() = Visited(); c->XercesType() = XercesType(); }
string TypeInfo::Debug(bool rec) const { string s = BaseTypeName(t); if (t == V_VECTOR || t == V_NIL) { s += "[" + g_vm->GetTypeInfo(subt).Debug(false) + "]"; } else if (t == V_STRUCT) { auto sname = g_vm->StructName(*this); s += ":" + sname; if (rec) { s += "{"; for (int i = 0; i < len; i++) s += g_vm->GetTypeInfo(elems[i]).Debug(false) + ","; s += "}"; } } return s; }