@Override public boolean hasObject(String name) { return this.delegate.hasObject(name); }
protected void doReassignThisInClosure(final ITreeAppendable b, JvmType prevType) { final String proposedName = prevType.getSimpleName()+".this"; if (!b.hasObject(proposedName)) { b.declareSyntheticVariable(prevType, proposedName); if (b.hasObject("super")) { Object superElement = b.getObject("super"); if (superElement instanceof JvmType) { // Don't reassign the super of the enclosing type if it has already been reassigned String superVariable = b.getName(superElement); if ("super".equals(superVariable)) { b.declareSyntheticVariable(superElement, prevType.getSimpleName()+".super"); } } } } }
protected void reassignThisInClosure(final ITreeAppendable b, JvmType rawClosureType) { boolean registerClosureAsThis = rawClosureType instanceof JvmGenericType; if (b.hasObject("this")) { Object element = b.getObject("this"); if (element instanceof JvmType) { // Don't reassign if the types are equal, since the 'this' of the enclosing type is shadowed if (element != rawClosureType) doReassignThisInClosure(b, (JvmType) element); } else { registerClosureAsThis = false; } } if (registerClosureAsThis) { b.declareVariable(rawClosureType, "this"); } }
protected String reassignThisType(final ITreeAppendable b, final JvmDeclaredType declaredType) { String _xblockexpression = null; { boolean _hasObject = b.hasObject("this"); if (_hasObject) { final Object element = b.getObject("this"); if ((element instanceof JvmDeclaredType)) { boolean _isLocal = ((JvmDeclaredType)element).isLocal(); if (_isLocal) { b.declareVariable(element, ""); } else { String _simpleName = ((JvmDeclaredType)element).getSimpleName(); final String proposedName = (_simpleName + ".this"); b.declareVariable(element, proposedName); } } } String _xifexpression = null; if ((declaredType != null)) { _xifexpression = b.declareVariable(declaredType, "this"); } _xblockexpression = _xifexpression; } return _xblockexpression; }
boolean _hasObject = b.hasObject("super"); if (_hasObject) { final Object element = b.getObject("this"); String _simpleName_1 = interfaze.getSimpleName(); final String simpleVarName = (_simpleName_1 + ".super"); boolean _hasObject_1 = b.hasObject(simpleVarName); if (_hasObject_1) { final Object element_1 = b.getObject(simpleVarName);
/** * Symmetric to {@link XtendGenerator#reassignThisType(ITreeAppendable, JvmDeclaredType)} */ @Override protected void doReassignThisInClosure(ITreeAppendable b, JvmType prevType) { if (prevType instanceof JvmDeclaredType && ((JvmDeclaredType) prevType).isLocal()) { if (b.hasName(Pair.of("this", prevType))) { b.declareVariable(prevType, b.getName(Pair.of("this", prevType))); } else { b.declareSyntheticVariable(prevType, ""); } if (b.hasObject("super")) { Object superElement = b.getObject("super"); if (superElement instanceof JvmType) { // Don't reassign the super of the enclosing type if it has already been reassigned String superVariable = b.getName(superElement); if ("super".equals(superVariable)) { b.declareSyntheticVariable(superElement, prevType.getSimpleName()+".super"); } } } } else { super.doReassignThisInClosure(b, prevType); } }
String _xblockexpression = null; boolean _hasObject = b.hasObject("this"); if (_hasObject) { final Object element = b.getObject("this");
appendable.openScope(); try { if (appendable.hasObject("this")) { Object thisElement = appendable.getObject("this"); if (thisElement instanceof JvmType) { appendable.declareVariable(thisElement, ((JvmType) thisElement).getSimpleName()+".this"); if (appendable.hasObject("super")) { Object superElement = appendable.getObject("super"); if (superElement instanceof JvmType) {