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

Side by Side Diff: frog/scripts/tree_gen.py

Issue 9464006: Fix for issue 1835: record the 'final' information in the DeclaredIdentifier. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « frog/parser.dart ('k') | frog/tree.g.dart » ('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/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 '''Generates the many subtypes of Node as well as a NodeVisitor into 6 '''Generates the many subtypes of Node as well as a NodeVisitor into
7 tree.g.dart.''' 7 tree.g.dart.'''
8 8
9 from codegen import CodeWriter 9 from codegen import CodeWriter
10 10
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 Node('Case', 202 Node('Case',
203 'Identifier label, List<Expression> cases, List<Statement> statements'), 203 'Identifier label, List<Expression> cases, List<Statement> statements'),
204 204
205 # Don't want to add Node to these names, use ! as convention to say so. 205 # Don't want to add Node to these names, use ! as convention to say so.
206 Node('TypeParameter!', 'Identifier name, TypeReference extendsType'), 206 Node('TypeParameter!', 'Identifier name, TypeReference extendsType'),
207 207
208 # TODO(jimhug): Consider removing this node and just using String. 208 # TODO(jimhug): Consider removing this node and just using String.
209 Node('Identifier!', 'String name'), 209 Node('Identifier!', 'String name'),
210 210
211 # Pseudo Expression for cover grammar approach 211 # Pseudo Expression for cover grammar approach
212 Expression('DeclaredIdentifier!', 'TypeReference type, Identifier name'), 212 Expression('DeclaredIdentifier!',
213 'TypeReference type, Identifier name, bool isFinal'),
213 ] 214 ]
214 215
215 def main(): 216 def main():
216 cw = CodeWriter(__file__) 217 cw = CodeWriter(__file__)
217 218
218 for node in nodes: 219 for node in nodes:
219 node.write(cw) 220 node.write(cw)
220 cw.writeln() 221 cw.writeln()
221 222
222 cw.writeln() 223 cw.writeln()
(...skipping 10 matching lines...) Expand all
233 cw.writeln('var output;') 234 cw.writeln('var output;')
234 cw.writeln('TreePrinter(this.output) { output.printer = this; }') 235 cw.writeln('TreePrinter(this.output) { output.printer = this; }')
235 for node in nodes: 236 for node in nodes:
236 node.writePrettyPrintMethod(cw) 237 node.writePrettyPrintMethod(cw)
237 cw.writeln() 238 cw.writeln()
238 cw.exitBlock('}') 239 cw.exitBlock('}')
239 240
240 cw.writeToFile('tree') 241 cw.writeToFile('tree')
241 242
242 if __name__ == '__main__': main() 243 if __name__ == '__main__': main()
OLDNEW
« no previous file with comments | « frog/parser.dart ('k') | frog/tree.g.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698