Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new eclmap format #63

Merged
merged 8 commits into from
Nov 7, 2019
Merged

new eclmap format #63

merged 8 commits into from
Nov 7, 2019

Conversation

DankRank
Copy link
Member

Convert with awk -f contrib/eclmapcvt.awk old.map > new.map

Documentation from manpage

ECLMAP FILE FORMAT
     Eclmap files, which are added with the -m option,
     consist of two kinds of lines: control lines (which
     start with ‘!’), and mapping lines.

     The file starts with ‘!eclmap’ control line. The rest
     of the control lines select the mapping that is being
     modified:

     ‘!ins_names’
             Instruction names. This is the default map‐
             ping.
             Value: identifier

     ‘!ins_signatures’
             Instruction signatures.
             Value: signature

     ‘!gvar_names’
             Global variable names.
             Value: identifier

     ‘!gvar_types’
             Global variable types.
             Value: type (‘$’ for integer, ‘%’ for float)

     ‘!timeline_ins_names’
             Timeline instruction names.
             Value: identifier

     ‘!timeline_ins_signatures’
             Timeline instruction signatures.
             Value: signature

     Mapping lines are always of form
           [key] [value]
     where key is an integer, and value is a string with‐
     out spaces.  ‘_’ can be used to specify an empty
     value (useful for signatures without arguments).

     When multiple mappings are specified for the same key
     or value, the most recent one has priority. For exam‐
     ple:

           123 foo
           123 bar

     will map ‘123’ to ‘bar’, ‘bar’ to ‘123’, and ‘foo’ to
     ‘123’.  Note how the reverse mapping doesn't get
     overridden.

Someone please check that everything works

Converter from old to new is available in contrib/eclmapcvt.awk

The data structure and parser have been generalized, and now are named
seqmap. They will probably move out of thecl tree and go into utils.

Ecl-specific stuff is in eclmap.c.
This makes it easier to override value->key mappings.

seqmap_set now simply prepends a copy and doesn't do any merging.
This might be wasteful on memory in the case of overrides, but at least
it's not broken: now you can have two mnemonics for a single
instruction.

- formatting fixes
Available in eclmaps and as a #timeline_ins directive (probably will get
removed or renamed later).

Still no signature checking.
@Priw8
Copy link
Member

Priw8 commented Nov 1, 2019

For reasons I do not understand, the awk script fails to convert th15.eclm, th12.eclm and th11.eclm from this repo - somehow, it throws the this isn't an old-style eclmap error, even though it clearly shouldn't, as they do begin with the eclmap magic. The other eclmaps from the repo get converted correctly. Maybe it's just some bizarre issue on my end, though.

@DankRank
Copy link
Member Author

DankRank commented Nov 1, 2019

Fixed. It was because of line endings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants