Class: RegularExpression::NFA::Transition::Range

Inherits:
Object
  • Object
show all
Defined in:
lib/regular_expression/nfa.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state, left, right, invert: false) ⇒ Range

Returns a new instance of Range.



99
100
101
102
103
104
# File 'lib/regular_expression/nfa.rb', line 99

def initialize(state, left, right, invert: false)
  @state = state
  @left = left
  @right = right
  @invert = invert
end

Instance Attribute Details

#invertObject (readonly)

bool



97
98
99
# File 'lib/regular_expression/nfa.rb', line 97

def invert
  @invert
end

#leftObject (readonly)

String



96
97
98
# File 'lib/regular_expression/nfa.rb', line 96

def left
  @left
end

#rightObject (readonly)

String



96
97
98
# File 'lib/regular_expression/nfa.rb', line 96

def right
  @right
end

#stateObject (readonly)

State



95
96
97
# File 'lib/regular_expression/nfa.rb', line 95

def state
  @state
end

Instance Method Details

#labelObject



106
107
108
# File 'lib/regular_expression/nfa.rb', line 106

def label
  "#{left}-#{right}"
end