// 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;