Module: Mail::Parsers::Ragel::PhraseListsMachine

Defined in:
lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.phrase_lists_en_comment_tailObject

Returns the value of attribute phrase_lists_en_comment_tail



330
331
332
# File 'lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb', line 330

def phrase_lists_en_comment_tail
  @phrase_lists_en_comment_tail
end

.phrase_lists_en_mainObject

Returns the value of attribute phrase_lists_en_main



334
335
336
# File 'lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb', line 334

def phrase_lists_en_main
  @phrase_lists_en_main
end

.phrase_lists_errorObject

Returns the value of attribute phrase_lists_error



325
326
327
# File 'lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb', line 325

def phrase_lists_error
  @phrase_lists_error
end

.phrase_lists_first_finalObject

Returns the value of attribute phrase_lists_first_final



321
322
323
# File 'lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb', line 321

def phrase_lists_first_final
  @phrase_lists_first_final
end

.phrase_lists_startObject

Returns the value of attribute phrase_lists_start



317
318
319
# File 'lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb', line 317

def phrase_lists_start
  @phrase_lists_start
end

Class Method Details

.parse(data) ⇒ Object

line 17 “/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb.rl”



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
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
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
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
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
# File 'lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb', line 341

def self.parse(data)
  p = 0
  eof = data.length
  stack = []

  actions = []
  data_unpacked = data.bytes.to_a
  
# line 350 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb"
begin
  p ||= 0
  pe ||= data.length
  cs = phrase_lists_start
  top = 0
end

# line 26 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb.rl"
  
# line 360 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb"
begin
  testEof = false
  _slen, _trans, _keys, _inds, _acts, _nacts = nil
  _goto_level = 0
  _resume = 10
  _eof_trans = 15
  _again = 20
  _test_eof = 30
  _out = 40
  while true
  if _goto_level <= 0
  if p == pe
    _goto_level = _test_eof
    next
  end
  if cs == 0
    _goto_level = _out
    next
  end
  end
  if _goto_level <= _resume
  _keys = cs << 1
  _inds = _phrase_lists_index_offsets[cs]
  _slen = _phrase_lists_key_spans[cs]
  _trans = if (   _slen > 0 && 
      _phrase_lists_trans_keys[_keys] <= ( data_unpacked[p]) && 
      ( data_unpacked[p]) <= _phrase_lists_trans_keys[_keys + 1] 
        ) then
      _phrase_lists_indicies[ _inds + ( data_unpacked[p]) - _phrase_lists_trans_keys[_keys] ] 
     else 
      _phrase_lists_indicies[ _inds + _slen ]
     end
  cs = _phrase_lists_trans_targs[_trans]
  if _phrase_lists_trans_actions[_trans] != 0
  case _phrase_lists_trans_actions[_trans]
  when 7 then
# line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(4, p)     end
  when 9 then
# line 8 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(5, p)     end
  when 13 then
# line 39 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(36, p)    end
  when 1 then
# line 40 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(37, p)    end
  when 6 then
# line 41 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(38, p)    end
  when 4 then
# line 42 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(39, p)    end
  when 3 then
# line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
    begin
  begin
    stack[top] = cs
    top+= 1
    cs = 16
    _goto_level = _again
    next
  end
    end
  when 12 then
# line 6 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
    begin
  begin
    top -= 1
    cs = stack[top]
    _goto_level = _again
    next
  end
    end
  when 14 then
# line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(4, p)     end
# line 39 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(36, p)    end
  when 8 then
# line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(4, p)     end
# line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
    begin
  begin
    stack[top] = cs
    top+= 1
    cs = 16
    _goto_level = _again
    next
  end
    end
  when 10 then
# line 8 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(5, p)     end
# line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
    begin
  begin
    stack[top] = cs
    top+= 1
    cs = 16
    _goto_level = _again
    next
  end
    end
  when 11 then
# line 8 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(5, p)     end
# line 6 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
    begin
  begin
    top -= 1
    cs = stack[top]
    _goto_level = _again
    next
  end
    end
  when 2 then
# line 40 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(37, p)    end
# line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
    begin
  begin
    stack[top] = cs
    top+= 1
    cs = 16
    _goto_level = _again
    next
  end
    end
  when 5 then
# line 42 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(39, p)    end
# line 41 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(38, p)    end
# line 510 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb"
  end
  end
  end
  if _goto_level <= _again
  if cs == 0
    _goto_level = _out
    next
  end
  p += 1
  if p != pe
    _goto_level = _resume
    next
  end
  end
  if _goto_level <= _test_eof
  if p == eof
    case _phrase_lists_eof_actions[cs]
  when 13 then
# line 39 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(36, p)    end
  when 14 then
# line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(4, p)     end
# line 39 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
    begin
 actions.push(36, p)    end
# line 539 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb"
    end
  end

  end
  if _goto_level <= _out
    break
  end
end
  end

# line 27 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb.rl"

  if p == eof && cs >= 
# line 553 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb"
21
# line 28 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb.rl"

    return actions, nil
  else
    return [], "Only able to parse up to #{data[0..p]}"
  end
end