Sha256: 6f062488a304295da4684dd6cfa57f858a0726fd0f50a5e3948246b234ae65f9

Contents?: true

Size: 491 Bytes

Versions: 14

Compression:

Stored size: 491 Bytes

Contents

module Antlr4::Runtime

  class RangeTransition < Transition
    attr_reader :from
    attr_reader :to

    def initialize(target, from, to)
      super(target)
      @from = from
      @to = to
    end

    def serialization_type
      RANGE
    end

    def label
      IntervalSet.of(@from, @to)
    end

    def matches(symbol, _min_vocab_symbol, _max_vocab_symbol)
      symbol >= @from && symbol <= @to
    end

    def to_s
      "'" << @from << "'..'" << @to << "'"
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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