Module: B64GRAMMAR
- Includes:
- Treetop::Runtime
- Included in:
- B64GRAMMARParser
- Defined in:
- lib/cbor-diagnostic-app/b64grammar.rb
Defined Under Namespace
Modules: AppStringB640, AppStringB641, AppStringB642, AppStringB643, AppStringB644
Instance Method Summary collapse
- #_nt_ALPHA ⇒ Object
- #_nt_app_string_b64 ⇒ Object
- #_nt_B ⇒ Object
- #_nt_b64dig ⇒ Object
- #_nt_DIGIT ⇒ Object
- #_nt_iblank ⇒ Object
- #_nt_lcalpha ⇒ Object
- #root ⇒ Object
Instance Method Details
#_nt_ALPHA ⇒ Object
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 |
# File 'lib/cbor-diagnostic-app/b64grammar.rb', line 431 def _nt_ALPHA start_index = index if node_cache[:ALPHA].has_key?(index) cached = node_cache[:ALPHA][index] if cached node_cache[:ALPHA][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index if has_terminal?(@regexps[gr = '\A[A-Z]'] ||= Regexp.new(gr), :regexp, index) r1 = true @index += 1 else terminal_parse_failure('[A-Z]') r1 = nil end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_lcalpha if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else @index = i0 r0 = nil end end node_cache[:ALPHA][start_index] = r0 r0 end |
#_nt_app_string_b64 ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/cbor-diagnostic-app/b64grammar.rb', line 69 def _nt_app_string_b64 start_index = index if node_cache[:app_string_b64].has_key?(index) cached = node_cache[:app_string_b64][index] if cached node_cache[:app_string_b64][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_B s0 << r1 if r1 s2, i2 = [], index loop do s3, i3 = [], index loop do i4, s4 = index, [] r5 = _nt_b64dig s4 << r5 if r5 r6 = _nt_B s4 << r6 end if s4.last r4 = instantiate_node(SyntaxNode,input, i4...index, s4) r4.extend(AppStringB640) else @index = i4 r4 = nil end if r4 s3 << r4 else break end if s3.size == 4 break end end if s3.size < 4 @index = i3 r3 = nil else if s3.size < 4 @terminal_failures.pop end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) end if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 if r2 i8, s8 = index, [] r9 = _nt_b64dig s8 << r9 if r9 r10 = _nt_B s8 << r10 if r10 r11 = _nt_b64dig s8 << r11 if r11 r12 = _nt_B s8 << r12 if r12 i14 = index i15, s15 = index, [] if (match_len = has_terminal?("=", false, index)) r16 = true @index += match_len else terminal_parse_failure('"="') r16 = nil end s15 << r16 if r16 r17 = _nt_B s15 << r17 if r17 if (match_len = has_terminal?("=", false, index)) r18 = true @index += match_len else terminal_parse_failure('"="') r18 = nil end s15 << r18 end end if s15.last r15 = instantiate_node(SyntaxNode,input, i15...index, s15) r15.extend(AppStringB641) else @index = i15 r15 = nil end if r15 r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true r14 = r15 else i19, s19 = index, [] r20 = _nt_b64dig s19 << r20 if r20 r21 = _nt_B s19 << r21 if r21 if (match_len = has_terminal?("=", false, index)) r23 = true @index += match_len else terminal_parse_failure('"="') r23 = nil end if r23 r22 = r23 else r22 = instantiate_node(SyntaxNode,input, index...index) end s19 << r22 end end if s19.last r19 = instantiate_node(SyntaxNode,input, i19...index, s19) r19.extend(AppStringB642) else @index = i19 r19 = nil end if r19 r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true r14 = r19 else @index = i14 r14 = nil end end if r14 r13 = r14 else r13 = instantiate_node(SyntaxNode,input, index...index) end s8 << r13 if r13 r24 = _nt_B s8 << r24 end end end end end if s8.last r8 = instantiate_node(SyntaxNode,input, i8...index, s8) r8.extend(AppStringB643) else @index = i8 r8 = nil end if r8 r7 = r8 else r7 = instantiate_node(SyntaxNode,input, index...index) end s0 << r7 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(AppStringB644) else @index = i0 r0 = nil end node_cache[:app_string_b64][start_index] = r0 r0 end |
#_nt_B ⇒ Object
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/cbor-diagnostic-app/b64grammar.rb', line 336 def _nt_B start_index = index if node_cache[:B].has_key?(index) cached = node_cache[:B][index] if cached node_cache[:B][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end s0, i0 = [], index loop do r1 = _nt_iblank if r1 s0 << r1 else break end end r0 = instantiate_node(SyntaxNode,input, i0...index, s0) node_cache[:B][start_index] = r0 r0 end |
#_nt_b64dig ⇒ Object
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/cbor-diagnostic-app/b64grammar.rb', line 256 def _nt_b64dig start_index = index if node_cache[:b64dig].has_key?(index) cached = node_cache[:b64dig][index] if cached node_cache[:b64dig][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_ALPHA if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_DIGIT if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else if (match_len = has_terminal?("-", false, index)) r3 = true @index += match_len else terminal_parse_failure('"-"') r3 = nil end if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else if (match_len = has_terminal?("_", false, index)) r4 = true @index += match_len else terminal_parse_failure('"_"') r4 = nil end if r4 r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true r0 = r4 else if (match_len = has_terminal?("+", false, index)) r5 = true @index += match_len else terminal_parse_failure('"+"') r5 = nil end if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r0 = r5 else if (match_len = has_terminal?("/", false, index)) r6 = true @index += match_len else terminal_parse_failure('"/"') r6 = nil end if r6 r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true r0 = r6 else @index = i0 r0 = nil end end end end end end node_cache[:b64dig][start_index] = r0 r0 end |
#_nt_DIGIT ⇒ Object
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
# File 'lib/cbor-diagnostic-app/b64grammar.rb', line 469 def _nt_DIGIT start_index = index if node_cache[:DIGIT].has_key?(index) cached = node_cache[:DIGIT][index] if cached node_cache[:DIGIT][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if has_terminal?(@regexps[gr = '\A[0-9]'] ||= Regexp.new(gr), :regexp, index) r0 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('[0-9]') r0 = nil end node_cache[:DIGIT][start_index] = r0 r0 end |
#_nt_iblank ⇒ Object
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 |
# File 'lib/cbor-diagnostic-app/b64grammar.rb', line 363 def _nt_iblank start_index = index if node_cache[:iblank].has_key?(index) cached = node_cache[:iblank][index] if cached node_cache[:iblank][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index if (match_len = has_terminal?("\n", false, index)) r1 = true @index += match_len else terminal_parse_failure('"\\n"') r1 = nil end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else if (match_len = has_terminal?(" ", false, index)) r2 = true @index += match_len else terminal_parse_failure('" "') r2 = nil end if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else @index = i0 r0 = nil end end node_cache[:iblank][start_index] = r0 r0 end |
#_nt_lcalpha ⇒ Object
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'lib/cbor-diagnostic-app/b64grammar.rb', line 407 def _nt_lcalpha start_index = index if node_cache[:lcalpha].has_key?(index) cached = node_cache[:lcalpha][index] if cached node_cache[:lcalpha][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if has_terminal?(@regexps[gr = '\A[a-z]'] ||= Regexp.new(gr), :regexp, index) r0 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('[a-z]') r0 = nil end node_cache[:lcalpha][start_index] = r0 r0 end |
#root ⇒ Object
8 9 10 |
# File 'lib/cbor-diagnostic-app/b64grammar.rb', line 8 def root @root ||= :app_string_b64 end |