Class ReferenceCollectorVisitor


  • public class ReferenceCollectorVisitor
    extends LanguageVisitor

    This visitor class will traverse a language object tree and collect all references it finds.

    The easiest way to use this visitor is to call the static methods which create the visitor (and possibly the collection), run the visitor, and return the collection. The public visit() methods should NOT be called directly.

    • Constructor Detail

      • ReferenceCollectorVisitor

        public ReferenceCollectorVisitor()
    • Method Detail

      • getReferences

        public List<Reference> getReferences()
        Get the references collected by the visitor. This should best be called after the visitor has been run on the language object tree.
        Returns:
        Collection of ElementSymbol
      • visit

        public void visit​(Reference obj)
        Visit a language object and collect symbols. This method should NOT be called directly.
        Overrides:
        visit in class LanguageVisitor
        Parameters:
        obj - Language object
      • getReferences

        public static List<Reference> getReferences​(LanguageObject obj)
        Helper to quickly get the references from obj in a collection.
        Parameters:
        obj - Language object
        Returns:
        List of Reference