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

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

Issue 9143001: Fixes 2 tests and a crash (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 Expression('Binary', 'Token op, Expression x, Expression y'), 150 Expression('Binary', 'Token op, Expression x, Expression y'),
151 Expression('Unary', 'Token op, Expression self'), 151 Expression('Unary', 'Token op, Expression self'),
152 152
153 Expression('Postfix', 'Expression body, Token op'), 153 Expression('Postfix', 'Expression body, Token op'),
154 154
155 Expression('New', 155 Expression('New',
156 'bool isConst, TypeReference type, Identifier name,' + 156 'bool isConst, TypeReference type, Identifier name,' +
157 'List<ArgumentNode> arguments'), 157 'List<ArgumentNode> arguments'),
158 158
159 Expression('List', 159 Expression('List',
160 'bool isConst, TypeReference type, List<Expression> values'), 160 'bool isConst, TypeReference itemType, List<Expression> values'),
161 Expression('Map', 161 Expression('Map',
162 'bool isConst, TypeReference type, List<Expression> items'), 162 'bool isConst, TypeReference keyType, TypeReference valueType,' +
163 'List<Expression> items'),
163 164
164 Expression('Conditional', 165 Expression('Conditional',
165 'Expression test, Expression trueBranch, Expression falseBranch'), 166 'Expression test, Expression trueBranch, Expression falseBranch'),
166 167
167 Expression('Is', 'bool isTrue, Expression x, TypeReference type'), 168 Expression('Is', 'bool isTrue, Expression x, TypeReference type'),
168 Expression('Paren', 'Expression body'), 169 Expression('Paren', 'Expression body'),
169 Expression('Await', 'Expression body'), 170 Expression('Await', 'Expression body'),
170 171
171 Expression('Dot', 'Expression self, Identifier name'), 172 Expression('Dot', 'Expression self, Identifier name'),
172 Expression('Var', 'Identifier name'), 173 Expression('Var', 'Identifier name'),
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 cw.writeln('var output;') 235 cw.writeln('var output;')
235 cw.writeln('TreePrinter(this.output) { output.printer = this; }') 236 cw.writeln('TreePrinter(this.output) { output.printer = this; }')
236 for node in nodes: 237 for node in nodes:
237 node.writePrettyPrintMethod(cw) 238 node.writePrettyPrintMethod(cw)
238 cw.writeln() 239 cw.writeln()
239 cw.exitBlock('}') 240 cw.exitBlock('}')
240 241
241 cw.writeToFile('tree') 242 cw.writeToFile('tree')
242 243
243 if __name__ == '__main__': main() 244 if __name__ == '__main__': main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698