examples/general/SRL/lib/regex/monadic_expression.rb in rley-0.6.00 vs examples/general/SRL/lib/regex/monadic_expression.rb in rley-0.6.01
- old
+ new
@@ -1,31 +1,28 @@
# File: monadic_expression.rb
-require_relative "compound_expression" # Access the superclass
+require_relative 'compound_expression' # Access the superclass
module Regex # This module is used as a namespace
+ # Abstract class. An element that is part of a regular expression &
+ # that can have up to one child sub-expression.
+ class MonadicExpression < CompoundExpression
+ # The (optional) child sub-expression
+ attr_reader(:child)
-# Abstract class. An element that is part of a regular expression &
-# that can have up to one child sub-expression.
-class MonadicExpression < CompoundExpression
- # The (optional) child sub-expression
- attr_reader(:child)
-
- # Constructor.
- def initialize(theChild)
- super()
- @child = theChild
- end
-
-protected
- # Return the text representation of the child (if any)
- def all_child_text()
- result = child.nil? ? '' : child.to_str()
-
- return result
- end
+ # Constructor.
+ def initialize(theChild)
+ super()
+ @child = theChild
+ end
-end # class
+ protected
+
+ # Return the text representation of the child (if any)
+ def all_child_text()
+ result = child.nil? ? '' : child.to_str
+ return result
+ end
+ end # class
end # module
-
-# End of file
\ No newline at end of file
+# End of file