Class: Antlr4::Runtime::ATNDeserializationOptions

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/antlr4/runtime/atn_deserialization_options.rb

Instance Method Summary collapse

Constructor Details

#initialize(read_only = true, options = nil) ⇒ ATNDeserializationOptions


7
8
9
10
11
12
13
14
15
16
# File 'lib/antlr4/runtime/atn_deserialization_options.rb', line 7

def initialize(read_only = true, options = nil)
  @read_only = read_only
  if !options.nil?
    @verify_atn = options.verify_atn
    @generate_rule_bypass_transitions = options.generate_rule_bypass_transitions
  else
    @verify_atn = true
    @generate_rule_bypass_transitions = false
  end
end

Instance Method Details

#generate_rule_bypass_transitions(generate_rule_bypass_transitions) ⇒ Object


39
40
41
42
# File 'lib/antlr4/runtime/atn_deserialization_options.rb', line 39

def generate_rule_bypass_transitions(generate_rule_bypass_transitions)
  throw_if_read_only
  @generate_rule_bypass_transitions = generate_rule_bypass_transitions
end

#generate_rule_bypass_transitions?Boolean


35
36
37
# File 'lib/antlr4/runtime/atn_deserialization_options.rb', line 35

def generate_rule_bypass_transitions?
  @generate_rule_bypass_transitions
end

#make_read_onlyObject


22
23
24
# File 'lib/antlr4/runtime/atn_deserialization_options.rb', line 22

def make_read_only
  @read_only = true
end

#read_only?Boolean


18
19
20
# File 'lib/antlr4/runtime/atn_deserialization_options.rb', line 18

def read_only?
  @read_only
end

#throw_if_read_onlyObject


44
45
46
# File 'lib/antlr4/runtime/atn_deserialization_options.rb', line 44

def throw_if_read_only
  raise IllegalStateException, 'The object is read only.' if read_only?
end

#verify_atn(verify_atn) ⇒ Object


30
31
32
33
# File 'lib/antlr4/runtime/atn_deserialization_options.rb', line 30

def verify_atn(verify_atn)
  throw_if_read_only
  @verify_atn = verify_atn
end

#verify_atn?Boolean


26
27
28
# File 'lib/antlr4/runtime/atn_deserialization_options.rb', line 26

def verify_atn?
  @verify_atn
end