Class: Antlr4::Runtime::ActionTransition

Inherits:
Transition
  • Object
show all
Defined in:
lib/antlr4/runtime/action_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

#label

Constructor Details

#initialize(target, rule_index, action_index, is_ctx_dependent) ⇒ ActionTransition

Returns a new instance of ActionTransition


6
7
8
9
10
11
# File 'lib/antlr4/runtime/action_transition.rb', line 6

def initialize(target, rule_index, action_index, is_ctx_dependent)
  super(target)
  @rule_index = rule_index
  @action_index = action_index
  @is_ctx_dependent = is_ctx_dependent
end

Instance Attribute Details

#action_indexObject (readonly)

Returns the value of attribute action_index


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

def action_index
  @action_index
end

Instance Method Details

#epsilon?Boolean

Returns:

  • (Boolean)

17
18
19
# File 'lib/antlr4/runtime/action_transition.rb', line 17

def epsilon?
  true
end

#matches(_symbol, _min_vocab_symbol, _max_vocab_symbol) ⇒ Object


21
22
23
# File 'lib/antlr4/runtime/action_transition.rb', line 21

def matches(_symbol, _min_vocab_symbol, _max_vocab_symbol)
  false
end

#serialization_typeObject


13
14
15
# File 'lib/antlr4/runtime/action_transition.rb', line 13

def serialization_type
  ACTION
end

#to_sObject


25
26
27
# File 'lib/antlr4/runtime/action_transition.rb', line 25

def to_s
  'action_' + @rule_index + ':' + @action_index
end