class Antlr4::Runtime::SemanticContext::PrecedencePredicate
Attributes
precedence[RW]
Public Class Methods
new(precedence = 0)
click to toggle source
# File lib/antlr4/runtime/semantic_context.rb, line 57 def initialize(precedence = 0) @precedence = precedence end
Public Instance Methods
compare_to(o)
click to toggle source
# File lib/antlr4/runtime/semantic_context.rb, line 69 def compare_to(o) @precedence - o.precedence end
eql?(other)
click to toggle source
# File lib/antlr4/runtime/semantic_context.rb, line 78 def eql?(other) return false unless other.is_a? PrecedencePredicate return true if self == other @precedence == other.precedence end
eval(parser, parser_call_stack)
click to toggle source
# File lib/antlr4/runtime/semantic_context.rb, line 61 def eval(parser, parser_call_stack) parser.precpred(parser_call_stack, @precedence) end
eval_precedence(parser, parser_call_stack)
click to toggle source
# File lib/antlr4/runtime/semantic_context.rb, line 65 def eval_precedence(parser, parser_call_stack) SemanticContext::NONE if parser.precpred(parser_call_stack, @precedence) end
hash()
click to toggle source
# File lib/antlr4/runtime/semantic_context.rb, line 73 def hash hash_code = 1 31 * hash_code + @precedence end
to_s()
click to toggle source
precedence >= _precedenceStack.peek()
# File lib/antlr4/runtime/semantic_context.rb, line 87 def to_s '{' + @precedence + '>=prec}?' end