Class CssNode

    • Constructor Detail

      • CssNode

        protected CssNode()
        Constructor of a node.
      • CssNode

        protected CssNode​(@Nullable
                          SourceCodeLocation sourceCodeLocation)
        Constructor of a node.
        Parameters:
        sourceCodeLocation - sourceCodeLocation
      • CssNode

        protected CssNode​(@Nullable
                          CssNode parent)
        Constructor of a node.
        Parameters:
        parent - parent
      • CssNode

        protected CssNode​(@Nullable
                          CssNode parent,
                          @Nullable
                          SourceCodeLocation sourceCodeLocation)
        Constructor of a node.
        Parameters:
        parent - parent
        sourceCodeLocation - sourceCodeLocation
      • CssNode

        protected CssNode​(@Nullable
                          CssNode parent,
                          @Nullable
                          java.util.List<CssCommentNode> comments,
                          @Nullable
                          SourceCodeLocation sourceCodeLocation)
        Constructor of a node.
        Parameters:
        parent - parent
        comments - comments
        sourceCodeLocation - sourceCodeLocation
    • Method Detail

      • deepCopy

        public abstract CssNode deepCopy()
      • getParent

        public CssNode getParent()
      • setSourceCodeLocation

        public void setSourceCodeLocation​(@Nullable
                                          SourceCodeLocation sourceCodeLocation)
      • appendComment

        public void appendComment​(CssCommentNode comment)
      • setComments

        public void setComments​(java.util.List<CssCommentNode> comments)
      • hasComment

        public boolean hasComment​(java.lang.String comment)
        Returns whether one of the comments attached to this node exactly matches the given string.
        Parameters:
        comment - comment
      • getShouldBeFlipped

        public boolean getShouldBeFlipped()
      • setShouldBeFlipped

        public void setShouldBeFlipped​(boolean shouldBeFlipped)
        Marks a node whether it should be flipped or not.
        Parameters:
        shouldBeFlipped - Whether the node should be flipped or not.
      • equals

        public final boolean equals​(@Nullable
                                    java.lang.Object obj)
        This is the default implementation of equals(). The method is marked final so that nobody changes the default behavior.

        The rationale for not allowing redefinition of equals is that different compiler passes and different optimizations have their own notion of equality. In order to avoid confusion and errors everybody that needs a custom definition of equality and custom hash codes should use customized collections with custom comparators or hash code providers.

        In addition, this class should not implement Comparable. Use Comparator instead.

        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(Object)
      • hashCode

        public final int hashCode()
        This is the default implementation of hashCode(). The method is marked final so that nobody changes the default behavior.
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        equals(Object), Object.hashCode()
      • toString

        public java.lang.String toString()
        This is the default implementation of toString().

        Overriding this method should only be done for debugging or logging purposes, not for the actual functionality of the compiler. If a string representation of a tree is needed, define a Visitor that builds the desired representation.

        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • ancestors

        public java.lang.Iterable<CssNode> ancestors()
        This node and the transitive closure of its parents.
      • inFunArgs

        public boolean inFunArgs()
        Returns true when any of a node's ancestors() is a function node.
      • deepCopyNodes

        public static <N extends CssNode> java.util.List<N> deepCopyNodes​(java.util.List<N> nodes)