java.lang.Object
java.lang.Enum<RNCTokenType>
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.parser.RNCTokenType
All Implemented Interfaces:
Serializable, Comparable<RNCTokenType>, Constable

public enum RNCTokenType extends Enum<RNCTokenType>
Enumerates the token types produced by RNCScanner when scanning RELAX NG Compact Syntax (RNC) text.

Use case: consumed by all RNC language features (formatting, semantic tokens, folding, highlighting, completions, code actions) to analyze the structure of an RNC document without building a full AST.

Example — the RNC text start = element root &#123; text &#125; produces the following token sequence:

 KeywordStart  "start"
 Whitespace    " "
 Assign        "="
 Whitespace    " "
 KeywordElement "element"
 Whitespace    " "
 Identifier    "root"
 Whitespace    " "
 BraceOpen     "{"
 Whitespace    " "
 KeywordText   "text"
 Whitespace    " "
 BraceClose    "}"
 EOS
 
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The interleave operator: &.
    The assignment operator: =.
    The choice-combine assignment operator: |=.
    The interleave-combine assignment operator: &=.
    The backslash: \.
    Closing brace: &#125;.
    Opening brace: &#123;.
    Closing bracket: ].
    Opening bracket: [.
    The colon separator: :.
    The group (sequence) operator: ,.
    A single-line comment starting with # (but not ##).
    A documentation comment starting with ##.
    End of stream — returned when the scanner has consumed all input.
    A user-defined identifier (define name, element/attribute name reference).
    The attribute keyword — defines an attribute pattern.
    The datatypes keyword — declares a datatype library prefix.
    The default keyword — used with namespace to set the default namespace.
    The div keyword — groups grammar definitions for organizational purposes (has no semantic effect).
    The element keyword — defines an element pattern.
    The empty keyword — matches empty content (no text, no elements).
    The external keyword — references an external grammar as a pattern.
    The grammar keyword — defines an explicit grammar block.
    The include keyword — includes another RNC grammar file.
    The inherit keyword — inherits the default namespace from the including grammar.
    The list keyword — matches whitespace-separated tokens.
    The mixed keyword — equivalent to (text | pattern)*, allows mixed content.
    The namespace keyword — declares a namespace prefix.
    The notAllowed keyword — a pattern that matches nothing.
    The parent keyword — references a define in the parent grammar (used inside grammar blocks).
    The start keyword — defines the start pattern of the grammar.
    The string keyword — built-in datatype that matches a string value (with whitespace normalization).
    The text keyword — matches any text content.
    The token keyword — built-in datatype that matches a tokenized string (whitespace collapsed).
    A quoted string literal (single or double quotes, including triple-quoted).
    The minus operator: -.
    Closing parenthesis: ).
    Opening parenthesis: (.
    The choice (alternation) operator: |.
    The one-or-more postfix operator: +.
    The optional postfix operator: ? — zero or one occurrence.
    The zero-or-more postfix operator: *.
    The tilde operator: ~.
    An unknown/unrecognized character.
    Whitespace: spaces, tabs, newlines, carriage returns.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static RNCTokenType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • EOS

      public static final RNCTokenType EOS
      End of stream — returned when the scanner has consumed all input.
    • Identifier

      public static final RNCTokenType Identifier
      A user-defined identifier (define name, element/attribute name reference).

      Use case: in root = element root &#123; text &#125;, the first root is an Identifier (define name), while the second root after element is also an Identifier (element name).

      Escaped identifiers (\element, \text) are also reported as Identifier, allowing reserved words to be used as names.

    • Literal

      public static final RNCTokenType Literal
      A quoted string literal (single or double quotes, including triple-quoted).

      Use case: namespace URIs, datatype values, include file paths.

      Examples: "http://example.com", 'value', """multi-line""".

    • Comment

      public static final RNCTokenType Comment
      A single-line comment starting with # (but not ##).

      Example: # This is a regular comment

    • DocumentationComment

      public static final RNCTokenType DocumentationComment
      A documentation comment starting with ##.

      Documentation comments are attached to the following definition and can be used to generate human-readable schema documentation.

      Example: ## The root element of the document

    • KeywordNamespace

      public static final RNCTokenType KeywordNamespace
      The namespace keyword — declares a namespace prefix.

      Example: namespace a = "http://example.com"

    • KeywordDefault

      public static final RNCTokenType KeywordDefault
      The default keyword — used with namespace to set the default namespace.

      Example: default namespace = "http://example.com"

    • KeywordDatatypes

      public static final RNCTokenType KeywordDatatypes
      The datatypes keyword — declares a datatype library prefix.

      Example: datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"

    • KeywordElement

      public static final RNCTokenType KeywordElement
      The element keyword — defines an element pattern.

      Example: element root &#123; text &#125;

    • KeywordAttribute

      public static final RNCTokenType KeywordAttribute
      The attribute keyword — defines an attribute pattern.

      Example: attribute id &#123; text &#125;

    • KeywordList

      public static final RNCTokenType KeywordList
      The list keyword — matches whitespace-separated tokens.

      Example: list &#123; xsd:integer+ &#125;

    • KeywordMixed

      public static final RNCTokenType KeywordMixed
      The mixed keyword — equivalent to (text | pattern)*, allows mixed content.

      Example: mixed &#123; element b &#123; text &#125;* &#125;

    • KeywordText

      public static final RNCTokenType KeywordText
      The text keyword — matches any text content.

      Example: element name &#123; text &#125;

    • KeywordEmpty

      public static final RNCTokenType KeywordEmpty
      The empty keyword — matches empty content (no text, no elements).

      Example: element br &#123; empty &#125;

    • KeywordNotAllowed

      public static final RNCTokenType KeywordNotAllowed
      The notAllowed keyword — a pattern that matches nothing. Used for extensibility (a definition can be overridden via combine).

      Example: extra = notAllowed

    • KeywordExternal

      public static final RNCTokenType KeywordExternal
      The external keyword — references an external grammar as a pattern.

      Example: external "other.rnc"

    • KeywordGrammar

      public static final RNCTokenType KeywordGrammar
      The grammar keyword — defines an explicit grammar block.

      Example: grammar &#123; start = element root &#123; text &#125; &#125;

    • KeywordStart

      public static final RNCTokenType KeywordStart
      The start keyword — defines the start pattern of the grammar.

      Example: start = root

    • KeywordInclude

      public static final RNCTokenType KeywordInclude
      The include keyword — includes another RNC grammar file.

      Example: include "common.rnc"

    • KeywordDiv

      public static final RNCTokenType KeywordDiv
      The div keyword — groups grammar definitions for organizational purposes (has no semantic effect).

      Example: div &#123; a = text &#125;

    • KeywordParent

      public static final RNCTokenType KeywordParent
      The parent keyword — references a define in the parent grammar (used inside grammar blocks).

      Example: parent name

    • KeywordInherit

      public static final RNCTokenType KeywordInherit
      The inherit keyword — inherits the default namespace from the including grammar.

      Example: namespace local = inherit

    • KeywordString

      public static final RNCTokenType KeywordString
      The string keyword — built-in datatype that matches a string value (with whitespace normalization).

      Example: attribute type &#123; string "fixed" &#125;

    • KeywordToken

      public static final RNCTokenType KeywordToken
      The token keyword — built-in datatype that matches a tokenized string (whitespace collapsed).

      Example: attribute type &#123; token "value" &#125;

    • Assign

      public static final RNCTokenType Assign
      The assignment operator: =.

      Example: start = root

    • AssignChoice

      public static final RNCTokenType AssignChoice
      The choice-combine assignment operator: |=.

      Use case: extending a definition with additional alternatives. Example: content |= newElement

    • AssignInterleave

      public static final RNCTokenType AssignInterleave
      The interleave-combine assignment operator: &=.

      Use case: extending a definition with interleaved content. Example: content &= optionalElement

    • Pipe

      public static final RNCTokenType Pipe
      The choice (alternation) operator: |.

      Example: a | b | c — matches a, b, or c.

    • Ampersand

      public static final RNCTokenType Ampersand
      The interleave operator: &.

      Example: a & b — matches a and b in any order.

    • Comma

      public static final RNCTokenType Comma
      The group (sequence) operator: ,.

      Example: a, b, c — matches a followed by b followed by c.

    • QuestionMark

      public static final RNCTokenType QuestionMark
      The optional postfix operator: ? — zero or one occurrence.

      Example: name?

    • Star

      public static final RNCTokenType Star
      The zero-or-more postfix operator: *.

      Example: item*

    • Plus

      public static final RNCTokenType Plus
      The one-or-more postfix operator: +.

      Example: name+

    • Minus

      public static final RNCTokenType Minus
      The minus operator: -. Used in name classes for exception patterns.

      Example: anyName - (foo | bar)

    • Tilde

      public static final RNCTokenType Tilde
      The tilde operator: ~. Used as a shorthand for the inherit namespace in name classes.
    • BraceOpen

      public static final RNCTokenType BraceOpen
      Opening brace: &#123;. Starts a block (element body, attribute body, div body, grammar body, include overrides).
    • BraceClose

      public static final RNCTokenType BraceClose
      Closing brace: &#125;. Ends a block.
    • ParenOpen

      public static final RNCTokenType ParenOpen
      Opening parenthesis: (. Groups patterns.

      Example: (a | b)*

    • ParenClose

      public static final RNCTokenType ParenClose
      Closing parenthesis: ).
    • BracketOpen

      public static final RNCTokenType BracketOpen
      Opening bracket: [. Starts an annotation.

      Example: [a:documentation "..."]

    • BracketClose

      public static final RNCTokenType BracketClose
      Closing bracket: ]. Ends an annotation.
    • Colon

      public static final RNCTokenType Colon
      The colon separator: :. Used for prefixed names.

      Example: xsd:integer, a:documentation

    • Backslash

      public static final RNCTokenType Backslash
      The backslash: \. Used to escape keywords as identifiers.

      Example: \element — uses "element" as an identifier rather than a keyword.

    • Whitespace

      public static final RNCTokenType Whitespace
      Whitespace: spaces, tabs, newlines, carriage returns. Whitespace tokens are significant for the formatter (it adjusts them) but are skipped by most other language features.
    • Unknown

      public static final RNCTokenType Unknown
      An unknown/unrecognized character. Produced for characters that don't match any RNC syntax rule.
  • Method Details

    • values

      public static RNCTokenType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RNCTokenType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null