OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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 library old_servicec.plugins.dart; | 5 library old_servicec.plugins.dart; |
6 | 6 |
7 import 'dart:core' hide Type; | 7 import 'dart:core' hide Type; |
8 import 'dart:io' show Platform, File; | 8 import 'dart:io' show Platform, File; |
9 | 9 |
10 import 'package:path/path.dart' show basenameWithoutExtension, join, dirname; | 10 import 'package:path/path.dart' show basenameWithoutExtension, join, dirname; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 visitUnit(Unit node) { | 84 visitUnit(Unit node) { |
85 writeln(COPYRIGHT); | 85 writeln(COPYRIGHT); |
86 | 86 |
87 writeln('// Generated file. Do not edit.'); | 87 writeln('// Generated file. Do not edit.'); |
88 writeln(); | 88 writeln(); |
89 | 89 |
90 String libraryName = basenameWithoutExtension(path); | 90 String libraryName = basenameWithoutExtension(path); |
91 writeln('library $libraryName;'); | 91 writeln('library $libraryName;'); |
92 writeln(); | 92 writeln(); |
93 | 93 |
94 writeln('import "dart:fletch";'); | 94 writeln('import "dart:dartino";'); |
95 writeln('import "dart:fletch.ffi";'); | 95 writeln('import "dart:dartino.ffi";'); |
96 writeln('import "dart:fletch.service" as service;'); | 96 writeln('import "dart:dartino.service" as service;'); |
97 if (node.structs.isNotEmpty) { | 97 if (node.structs.isNotEmpty) { |
98 writeln('import "struct.dart";'); | 98 writeln('import "struct.dart";'); |
99 } | 99 } |
100 writeln(); | 100 writeln(); |
101 | 101 |
102 writeln('final Channel _channel = new Channel();'); | 102 writeln('final Channel _channel = new Channel();'); |
103 writeln('final Port _port = new Port(_channel);'); | 103 writeln('final Port _port = new Port(_channel);'); |
104 write('final ForeignFunction _postResult = '); | 104 write('final ForeignFunction _postResult = '); |
105 writeln('ForeignLibrary.main.lookup("PostResultToService");'); | 105 writeln('ForeignLibrary.main.lookup("PostResultToService");'); |
106 | 106 |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 Node resolved = node.resolved; | 473 Node resolved = node.resolved; |
474 if (resolved != null) { | 474 if (resolved != null) { |
475 write('${node.identifier}Builder'); | 475 write('${node.identifier}Builder'); |
476 } else { | 476 } else { |
477 String type = _types[node.identifier]; | 477 String type = _types[node.identifier]; |
478 write(type); | 478 write(type); |
479 } | 479 } |
480 } | 480 } |
481 | 481 |
482 } | 482 } |
OLD | NEW |