Class: Antlr4ruby::Parser
Constant Summary
Constants inherited
from Recognizer
Recognizer::EOF
Instance Method Summary
collapse
-
#add_contex_to_parse_tree ⇒ Object
-
#add_parse_listener(listener) ⇒ Object
-
#consume ⇒ Object
-
#create_terminal_node(parent, token) ⇒ Object
-
#dump_dfa ⇒ Object
-
#enter_recursion_rule(localctx, state, rule_index, precedence) ⇒ Object
-
#enter_rule(localctx, state, rule_index) ⇒ Object
-
#get_atn_with_bypass_alts ⇒ Object
-
#get_build_parse_tree ⇒ Object
-
#get_context ⇒ Object
-
#get_current_token ⇒ Object
-
#get_dfa_strings ⇒ Object
-
#get_error_handler ⇒ Object
compile_parse_tree_pattern 不要.
-
#get_expected_tokens ⇒ Object
-
#get_expected_tokens_within_current_rule ⇒ Object
-
#get_input_stream ⇒ Object
-
#get_invoking_context(rule_index) ⇒ Object
-
#get_parse_info ⇒ Object
-
#get_parse_listeners ⇒ Object
不要 set_trim_parse_tree get_trim_parse_tree.
-
#get_precedence ⇒ Object
-
#get_rule_context ⇒ Object
-
#get_rule_index(rule_name) ⇒ Object
-
#get_rule_invocation_stack(rule_context) ⇒ Object
-
#get_source_name ⇒ Object
-
#get_syntax_error_count ⇒ Object
-
#get_token_factory ⇒ Object
-
#get_token_stream ⇒ Object
-
#initialize(input) ⇒ Parser
constructor
A new instance of Parser.
-
#is_expected_token(symbol) ⇒ Object
-
#is_matched_eof? ⇒ Boolean
-
#match(token_type) ⇒ Object
-
#match_wildcard ⇒ Object
-
#notify_error_listeners(msg, token, e) ⇒ Object
-
#precpred(localctx, precedence) ⇒ Object
-
#push_new_recursion_context(localctx, state, rule_index) ⇒ Object
-
#remove_parse_listener(listener) ⇒ Object
-
#remove_parse_listeners ⇒ Object
-
#reset ⇒ Object
-
#set_build_parse_tree(build_parse_trees) ⇒ Object
-
#set_context(ctx) ⇒ Object
-
#set_error_handler(handler) ⇒ Object
-
#set_input_stream(input) ⇒ Object
-
#set_profile(profile) ⇒ Object
-
#set_token_factory(factory) ⇒ Object
-
#set_token_stream(input) ⇒ Object
-
#unroll_recursion_contexts(parent) ⇒ Object
Methods inherited from Recognizer
#action, #add_error_listener, #get_atn, #get_error_header, #get_error_listener_dispatch, #get_error_listeners, #get_grammar_file_name, #get_interpreter, #get_rule_index_map, #get_rule_names, #get_serialized_atn, #get_state, #get_token_names, #get_token_type, #get_token_type_map, #get_vocabulary, #remove_error_listener, #remove_error_listeners, #sempred, #set_interpreter, #set_state
Constructor Details
#initialize(input) ⇒ Parser
Returns a new instance of Parser.
4
5
6
7
|
# File 'lib/antlr4ruby/parser.rb', line 4
def initialize(input)
super()
set_input_stream(input)
end
|
Instance Method Details
#add_contex_to_parse_tree ⇒ Object
127
128
129
|
# File 'lib/antlr4ruby/parser.rb', line 127
def add_contex_to_parse_tree
end
|
#add_parse_listener(listener) ⇒ Object
52
53
54
|
# File 'lib/antlr4ruby/parser.rb', line 52
def add_parse_listener(listener)
end
|
#consume ⇒ Object
119
120
121
|
# File 'lib/antlr4ruby/parser.rb', line 119
def consume
end
|
#create_terminal_node(parent, token) ⇒ Object
123
124
125
|
# File 'lib/antlr4ruby/parser.rb', line 123
def create_terminal_node(parent, token)
end
|
#dump_dfa ⇒ Object
205
206
207
|
# File 'lib/antlr4ruby/parser.rb', line 205
def dump_dfa
end
|
#enter_recursion_rule(localctx, state, rule_index, precedence) ⇒ Object
141
142
143
|
# File 'lib/antlr4ruby/parser.rb', line 141
def enter_recursion_rule(localctx, state, rule_index, precedence)
end
|
#enter_rule(localctx, state, rule_index) ⇒ Object
131
132
133
|
# File 'lib/antlr4ruby/parser.rb', line 131
def enter_rule(localctx, state, rule_index)
end
|
#get_atn_with_bypass_alts ⇒ Object
76
77
78
|
# File 'lib/antlr4ruby/parser.rb', line 76
def get_atn_with_bypass_alts
end
|
#get_build_parse_tree ⇒ Object
42
43
44
|
# File 'lib/antlr4ruby/parser.rb', line 42
def get_build_parse_tree
@build_parse_trees
end
|
#get_context ⇒ Object
157
158
159
|
# File 'lib/antlr4ruby/parser.rb', line 157
def get_context
@ctx
end
|
#get_current_token ⇒ Object
108
109
110
|
# File 'lib/antlr4ruby/parser.rb', line 108
def get_current_token
input.lt(1)
end
|
#get_dfa_strings ⇒ Object
201
202
203
|
# File 'lib/antlr4ruby/parser.rb', line 201
def get_dfa_strings
end
|
#get_error_handler ⇒ Object
compile_parse_tree_pattern 不要
82
83
84
|
# File 'lib/antlr4ruby/parser.rb', line 82
def get_error_handler
@err_handler
end
|
#get_expected_tokens ⇒ Object
180
181
182
|
# File 'lib/antlr4ruby/parser.rb', line 180
def get_expected_tokens
end
|
#get_expected_tokens_within_current_rule ⇒ Object
184
185
186
|
# File 'lib/antlr4ruby/parser.rb', line 184
def get_expected_tokens_within_current_rule
end
|
94
95
96
|
# File 'lib/antlr4ruby/parser.rb', line 94
def get_input_stream
get_token_stream
end
|
#get_invoking_context(rule_index) ⇒ Object
153
154
155
|
# File 'lib/antlr4ruby/parser.rb', line 153
def get_invoking_context(rule_index)
end
|
#get_parse_info ⇒ Object
213
214
215
|
# File 'lib/antlr4ruby/parser.rb', line 213
def get_parse_info
end
|
#get_parse_listeners ⇒ Object
不要 set_trim_parse_tree get_trim_parse_tree
48
49
50
|
# File 'lib/antlr4ruby/parser.rb', line 48
def get_parse_listeners
end
|
#get_precedence ⇒ Object
137
138
139
|
# File 'lib/antlr4ruby/parser.rb', line 137
def get_precedence
end
|
#get_rule_context ⇒ Object
192
193
194
|
# File 'lib/antlr4ruby/parser.rb', line 192
def get_rule_context
@ctx
end
|
#get_rule_index(rule_name) ⇒ Object
188
189
190
|
# File 'lib/antlr4ruby/parser.rb', line 188
def get_rule_index(rule_name)
end
|
#get_rule_invocation_stack(rule_context) ⇒ Object
196
197
198
199
|
# File 'lib/antlr4ruby/parser.rb', line 196
def get_rule_invocation_stack(rule_context)
end
|
#get_source_name ⇒ Object
209
210
211
|
# File 'lib/antlr4ruby/parser.rb', line 209
def get_source_name
input.get_source_name
end
|
#get_syntax_error_count ⇒ Object
64
65
66
|
# File 'lib/antlr4ruby/parser.rb', line 64
def get_syntax_error_count
@syntax_errors
end
|
#get_token_factory ⇒ Object
68
69
70
|
# File 'lib/antlr4ruby/parser.rb', line 68
def get_token_factory
input.get_token_source.get_token_factory
end
|
#get_token_stream ⇒ Object
90
91
92
|
# File 'lib/antlr4ruby/parser.rb', line 90
def get_token_stream
@input
end
|
#is_expected_token(symbol) ⇒ Object
172
173
174
|
# File 'lib/antlr4ruby/parser.rb', line 172
def is_expected_token(symbol)
end
|
#is_matched_eof? ⇒ Boolean
176
177
178
|
# File 'lib/antlr4ruby/parser.rb', line 176
def is_matched_eof?
@matched_eof
end
|
#match(token_type) ⇒ Object
30
31
32
|
# File 'lib/antlr4ruby/parser.rb', line 30
def match(token_type)
end
|
#match_wildcard ⇒ Object
34
35
36
|
# File 'lib/antlr4ruby/parser.rb', line 34
def match_wildcard
end
|
#notify_error_listeners(msg, token, e) ⇒ Object
112
113
114
115
116
117
|
# File 'lib/antlr4ruby/parser.rb', line 112
def notify_error_listeners(msg, token, e)
unless token
token = get_current_token
end
end
|
#precpred(localctx, precedence) ⇒ Object
165
166
167
168
|
# File 'lib/antlr4ruby/parser.rb', line 165
def precpred(localctx, precedence)
end
|
#push_new_recursion_context(localctx, state, rule_index) ⇒ Object
145
146
147
|
# File 'lib/antlr4ruby/parser.rb', line 145
def push_new_recursion_context(localctx, state, rule_index)
end
|
#remove_parse_listener(listener) ⇒ Object
56
57
58
|
# File 'lib/antlr4ruby/parser.rb', line 56
def remove_parse_listener(listener)
end
|
#remove_parse_listeners ⇒ Object
60
61
62
|
# File 'lib/antlr4ruby/parser.rb', line 60
def remove_parse_listeners
listeners.clear
end
|
#reset ⇒ Object
26
27
28
|
# File 'lib/antlr4ruby/parser.rb', line 26
def reset
end
|
#set_build_parse_tree(build_parse_trees) ⇒ Object
38
39
40
|
# File 'lib/antlr4ruby/parser.rb', line 38
def set_build_parse_tree(build_parse_trees)
@build_parse_trees = build_parse_trees
end
|
#set_context(ctx) ⇒ Object
161
162
163
|
# File 'lib/antlr4ruby/parser.rb', line 161
def set_context(ctx)
@ctx = ctx
end
|
#set_error_handler(handler) ⇒ Object
86
87
88
|
# File 'lib/antlr4ruby/parser.rb', line 86
def set_error_handler(handler)
@err_handler = handler
end
|
104
105
106
|
# File 'lib/antlr4ruby/parser.rb', line 104
def set_input_stream(input)
set_token_stream(input)
end
|
#set_profile(profile) ⇒ Object
217
218
219
|
# File 'lib/antlr4ruby/parser.rb', line 217
def set_profile(profile)
end
|
#set_token_factory(factory) ⇒ Object
72
73
74
|
# File 'lib/antlr4ruby/parser.rb', line 72
def set_token_factory(factory)
input.get_token_source.set_token_factory(factory)
end
|
#set_token_stream(input) ⇒ Object
98
99
100
101
102
|
# File 'lib/antlr4ruby/parser.rb', line 98
def set_token_stream(input)
@input = nil
reset
@input = input
end
|
#unroll_recursion_contexts(parent) ⇒ Object
149
150
151
|
# File 'lib/antlr4ruby/parser.rb', line 149
def unroll_recursion_contexts(parent)
end
|