Пример #1
0
static int compareSymbolsByPosition(IInterface * const * pleft, IInterface * const * pright)
{
    IHqlExpression * left = static_cast<IHqlExpression *>(*pleft);
    IHqlExpression * right = static_cast<IHqlExpression *>(*pright);

    int startLeft = left->getStartLine();
    int startRight = right->getStartLine();
    if (startLeft != startRight)
        return startLeft < startRight ? -1 : +1;
    return stricmp(str(left->queryName()), str(right->queryName()));
}
Пример #2
0
bool ECLlocation::extractLocationAttr(const IHqlExpression * location)
{
    if (!location)
    {
        clear();
        return false;
    }
    if (location->isAttribute())
    {
        if (location->queryName() != _location_Atom)
            return false;

        IHqlExpression * sourceExpr = location->queryChild(3);
        if (sourceExpr)
            sourcePath = static_cast<ISourcePath *>(sourceExpr->queryUnknownExtra());
        else
            sourcePath = NULL;
        lineno = (int)getIntValue(location->queryChild(0));
        column = (int)getIntValue(location->queryChild(1));
        position = (int)getIntValue(location->queryChild(2));
        return true;
    }
    IHqlExpression * annotation = queryLocation(const_cast<IHqlExpression *>(location));
    if (annotation)
    {
        sourcePath = annotation->querySourcePath();
        lineno = annotation->getStartLine();
        column = annotation->getStartColumn();
        position = 0;
        return true;
    }
    return false;
}