Class: Regex::MonadicExpression

Inherits:
CompoundExpression show all
Defined in:
lib/regex/monadic_expression.rb

Overview

Abstract class. An element that is part of a regular expression & that can have up to one child sub-expression.

Instance Attribute Summary collapse

Attributes inherited from Expression

#begin_anchor, #end_anchor

Instance Method Summary collapse

Methods inherited from CompoundExpression

#atomic?

Methods inherited from Expression

#atomic?, #options, #to_str

Constructor Details

#initialize(theChild) ⇒ MonadicExpression

Constructor.

Parameters:



16
17
18
19
# File 'lib/regex/monadic_expression.rb', line 16

def initialize(theChild)
  super()
  @child = theChild
end

Instance Attribute Details

#childObject (readonly)

The (optional) child sub-expression



12
13
14
# File 'lib/regex/monadic_expression.rb', line 12

def child
  @child
end

Instance Method Details

#done!Object

Notification that the parse tree construction is complete.



22
23
24
# File 'lib/regex/monadic_expression.rb', line 22

def done!
  child.done!
end

#lazy!Object

Notification that all quantifiers are lazy



27
28
29
# File 'lib/regex/monadic_expression.rb', line 27

def lazy!
  child.lazy!
end