Class AbstractNode<Tag extends java.lang.Enum<Tag>>

    • Constructor Detail

      • AbstractNode

        protected AbstractNode​(Tag tag,
                               java.util.EnumSet<Tag> childrenTags,
                               AbstractNode.NodeKind kind,
                               AbstractNode<Tag> parent)
        Creates a node.
        Parameters:
        tag - the tag.
        childrenTags - the admissible tags of the node's children.
        kind - the kind.
        parent - the parent node.
      • AbstractNode

        protected AbstractNode​(Tag tag,
                               java.util.EnumSet<Tag> childrenTags,
                               AbstractNode.NodeKind kind)
        Creates a node.
        Parameters:
        tag - the tag.
        childrenTags - the admissible tags of the node's children.
        kind - the kind.
      • AbstractNode

        protected AbstractNode​(AbstractNode<Tag> other)
        Creates a copy of the node.
        Parameters:
        other - the node to be copied.
      • AbstractNode

        protected AbstractNode​(AbstractNode<Tag> other,
                               AbstractNode<Tag> parent)
        Creates a copy of the node.
        Parameters:
        other - the node to be copied.
        parent - the parent node to be set.
    • Method Detail

      • getName

        public final java.lang.String getName()
        Returns the name of the node.
        Returns:
        the name of the node.
      • getFullName

        public final java.lang.String getFullName()
        Returns the fully qualified name of the node.
        Returns:
        the full name of the node.
      • setName

        public final void setName​(java.lang.String name)
        Sets the name of the node.
        Parameters:
        name - the name to be set.
      • getTag

        public final Tag getTag()
        Returns the tag of the node.
        Returns:
        the tag of the node.
      • setTag

        public final void setTag​(Tag tag)
        Sets the tag of the node.
        Parameters:
        tag - the tag to be set.
      • hasName

        public final boolean hasName()
        Checks whether the node has a name.
        Returns:
        true iff the node has a name.
      • hasScope

        public final boolean hasScope()
        Checks whether the node has a scope.
        Returns:
        true iff the node has a scope.
      • isTransparent

        public final boolean isTransparent()
        Checks whether the node is transparent (i.e. has no a real scope).
        Returns:
        true iff the node is transparent.
      • getParent

        public final AbstractNode<Tag> getParent()
        Returns the parent of the node.
        Returns:
        the parent node or null if the node is a top-level one.
      • setParent

        public final void setParent​(AbstractNode<Tag> parent)
        Sets the parent of the node.
        Parameters:
        parent - the parent node to be set.
      • toString

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

        public final java.util.Collection<AbstractNode<Tag>> items​(java.util.EnumSet<Tag> tags)
        Description copied from class: AbstractSymbolTable
        Returns the items whose tags belong to the given set.
        Specified by:
        items in class AbstractSymbolTable<Tag extends java.lang.Enum<Tag>>
        Parameters:
        tags - the set of tags.
        Returns:
        the collection of items.
      • find

        public final AbstractNode<Tag> find​(java.lang.String name)
        Description copied from class: AbstractSymbolTable
        Returns an item of the symbol table with the given name.
        Specified by:
        find in class AbstractSymbolTable<Tag extends java.lang.Enum<Tag>>
        Parameters:
        name - the name.
        Returns:
        an item or null.
      • replace

        public void replace​(AbstractNode<Tag> oldNode,
                            java.util.Collection<AbstractNode<Tag>> newNodes)
        Description copied from class: AbstractSymbolTable
        Replaces the item of the symbol table with the given items.

        All items should have the same tag.

        Specified by:
        replace in class AbstractSymbolTable<Tag extends java.lang.Enum<Tag>>
        Parameters:
        oldNode - the existing item to be replaced.
        newNodes - the items to to replace the existing one.
      • setRedefinitionHandler

        protected final void setRedefinitionHandler​(ErrorHandler<Tag> redefinitionHandler)
        Sets the redefinition handler.
        Parameters:
        redefinitionHandler - the handler to be set.