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

Unified Diff: tools/immic/lib/src/plugins/shared.dart

Issue 2035023003: Remove service-compiler related code. (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/immic/lib/src/plugins/objc.dart ('k') | tools/immic/lib/src/primitives.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/immic/lib/src/plugins/shared.dart
diff --git a/tools/immic/lib/src/plugins/shared.dart b/tools/immic/lib/src/plugins/shared.dart
deleted file mode 100644
index 3fb72c61ebd5123620e3368c8f73850ef5055a86..0000000000000000000000000000000000000000
--- a/tools/immic/lib/src/plugins/shared.dart
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library immic.plugins.shared;
-
-import 'package:strings/strings.dart' as strings;
-import 'package:path/path.dart' show basename, basenameWithoutExtension;
-
-import '../parser.dart';
-export '../parser.dart';
-
-abstract class CodeGenerationVisitor extends Visitor {
- final String path;
- final StringBuffer buffer = new StringBuffer();
- HashMap<String, List<Type>> methodSignatures = {};
-
- CodeGenerationVisitor(this.path);
-
- String get libraryFile => basenameWithoutExtension(path);
- String get libraryName => 'immi.$libraryFile';
- String get baseName => camelize(libraryName);
- String serviceName = 'ImmiServiceLayer';
- String serviceFile = 'immi_service';
- String serviceImplName = 'ImmiServiceImpl';
- String serviceImplFile = 'immi_service_impl';
- String serviceImplLib = 'immi_service_impl';
- String immiGenPkg = 'package:immi';
- String serviceGenPkg = 'package:service';
-
- void write(String s) => buffer.write(s);
- void writeln([String s = '']) => buffer.writeln(s);
- void writeComma() => buffer.write(', ');
-
- String camelize(String name) {
- return strings.camelize(strings.underscore(name));
- }
-
- void forEachSlot(Struct node,
- void sep(),
- void f(Type slotType, String slotName)) {
- bool first = true;
- for (StructSlot slot in node.layout.slots) {
- if (!first && sep != null) sep();
- f(slot.slot.type, slot.slot.name);
- first = false;
- }
- }
-
- void forEachSlotAndMethod(Struct node,
- void sep(),
- void f(field, String name)) {
- bool first = true;
- for (StructSlot slot in node.layout.slots) {
- if (!first && sep != null) sep();
- f(slot.slot, slot.slot.name);
- first = false;
- }
- for (Method method in node.methods) {
- if (!first && sep != null) sep();
- f(method, method.name);
- first = false;
- }
- }
-
- visit(Node node) => node.accept(this);
-
- visitStruct(Struct node) {
- // TODO(kasper): Stop ignoring this.
- }
-
- visitUnion(Union node) {
- // TODO(kasper): Stop ignoring this.
- }
-
- visitImport(Import node) {
- }
-
- visitNodes(List<Node> nodes, String separatedBy(bool first)) {
- bool first = true;
- for (int i = 0; i < nodes.length; i++) {
- write(separatedBy(first));
- if (first) first = false;
- visit(nodes[i]);
- }
- }
-
- void collectMethodSignatures(Unit unit) {
- for (var node in unit.structs) {
- for (var method in node.methods) {
- assert(method.returnType.isVoid);
- String signature =
- method.arguments.map((formal) => formal.type.identifier);
- methodSignatures.putIfAbsent('$signature', () {
- return method.arguments.map((formal) => formal.type);
- });
- }
- }
- }
-
- String actionTypeSuffix(List<Type> types) {
- if (types.isEmpty) return 'Void';
- return types.map((Type type) => camelize(type.identifier)).join();
- }
-
- Iterable mapWithIndex(List list, f(int i, element)) {
- int i = 0;
- return list.map((e) => f(i++, e));
- }
-}
« no previous file with comments | « tools/immic/lib/src/plugins/objc.dart ('k') | tools/immic/lib/src/primitives.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698