Class: Antlr4::Runtime::PrecedencePredicateTransition

Inherits:
AbstractPredicateTransition show all
Defined in:
lib/antlr4/runtime/precedence_predicate_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, precedence) ⇒ PrecedencePredicateTransition

Returns a new instance of PrecedencePredicateTransition


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

def initialize(target, precedence)
  super(target)
  @precedence = precedence
end

Instance Attribute Details

#precedenceObject (readonly)

Returns the value of attribute precedence


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

def precedence
  @precedence
end

Instance Method Details

#epsilon?Boolean

Returns:

  • (Boolean)

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

def epsilon?
  true
end

#matches(_symbol, _min_vocab_symbol, _max_vocab_symbol) ⇒ Object


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

def matches(_symbol, _min_vocab_symbol, _max_vocab_symbol)
  false
end

#predicateObject


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

def predicate
  SemanticContext.PrecedencePredicate.new(@precedence)
end

#serialization_typeObject


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

def serialization_type
  PRECEDENCE
end

#to_sObject


27
28
29
# File 'lib/antlr4/runtime/precedence_predicate_transition.rb', line 27

def to_s
  @precedence + ' >= _p'
end