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:



14
15
16
17
# File 'lib/regex/monadic_expression.rb', line 14

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

Instance Attribute Details

#childObject (readonly)

The (optional) child sub-expression



10
11
12
# File 'lib/regex/monadic_expression.rb', line 10

def child
  @child
end

Instance Method Details

#done!Object

Notification that the parse tree construction is complete.



20
21
22
# File 'lib/regex/monadic_expression.rb', line 20

def done!
  child.done!
end

#lazy!Object

Notification that all quantifiers are lazy



25
26
27
# File 'lib/regex/monadic_expression.rb', line 25

def lazy!
  child.lazy!
end