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 ClassesModifier and TypeInterfaceDescriptionstatic final recordRepresents the concatenation of two regular expressions (e.g., "ab").static final recordRepresents a single literal character in the regex (e.g., 'a', 'b').static final recordRepresents the Kleene Star operator, allowing zero or more repetitions (e.g., "a*").static final recordRepresents the union (OR) of two regular expressions (e.g., "a|b").static interfaceThe Visitor interface for the AST nodes. -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(RegexNode.Visitor<T> visitor) Accepts a visitor to apply an operation on this node.
-
Method Details
-
accept
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.
-