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

Side by Side Diff: pkg/analysis_server/tool/spec/codegen_java.dart

Issue 1431683002: Refactor analysis server code generation to re-use logic from analyzer. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Tools for Java code generation. 6 * Tools for Java code generation.
7 */ 7 */
8 library CodegenJava; 8 library CodegenJava;
9 9
10 import 'package:analyzer/src/codegen/tools.dart';
10 import 'package:html/dom.dart' as dom; 11 import 'package:html/dom.dart' as dom;
11 12
12 import 'api.dart'; 13 import 'api.dart';
13 import 'codegen_tools.dart';
14 import 'from_html.dart'; 14 import 'from_html.dart';
15 import 'to_html.dart'; 15 import 'to_html.dart';
16 16
17 /** 17 /**
18 * Create a [GeneratedFile] that creates Java code and outputs it to [path]. 18 * Create a [GeneratedFile] that creates Java code and outputs it to [path].
19 * [path] uses Posix-style path separators regardless of the OS. 19 * [path] uses Posix-style path separators regardless of the OS.
20 */ 20 */
21 GeneratedFile javaGeneratedFile( 21 GeneratedFile javaGeneratedFile(
22 String path, CodegenJavaVisitor createVisitor(Api api)) { 22 String path, CodegenJavaVisitor createVisitor(Api api)) {
23 return new GeneratedFile(path, () { 23 return new GeneratedFile(path, (String pkgPath) {
24 CodegenJavaVisitor visitor = createVisitor(readApi()); 24 CodegenJavaVisitor visitor = createVisitor(readApi(pkgPath));
25 return visitor.collectCode(visitor.visitApi); 25 return visitor.collectCode(visitor.visitApi);
26 }); 26 });
27 } 27 }
28 28
29 /** 29 /**
30 * Iterate through the values in [map] in the order of increasing keys. 30 * Iterate through the values in [map] in the order of increasing keys.
31 */ 31 */
32 Iterable<String> _valuesSortedByKey(Map<String, String> map) { 32 Iterable<String> _valuesSortedByKey(Map<String, String> map) {
33 List<String> keys = map.keys.toList(); 33 List<String> keys = map.keys.toList();
34 keys.sort(); 34 keys.sort();
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 /** 293 /**
294 * Temporary storage for private fields. 294 * Temporary storage for private fields.
295 */ 295 */
296 Map<String, String> privateFields = <String, String>{}; 296 Map<String, String> privateFields = <String, String>{};
297 297
298 /** 298 /**
299 * Temporary storage for constructors. 299 * Temporary storage for constructors.
300 */ 300 */
301 Map<String, String> constructors = <String, String>{}; 301 Map<String, String> constructors = <String, String>{};
302 } 302 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/tool/spec/codegen_inttest_methods.dart ('k') | pkg/analysis_server/tool/spec/codegen_java_types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698