OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 import sys |
| 7 |
| 8 from idl_option import ParseOptions |
| 9 from idl_parser import IDLParser |
| 10 |
| 11 def Main(): |
| 12 filenames = ParseOptions(sys.argv[1:]) |
| 13 for filename in filenames: |
| 14 f = open(filename, "r") |
| 15 content = f.read() |
| 16 f.close() |
| 17 parser = IDLParser() |
| 18 result = parser.ParseData(content, filename) |
| 19 if not result: |
| 20 print "No results - bailing out." |
| 21 return |
| 22 index = 1 |
| 23 for node in result: |
| 24 print "-------------------- Node %d --------------------" % index |
| 25 index += 1 |
| 26 print "Node class: '%s'\n" % node.cls |
| 27 if not hasattr(node, 'Dump'): |
| 28 print " No Dump function - skipping" |
| 29 continue |
| 30 node.Dump() |
| 31 |
| 32 |
| 33 if __name__ == '__main__': |
| 34 sys.exit(Main()) |
OLD | NEW |