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

Unified Diff: tools/servicec/lib/src/pretty_printer.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/servicec/lib/src/plugins/shared.dart ('k') | tools/servicec/lib/src/primitives.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/servicec/lib/src/pretty_printer.dart
diff --git a/tools/servicec/lib/src/pretty_printer.dart b/tools/servicec/lib/src/pretty_printer.dart
deleted file mode 100644
index 04a31b1db2ea568050cbeb0816b03e1db0d7abb4..0000000000000000000000000000000000000000
--- a/tools/servicec/lib/src/pretty_printer.dart
+++ /dev/null
@@ -1,74 +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 old_servicec.pretty_printer;
-
-import 'parser.dart';
-import 'struct_layout.dart';
-
-import 'dart:core' hide Type;
-
-class PrettyPrinter extends Visitor {
- final StringBuffer buffer = new StringBuffer();
-
- visit(Node node) => node.accept(this);
-
- visitUnit(Unit node) {
- node.services.forEach(visit);
- node.structs.forEach(visit);
- }
-
- visitService(Service node) {
- buffer.writeln("service ${node.name} {");
- node.methods.forEach(visit);
- buffer.writeln("}");
- }
-
- visitMethod(Method node) {
- buffer.write(" ");
- writeType(node.returnType);
- buffer.write(" ${node.name}(");
- bool first = true;
- node.arguments.forEach((Formal formal) {
- if (!first) buffer.write(", ");
- first = false;
- visit(formal);
- });
- buffer.writeln(");");
- }
-
- visitStruct(Struct node) {
- StructLayout layout = node.layout;
- buffer.writeln("struct ${node.name} { // size = ${layout.size} bytes");
- for (Formal slot in node.slots) {
- buffer.write(" ");
- visit(slot);
- buffer.writeln("; // offset = ${layout[slot].offset}");
- }
- node.unions.forEach(visit);
- buffer.writeln("}");
- }
-
- visitUnion(Union node) {
- StructLayout layout = node.struct.layout;
- buffer.writeln(" union {");
- for (Formal slot in node.slots) {
- buffer.write(" ");
- visit(slot);
- buffer.writeln("; // offset = ${layout[slot].offset}");
- }
- buffer.writeln(" }");
- }
-
- visitFormal(Formal node) {
- writeType(node.type);
- buffer.write(" ${node.name}");
- }
-
- void writeType(Type node) {
- if (node.isList) buffer.write("List<");
- buffer.write(node.identifier);
- if (node.isList) buffer.write(">");
- }
-}
« no previous file with comments | « tools/servicec/lib/src/plugins/shared.dart ('k') | tools/servicec/lib/src/primitives.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698