Class: RLSM::RegExp::Union
Instance Method Summary collapse
- #empty? ⇒ Boolean
- #first ⇒ Object
- #follow ⇒ Object
-
#initialize(parent, str) ⇒ Union
constructor
A new instance of Union.
- #lambda? ⇒ Boolean
- #last ⇒ Object
- #null? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(parent, str) ⇒ Union
Returns a new instance of Union.
320 321 322 323 324 325 |
# File 'lib/rlsm_regexp.rb', line 320 def initialize(parent, str) @parent = parent @childs = _split(str).map do |substr| NodeFactory.new_node(self, substr) end end |
Instance Method Details
#empty? ⇒ Boolean
376 377 378 |
# File 'lib/rlsm_regexp.rb', line 376 def empty? false end |
#first ⇒ Object
331 332 333 334 335 336 337 338 339 340 |
# File 'lib/rlsm_regexp.rb', line 331 def first res = [] @childs.each do |child| child.first.each do |f| res << f end end res end |
#follow ⇒ Object
353 354 355 356 357 358 359 360 361 362 |
# File 'lib/rlsm_regexp.rb', line 353 def follow res = [] @childs.each do |child| child.follow.each do |f| res << f end end res end |
#lambda? ⇒ Boolean
372 373 374 |
# File 'lib/rlsm_regexp.rb', line 372 def lambda? false end |
#last ⇒ Object
342 343 344 345 346 347 348 349 350 351 |
# File 'lib/rlsm_regexp.rb', line 342 def last res = [] @childs.each do |child| child.last.each do |l| res << l end end res end |
#null? ⇒ Boolean
327 328 329 |
# File 'lib/rlsm_regexp.rb', line 327 def null? @childs.any? { |child| child.null? } end |