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

Side by Side Diff: pkg/analyzer_experimental/lib/src/generated/parser.dart

Issue 23769004: java2dart improvement - use field if getter/setter are trivial. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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
1 // This code was auto-generated, is not intended to be edited, and is subject to 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. 2 // significant change. Please see the README file for more information.
3 library engine.parser; 3 library engine.parser;
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'java_core.dart'; 5 import 'java_core.dart';
6 import 'instrumentation.dart'; 6 import 'instrumentation.dart';
7 import 'error.dart'; 7 import 'error.dart';
8 import 'source.dart'; 8 import 'source.dart';
9 import 'scanner.dart'; 9 import 'scanner.dart';
10 import 'ast.dart'; 10 import 'ast.dart';
11 import 'utilities_dart.dart'; 11 import 'utilities_dart.dart';
12 import 'engine.dart' show AnalysisEngine; 12 import 'engine.dart' show AnalysisEngine;
13 /** 13 /**
14 * Instances of the class `CommentAndMetadata` implement a simple data-holder fo r a method 14 * Instances of the class `CommentAndMetadata` implement a simple data-holder fo r a method
15 * that needs to return multiple values. 15 * that needs to return multiple values.
16 * 16 *
17 * @coverage dart.engine.parser 17 * @coverage dart.engine.parser
18 */ 18 */
19 class CommentAndMetadata { 19 class CommentAndMetadata {
20 20
21 /** 21 /**
22 * The documentation comment that was parsed, or `null` if none was given. 22 * The documentation comment that was parsed, or `null` if none was given.
23 */ 23 */
24 Comment _comment; 24 Comment comment;
25 25
26 /** 26 /**
27 * The metadata that was parsed. 27 * The metadata that was parsed.
28 */ 28 */
29 List<Annotation> _metadata; 29 List<Annotation> metadata;
30 30
31 /** 31 /**
32 * Initialize a newly created holder with the given data. 32 * Initialize a newly created holder with the given data.
33 * 33 *
34 * @param comment the documentation comment that was parsed 34 * @param comment the documentation comment that was parsed
35 * @param metadata the metadata that was parsed 35 * @param metadata the metadata that was parsed
36 */ 36 */
37 CommentAndMetadata(Comment comment, List<Annotation> metadata) { 37 CommentAndMetadata(Comment comment, List<Annotation> metadata) {
38 this._comment = comment; 38 this.comment = comment;
39 this._metadata = metadata; 39 this.metadata = metadata;
40 } 40 }
41
42 /**
43 * Return the documentation comment that was parsed, or `null` if none was giv en.
44 *
45 * @return the documentation comment that was parsed
46 */
47 Comment get comment => _comment;
48
49 /**
50 * Return the metadata that was parsed. If there was no metadata, then the lis t will be empty.
51 *
52 * @return the metadata that was parsed
53 */
54 List<Annotation> get metadata => _metadata;
55 } 41 }
56 /** 42 /**
57 * Instances of the class `FinalConstVarOrType` implement a simple data-holder f or a method 43 * Instances of the class `FinalConstVarOrType` implement a simple data-holder f or a method
58 * that needs to return multiple values. 44 * that needs to return multiple values.
59 * 45 *
60 * @coverage dart.engine.parser 46 * @coverage dart.engine.parser
61 */ 47 */
62 class FinalConstVarOrType { 48 class FinalConstVarOrType {
63 49
64 /** 50 /**
65 * The 'final', 'const' or 'var' keyword, or `null` if none was given. 51 * The 'final', 'const' or 'var' keyword, or `null` if none was given.
66 */ 52 */
67 Token _keyword; 53 Token keyword;
68 54
69 /** 55 /**
70 * The type, of `null` if no type was specified. 56 * The type, of `null` if no type was specified.
71 */ 57 */
72 TypeName _type; 58 TypeName type;
73 59
74 /** 60 /**
75 * Initialize a newly created holder with the given data. 61 * Initialize a newly created holder with the given data.
76 * 62 *
77 * @param keyword the 'final', 'const' or 'var' keyword 63 * @param keyword the 'final', 'const' or 'var' keyword
78 * @param type the type 64 * @param type the type
79 */ 65 */
80 FinalConstVarOrType(Token keyword, TypeName type) { 66 FinalConstVarOrType(Token keyword, TypeName type) {
81 this._keyword = keyword; 67 this.keyword = keyword;
82 this._type = type; 68 this.type = type;
83 } 69 }
84
85 /**
86 * Return the 'final', 'const' or 'var' keyword, or `null` if none was given.
87 *
88 * @return the 'final', 'const' or 'var' keyword
89 */
90 Token get keyword => _keyword;
91
92 /**
93 * Return the type, of `null` if no type was specified.
94 *
95 * @return the type
96 */
97 TypeName get type => _type;
98 } 70 }
99 /** 71 /**
100 * Instances of the class `Modifiers` implement a simple data-holder for a metho d that needs 72 * Instances of the class `Modifiers` implement a simple data-holder for a metho d that needs
101 * to return multiple values. 73 * to return multiple values.
102 * 74 *
103 * @coverage dart.engine.parser 75 * @coverage dart.engine.parser
104 */ 76 */
105 class Modifiers { 77 class Modifiers {
106 78
107 /** 79 /**
108 * The token representing the keyword 'abstract', or `null` if the keyword was not found. 80 * The token representing the keyword 'abstract', or `null` if the keyword was not found.
109 */ 81 */
110 Token _abstractKeyword; 82 Token abstractKeyword;
111 83
112 /** 84 /**
113 * The token representing the keyword 'const', or `null` if the keyword was no t found. 85 * The token representing the keyword 'const', or `null` if the keyword was no t found.
114 */ 86 */
115 Token _constKeyword; 87 Token constKeyword;
116 88
117 /** 89 /**
118 * The token representing the keyword 'external', or `null` if the keyword was not found. 90 * The token representing the keyword 'external', or `null` if the keyword was not found.
119 */ 91 */
120 Token _externalKeyword; 92 Token externalKeyword;
121 93
122 /** 94 /**
123 * The token representing the keyword 'factory', or `null` if the keyword was not found. 95 * The token representing the keyword 'factory', or `null` if the keyword was not found.
124 */ 96 */
125 Token _factoryKeyword; 97 Token factoryKeyword;
126 98
127 /** 99 /**
128 * The token representing the keyword 'final', or `null` if the keyword was no t found. 100 * The token representing the keyword 'final', or `null` if the keyword was no t found.
129 */ 101 */
130 Token _finalKeyword; 102 Token finalKeyword;
131 103
132 /** 104 /**
133 * The token representing the keyword 'static', or `null` if the keyword was n ot found. 105 * The token representing the keyword 'static', or `null` if the keyword was n ot found.
134 */ 106 */
135 Token _staticKeyword; 107 Token staticKeyword;
136 108
137 /** 109 /**
138 * The token representing the keyword 'var', or `null` if the keyword was not found. 110 * The token representing the keyword 'var', or `null` if the keyword was not found.
139 */ 111 */
140 Token _varKeyword; 112 Token varKeyword;
141
142 /**
143 * Return the token representing the keyword 'abstract', or `null` if the keyw ord was not
144 * found.
145 *
146 * @return the token representing the keyword 'abstract'
147 */
148 Token get abstractKeyword => _abstractKeyword;
149
150 /**
151 * Return the token representing the keyword 'const', or `null` if the keyword was not
152 * found.
153 *
154 * @return the token representing the keyword 'const'
155 */
156 Token get constKeyword => _constKeyword;
157
158 /**
159 * Return the token representing the keyword 'external', or `null` if the keyw ord was not
160 * found.
161 *
162 * @return the token representing the keyword 'external'
163 */
164 Token get externalKeyword => _externalKeyword;
165
166 /**
167 * Return the token representing the keyword 'factory', or `null` if the keywo rd was not
168 * found.
169 *
170 * @return the token representing the keyword 'factory'
171 */
172 Token get factoryKeyword => _factoryKeyword;
173
174 /**
175 * Return the token representing the keyword 'final', or `null` if the keyword was not
176 * found.
177 *
178 * @return the token representing the keyword 'final'
179 */
180 Token get finalKeyword => _finalKeyword;
181
182 /**
183 * Return the token representing the keyword 'static', or `null` if the keywor d was not
184 * found.
185 *
186 * @return the token representing the keyword 'static'
187 */
188 Token get staticKeyword => _staticKeyword;
189
190 /**
191 * Return the token representing the keyword 'var', or `null` if the keyword w as not found.
192 *
193 * @return the token representing the keyword 'var'
194 */
195 Token get varKeyword => _varKeyword;
196
197 /**
198 * Set the token representing the keyword 'abstract' to the given token.
199 *
200 * @param abstractKeyword the token representing the keyword 'abstract'
201 */
202 void set abstractKeyword(Token abstractKeyword2) {
203 this._abstractKeyword = abstractKeyword2;
204 }
205
206 /**
207 * Set the token representing the keyword 'const' to the given token.
208 *
209 * @param constKeyword the token representing the keyword 'const'
210 */
211 void set constKeyword(Token constKeyword2) {
212 this._constKeyword = constKeyword2;
213 }
214
215 /**
216 * Set the token representing the keyword 'external' to the given token.
217 *
218 * @param externalKeyword the token representing the keyword 'external'
219 */
220 void set externalKeyword(Token externalKeyword2) {
221 this._externalKeyword = externalKeyword2;
222 }
223
224 /**
225 * Set the token representing the keyword 'factory' to the given token.
226 *
227 * @param factoryKeyword the token representing the keyword 'factory'
228 */
229 void set factoryKeyword(Token factoryKeyword2) {
230 this._factoryKeyword = factoryKeyword2;
231 }
232
233 /**
234 * Set the token representing the keyword 'final' to the given token.
235 *
236 * @param finalKeyword the token representing the keyword 'final'
237 */
238 void set finalKeyword(Token finalKeyword2) {
239 this._finalKeyword = finalKeyword2;
240 }
241
242 /**
243 * Set the token representing the keyword 'static' to the given token.
244 *
245 * @param staticKeyword the token representing the keyword 'static'
246 */
247 void set staticKeyword(Token staticKeyword2) {
248 this._staticKeyword = staticKeyword2;
249 }
250
251 /**
252 * Set the token representing the keyword 'var' to the given token.
253 *
254 * @param varKeyword the token representing the keyword 'var'
255 */
256 void set varKeyword(Token varKeyword2) {
257 this._varKeyword = varKeyword2;
258 }
259 String toString() { 113 String toString() {
260 JavaStringBuilder builder = new JavaStringBuilder(); 114 JavaStringBuilder builder = new JavaStringBuilder();
261 bool needsSpace = appendKeyword(builder, false, _abstractKeyword); 115 bool needsSpace = appendKeyword(builder, false, abstractKeyword);
262 needsSpace = appendKeyword(builder, needsSpace, _constKeyword); 116 needsSpace = appendKeyword(builder, needsSpace, constKeyword);
263 needsSpace = appendKeyword(builder, needsSpace, _externalKeyword); 117 needsSpace = appendKeyword(builder, needsSpace, externalKeyword);
264 needsSpace = appendKeyword(builder, needsSpace, _factoryKeyword); 118 needsSpace = appendKeyword(builder, needsSpace, factoryKeyword);
265 needsSpace = appendKeyword(builder, needsSpace, _finalKeyword); 119 needsSpace = appendKeyword(builder, needsSpace, finalKeyword);
266 needsSpace = appendKeyword(builder, needsSpace, _staticKeyword); 120 needsSpace = appendKeyword(builder, needsSpace, staticKeyword);
267 appendKeyword(builder, needsSpace, _varKeyword); 121 appendKeyword(builder, needsSpace, varKeyword);
268 return builder.toString(); 122 return builder.toString();
269 } 123 }
270 124
271 /** 125 /**
272 * If the given keyword is not `null`, append it to the given builder, prefixi ng it with a 126 * If the given keyword is not `null`, append it to the given builder, prefixi ng it with a
273 * space if needed. 127 * space if needed.
274 * 128 *
275 * @param builder the builder to which the keyword will be appended 129 * @param builder the builder to which the keyword will be appended
276 * @param needsSpace `true` if the keyword needs to be prefixed with a space 130 * @param needsSpace `true` if the keyword needs to be prefixed with a space
277 * @param keyword the keyword to be appended 131 * @param keyword the keyword to be appended
(...skipping 6713 matching lines...) Expand 10 before | Expand all | Expand 10 after
6991 if ("\n" == separator) { 6845 if ("\n" == separator) {
6992 _writer.print("\n"); 6846 _writer.print("\n");
6993 indent(); 6847 indent();
6994 } else if (i > 0) { 6848 } else if (i > 0) {
6995 _writer.print(separator); 6849 _writer.print(separator);
6996 } 6850 }
6997 _writer.print(tokens[i].lexeme); 6851 _writer.print(tokens[i].lexeme);
6998 } 6852 }
6999 } 6853 }
7000 } 6854 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698