1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpeclipse.internal.compiler.ast;
13 import net.sourceforge.phpdt.internal.compiler.ASTVisitor;
14 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
15 import net.sourceforge.phpdt.internal.compiler.lookup.MethodBinding;
16 import net.sourceforge.phpdt.internal.compiler.lookup.MethodScope;
17 import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding;
20 public class JavadocReturnStatement extends ReturnStatement {
21 public char[] description;
23 public JavadocReturnStatement(int s, int e, char[] descr) {
25 this.description = descr;
26 this.bits |= InsideJavadoc;
29 public void resolve(BlockScope scope) {
30 MethodScope methodScope = scope.methodScope();
31 MethodBinding methodBinding;
32 TypeBinding methodType =
33 (methodScope.referenceContext instanceof AbstractMethodDeclaration)
34 ? ((methodBinding = ((AbstractMethodDeclaration) methodScope.referenceContext).binding) == null
36 : methodBinding.returnType)
38 if (methodType == null || methodType == VoidBinding) {
39 scope.problemReporter().javadocUnexpectedTag(this.sourceStart, this.sourceEnd);
44 * Redefine to capture javadoc specific signatures
45 * @see net.sourceforge.phpdt.internal.compiler.ast.ASTNode#traverse(net.sourceforge.phpdt.internal.compiler.ASTVisitor, net.sourceforge.phpdt.internal.compiler.lookup.BlockScope)
47 public void traverse(ASTVisitor visitor, BlockScope scope) {
48 visitor.visit(this, scope);
49 visitor.endVisit(this, scope);