Class: Antlr4::Runtime::TagChunk
- Inherits:
-
Object
- Object
- Antlr4::Runtime::TagChunk
- Defined in:
- lib/antlr4/runtime/tag_chunk.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Instance Method Summary collapse
-
#initialize(label, tag) ⇒ TagChunk
constructor
A new instance of TagChunk.
- #to_s ⇒ Object
Constructor Details
#initialize(label, tag) ⇒ TagChunk
Returns a new instance of TagChunk.
7 8 9 10 11 12 13 14 |
# File 'lib/antlr4/runtime/tag_chunk.rb', line 7 def initialize(label, tag) if tag.nil? || tag.empty? raise IllegalArgumentException, 'tag cannot be nil or empty' end @label = label @tag = tag end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
5 6 7 |
# File 'lib/antlr4/runtime/tag_chunk.rb', line 5 def label @label end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
4 5 6 |
# File 'lib/antlr4/runtime/tag_chunk.rb', line 4 def tag @tag end |
Instance Method Details
#to_s ⇒ Object
16 17 18 19 20 |
# File 'lib/antlr4/runtime/tag_chunk.rb', line 16 def to_s return @label + ':' + @tag unless @label.nil? @tag end |