Class CssConstantReferenceNode

  • All Implemented Interfaces:
    Locatable

    public class CssConstantReferenceNode
    extends CssValueNode
    A node holding a reference to a constant or an argument of a mixin definition.

    Because references can be valid within one block, each reference has a scope where it is valid. For example, references to arguments of mixin definitions are only valid in the block of the mixin definition whereas references to global definitions are valid everywhere.

    • Constructor Detail

      • CssConstantReferenceNode

        public CssConstantReferenceNode​(java.lang.String value,
                                        @Nullable
                                        SourceCodeLocation sourceCodeLocation)
      • CssConstantReferenceNode

        public CssConstantReferenceNode​(java.lang.String value)
      • CssConstantReferenceNode

        public CssConstantReferenceNode​(CssConstantReferenceNode node)
        Creates a new constant reference node that is a deep copy of the given node.
        Parameters:
        node - node
    • Method Detail

      • getScope

        public CssNode getScope()
        Returns the scope of the reference. If the reference belongs to a global definition, the scope is the 'global scope'. If the reference belongs to an argument of a mixin definition, the scope is the mixin definition.
        Returns:
        scope
      • setScope

        public void setScope​(CssNode scope)
      • isDefinitionReference

        public static boolean isDefinitionReference​(java.lang.String ident)
        Returns if the given identifier matches the pattern of a constant.
        Parameters:
        ident - identifier