/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: Variable.java,v 1.2.4.1 2005/09/12 11:36:46 pvedula Exp $
*/
public int getIndex() {
}
/**
* Parse the contents of the variable
*/
// Parse 'name' and 'select' attributes plus parameter contents
super.parseContents(parser);
// Add a ref to this var to its enclosing construct
if (parent instanceof Stylesheet) {
// Mark this as a global variable
_isLocal = false;
// Check if a global variable with this name already exists...
// ...and if it does we need to check import precedence
final int us = this.getImportPrecedence();
// It is an error if the two have the same import precedence
}
// Ignore this if previous definition has higher precedence
_ignore = true;
return;
}
else {
var.copyReferences(this);
}
// Add this variable if we have higher precedence
}
}
else {
_isLocal = true;
}
}
/**
* Runs a type check on either the variable element body or the
* expression in the 'select' attribute
*/
// Type check the 'select' expression if present
}
// Type check the element contents otherwise
else if (hasContents()) {
}
else {
}
// The return type is void as the variable element does not leave
// anything on the JVM's stack. The '_type' global will be returned
// by the references to this variable, and not by the variable itself.
}
/**
* This method is part of a little trick that is needed to use local
* variables inside nested for-each loops. See the initializeVariables()
* method in the ForEach class for an explanation
*/
// This is only done for local variables that are actually used
// Create a variable slot if none is allocated
null);
}
// Push the default value on the JVM's stack
(_type instanceof BooleanType))
else
// Mark the store as the start of the live range of the variable
}
}
// Don't generate code for unreferenced variables
_ignore = true;
}
// Make sure that a variable instance is only compiled once
if (_ignore) return;
_ignore = true;
if (isLocal()) {
// Compile variable value computation
// Add a new local variable and store value
if (createLocal) {
}
// If the local is just being created, mark the store as the start
// of its live range. Note that it might have been created by
// initializeVariables already, which would have set the start of
// the live range already.
if (createLocal) {
}
}
else {
// Global variables are store in class fields
// Push a reference to "this" for putfield
// Compile variable value computation
// Store the variable in the allocated field
}
}
}
}