Class: RLSM::RE::Union

Inherits:
SyntaxNode show all
Defined in:
lib/rlsm/regexp_parser.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from SyntaxNode

#content

Instance Method Summary collapse

Methods inherited from SyntaxNode

#<=>, [], #initialize, #inspect

Constructor Details

This class inherits a constructor from RLSM::RE::SyntaxNode

Instance Method Details

#firstObject



377
378
379
# File 'lib/rlsm/regexp_parser.rb', line 377

def first
  @content.map { |subexpr| subexpr.first }.flatten.sort
end

#followObject



385
386
387
# File 'lib/rlsm/regexp_parser.rb', line 385

def follow
  @content.inject([]) { |result, subexpr| result | subexpr.follow }.sort
end

#lastObject



381
382
383
# File 'lib/rlsm/regexp_parser.rb', line 381

def last
  @content.map { |subexpr| subexpr.last }.flatten.sort
end

#null?Boolean

Returns:

  • (Boolean)


373
374
375
# File 'lib/rlsm/regexp_parser.rb', line 373

def null?
  @content.any? { |subexpr| subexpr.null? }
end

#to_sObject



389
390
391
# File 'lib/rlsm/regexp_parser.rb', line 389

def to_s
  @content.map { |subexpr| subexpr.to_s }.join('|')
end