Class: Antlr4::Runtime::RuleTagToken
- Inherits:
-
Token
- Object
- Token
- Antlr4::Runtime::RuleTagToken
show all
- Defined in:
- lib/antlr4/runtime/rule_tag_token.rb
Constant Summary
Constants inherited
from Token
Token::DEFAULT_CHANNEL, Token::EOF, Token::EPSILON, Token::HIDDEN_CHANNEL, Token::INVALID_TYPE, Token::MIN_USER_CHANNEL_VALUE, Token::MIN_USER_TOKEN_TYPE
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(rule_name, bypass_token_type, label = nil) ⇒ RuleTagToken
Returns a new instance of RuleTagToken.
8
9
10
11
12
13
14
15
16
|
# 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
|
Instance Attribute Details
#bypass_token_type ⇒ Object
Returns the value of attribute bypass_token_type.
5
6
7
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 5
def bypass_token_type
@bypass_token_type
end
|
#label ⇒ Object
Returns the value of attribute label.
6
7
8
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 6
def label
@label
end
|
#rule_name ⇒ Object
Returns the value of attribute rule_name.
4
5
6
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 4
def rule_name
@rule_name
end
|
Instance Method Details
#channel ⇒ Object
18
19
20
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 18
def channel
DEFAULT_CHANNEL
end
|
#char_position_in_line ⇒ Object
36
37
38
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 36
def char_position_in_line
-1
end
|
56
57
58
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 56
def input_stream
nil
end
|
#line ⇒ Object
32
33
34
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 32
def line
0
end
|
#start_index ⇒ Object
44
45
46
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 44
def start_index
-1
end
|
#stop_index ⇒ Object
48
49
50
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 48
def stop_index
-1
end
|
#text ⇒ Object
22
23
24
25
26
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 22
def text
return '<' + @label + ':' + @rule_name + '>' unless @label.nil?
'<' + @rule_name + '>'
end
|
#to_s ⇒ Object
60
61
62
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 60
def to_s
@rule_name + ':' + @bypass_token_type
end
|
#token_index ⇒ Object
40
41
42
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 40
def token_index
-1
end
|
#token_source ⇒ Object
52
53
54
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 52
def token_source
nil
end
|
#type ⇒ Object
28
29
30
|
# File 'lib/antlr4/runtime/rule_tag_token.rb', line 28
def type
@bypass_token_type
end
|