Class: Antlr4::Runtime::TextChunk

Inherits:
Chunk
  • Object
show all
Defined in:
lib/antlr4/runtime/text_chunk.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ TextChunk

Returns a new instance of TextChunk



6
7
8
9
10
# File 'lib/antlr4/runtime/text_chunk.rb', line 6

def initialize(text)
  raise IllegalArgumentException, 'text cannot be null' if text.nil?

  @text = text
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text



4
5
6
# File 'lib/antlr4/runtime/text_chunk.rb', line 4

def text
  @text
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/antlr4/runtime/text_chunk.rb', line 12

def to_s
  "'" + @text + "'"
end