Class: Antlr4ruby::ATNConfig
- Inherits:
-
Object
- Object
- Antlr4ruby::ATNConfig
- Defined in:
- lib/antlr4ruby/atn/config/atn_config.rb
Direct Known Subclasses
Constant Summary collapse
- SUPPRESS_PRECEDENCE_FILTER =
0x40000000
Instance Attribute Summary collapse
-
#alt ⇒ Object
readonly
Returns the value of attribute alt.
-
#context ⇒ Object
Returns the value of attribute context.
-
#reaches_into_outer_context ⇒ Object
Returns the value of attribute reaches_into_outer_context.
-
#semantic_context ⇒ Object
readonly
Returns the value of attribute semantic_context.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
todo eql? hash to_s.
- #get_outer_context_depth ⇒ Object
- #hash ⇒ Object
-
#initialize(state, alt, context, semantic_context, reaches_outer = 0) ⇒ ATNConfig
constructor
A new instance of ATNConfig.
- #is_precedence_filter_suppressed ⇒ Object
- #set_precedence_filter_suppressed(value) ⇒ Object
- #to_s(recognizer: nil, show_alt: true) ⇒ Object
Constructor Details
#initialize(state, alt, context, semantic_context, reaches_outer = 0) ⇒ ATNConfig
10 11 12 |
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 10 def initialize(state, alt, context, semantic_context, reaches_outer = 0) @state, @alt, @context, @semantic_context, @semantic_context = state, alt, context, semantic_context, reaches_outer end |
Instance Attribute Details
#alt ⇒ Object (readonly)
Returns the value of attribute alt.
7 8 9 |
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 7 def alt @alt end |
#context ⇒ Object
Returns the value of attribute context.
8 9 10 |
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 8 def context @context end |
#reaches_into_outer_context ⇒ Object
Returns the value of attribute reaches_into_outer_context.
8 9 10 |
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 8 def reaches_into_outer_context @reaches_into_outer_context end |
#semantic_context ⇒ Object (readonly)
Returns the value of attribute semantic_context.
7 8 9 |
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 7 def semantic_context @semantic_context end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
7 8 9 |
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 7 def state @state end |
Instance Method Details
#eql?(other) ⇒ Boolean
todo eql? hash to_s
31 32 33 34 35 |
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 31 def eql?(other) return false if ! other || ! other.instance_of?(ATNConfig) return true if self.equal?(other) @alt == other.alt && state.state_number == other.state.state_number # todo end |
#get_outer_context_depth ⇒ Object
14 15 16 |
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 14 def get_outer_context_depth reaches_into_outer_context & ~SUPPRESS_PRECEDENCE_FILTER end |
#hash ⇒ Object
37 38 39 |
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 37 def hash # todo end |
#is_precedence_filter_suppressed ⇒ Object
18 19 20 |
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 18 def is_precedence_filter_suppressed (reaches_into_outer_context & SUPPRESS_PRECEDENCE_FILTER) != 0 end |
#set_precedence_filter_suppressed(value) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 22 def set_precedence_filter_suppressed(value) if value @reaches_into_outer_context |= 0x40000000 else @reaches_into_outer_context &= ~SUPPRESS_PRECEDENCE_FILTER end end |
#to_s(recognizer: nil, show_alt: true) ⇒ Object
41 42 43 |
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 41 def to_s(recognizer: nil, show_alt: true) # todo end |