Class: Antlr4ruby::ATNConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/antlr4ruby/atn/config/atn_config.rb

Direct Known Subclasses

LexerATNConfig

Constant Summary collapse

SUPPRESS_PRECEDENCE_FILTER =
0x40000000

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#altObject (readonly)

Returns the value of attribute alt.



7
8
9
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 7

def alt
  @alt
end

#contextObject

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_contextObject

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_contextObject (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

#stateObject (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_depthObject



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

#hashObject



37
38
39
# File 'lib/antlr4ruby/atn/config/atn_config.rb', line 37

def hash
  # todo

end

#is_precedence_filter_suppressedObject



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