1) Moved net.sourceforge.phpeclipse.ui\src\net\sourceforge\phpdt back to net.sourcefo...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / ImplicitDocTypeReference.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.ClassScope;
15 import net.sourceforge.phpdt.internal.compiler.lookup.Scope;
16 import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding;
17
18 public class ImplicitDocTypeReference extends TypeReference {
19
20         public char[] token;
21
22         public ImplicitDocTypeReference(char[] name, int pos) {
23                 super();
24                 this.token = name;
25                 this.sourceStart = pos;
26                 this.sourceEnd = pos;
27         }
28
29         /*
30          * (non-Javadoc)
31          * 
32          * @see org.eclipse.jdt.internal.compiler.ast.TypeReference#copyDims(int)
33          */
34         public TypeReference copyDims(int dim) {
35                 return null;
36         }
37
38         /*
39          * (non-Javadoc)
40          * 
41          * @see org.eclipse.jdt.internal.compiler.ast.TypeReference#getTypeBinding(org.eclipse.jdt.internal.compiler.lookup.Scope)
42          */
43         public TypeBinding getTypeBinding(Scope scope) {
44                 this.constant = NotAConstant;
45                 return this.resolvedType = scope.enclosingSourceType();
46         }
47
48         /*
49          * (non-Javadoc)
50          * 
51          * @see org.eclipse.jdt.internal.compiler.ast.TypeReference#getTypeName()
52          */
53         public char[][] getTypeName() {
54                 if (this.token != null) {
55                         char[][] tokens = { this.token };
56                         return tokens;
57                 }
58                 return null;
59         }
60
61         public boolean isThis() {
62                 return true;
63         }
64
65         /*
66          * (non-Javadoc)
67          * 
68          * @see org.eclipse.jdt.internal.compiler.ast.TypeReference#traverse(org.eclipse.jdt.internal.compiler.ASTVisitor,
69          *      org.eclipse.jdt.internal.compiler.lookup.ClassScope)
70          */
71         public void traverse(ASTVisitor visitor, ClassScope classScope) {
72                 // Do nothing
73         }
74
75         /*
76          * (non-Javadoc)
77          * 
78          * @see org.eclipse.jdt.internal.compiler.ast.Expression#printExpression(int,
79          *      java.lang.StringBuffer)
80          */
81         public StringBuffer printExpression(int indent, StringBuffer output) {
82                 return new StringBuffer();
83         }
84 }