summaryrefslogtreecommitdiffstats
path: root/ppapi/generators/idl_parser.py
diff options
context:
space:
mode:
authornoelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-07 01:36:01 +0000
committernoelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-07 01:36:01 +0000
commitf0dd202ffdb5779229f52c6cfda50853778d7287 (patch)
tree3db2016e6a329cae384b3b275af5a52698ec3f85 /ppapi/generators/idl_parser.py
parent473c01ccb10d0e459a6f06784c38ed8e2bc7215b (diff)
downloadchromium_src-f0dd202ffdb5779229f52c6cfda50853778d7287.zip
chromium_src-f0dd202ffdb5779229f52c6cfda50853778d7287.tar.gz
chromium_src-f0dd202ffdb5779229f52c6cfda50853778d7287.tar.bz2
Fix 'C' header generation
Added chidlist which provides in-order access to node children. Extra warning information on idl_parse. Added 'srcdir' to parser for prepending path Added header generator Fixed minor errors in idl_c_proto BUG= http://codereview.chromium.org/7085014/ TEST= python idl_c_header.py --srcdir="../api" *.idl Review URL: http://codereview.chromium.org/7056069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88079 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/generators/idl_parser.py')
-rw-r--r--ppapi/generators/idl_parser.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/ppapi/generators/idl_parser.py b/ppapi/generators/idl_parser.py
index 4f38d49..d2caad1 100644
--- a/ppapi/generators/idl_parser.py
+++ b/ppapi/generators/idl_parser.py
@@ -41,6 +41,8 @@ Option('build_debug', 'Debug tree building.')
Option('parse_debug', 'Debug parse reduction steps.')
Option('token_debug', 'Debug token generation.')
Option('dump_tree', 'Dump the tree.')
+Option('srcdir', 'Working directory', default='.')
+
#
# ERROR_REMAP
@@ -221,9 +223,7 @@ class IDLParser(IDLLexer):
Copyright = self.BuildProduction('Copyright', p, 1, None)
Filedoc = self.BuildProduction('Comment', p, 2, None)
- out = ListFromConcat(p[3], p[4])
- out = ListFromConcat(Filedoc, out)
- p[0] = ListFromConcat(Copyright, out)
+ p[0] = ListFromConcat(Copyright, Filedoc, p[3], p[4])
if self.parse_debug: DumpReduction('top', p)
# Build a list of top level items.
@@ -620,7 +620,7 @@ class IDLParser(IDLLexer):
def VerifyProduction(self, node):
comment = node.GetOneOf('Comment')
if node.cls in ['Interface', 'Struct', 'Function'] and not comment:
- self.Warn(node, 'Missing comment.')
+ self.Warn(node, 'Missing comment for %s.' % node)
if node.cls in ['Param']:
found = False;
for form in ['in', 'inout', 'out']:
@@ -684,7 +684,8 @@ class IDLParser(IDLLexer):
# Loads a new file into the lexer and attemps to parse it.
#
def ParseFile(self, filename):
- data = open(filename).read()
+ loadname = os.path.join(GetOption('srcdir'), filename)
+ data = open(loadname).read()
if self.verbose:
InfoOut.Log("Parsing %s" % filename)
try: