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

Side by Side Diff: dart/lib/compiler/implementation/dart_backend/backend.dart

Issue 10982089: Remove AbstractVisitor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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
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 const bool REMOVE_ASSERTS = false; 5 const bool REMOVE_ASSERTS = false;
6 6
7 class ElementAst { 7 class ElementAst {
8 final Node ast; 8 final Node ast;
9 final TreeElements treeElements; 9 final TreeElements treeElements;
10 10
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 417
418 log(String message) => compiler.log('[DartBackend] $message'); 418 log(String message) => compiler.log('[DartBackend] $message');
419 } 419 }
420 420
421 /** 421 /**
422 * Some elements are not recorded by resolver now, 422 * Some elements are not recorded by resolver now,
423 * for example, typedefs or classes which are only 423 * for example, typedefs or classes which are only
424 * used in signatures, as/is operators or in super clauses 424 * used in signatures, as/is operators or in super clauses
425 * (just to name a few). Retraverse AST to pick those up. 425 * (just to name a few). Retraverse AST to pick those up.
426 */ 426 */
427 class ReferencedElementCollector extends AbstractVisitor { 427 class ReferencedElementCollector extends Visitor {
428 final Compiler compiler; 428 final Compiler compiler;
429 final Element rootElement; 429 final Element rootElement;
430 final TreeElements treeElements; 430 final TreeElements treeElements;
431 final newTypedefElementCallback; 431 final newTypedefElementCallback;
432 final newClassElementCallback; 432 final newClassElementCallback;
433 433
434 ReferencedElementCollector( 434 ReferencedElementCollector(
435 this.compiler, 435 this.compiler,
436 Element rootElement, this.treeElements, 436 Element rootElement, this.treeElements,
437 this.newTypedefElementCallback, this.newClassElementCallback) 437 this.newTypedefElementCallback, this.newClassElementCallback)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 } 477 }
478 478
479 compareElements(e0, e1) { 479 compareElements(e0, e1) {
480 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1); 480 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1);
481 if (result != 0) return result; 481 if (result != 0) return result;
482 return compareBy((e) => e.position().charOffset)(e0, e1); 482 return compareBy((e) => e.position().charOffset)(e0, e1);
483 } 483 }
484 484
485 List<Element> sortElements(Collection<Element> elements) => 485 List<Element> sortElements(Collection<Element> elements) =>
486 sorted(elements, compareElements); 486 sorted(elements, compareElements);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698