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

Side by Side Diff: ppapi/generators/idl_ast.py

Issue 8538029: Cleanup IDL Generator (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ppapi/generators/idl_c_header.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Nodes for PPAPI IDL AST.""" 7 """Nodes for PPAPI IDL AST."""
8 8
9 from idl_namespace import IDLNamespace 9 from idl_namespace import IDLNamespace
10 from idl_node import IDLAttribute, IDLFile, IDLNode 10 from idl_node import IDLAttribute, IDLFile, IDLNode
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 # 99 #
100 # IDLAst 100 # IDLAst
101 # 101 #
102 # A specialized version of the IDLNode for containing the whole of the 102 # A specialized version of the IDLNode for containing the whole of the
103 # AST. The specialized BuildTree function pulls the per file namespaces 103 # AST. The specialized BuildTree function pulls the per file namespaces
104 # into the global AST namespace and checks for collisions. 104 # into the global AST namespace and checks for collisions.
105 # 105 #
106 class IDLAst(IDLNode): 106 class IDLAst(IDLNode):
107 def __init__(self, children): 107 def __init__(self, children):
108 objs = [] 108 IDLNode.__init__(self, 'AST', 'BuiltIn', 1, 0, children)
109
110 builtin = None
111 extranodes = []
112 for filenode in children:
113 if filenode.GetProperty('NAME') == 'pp_stdint.idl':
114 builtin = filenode
115 break
116
117 IDLNode.__init__(self, 'AST', 'BuiltIn', 1, 0, extranodes + children)
118 self.Resolve() 109 self.Resolve()
119 110
120 def Resolve(self): 111 def Resolve(self):
121 self.namespace = IDLNamespace(None) 112 self.namespace = IDLNamespace(None)
122 self.namespace.name = 'AST' 113 self.namespace.name = 'AST'
123 IDLNamespaceLabelResolver().Visit(self, self.namespace) 114 IDLNamespaceLabelResolver().Visit(self, self.namespace)
124 IDLFileTypeResolver().Visit(self, None) 115 IDLFileTypeResolver().Visit(self, None)
125 116
126 # Build an ordered list of all releases 117 # Build an ordered list of all releases
127 self.releases = set() 118 self.releases = set()
128 for filenode in self.GetListOf('File'): 119 for filenode in self.GetListOf('File'):
129 self.releases |= set(filenode.release_map.GetReleases()) 120 self.releases |= set(filenode.release_map.GetReleases())
130 self.releases = sorted(self.releases) 121 self.releases = sorted(self.releases)
131 122
132 def SetTypeInfo(self, name, properties): 123 def SetTypeInfo(self, name, properties):
133 node = self.namespace[name] 124 node = self.namespace[name]
134 for prop in properties: 125 for prop in properties:
135 node.properties[prop] = properties[prop] 126 node.properties[prop] = properties[prop]
136 127
137 128
OLDNEW
« no previous file with comments | « no previous file | ppapi/generators/idl_c_header.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698