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.

Direct Known Subclasses

CapturingGroup, NonCapturingGroup, Repetition

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?, #cardinality, #options, #to_str

Constructor Details

#initialize(theChild) ⇒ MonadicExpression

Constructor.



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

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