Class: Antlr4::Runtime::AtomTransition

Inherits:
Transition
  • Object
show all
Defined in:
lib/antlr4/runtime/atom_transition.rb

Constant Summary

Constants inherited from Transition

Transition::ACTION, Transition::ATOM, Transition::EPSILON, Transition::NOT_SET, Transition::PRECEDENCE, Transition::PREDICATE, Transition::RANGE, Transition::RULE, Transition::SET, Transition::WILDCARD

Instance Attribute Summary collapse

Attributes inherited from Transition

#target

Instance Method Summary collapse

Methods inherited from Transition

#epsilon?

Constructor Details

#initialize(target, label) ⇒ AtomTransition

Returns a new instance of AtomTransition



6
7
8
9
# File 'lib/antlr4/runtime/atom_transition.rb', line 6

def initialize(target, label)
  super(target)
  @the_label = label
end

Instance Attribute Details

#the_labelObject (readonly)

Returns the value of attribute the_label



4
5
6
# File 'lib/antlr4/runtime/atom_transition.rb', line 4

def the_label
  @the_label
end

Instance Method Details

#labelObject



15
16
17
# File 'lib/antlr4/runtime/atom_transition.rb', line 15

def label
  IntervalSet.of(@the_label)
end

#matches(symbol, _min_vocab_symbol, _max_vocab_symbol) ⇒ Object



19
20
21
# File 'lib/antlr4/runtime/atom_transition.rb', line 19

def matches(symbol, _min_vocab_symbol, _max_vocab_symbol)
  @the_label == symbol
end

#serialization_typeObject



11
12
13
# File 'lib/antlr4/runtime/atom_transition.rb', line 11

def serialization_type
  ATOM
end

#to_sObject



23
24
25
# File 'lib/antlr4/runtime/atom_transition.rb', line 23

def to_s
  '' + @the_label
end