OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 * This file contains code to generate serialization/deserialization logic for | 6 * This file contains code to generate serialization/deserialization logic for |
7 * summaries based on an "IDL" description of the summary format (written in | 7 * summaries based on an "IDL" description of the summary format (written in |
8 * stylized Dart). | 8 * stylized Dart). |
9 * | 9 * |
10 * For each class in the "IDL" input, two corresponding classes are generated: | 10 * For each class in the "IDL" input, two corresponding classes are generated: |
11 * - A class with the same name which represents deserialized summary data in | 11 * - A class with the same name which represents deserialized summary data in |
12 * memory. This class has read-only semantics. | 12 * memory. This class has read-only semantics. |
13 * - A "builder" class which can be used to generate serialized summary data. | 13 * - A "builder" class which can be used to generate serialized summary data. |
14 * This class has write-only semantics. | 14 * This class has write-only semantics. |
15 * | 15 * |
16 * Each of the "builder" classes has a single `finish` method which writes | 16 * Each of the "builder" classes has a single `finish` method which writes |
17 * the entity being built into the given FlatBuffer and returns the `Offset` | 17 * the entity being built into the given FlatBuffer and returns the `Offset` |
18 * reference to it. | 18 * reference to it. |
19 */ | 19 */ |
20 library analyzer.tool.summary.generate; | 20 library analyzer.tool.summary.generate; |
21 | 21 |
22 import 'dart:convert'; | 22 import 'dart:convert'; |
23 import 'dart:io' hide File; | 23 import 'dart:io' hide File; |
24 | 24 |
25 import 'package:analyzer/analyzer.dart'; | 25 import 'package:analyzer/analyzer.dart'; |
26 import 'package:analyzer/dart/ast/token.dart'; | 26 import 'package:analyzer/dart/ast/token.dart'; |
| 27 import 'package:analyzer/error/listener.dart'; |
27 import 'package:analyzer/file_system/file_system.dart'; | 28 import 'package:analyzer/file_system/file_system.dart'; |
28 import 'package:analyzer/file_system/physical_file_system.dart'; | 29 import 'package:analyzer/file_system/physical_file_system.dart'; |
29 import 'package:analyzer/src/codegen/tools.dart'; | 30 import 'package:analyzer/src/codegen/tools.dart'; |
30 import 'package:analyzer/src/dart/scanner/reader.dart'; | 31 import 'package:analyzer/src/dart/scanner/reader.dart'; |
31 import 'package:analyzer/src/dart/scanner/scanner.dart'; | 32 import 'package:analyzer/src/dart/scanner/scanner.dart'; |
32 import 'package:analyzer/src/generated/parser.dart'; | 33 import 'package:analyzer/src/generated/parser.dart'; |
33 import 'package:analyzer/src/generated/source.dart'; | 34 import 'package:analyzer/src/generated/source.dart'; |
34 import 'package:path/path.dart'; | 35 import 'package:path/path.dart'; |
35 | 36 |
36 import 'idl_model.dart' as idlModel; | 37 import 'idl_model.dart' as idlModel; |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 return token.lexeme.split('\n').map((String line) { | 1024 return token.lexeme.split('\n').map((String line) { |
1024 if (line.startsWith(indent)) { | 1025 if (line.startsWith(indent)) { |
1025 line = line.substring(indent.length); | 1026 line = line.substring(indent.length); |
1026 } | 1027 } |
1027 return line; | 1028 return line; |
1028 }).join('\n'); | 1029 }).join('\n'); |
1029 } | 1030 } |
1030 return null; | 1031 return null; |
1031 } | 1032 } |
1032 } | 1033 } |
OLD | NEW |