Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Side by Side Diff: pkg/analyzer-experimental/lib/src/generated/error.dart

Issue 12197019: Drop of generated scanner and example scanner driver. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information.
3
4 library engine.error;
5
6 import 'java_core.dart';
7 import 'source.dart';
8
9 /**
10 * Instances of the enumeration {@code ErrorType} represent the type of an {@lin k ErrorCode}.
11 */
12 class ErrorType {
13 /**
14 * Compile-time errors are errors that preclude execution. A compile time erro r must be reported
15 * by a Dart compiler before the erroneous code is executed.
16 */
17 static final ErrorType COMPILE_TIME_ERROR = new ErrorType('COMPILE_TIME_ERROR' , 0, ErrorSeverity.ERROR);
18 /**
19 * Static warnings are those warnings reported by the static checker. They hav e no effect on
20 * execution. Static warnings must be provided by Dart compilers used during d evelopment.
21 */
22 static final ErrorType STATIC_WARNING = new ErrorType('STATIC_WARNING', 1, Err orSeverity.WARNING);
23 /**
24 * Many, but not all, static warnings relate to types, in which case they are known as static type
25 * warnings.
26 */
27 static final ErrorType STATIC_TYPE_WARNING = new ErrorType('STATIC_TYPE_WARNIN G', 2, ErrorSeverity.WARNING);
28 /**
29 * Syntactic errors are errors produced as a result of input that does not con form to the grammar.
30 */
31 static final ErrorType SYNTACTIC_ERROR = new ErrorType('SYNTACTIC_ERROR', 3, E rrorSeverity.ERROR);
32 static final List<ErrorType> values = [COMPILE_TIME_ERROR, STATIC_WARNING, STA TIC_TYPE_WARNING, SYNTACTIC_ERROR];
33 final String __name;
34 final int __ordinal;
35 /**
36 * The severity of this type of error.
37 */
38 ErrorSeverity _severity;
39 /**
40 * Initialize a newly created error type to have the given severity.
41 * @param severity the severity of this type of error
42 */
43 ErrorType(this.__name, this.__ordinal, ErrorSeverity severity) {
44 this._severity = severity;
45 }
46 /**
47 * Return the severity of this type of error.
48 * @return the severity of this type of error
49 */
50 ErrorSeverity get severity => _severity;
51 String toString() => __name;
52 }
53 /**
54 * The interface {@code ErrorCode} defines the behavior common to objects repres enting error codes
55 * associated with {@link AnalysisError analysis errors}.
56 */
57 abstract class ErrorCode {
58 /**
59 * Return the severity of this error.
60 * @return the severity of this error
61 */
62 ErrorSeverity get errorSeverity;
63 /**
64 * Return the message template used to create the message to be displayed for this error.
65 * @return the message template used to create the message to be displayed for this error
66 */
67 String get message;
68 /**
69 * Return the type of the error.
70 * @return the type of the error
71 */
72 ErrorType get type;
73 /**
74 * Return {@code true} if this error should cause recompilation of the source during the next
75 * incremental compilation.
76 * @return {@code true} if this error should cause recompilation of the source during the next
77 * incremental compilation
78 */
79 bool needsRecompilation();
80 }
81 /**
82 * Instances of the enumeration {@code ErrorSeverity} represent the severity of an {@link ErrorCode}.
83 */
84 class ErrorSeverity {
85 /**
86 * The severity representing an error.
87 */
88 static final ErrorSeverity ERROR = new ErrorSeverity('ERROR', 0, "E");
89 /**
90 * The severity representing a warning. Warnings can become errors if the {@co de -Werror} command
91 * line flag is specified.
92 */
93 static final ErrorSeverity WARNING = new ErrorSeverity('WARNING', 1, "W");
94 static final List<ErrorSeverity> values = [ERROR, WARNING];
95 final String __name;
96 final int __ordinal;
97 String _name;
98 ErrorSeverity(this.__name, this.__ordinal, String name) {
99 this._name = name;
100 }
101 String get name => _name;
102 String toString() => __name;
103 }
104 /**
105 * The interface {@code AnalysisErrorListener} defines the behavior of objects t hat listen for{@link AnalysisError analysis errors} being produced by the analys is engine.
106 */
107 abstract class AnalysisErrorListener {
108 /**
109 * This method is invoked when an error has been found by the analysis engine.
110 * @param error the error that was just found (not {@code null})
111 */
112 void onError(AnalysisError error);
113 }
114 /**
115 * Instances of the class {@code AnalysisError} represent an error discovered du ring the analysis of
116 * some Dart code.
117 * @see AnalysisErrorListener
118 */
119 class AnalysisError {
120 /**
121 * An empty array of errors used when no errors are expected.
122 */
123 static List<AnalysisError> NO_ERRORS = new List<AnalysisError>.fixedLength(0);
124 /**
125 * The error code associated with the error.
126 */
127 ErrorCode _errorCode;
128 /**
129 * The localized error message.
130 */
131 String _message;
132 /**
133 * The source in which the error occurred, or {@code null} if unknown.
134 */
135 Source _source;
136 /**
137 * The character offset from the beginning of the source (zero based) where th e error occurred.
138 */
139 int _offset = 0;
140 /**
141 * The number of characters from the offset to the end of the source which enc ompasses the
142 * compilation error.
143 */
144 int _length = 0;
145 /**
146 * Initialize a newly created analysis error for the specified source. The err or has no location
147 * information.
148 * @param source the source for which the exception occurred
149 * @param errorCode the error code to be associated with this error
150 * @param arguments the arguments used to build the error message
151 */
152 AnalysisError.con1(Source source, ErrorCode errorCode, List<Object> arguments) {
153 _jtd_constructor_117_impl(source, errorCode, arguments);
154 }
155 _jtd_constructor_117_impl(Source source, ErrorCode errorCode, List<Object> arg uments) {
156 this._source = source;
157 this._errorCode = errorCode;
158 this._message = JavaString.format(errorCode.message, arguments);
159 }
160 /**
161 * Initialize a newly created analysis error for the specified source at the g iven location.
162 * @param source the source for which the exception occurred
163 * @param offset the offset of the location of the error
164 * @param length the length of the location of the error
165 * @param errorCode the error code to be associated with this error
166 * @param arguments the arguments used to build the error message
167 */
168 AnalysisError.con2(Source source, int offset, int length, ErrorCode errorCode, List<Object> arguments) {
169 _jtd_constructor_118_impl(source, offset, length, errorCode, arguments);
170 }
171 _jtd_constructor_118_impl(Source source, int offset, int length, ErrorCode err orCode, List<Object> arguments) {
172 this._source = source;
173 this._offset = offset;
174 this._length = length;
175 this._errorCode = errorCode;
176 this._message = JavaString.format(errorCode.message, arguments);
177 }
178 /**
179 * Return the error code associated with the error.
180 * @return the error code associated with the error
181 */
182 ErrorCode get errorCode => _errorCode;
183 /**
184 * Return the number of characters from the offset to the end of the source wh ich encompasses the
185 * compilation error.
186 * @return the length of the error location
187 */
188 int get length => _length;
189 /**
190 * Return the localized error message.
191 * @return the localized error message
192 */
193 String get message => _message;
194 /**
195 * Return the character offset from the beginning of the source (zero based) w here the error
196 * occurred.
197 * @return the offset to the start of the error location
198 */
199 int get offset => _offset;
200 /**
201 * Return the source in which the error occurred, or {@code null} if unknown.
202 * @return the source in which the error occurred
203 */
204 Source get source => _source;
205 int get hashCode {
206 int hashCode = _offset;
207 hashCode ^= (_message != null) ? _message.hashCode : 0;
208 hashCode ^= (_source != null) ? _source.hashCode : 0;
209 return hashCode;
210 }
211 /**
212 * Set the source in which the error occurred to the given source.
213 * @param source the source in which the error occurred
214 */
215 void set source2(Source source) {
216 this._source = source;
217 }
218 String toString() {
219 StringBuffer builder = new StringBuffer();
220 builder.add((_source != null) ? _source.fullName : "<unknown source>");
221 builder.add("(");
222 builder.add(_offset);
223 builder.add("..");
224 builder.add(_offset + _length - 1);
225 builder.add("): ");
226 builder.add(_message);
227 return builder.toString();
228 }
229 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698