cobrix icon indicating copy to clipboard operation
cobrix copied to clipboard

Simplify hierarchical traversal

Open yruslan opened this issue 6 years ago • 2 comments

Background

Currently, the hierarchical records generator uses a lot of auxiliary arrays, maps, etc. Maybe if the parser could specify child segments for segment redefines instead of setting parent segment for child segment redefines the traversal could be simplified.

Feature

Investigate if hierarchical traversal can be simplified.

Additional context

  • Consider using visitor pattern for both nested and hierarchical traversals so that the traversal algorithms can be reused.
  • If this could be achieved the traversal algorithms can be moved from spark-cobol to cobol-parser.

yruslan avatar Nov 06 '19 09:11 yruslan

Wondering what's the best way to proceed here. I can rewrite and refactor the parser as needed so we can also add some of the other features (variable arrays, custom occurs handlers, etc).

What are the parser features we'd need for this?

tr11 avatar Feb 05 '20 21:02 tr11

Thanks for offering help on the parser. But this issue (#208) is more related to #33. The reconstruction of hierarchical records feature is not currently used much so it is not of a high priority. And it does not affect the parser, only AST and hierarchical records traversal. So putting it to the icebox for now.

The variable arrays for records without RDWs is something that I'm going to start work on soon.

By custom occurs handlers you mean #151, right? Let's revisit it once #239 is done.

yruslan avatar Feb 06 '20 13:02 yruslan