FileDocCategorySizeDatePackage
UnresolvedRef.javaAPI DocJava SE 5 API3191Fri Aug 26 14:55:36 BST 2005com.sun.org.apache.xalan.internal.xsltc.compiler

UnresolvedRef

public final class UnresolvedRef extends VariableRefBase
author
Morten Jorgensen

Fields Summary
private QName
_variableName
private VariableRefBase
_ref
private VariableBase
_var
private Stylesheet
_sheet
Constructors Summary
public UnresolvedRef(QName name)


       
	super();
	_variableName = name;
	_sheet = getStylesheet();
    
Methods Summary
public com.sun.org.apache.xalan.internal.xsltc.compiler.QNamegetName()

	return(_variableName);
    
private com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsgreportError()

	ErrorMsg err = new ErrorMsg(ErrorMsg.VARIABLE_UNDEF_ERR,
				    _variableName, this);
	getParser().reportError(Constants.ERROR, err);
	return(err);
    
private com.sun.org.apache.xalan.internal.xsltc.compiler.VariableRefBaseresolve(com.sun.org.apache.xalan.internal.xsltc.compiler.Parser parser, com.sun.org.apache.xalan.internal.xsltc.compiler.SymbolTable stable)

	// At this point the AST is already built and we should be able to
	// find any declared global variable or parameter
	VariableBase ref = parser.lookupVariable(_variableName);
	if (ref == null) ref = (VariableBase)stable.lookupName(_variableName);
	if (ref == null) {
	    reportError();
	    return null;
	}
	
	// Insert the referenced variable as something the parent variable
	// is dependent of (this class should only be used under variables)
	if ((_var = findParentVariable()) != null) _var.addDependency(ref);

	// Instanciate a true variable/parameter ref
	if (ref instanceof Variable)
	    return(new VariableRef((Variable)ref));
	else if (ref instanceof Param)
	    return(new ParameterRef((Param)ref));
	else
	    return null;
    
public java.lang.StringtoString()

	return "unresolved-ref()";
    
public voidtranslate(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen)

	if (_ref != null)
	    _ref.translate(classGen, methodGen);
	else
	    reportError();
    
public com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypetypeCheck(com.sun.org.apache.xalan.internal.xsltc.compiler.SymbolTable stable)

	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());