Class: Resyma::Core::RegexpConcat
- Defined in:
- lib/resyma/core/automaton/regexp.rb
Instance Attribute Summary collapse
-
#regexp_list ⇒ Object
readonly
Returns the value of attribute regexp_list.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(regexp_list) ⇒ RegexpConcat
constructor
Concatentate a list of regexps.
- #inject(ab, start_state) ⇒ Object
Methods inherited from Regexp
Constructor Details
#initialize(regexp_list) ⇒ RegexpConcat
Concatentate a list of regexps
48 49 50 |
# File 'lib/resyma/core/automaton/regexp.rb', line 48 def initialize(regexp_list) @regexp_list = regexp_list end |
Instance Attribute Details
#regexp_list ⇒ Object (readonly)
Returns the value of attribute regexp_list.
52 53 54 |
# File 'lib/resyma/core/automaton/regexp.rb', line 52 def regexp_list @regexp_list end |
Instance Method Details
#==(other) ⇒ Object
54 55 56 |
# File 'lib/resyma/core/automaton/regexp.rb', line 54 def ==(other) other.is_a?(self.class) && other.regexp_list == @regexp_list end |
#inject(ab, start_state) ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/resyma/core/automaton/regexp.rb', line 58 def inject(ab, start_state) current_start = start_state @regexp_list.each do |regexp| current_start = regexp.inject(ab, current_start) end current_start end |