class Antlr4::Runtime::RuleTagToken

Attributes

bypass_token_type[R]
label[R]
rule_name[R]

Public Class Methods

new(rule_name, bypass_token_type, label = nil) click to toggle source
# File lib/antlr4/runtime/rule_tag_token.rb, line 8
def initialize(rule_name, bypass_token_type, label = nil)
  if rule_name.nil? || rule_name.empty?
    raise IllegalArgumentException, 'rule_name cannot be nil or empty.'
  end

  @rule_name = rule_name
  @bypass_token_type = bypass_token_type
  @label = label
end

Public Instance Methods

channel() click to toggle source
# File lib/antlr4/runtime/rule_tag_token.rb, line 18
def channel
  DEFAULT_CHANNEL
end
char_position_in_line() click to toggle source
# File lib/antlr4/runtime/rule_tag_token.rb, line 36
def char_position_in_line
  -1
end
input_stream() click to toggle source
# File lib/antlr4/runtime/rule_tag_token.rb, line 56
def input_stream
  nil
end
line() click to toggle source
# File lib/antlr4/runtime/rule_tag_token.rb, line 32
def line
  0
end
start_index() click to toggle source
# File lib/antlr4/runtime/rule_tag_token.rb, line 44
def start_index
  -1
end
stop_index() click to toggle source
# File lib/antlr4/runtime/rule_tag_token.rb, line 48
def stop_index
  -1
end
text() click to toggle source
# File lib/antlr4/runtime/rule_tag_token.rb, line 22
def text
  return '<' + @label + ':' + @rule_name + '>' unless @label.nil?

  '<' + @rule_name + '>'
end
to_s() click to toggle source
# File lib/antlr4/runtime/rule_tag_token.rb, line 60
def to_s
  @rule_name + ':' + @bypass_token_type
end
token_index() click to toggle source
# File lib/antlr4/runtime/rule_tag_token.rb, line 40
def token_index
  -1
end
token_source() click to toggle source
# File lib/antlr4/runtime/rule_tag_token.rb, line 52
def token_source
  nil
end
type() click to toggle source
# File lib/antlr4/runtime/rule_tag_token.rb, line 28
def type
  @bypass_token_type
end