Class: ATNSimulator
- Includes:
- PredictionContextFunctions
- Defined in:
- lib/antlr4/atn/ATNSimulator.rb
Direct Known Subclasses
Constant Summary collapse
- ERROR =
Must distinguish between missing edge and edge we know leads nowhere#/
DFAState.new(0x7FFFFFFF,ATNConfigSet.new())
Instance Attribute Summary collapse
-
#atn ⇒ Object
Returns the value of attribute atn.
-
#sharedContextCache ⇒ Object
Returns the value of attribute sharedContextCache.
Instance Method Summary collapse
- #getCachedContext(context) ⇒ Object
-
#initialize(atn, sharedContextCache) ⇒ ATNSimulator
constructor
A new instance of ATNSimulator.
Methods included from PredictionContextFunctions
Constructor Details
#initialize(atn, sharedContextCache) ⇒ ATNSimulator
Returns a new instance of ATNSimulator.
30 31 32 33 34 |
# File 'lib/antlr4/atn/ATNSimulator.rb', line 30 def initialize(atn, sharedContextCache) raise Exception.new("ATN is nil") if atn.nil? self.atn = atn self.sharedContextCache = sharedContextCache end |
Instance Attribute Details
#atn ⇒ Object
Returns the value of attribute atn.
29 30 31 |
# File 'lib/antlr4/atn/ATNSimulator.rb', line 29 def atn @atn end |
#sharedContextCache ⇒ Object
Returns the value of attribute sharedContextCache.
29 30 31 |
# File 'lib/antlr4/atn/ATNSimulator.rb', line 29 def sharedContextCache @sharedContextCache end |
Instance Method Details
#getCachedContext(context) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/antlr4/atn/ATNSimulator.rb', line 35 def getCachedContext(context) if self.sharedContextCache.nil? then return context end visited = Hash.new return getCachedPredictionContext(context, self.sharedContextCache, visited) end |