| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 | |
| 5 library analyzer.src.dart.element.utilities; | |
| 6 | |
| 7 import 'dart:collection'; | |
| 8 | |
| 9 import 'package:analyzer/dart/element/element.dart'; | |
| 10 import 'package:analyzer/dart/element/visitor.dart'; | |
| 11 | |
| 12 /** | |
| 13 * A visitor that can be used to collect all of the non-synthetic elements in an | |
| 14 * element model. | |
| 15 */ | |
| 16 class ElementGatherer extends GeneralizingElementVisitor { | |
| 17 /** | |
| 18 * The set in which the elements are collected. | |
| 19 */ | |
| 20 final Set<Element> elements = new HashSet<Element>(); | |
| 21 | |
| 22 /** | |
| 23 * Initialize the visitor. | |
| 24 */ | |
| 25 ElementGatherer(); | |
| 26 | |
| 27 @override | |
| 28 void visitElement(Element element) { | |
| 29 if (!element.isSynthetic) { | |
| 30 elements.add(element); | |
| 31 } | |
| 32 super.visitElement(element); | |
| 33 } | |
| 34 } | |
| OLD | NEW |