OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 final bool VERBOSE = false; | 5 final bool VERBOSE = false; |
6 | 6 |
7 class Listener { | 7 class Listener { |
8 void beginArguments(Token token) { | 8 void beginArguments(Token token) { |
9 } | 9 } |
10 | 10 |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 NodeList supertypes = | 566 NodeList supertypes = |
567 makeNodeList(supertypeCount, extendsKeyword, null, ","); | 567 makeNodeList(supertypeCount, extendsKeyword, null, ","); |
568 Identifier name = popNode(); | 568 Identifier name = popNode(); |
569 pushElement(new PartialClassElement( | 569 pushElement(new PartialClassElement( |
570 name.source, interfaceKeyword, endToken, compilationUnitElement)); | 570 name.source, interfaceKeyword, endToken, compilationUnitElement)); |
571 } | 571 } |
572 | 572 |
573 void endFunctionTypeAlias(Token typedefKeyword, Token endToken) { | 573 void endFunctionTypeAlias(Token typedefKeyword, Token endToken) { |
574 Identifier name = popNode(); | 574 Identifier name = popNode(); |
575 TypeAnnotation returnType = popNode(); | 575 TypeAnnotation returnType = popNode(); |
| 576 pushElement(new TypedefElement(name.source, compilationUnitElement)); |
576 } | 577 } |
577 | 578 |
578 void handleVoidKeyword(Token token) { | 579 void handleVoidKeyword(Token token) { |
579 pushNode(new TypeAnnotation(new Identifier(token), null)); | 580 pushNode(new TypeAnnotation(new Identifier(token), null)); |
580 } | 581 } |
581 | 582 |
582 void endTopLevelMethod(Token beginToken, Token getOrSet, Token endToken) { | 583 void endTopLevelMethod(Token beginToken, Token getOrSet, Token endToken) { |
583 Identifier name = popNode(); | 584 Identifier name = popNode(); |
584 Modifiers modifiers = popNode(); | 585 Modifiers modifiers = popNode(); |
585 ElementKind kind; | 586 ElementKind kind; |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1455 | 1456 |
1456 Node parse(DiagnosticListener diagnosticListener, | 1457 Node parse(DiagnosticListener diagnosticListener, |
1457 CompilationUnitElement element, | 1458 CompilationUnitElement element, |
1458 doParse(Parser parser)) { | 1459 doParse(Parser parser)) { |
1459 NodeListener listener = new NodeListener(diagnosticListener, element); | 1460 NodeListener listener = new NodeListener(diagnosticListener, element); |
1460 doParse(new Parser(listener)); | 1461 doParse(new Parser(listener)); |
1461 Node node = listener.popNode(); | 1462 Node node = listener.popNode(); |
1462 assert(listener.nodes.isEmpty()); | 1463 assert(listener.nodes.isEmpty()); |
1463 return node; | 1464 return node; |
1464 } | 1465 } |
OLD | NEW |