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

change API to allow later binding of external variables

XMLWordPrintableJSON

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • s12
    • s6
    • Front End
    • None

      The API currently requires setting of externally bound variables on the Compiler instance. That's much too early.

      The external variables aren't needed until one is about to execute the processor on data; hence, this setExternalVariable call should also be available on the DataProcessor class.

      This would allow the external variable to be different for each invocation of the parser on different data.

      E.g., if an external variable setting controls byte order, then one could set the byte order to big or little endian just before invoking the parser.

      The point is to put this API both on the Compiler, and on the DataProcessor so that if early binding of a variable is available it can be used, and this will result in compilation of the schema into a more efficient version. The best example of this is character set encoding. If we know that at Compile time, then entirely different, and more efficient, primitives can be chosen for many encodings (fixed width encodings to be specific.). If we do not know the encoding at schema compilation time, then primitives must be selected by DFDL compilation which can accommodate any character encoding, including those with variable width.

              jadams Joshua Adams
              mbeckerle.dfdl Mike Beckerle
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: