Package icyllis.arc3d.compiler.lex

# Interface RegexNode

All Known Implementing Classes:
  `RegexNode.Char`, `RegexNode.CharClass`, `RegexNode.Range`

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface RegexNode
Represents a node in the parse tree of a regular expression.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static class`
  `RegexNode.Char`
  `static class`
  `RegexNode.CharClass`
  `static class`
  `RegexNode.Range`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static RegexNode`
  `Char(char c)`
  Match a character.
  `static RegexNode`
  `CharClass(RegexNode... clazz)`
  Match a character class.
  `static RegexNode`
  `CharClass(RegexNode[] clazz, boolean exclusive)`
  Match a character class.
  `static RegexNode`
  `Concat(RegexNode x, RegexNode y)`
  Concatenation: XY (X -> Y -> Next)
  `static RegexNode`
  `Dot()`
  Wildcard, excluding LF and CR.
  `static RegexNode`
  `Plus(RegexNode x)`
  X -> X, X -> Next.
  `static RegexNode`
  `Ques(RegexNode x)`
  X -> Next, Next -> Next.
  `static RegexNode`
  `Range(char start, char end)`
  Match a character range.
  `static RegexNode`
  `Range(RegexNode start, RegexNode end)`
  Match a character range.
  `static RegexNode`
  `Star(RegexNode x)`
  Kleene closure: X -> X, X -> Next, Next -> Next.
  `@Unmodifiable it.unimi.dsi.fastutil.ints.IntList`
  `transition(NFA nfa, @Unmodifiable it.unimi.dsi.fastutil.ints.IntList next)`
  Creates NFA states for this node, with a successful match against this node resulting in a transition next all the states in the `next` list.
  `static RegexNode`
  `Union(RegexNode x, RegexNode y)`
  Alternation: X|Y (X -> Next, Y -> Next)

- ## Method Details

  - ### transition

    @Unmodifiable it.unimi.dsi.fastutil.ints.IntList transition(NFA nfa, @Unmodifiable it.unimi.dsi.fastutil.ints.IntList next)
    Creates NFA states for this node, with a successful match against this node resulting in a transition next all the states in the `next` list.

  - ### Char

    @Nonnull static RegexNode Char(char c)
    Match a character.

  - ### Range

    @Nonnull static RegexNode Range(char start, char end)
    Match a character range.

  - ### Range

    @Nonnull static RegexNode Range(RegexNode start, RegexNode end)
    Match a character range.

  - ### CharClass

    @Nonnull static RegexNode CharClass(RegexNode... clazz)
    Match a character class.

  - ### CharClass

    @Nonnull static RegexNode CharClass(RegexNode[] clazz, boolean exclusive)
    Match a character class.

  - ### Concat

    @Nonnull @Contract(pure=true) static RegexNode Concat(RegexNode x, RegexNode y)
    Concatenation: XY (X -> Y -> Next)

  - ### Union

    @Nonnull @Contract(pure=true) static RegexNode Union(RegexNode x, RegexNode y)
    Alternation: X|Y (X -> Next, Y -> Next)

  - ### Dot

    @Nonnull @Contract(pure=true) static RegexNode Dot()
    Wildcard, excluding LF and CR.

  - ### Star

    @Nonnull @Contract(pure=true) static RegexNode Star(RegexNode x)
    Kleene closure: X -> X, X -> Next, Next -> Next. Match between zero, one and unlimited times.

  - ### Plus

    @Nonnull @Contract(pure=true) static RegexNode Plus(RegexNode x)
    X -> X, X -> Next. Match between one and unlimited times.

  - ### Ques

    @Nonnull @Contract(pure=true) static RegexNode Ques(RegexNode x)
    X -> Next, Next -> Next. Match between zero and one times.