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

Side by Side Diff: dart/lib/compiler/implementation/scanner/parser.dart

Issue 10205015: Add some documentation to the parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 8 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 | « dart/lib/compiler/implementation/scanner/listener.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/scanner/listener.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698