Ticket #32 (closed enhancement: wontfix)

Opened 2 years ago

Last modified 1 year ago

Use higher level syntax

Reported by: haypo Assigned to: haypo
Priority: lowest Milestone:
Component: core Keywords:
Cc:

Description

!! Problem

Problems of Hachoir syntax:

  • Hachoir parser are very close classic parser code: it's like a list of read(type, length)
  • It's hard to convert an Hachoir parser to another syntax (C struct or any other parser syntax)

Requirements:

  • need arithmetic operations: a+b, a-b, a*b, a/b (integer divison), a%b
  • need (sometimes) to call Python function: alignValue() or many functions when creating a field description
  • need to be able to get other field attribute (brother or parent)

More complex requirements:

  • what about loop on range?
    for index in range(n):
       ...
    
  • what about loop with condition?
    while self.current_size < self.size:
       ...
    while True:
      offset = UInt32(self, "offset[]")
      yield offset
      if offset.value == 0:
         break
    
  • what about test (if)?
    if self["has_comment"].value:
       yield CString(self, "comment")
    

Haypo: "On my mind, it's not possible or at least very complex"

!! Existing syntax for binary parsers

Attachments

Change History

10/26/06 01:26:29 changed by haypo

  • owner set to haypo.
  • component set to hachoir-core.

10/30/06 11:58:49 changed by haypo

10/30/06 13:34:00 changed by Guyou

Can I suggest to look around www.ccsds.org as binary data is fundamental in space applications. In particular, we can find the DEDSL format ( public.ccsds.org/publications/archive/647x3b1.pdf for XML syntax). A (proprietary) tool is normaly able to handle that: debat.c-s.fr

(No HTML links due to a reject for SPAM reason)

04/11/07 18:41:05 changed by haypo

  • status changed from new to closed.
  • resolution set to wontfix.

Ticket replaced with wiki:ParserLanguage


Add/Change #32 (Use higher level syntax)




Action