本文整理汇总了C++中MapInfo::getAttr方法的典型用法代码示例。如果您正苦于以下问题:C++ MapInfo::getAttr方法的具体用法?C++ MapInfo::getAttr怎么用?C++ MapInfo::getAttr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapInfo
的用法示例。
在下文中一共展示了MapInfo::getAttr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: codeGen
short Assign::codeGen(Generator * generator)
{
Attributes ** attr;
// If this Assign has already been codeGenned, then bug out early.
//
MapInfo * assignMapInfo = generator->getMapInfoAsIs(getValueId());
if (assignMapInfo && assignMapInfo->isCodeGenerated())
return 0;
// If the left child (lvalue) is already in the map table, then
// add the Assign value Id to the map table with the same attributes
// as the let child. Mark the Assign node as codeGenned. Also, allocate
// space for the attributes.
//
MapInfo *leftChildMapInfo = generator->getMapInfoAsIs
(child(0)->castToItemExpr()->getValueId());
if (leftChildMapInfo)
{
if (! assignMapInfo)
assignMapInfo =
generator->addMapInfoToThis(generator->getLastMapTable(),
getValueId(),
leftChildMapInfo->getAttr());
assignMapInfo->codeGenerated();
attr = new(generator->wHeap()) Attributes*[2];
// Set the result attribute
//
attr[0] = assignMapInfo->getAttr();
}
// Otherwise, go ahead and generate the Assign attributes (which also
// allocates space for the Assign result). Add the left child to the
// map table with the same attributes as the Assign node.
//
else
{
generator->getExpGenerator()->genItemExpr(this, &attr, 2, 0);
generator->addMapInfoToThis(generator->getLastMapTable(),
child(0)->castToItemExpr()->getValueId(),
attr[0]);
}
attr[0]->resetShowplan();
// Now, generate code for the right child (rvalue).
//
generator->getExpGenerator()->setClauseLinked(FALSE);
child(1)->codeGen(generator);
attr[1] = generator->getAttr(child(1));
generator->getExpGenerator()->setClauseLinked(FALSE);
ex_conv_clause * conv_clause =
new(generator->getSpace()) ex_conv_clause
(getOperatorType(), attr, generator->getSpace());
generator->getExpGenerator()->linkClause(this, conv_clause);
return 0;
}