当前位置: 首页>>代码示例>>Java>>正文


Java ErrorMsg.CIRCULAR_VARIABLE_ERR属性代码示例

本文整理汇总了Java中com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg.CIRCULAR_VARIABLE_ERR属性的典型用法代码示例。如果您正苦于以下问题:Java ErrorMsg.CIRCULAR_VARIABLE_ERR属性的具体用法?Java ErrorMsg.CIRCULAR_VARIABLE_ERR怎么用?Java ErrorMsg.CIRCULAR_VARIABLE_ERR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg的用法示例。


在下文中一共展示了ErrorMsg.CIRCULAR_VARIABLE_ERR属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resolveDependencies

/**
 * This method returns a vector with variables/params and keys in the
 * order in which they are to be compiled for initialization. The order
 * is determined by analyzing the dependencies between them. The XSLT 1.0
 * spec does not allow a key to depend on a variable. However, for
 * compatibility with Xalan interpretive, that type of dependency is
 * allowed and, therefore, consider to determine the partial order.
 */
private Vector resolveDependencies(Vector input) {
    /* DEBUG CODE - INGORE
    for (int i = 0; i < input.size(); i++) {
        final TopLevelElement e = (TopLevelElement) input.elementAt(i);
        System.out.println("e = " + e + " depends on:");
        Vector dep = e.getDependencies();
        for (int j = 0; j < (dep != null ? dep.size() : 0); j++) {
            System.out.println("\t" + dep.elementAt(j));
        }
    }
    System.out.println("=================================");
    */

    Vector result = new Vector();
    while (input.size() > 0) {
        boolean changed = false;
        for (int i = 0; i < input.size(); ) {
            final TopLevelElement vde = (TopLevelElement) input.elementAt(i);
            final Vector dep = vde.getDependencies();
            if (dep == null || result.containsAll(dep)) {
                result.addElement(vde);
                input.remove(i);
                changed = true;
            }
            else {
                i++;
            }
        }

        // If nothing was changed in this pass then we have a circular ref
        if (!changed) {
            ErrorMsg err = new ErrorMsg(ErrorMsg.CIRCULAR_VARIABLE_ERR,
                                        input.toString(), this);
            getParser().reportError(Constants.ERROR, err);
            return(result);
        }
    }

    /* DEBUG CODE - INGORE
    System.out.println("=================================");
    for (int i = 0; i < result.size(); i++) {
        final TopLevelElement e = (TopLevelElement) result.elementAt(i);
        System.out.println("e = " + e);
    }
    */

    return result;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:56,代码来源:Stylesheet.java

示例2: typeCheck

public Type typeCheck(SymbolTable stable) throws TypeCheckError {
    if (_ref != null) {
        final String name = _variableName.toString();
        ErrorMsg err = new ErrorMsg(ErrorMsg.CIRCULAR_VARIABLE_ERR,
                                    name, this);
    }
    if ((_ref = resolve(getParser(), stable)) != null) {
        return (_type = _ref.typeCheck(stable));
    }
    throw new TypeCheckError(reportError());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:UnresolvedRef.java


注:本文中的com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg.CIRCULAR_VARIABLE_ERR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。