class MODL::Parser::MODLParser
Constants
- AMP
- ARR_SEP
- ASTERISK
- CCOMMENT
- COLON
- COMMENT
- CWS
- EQUALS
- EXCLAM
- FALSE
- FSLASH
- GTHAN
- HASH_PREFIX
- LBRAC
- LCBRAC
- LSBRAC
- LTHAN
- NULL
- NUMBER
- PIPE
- QMARK
- QUOTED
- RBRAC
- RCBRAC
- RSBRAC
- RULE_modl
- RULE_modl_array
- RULE_modl_array_conditional
- RULE_modl_array_conditional_return
- RULE_modl_array_item
- RULE_modl_array_value_item
- RULE_modl_condition
- RULE_modl_condition_group
- RULE_modl_condition_test
- RULE_modl_map
- RULE_modl_map_conditional
- RULE_modl_map_conditional_return
- RULE_modl_map_item
- RULE_modl_nb_array
- RULE_modl_operator
- RULE_modl_pair
- RULE_modl_primitive
- RULE_modl_structure
- RULE_modl_top_level_conditional
- RULE_modl_top_level_conditional_return
- RULE_modl_value
- RULE_modl_value_conditional
- RULE_modl_value_conditional_return
- RULE_modl_value_item
- STRING
- STRUCT_SEP
- TRUE
- WS
Public Class Methods
new( input)
click to toggle source
Calls superclass method
# File lib/modl/parser/MODLParser.rb, line 117 def initialize( input) super(input) i = 0 while i < @@_ATN.number_of_decisions() @@_decisionToDFA[i] = Antlr4::Runtime::DFA.new(@@_ATN.decision_state(i), i) i+=1 end @_interp = Antlr4::Runtime::ParserATNSimulator.new(self,@@_ATN,@@_decisionToDFA,@@_sharedContextCache) end
Public Instance Methods
atn()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 113 def atn() return @@_ATN end
getGrammarFileName()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 101 def getGrammarFileName() return "MODLParser.g4" end
get_vocabulary()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 97 def get_vocabulary @@VOCABULARY end
modl()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 170 def modl() _localctx = ModlContext.new(@_ctx, @_state_number) enter_rule(_localctx, 0, RULE_modl) _la = 0 begin _alt = 0 enter_outer_alt(_localctx, 1) @_state_number = 62 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,3,@_ctx) ) when 1 @_state_number = 49 @_err_handler.sync(self) _la = @_input.la(1) if ((((_la) & ~0x3f) == 0 && ((1 << _la) & ((1 << LBRAC) | (1 << LSBRAC) | (1 << QUOTED) | (1 << STRING) | (1 << LCBRAC))) != 0)) @_state_number = 48 modl_structure() end when 2 @_state_number = 51 modl_structure() @_state_number = 56 @_err_handler.sync(self); _alt = @_interp.adaptive_predict(@_input,1,@_ctx) while ( _alt!=2 && _alt!=Antlr4::Runtime::ATN::INVALID_ALT_NUMBER ) if ( _alt==1 ) @_state_number = 52 match(STRUCT_SEP) @_state_number = 53 modl_structure() end @_state_number = 58 @_err_handler.sync(self) _alt = @_interp.adaptive_predict(@_input,1,@_ctx) end @_state_number = 60 @_err_handler.sync(self) _la = @_input.la(1) if (_la==STRUCT_SEP) @_state_number = 59 match(STRUCT_SEP) end end @_state_number = 64 match(EOF) rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_array()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 460 def modl_array() _localctx = Modl_arrayContext.new(@_ctx, @_state_number) enter_rule(_localctx, 6, RULE_modl_array) _la = 0 begin _alt = 0 enter_outer_alt(_localctx, 1) @_state_number = 85 match(LSBRAC) @_state_number = 110 @_err_handler.sync(self) _la = @_input.la(1) if ((((_la) & ~0x3f) == 0 && ((1 << _la) & ((1 << NULL) | (1 << TRUE) | (1 << FALSE) | (1 << LBRAC) | (1 << LSBRAC) | (1 << NUMBER) | (1 << QUOTED) | (1 << STRING) | (1 << LCBRAC))) != 0)) @_state_number = 88 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,7,@_ctx) ) when 1 @_state_number = 86 modl_array_item() when 2 @_state_number = 87 modl_nb_array() end @_state_number = 107 @_err_handler.sync(self) _la = @_input.la(1) while (_la==STRUCT_SEP) @_state_number = 91 @_err_handler.sync(self) _la = @_input.la(1) loop do @_state_number = 90 match(STRUCT_SEP) @_state_number = 93 @_err_handler.sync(self) _la = @_input.la(1) break if (!( _la==STRUCT_SEP) ) end @_state_number = 97 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,9,@_ctx) ) when 1 @_state_number = 95 modl_array_item() when 2 @_state_number = 96 modl_nb_array() end @_state_number = 102 @_err_handler.sync(self); _alt = @_interp.adaptive_predict(@_input,10,@_ctx) while ( _alt!=2 && _alt!=Antlr4::Runtime::ATN::INVALID_ALT_NUMBER ) if ( _alt==1 ) @_state_number = 99 match(STRUCT_SEP) end @_state_number = 104 @_err_handler.sync(self) _alt = @_interp.adaptive_predict(@_input,10,@_ctx) end @_state_number = 109 @_err_handler.sync(self) _la = @_input.la(1) end end @_state_number = 112 match(RSBRAC) rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_array_conditional()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 1310 def modl_array_conditional() _localctx = Modl_array_conditionalContext.new(@_ctx, @_state_number) enter_rule(_localctx, 24, RULE_modl_array_conditional) _la = 0 begin enter_outer_alt(_localctx, 1) @_state_number = 197 match(LCBRAC) @_state_number = 198 modl_condition_test() @_state_number = 199 match(QMARK) @_state_number = 200 modl_array_conditional_return() @_state_number = 209 @_err_handler.sync(self) _la = @_input.la(1) while (_la==FSLASH) @_state_number = 201 match(FSLASH) @_state_number = 203 @_err_handler.sync(self) _la = @_input.la(1) if ((((_la) & ~0x3f) == 0 && ((1 << _la) & ((1 << NULL) | (1 << TRUE) | (1 << FALSE) | (1 << EQUALS) | (1 << LBRAC) | (1 << LSBRAC) | (1 << NUMBER) | (1 << QUOTED) | (1 << STRING) | (1 << LCBRAC) | (1 << GTHAN) | (1 << LTHAN) | (1 << EXCLAM))) != 0)) @_state_number = 202 modl_condition_test() end @_state_number = 205 match(QMARK) @_state_number = 206 modl_array_conditional_return() @_state_number = 211 @_err_handler.sync(self) _la = @_input.la(1) end @_state_number = 212 match(RCBRAC) rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_array_conditional_return()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 1395 def modl_array_conditional_return() _localctx = Modl_array_conditional_returnContext.new(@_ctx, @_state_number) enter_rule(_localctx, 26, RULE_modl_array_conditional_return) _la = 0 begin enter_outer_alt(_localctx, 1) @_state_number = 215 @_err_handler.sync(self) _la = @_input.la(1) loop do @_state_number = 214 modl_array_item() @_state_number = 217 @_err_handler.sync(self) _la = @_input.la(1) break if (!((((_la) & ~0x3f) == 0 && ((1 << _la) & ((1 << NULL) | (1 << TRUE) | (1 << FALSE) | (1 << LBRAC) | (1 << LSBRAC) | (1 << NUMBER) | (1 << QUOTED) | (1 << STRING) | (1 << LCBRAC))) != 0))) end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_array_item()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 1458 def modl_array_item() _localctx = Modl_array_itemContext.new(@_ctx, @_state_number) enter_rule(_localctx, 28, RULE_modl_array_item) begin @_state_number = 221 @_err_handler.sync(self) case (@_input.la(1)) when MODLParser::NULL, MODLParser::TRUE, MODLParser::FALSE, MODLParser::LBRAC, MODLParser::LSBRAC, MODLParser::NUMBER, MODLParser::QUOTED, MODLParser::STRING enter_outer_alt(_localctx, 1) @_state_number = 219 modl_array_value_item() when MODLParser::LCBRAC enter_outer_alt(_localctx, 2) @_state_number = 220 modl_array_conditional() else raise Antlr4::Runtime::NoViableAltException, self end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_array_value_item()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 2247 def modl_array_value_item() _localctx = Modl_array_value_itemContext.new(@_ctx, @_state_number) enter_rule(_localctx, 44, RULE_modl_array_value_item) begin @_state_number = 320 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,44,@_ctx) ) when 1 enter_outer_alt(_localctx, 1) @_state_number = 316 modl_map() when 2 enter_outer_alt(_localctx, 2) @_state_number = 317 modl_pair() when 3 enter_outer_alt(_localctx, 3) @_state_number = 318 modl_array() when 4 enter_outer_alt(_localctx, 4) @_state_number = 319 modl_primitive() end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_condition()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 1969 def modl_condition() _localctx = Modl_conditionContext.new(@_ctx, @_state_number) enter_rule(_localctx, 38, RULE_modl_condition) _la = 0 begin enter_outer_alt(_localctx, 1) @_state_number = 285 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,39,@_ctx) ) when 1 @_state_number = 284 match(STRING) end @_state_number = 288 @_err_handler.sync(self) _la = @_input.la(1) if ((((_la) & ~0x3f) == 0 && ((1 << _la) & ((1 << EQUALS) | (1 << GTHAN) | (1 << LTHAN) | (1 << EXCLAM))) != 0)) @_state_number = 287 modl_operator() end @_state_number = 290 modl_value() @_state_number = 295 @_err_handler.sync(self) _la = @_input.la(1) while (_la==FSLASH) @_state_number = 291 match(FSLASH) @_state_number = 292 modl_value() @_state_number = 297 @_err_handler.sync(self) _la = @_input.la(1) end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_condition_group()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 2071 def modl_condition_group() _localctx = Modl_condition_groupContext.new(@_ctx, @_state_number) enter_rule(_localctx, 40, RULE_modl_condition_group) _la = 0 begin enter_outer_alt(_localctx, 1) @_state_number = 298 match(LCBRAC) @_state_number = 299 modl_condition_test() @_state_number = 304 @_err_handler.sync(self) _la = @_input.la(1) while (_la==AMP || _la==PIPE) @_state_number = 300 _la = @_input.la(1) if ( !(_la==AMP || _la==PIPE) ) @_err_handler.recover_in_line(self) else if ( @_input.la(1)==Antlr4::Runtime::Token::EOF ) @matchedEOF = true end @_err_handler.report_match(self) consume() end @_state_number = 301 modl_condition_test() @_state_number = 306 @_err_handler.sync(self) _la = @_input.la(1) end @_state_number = 307 match(RCBRAC) rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_condition_test()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 1737 def modl_condition_test() _localctx = Modl_condition_testContext.new(@_ctx, @_state_number) enter_rule(_localctx, 34, RULE_modl_condition_test) _la = 0 begin _alt = 0 enter_outer_alt(_localctx, 1) @_state_number = 254 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,33,@_ctx) ) when 1 @_state_number = 253 match(EXCLAM) end @_state_number = 258 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,34,@_ctx) ) when 1 @_state_number = 256 modl_condition() when 2 @_state_number = 257 modl_condition_group() end @_state_number = 270 @_err_handler.sync(self); _alt = @_interp.adaptive_predict(@_input,37,@_ctx) while ( _alt!=2 && _alt!=Antlr4::Runtime::ATN::INVALID_ALT_NUMBER ) if ( _alt==1 ) @_state_number = 260 _la = @_input.la(1) if ( !(_la==AMP || _la==PIPE) ) @_err_handler.recover_in_line(self) else if ( @_input.la(1)==Antlr4::Runtime::Token::EOF ) @matchedEOF = true end @_err_handler.report_match(self) consume() end @_state_number = 262 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,35,@_ctx) ) when 1 @_state_number = 261 match(EXCLAM) end @_state_number = 266 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,36,@_ctx) ) when 1 @_state_number = 264 modl_condition() when 2 @_state_number = 265 modl_condition_group() end end @_state_number = 272 @_err_handler.sync(self) _alt = @_interp.adaptive_predict(@_input,37,@_ctx) end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_map()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 365 def modl_map() _localctx = Modl_mapContext.new(@_ctx, @_state_number) enter_rule(_localctx, 4, RULE_modl_map) _la = 0 begin enter_outer_alt(_localctx, 1) @_state_number = 72 match(LBRAC) @_state_number = 81 @_err_handler.sync(self) _la = @_input.la(1) if ((((_la) & ~0x3f) == 0 && ((1 << _la) & ((1 << QUOTED) | (1 << STRING) | (1 << LCBRAC))) != 0)) @_state_number = 73 modl_map_item() @_state_number = 78 @_err_handler.sync(self) _la = @_input.la(1) while (_la==STRUCT_SEP) @_state_number = 74 match(STRUCT_SEP) @_state_number = 75 modl_map_item() @_state_number = 80 @_err_handler.sync(self) _la = @_input.la(1) end end @_state_number = 83 match(RBRAC) rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_map_conditional()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 1074 def modl_map_conditional() _localctx = Modl_map_conditionalContext.new(@_ctx, @_state_number) enter_rule(_localctx, 18, RULE_modl_map_conditional) _la = 0 begin enter_outer_alt(_localctx, 1) @_state_number = 171 match(LCBRAC) @_state_number = 172 modl_condition_test() @_state_number = 173 match(QMARK) @_state_number = 174 modl_map_conditional_return() @_state_number = 183 @_err_handler.sync(self) _la = @_input.la(1) while (_la==FSLASH) @_state_number = 175 match(FSLASH) @_state_number = 177 @_err_handler.sync(self) _la = @_input.la(1) if ((((_la) & ~0x3f) == 0 && ((1 << _la) & ((1 << NULL) | (1 << TRUE) | (1 << FALSE) | (1 << EQUALS) | (1 << LBRAC) | (1 << LSBRAC) | (1 << NUMBER) | (1 << QUOTED) | (1 << STRING) | (1 << LCBRAC) | (1 << GTHAN) | (1 << LTHAN) | (1 << EXCLAM))) != 0)) @_state_number = 176 modl_condition_test() end @_state_number = 179 match(QMARK) @_state_number = 180 modl_map_conditional_return() @_state_number = 185 @_err_handler.sync(self) _la = @_input.la(1) end @_state_number = 186 match(RCBRAC) rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_map_conditional_return()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 1159 def modl_map_conditional_return() _localctx = Modl_map_conditional_returnContext.new(@_ctx, @_state_number) enter_rule(_localctx, 20, RULE_modl_map_conditional_return) _la = 0 begin enter_outer_alt(_localctx, 1) @_state_number = 189 @_err_handler.sync(self) _la = @_input.la(1) loop do @_state_number = 188 modl_map_item() @_state_number = 191 @_err_handler.sync(self) _la = @_input.la(1) break if (!((((_la) & ~0x3f) == 0 && ((1 << _la) & ((1 << QUOTED) | (1 << STRING) | (1 << LCBRAC))) != 0))) end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_map_item()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 1222 def modl_map_item() _localctx = Modl_map_itemContext.new(@_ctx, @_state_number) enter_rule(_localctx, 22, RULE_modl_map_item) begin @_state_number = 195 @_err_handler.sync(self) case (@_input.la(1)) when MODLParser::QUOTED, MODLParser::STRING enter_outer_alt(_localctx, 1) @_state_number = 193 modl_pair() when MODLParser::LCBRAC enter_outer_alt(_localctx, 2) @_state_number = 194 modl_map_conditional() else raise Antlr4::Runtime::NoViableAltException, self end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_nb_array()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 593 def modl_nb_array() _localctx = Modl_nb_arrayContext.new(@_ctx, @_state_number) enter_rule(_localctx, 8, RULE_modl_nb_array) begin _alt = 0 enter_outer_alt(_localctx, 1) @_state_number = 120 @_err_handler.sync(self) _alt = 1 loop do case (_alt) when 1 @_state_number = 114 modl_array_item() @_state_number = 116 @_err_handler.sync(self) _alt = 1 loop do case (_alt) when 1 @_state_number = 115 match(COLON) else raise Antlr4::Runtime::NoViableAltException, self end @_state_number = 118 @_err_handler.sync(self) _alt = @_interp.adaptive_predict(@_input,13,@_ctx) break if !( _alt!=2 && _alt!=Antlr4::Runtime::ATN::INVALID_ALT_NUMBER ) end else raise Antlr4::Runtime::NoViableAltException, self end @_state_number = 122 @_err_handler.sync(self) _alt = @_interp.adaptive_predict(@_input,14,@_ctx) break if !( _alt!=2 && _alt!=Antlr4::Runtime::ATN::INVALID_ALT_NUMBER ) end @_state_number = 127 @_err_handler.sync(self); _alt = @_interp.adaptive_predict(@_input,15,@_ctx) while ( _alt!=2 && _alt!=Antlr4::Runtime::ATN::INVALID_ALT_NUMBER ) if ( _alt==1 ) @_state_number = 124 modl_array_item() end @_state_number = 129 @_err_handler.sync(self) _alt = @_interp.adaptive_predict(@_input,15,@_ctx) end @_state_number = 131 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,16,@_ctx) ) when 1 @_state_number = 130 match(COLON) end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_operator()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 1864 def modl_operator() _localctx = Modl_operatorContext.new(@_ctx, @_state_number) enter_rule(_localctx, 36, RULE_modl_operator) begin @_state_number = 282 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,38,@_ctx) ) when 1 enter_outer_alt(_localctx, 1) @_state_number = 273 match(EQUALS) when 2 enter_outer_alt(_localctx, 2) @_state_number = 274 match(GTHAN) when 3 enter_outer_alt(_localctx, 3) @_state_number = 275 match(GTHAN) @_state_number = 276 match(EQUALS) when 4 enter_outer_alt(_localctx, 4) @_state_number = 277 match(LTHAN) when 5 enter_outer_alt(_localctx, 5) @_state_number = 278 match(LTHAN) @_state_number = 279 match(EQUALS) when 6 enter_outer_alt(_localctx, 6) @_state_number = 280 match(EXCLAM) @_state_number = 281 match(EQUALS) end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_pair()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 716 def modl_pair() _localctx = Modl_pairContext.new(@_ctx, @_state_number) enter_rule(_localctx, 10, RULE_modl_pair) _la = 0 begin @_state_number = 140 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,17,@_ctx) ) when 1 enter_outer_alt(_localctx, 1) @_state_number = 133 _la = @_input.la(1) if (!(_la == QUOTED || _la == STRING)) @_err_handler.recover_in_line(self) else if ( @_input.la(1)==Antlr4::Runtime::Token::EOF ) @matchedEOF = true end @_err_handler.report_match(self) consume() end @_state_number = 134 match(EQUALS) @_state_number = 135 modl_value_item() when 2 enter_outer_alt(_localctx, 2) @_state_number = 136 match(STRING) @_state_number = 137 modl_map() when 3 enter_outer_alt(_localctx, 3) @_state_number = 138 match(STRING) @_state_number = 139 modl_array() end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_primitive()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 2334 def modl_primitive() _localctx = Modl_primitiveContext.new(@_ctx, @_state_number) enter_rule(_localctx, 46, RULE_modl_primitive) _la = 0 begin enter_outer_alt(_localctx, 1) @_state_number = 322 _la = @_input.la(1) if (!((((_la) & ~0x3f) == 0 && ((1 << _la) & ((1 << NULL) | (1 << TRUE) | (1 << FALSE) | (1 << NUMBER) | (1 << QUOTED) | (1 << STRING))) != 0))) @_err_handler.recover_in_line(self) else if ( @_input.la(1)==Antlr4::Runtime::Token::EOF ) @matchedEOF = true end @_err_handler.report_match(self) consume() end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_structure()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 277 def modl_structure() _localctx = Modl_structureContext.new(@_ctx, @_state_number) enter_rule(_localctx, 2, RULE_modl_structure) begin @_state_number = 70 @_err_handler.sync(self) case (@_input.la(1)) when MODLParser::LBRAC enter_outer_alt(_localctx, 1) @_state_number = 66 modl_map() when MODLParser::LSBRAC enter_outer_alt(_localctx, 2) @_state_number = 67 modl_array() when MODLParser::LCBRAC enter_outer_alt(_localctx, 3) @_state_number = 68 modl_top_level_conditional() when MODLParser::QUOTED, MODLParser::STRING enter_outer_alt(_localctx, 4) @_state_number = 69 modl_pair() else raise Antlr4::Runtime::NoViableAltException, self end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_top_level_conditional()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 891 def modl_top_level_conditional() _localctx = Modl_top_level_conditionalContext.new(@_ctx, @_state_number) enter_rule(_localctx, 14, RULE_modl_top_level_conditional) _la = 0 begin enter_outer_alt(_localctx, 1) @_state_number = 146 match(LCBRAC) @_state_number = 147 modl_condition_test() @_state_number = 148 match(QMARK) @_state_number = 149 modl_top_level_conditional_return() @_state_number = 158 @_err_handler.sync(self) _la = @_input.la(1) while (_la==FSLASH) @_state_number = 150 match(FSLASH) @_state_number = 152 @_err_handler.sync(self) _la = @_input.la(1) if ((((_la) & ~0x3f) == 0 && ((1 << _la) & ((1 << NULL) | (1 << TRUE) | (1 << FALSE) | (1 << EQUALS) | (1 << LBRAC) | (1 << LSBRAC) | (1 << NUMBER) | (1 << QUOTED) | (1 << STRING) | (1 << LCBRAC) | (1 << GTHAN) | (1 << LTHAN) | (1 << EXCLAM))) != 0)) @_state_number = 151 modl_condition_test() end @_state_number = 154 match(QMARK) @_state_number = 155 modl_top_level_conditional_return() @_state_number = 160 @_err_handler.sync(self) _la = @_input.la(1) end @_state_number = 161 match(RCBRAC) rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_top_level_conditional_return()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 984 def modl_top_level_conditional_return() _localctx = Modl_top_level_conditional_returnContext.new(@_ctx, @_state_number) enter_rule(_localctx, 16, RULE_modl_top_level_conditional_return) _la = 0 begin enter_outer_alt(_localctx, 1) @_state_number = 163 modl_structure() @_state_number = 168 @_err_handler.sync(self) _la = @_input.la(1) while (_la == STRUCT_SEP) @_state_number = 164 match(STRUCT_SEP) @_state_number = 165 modl_structure() @_state_number = 170 @_err_handler.sync(self) _la = @_input.la(1) end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_value()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 2160 def modl_value() _localctx = Modl_valueContext.new(@_ctx, @_state_number) enter_rule(_localctx, 42, RULE_modl_value) begin @_state_number = 314 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,43,@_ctx) ) when 1 enter_outer_alt(_localctx, 1) @_state_number = 309 modl_map() when 2 enter_outer_alt(_localctx, 2) @_state_number = 310 modl_array() when 3 enter_outer_alt(_localctx, 3) @_state_number = 311 modl_nb_array() when 4 enter_outer_alt(_localctx, 4) @_state_number = 312 modl_pair() when 5 enter_outer_alt(_localctx, 5) @_state_number = 313 modl_primitive() end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_value_conditional()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 1546 def modl_value_conditional() _localctx = Modl_value_conditionalContext.new(@_ctx, @_state_number) enter_rule(_localctx, 30, RULE_modl_value_conditional) _la = 0 begin _alt = 0 enter_outer_alt(_localctx, 1) @_state_number = 223 match(LCBRAC) @_state_number = 224 modl_condition_test() @_state_number = 225 match(QMARK) @_state_number = 241 @_err_handler.sync(self) _la = @_input.la(1) if ((((_la) & ~0x3f) == 0 && ((1 << _la) & ((1 << NULL) | (1 << TRUE) | (1 << FALSE) | (1 << LBRAC) | (1 << LSBRAC) | (1 << NUMBER) | (1 << QUOTED) | (1 << STRING) | (1 << LCBRAC))) != 0)) @_state_number = 226 modl_value_conditional_return() @_state_number = 234 @_err_handler.sync(self); _alt = @_interp.adaptive_predict(@_input,30,@_ctx) while ( _alt!=2 && _alt!=Antlr4::Runtime::ATN::INVALID_ALT_NUMBER ) if ( _alt==1 ) @_state_number = 227 match(FSLASH) @_state_number = 228 modl_condition_test() @_state_number = 229 match(QMARK) @_state_number = 230 modl_value_conditional_return() end @_state_number = 236 @_err_handler.sync(self) _alt = @_interp.adaptive_predict(@_input,30,@_ctx) end @_state_number = 237 match(FSLASH) @_state_number = 238 match(QMARK) @_state_number = 239 modl_value_conditional_return() end @_state_number = 243 match(RCBRAC) rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_value_conditional_return()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 1647 def modl_value_conditional_return() _localctx = Modl_value_conditional_returnContext.new(@_ctx, @_state_number) enter_rule(_localctx, 32, RULE_modl_value_conditional_return) _la = 0 begin enter_outer_alt(_localctx, 1) @_state_number = 245 modl_value_item() @_state_number = 250 @_err_handler.sync(self) _la = @_input.la(1) while (_la==COLON) @_state_number = 246 match(COLON) @_state_number = 247 modl_value_item() @_state_number = 252 @_err_handler.sync(self) _la = @_input.la(1) end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
modl_value_item()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 804 def modl_value_item() _localctx = Modl_value_itemContext.new(@_ctx, @_state_number) enter_rule(_localctx, 12, RULE_modl_value_item) begin enter_outer_alt(_localctx, 1) @_state_number = 144 @_err_handler.sync(self) case ( @_interp.adaptive_predict(@_input,18,@_ctx) ) when 1 @_state_number = 142 modl_value() when 2 @_state_number = 143 modl_value_conditional() end rescue Antlr4::Runtime::RecognitionException => re _localctx.exception = re @_err_handler.report_error(self, re) @_err_handler.recover(self, re) ensure exit_rule() end return _localctx end
rule_names()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 105 def rule_names() return @@ruleNames end
serialized_atn()
click to toggle source
# File lib/modl/parser/MODLParser.rb, line 109 def serialized_atn() return @@_serializedATN end