This is a a very large function and probably should be split into smaller chunks.
| 1351 | // This is a a very large function and probably should be split into |
| 1352 | // smaller chunks. |
| 1353 | UHDM::any *CompileHelper::compileExpression( |
| 1354 | DesignComponent *component, const FileContent *fC, NodeId parent, |
| 1355 | CompileDesign *compileDesign, Reduce reduce, UHDM::any *pexpr, |
| 1356 | ValuedComponentI *instance, bool muteErrors) { |
| 1357 | if (m_checkForLoops) { |
| 1358 | m_stackLevel++; |
| 1359 | } |
| 1360 | FileSystem *const fileSystem = FileSystem::getInstance(); |
| 1361 | UHDM::Serializer &s = compileDesign->getSerializer(); |
| 1362 | UHDM::any *result = nullptr; |
| 1363 | VObjectType parentType = fC->Type(parent); |
| 1364 | UHDM::VectorOfattribute *attributes = nullptr; |
| 1365 | if (parentType == VObjectType::paAttribute_instance) { |
| 1366 | attributes = |
| 1367 | compileAttributes(component, fC, parent, compileDesign, nullptr); |
| 1368 | while (fC->Type(parent) == VObjectType::paAttribute_instance) |
| 1369 | parent = fC->Sibling(parent); |
| 1370 | } |
| 1371 | parentType = fC->Type(parent); |
| 1372 | NodeId child = fC->Child(parent); |
| 1373 | VObjectType childType = VObjectType::sl_INVALID_; |
| 1374 | if (child) { |
| 1375 | childType = fC->Type(child); |
| 1376 | } |
| 1377 | switch (parentType) { |
| 1378 | case VObjectType::paIntegerAtomType_Byte: { |
| 1379 | result = s.MakeByte_var(); |
| 1380 | result->VpiParent(pexpr); |
| 1381 | break; |
| 1382 | } |
| 1383 | case VObjectType::paIntegerAtomType_Int: { |
| 1384 | result = s.MakeInt_var(); |
| 1385 | result->VpiParent(pexpr); |
| 1386 | break; |
| 1387 | } |
| 1388 | case VObjectType::paIntegerAtomType_Integer: { |
| 1389 | result = s.MakeInteger_var(); |
| 1390 | result->VpiParent(pexpr); |
| 1391 | break; |
| 1392 | } |
| 1393 | case VObjectType::paIntegerAtomType_LongInt: { |
| 1394 | result = s.MakeLong_int_var(); |
| 1395 | result->VpiParent(pexpr); |
| 1396 | break; |
| 1397 | } |
| 1398 | case VObjectType::paIntegerAtomType_Shortint: { |
| 1399 | result = s.MakeShort_int_var(); |
| 1400 | result->VpiParent(pexpr); |
| 1401 | break; |
| 1402 | } |
| 1403 | case VObjectType::paValue_range: { |
| 1404 | UHDM::operation *list_op = s.MakeOperation(); |
| 1405 | fC->populateCoreMembers(parent, parent, list_op); |
| 1406 | list_op->VpiOpType(vpiListOp); |
| 1407 | list_op->VpiParent(pexpr); |
| 1408 | UHDM::VectorOfany *operands = s.MakeAnyVec(); |
| 1409 | list_op->Operands(operands); |
| 1410 | NodeId lexpr = child; |