Sha256: 06425cbd20e0ce684d5f1cea9300c24e704fb7493a3d960f34c9199b5cc255c1

Contents?: true

Size: 378 Bytes

Versions: 10

Compression:

Stored size: 378 Bytes

Contents

module Antlr4::Runtime

  class TagChunk < Chunk
    attr_reader :tag
    attr_reader :label

    def initialize(label, tag)
      if tag.nil? || tag.empty?
        raise IllegalArgumentException, 'tag cannot be nil or empty'
      end

      @label = label
      @tag = tag
    end

    def to_s
      return @label + ':' + @tag unless @label.nil?

      @tag
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
antlr4-runtime-0.2.8 lib/antlr4/runtime/tag_chunk.rb
antlr4-runtime-0.2.7 lib/antlr4/runtime/tag_chunk.rb
antlr4-runtime-0.2.6 lib/antlr4/runtime/tag_chunk.rb
antlr4-runtime-0.2.5 lib/antlr4/runtime/tag_chunk.rb
antlr4-runtime-0.2.4 lib/antlr4/runtime/tag_chunk.rb
antlr4-runtime-0.2.3 lib/antlr4/runtime/tag_chunk.rb
antlr4-runtime-0.2.2 lib/antlr4/runtime/tag_chunk.rb
antlr4-runtime-0.2.1 lib/antlr4/runtime/tag_chunk.rb
antlr4-runtime-0.2.0 lib/antlr4/runtime/tag_chunk.rb
antlr4-runtime-0.1.0 lib/antlr4/runtime/tag_chunk.rb