Sha256: ad9d9add6ad322fdf8e02cbf976f511adca6cd2dcca0f895cca4bfa0f487b035

Contents?: true

Size: 1.05 KB

Versions: 14

Compression:

Stored size: 1.05 KB

Contents

require 'singleton'

module Antlr4::Runtime
  class ATNDeserializationOptions
    include Singleton

    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

    def read_only?
      @read_only
    end

    def make_read_only
      @read_only = true
    end

    def verify_atn?
      @verify_atn
    end

    def verify_atn(verify_atn)
      throw_if_read_only
      @verify_atn = verify_atn
    end

    def generate_rule_bypass_transitions?
      @generate_rule_bypass_transitions
    end

    def generate_rule_bypass_transitions(generate_rule_bypass_transitions)
      throw_if_read_only
      @generate_rule_bypass_transitions = generate_rule_bypass_transitions
    end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
antlr4-runtime-0.2.12 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.2.11 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.2.10 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.2.9 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.2.8 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.2.7 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.2.6 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.2.5 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.2.4 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.2.3 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.2.2 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.2.1 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.2.0 lib/antlr4/runtime/atn_deserialization_options.rb
antlr4-runtime-0.1.0 lib/antlr4/runtime/atn_deserialization_options.rb