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

Unified Diff: ppapi/generators/apps_example.py

Issue 9388002: Add support for Chrome Apps to IDL lexer/parser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed reduce conflicts and allowed use of callback as identifier Created 8 years, 10 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
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..a40c85d76f0787e7e5c1e5cfa4923128a85c4b84
--- /dev/null
+++ b/ppapi/generators/apps_example.py
@@ -0,0 +1,35 @@
+#!/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:
+ print "parsing %s" % filename
+ 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(comments=True)
+
+
+if __name__ == '__main__':
+ sys.exit(Main())

Powered by Google App Engine
This is Rietveld 408576698