class Antlr4::Runtime::PredictionContextCache
Public Class Methods
new()
click to toggle source
# File lib/antlr4/runtime/prediction_context_cache.rb, line 4 def initialize @cache = {} end
Public Instance Methods
add(ctx)
click to toggle source
# File lib/antlr4/runtime/prediction_context_cache.rb, line 8 def add(ctx) return EmptyPredictionContext::EMPTY if ctx == EmptyPredictionContext::EMPTY existing = @cache[ctx] return existing unless existing.nil? @cache[ctx] = ctx ctx end
get(ctx)
click to toggle source
# File lib/antlr4/runtime/prediction_context_cache.rb, line 18 def get(ctx) @cache[ctx] end
size()
click to toggle source
# File lib/antlr4/runtime/prediction_context_cache.rb, line 22 def size @cache.size end