| Index: packages/analyzer/lib/src/dart/element/utilities.dart
|
| diff --git a/packages/analyzer/lib/src/dart/element/utilities.dart b/packages/analyzer/lib/src/dart/element/utilities.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7c5aa4cece13c9975adc96fe90d51dc2bb05fe6b
|
| --- /dev/null
|
| +++ b/packages/analyzer/lib/src/dart/element/utilities.dart
|
| @@ -0,0 +1,34 @@
|
| +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +library analyzer.src.dart.element.utilities;
|
| +
|
| +import 'dart:collection';
|
| +
|
| +import 'package:analyzer/dart/element/element.dart';
|
| +import 'package:analyzer/dart/element/visitor.dart';
|
| +
|
| +/**
|
| + * A visitor that can be used to collect all of the non-synthetic elements in an
|
| + * element model.
|
| + */
|
| +class ElementGatherer extends GeneralizingElementVisitor {
|
| + /**
|
| + * The set in which the elements are collected.
|
| + */
|
| + final Set<Element> elements = new HashSet<Element>();
|
| +
|
| + /**
|
| + * Initialize the visitor.
|
| + */
|
| + ElementGatherer();
|
| +
|
| + @override
|
| + void visitElement(Element element) {
|
| + if (!element.isSynthetic) {
|
| + elements.add(element);
|
| + }
|
| + super.visitElement(element);
|
| + }
|
| +}
|
|
|