class Regex::MonadicExpression
Abstract class. An element that is part of a regular expression & that can have up to one child sub-expression.
Attributes
child[R]
The (optional) child sub-expression
Public Class Methods
new(theChild)
click to toggle source
Constructor. @param theChild [Regex::Expression] Child (sub)expression
Calls superclass method
# File lib/regex/monadic_expression.rb, line 16 def initialize(theChild) super() @child = theChild end
Public Instance Methods
done!()
click to toggle source
Notification that the parse tree construction is complete.
# File lib/regex/monadic_expression.rb, line 22 def done! child.done! end
lazy!()
click to toggle source
Notification that all quantifiers are lazy
# File lib/regex/monadic_expression.rb, line 27 def lazy! child.lazy! end
Protected Instance Methods
all_child_text()
click to toggle source
Return the text representation of the child (if any)
# File lib/regex/monadic_expression.rb, line 34 def all_child_text result = child.nil? ? '' : child.to_str return result end