Module: Mail::Parsers::Ragel::DateTimeMachine

### Home Classes Methods

### In Files

- lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb

### Methods

- ::parse

### Files

- TODO.rdoc

### Class/Module Index

Quicksearch

- Mail
- Mail::Address
- Mail::AddressContainer
- Mail::AttachmentsList
- Mail::BccField
- Mail::Body
- Mail::CcField
- Mail::CheckDeliveryParams
- Mail::CommentsField
- Mail::Constants
- Mail::ContentDescriptionField
- Mail::ContentDispositionField
- Mail::ContentIdField
- Mail::ContentLocationField
- Mail::ContentTransferEncodingElement
- Mail::ContentTransferEncodingField
- Mail::ContentTypeField
- Mail::DateField
- Mail::Encodings
- Mail::Encodings::Base64
- Mail::Encodings::Binary
- Mail::Encodings::EightBit
- Mail::Encodings::QuotedPrintable
- Mail::Encodings::SevenBit
- Mail::Encodings::TransferEncoding
- Mail::Encodings::UnixToUnix
- Mail::Envelope
- Mail::EnvelopeFromElement
- Mail::Exim
- Mail::Field
- Mail::Field::FieldError
- Mail::FieldList
- Mail::FileDelivery
- Mail::FromField
- Mail::Header
- Mail::IMAP
- Mail::InReplyToField
- Mail::IndifferentHash
- Mail::KeywordsField
- Mail::Matchers
- Mail::Matchers::HasSentEmailMatcher
- Mail::MessageIdField
- Mail::MessageIdsElement
- Mail::MimeVersionElement
- Mail::MimeVersionField
- Mail::Multibyte
- Mail::Multibyte::EncodingError
- Mail::OptionalField
- Mail::POP3
- Mail::ParameterHash
- Mail::Parsers
- Mail::Parsers::AddressListsParser
- Mail::Parsers::ContentDispositionParser
- Mail::Parsers::ContentLocationParser
- Mail::Parsers::ContentTransferEncodingParser
- Mail::Parsers::ContentTypeParser
- Mail::Parsers::DateTimeParser
- Mail::Parsers::EnvelopeFromParser
- Mail::Parsers::MessageIdsParser
- Mail::Parsers::MimeVersionParser
- Mail::Parsers::PhraseListsParser
- Mail::Parsers::Ragel
- Mail::Parsers::Ragel::AddressListsMachine
- Mail::Parsers::Ragel::ContentDispositionMachine
- Mail::Parsers::Ragel::ContentLocationMachine
- Mail::Parsers::Ragel::ContentTransferEncodingMachine
- Mail::Parsers::Ragel::ContentTypeMachine
- Mail::Parsers::Ragel::DateTimeMachine
- Mail::Parsers::Ragel::EnvelopeFromMachine
- Mail::Parsers::Ragel::MessageIdsMachine
- Mail::Parsers::Ragel::MimeVersionMachine
- Mail::Parsers::Ragel::PhraseListsMachine
- Mail::Parsers::Ragel::ReceivedMachine
- Mail::Parsers::Ragel::Ruby
- Mail::Parsers::ReceivedParser
- Mail::Part
- Mail::PartsList
- Mail::PhraseList
- Mail::ReceivedElement
- Mail::ReceivedField
- Mail::ReferencesField
- Mail::ReplyToField
- Mail::ResentBccField
- Mail::ResentCcField
- Mail::ResentDateField
- Mail::ResentFromField
- Mail::ResentMessageIdField
- Mail::ResentSenderField
- Mail::ResentToField
- Mail::Retriever
- Mail::ReturnPathField
- Mail::Ruby18
- Mail::Ruby19
- Mail::Ruby19::BestEffortCharsetEncoder
- Mail::Ruby19::StrictCharsetEncoder
- Mail::SMTP
- Mail::SMTPConnection
- Mail::SenderField
- Mail::Sendmail
- Mail::StructuredField
- Mail::SubjectField
- Mail::TestMailer
- Mail::TestRetriever
- Mail::ToField
- Mail::UnstructuredField
- Mail::Utilities
- Mail::VERSION
- Net
- Net::SMTP
- Object
- String

No matching classes.

# Mail::Parsers::Ragel::DateTimeMachine

### Attributes

date_time_en_comment_tail[RW]
date_time_en_main[RW]
date_time_error[RW]
date_time_first_final[RW]
date_time_start[RW]

### Public Class Methods

parse(data) click to toggle source

line 17 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb.rl"

    # File lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb, line 574
            def self.parse(data)
              p = 0
              eof = data.length
              stack = []

              actions = []
              data_unpacked = data.bytes.to_a

    # line 583 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb"
    begin
            p ||= 0
            pe ||= data.length
            cs = date_time_start
            top = 0
    end

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

    # line 593 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/date_time_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 = _date_time_index_offsets[cs]
            _slen = _date_time_key_spans[cs]
            _trans = if (   _slen > 0 &&
                            _date_time_trans_keys[_keys] <= ( data_unpacked[p]) &&
                            ( data_unpacked[p]) <= _date_time_trans_keys[_keys + 1]
                        ) then
                            _date_time_indicies[ _inds + ( data_unpacked[p]) - _date_time_trans_keys[_keys] ]
                     else
                            _date_time_indicies[ _inds + _slen ]
                     end
            cs = _date_time_trans_targs[_trans]
            if _date_time_trans_actions[_trans] != 0
            case _date_time_trans_actions[_trans]
            when 4 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 1 then
    # line 12 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
                    begin
     actions.push(9, p)             end
            when 13 then
    # line 47 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
                    begin
     actions.push(44, 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 = 91
                    _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 5 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 = 91
                    _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 = 91
                    _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 6 then
    # line 11 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
                    begin
     actions.push(8, p)             end
    # line 48 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
                    begin
     actions.push(45, p)            end
            when 8 then
    # line 12 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
                    begin
     actions.push(9, 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 = 91
                    _goto_level = _again
                    next
            end
                    end
            when 14 then
    # line 47 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
                    begin
     actions.push(44, 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 = 91
                    _goto_level = _again
                    next
            end
                    end
            when 2 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 = 91
                    _goto_level = _again
                    next
            end
                    end
    # line 12 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
                    begin
     actions.push(9, p)             end
            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
    # line 11 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
                    begin
     actions.push(8, p)             end
    # line 48 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
                    begin
     actions.push(45, p)            end
    # line 766 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/date_time_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 _date_time_eof_actions[cs]
            when 4 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 13 then
    # line 47 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
                    begin
     actions.push(44, p)            end
    # line 792 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/date_time_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/date_time_machine.rb.rl"

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

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.