Many may think that EDIFACT is easy to parse, which may be the case. But it is NOT easy to interpret.
There are hundreds of "substandards" per industry. For example for clothes or medicine, most vendors have custom fields outside of the standard which MUST be interpreted/sent or everything falls apart
What is a "real" syntax tree? I wonder if the intent was "concrete" (the contrast to an abstract syntax tree), or if it's meant colloquially (as in "you really get a syntax tree" or "you get an actual syntax tree") rather than as a technical term.
I think OP means that it will parse EDIFACT with the tree structure it actually has in its specification, instead of a simple list of messages like many people do.
EDIFACT normally has (possibly repeating, possibly nesting) segment groups and a lot of code trying to handle EDIFACT skips over that.
Edison is a Python library for parsing EDIFACT messages. Instead of treating a message as a flat list of segments, it models messages as a syntax tree: segments can define groups of child segments, recursively.
You define the syntax tree once, then parse, validate, or pretty-print messages against that structure.
It works by converting the syntax tree to a state machine of possible transitions between segments.
Once you know the tree, edi is trivial to parse. You can even do it with a loop and a state to store which level has which tag and what the current count is.
The real challenge was to discover what the tree was. Like wayfair order listings, cargo delivery messages, which are also similar to how Rhenus does them. Every vendor has their own format and standards.
There are hundreds of "substandards" per industry. For example for clothes or medicine, most vendors have custom fields outside of the standard which MUST be interpreted/sent or everything falls apart
EDIFACT normally has (possibly repeating, possibly nesting) segment groups and a lot of code trying to handle EDIFACT skips over that.
You define the syntax tree once, then parse, validate, or pretty-print messages against that structure. It works by converting the syntax tree to a state machine of possible transitions between segments.
The real challenge was to discover what the tree was. Like wayfair order listings, cargo delivery messages, which are also similar to how Rhenus does them. Every vendor has their own format and standards.