Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-933

Improve PState/InStream/DFDLReader/Reader[Char] stack

XMLWordPrintableJSON

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.0.0
    • s13
    • Back End
    • None

      Every parser action copies a lot of state objects right now. These data structures could be redesigned so that most actions copy minimally. This is still in keeping with the functional-programming style of I/O where input operations don't modify an I/O layer, rather they produce values and a new State.

      Currently the backend parsers consume and produce a PState. This object has many slots so copying it isn't cheap. One of the slots is an InStream object, also has to be copied, and depending on some things, a DFDLReader, may be there too.

      All of these should be squished together into one class (called PState), which has a tree-like shape. The basic PState object should have two slots: bitPosition, and "Everything Else" so that just advancing the position causes minimal work.

      Also suspect: the stacks of array pos, child pos and group pos should go away and become Dynamic Variables. (This may apply to other things as well).

      The new PState should support the union of the operations of DFDLCharReader and InStream, plus should support getStringInBytes and getStringInCharacters methods so that primitives don't have to do their own charset decoding.

              jchab Jessie Chab
              mbeckerle.dfdl Mike Beckerle
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 18 minutes
                  18m