public TypeBinding resolveType(BlockScope scope) { this.constant = Constant.NotAConstant; if (!isImplicitThis() &&!checkAccess(scope.methodScope())) { return null; } return this.resolvedType = scope.enclosingReceiverType(); }
public static ThisReference implicitThis(){ ThisReference implicitThis = new ThisReference(0, 0); implicitThis.bits |= IsImplicitThis; return implicitThis; }
@Override public boolean visit(ThisReference thisReference, BlockScope scope) { context.enter(factory.Code().createThisAccess(references.getTypeReference(thisReference.resolvedType), thisReference.isImplicitThis()), thisReference); return true; }
protected void consumeMethodInvocationName() { // MethodInvocation ::= Name '(' ArgumentListopt ')' // when the name is only an identifier...we have a message send to "this" (implicit) MessageSend m = newMessageSend(); m.sourceEnd = this.rParenPos; m.sourceStart = (int) ((m.nameSourcePosition = this.identifierPositionStack[this.identifierPtr]) >>> 32); m.selector = this.identifierStack[this.identifierPtr--]; if (this.identifierLengthStack[this.identifierLengthPtr] == 1) { m.receiver = ThisReference.implicitThis(); this.identifierLengthPtr--; } else { this.identifierLengthStack[this.identifierLengthPtr]--; m.receiver = getUnspecifiedReference(); m.sourceStart = m.receiver.sourceStart; } pushOnExpressionStack(m); } protected void consumeMethodInvocationNameWithTypeArguments() {
public boolean checkAccess(BlockScope scope, ReferenceBinding receiverType) { MethodScope methodScope = scope.methodScope(); // this/super cannot be used in constructor call if (methodScope.isConstructorCall) { methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this); return false; } // static may not refer to this/super if (methodScope.isStatic) { methodScope.problemReporter().errorThisSuperInStatic(this); return false; } else if (this.isUnqualifiedSuper()) { TypeDeclaration type = methodScope.referenceType(); if (type != null && TypeDeclaration.kind(type.modifiers) == TypeDeclaration.INTERFACE_DECL) { methodScope.problemReporter().errorNoSuperInInterface(this); return false; } } if (receiverType != null) scope.tagAsAccessingEnclosingInstanceStateOf(receiverType, false /* type variable access */); return true; }
BlockScope blockScope = (BlockScope) this.astNodesToBlockScope.get(expression); if (blockScope != null) { return this.getTypeBinding(thisReference.resolveType(blockScope));
@Override public StringBuffer printExpression(int indent, StringBuffer output){ if (isImplicitThis()) return output; return output.append("this"); //$NON-NLS-1$ }
protected void consumeMethodInvocationName() { // MethodInvocation ::= Name '(' ArgumentListopt ')' // when the name is only an identifier...we have a message send to "this" (implicit) MessageSend m = newMessageSend(); m.sourceEnd = this.rParenPos; m.sourceStart = (int) ((m.nameSourcePosition = this.identifierPositionStack[this.identifierPtr]) >>> 32); m.selector = this.identifierStack[this.identifierPtr--]; if (this.identifierLengthStack[this.identifierLengthPtr] == 1) { m.receiver = ThisReference.implicitThis(); this.identifierLengthPtr--; } else { this.identifierLengthStack[this.identifierLengthPtr]--; m.receiver = getUnspecifiedReference(); m.sourceStart = m.receiver.sourceStart; } pushOnExpressionStack(m); } protected void consumeMethodInvocationNameWithTypeArguments() {
public boolean checkAccess(BlockScope scope, ReferenceBinding receiverType) { MethodScope methodScope = scope.methodScope(); // this/super cannot be used in constructor call if (methodScope.isConstructorCall) { methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this); return false; } // static may not refer to this/super if (methodScope.isStatic) { methodScope.problemReporter().errorThisSuperInStatic(this); return false; } else if (this.isUnqualifiedSuper()) { TypeDeclaration type = methodScope.referenceType(); if (type != null && TypeDeclaration.kind(type.modifiers) == TypeDeclaration.INTERFACE_DECL) { methodScope.problemReporter().errorNoSuperInInterface(this); return false; } } if (receiverType != null) scope.tagAsAccessingEnclosingInstanceStateOf(receiverType, false /* type variable access */); return true; }
BlockScope blockScope = (BlockScope) this.astNodesToBlockScope.get(expression); if (blockScope != null) { return this.getTypeBinding(thisReference.resolveType(blockScope));
public TypeBinding resolveType(BlockScope scope) { this.constant = Constant.NotAConstant; if (!isImplicitThis() &&!checkAccess(scope.methodScope())) { return null; } return this.resolvedType = scope.enclosingReceiverType(); }
public StringBuffer printExpression(int indent, StringBuffer output){ if (isImplicitThis()) return output; return output.append("this"); //$NON-NLS-1$ }
public static ThisReference implicitThis(){ ThisReference implicitThis = new ThisReference(0, 0); implicitThis.bits |= IsImplicitThis; return implicitThis; }
protected void consumeMethodInvocationName() { // MethodInvocation ::= Name '(' ArgumentListopt ')' // when the name is only an identifier...we have a message send to "this" (implicit) MessageSend m = newMessageSend(); m.sourceEnd = this.rParenPos; m.sourceStart = (int) ((m.nameSourcePosition = this.identifierPositionStack[this.identifierPtr]) >>> 32); m.selector = this.identifierStack[this.identifierPtr--]; if (this.identifierLengthStack[this.identifierLengthPtr] == 1) { m.receiver = ThisReference.implicitThis(); this.identifierLengthPtr--; } else { this.identifierLengthStack[this.identifierLengthPtr]--; m.receiver = getUnspecifiedReference(); m.sourceStart = m.receiver.sourceStart; } pushOnExpressionStack(m); } protected void consumeMethodInvocationNameWithTypeArguments() {
public boolean checkAccess(BlockScope scope, ReferenceBinding receiverType) { MethodScope methodScope = scope.methodScope(); // this/super cannot be used in constructor call if (methodScope.isConstructorCall) { methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this); return false; } // static may not refer to this/super if (methodScope.isStatic) { methodScope.problemReporter().errorThisSuperInStatic(this); return false; } else if (this.isUnqualifiedSuper()) { TypeDeclaration type = methodScope.referenceType(); if (type != null && TypeDeclaration.kind(type.modifiers) == TypeDeclaration.INTERFACE_DECL) { methodScope.problemReporter().errorNoSuperInInterface(this); return false; } } if (receiverType != null) scope.tagAsAccessingEnclosingInstanceStateOf(receiverType, false /* type variable access */); return true; }
BlockScope blockScope = (BlockScope) this.astNodesToBlockScope.get(expression); if (blockScope != null) { return this.getTypeBinding(thisReference.resolveType(blockScope));
public TypeBinding resolveType(BlockScope scope) { this.constant = Constant.NotAConstant; if (!isImplicitThis() &&!checkAccess(scope.methodScope())) { return null; } return this.resolvedType = scope.enclosingReceiverType(); }
public StringBuffer printExpression(int indent, StringBuffer output){ if (isImplicitThis()) return output; return output.append("this"); //$NON-NLS-1$ }
public static ThisReference implicitThis(){ ThisReference implicitThis = new ThisReference(0, 0); implicitThis.bits |= IsImplicitThis; return implicitThis; }
m.selector = this.identifierStack[this.identifierPtr--]; if (this.identifierLengthStack[this.identifierLengthPtr] == 1) { m.receiver = ThisReference.implicitThis(); this.identifierLengthPtr--; } else {