-
Notifications
You must be signed in to change notification settings - Fork 70
/
IErlModule.java
151 lines (116 loc) · 4.79 KB
/
IErlModule.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*******************************************************************************
// * Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* IBM Corporation - added J2SE 1.5 support
* Vlad Dumitrescu
* *******************************************************************************/
package org.erlide.core.model.erlang;
import java.util.Collection;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.erlide.core.model.root.ErlModelException;
import org.erlide.core.model.root.IErlElement;
import org.erlide.core.model.root.IOpenable;
import org.erlide.core.model.root.IParent;
import org.erlide.core.model.root.ISourceUnit;
import org.erlide.core.model.util.ErlangFunction;
import org.erlide.core.model.util.ErlangIncludeFile;
/**
* Represents an entire Erlang compilation unit (<code>.erl</code> or
* <code>.hrl</code> source file). Compilation unit elements need to be opened
* before they can be navigated or manipulated. The children are of type
* <code>IErlAttribute</code>, and <code>IErlFunction</code>, and appear in the
* order in which they are declared in the source. If a <code>.erl</code> file
* cannot be parsed, its structure remains unknown. Use
* <code>IErlElement.isStructureKnown</code> to determine whether this is the
* case.
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*/
public interface IErlModule extends IErlElement, IParent, IOpenable,
ISourceUnit {
/**
* Returns the smallest element within this module that includes the given
* source position (that is, a clause, attribute, etc.), or
* <code>null</code> if there is no element other than the compilation unit
* itself at the given position, or if the given position is not within the
* source range of this compilation unit.
*
* @param position
* a source position inside the compilation unit
* @return the innermost Erlang element enclosing a given source position or
* <code>null</code> if none (excluding the compilation unit).
* @throws ErlModelException
* if the compilation unit does not exist or if an exception
* occurs while accessing its corresponding resource
*/
IErlElement getElementAt(int position) throws ErlModelException;
IErlMember getElementAtLine(int lineNumber);
/**
* Is this module a real one, or an include file?
*
* @return true if .erl, false if .hrl
*/
ModuleKind getModuleKind();
Collection<IErlComment> getComments();
long getTimestamp();
IErlImport findImport(ErlangFunction function);
Collection<IErlImport> getImports();
IErlPreprocessorDef findPreprocessorDef(String definedName, Kind kind);
public Collection<IErlPreprocessorDef> getPreprocessorDefs(final Kind kind);
Collection<ErlangIncludeFile> getIncludeFiles() throws ErlModelException;
// void getScanner();
//
// void disposeScanner();
void initialReconcile();
void reconcileText(int offset, int removeLength, String newText,
IProgressMonitor mon);
void postReconcile(IProgressMonitor mon);
void finalReconcile();
/**
* Returns a collection of modules that include this one.
**/
Set<IErlModule> getDirectDependentModules() throws ErlModelException;
/**
* Returns the transitive closure of modules that include this one.
*
* @throws CoreException
**/
Set<IErlModule> getAllDependentModules() throws CoreException;
/**
* Resets parser so that the next parse will be a full parse, possibly
* updating the parser cache
*
* @param newText
* @throws ErlModelException
*/
void resetAndCacheScannerAndParser(String newText) throws ErlModelException;
/**
* Get the module name without extension
*
* @return name as string
*/
String getModuleName();
IErlFunction findFunction(ErlangFunction erlangFunction);
IErlTypespec findTypespec(String typeName);
ErlToken getScannerTokenAt(int offset);
void setResource(IFile file);
void setComments(Collection<? extends IErlComment> comments);
Collection<IErlModule> findAllIncludedFiles() throws CoreException;
boolean isOnSourcePath();
boolean isOnIncludePath();
boolean exportsAllFunctions();
@Override
Object getModelLock();
boolean isRealFile();
String getScannerName();
}