本文整理汇总了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;
}
示例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());
}