Refactory: remove unused classes, imports, fields and methods.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ISourceElementRequestor.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 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;
12
13 import net.sourceforge.phpdt.core.compiler.IProblem;
14
15 /*
16  * Part of the source element parser responsible for building the output. It
17  * gets notified of structural information as they are detected, relying on the
18  * requestor to assemble them together, based on the notifications it got.
19  * 
20  * The structural investigation includes: - package statement - import
21  * statements - top-level types: package member, member types (member types of
22  * member types...) - fields - methods
23  * 
24  * If reference information is requested, then all source constructs are
25  * investigated and type, field & method references are provided as well.
26  * 
27  * Any (parsing) problem encountered is also provided.
28  * 
29  * All positions are relative to the exact source fed to the parser.
30  * 
31  * Elements which are complex are notified in two steps: - enter<Element> :
32  * once the element header has been identified - exit<Element> : once the
33  * element has been fully consumed
34  * 
35  * other simpler elements (package, import) are read all at once: - accept<Element>
36  */
37
38 public interface ISourceElementRequestor {
39         void acceptConstructorReference(char[] typeName, int argCount,
40                         int sourcePosition);
41
42         // void acceptFieldReference(char[] fieldName, int sourcePosition);
43         /**
44          * @param declarationStart
45          *            This is the position of the first character of the import
46          *            keyword.
47          * @param declarationEnd
48          *            This is the position of the ';' ending the import statement or
49          *            the end of the comment following the import.
50          * @param name
51          *            This is the name of the import like specified in the source
52          *            including the dots. The '.*' is never included in the name.
53          * @param onDemand
54          *            set to true if the import is an import on demand (e.g. import
55          *            java.io.*). False otherwise.
56          */
57         void acceptImport(int declarationStart, int declarationEnd, char[] name,
58                         boolean onDemand);
59
60         /*
61          * Table of line separator position. This table is passed once at the end of
62          * the parse action, so as to allow computation of normalized ranges.
63          * 
64          * A line separator might corresponds to several characters in the source,
65          * 
66          */
67         void acceptLineSeparatorPositions(int[] positions);
68
69         void acceptMethodReference(char[] methodName, int argCount,
70                         int sourcePosition);
71
72         // void acceptPackage(
73         // int declarationStart,
74         // int declarationEnd,
75         // char[] name);
76         void acceptProblem(IProblem problem);
77
78         void acceptTypeReference(char[][] typeName, int sourceStart, int sourceEnd);
79
80         void acceptTypeReference(char[] typeName, int sourcePosition);
81
82         void acceptUnknownReference(char[][] name, int sourceStart, int sourceEnd);
83
84         void acceptUnknownReference(char[] name, int sourcePosition);
85
86         void enterClass(int declarationStart, int modifiers, char[] name,
87                         int nameSourceStart, int nameSourceEnd, char[] superclass,
88                         char[][] superinterfaces);
89
90         void enterCompilationUnit();
91
92         void enterConstructor(int declarationStart, int modifiers, char[] name,
93                         int nameSourceStart, int nameSourceEnd, char[][] parameterTypes,
94                         char[][] parameterNames, char[][] exceptionTypes);
95
96         void enterField(int declarationStart, int modifiers, char[] type,
97                         char[] name, int nameSourceStart, int nameSourceEnd);
98
99         // void enterInitializer(
100         // int declarationStart,
101         // int modifiers);
102         void enterInterface(int declarationStart, int modifiers, char[] name,
103                         int nameSourceStart, int nameSourceEnd, char[][] superinterfaces);
104
105         void enterMethod(int declarationStart, int modifiers, char[] returnType,
106                         char[] name, int nameSourceStart, int nameSourceEnd,
107                         char[][] parameterTypes, char[][] parameterNames,
108                         char[][] exceptionTypes);
109
110         void exitClass(int declarationEnd);
111
112         void exitCompilationUnit(int declarationEnd);
113
114         void exitConstructor(int declarationEnd);
115
116         /*
117          * initializationStart denotes the source start of the expression used for
118          * initializing the field if any (-1 if no initialization).
119          */
120         void exitField(int initializationStart, int declarationEnd,
121                         int declarationSourceEnd);
122
123         void exitInitializer(int declarationEnd);
124
125         void exitInterface(int declarationEnd);
126
127         void exitMethod(int declarationEnd);
128 }