Index: ppapi/generators/apps_example.py |
diff --git a/ppapi/generators/apps_example.py b/ppapi/generators/apps_example.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..23fe104beb17e833932c05a2f49a2d9437e564f3 |
--- /dev/null |
+++ b/ppapi/generators/apps_example.py |
@@ -0,0 +1,34 @@ |
+#!/usr/bin/env python |
+# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import sys |
+ |
+from idl_option import ParseOptions |
+from idl_parser import IDLParser |
+ |
+def Main(): |
+ filenames = ParseOptions(sys.argv[1:]) |
+ for filename in filenames: |
+ f = open(filename, "r") |
+ content = f.read() |
+ f.close() |
+ parser = IDLParser() |
+ result = parser.ParseData(content, filename) |
+ if not result: |
+ print "No results - bailing out." |
+ return |
+ index = 1 |
+ for node in result: |
+ print "-------------------- Node %d --------------------" % index |
+ index += 1 |
+ print "Node class: '%s'\n" % node.cls |
+ if not hasattr(node, 'Dump'): |
+ print " No Dump function - skipping" |
+ continue |
+ node.Dump() |
+ |
+ |
+if __name__ == '__main__': |
+ sys.exit(Main()) |