examples/general/SRL/lib/regex/repetition.rb in rley-0.6.00 vs examples/general/SRL/lib/regex/repetition.rb in rley-0.6.01

- old
+ new

@@ -1,32 +1,29 @@ # File: repetition.rb -require_relative "monadic_expression" # Access the superclass +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 repetition of the child expression + # succeeds to match the subject text in the same serial arrangement + class Repetition < MonadicExpression + attr_reader(:multiplicity) -# 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 + # Constructor. + def initialize(childExpressionToRepeat, aMultiplicity) + super(childExpressionToRepeat) + @multiplicity = aMultiplicity + end - # 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 + protected -end # class - + # 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 \ No newline at end of file +# End of file