| 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 13 matching lines...) Expand all Loading... |
| 24 * reserved words in Java. | 24 * reserved words in Java. |
| 25 */ | 25 */ |
| 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 // TODO (jwren) in some situations we want to use Boolean while other |
| 35 // situations we want to use boolean... |
| 36 'bool': 'Boolean', |
| 35 'FilePath': 'String', | 37 'FilePath': 'String', |
| 36 'DebugContextId': 'String', | 38 'DebugContextId': 'String', |
| 37 'object': 'Object', | 39 'object': 'Object', |
| 38 'Override': 'OverrideMember', | 40 'Override': 'OverrideMember', |
| 39 }; | 41 }; |
| 40 | 42 |
| 41 /** | 43 /** |
| 42 * Visitor used to produce doc comments. | 44 * Visitor used to produce doc comments. |
| 43 */ | 45 */ |
| 44 final ToHtmlVisitor toHtmlVisitor; | 46 final ToHtmlVisitor toHtmlVisitor; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 * Create a [GeneratedFile] that creates Java code and outputs it to [path]. | 257 * Create a [GeneratedFile] that creates Java code and outputs it to [path]. |
| 256 * [path] uses Posix-style path separators regardless of the OS. | 258 * [path] uses Posix-style path separators regardless of the OS. |
| 257 */ | 259 */ |
| 258 GeneratedFile javaGeneratedFile(String path, CodegenJavaVisitor | 260 GeneratedFile javaGeneratedFile(String path, CodegenJavaVisitor |
| 259 createVisitor(Api api)) { | 261 createVisitor(Api api)) { |
| 260 return new GeneratedFile(path, () { | 262 return new GeneratedFile(path, () { |
| 261 CodegenJavaVisitor visitor = createVisitor(readApi()); | 263 CodegenJavaVisitor visitor = createVisitor(readApi()); |
| 262 return visitor.collectCode(visitor.visitApi); | 264 return visitor.collectCode(visitor.visitApi); |
| 263 }); | 265 }); |
| 264 } | 266 } |
| OLD | NEW |