Class: Regex::AtomicExpression

Inherits:
Expression show all
Defined in:
lib/regex/atomic_expression.rb

Overview

Abstract class. A valid regular expression that cannot be further decomposed into sub-expressions.

Direct Known Subclasses

Anchor, CharShorthand, Character, RawExpression, Wildcard

Instance Attribute Summary

Attributes inherited from Expression

#begin_anchor, #end_anchor

Instance Method Summary collapse

Methods inherited from Expression

#initialize, #options, #to_str

Constructor Details

This class inherits a constructor from Regex::Expression

Instance Method Details

#atomic?TrueClass

Redefined method.

Returns:

  • (TrueClass)

    Return true since it may not have any child.



11
12
13
# File 'lib/regex/atomic_expression.rb', line 11

def atomic?
  return true
end

#done!Object

Notification that the parse tree construction is complete.



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

def done!
  # Do nothing
end

#lazy!Object

Notification that all quantifiers are lazy



21
22
23
# File 'lib/regex/atomic_expression.rb', line 21

def lazy!
  # Do nothing
end