class RegularExpression::AST::CharacterRange
Attributes
left[R]
right[R]
Public Class Methods
new(left, right)
click to toggle source
# File lib/regular_expression/ast.rb, line 210 def initialize(left, right) @left = left @right = right end
Public Instance Methods
to_dot(parent)
click to toggle source
# File lib/regular_expression/ast.rb, line 215 def to_dot(parent) parent.add_node(object_id, label: "#{left}-#{right}", shape: "box") end
to_nfa(start, finish)
click to toggle source
# File lib/regular_expression/ast.rb, line 223 def to_nfa(start, finish) transition = NFA::Transition::Range.new(finish, left, right) start.add_transition(transition) end
to_nfa_values()
click to toggle source
# File lib/regular_expression/ast.rb, line 219 def to_nfa_values (left..right).to_a end