Class: RegularExpression::AST::Character
- Inherits:
-
Object
- Object
- RegularExpression::AST::Character
- Defined in:
- lib/regular_expression/ast.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
String.
Instance Method Summary collapse
-
#initialize(value) ⇒ Character
constructor
A new instance of Character.
- #to_dot(parent) ⇒ Object
- #to_nfa(start, finish) ⇒ Object
- #to_nfa_values ⇒ Object
Constructor Details
#initialize(value) ⇒ Character
Returns a new instance of Character.
179 180 181 |
# File 'lib/regular_expression/ast.rb', line 179 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
String
177 178 179 |
# File 'lib/regular_expression/ast.rb', line 177 def value @value end |
Instance Method Details
#to_dot(parent) ⇒ Object
183 184 185 |
# File 'lib/regular_expression/ast.rb', line 183 def to_dot(parent) parent.add_node(object_id, label: value, shape: "box") end |
#to_nfa(start, finish) ⇒ Object
191 192 193 |
# File 'lib/regular_expression/ast.rb', line 191 def to_nfa(start, finish) start.add_transition(NFA::Transition::Value.new(finish, value)) end |
#to_nfa_values ⇒ Object
187 188 189 |
# File 'lib/regular_expression/ast.rb', line 187 def to_nfa_values [value] end |