Sha256: 58536c5c9144447bca44ce3005b6fedf08152cdada28256759620bf185804861

Contents?: true

Size: 788 Bytes

Versions: 4

Compression:

Stored size: 788 Bytes

Contents

# File: repetition.rb

require_relative "monadic_expression"	# Access the superclass

module Regex # This module is used as a namespace

# Abstract class. An unary matching operator. 
# It succeeds when the specified reptition of the child expression succeeds to match 
# the subject text in the same serial arrangement
class Repetition < MonadicExpression
	attr_reader(:multiplicity)
	
	# Constructor.
	def initialize(childExpressionToRepeat, aMultiplicity)
		super(childExpressionToRepeat)
		@multiplicity = aMultiplicity
	end
	
  protected

	# Conversion method re-definition.
	# Purpose: Return the String representation of the concatented expressions.
	def text_repr()
		result = all_child_text() + multiplicity.to_str()
		return result
	end

end # class

end # module

# End of file

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rley-0.6.00 examples/general/SRL/lib/regex/repetition.rb
rley-0.5.14 examples/general/SRL/lib/regex/repetition.rb
rley-0.5.13 examples/general/SRL/lib/regex/repetition.rb
rley-0.5.12 examples/general/SRL/lib/regex/repetition.rb