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

Side by Side Diff: dart/frog/leg/scanner/scanner_task.dart

Issue 8508016: Create class AST nodes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: frogsh Created 9 years, 1 month 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/frog/leg/scanner/parser_bench.dart ('k') | dart/frog/leg/tree/nodes.dart » ('j') | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class ScannerTask extends CompilerTask { 5 class ScannerTask extends CompilerTask {
6 ScannerTask(Compiler compiler) : super(compiler); 6 ScannerTask(Compiler compiler) : super(compiler);
7 String get name() => 'Scanner'; 7 String get name() => 'Scanner';
8 8
9 void scan(Script script) { 9 void scan(Script script) {
10 measure(() { 10 measure(() {
11 Link<Element> elements = scanElements(script.text); 11 Link<Element> elements = scanElements(script.text);
12 for (Link<Element> link = elements; !link.isEmpty(); link = link.tail) { 12 for (Link<Element> link = elements; !link.isEmpty(); link = link.tail) {
13 compiler.universe.define(link.head); 13 compiler.universe.define(link.head);
14 } 14 }
15 }); 15 });
16 } 16 }
17 17
18 Link<Element> scanElements(String text) { 18 Link<Element> scanElements(String text) {
19 Token tokens = new StringScanner(text).tokenize(); 19 Token tokens = new StringScanner(text).tokenize();
20 ElementListener listener = new ElementListener(compiler); 20 ElementListener listener = new ElementListener(compiler);
21 Parser parser = new Parser(listener); 21 PartialParser parser = new PartialParser(listener);
22 parser.parseUnit(tokens); 22 parser.parseUnit(tokens);
23 return listener.topLevelElements; 23 return listener.topLevelElements;
24 } 24 }
25 } 25 }
OLDNEW
« no previous file with comments | « dart/frog/leg/scanner/parser_bench.dart ('k') | dart/frog/leg/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698