void NodeStatements::updateLineage(NNO pno) { setYourParentNo(pno); if(m_node) m_node->updateLineage(getNodeNo()); if(m_nodeNext) m_nodeNext->updateLineage(getNodeNo()); } //updateLineage
UTI NodeBinaryOpArithRemainder::castThyselfToResultType(UTI rt, UTI lt, UTI newType) { UTI nuti = newType; //because the result bitsize for mod should be the right bitsize // create a cast! combining newType's base type and right resultbitsize. // could be the same, or "unsafe". if(m_state.okUTItoContinue(newType) && m_state.isComplete(newType)) { UlamType * newut = m_state.getUlamTypeByIndex(newType); ULAMTYPE typEnum = newut->getUlamTypeEnum(); u32 convertSize = m_state.getUlamTypeByIndex(rt)->bitsizeToConvertTypeTo(typEnum); u32 enumStrIdx = m_state.m_pool.getIndexForDataString(UlamType::getUlamTypeEnumAsString(typEnum)); UlamKeyTypeSignature tokey(enumStrIdx, convertSize, NONARRAYSIZE); ULAMCLASSTYPE newclasstype = newut->getUlamClassType(); nuti = m_state.makeUlamType(tokey, typEnum, newclasstype); if(UlamType::compareForMakingCastingNode(nuti, newType, m_state) != UTIC_SAME) //not same, or dontknow { NNO pno = Node::getYourParentNo(); //save assert(pno); //not using use makeCastingNode since don't want recursive c&l call Node * castNode = Node::newCastingNode(this, nuti); Node * parentNode = m_state.findNodeNoInThisClass(pno); if(!parentNode) { std::ostringstream msg; msg << "Remainder cast cannot be exchanged at this time while compiling class: "; msg << m_state.getUlamTypeNameBriefByIndex(m_state.getCompileThisIdx()).c_str(); msg << " Parent required"; MSG(getNodeLocationAsString().c_str(), msg.str().c_str(), DEBUG); assert(0); //parent required } AssertBool swapOk = parentNode->exchangeKids(this, castNode); assert(swapOk); std::ostringstream msg; msg << "Exchanged kids! of parent of binary operator" << getName(); msg << ", with a cast to type: "; msg << m_state.getUlamTypeNameBriefByIndex(nuti).c_str(); msg << " while compiling class: "; msg << m_state.getUlamTypeNameBriefByIndex(m_state.getCompileThisIdx()).c_str(); MSG(getNodeLocationAsString().c_str(), msg.str().c_str(), DEBUG); castNode->setYourParentNo(pno); //inverts normal update lineage setYourParentNo(castNode->getNodeNo()); } } return nuti; } //castThyselfToResultType
void NodeBlock::updateLineage(NNO pno) { if(getPreviousBlockPointer() == NULL) { setPreviousBlockPointer(m_state.getCurrentBlock()); } else assert(getPreviousBlockPointer() == m_state.getCurrentBlock()); m_state.pushCurrentBlock(this); setYourParentNo(pno); //has no m_node if(m_nodeNext) m_nodeNext->updateLineage(getNodeNo()); m_state.popClassContext(); //restores previousBlockNode } //updateLineage
void NodeUnaryOp::updateLineage(NNO pno) { setYourParentNo(pno); m_node->updateLineage(getNodeNo()); }
void NodeTypeDescriptorSelect::updateLineage(NNO pno) { setYourParentNo(pno); if(m_nodeSelect) m_nodeSelect->updateLineage(getNodeNo()); } //updateLineage
void NodeControl::updateLineage(NNO pno) { setYourParentNo(pno); m_nodeCondition->updateLineage(getNodeNo()); m_nodeBody->updateLineage(getNodeNo()); } //updateLineage
void NodeStatementEmpty::updateLineage(NNO pno) { setYourParentNo(pno); } //updateLineage