| 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 /** | 5 /** |
| 6 * An event generating parser of Dart programs. This parser expects | 6 * An event generating parser of Dart programs. This parser expects |
| 7 * all tokens in a linked list. | 7 * all tokens in a linked list (aka a token stream). |
| 8 * |
| 9 * The class [Scanner] is used to generate a token stream. See the |
| 10 * file scanner.dart. |
| 11 * |
| 12 * Subclasses of the class [Listener] are used to listen to events. |
| 8 */ | 13 */ |
| 9 class Parser { | 14 class Parser { |
| 10 final Listener listener; | 15 final Listener listener; |
| 11 bool mayParseFunctionExpressions = true; | 16 bool mayParseFunctionExpressions = true; |
| 12 | 17 |
| 13 Parser(Listener this.listener); | 18 Parser(Listener this.listener); |
| 14 | 19 |
| 15 void parseUnit(Token token) { | 20 void parseUnit(Token token) { |
| 16 while (token.kind !== EOF_TOKEN) { | 21 while (token.kind !== EOF_TOKEN) { |
| 17 token = parseTopLevelDeclaration(token); | 22 token = parseTopLevelDeclaration(token); |
| (...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1619 } | 1624 } |
| 1620 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 1625 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
| 1621 return expectSemicolon(token); | 1626 return expectSemicolon(token); |
| 1622 } | 1627 } |
| 1623 | 1628 |
| 1624 Token parseEmptyStatement(Token token) { | 1629 Token parseEmptyStatement(Token token) { |
| 1625 listener.handleEmptyStatement(token); | 1630 listener.handleEmptyStatement(token); |
| 1626 return expectSemicolon(token); | 1631 return expectSemicolon(token); |
| 1627 } | 1632 } |
| 1628 } | 1633 } |
| OLD | NEW |