java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.RNCNode
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.RNCDefine
All Implemented Interfaces:
RNCRange

public class RNCDefine extends RNCNode
  • Constructor Details

    • RNCDefine

      public RNCDefine(int start, int end)
      Creates a new define node spanning the given offsets.
      Parameters:
      start - the inclusive start offset of the entire define declaration.
      end - the exclusive end offset (adjusted as the define body is parsed).
  • Method Details

    • getNodeType

      public RNCNodeType getNodeType()
      Specified by:
      getNodeType in class RNCNode
    • setName

      public void setName(int start, int end)
      Sets the source offsets of the define name.

      Called by the parser when the name identifier token is encountered.

      Parameters:
      start - the inclusive start offset of the name.
      end - the exclusive end offset of the name.
    • getName

      public String getName()
      Returns the define name extracted from the source text.

      Example: for root = element root { text }, returns "root".

      Returns:
      the name string, or null if the name offsets have not been set.
    • getNameStart

      public int getNameStart()
      Returns the inclusive start offset of the define name.
      Returns:
      the name start offset, or -1 if not set.
    • getNameEnd

      public int getNameEnd()
      Returns the exclusive end offset of the define name.
      Returns:
      the name end offset, or -1 if not set.
    • getAssignType

      public RNCAssignType getAssignType()
      Returns the assignment operator type used in this define.
      Returns:
      the RNCAssignType (ASSIGN, CHOICE, or INTERLEAVE).
    • setAssignType

      public void setAssignType(RNCAssignType assignType)
      Sets the assignment operator type for this define.
      Parameters:
      assignType - the assignment type parsed from the source.
    • getText

      public String getText()
      Description copied from class: RNCNode
      Returns the source text spanned by this node.
      Overrides:
      getText in class RNCNode
      Returns:
      the text from RNCNode.getStart() to RNCNode.getEnd(), or null if this node is not attached to a document.