| OLD | NEW |
| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 Expression('Is', 'bool isTrue, Expression x, TypeReference type'), | 167 Expression('Is', 'bool isTrue, Expression x, TypeReference type'), |
| 168 Expression('Paren', 'Expression body'), | 168 Expression('Paren', 'Expression body'), |
| 169 Expression('Await', 'Expression body'), | 169 Expression('Await', 'Expression body'), |
| 170 | 170 |
| 171 Expression('Dot', 'Expression self, Identifier name'), | 171 Expression('Dot', 'Expression self, Identifier name'), |
| 172 Expression('Var', 'Identifier name'), | 172 Expression('Var', 'Identifier name'), |
| 173 | 173 |
| 174 Expression('This'), | 174 Expression('This'), |
| 175 Expression('Super'), | 175 Expression('Super'), |
| 176 Expression('Null'), | |
| 177 | 176 |
| 178 Expression('Literal', 'var value, TypeReference type, String text'), | 177 Expression('Literal', 'Value value'), |
| 178 |
| 179 Expression('StringInterp', 'List<Expression> pieces'), |
| 179 | 180 |
| 180 # TODO(jimhug): Split into Simple and Qualified names | 181 # TODO(jimhug): Split into Simple and Qualified names |
| 181 TypeReference('Name', | 182 TypeReference('Name', |
| 182 'bool isFinal, Identifier name, List<Identifier> names'), | 183 'bool isFinal, Identifier name, List<Identifier> names'), |
| 183 | 184 |
| 184 TypeReference('Generic', | 185 TypeReference('Generic', |
| 185 'TypeReference baseType, List<TypeReference> typeArguments, int depth'), | 186 'TypeReference baseType, List<TypeReference> typeArguments, int depth'), |
| 186 TypeReference('Function', | 187 TypeReference('Function', |
| 187 'bool isFinal, FunctionDefinition func'), | 188 'bool isFinal, FunctionDefinition func'), |
| 188 TypeReference('Default', 'bool oldFactory, NameTypeReference baseType, '+ | 189 TypeReference('Default', 'bool oldFactory, NameTypeReference baseType, '+ |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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() |
| OLD | NEW |