A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / JavadocReturnStatement.java
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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.ast;
12
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;
18
19 public class JavadocReturnStatement extends ReturnStatement {
20         public char[] description;
21
22         public JavadocReturnStatement(int s, int e, char[] descr) {
23                 super(null, s, e);
24                 this.description = descr;
25                 this.bits |= InsideJavadoc;
26         }
27
28         public void resolve(BlockScope scope) {
29                 MethodScope methodScope = scope.methodScope();
30                 MethodBinding methodBinding;
31                 TypeBinding methodType = (methodScope.referenceContext instanceof AbstractMethodDeclaration) ? ((methodBinding = ((AbstractMethodDeclaration) methodScope.referenceContext).binding) == null ? null
32                                 : methodBinding.returnType)
33                                 : VoidBinding;
34                 if (methodType == null || methodType == VoidBinding) {
35                         scope.problemReporter().javadocUnexpectedTag(this.sourceStart,
36                                         this.sourceEnd);
37                 }
38         }
39
40         /*
41          * (non-Javadoc) Redefine to capture javadoc specific signatures
42          * 
43          * @see net.sourceforge.phpdt.internal.compiler.ast.ASTNode#traverse(net.sourceforge.phpdt.internal.compiler.ASTVisitor,
44          *      net.sourceforge.phpdt.internal.compiler.lookup.BlockScope)
45          */
46         public void traverse(ASTVisitor visitor, BlockScope scope) {
47                 visitor.visit(this, scope);
48                 visitor.endVisit(this, scope);
49         }
50 }