示例#1
0
void HqlCppLibrary::extractOutputs()
{
    HqlExprArray symbols;
    scopeExpr->queryScope()->getSymbols(symbols);

    IHqlScope * scope = scopeExpr->queryScope();
    HqlDummyLookupContext dummyctx(NULL);
    ForEachItemIn(i, symbols)
    {
        IHqlExpression & cur = symbols.item(i);
        if (isExported(&cur))
        {
            _ATOM name = cur.queryName();
            OwnedHqlExpr value = scope->lookupSymbol(name, LSFpublic, dummyctx);

            if (value && !value->isFunction())
            {
                if (value->isDataset() || value->isDatarow() || value->queryType()->isScalar())
                {
                    OwnedHqlExpr null = createNullExpr(value);
                    outputs.append(*cur.cloneAllAnnotations(null));
                }
            }
        }
    }
示例#2
0
void CChildLinkedDatasetColumnInfo::setColumn(HqlCppTranslator & translator, BuildCtx & ctx, IReferenceSelector * selector, IHqlExpression * _value)
{
    OwnedHqlExpr addressSize = getColumnAddress(translator, ctx, selector, sizetType, 0);
    OwnedHqlExpr addressData = getColumnAddress(translator, ctx, selector, queryType(), sizeof(size32_t));

    ITypeInfo * resultType = queryType();
    LinkedHqlExpr value = _value;
    ITypeInfo * valueType = value->queryType();

    assertRecordTypesMatch(resultType, valueType);

    value.setown(addDatasetLimits(translator, ctx, selector, value));

    CHqlBoundTarget boundTarget;
    boundTarget.count.setown(convertAddressToValue(addressSize, sizetType));
    boundTarget.expr.setown(convertAddressToValue(addressData, queryType()));

    if (value->getOperator() == no_null)
        value.setown(createNullExpr(column));
    
    translator.buildDatasetAssign(ctx, boundTarget, value);
}