string TarsAnalyzer::tostrVector(const VectorPtr &pPtr) { //数组类型 if(pPtr->isArray()) { return tostr(pPtr->getTypePtr()); } //指针类型 if(pPtr->isPointer()) { return tostr(pPtr->getTypePtr())+" *"; } string s = Builtin::builtinTable[Builtin::KindVector] + string("<") + tostr(pPtr->getTypePtr()); if(MapPtr::dynamicCast(pPtr->getTypePtr()) || VectorPtr::dynamicCast(pPtr->getTypePtr())) { s += " >"; } else { s += ">"; } return s; }
/*******************************获取定长数组坐标********************************/ int Jce2Php::getSuffix(const TypeIdPtr &pPtr) const { BuiltinPtr bPtr = BuiltinPtr::dynamicCast(pPtr->getTypePtr()); if(bPtr && bPtr->kind() == Builtin::KindString && bPtr->isArray()) { return bPtr->getSize(); } VectorPtr vPtr = VectorPtr::dynamicCast(pPtr->getTypePtr()); if(vPtr && vPtr->isArray()) { return vPtr->getSize(); } return -1; }