_local = methodGen.addLocalVariable2(name, _type.toJCType(), il.getEnd());
if (_local == null) { _local = methodGen.addLocalVariable2(name, _type.toJCType(), il.getEnd()); }
    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {	final ConstantPoolGen cpg = classGen.getConstantPool();	final InstructionList il = methodGen.getInstructionList();	final String name = _name.getLocalPart();	if (_compiled) return;	_compiled = true;	if (isLocal()) {	    // If rt implemented as method then compile and return	    if (_select == null && _type != Type.ResultTree) {		compileRtMethod(classGen, methodGen);		return;	    }	    // Push args to call addVariable()	    if (_escapes) {		il.append(classGen.loadTranslet());		il.append(new PUSH(cpg, _stackIndex));	    }	    // Compile rt or expression and store in local	    if (_select == null) {		if (hasContents()) {		    compileRtDom(classGen, methodGen);		}		else {		    // If no select and no contents push the empty string		    il.append(new PUSH(cpg, Constants.EMPTYSTRING));		}	    }	    else {		_select.translate(classGen, methodGen);		_select.startResetIterator(classGen, methodGen);	    }	    // Dup value only when needed	    if (_escapes) {		il.append(_type.DUP());	    }	    // Add a new local variable and store value	    if (_refs.isEmpty()) { // nobody uses the value		il.append(_type.POP());		_local = null;	    }	    else {		// normal case		_local = methodGen.addLocalVariable2(name,						     _type.toJCType(),						     il.getEnd());		il.append(_type.STORE(_local.getIndex()));	    }	    // Store boxed value into the template's variable stack	    if (_escapes) {		_type.translateBox(classGen, methodGen);		il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,							     ADD_VARIABLE,							     ADD_VARIABLE_SIG)					    ));	    }	}	else {	    // If rt implemented as method then compile and return	    if (_select == null && _type != Type.ResultTree) {		compileRtMethod(classGen, methodGen);		return;	    }	    String signature = _type.toSignature();	    if (signature.equals(DOM_IMPL_SIG))		signature = classGen.getDOMClassSig();	    // Add a new field to this class	    if (classGen.containsField(name) == null) {		classGen.addField(new Field(ACC_PUBLIC, 					    cpg.addUtf8(name),					    cpg.addUtf8(signature),					    null, cpg.getConstantPool()));		// Push a reference to "this" for putfield		il.append(classGen.loadTranslet());		// Compile rt or expression and store in field		if (_select == null) {		    if (hasContents()) {			compileRtDom(classGen, methodGen);		    }		    else {			// If no select and no contents push the empty string			il.append(new PUSH(cpg, Constants.EMPTYSTRING));		    }		}		else {		    _select.translate(classGen, methodGen);		    _select.startResetIterator(classGen, methodGen);		}		il.append(new PUTFIELD(cpg.addFieldref(classGen.getClassName(),						       name, signature)));	    }	}    }