Class ScopedTreeWalker


  • public class ScopedTreeWalker
    extends Object
    This class can be used to traverse a model tree after parsing for reference resolving. It follows scoping rules common to textual languages.

    It starts at the point of the reference, walking up the tree but visiting, for each step up, the children of the new parent. On each visited element it applies a set of deciders with which it is initialized.

    • Constructor Detail

      • ScopedTreeWalker

        public ScopedTreeWalker​(List<IResolutionTargetDecider> deciderList)
        Initializes a new walker with a list of deciders.
        Parameters:
        deciderList -
    • Method Detail

      • walk

        public EObject walk​(EObject startingPoint,
                            String identifier,
                            EObject container,
                            EReference crossReference)
        Main method.
        Parameters:
        startingPoint - starting point of the search.
        identifier - name of the target to resolve.
        container - container of the target to resolve.
        crossReference - reference in the container to the target.
        Returns:
        the target if one was found.