| 4133 | } |
| 4134 | |
| 4135 | const typespec *CompileHelper::getTypespec(DesignComponent *component, |
| 4136 | const FileContent *fC, NodeId id, |
| 4137 | CompileDesign *compileDesign, |
| 4138 | Reduce reduce, |
| 4139 | ValuedComponentI *instance) { |
| 4140 | if (loopDetected(fC->getFileId(), fC->Line(id), compileDesign, instance)) { |
| 4141 | return nullptr; |
| 4142 | } |
| 4143 | UHDM::Serializer &s = compileDesign->getSerializer(); |
| 4144 | const DataType *dtype = nullptr; |
| 4145 | const typespec *result = nullptr; |
| 4146 | std::string basename; |
| 4147 | std::vector<std::string> suffixnames; |
| 4148 | switch (fC->Type(id)) { |
| 4149 | case VObjectType::paIntegerAtomType_Byte: { |
| 4150 | result = s.MakeByte_typespec(); |
| 4151 | break; |
| 4152 | } |
| 4153 | case VObjectType::paIntegerAtomType_Int: { |
| 4154 | result = s.MakeInt_typespec(); |
| 4155 | break; |
| 4156 | } |
| 4157 | case VObjectType::paIntegerAtomType_Integer: { |
| 4158 | result = s.MakeInteger_typespec(); |
| 4159 | break; |
| 4160 | } |
| 4161 | case VObjectType::paIntegerAtomType_LongInt: { |
| 4162 | result = s.MakeLong_int_typespec(); |
| 4163 | break; |
| 4164 | } |
| 4165 | case VObjectType::paIntegerAtomType_Shortint: { |
| 4166 | result = s.MakeShort_int_typespec(); |
| 4167 | break; |
| 4168 | } |
| 4169 | case VObjectType::paIntegerAtomType_Time: { |
| 4170 | result = s.MakeTime_typespec(); |
| 4171 | break; |
| 4172 | } |
| 4173 | case VObjectType::slStringConst: { |
| 4174 | basename = fC->SymName(id); |
| 4175 | NodeId suffix = fC->Sibling(id); |
| 4176 | while (suffix && (fC->Type(suffix) == VObjectType::slStringConst)) { |
| 4177 | suffixnames.emplace_back(fC->SymName(suffix)); |
| 4178 | suffix = fC->Sibling(suffix); |
| 4179 | } |
| 4180 | break; |
| 4181 | } |
| 4182 | case VObjectType::paComplex_func_call: { |
| 4183 | UHDM::any *exp = |
| 4184 | compileExpression(component, fC, fC->Parent(id), compileDesign, |
| 4185 | reduce, nullptr, instance, false); |
| 4186 | if (exp) { |
| 4187 | if (exp->UhdmType() == uhdmhier_path) { |
| 4188 | bool invalidValue = false; |
| 4189 | result = (typespec *)decodeHierPath( |
| 4190 | (hier_path *)exp, invalidValue, component, compileDesign, reduce, |
| 4191 | instance, fC->getFileId(), fC->Line(id), nullptr, false, true); |
| 4192 | } else if (exp->UhdmType() == uhdmbit_select) { |
no test coverage detected