Method: RuleTagToken#initialize

Defined in:
lib/antlr4/tree/RuleTagToken.rb

#initialize(ruleName, bypassTokenType, label = nil) ⇒ RuleTagToken

Returns a new instance of RuleTagToken.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/antlr4/tree/RuleTagToken.rb', line 16

def initialize(ruleName, bypassTokenType, label=nil)
    if ruleName.nil? or ruleName.length ==0 then
        raise Exception.new("ruleName cannot be null or empty.")
    end
    self.source = nil
    self.type = bypassTokenType # token type of the token
    self.channel = Token::DEFAULT_CHANNEL # The parser ignores everything not on DEFAULT_CHANNEL
    self.start = -1 # optional; return -1 if not implemented.
    self.stop = -1  # optional; return -1 if not implemented.
    self.tokenIndex = -1 # from 0..n-1 of the token object in the input stream
    self.line = 0 # line=1..n of the 1st character
    self.column = -1 # beginning of the line at which it occurs, 0..n-1
    self.label = label
    self.ruleName = ruleName
    @text = getText()
end