| 502 | } |
| 503 | |
| 504 | void JavaGenerator::makeConstTemplateData() |
| 505 | { |
| 506 | Log::info("Constant globals:\n"); |
| 507 | data_list consts; |
| 508 | for (auto it : m_globals->getSymbolsOfType(Symbol::symbol_type_t::kConstSymbol)) |
| 509 | { |
| 510 | ConstType *constVar = dynamic_cast<ConstType *>(it); |
| 511 | assert(constVar); |
| 512 | data_map constInfo; |
| 513 | if (!findAnnotation(constVar, EXTERNAL_ANNOTATION)) |
| 514 | { |
| 515 | constInfo["name"] = getOutputName(constVar); |
| 516 | constInfo["type"] = getTypeInfo(constVar->getDataType(), false, false); |
| 517 | // throw nullptr exception |
| 518 | if (NULL == constVar->getValue()) |
| 519 | { |
| 520 | Log::info("const pointing to null Value object\n"); |
| 521 | } |
| 522 | if (kStringValue == constVar->getValue()->getType()) |
| 523 | { |
| 524 | constInfo["value"] = "\"" + constVar->getValue()->toString() + "\""; |
| 525 | } |
| 526 | else |
| 527 | { |
| 528 | constInfo["value"] = constVar->getValue()->toString(); |
| 529 | } |
| 530 | setTemplateComments(constVar, constInfo); |
| 531 | Log::info("Name=%s\tType=%s\tValue=%s\n", constVar->getName().c_str(), |
| 532 | constVar->getDataType()->getName().c_str(), constVar->getValue()->toString().c_str()); |
| 533 | consts.push_back(constInfo); |
| 534 | } |
| 535 | } |
| 536 | m_templateData["consts"] = consts; |
| 537 | } |
| 538 | |
| 539 | void JavaGenerator::makeEnumsTemplateData() |
| 540 | { |
nothing calls this directly
no test coverage detected