Menu

#1093 [PATCH] Lexer for Intel HEX file format

Committed
closed
5
2015-01-19
2014-12-24
No

These patches adapt LexHex.cxx to support Intel HEX in addition to Motorola S-Record. Patches 1-3 fix/extend some S-Record stuff, patch 4 prepares some helper functions for reusing in Intel HEX, patch 5 adds the new lexer. In the example file, the first section is valid and the second section contains errors (unknown type, wrong byte count, wrong checksum).

I wonder whether it would be better to use the same lexical states for both lexers because they are mostly equal with few states only occuring in one of the lexers. I.e. SCE_HEX_ instead of SCE_SREC_ and SCE_IHEX_.

Another tought is about reordering the states to keep related states side by side. And also keeping gaps between groups for extensibility, is this usual?

I know, the states must not be changed for compatibility reasons, but maybe this is not true as long as the states/lexers have not been released yet?

1 Attachments

Discussion

  • Neil Hodgson

    Neil Hodgson - 2014-12-27

    The states are similar enough that sharing would be reasonable. Sharing may lead to better support in projects using these lexers.

    If you want to renumber states then do it before this is in a release. The next release is likely in 2 to 4 weeks.

    Current lexers mostly avoid gaps so downstream projects do not expect them and may behave in unexpected ways.

    State ordering is not generally important although it may lead to ordering in UI elements.

     
  • Neil Hodgson

    Neil Hodgson - 2015-01-11
    • assigned_to: Neil Hodgson
    • Group: Completed --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2015-01-19
    • status: open --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.