| OLD | NEW |
| 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:html5lib/dom.dart' as dom; | 10 import 'package:html5lib/dom.dart' as dom; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 static const Map<String, String> _variableRenames = const { | 26 static const Map<String, String> _variableRenames = const { |
| 27 'default': 'defaultSdk' | 27 'default': 'defaultSdk' |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 /** | 30 /** |
| 31 * Type references in the spec that are named something else in Java. | 31 * Type references in the spec that are named something else in Java. |
| 32 */ | 32 */ |
| 33 static const Map<String, String> _typeRenames = const { | 33 static const Map<String, String> _typeRenames = const { |
| 34 'bool': 'boolean', | 34 'bool': 'boolean', |
| 35 'int': 'int', | 35 'int': 'int', |
| 36 'ExecutionContextId': 'String', |
| 36 'FilePath': 'String', | 37 'FilePath': 'String', |
| 37 'DebugContextId': 'String', | 38 'DebugContextId': 'String', |
| 38 'object': 'Object', | 39 'object': 'Object', |
| 39 'Override': 'OverrideMember', | 40 'Override': 'OverrideMember', |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 /** | 43 /** |
| 43 * Visitor used to produce doc comments. | 44 * Visitor used to produce doc comments. |
| 44 */ | 45 */ |
| 45 final ToHtmlVisitor toHtmlVisitor; | 46 final ToHtmlVisitor toHtmlVisitor; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 * Create a [GeneratedFile] that creates Java code and outputs it to [path]. | 292 * Create a [GeneratedFile] that creates Java code and outputs it to [path]. |
| 292 * [path] uses Posix-style path separators regardless of the OS. | 293 * [path] uses Posix-style path separators regardless of the OS. |
| 293 */ | 294 */ |
| 294 GeneratedFile javaGeneratedFile(String path, CodegenJavaVisitor | 295 GeneratedFile javaGeneratedFile(String path, CodegenJavaVisitor |
| 295 createVisitor(Api api)) { | 296 createVisitor(Api api)) { |
| 296 return new GeneratedFile(path, () { | 297 return new GeneratedFile(path, () { |
| 297 CodegenJavaVisitor visitor = createVisitor(readApi()); | 298 CodegenJavaVisitor visitor = createVisitor(readApi()); |
| 298 return visitor.collectCode(visitor.visitApi); | 299 return visitor.collectCode(visitor.visitApi); |
| 299 }); | 300 }); |
| 300 } | 301 } |
| OLD | NEW |