Class: Kleene::DFATransition
- Inherits:
-
Object
- Object
- Kleene::DFATransition
- Defined in:
- lib/kleene/dfa.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
: State.
-
#to ⇒ Object
: State.
-
#token ⇒ Object
: Char.
Instance Method Summary collapse
- #accept?(input) ⇒ Boolean
-
#initialize(token, from_state, to_state) ⇒ DFATransition
constructor
A new instance of DFATransition.
Constructor Details
#initialize(token, from_state, to_state) ⇒ DFATransition
Returns a new instance of DFATransition.
7 8 9 10 11 |
# File 'lib/kleene/dfa.rb', line 7 def initialize(token, from_state, to_state) @token = token @from = from_state @to = to_state end |
Instance Attribute Details
#from ⇒ Object
: State
4 5 6 |
# File 'lib/kleene/dfa.rb', line 4 def from @from end |
#to ⇒ Object
: State
5 6 7 |
# File 'lib/kleene/dfa.rb', line 5 def to @to end |
#token ⇒ Object
: Char
3 4 5 |
# File 'lib/kleene/dfa.rb', line 3 def token @token end |
Instance Method Details
#accept?(input) ⇒ Boolean
13 14 15 |
# File 'lib/kleene/dfa.rb', line 13 def accept?(input) @token == input end |