Re: Compressed Linetables

new topic     » goto parent     » topic index » view thread      » older message » newer message
petelomax said...

As long as you are aware that the above table is

   {skip,code, 
    skip,code,code, 
    skip,code,code,code, 
    skip,code, 
    skip,code,code,code, 
    skip,... 
There's no pattern, other than someone's coding/spacing/commenting style, plus any lines the compiler could completely optimise away. There may, in fact, not be any skips at all, but if there are present, they are never consecutive but instead always separated by one or more code offsets(/sizes). If you split it into two lists it might be difficult if not impossible to recombine them correctly.

I understand, but you could also write it this way, given that multiple code offsets mapped to the same line would be the same as a skip of zero, resulting in this:

   {skip,code, 
    skip,code,0,code, 
    skip,code,0,code,0,code, 
    skip,code, 
    skip,code,0,code,0,code, 
    skip,... 
which could then be split into two lists of the same length. But doing it this way is just an implementation detail that doesn't really matter to your challenge. You just want to see an encoder that takes your table and outputs some compressed data that later be decoded and queried to get a line number given a machine code offset.

I've been working on the arithmetic coding, and I'm starting to believe it's way overkill, but at least it's been a learning experience. I'll post it when I have the decoder working.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu