Class AstNode

    • Constructor Detail

      • AstNode

        protected AstNode()
    • Method Detail

      • matchString

        protected static boolean matchString​(java.lang.String pattern,
                                             java.lang.String text)
      • isLoop

        public static boolean isLoop​(AstNode statement)
      • isUnconditionalBranch

        public static boolean isUnconditionalBranch​(AstNode statement)
      • setRoleUnsafe

        final void setRoleUnsafe​(Role<?> role)
      • acceptVisitor

        public abstract <T,​R> R acceptVisitor​(IAstVisitor<? super T,​? extends R> visitor,
                                                    T data)
      • clone

        public AstNode clone()
        Overrides:
        clone in class java.lang.Object
      • copyUserDataFrom

        public void copyUserDataFrom​(AstNode source)
      • copyKey

        private static <T> void copyKey​(AstNode source,
                                        AstNode target,
                                        Key<T> key)
      • getParent

        public final AstNode getParent()
      • getPreviousSibling

        public final AstNode getPreviousSibling()
      • getLastChild

        public final AstNode getLastChild()
      • getPreviousSibling

        public final <T extends AstNode> T getPreviousSibling​(Role<? extends T> role)
      • getNextSibling

        public final <T extends AstNode> T getNextSibling​(Role<? extends T> role)
      • hasChildren

        public final boolean hasChildren()
      • getNextNode

        public final AstNode getNextNode()
      • getPreviousNode

        public final AstNode getPreviousNode()
      • getChildren

        public final java.lang.Iterable<AstNode> getChildren()
      • isAncestorOf

        public final boolean isAncestorOf​(AstNode node)
      • isAncestorOf

        public final boolean isAncestorOf​(AstNode node,
                                          AstNode stopAt)
      • isDescendantOf

        public final boolean isDescendantOf​(AstNode node)
      • getAncestors

        public final <T extends AstNode> java.lang.Iterable<T> getAncestors​(@NotNull
                                                                            java.lang.Class<T> type)
      • getAncestors

        public final java.lang.Iterable<AstNode> getAncestors()
      • getAncestorsAndSelf

        public final java.lang.Iterable<AstNode> getAncestorsAndSelf()
      • getDescendants

        public final java.lang.Iterable<AstNode> getDescendants()
      • getDescendantsAndSelf

        public final java.lang.Iterable<AstNode> getDescendantsAndSelf()
      • getChildByRole

        @NotNull
        public final <T extends AstNode> T getChildByRole​(Role<? extends T> role)
      • setChildByRole

        protected final <T extends AstNode> void setChildByRole​(Role<? extends T> role,
                                                                T newChild)
      • getParent

        public final <T extends AstNode> T getParent​(java.lang.Class<T> nodeType)
      • addChild

        public final <T extends AstNode> void addChild​(T child,
                                                       Role<? extends T> role)
      • addChildUnsafe

        final void addChildUnsafe​(AstNode child,
                                  Role<?> role)
      • insertChildrenBefore

        @SafeVarargs
        public final <T extends AstNode> void insertChildrenBefore​(AstNode nextSibling,
                                                                   Role<? extends T> role,
                                                                   T... children)
      • insertChildBefore

        public final <T extends AstNode> void insertChildBefore​(AstNode nextSibling,
                                                                T child,
                                                                Role<? extends T> role)
      • insertChildrenAfter

        @SafeVarargs
        public final <T extends AstNode> void insertChildrenAfter​(AstNode nextSibling,
                                                                  Role<? extends T> role,
                                                                  T... children)
      • insertChildAfter

        public final <T extends AstNode> void insertChildAfter​(AstNode previousSibling,
                                                               T child,
                                                               Role<? extends T> role)
      • insertChildBeforeUnsafe

        final void insertChildBeforeUnsafe​(AstNode nextSibling,
                                           AstNode child,
                                           Role<?> role)
      • remove

        public final void remove()
      • replaceWith

        public final void replaceWith​(AstNode newNode)
      • replaceWith

        public final <T extends AstNode> T replaceWith​(Function<? super AstNode,​? extends T> replaceFunction)
      • getNodeType

        public abstract NodeType getNodeType()
      • isReference

        public boolean isReference()
      • isNull

        public boolean isNull()
        Specified by:
        isNull in interface INode
      • setRole

        public final void setRole​(Role<?> role)
      • matches

        public abstract boolean matches​(INode other,
                                        Match match)
        Specified by:
        matches in interface INode
      • matches

        public final boolean matches​(INode other)
        Specified by:
        matches in interface INode
      • withName

        public NamedNode withName​(java.lang.String name)
      • getRegion

        public Region getRegion()
      • contains

        public final boolean contains​(int line,
                                      int column)
      • contains

        public final boolean contains​(TextLocation location)
      • isInside

        public final boolean isInside​(int line,
                                      int column)
      • isInside

        public final boolean isInside​(TextLocation location)
      • getText

        public java.lang.String getText()
      • debugToString

        java.lang.String debugToString()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • replace

        public final <T> boolean replace​(Key<T> key,
                                         T oldValue,
                                         T newValue)
        Specified by:
        replace in interface UserDataStore