Interface RegexNode

All Known Implementing Classes:
RegexNode.ConcatNode, RegexNode.LiteralNode, RegexNode.StarNode, RegexNode.UnionNode

public interface RegexNode
Base interface for all nodes in the Regular Expression Abstract Syntax Tree (AST). Utilizes Java Records to define immutable node implementations concisely.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Represents the concatenation of two regular expressions (e.g., "ab").
    static final record 
    Represents a single literal character in the regex (e.g., 'a', 'b').
    static final record 
    Represents the Kleene Star operator, allowing zero or more repetitions (e.g., "a*").
    static final record 
    Represents the union (OR) of two regular expressions (e.g., "a|b").
    static interface 
    The Visitor interface for the AST nodes.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    Accepts a visitor to apply an operation on this node.
  • Method Details

    • accept

      <T> T accept(RegexNode.Visitor<T> visitor)
      Accepts a visitor to apply an operation on this node.
      Type Parameters:
      T - The return type of the visitor.
      Parameters:
      visitor - The visitor applying the operation.
      Returns:
      The result of the visitor's operation.