You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by ji...@apache.org on 2021/03/30 15:15:21 UTC

[daffodil] 05/09: Support arrays, real numbers, and improve TDML processing

This is an automated email from the ASF dual-hosted git repository.

jinterrante pushed a commit to branch runtime2-2202
in repository https://gitbox.apache.org/repos/asf/daffodil.git

commit 10618041eae1ac0509e12f608528e604ed80d83d
Author: John Interrante <in...@research.ge.com>
AuthorDate: Thu Jan 7 11:54:00 2021 -0500

    Support arrays, real numbers, and improve TDML processing
    
    Expand the C code generator to support both binary real numbers and
    fixed occurrence arrays of binary numbers.  Reduce the size of the
    generated C code by emitting one-line function calls instead of 14-16
    lines of low level parsing & unparsing C code for each binary number.
    Move the 14-16 lines of low level code into functions within parsers.c
    and unparsers.c in the c/libruntime directory instead.
    
    Remove the orion-command element from TestRuntime2.dfdl.xsd and add it
    back as a new test schema (orion-command.dfdl.xsd), tests
    (orion-command.tdml), and data files (command_parse.dat/unparse.xml,
    video_settings_parse.dat/unparse.xml).  Rename the ex_ints element in
    TestRuntime2.dfdl.xsd to ex_nums and add arrays and real numbers to
    its schema and data files.
    
    Fix file-writing/reading collision problems when both TestOrionCommand
    and TestRuntime2 try to compile and run C code at the same time.  Get
    rid of dev.dirs % directories-jvm and make the TDML processor write to
    a temporary unique directory for each test which gets deleted after
    each test.  Thankfully, the "zig cc" command now caches previously
    built files in zig's own global cache directory instead of a local
    zig_cache directory so the TDML processor no longer needs to write to
    a daffodil cache directory anymore.
    
    Changelog:
    
    In main.yml, install pkgconf instead of pkg-config in msys2 setup
    since pkgconf is newer and better.
    
    In README.md, add new build requirements so developers will know they
    will need a C compiler and Mini-XML library to build Daffodil.
    
    In bin.LICENSE, remove license for dirs-dev / directories-jvm.
    
    In TestCLIGenerateC.scala, rename ex_ints to ex_nums.
    
    In c/Makefile, change CFLAGS for easier debugging and remove unneeded
    libraries.
    
    Run include-what-you-use on C source files in verbose mode to update
    comments saying exactly what is used from each include in these files:
    
     - daffodil_argp.c
     - daffodil_main.c
     - xml_reader.c
     - xml_writer.c
     - infoset.c
     - parsers.[ch]
     - unparsers.[ch]
     - ex_nums.[ch]
    
    In daffodil_main.c, update the parseSelf and unparseSelf calls since
    they now return void instead of const char *error_msg.
    
    In xml_reader.c, define new strtofnum and strtodnum functions to
    support reading floating point numbers from XML data.  Rename
    xmlIntegerElem to xmlNumberElem and make it call strtofnum and
    strtodnum as well as strtounum and strtonum.
    
    In xml_writer.c, rename xmlIntegerElem to xmlNumberElem and make it
    write floating point numbers as well as integers.  Use G format
    specifier and call fixNumberIfNeeded on number's text afterwards to
    ensure that [-]INF and NaN will be capitalized correctly according to
    the XML Schema's xsd:float specification.  We still need to make
    runtime1 and runtime2's XML floating point output match each other
    even more closely or make TDML Runner compare real numbers
    numerically, not textually, so it can ignore minor textual differences
    without ignoring numerical differences.
    
    In infoset.c, make walkInfosetNode call visitNumberElem for primitive
    floats/doubles as well as primitive integers.
    
    In infoset.h, change signatures of parseSelf and unparseSelf.  Rename
    VisitIntegerElem to VisitNumberElem.  Add enumerations for primitive
    floats/doubles.  Add const char *error_msg to PState and UState
    structs so parser/unparser functions can set it when needed.  Add
    (void) to rootElement() to fix -Weverything warning.
    
    In parsers.{c,h}, define functions to parse binary real and integer
    numbers.  Use macros to achieve DRY (Don't Repeat Yourself).  Note
    that binary floating point numbers can be little-endian or big-endian
    just like binary integers.
    
    In unparsers.{c,h}, define functions to unparse binary real and
    integer numbers.  Use macros to achieve DRY (Don't Repeat Yourself).
    
    In ex_nums.{c,h}, rename from ex_ints.{c,h} to ex_nums.{c,h}.  Verify
    real numbers work, then implement and test code to support a fixed
    occurrence array, propagate changes to C code generator, and verify C
    code generator produces same code.  Add a second array to ex_nums'
    schema and verify C code generator generates appropriate code for it
    too.  Make generator add (void) to rootElement() and (const char*) to
    ERD offset computations to fix -Weverything warnings.
    
    In CodeGenerator.scala, make generateCode return codeDir rather than
    outputDir, pass codeDir rather than outputDir to compileCode, and
    perform compilation in codeDir rather than outputDir since "zig cc"
    will now cache previously built files in zig's global cache directory,
    not a local zig_cache directory.
    
    In Runtime2CodeGenerator.scala, add BinaryFloat and BinaryDouble cases
    within the generateCode function and make them call
    BinaryFloatCodeGenerator.  Also add and call a noop function to
    facilitate setting a breakpoint within the generateCode function.
    
    In BinaryFloatCodeGenerator.scala, initialize float fields with NaN
    macro (NAN) since some platforms don't define signaling NaN macros
    (SNAN & SNANF).  Emit one-line function calls to parse and unparse
    32-bit, 64-bit big-endian & little-endian binary floats.  Generate
    code to initialize a floating point array, parse data into the array,
    and unparse data from the array too.
    
    In BinaryIntegerKnownLengthCodeGenerator.scala, remove minimum 8-bit
    alignment restriction to allow schemas to say they want 1-bit
    alignment although C runtime can't handle binary numbers smaller than
    8 bits right now.  Emit one-line function calls to parse and unparse
    binary 8-bit, 16-bit, 32-bit, 64-bit big-endian & little-endian binary
    integers.  Generate code to initialize an integer array, parse data
    into the array, and unparse data from the array too.  Call
    e.schemaDefinitionUnless instead of e.SDE inside an if expression to
    avoid uncovered line of code warning as Mike suggested.
    
    In CodeGeneratorState.scala, add private qualifiedName and localName
    methods to generate unique C file-scope names for ERD objects and
    plain local names for structs/fields although we probably will need to
    prepend namespace prefixes to plain local names to disambiguate some
    structs/fields from each other later.  Make changes to support arrays
    and binary floats as well as binary integers.  Include arrays in
    struct declarations and ERD objects' count of children and offset
    computations.  Change parseSelf and unparseSelf to return void instead
    of const char *error_msg.  Shorten ${C}_compute_ERD_offsets to
    ${C}_compute_offsets.
    
    In Runtime2TDMLDFDLProcessor.scala, make getProcessor create a
    temporary unique directory per call instead of using the same cache
    directory from dev.dirs.ProjectDirectories.  Get codeDir from
    generateCode and pass codeDir to compileCode instead of outputDir.
    Pass temporary directory to Runtime2TDMLDFDLProcessor,
    Runtime2TDMLParseResult, and Runtime2TDMLUnparseResult and implement
    cleanUp() in Runtime2TDMLParseResult and Runtime2TDMLUnparseResult to
    allow us to delete temporary directory later.
    
    In TestRuntime2.dfdl.xsd, rename ex_ints to ex_nums and make it define
    floating point numbers as well as integer numbers.  Use nested
    elements again to ensure more code is executed by tests according to
    coverage report.  Add two fixed occurrence arrays (integer and float)
    to ex_nums.  Move orion_command and its simple types to
    orion-command.xml.
    
    In TestRuntime2.tdml, rename ex_ints tests to ex_nums.  Move
    orion_command tests to orion-command.tdml.  Use ex_nums_unparse1.xml
    with runtime1 and ex_nums_unparse2.xml with runtime2 to demonstrate
    differences in XML floating point output between both runtimes.
    
    In command_parse.dat, rename from orion_command_parse.dat to
    command_parse.dat.  Change tilt field's value from -21231 to -1231 to
    fit new constraint in orion-command.dfdl.xsd.
    
    In command_unparse.xml, rename from orion_command_unparse.xml to
    command_unparse.xml.  Change tilt field's value from -21231 to -1231
    to fit new constraint in orion-command.dfdl.xsd.
    
    In ex_nums_parse.dat, rename from ex_ints_parse.dat to
    ex_nums_parse.dat.  Add arrays and real numbers.  Make two of the real
    numbers INF and NaN to ensure fixNumberIfNeeded gets tested.
    
    In ex_nums_unparse1.xml, rename from ex_nums_unparse.xml, add arrays
    and real numbers, and split into ex_nums_unparse1.xml and
    ex_nums_unparse2.xml to demonstrate differences in XML floating point
    output between both runtimes.
    
    In orion-command.dfdl.xsd, add new test schema with Command,
    CameraState, and VideoSettings elements.
    
    In orion-command.tdml, add new test cases for Command and
    VideoSettings elements.
    
    In video_settings_parse.dat, add data for VideoSettings element.
    
    In video_settings_unparse.xml, add infoset for VideoSettings element.
    
    In TestCodeGenerator.scala, rename outputDir to tempDir, get codeDir
    from generateCode, and pass codeDir to compileCode instead of
    outputDir.
    
    In TestOrionCommand.scala, run test cases in orion-command.tdml as
    part of sbt tests.  Note that tests might run in parallel (that is,
    TestOrionCommand.scala and TestRuntime2.scala can overlap each other
    concurrently).
    
    In TestRuntime2.scala, rename ex_ints to ex_nums.  Move orion_command
    test cases to TestOrionCommand.scala.  Change names and add 2 more
    methods to match renamed & new test cases in TestRuntime2.tdml.
    
    In TDMLRunner.scala, replace duplicate lines of code deleting blob
    files with cleanUp() calls.  Add two new cleanUp() calls in
    UnparserTestCase to ensure unparse tests clean up temporary files too.
    
    In TDMLDFDLProcessor.scala, add a new cleanUp() abstract function to
    TDMLResult.
    
    In DaffodilTDMLDFDLProcessor.scala, make DaffodilTDMLParseResult and
    DaffodilTDMLUnparseResult implement cleanUp() to remove blob files or
    do nothing respectively.
    
    In Dependencies.scala, remove "dev.dirs" % "directories" since we
    don't need it anymore.
    
    In Rat.scala, tell Rat to ignore new/renamed test data files.
---
 .github/workflows/main.yml                         |   2 +-
 README.md                                          |  28 +-
 daffodil-cli/bin.LICENSE                           | 384 +----------
 .../daffodil/generating/TestCLIGenerateC.scala     |   6 +-
 daffodil-runtime2/src/main/resources/c/Makefile    |   4 +-
 .../src/main/resources/c/libcli/daffodil_argp.c    |  10 +-
 .../src/main/resources/c/libcli/daffodil_main.c    |  33 +-
 .../src/main/resources/c/libcli/stack.c            |   8 +-
 .../src/main/resources/c/libcli/stack.h            |   6 +-
 .../src/main/resources/c/libcli/xml_reader.c       | 124 +++-
 .../src/main/resources/c/libcli/xml_reader.h       |   6 +-
 .../src/main/resources/c/libcli/xml_writer.c       |  62 +-
 .../src/main/resources/c/libcli/xml_writer.h       |   6 +-
 .../src/main/resources/c/libruntime/infoset.c      |   8 +-
 .../src/main/resources/c/libruntime/infoset.h      |  30 +-
 .../src/main/resources/c/libruntime/parsers.c      | 111 +++
 .../src/main/resources/c/libruntime/parsers.h      |  52 ++
 .../src/main/resources/c/libruntime/unparsers.c    | 111 +++
 .../src/main/resources/c/libruntime/unparsers.h    |  52 ++
 .../src/main/resources/examples/ex_ints.c          | 766 ---------------------
 .../src/main/resources/examples/ex_nums.c          | 684 ++++++++++++++++++
 .../resources/examples/{ex_ints.h => ex_nums.h}    |  32 +-
 .../apache/daffodil/runtime2/CodeGenerator.scala   |  27 +-
 .../daffodil/runtime2/Runtime2CodeGenerator.scala  |  18 +-
 .../generators/BinaryFloatCodeGenerator.scala      |  55 ++
 .../BinaryIntegerKnownLengthCodeGenerator.scala    |  59 +-
 .../runtime2/generators/CodeGeneratorState.scala   | 137 ++--
 .../runtime2/Runtime2TDMLDFDLProcessor.scala       |  28 +-
 .../apache/daffodil/runtime2/TestRuntime2.dfdl.xsd | 102 ++-
 .../org/apache/daffodil/runtime2/TestRuntime2.tdml |  75 +-
 .../org/apache/daffodil/runtime2/command_parse.dat | Bin 0 -> 13 bytes
 ...ion_command_unparse.xml => command_unparse.xml} |   8 +-
 .../org/apache/daffodil/runtime2/ex_ints_parse.dat | Bin 60 -> 0 bytes
 .../org/apache/daffodil/runtime2/ex_nums_parse.dat | Bin 0 -> 102 bytes
 .../apache/daffodil/runtime2/ex_nums_unparse1.xml  |  52 ++
 .../apache/daffodil/runtime2/ex_nums_unparse2.xml  |  52 ++
 .../daffodil/runtime2/orion-command.dfdl.xsd       | 104 +++
 .../apache/daffodil/runtime2/orion-command.tdml    |  92 +++
 .../daffodil/runtime2/orion_command_parse.dat      | Bin 13 -> 0 bytes
 .../daffodil/runtime2/video_settings_parse.dat     | Bin 0 -> 20 bytes
 ...ints_unparse.xml => video_settings_unparse.xml} |  37 +-
 .../daffodil/runtime2/TestCodeGenerator.scala      |  26 +-
 .../{TestRuntime2.scala => TestOrionCommand.scala} |  16 +-
 .../apache/daffodil/runtime2/TestRuntime2.scala    |   8 +-
 .../org/apache/daffodil/tdml/TDMLRunner.scala      |  42 +-
 .../tdml/processor/TDMLDFDLProcessor.scala         |   5 +-
 .../tdml/processor/DaffodilTDMLDFDLProcessor.scala |   5 +
 project/Dependencies.scala                         |   1 -
 project/Rat.scala                                  |   5 +-
 49 files changed, 1923 insertions(+), 1556 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 38bfa61..2679df5 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -53,7 +53,7 @@ jobs:
         if: runner.os == 'Windows'
         uses: msys2/setup-msys2@v2
         with:
-          install: gcc libargp-devel make pkg-config
+          install: gcc libargp-devel make pkgconf
           path-type: inherit
 
       - name: Check out mxml source (Windows)
diff --git a/README.md b/README.md
index 991d688..9097223 100644
--- a/README.md
+++ b/README.md
@@ -38,17 +38,28 @@ For more information about Daffodil, see https://daffodil.apache.org/.
 
 * JDK 8 or higher
 * SBT 0.13.8 or higher
+* C compiler (for daffodil-runtime2 only)
+* Mini-XML Version 3.2 or higher (for daffodil-runtime2 only)
 
 ## Getting Started
 
-[SBT] is the officially supported tool to build Daffodil, run all tests, create packages,
-and more. Below are some of the more common commands used for Daffodil development.
+You will need the full Java Software Development Kit ([JDK] or [SDK]),
+not the Java Runtime Environment (JRE), to build Daffodil.  You also
+will need [SBT] to build Daffodil, run all tests, create packages, and
+more.
+
+In order to build daffodil-runtime2, you will need a C compiler (for
+example, [gcc]), the [Mini-XML] library, and possibly the [argp]
+library if your system doesn't include it in its C library.
+
+Below are some of the more common commands used for Daffodil development.
 
 ### Compile
 
 ```text
 $ sbt compile
 ```
+
 ### Tests
 
 Run all unit tests:
@@ -100,18 +111,19 @@ users@daffodil.apache.org mailing lists. Bugs can be reported via the [Daffodil
 
 Apache Daffodil is licensed under the [Apache License, v2.0].
 
-
-
-
 [Apache License, v2.0]: https://www.apache.org/licenses/LICENSE-2.0
 [Apache RAT]: https://creadur.apache.org/rat/
 [CodeCov]: https://codecov.io/gh/apache/daffodil/
 [Command Line Interface]: https://daffodil.apache.org/cli/
-[Daffodil JIRA]: https://issues.apache.org/jira/projects/DAFFODIL
 [DFDL specification]: http://www.ogf.org/dfdl
-[Open Grid Forum]: http://www.ogf.org
+[Daffodil JIRA]: https://issues.apache.org/jira/projects/DAFFODIL
+[Github Actions]: https://github.com/apache/daffodil/actions?query=branch%3Amaster+
+[JDK]: https://docs.oracle.com/en/java/javase/11/install/overview-jdk-installation.html
+[Mini-XML]: https://www.msweet.org/mxml/
 [Releases]: http://daffodil.apache.org/releases/
 [SBT]: http://www.scala-sbt.org
-[Github Actions]: https://github.com/apache/daffodil/actions?query=branch%3Amaster+
+[SDK]: https://sdkman.io
 [Website]: https://daffodil.apache.org
+[argp]: https://packages.msys2.org/package/libargp-devel
+[gcc]: https://linuxize.com/post/how-to-install-gcc-on-ubuntu-20-04/
 [sbt-scoverage]: https://github.com/scoverage/sbt-scoverage
diff --git a/daffodil-cli/bin.LICENSE b/daffodil-cli/bin.LICENSE
index 63c4098..07241dc 100644
--- a/daffodil-cli/bin.LICENSE
+++ b/daffodil-cli/bin.LICENSE
@@ -1446,11 +1446,15 @@ is subject to the terms and conditions of the following licenses.
     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
     THE SOFTWARE.
 
-  This product bundles libraries from 'libaoyi', including the following files:
+  This product bundles libraries from 'os-lib', including the following files:
     - lib/com.lihaoyi.geany_<VERSION>.jar
     - lib/com.lihaoyi.os-lib_<VERSION>.jar
   These files are available under the MIT license:
 
+    License
+    =======
+
+
     The MIT License (MIT)
 
     Copyright (c) 2019 Li Haoyi (haoyi.sg@gmail.com)
@@ -1472,381 +1476,3 @@ is subject to the terms and conditions of the following licenses.
     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     DEALINGS IN THE SOFTWARE.
-
-  This product bundles 'directories-jvm', including the following files:
-    - lib/dirs-dev.directories_<VERSION>.jar
-  These files are available under the Mozilla 2.0 license:
-
-    Mozilla Public License Version 2.0
-    ==================================
-
-    1. Definitions
-    --------------
-
-    1.1. "Contributor"
-        means each individual or legal entity that creates, contributes to
-        the creation of, or owns Covered Software.
-
-    1.2. "Contributor Version"
-        means the combination of the Contributions of others (if any) used
-        by a Contributor and that particular Contributor's Contribution.
-
-    1.3. "Contribution"
-        means Covered Software of a particular Contributor.
-
-    1.4. "Covered Software"
-        means Source Code Form to which the initial Contributor has attached
-        the notice in Exhibit A, the Executable Form of such Source Code
-        Form, and Modifications of such Source Code Form, in each case
-        including portions thereof.
-
-    1.5. "Incompatible With Secondary Licenses"
-        means
-
-        (a) that the initial Contributor has attached the notice described
-            in Exhibit B to the Covered Software; or
-
-        (b) that the Covered Software was made available under the terms of
-            version 1.1 or earlier of the License, but not also under the
-            terms of a Secondary License.
-
-    1.6. "Executable Form"
-        means any form of the work other than Source Code Form.
-
-    1.7. "Larger Work"
-        means a work that combines Covered Software with other material, in
-        a separate file or files, that is not Covered Software.
-
-    1.8. "License"
-        means this document.
-
-    1.9. "Licensable"
-        means having the right to grant, to the maximum extent possible,
-        whether at the time of the initial grant or subsequently, any and
-        all of the rights conveyed by this License.
-
-    1.10. "Modifications"
-        means any of the following:
-
-        (a) any file in Source Code Form that results from an addition to,
-            deletion from, or modification of the contents of Covered
-            Software; or
-
-        (b) any new file in Source Code Form that contains any Covered
-            Software.
-
-    1.11. "Patent Claims" of a Contributor
-        means any patent claim(s), including without limitation, method,
-        process, and apparatus claims, in any patent Licensable by such
-        Contributor that would be infringed, but for the grant of the
-        License, by the making, using, selling, offering for sale, having
-        made, import, or transfer of either its Contributions or its
-        Contributor Version.
-
-    1.12. "Secondary License"
-        means either the GNU General Public License, Version 2.0, the GNU
-        Lesser General Public License, Version 2.1, the GNU Affero General
-        Public License, Version 3.0, or any later versions of those
-        licenses.
-
-    1.13. "Source Code Form"
-        means the form of the work preferred for making modifications.
-
-    1.14. "You" (or "Your")
-        means an individual or a legal entity exercising rights under this
-        License. For legal entities, "You" includes any entity that
-        controls, is controlled by, or is under common control with You. For
-        purposes of this definition, "control" means (a) the power, direct
-        or indirect, to cause the direction or management of such entity,
-        whether by contract or otherwise, or (b) ownership of more than
-        fifty percent (50%) of the outstanding shares or beneficial
-        ownership of such entity.
-
-    2. License Grants and Conditions
-    --------------------------------
-
-    2.1. Grants
-
-    Each Contributor hereby grants You a world-wide, royalty-free,
-    non-exclusive license:
-
-    (a) under intellectual property rights (other than patent or trademark)
-        Licensable by such Contributor to use, reproduce, make available,
-        modify, display, perform, distribute, and otherwise exploit its
-        Contributions, either on an unmodified basis, with Modifications, or
-        as part of a Larger Work; and
-
-    (b) under Patent Claims of such Contributor to make, use, sell, offer
-        for sale, have made, import, and otherwise transfer either its
-        Contributions or its Contributor Version.
-
-    2.2. Effective Date
-
-    The licenses granted in Section 2.1 with respect to any Contribution
-    become effective for each Contribution on the date the Contributor first
-    distributes such Contribution.
-
-    2.3. Limitations on Grant Scope
-
-    The licenses granted in this Section 2 are the only rights granted under
-    this License. No additional rights or licenses will be implied from the
-    distribution or licensing of Covered Software under this License.
-    Notwithstanding Section 2.1(b) above, no patent license is granted by a
-    Contributor:
-
-    (a) for any code that a Contributor has removed from Covered Software;
-        or
-
-    (b) for infringements caused by: (i) Your and any other third party's
-        modifications of Covered Software, or (ii) the combination of its
-        Contributions with other software (except as part of its Contributor
-        Version); or
-
-    (c) under Patent Claims infringed by Covered Software in the absence of
-        its Contributions.
-
-    This License does not grant any rights in the trademarks, service marks,
-    or logos of any Contributor (except as may be necessary to comply with
-    the notice requirements in Section 3.4).
-
-    2.4. Subsequent Licenses
-
-    No Contributor makes additional grants as a result of Your choice to
-    distribute the Covered Software under a subsequent version of this
-    License (see Section 10.2) or under the terms of a Secondary License (if
-    permitted under the terms of Section 3.3).
-
-    2.5. Representation
-
-    Each Contributor represents that the Contributor believes its
-    Contributions are its original creation(s) or it has sufficient rights
-    to grant the rights to its Contributions conveyed by this License.
-
-    2.6. Fair Use
-
-    This License is not intended to limit any rights You have under
-    applicable copyright doctrines of fair use, fair dealing, or other
-    equivalents.
-
-    2.7. Conditions
-
-    Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
-    in Section 2.1.
-
-    3. Responsibilities
-    -------------------
-
-    3.1. Distribution of Source Form
-
-    All distribution of Covered Software in Source Code Form, including any
-    Modifications that You create or to which You contribute, must be under
-    the terms of this License. You must inform recipients that the Source
-    Code Form of the Covered Software is governed by the terms of this
-    License, and how they can obtain a copy of this License. You may not
-    attempt to alter or restrict the recipients' rights in the Source Code
-    Form.
-
-    3.2. Distribution of Executable Form
-
-    If You distribute Covered Software in Executable Form then:
-
-    (a) such Covered Software must also be made available in Source Code
-        Form, as described in Section 3.1, and You must inform recipients of
-        the Executable Form how they can obtain a copy of such Source Code
-        Form by reasonable means in a timely manner, at a charge no more
-        than the cost of distribution to the recipient; and
-
-    (b) You may distribute such Executable Form under the terms of this
-        License, or sublicense it under different terms, provided that the
-        license for the Executable Form does not attempt to limit or alter
-        the recipients' rights in the Source Code Form under this License.
-
-    3.3. Distribution of a Larger Work
-
-    You may create and distribute a Larger Work under terms of Your choice,
-    provided that You also comply with the requirements of this License for
-    the Covered Software. If the Larger Work is a combination of Covered
-    Software with a work governed by one or more Secondary Licenses, and the
-    Covered Software is not Incompatible With Secondary Licenses, this
-    License permits You to additionally distribute such Covered Software
-    under the terms of such Secondary License(s), so that the recipient of
-    the Larger Work may, at their option, further distribute the Covered
-    Software under the terms of either this License or such Secondary
-    License(s).
-
-    3.4. Notices
-
-    You may not remove or alter the substance of any license notices
-    (including copyright notices, patent notices, disclaimers of warranty,
-    or limitations of liability) contained within the Source Code Form of
-    the Covered Software, except that You may alter any license notices to
-    the extent required to remedy known factual inaccuracies.
-
-    3.5. Application of Additional Terms
-
-    You may choose to offer, and to charge a fee for, warranty, support,
-    indemnity or liability obligations to one or more recipients of Covered
-    Software. However, You may do so only on Your own behalf, and not on
-    behalf of any Contributor. You must make it absolutely clear that any
-    such warranty, support, indemnity, or liability obligation is offered by
-    You alone, and You hereby agree to indemnify every Contributor for any
-    liability incurred by such Contributor as a result of warranty, support,
-    indemnity or liability terms You offer. You may include additional
-    disclaimers of warranty and limitations of liability specific to any
-    jurisdiction.
-
-    4. Inability to Comply Due to Statute or Regulation
-    ---------------------------------------------------
-
-    If it is impossible for You to comply with any of the terms of this
-    License with respect to some or all of the Covered Software due to
-    statute, judicial order, or regulation then You must: (a) comply with
-    the terms of this License to the maximum extent possible; and (b)
-    describe the limitations and the code they affect. Such description must
-    be placed in a text file included with all distributions of the Covered
-    Software under this License. Except to the extent prohibited by statute
-    or regulation, such description must be sufficiently detailed for a
-    recipient of ordinary skill to be able to understand it.
-
-    5. Termination
-    --------------
-
-    5.1. The rights granted under this License will terminate automatically
-    if You fail to comply with any of its terms. However, if You become
-    compliant, then the rights granted under this License from a particular
-    Contributor are reinstated (a) provisionally, unless and until such
-    Contributor explicitly and finally terminates Your grants, and (b) on an
-    ongoing basis, if such Contributor fails to notify You of the
-    non-compliance by some reasonable means prior to 60 days after You have
-    come back into compliance. Moreover, Your grants from a particular
-    Contributor are reinstated on an ongoing basis if such Contributor
-    notifies You of the non-compliance by some reasonable means, this is the
-    first time You have received notice of non-compliance with this License
-    from such Contributor, and You become compliant prior to 30 days after
-    Your receipt of the notice.
-
-    5.2. If You initiate litigation against any entity by asserting a patent
-    infringement claim (excluding declaratory judgment actions,
-    counter-claims, and cross-claims) alleging that a Contributor Version
-    directly or indirectly infringes any patent, then the rights granted to
-    You by any and all Contributors for the Covered Software under Section
-    2.1 of this License shall terminate.
-
-    5.3. In the event of termination under Sections 5.1 or 5.2 above, all
-    end user license agreements (excluding distributors and resellers) which
-    have been validly granted by You or Your distributors under this License
-    prior to termination shall survive termination.
-
-    ************************************************************************
-    *                                                                      *
-    *  6. Disclaimer of Warranty                                           *
-    *  -------------------------                                           *
-    *                                                                      *
-    *  Covered Software is provided under this License on an "as is"       *
-    *  basis, without warranty of any kind, either expressed, implied, or  *
-    *  statutory, including, without limitation, warranties that the       *
-    *  Covered Software is free of defects, merchantable, fit for a        *
-    *  particular purpose or non-infringing. The entire risk as to the     *
-    *  quality and performance of the Covered Software is with You.        *
-    *  Should any Covered Software prove defective in any respect, You     *
-    *  (not any Contributor) assume the cost of any necessary servicing,   *
-    *  repair, or correction. This disclaimer of warranty constitutes an   *
-    *  essential part of this License. No use of any Covered Software is   *
-    *  authorized under this License except under this disclaimer.         *
-    *                                                                      *
-    ************************************************************************
-
-    ************************************************************************
-    *                                                                      *
-    *  7. Limitation of Liability                                          *
-    *  --------------------------                                          *
-    *                                                                      *
-    *  Under no circumstances and under no legal theory, whether tort      *
-    *  (including negligence), contract, or otherwise, shall any           *
-    *  Contributor, or anyone who distributes Covered Software as          *
-    *  permitted above, be liable to You for any direct, indirect,         *
-    *  special, incidental, or consequential damages of any character      *
-    *  including, without limitation, damages for lost profits, loss of    *
-    *  goodwill, work stoppage, computer failure or malfunction, or any    *
-    *  and all other commercial damages or losses, even if such party      *
-    *  shall have been informed of the possibility of such damages. This   *
-    *  limitation of liability shall not apply to liability for death or   *
-    *  personal injury resulting from such party's negligence to the       *
-    *  extent applicable law prohibits such limitation. Some               *
-    *  jurisdictions do not allow the exclusion or limitation of           *
-    *  incidental or consequential damages, so this exclusion and          *
-    *  limitation may not apply to You.                                    *
-    *                                                                      *
-    ************************************************************************
-
-    8. Litigation
-    -------------
-
-    Any litigation relating to this License may be brought only in the
-    courts of a jurisdiction where the defendant maintains its principal
-    place of business and such litigation shall be governed by laws of that
-    jurisdiction, without reference to its conflict-of-law provisions.
-    Nothing in this Section shall prevent a party's ability to bring
-    cross-claims or counter-claims.
-
-    9. Miscellaneous
-    ----------------
-
-    This License represents the complete agreement concerning the subject
-    matter hereof. If any provision of this License is held to be
-    unenforceable, such provision shall be reformed only to the extent
-    necessary to make it enforceable. Any law or regulation which provides
-    that the language of a contract shall be construed against the drafter
-    shall not be used to construe this License against a Contributor.
-
-    10. Versions of the License
-    ---------------------------
-
-    10.1. New Versions
-
-    Mozilla Foundation is the license steward. Except as provided in Section
-    10.3, no one other than the license steward has the right to modify or
-    publish new versions of this License. Each version will be given a
-    distinguishing version number.
-
-    10.2. Effect of New Versions
-
-    You may distribute the Covered Software under the terms of the version
-    of the License under which You originally received the Covered Software,
-    or under the terms of any subsequent version published by the license
-    steward.
-
-    10.3. Modified Versions
-
-    If you create software not governed by this License, and you want to
-    create a new license for such software, you may create and use a
-    modified version of this License if you rename the license and remove
-    any references to the name of the license steward (except to note that
-    such modified license differs from this License).
-
-    10.4. Distributing Source Code Form that is Incompatible With Secondary
-    Licenses
-
-    If You choose to distribute Source Code Form that is Incompatible With
-    Secondary Licenses under the terms of this version of the License, the
-    notice described in Exhibit B of this License must be attached.
-
-    Exhibit A - Source Code Form License Notice
-    -------------------------------------------
-
-      This Source Code Form is subject to the terms of the Mozilla Public
-      License, v. 2.0. If a copy of the MPL was not distributed with this
-      file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-    If it is not possible or desirable to put the notice in a particular
-    file, then You may include the notice in a location (such as a LICENSE
-    file in a relevant directory) where a recipient would be likely to look
-    for such a notice.
-
-    You may add additional accurate notices of copyright ownership.
-
-    Exhibit B - "Incompatible With Secondary Licenses" Notice
-    ---------------------------------------------------------
-
-      This Source Code Form is "Incompatible With Secondary Licenses", as
-      defined by the Mozilla Public License, v. 2.0.
diff --git a/daffodil-cli/src/it/scala/org/apache/daffodil/generating/TestCLIGenerateC.scala b/daffodil-cli/src/it/scala/org/apache/daffodil/generating/TestCLIGenerateC.scala
index de004d2..6700b66 100644
--- a/daffodil-cli/src/it/scala/org/apache/daffodil/generating/TestCLIGenerateC.scala
+++ b/daffodil-cli/src/it/scala/org/apache/daffodil/generating/TestCLIGenerateC.scala
@@ -138,7 +138,7 @@ class TestCLIGenerateC {
   }
 
   @Test def test_CLI_Generate_root(): Unit = {
-    val generateCmd = s"$daffodil generate c -s $schemaFile -r {http://example.com}ex_ints $outputDir"
+    val generateCmd = s"$daffodil generate c -s $schemaFile -r {http://example.com}ex_nums $outputDir"
     val exitCmd = "exit"
 
     val shell = Util.start("")
@@ -154,14 +154,14 @@ class TestCLIGenerateC {
   }
 
   @Test def test_CLI_Generate_root_error(): Unit = {
-    val generateCmd = s"$daffodil generate c -s $schemaFile -r {ex}ex_ints $outputDir"
+    val generateCmd = s"$daffodil generate c -s $schemaFile -r {ex}ex_nums $outputDir"
     val exitCmd = "exit"
 
     val shell = Util.start("", expectErr = true)
     try {
       shell.sendLine(generateCmd)
       shell.expect(contains("Schema Definition Error"))
-      shell.expect(contains("No global element found for {ex}ex_ints"))
+      shell.expect(contains("No global element found for {ex}ex_nums"))
       shell.sendLine(exitCmd)
       shell.expect(eof())
     } finally {
diff --git a/daffodil-runtime2/src/main/resources/c/Makefile b/daffodil-runtime2/src/main/resources/c/Makefile
index d3fcb79..fd1cf8d 100644
--- a/daffodil-runtime2/src/main/resources/c/Makefile
+++ b/daffodil-runtime2/src/main/resources/c/Makefile
@@ -19,10 +19,10 @@
 
 SOURCES = libcli/*.[ch] libruntime/*.[ch]
 PROGRAM = ./daffodil
-CFLAGS = -Wall
+CFLAGS = -g -Wall -Wextra -Wno-missing-field-initializers
 
 $(PROGRAM): $(SOURCES)
-	$(CC) $(CFLAGS) -o $(PROGRAM) -I libcli -I libruntime $(SOURCES) -lmxml -lpthread -lm
+	$(CC) $(CFLAGS) -I libcli -I libruntime $(SOURCES) -lmxml -o $(PROGRAM)
 
 # Here's how to run parse/unparse tests (.dat <-> .xml, although you
 # will need to create the .dat and .xml files first)
diff --git a/daffodil-runtime2/src/main/resources/c/libcli/daffodil_argp.c b/daffodil-runtime2/src/main/resources/c/libcli/daffodil_argp.c
index 7e27972..0b4e911 100644
--- a/daffodil-runtime2/src/main/resources/c/libcli/daffodil_argp.c
+++ b/daffodil-runtime2/src/main/resources/c/libcli/daffodil_argp.c
@@ -15,11 +15,11 @@
  * limitations under the License.
  */
 
-#include "daffodil_argp.h" // for daffodil_cli, daffodil_parse_cli, ...
-#include <argp.h>          // for argp_state, argp_error, error_t, argp_parse
-#include <stdio.h>         // for sprintf
-#include <stdlib.h>        // for putenv, NULL
-#include <string.h>        // for strlen, strcmp
+#include "daffodil_argp.h"
+#include <argp.h>    // for argp_state, argp_error, error_t, argp_parse, ARGP_ERR_UNKNOWN, ARGP_IN_ORDER, ARGP_KEY_ARG, argp, argp_option, ARGP_KEY_END
+#include <stdio.h>   // for sprintf, NULL
+#include <stdlib.h>  // for putenv
+#include <string.h>  // for strlen, strcmp
 
 // Initialize our "daffodil" name and version
 
diff --git a/daffodil-runtime2/src/main/resources/c/libcli/daffodil_main.c b/daffodil-runtime2/src/main/resources/c/libcli/daffodil_main.c
index ce6d62b..f915d9f 100644
--- a/daffodil-runtime2/src/main/resources/c/libcli/daffodil_main.c
+++ b/daffodil-runtime2/src/main/resources/c/libcli/daffodil_main.c
@@ -15,14 +15,14 @@
  * limitations under the License.
  */
 
-#include "daffodil_argp.h" // for daffodil_cli, parse_daffodil_cli, ...
-#include "infoset.h"       // for InfosetBase, walkInfoset, rootElement, ...
-#include "xml_reader.h"    // for xmlReaderMethods, XMLReader
-#include "xml_writer.h"    // for xmlWriterMethods, XMLWriter
-#include <error.h>         // for error
-#include <stdio.h>         // for FILE, perror, fclose, fopen, stdin
-#include <stdlib.h>        // for exit, EXIT_FAILURE
-#include <string.h>        // for strcmp
+#include "daffodil_argp.h"  // for daffodil_cli, daffodil_parse, daffodil_parse_cli, daffodil_unparse, daffodil_unparse_cli, parse_daffodil_cli, DAFFODIL_PARSE, DAFFODIL_UNPARSE
+#include "infoset.h"        // for walkInfoset, InfosetBase, rootElement, ERD, PState, UState, VisitEventHandler
+#include "xml_reader.h"     // for xmlReaderMethods, XMLReader
+#include "xml_writer.h"     // for xmlWriterMethods, XMLWriter
+#include <error.h>          // for error
+#include <stdio.h>          // for FILE, perror, fclose, fopen, stdin, stdout
+#include <stdlib.h>         // for exit, EXIT_FAILURE
+#include <string.h>         // for strcmp
 
 // Open a file or exit if it can't be opened
 
@@ -85,15 +85,16 @@ main(int argc, char *argv[])
             output = fopen_or_exit(output, daffodil_parse.outfile, "w");
 
             // Parse the input file into our infoset.
-            PState      pstate = {input};
-            const char *error_msg = root->erd->parseSelf(root, &pstate);
-            continue_or_exit(error_msg);
+            PState pstate = {input};
+            root->erd->parseSelf(root, &pstate);
+            continue_or_exit(pstate.error_msg);
 
             if (strcmp(daffodil_parse.infoset_converter, "xml") == 0)
             {
                 // Visit the infoset and print XML from it.
-                XMLWriter xmlWriter = {xmlWriterMethods, output};
-                error_msg = walkInfoset((VisitEventHandler *)&xmlWriter, root);
+                XMLWriter   xmlWriter = {xmlWriterMethods, output};
+                const char *error_msg =
+                    walkInfoset((VisitEventHandler *)&xmlWriter, root);
                 continue_or_exit(error_msg);
             }
             else
@@ -123,9 +124,9 @@ main(int argc, char *argv[])
             }
 
             // Unparse our infoset to the output file.
-            UState      ustate = {output};
-            const char *error_msg = root->erd->unparseSelf(root, &ustate);
-            continue_or_exit(error_msg);
+            UState ustate = {output};
+            root->erd->unparseSelf(root, &ustate);
+            continue_or_exit(ustate.error_msg);
         }
 
         // Close our input and out files if we opened them.
diff --git a/daffodil-runtime2/src/main/resources/c/libcli/stack.c b/daffodil-runtime2/src/main/resources/c/libcli/stack.c
index c1814bb..08c1561 100644
--- a/daffodil-runtime2/src/main/resources/c/libcli/stack.c
+++ b/daffodil-runtime2/src/main/resources/c/libcli/stack.c
@@ -16,10 +16,10 @@
  */
 
 #include "stack.h"
-#include <error.h>   // for error
-#include <stdbool.h> // for bool
-#include <stddef.h>  // for ptrdiff_t
-#include <stdlib.h>  // for EXIT_FAILURE
+#include <error.h>    // for error
+#include <stdbool.h>  // for bool
+#include <stddef.h>   // for ptrdiff_t
+#include <stdlib.h>   // for EXIT_FAILURE
 
 // Initialize stack with preallocated array
 
diff --git a/daffodil-runtime2/src/main/resources/c/libcli/stack.h b/daffodil-runtime2/src/main/resources/c/libcli/stack.h
index bf1cf3a..0db5c32 100644
--- a/daffodil-runtime2/src/main/resources/c/libcli/stack.h
+++ b/daffodil-runtime2/src/main/resources/c/libcli/stack.h
@@ -18,9 +18,9 @@
 #ifndef STACK_H
 #define STACK_H
 
-#include <mxml.h>    // for mxml_node_t
-#include <stdbool.h> // for bool
-#include <stddef.h>  // for ptrdiff_t
+#include <mxml.h>     // for mxml_node_t
+#include <stdbool.h>  // for bool
+#include <stddef.h>   // for ptrdiff_t
 
 // Type of element pushed into stack
 
diff --git a/daffodil-runtime2/src/main/resources/c/libcli/xml_reader.c b/daffodil-runtime2/src/main/resources/c/libcli/xml_reader.c
index 175ca52..226b015 100644
--- a/daffodil-runtime2/src/main/resources/c/libcli/xml_reader.c
+++ b/daffodil-runtime2/src/main/resources/c/libcli/xml_reader.c
@@ -16,14 +16,15 @@
  */
 
 #include "xml_reader.h"
-#include <errno.h>    // for errno
-#include <inttypes.h> // for strtoimax
-#include <mxml.h>     // for mxmlWalkNext, mxmlGetType, mxmlGetElement, ...
-#include <stdint.h>   // for intmax_t, int32_t, INT32_MAX, INT32_MIN
-#include <string.h>   // for strcmp, strlen, strncmp
+#include <errno.h>     // for errno
+#include <inttypes.h>  // for strtoimax, strtoumax
+#include <mxml.h>      // for mxmlWalkNext, mxmlGetType, mxmlGetElement, MXML_DESCEND, MXML_OPAQUE, mxmlDelete, mxmlGetOpaque, mxmlLoadFile, MXML_OPAQUE_CALLBACK
+#include <stdint.h>    // for intmax_t, uintmax_t, int16_t, int32_t, int64_t, int8_t, uint16_t, uint32_t, uint64_t, uint8_t, INT16_MAX, INT16_MIN, INT32_MAX, INT32_MIN, INT64_MAX, INT64_MIN, INT8_MAX, INT8_MIN, UINT16_MAX, UINT32_MAX, UINT64_MAX, UINT8_MAX
+#include <stdlib.h>    // for strtod, strtof
+#include <string.h>    // for strcmp, strlen, strncmp
 
 // Convert an XML element's text to a signed integer (BSD function not
-// widely available, so roll our own function based on strtoimax)
+// widely available, so call strtoimax with our own error checking)
 
 static intmax_t
 strtonum(const char *numptr, intmax_t minval, intmax_t maxval,
@@ -31,7 +32,7 @@ strtonum(const char *numptr, intmax_t minval, intmax_t maxval,
 {
     char *endptr = NULL;
 
-    // Clear errno to detect failure after calling strtoimax
+    // Clear errno to detect error after calling strtoimax
     errno = 0;
     const intmax_t value = strtoimax(numptr, &endptr, 10);
 
@@ -60,15 +61,15 @@ strtonum(const char *numptr, intmax_t minval, intmax_t maxval,
     return value;
 }
 
-// Convert an XML element's text to an unsigned integer (roll our own
-// function based on strtoumax)
+// Convert an XML element's text to an unsigned integer (call strtoumax
+// with our own error checking)
 
 static uintmax_t
 strtounum(const char *numptr, uintmax_t maxval, const char **errstrp)
 {
     char *endptr = NULL;
 
-    // Clear errno to detect failure after calling strtoumax
+    // Clear errno to detect error after calling strtoumax
     errno = 0;
     const uintmax_t value = strtoumax(numptr, &endptr, 10);
 
@@ -97,6 +98,72 @@ strtounum(const char *numptr, uintmax_t maxval, const char **errstrp)
     return value;
 }
 
+// Convert an XML element's text to a float (call strtof with our own
+// error checking)
+
+static float
+strtofnum(const char *numptr, const char **errstrp)
+{
+    char *endptr = NULL;
+
+    // Clear errno to detect error after calling strtof
+    errno = 0;
+    const float value = strtof(numptr, &endptr);
+
+    // Report any issues converting the string to a number
+    if (errno != 0)
+    {
+        *errstrp = "Error converting XML data to number";
+    }
+    else if (endptr == numptr)
+    {
+        *errstrp = "Found no number in XML data";
+    }
+    else if (*endptr != '\0')
+    {
+        *errstrp = "Found non-number characters in XML data";
+    }
+    else
+    {
+        *errstrp = NULL;
+    }
+
+    return value;
+}
+
+// Convert an XML element's text to a double (call strtod with our own
+// error checking)
+
+static double
+strtodnum(const char *numptr, const char **errstrp)
+{
+    char *endptr = NULL;
+
+    // Clear errno to detect error after calling strtod
+    errno = 0;
+    const double value = strtod(numptr, &endptr);
+
+    // Report any issues converting the string to a number
+    if (errno != 0)
+    {
+        *errstrp = "Error converting XML data to number";
+    }
+    else if (endptr == numptr)
+    {
+        *errstrp = "Found no number in XML data";
+    }
+    else if (*endptr != '\0')
+    {
+        *errstrp = "Found non-number characters in XML data";
+    }
+    else
+    {
+        *errstrp = NULL;
+    }
+
+    return value;
+}
+
 // Read XML data from file before walking infoset
 
 static const char *
@@ -199,10 +266,11 @@ xmlEndComplex(XMLReader *reader, const InfosetBase *base)
     return NULL;
 }
 
-// Read 8, 16, 32, or 64-bit signed/unsigned integer number from XML data
+// Read 8, 16, 32, or 64-bit signed/unsigned integer number or floating point
+// number from XML data
 
 static const char *
-xmlIntegerElem(XMLReader *reader, const ERD *erd, void *intLocation)
+xmlNumberElem(XMLReader *reader, const ERD *erd, void *numLocation)
 {
     // Consume any newlines or whitespace before the element
     while (mxmlGetType(reader->node) == MXML_OPAQUE)
@@ -221,47 +289,55 @@ xmlIntegerElem(XMLReader *reader, const ERD *erd, void *intLocation)
     {
         if (strcmp(name_from_xml, name_from_erd) == 0)
         {
-            // Check for any errors getting the integer number
+            // Check for any errors getting the number
             const char *errstr = NULL;
 
-            // Handle varying bit lengths of both signed & unsigned numbers
+            // Handle varying bit lengths of both signed & unsigned integers and
+            // floating point numbers
             const enum TypeCode typeCode = erd->typeCode;
             switch (typeCode)
             {
             case PRIMITIVE_UINT64:
-                *(uint64_t *)intLocation =
+                *(uint64_t *)numLocation =
                     (uint64_t)strtounum(number_from_xml, UINT64_MAX, &errstr);
                 break;
             case PRIMITIVE_UINT32:
-                *(uint32_t *)intLocation =
+                *(uint32_t *)numLocation =
                     (uint32_t)strtounum(number_from_xml, UINT32_MAX, &errstr);
                 break;
             case PRIMITIVE_UINT16:
-                *(uint16_t *)intLocation =
+                *(uint16_t *)numLocation =
                     (uint16_t)strtounum(number_from_xml, UINT16_MAX, &errstr);
                 break;
             case PRIMITIVE_UINT8:
-                *(uint8_t *)intLocation =
+                *(uint8_t *)numLocation =
                     (uint8_t)strtounum(number_from_xml, UINT8_MAX, &errstr);
                 break;
             case PRIMITIVE_INT64:
-                *(int64_t *)intLocation = (int64_t)strtonum(
+                *(int64_t *)numLocation = (int64_t)strtonum(
                     number_from_xml, INT64_MIN, INT64_MAX, &errstr);
                 break;
             case PRIMITIVE_INT32:
-                *(int32_t *)intLocation = (int32_t)strtonum(
+                *(int32_t *)numLocation = (int32_t)strtonum(
                     number_from_xml, INT32_MIN, INT32_MAX, &errstr);
                 break;
             case PRIMITIVE_INT16:
-                *(int16_t *)intLocation = (int16_t)strtonum(
+                *(int16_t *)numLocation = (int16_t)strtonum(
                     number_from_xml, INT16_MIN, INT16_MAX, &errstr);
                 break;
             case PRIMITIVE_INT8:
-                *(int8_t *)intLocation = (int8_t)strtonum(
+                *(int8_t *)numLocation = (int8_t)strtonum(
                     number_from_xml, INT8_MIN, INT8_MAX, &errstr);
                 break;
+            case PRIMITIVE_FLOAT:
+                *(float *)numLocation = strtofnum(number_from_xml, &errstr);
+                break;
+            case PRIMITIVE_DOUBLE:
+                *(double *)numLocation = strtodnum(number_from_xml, &errstr);
+                break;
             default:
-                errstr = "Unexpected ERD typeCode while reading integer from XML data";
+                errstr = "Unexpected ERD typeCode while reading number from "
+                         "XML data";
                 break;
             }
 
@@ -283,5 +359,5 @@ xmlIntegerElem(XMLReader *reader, const ERD *erd, void *intLocation)
 const VisitEventHandler xmlReaderMethods = {
     (VisitStartDocument)&xmlStartDocument, (VisitEndDocument)&xmlEndDocument,
     (VisitStartComplex)&xmlStartComplex,   (VisitEndComplex)&xmlEndComplex,
-    (VisitIntegerElem)&xmlIntegerElem,
+    (VisitNumberElem)&xmlNumberElem,
 };
diff --git a/daffodil-runtime2/src/main/resources/c/libcli/xml_reader.h b/daffodil-runtime2/src/main/resources/c/libcli/xml_reader.h
index 3333f55..57ce1bd 100644
--- a/daffodil-runtime2/src/main/resources/c/libcli/xml_reader.h
+++ b/daffodil-runtime2/src/main/resources/c/libcli/xml_reader.h
@@ -18,9 +18,9 @@
 #ifndef XML_READER_H
 #define XML_READER_H
 
-#include "infoset.h" // for VisitEventHandler, InfosetBase
-#include <mxml.h>    // for mxml_node_t
-#include <stdio.h>   // for FILE
+#include "infoset.h"  // for VisitEventHandler, InfosetBase
+#include <mxml.h>     // for mxml_node_t
+#include <stdio.h>    // for FILE
 
 // XMLReader - infoset visitor with methods to read XML
 
diff --git a/daffodil-runtime2/src/main/resources/c/libcli/xml_writer.c b/daffodil-runtime2/src/main/resources/c/libcli/xml_writer.c
index 9a0be6d..073423e 100644
--- a/daffodil-runtime2/src/main/resources/c/libcli/xml_writer.c
+++ b/daffodil-runtime2/src/main/resources/c/libcli/xml_writer.c
@@ -16,11 +16,11 @@
  */
 
 #include "xml_writer.h"
-#include "stack.h"  // for stack_is_empty, stack_pop, stack_push, stack_top
-#include <assert.h> // for assert
-#include <mxml.h>   // for mxml_node_t, mxmlNewElement, mxmlNewOpaquef, ...
-#include <stdint.h> // for int32_t
-#include <stdio.h>  // for NULL, fflush
+#include "stack.h"   // for stack_is_empty, stack_pop, stack_push, stack_top, stack_init, stack_is_full
+#include <assert.h>  // for assert
+#include <mxml.h>    // for mxmlNewOpaquef, mxml_node_t, mxmlElementSetAttr, mxmlNewElement, mxmlDelete, mxmlNewXML, mxmlSaveFile, MXML_NO_CALLBACK
+#include <stdint.h>  // for int16_t, int32_t, int64_t, int8_t, uint16_t, uint32_t, uint64_t, uint8_t
+#include <stdio.h>   // for NULL, fflush
 
 // Push new XML document on stack.  This function is not
 // thread-safe since it uses static storage.
@@ -90,10 +90,27 @@ xmlEndComplex(XMLWriter *writer, const InfosetBase *base)
     return complex ? NULL : "Underflowed the XML stack";
 }
 
-// Write 8, 16, 32, or 64-bit signed/unsigned integer as element
+// Fix a floating point number to conform to xsd:float syntax if needed
+
+static void
+fixNumberIfNeeded(const char *text)
+{
+    if (text[0] == 'N' && text[1] == 'A')
+    {
+        // xsd:float requires NaN to be capitalized correctly
+        char *modifyInPlace = (char *)text;
+        modifyInPlace[1] = 'a';
+    }
+    // These are not required by xsd:float, only to match runtime1 better
+    //  - Strip + from <f>E+<e> to get <f>E<e> (not worth it)
+    //  - Add .0 to 1 to get 1.0 (not worth it)
+}
+
+// Write 8, 16, 32, or 64-bit signed/unsigned Number or floating point number as
+// element
 
 static const char *
-xmlIntegerElem(XMLWriter *writer, const ERD *erd, const void *intLocation)
+xmlNumberElem(XMLWriter *writer, const ERD *erd, const void *numLocation)
 {
     mxml_node_t *parent = stack_top(&writer->stack);
     const char * name = get_erd_name(erd);
@@ -113,35 +130,46 @@ xmlIntegerElem(XMLWriter *writer, const ERD *erd, const void *intLocation)
     switch (typeCode)
     {
     case PRIMITIVE_UINT64:
-        text = mxmlNewOpaquef(simple, "%lu", *(const uint64_t *)intLocation);
+        text = mxmlNewOpaquef(simple, "%lu", *(const uint64_t *)numLocation);
         break;
     case PRIMITIVE_UINT32:
-        text = mxmlNewOpaquef(simple, "%u", *(const uint32_t *)intLocation);
+        text = mxmlNewOpaquef(simple, "%u", *(const uint32_t *)numLocation);
         break;
     case PRIMITIVE_UINT16:
-        text = mxmlNewOpaquef(simple, "%hu", *(const uint16_t *)intLocation);
+        text = mxmlNewOpaquef(simple, "%hu", *(const uint16_t *)numLocation);
         break;
     case PRIMITIVE_UINT8:
-        text = mxmlNewOpaquef(simple, "%hhu", *(const uint8_t *)intLocation);
+        text = mxmlNewOpaquef(simple, "%hhu", *(const uint8_t *)numLocation);
         break;
     case PRIMITIVE_INT64:
-        text = mxmlNewOpaquef(simple, "%li", *(const int64_t *)intLocation);
+        text = mxmlNewOpaquef(simple, "%li", *(const int64_t *)numLocation);
         break;
     case PRIMITIVE_INT32:
-        text = mxmlNewOpaquef(simple, "%i", *(const int32_t *)intLocation);
+        text = mxmlNewOpaquef(simple, "%i", *(const int32_t *)numLocation);
         break;
     case PRIMITIVE_INT16:
-        text = mxmlNewOpaquef(simple, "%hi", *(const int16_t *)intLocation);
+        text = mxmlNewOpaquef(simple, "%hi", *(const int16_t *)numLocation);
         break;
     case PRIMITIVE_INT8:
-        text = mxmlNewOpaquef(simple, "%hhi", *(const int8_t *)intLocation);
+        text = mxmlNewOpaquef(simple, "%hhi", *(const int8_t *)numLocation);
+        break;
+    case PRIMITIVE_FLOAT:
+        // Round-trippable float, shortest possible
+        text = mxmlNewOpaquef(simple, "%.9G", *(const float *)numLocation);
+        fixNumberIfNeeded(mxmlGetOpaque(text));
+        break;
+    case PRIMITIVE_DOUBLE:
+        // Round-trippable double, shortest possible
+        text = mxmlNewOpaquef(simple, "%.17lG", *(const double *)numLocation);
+        fixNumberIfNeeded(mxmlGetOpaque(text));
         break;
     default:
         // Let text remain NULL and report error below
         break;
     }
 
-    return (simple && text) ? NULL : "Error making new simple integer element";
+    return (simple && text) ? NULL
+                            : "Error making new simple numerical element";
 }
 
 // Initialize a struct with our visitor event handler methods
@@ -149,5 +177,5 @@ xmlIntegerElem(XMLWriter *writer, const ERD *erd, const void *intLocation)
 const VisitEventHandler xmlWriterMethods = {
     (VisitStartDocument)&xmlStartDocument, (VisitEndDocument)&xmlEndDocument,
     (VisitStartComplex)&xmlStartComplex,   (VisitEndComplex)&xmlEndComplex,
-    (VisitIntegerElem)&xmlIntegerElem,
+    (VisitNumberElem)&xmlNumberElem,
 };
diff --git a/daffodil-runtime2/src/main/resources/c/libcli/xml_writer.h b/daffodil-runtime2/src/main/resources/c/libcli/xml_writer.h
index 45d7a45..c49e2f0 100644
--- a/daffodil-runtime2/src/main/resources/c/libcli/xml_writer.h
+++ b/daffodil-runtime2/src/main/resources/c/libcli/xml_writer.h
@@ -18,9 +18,9 @@
 #ifndef XML_WRITER_H
 #define XML_WRITER_H
 
-#include "infoset.h" // for VisitEventHandler
-#include "stack.h"   // for stack_t
-#include <stdio.h>   // for FILE
+#include "infoset.h"  // for VisitEventHandler
+#include "stack.h"    // for stack_t
+#include <stdio.h>    // for FILE
 
 // XMLWriter - infoset visitor with methods to output XML
 
diff --git a/daffodil-runtime2/src/main/resources/c/libruntime/infoset.c b/daffodil-runtime2/src/main/resources/c/libruntime/infoset.c
index b30f92e..d40c351 100644
--- a/daffodil-runtime2/src/main/resources/c/libruntime/infoset.c
+++ b/daffodil-runtime2/src/main/resources/c/libruntime/infoset.c
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-#include "infoset.h" // for walkInfoset, VisitEventHandler, ...
+#include "infoset.h"
 #include <string.h>  // for memccpy
 
 // get_erd_name, get_erd_xmlns, get_erd_ns - get name and xmlns
@@ -136,7 +136,7 @@ walkInfosetNode(const VisitEventHandler *handler, const InfosetBase *infoNode)
         // We use only one of these variables below depending on typeCode
         const InfosetBase *childNode =
             (const InfosetBase *)((const char *)infoNode + offset);
-        const void *intLocation =
+        const void *numLocation =
             (const void *)((const char *)infoNode + offset);
 
         // Need to handle more element types
@@ -154,8 +154,10 @@ walkInfosetNode(const VisitEventHandler *handler, const InfosetBase *infoNode)
         case PRIMITIVE_INT32:
         case PRIMITIVE_INT16:
         case PRIMITIVE_INT8:
+        case PRIMITIVE_FLOAT:
+        case PRIMITIVE_DOUBLE:
             error_msg =
-                handler->visitIntegerElem(handler, childERD, intLocation);
+                handler->visitNumberElem(handler, childERD, numLocation);
             break;
         }
     }
diff --git a/daffodil-runtime2/src/main/resources/c/libruntime/infoset.h b/daffodil-runtime2/src/main/resources/c/libruntime/infoset.h
index 523a0d6..d9b614c 100644
--- a/daffodil-runtime2/src/main/resources/c/libruntime/infoset.h
+++ b/daffodil-runtime2/src/main/resources/c/libruntime/infoset.h
@@ -18,9 +18,8 @@
 #ifndef INFOSET_H
 #define INFOSET_H
 
-#include <stddef.h> // for ptrdiff_t
-#include <stdint.h> // for int32_t
-#include <stdio.h>  // for FILE, size_t
+#include <stddef.h>  // for ptrdiff_t, size_t
+#include <stdio.h>   // for FILE
 
 // Prototypes needed for compilation
 
@@ -37,10 +36,8 @@ typedef struct UState             UState;
 typedef struct VisitEventHandler  VisitEventHandler;
 
 typedef void (*ERDInitSelf)(InfosetBase *infoNode);
-typedef const char *(*ERDParseSelf)(InfosetBase * infoNode,
-                                    const PState *pstate);
-typedef const char *(*ERDUnparseSelf)(const InfosetBase *infoNode,
-                                      const UState *     ustate);
+typedef void (*ERDParseSelf)(InfosetBase *infoNode, PState *pstate);
+typedef void (*ERDUnparseSelf)(const InfosetBase *infoNode, UState *ustate);
 
 typedef const char *(*VisitStartDocument)(const VisitEventHandler *handler);
 typedef const char *(*VisitEndDocument)(const VisitEventHandler *handler);
@@ -48,9 +45,8 @@ typedef const char *(*VisitStartComplex)(const VisitEventHandler *handler,
                                          const InfosetBase *      base);
 typedef const char *(*VisitEndComplex)(const VisitEventHandler *handler,
                                        const InfosetBase *      base);
-typedef const char *(*VisitIntegerElem)(const VisitEventHandler *handler,
-                                        const ERD *              erd,
-                                        const void *             intLocation);
+typedef const char *(*VisitNumberElem)(const VisitEventHandler *handler,
+                                       const ERD *erd, const void *numLocation);
 
 // NamedQName - name of an infoset element
 
@@ -73,7 +69,9 @@ enum TypeCode
     PRIMITIVE_INT64,
     PRIMITIVE_INT32,
     PRIMITIVE_INT16,
-    PRIMITIVE_INT8
+    PRIMITIVE_INT8,
+    PRIMITIVE_FLOAT,
+    PRIMITIVE_DOUBLE
 };
 
 // ERD - element runtime data needed to parse/unparse objects
@@ -102,14 +100,16 @@ typedef struct InfosetBase
 
 typedef struct PState
 {
-    FILE *stream; // input to read from
+    FILE *      stream;    // input to read from
+    const char *error_msg; // to stop if an error happens
 } PState;
 
 // UState - unparser state while unparsing infoset
 
 typedef struct UState
 {
-    FILE *stream; // output to write to
+    FILE *      stream;    // output to write to
+    const char *error_msg; // to stop if an error happens
 } UState;
 
 // VisitEventHandler - methods to be called when walking an infoset
@@ -120,7 +120,7 @@ typedef struct VisitEventHandler
     const VisitEndDocument   visitEndDocument;
     const VisitStartComplex  visitStartComplex;
     const VisitEndComplex    visitEndComplex;
-    const VisitIntegerElem   visitIntegerElem;
+    const VisitNumberElem    visitNumberElem;
 } VisitEventHandler;
 
 // get_erd_name, get_erd_xmlns, get_erd_ns - get name and xmlns
@@ -133,7 +133,7 @@ extern const char *get_erd_ns(const ERD *erd);
 // rootElement - return a root element to walk while parsing or unparsing
 
 // (actual definition will be in generated_code.c, not infoset.c)
-extern InfosetBase *rootElement();
+extern InfosetBase *rootElement(void);
 
 // walkInfoset - walk an infoset and call VisitEventHandler methods
 
diff --git a/daffodil-runtime2/src/main/resources/c/libruntime/parsers.c b/daffodil-runtime2/src/main/resources/c/libruntime/parsers.c
new file mode 100644
index 0000000..87a5f98
--- /dev/null
+++ b/daffodil-runtime2/src/main/resources/c/libruntime/parsers.c
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "parsers.h"
+#include <endian.h>  // for be32toh, be64toh, le32toh, le64toh, be16toh, le16toh
+#include <stdio.h>   // for fread, size_t
+
+// Macros to expand into functions below
+
+#define define_parse_endian_real(endian, type, bits)                           \
+    extern void parse_##endian##_##type(type *number, PState *pstate)          \
+    {                                                                          \
+        if (!pstate->error_msg)                                                \
+        {                                                                      \
+            union                                                              \
+            {                                                                  \
+                char           c_val[sizeof(type)];                            \
+                type           f_val;                                          \
+                uint##bits##_t i_val;                                          \
+            } buffer;                                                          \
+            size_t count =                                                     \
+                fread(&buffer.c_val, 1, sizeof(buffer), pstate->stream);       \
+            if (count < sizeof(buffer))                                        \
+            {                                                                  \
+                pstate->error_msg = eof_or_error_msg(pstate->stream);          \
+            }                                                                  \
+            buffer.i_val = endian##bits##toh(buffer.i_val);                    \
+            *number = buffer.f_val;                                            \
+        }                                                                      \
+    }
+
+#define define_parse_endian_integer(endian, type, bits)                        \
+    extern void parse_##endian##_##type##bits(type##bits##_t *number,          \
+                                              PState *        pstate)          \
+    {                                                                          \
+        if (!pstate->error_msg)                                                \
+        {                                                                      \
+            union                                                              \
+            {                                                                  \
+                char           c_val[sizeof(type##bits##_t)];                  \
+                type##bits##_t i_val;                                          \
+            } buffer;                                                          \
+            size_t count =                                                     \
+                fread(&buffer.c_val, 1, sizeof(buffer), pstate->stream);       \
+            if (count < sizeof(buffer))                                        \
+            {                                                                  \
+                pstate->error_msg = eof_or_error_msg(pstate->stream);          \
+            }                                                                  \
+            *number = endian##bits##toh(buffer.i_val);                         \
+        }                                                                      \
+    }
+
+#define be8toh(var) var
+
+#define le8toh(var) var
+
+// Define functions to parse binary real and integer numbers
+
+define_parse_endian_real(be, double, 64)
+
+define_parse_endian_real(be, float, 32)
+
+define_parse_endian_integer(be, uint, 64)
+
+define_parse_endian_integer(be, uint, 32)
+
+define_parse_endian_integer(be, uint, 16)
+
+define_parse_endian_integer(be, uint, 8)
+
+define_parse_endian_integer(be, int, 64)
+
+define_parse_endian_integer(be, int, 32)
+
+define_parse_endian_integer(be, int, 16)
+
+define_parse_endian_integer(be, int, 8)
+
+define_parse_endian_real(le, double, 64)
+
+define_parse_endian_real(le, float, 32)
+
+define_parse_endian_integer(le, uint, 64)
+
+define_parse_endian_integer(le, uint, 32)
+
+define_parse_endian_integer(le, uint, 16)
+
+define_parse_endian_integer(le, uint, 8)
+
+define_parse_endian_integer(le, int, 64)
+
+define_parse_endian_integer(le, int, 32)
+
+define_parse_endian_integer(le, int, 16)
+
+define_parse_endian_integer(le, int, 8)
diff --git a/daffodil-runtime2/src/main/resources/c/libruntime/parsers.h b/daffodil-runtime2/src/main/resources/c/libruntime/parsers.h
new file mode 100644
index 0000000..1a4f831
--- /dev/null
+++ b/daffodil-runtime2/src/main/resources/c/libruntime/parsers.h
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef PARSERS_H
+#define PARSERS_H
+
+#include "infoset.h"  // for PState
+#include <stdint.h>   // for int16_t, int32_t, int64_t, int8_t, uint16_t, uint32_t, uint64_t, uint8_t
+
+// Functions to parse binary floating point numbers and integers
+
+extern void parse_be_double(double *number, PState *pstate);
+extern void parse_be_float(float *number, PState *pstate);
+
+extern void parse_be_uint64(uint64_t *number, PState *pstate);
+extern void parse_be_uint32(uint32_t *number, PState *pstate);
+extern void parse_be_uint16(uint16_t *number, PState *pstate);
+extern void parse_be_uint8(uint8_t *number, PState *pstate);
+
+extern void parse_be_int64(int64_t *number, PState *pstate);
+extern void parse_be_int32(int32_t *number, PState *pstate);
+extern void parse_be_int16(int16_t *number, PState *pstate);
+extern void parse_be_int8(int8_t *number, PState *pstate);
+
+extern void parse_le_double(double *number, PState *pstate);
+extern void parse_le_float(float *number, PState *pstate);
+
+extern void parse_le_uint64(uint64_t *number, PState *pstate);
+extern void parse_le_uint32(uint32_t *number, PState *pstate);
+extern void parse_le_uint16(uint16_t *number, PState *pstate);
+extern void parse_le_uint8(uint8_t *number, PState *pstate);
+
+extern void parse_le_int64(int64_t *number, PState *pstate);
+extern void parse_le_int32(int32_t *number, PState *pstate);
+extern void parse_le_int16(int16_t *number, PState *pstate);
+extern void parse_le_int8(int8_t *number, PState *pstate);
+
+#endif // PARSERS_H
diff --git a/daffodil-runtime2/src/main/resources/c/libruntime/unparsers.c b/daffodil-runtime2/src/main/resources/c/libruntime/unparsers.c
new file mode 100644
index 0000000..93cddbd
--- /dev/null
+++ b/daffodil-runtime2/src/main/resources/c/libruntime/unparsers.c
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "unparsers.h"
+#include <endian.h>  // for htobe32, htobe64, htole32, htole64, htobe16, htole16
+#include <stdio.h>   // for fwrite, size_t
+
+// Macros to expand into functions below
+
+#define define_unparse_endian_real(endian, type, bits)                         \
+    extern void unparse_##endian##_##type(type number, UState *ustate)         \
+    {                                                                          \
+        if (!ustate->error_msg)                                                \
+        {                                                                      \
+            union                                                              \
+            {                                                                  \
+                char           c_val[sizeof(type)];                            \
+                type           f_val;                                          \
+                uint##bits##_t i_val;                                          \
+            } buffer;                                                          \
+            buffer.f_val = number;                                             \
+            buffer.i_val = hto##endian##bits(buffer.i_val);                    \
+            size_t count =                                                     \
+                fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);       \
+            if (count < sizeof(buffer))                                        \
+            {                                                                  \
+                ustate->error_msg = eof_or_error_msg(ustate->stream);          \
+            }                                                                  \
+        }                                                                      \
+    }
+
+#define define_unparse_endian_integer(endian, type, bits)                      \
+    extern void unparse_##endian##_##type##bits(type##bits##_t number,         \
+                                                UState *       ustate)         \
+    {                                                                          \
+        if (!ustate->error_msg)                                                \
+        {                                                                      \
+            union                                                              \
+            {                                                                  \
+                char           c_val[sizeof(type##bits##_t)];                  \
+                type##bits##_t i_val;                                          \
+            } buffer;                                                          \
+            buffer.i_val = hto##endian##bits(number);                          \
+            size_t count =                                                     \
+                fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);       \
+            if (count < sizeof(buffer))                                        \
+            {                                                                  \
+                ustate->error_msg = eof_or_error_msg(ustate->stream);          \
+            }                                                                  \
+        }                                                                      \
+    }
+
+#define htobe8(var) var
+
+#define htole8(var) var
+
+// Define functions to unparse binary real and integer numbers
+
+define_unparse_endian_real(be, double, 64)
+
+define_unparse_endian_real(be, float, 32)
+
+define_unparse_endian_integer(be, uint, 64)
+
+define_unparse_endian_integer(be, uint, 32)
+
+define_unparse_endian_integer(be, uint, 16)
+
+define_unparse_endian_integer(be, uint, 8)
+
+define_unparse_endian_integer(be, int, 64)
+
+define_unparse_endian_integer(be, int, 32)
+
+define_unparse_endian_integer(be, int, 16)
+
+define_unparse_endian_integer(be, int, 8)
+
+define_unparse_endian_real(le, double, 64)
+
+define_unparse_endian_real(le, float, 32)
+
+define_unparse_endian_integer(le, uint, 64)
+
+define_unparse_endian_integer(le, uint, 32)
+
+define_unparse_endian_integer(le, uint, 16)
+
+define_unparse_endian_integer(le, uint, 8)
+
+define_unparse_endian_integer(le, int, 64)
+
+define_unparse_endian_integer(le, int, 32)
+
+define_unparse_endian_integer(le, int, 16)
+
+define_unparse_endian_integer(le, int, 8)
diff --git a/daffodil-runtime2/src/main/resources/c/libruntime/unparsers.h b/daffodil-runtime2/src/main/resources/c/libruntime/unparsers.h
new file mode 100644
index 0000000..1d2eabd
--- /dev/null
+++ b/daffodil-runtime2/src/main/resources/c/libruntime/unparsers.h
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef UNPARSERS_H
+#define UNPARSERS_H
+
+#include "infoset.h"  // for UState
+#include <stdint.h>   // for int16_t, int32_t, int64_t, int8_t, uint16_t, uint32_t, uint64_t, uint8_t
+
+// Functions to unparse binary floating point numbers and integers
+
+extern void unparse_be_double(double number, UState *ustate);
+extern void unparse_be_float(float number, UState *ustate);
+
+extern void unparse_be_uint64(uint64_t number, UState *ustate);
+extern void unparse_be_uint32(uint32_t number, UState *ustate);
+extern void unparse_be_uint16(uint16_t number, UState *ustate);
+extern void unparse_be_uint8(uint8_t number, UState *ustate);
+
+extern void unparse_be_int64(int64_t number, UState *ustate);
+extern void unparse_be_int32(int32_t number, UState *ustate);
+extern void unparse_be_int16(int16_t number, UState *ustate);
+extern void unparse_be_int8(int8_t number, UState *ustate);
+
+extern void unparse_le_double(double number, UState *ustate);
+extern void unparse_le_float(float number, UState *ustate);
+
+extern void unparse_le_uint64(uint64_t number, UState *ustate);
+extern void unparse_le_uint32(uint32_t number, UState *ustate);
+extern void unparse_le_uint16(uint16_t number, UState *ustate);
+extern void unparse_le_uint8(uint8_t number, UState *ustate);
+
+extern void unparse_le_int64(int64_t number, UState *ustate);
+extern void unparse_le_int32(int32_t number, UState *ustate);
+extern void unparse_le_int16(int16_t number, UState *ustate);
+extern void unparse_le_int8(int8_t number, UState *ustate);
+
+#endif // UNPARSERS_H
diff --git a/daffodil-runtime2/src/main/resources/examples/ex_ints.c b/daffodil-runtime2/src/main/resources/examples/ex_ints.c
deleted file mode 100644
index 2db53e2..0000000
--- a/daffodil-runtime2/src/main/resources/examples/ex_ints.c
+++ /dev/null
@@ -1,766 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ex_ints.h" // for generated code structs
-#include <endian.h>         // for be32toh, htobe32, etc.
-#include <stddef.h>         // for ptrdiff_t
-#include <stdio.h>          // for NULL, fread, fwrite, size_t, FILE
-
-// Prototypes needed for compilation
-
-static void        ex_ints_initSelf(ex_ints *instance);
-static const char *ex_ints_parseSelf(ex_ints *instance, const PState *pstate);
-static const char *ex_ints_unparseSelf(const ex_ints *instance, const UState *ustate);
-
-// Metadata singletons
-
-static const ERD be_uint64_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "be_uint64", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_UINT64, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD be_uint32_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "be_uint32", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_UINT32, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD be_uint16_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "be_uint16", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_UINT16, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD be_uint8_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "be_uint8", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_UINT8, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD be_int64_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "be_int64", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_INT64, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD be_int32_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "be_int32", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_INT32, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD be_int16_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "be_int16", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_INT16, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD be_int8_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "be_int8", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_INT8, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD le_uint64_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "le_uint64", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_UINT64, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD le_uint32_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "le_uint32", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_UINT32, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD le_uint16_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "le_uint16", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_UINT16, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD le_uint8_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "le_uint8", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_UINT8, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD le_int64_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "le_int64", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_INT64, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD le_int32_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "le_int32", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_INT32, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD le_int16_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "le_int16", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_INT16, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ERD le_int8_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "le_int8", // namedQName.local
-        NULL, // namedQName.ns
-    },
-    PRIMITIVE_INT8, // typeCode
-    0,               // numChildren
-    NULL,            // offsets
-    NULL,            // childrenERDs
-    NULL,            // initSelf
-    NULL,            // parseSelf
-    NULL,            // unparseSelf
-};
-
-static const ex_ints ex_ints_compute_ERD_offsets;
-
-static const ptrdiff_t ex_ints_offsets[16] = {
-    (char *)&ex_ints_compute_ERD_offsets.be_uint64 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.be_uint32 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.be_uint16 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.be_uint8 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.be_int64 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.be_int32 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.be_int16 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.be_int8 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.le_uint64 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.le_uint32 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.le_uint16 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.le_uint8 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.le_int64 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.le_int32 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.le_int16 - (char *)&ex_ints_compute_ERD_offsets,
-    (char *)&ex_ints_compute_ERD_offsets.le_int8 - (char *)&ex_ints_compute_ERD_offsets
-};
-
-static const ERD *ex_ints_childrenERDs[16] = {
-    &be_uint64_ERD,
-    &be_uint32_ERD,
-    &be_uint16_ERD,
-    &be_uint8_ERD,
-    &be_int64_ERD,
-    &be_int32_ERD,
-    &be_int16_ERD,
-    &be_int8_ERD,
-    &le_uint64_ERD,
-    &le_uint32_ERD,
-    &le_uint16_ERD,
-    &le_uint8_ERD,
-    &le_int64_ERD,
-    &le_int32_ERD,
-    &le_int16_ERD,
-    &le_int8_ERD
-};
-
-static const ERD ex_ints_ERD = {
-    {
-        NULL, // namedQName.prefix
-        "ex_ints", // namedQName.local
-        "http://example.com", // namedQName.ns
-    },
-    COMPLEX,                         // typeCode
-    16,                               // numChildren
-    ex_ints_offsets,                      // offsets
-    ex_ints_childrenERDs,                 // childrenERDs
-    (ERDInitSelf)&ex_ints_initSelf,       // initSelf
-    (ERDParseSelf)&ex_ints_parseSelf,     // parseSelf
-    (ERDUnparseSelf)&ex_ints_unparseSelf, // unparseSelf
-};
-
-// Return a root element to be used for parsing or unparsing
-
-InfosetBase *
-rootElement()
-{
-    static ex_ints    instance;
-    InfosetBase *root = &instance._base;
-    ex_ints_ERD.initSelf(root);
-    return root;
-}
-
-// Degenerate cases of endian-conversion functions called by code
-// generator since <endian.h> handles only 16, 32, and 64-bit cases
-
-static inline uint8_t htobe8(uint8_t h8b) { return h8b; }
-static inline uint8_t htole8(uint8_t h8b) { return h8b; }
-static inline uint8_t be8toh(uint8_t be8b) { return be8b; }
-static inline uint8_t le8toh(uint8_t le8b) { return le8b; }
-
-// Methods to initialize, parse, and unparse infoset nodes
-
-static void
-ex_ints_initSelf(ex_ints *instance)
-{
-    instance->be_uint64 = 0xCCCCCCCCCCCCCCCC;
-    instance->be_uint32 = 0xCCCCCCCC;
-    instance->be_uint16 = 0xCCCC;
-    instance->be_uint8 = 0xCC;
-    instance->be_int64 = 0xCCCCCCCCCCCCCCCC;
-    instance->be_int32 = 0xCCCCCCCC;
-    instance->be_int16 = 0xCCCC;
-    instance->be_int8 = 0xCC;
-    instance->le_uint64 = 0xCCCCCCCCCCCCCCCC;
-    instance->le_uint32 = 0xCCCCCCCC;
-    instance->le_uint16 = 0xCCCC;
-    instance->le_uint8 = 0xCC;
-    instance->le_int64 = 0xCCCCCCCCCCCCCCCC;
-    instance->le_int32 = 0xCCCCCCCC;
-    instance->le_int16 = 0xCCCC;
-    instance->le_int8 = 0xCC;
-    instance->_base.erd = &ex_ints_ERD;
-}
-
-static const char *
-ex_ints_parseSelf(ex_ints *instance, const PState *pstate)
-{
-    const char *error_msg = NULL;
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint64_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->be_uint64 = be64toh(*((uint64_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint32_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->be_uint32 = be32toh(*((uint32_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint16_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->be_uint16 = be16toh(*((uint16_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint8_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->be_uint8 = be8toh(*((uint8_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint64_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->be_int64 = be64toh(*((uint64_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint32_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->be_int32 = be32toh(*((uint32_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint16_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->be_int16 = be16toh(*((uint16_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint8_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->be_int8 = be8toh(*((uint8_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint64_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->le_uint64 = le64toh(*((uint64_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint32_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->le_uint32 = le32toh(*((uint32_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint16_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->le_uint16 = le16toh(*((uint16_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint8_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->le_uint8 = le8toh(*((uint8_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint64_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->le_int64 = le64toh(*((uint64_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint32_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->le_int32 = le32toh(*((uint32_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint16_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->le_int16 = le16toh(*((uint16_t *)(&buffer)));
-    }
-    if (!error_msg)
-    {
-        char   buffer[sizeof(uint8_t)];
-        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(pstate->stream);
-        }
-        instance->le_int8 = le8toh(*((uint8_t *)(&buffer)));
-    }
-    return error_msg;
-}
-
-static const char *
-ex_ints_unparseSelf(const ex_ints *instance, const UState *ustate)
-{
-    const char *error_msg = NULL;
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint64_t)];
-            uint64_t i_val;
-        } buffer;
-        buffer.i_val = htobe64(instance->be_uint64);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint32_t)];
-            uint32_t i_val;
-        } buffer;
-        buffer.i_val = htobe32(instance->be_uint32);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint16_t)];
-            uint16_t i_val;
-        } buffer;
-        buffer.i_val = htobe16(instance->be_uint16);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint8_t)];
-            uint8_t i_val;
-        } buffer;
-        buffer.i_val = htobe8(instance->be_uint8);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint64_t)];
-            uint64_t i_val;
-        } buffer;
-        buffer.i_val = htobe64(instance->be_int64);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint32_t)];
-            uint32_t i_val;
-        } buffer;
-        buffer.i_val = htobe32(instance->be_int32);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint16_t)];
-            uint16_t i_val;
-        } buffer;
-        buffer.i_val = htobe16(instance->be_int16);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint8_t)];
-            uint8_t i_val;
-        } buffer;
-        buffer.i_val = htobe8(instance->be_int8);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint64_t)];
-            uint64_t i_val;
-        } buffer;
-        buffer.i_val = htole64(instance->le_uint64);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint32_t)];
-            uint32_t i_val;
-        } buffer;
-        buffer.i_val = htole32(instance->le_uint32);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint16_t)];
-            uint16_t i_val;
-        } buffer;
-        buffer.i_val = htole16(instance->le_uint16);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint8_t)];
-            uint8_t i_val;
-        } buffer;
-        buffer.i_val = htole8(instance->le_uint8);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint64_t)];
-            uint64_t i_val;
-        } buffer;
-        buffer.i_val = htole64(instance->le_int64);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint32_t)];
-            uint32_t i_val;
-        } buffer;
-        buffer.i_val = htole32(instance->le_int32);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint16_t)];
-            uint16_t i_val;
-        } buffer;
-        buffer.i_val = htole16(instance->le_int16);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    if (!error_msg)
-    {
-        union
-        {
-            char     c_val[sizeof(uint8_t)];
-            uint8_t i_val;
-        } buffer;
-        buffer.i_val = htole8(instance->le_int8);
-        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-        if (count < sizeof(buffer))
-        {
-            error_msg = eof_or_error_msg(ustate->stream);
-        }
-    }
-    return error_msg;
-}
-
diff --git a/daffodil-runtime2/src/main/resources/examples/ex_nums.c b/daffodil-runtime2/src/main/resources/examples/ex_nums.c
new file mode 100644
index 0000000..7747006
--- /dev/null
+++ b/daffodil-runtime2/src/main/resources/examples/ex_nums.c
@@ -0,0 +1,684 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ex_nums.h"
+#include "parsers.h"    // for parse_be_double, parse_be_float, parse_be_int16, parse_be_int32, parse_be_int64, parse_be_int8, parse_be_uint16, parse_be_uint32, parse_be_uint64, parse_be_uint8, parse_le_double, parse_le_float, parse_le_int16, parse_le_int32, parse_le_int64, parse_le_int8, parse_le_uint16, parse_le_uint32, parse_le_uint64, parse_le_uint8
+#include "unparsers.h"  // for unparse_be_double, unparse_be_float, unparse_be_int16, unparse_be_int32, unparse_be_int64, unparse_be_int8, unparse_be_uint16, unparse_be_uint32, unparse_be_uint64, unparse_be_uint8, unparse_le_double, unparse_le_float, unparse_le_int16, unparse_le_int32, unparse_le_int64, unparse_le_int8, unparse_le_uint16, unparse_le_uint32, unparse_le_uint64, unparse_le_uint8
+#include <math.h>       // for NAN
+#include <stddef.h>     // for NULL, ptrdiff_t
+
+// Prototypes needed for compilation
+
+static void array_initSelf(array *instance);
+static void array_parseSelf(array *instance, PState *pstate);
+static void array_unparseSelf(const array *instance, UState *ustate);
+static void bigEndian_initSelf(bigEndian *instance);
+static void bigEndian_parseSelf(bigEndian *instance, PState *pstate);
+static void bigEndian_unparseSelf(const bigEndian *instance, UState *ustate);
+static void littleEndian_initSelf(littleEndian *instance);
+static void littleEndian_parseSelf(littleEndian *instance, PState *pstate);
+static void littleEndian_unparseSelf(const littleEndian *instance, UState *ustate);
+static void ex_nums_initSelf(ex_nums *instance);
+static void ex_nums_parseSelf(ex_nums *instance, PState *pstate);
+static void ex_nums_unparseSelf(const ex_nums *instance, UState *ustate);
+
+// Metadata singletons
+
+static const ERD be_int16_array_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "be_int16", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_INT16, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD be_float_array_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "be_float", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_FLOAT, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const array array_compute_offsets;
+
+static const ptrdiff_t array_offsets[6] = {
+    (const char *)&array_compute_offsets.be_int16[0] - (const char *)&array_compute_offsets,
+    (const char *)&array_compute_offsets.be_int16[1] - (const char *)&array_compute_offsets,
+    (const char *)&array_compute_offsets.be_int16[2] - (const char *)&array_compute_offsets,
+    (const char *)&array_compute_offsets.be_float[0] - (const char *)&array_compute_offsets,
+    (const char *)&array_compute_offsets.be_float[1] - (const char *)&array_compute_offsets,
+    (const char *)&array_compute_offsets.be_float[2] - (const char *)&array_compute_offsets
+};
+
+static const ERD *array_childrenERDs[6] = {
+    &be_int16_array_ex_nums__ERD,
+    &be_int16_array_ex_nums__ERD,
+    &be_int16_array_ex_nums__ERD,
+    &be_float_array_ex_nums__ERD,
+    &be_float_array_ex_nums__ERD,
+    &be_float_array_ex_nums__ERD
+};
+
+static const ERD array_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "array", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    COMPLEX,                         // typeCode
+    6,                               // numChildren
+    array_offsets,                      // offsets
+    array_childrenERDs,                 // childrenERDs
+    (ERDInitSelf)&array_initSelf,       // initSelf
+    (ERDParseSelf)&array_parseSelf,     // parseSelf
+    (ERDUnparseSelf)&array_unparseSelf, // unparseSelf
+};
+
+static const ERD be_double_bigEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "be_double", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_DOUBLE, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD be_float_bigEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "be_float", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_FLOAT, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD be_uint64_bigEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "be_uint64", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_UINT64, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD be_uint32_bigEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "be_uint32", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_UINT32, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD be_uint16_bigEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "be_uint16", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_UINT16, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD be_uint8_bigEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "be_uint8", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_UINT8, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD be_int64_bigEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "be_int64", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_INT64, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD be_int32_bigEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "be_int32", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_INT32, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD be_int16_bigEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "be_int16", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_INT16, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD be_int8_bigEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "be_int8", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_INT8, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const bigEndian bigEndian_compute_offsets;
+
+static const ptrdiff_t bigEndian_offsets[10] = {
+    (const char *)&bigEndian_compute_offsets.be_double - (const char *)&bigEndian_compute_offsets,
+    (const char *)&bigEndian_compute_offsets.be_float - (const char *)&bigEndian_compute_offsets,
+    (const char *)&bigEndian_compute_offsets.be_uint64 - (const char *)&bigEndian_compute_offsets,
+    (const char *)&bigEndian_compute_offsets.be_uint32 - (const char *)&bigEndian_compute_offsets,
+    (const char *)&bigEndian_compute_offsets.be_uint16 - (const char *)&bigEndian_compute_offsets,
+    (const char *)&bigEndian_compute_offsets.be_uint8 - (const char *)&bigEndian_compute_offsets,
+    (const char *)&bigEndian_compute_offsets.be_int64 - (const char *)&bigEndian_compute_offsets,
+    (const char *)&bigEndian_compute_offsets.be_int32 - (const char *)&bigEndian_compute_offsets,
+    (const char *)&bigEndian_compute_offsets.be_int16 - (const char *)&bigEndian_compute_offsets,
+    (const char *)&bigEndian_compute_offsets.be_int8 - (const char *)&bigEndian_compute_offsets
+};
+
+static const ERD *bigEndian_childrenERDs[10] = {
+    &be_double_bigEndian_ex_nums__ERD,
+    &be_float_bigEndian_ex_nums__ERD,
+    &be_uint64_bigEndian_ex_nums__ERD,
+    &be_uint32_bigEndian_ex_nums__ERD,
+    &be_uint16_bigEndian_ex_nums__ERD,
+    &be_uint8_bigEndian_ex_nums__ERD,
+    &be_int64_bigEndian_ex_nums__ERD,
+    &be_int32_bigEndian_ex_nums__ERD,
+    &be_int16_bigEndian_ex_nums__ERD,
+    &be_int8_bigEndian_ex_nums__ERD
+};
+
+static const ERD bigEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "bigEndian", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    COMPLEX,                         // typeCode
+    10,                               // numChildren
+    bigEndian_offsets,                      // offsets
+    bigEndian_childrenERDs,                 // childrenERDs
+    (ERDInitSelf)&bigEndian_initSelf,       // initSelf
+    (ERDParseSelf)&bigEndian_parseSelf,     // parseSelf
+    (ERDUnparseSelf)&bigEndian_unparseSelf, // unparseSelf
+};
+
+static const ERD le_uint64_littleEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "le_uint64", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_UINT64, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD le_uint32_littleEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "le_uint32", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_UINT32, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD le_uint16_littleEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "le_uint16", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_UINT16, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD le_uint8_littleEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "le_uint8", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_UINT8, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD le_int64_littleEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "le_int64", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_INT64, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD le_int32_littleEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "le_int32", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_INT32, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD le_int16_littleEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "le_int16", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_INT16, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD le_int8_littleEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "le_int8", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_INT8, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD le_float_littleEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "le_float", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_FLOAT, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const ERD le_double_littleEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "le_double", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    PRIMITIVE_DOUBLE, // typeCode
+    0,               // numChildren
+    NULL,            // offsets
+    NULL,            // childrenERDs
+    NULL,            // initSelf
+    NULL,            // parseSelf
+    NULL,            // unparseSelf
+};
+
+static const littleEndian littleEndian_compute_offsets;
+
+static const ptrdiff_t littleEndian_offsets[10] = {
+    (const char *)&littleEndian_compute_offsets.le_uint64 - (const char *)&littleEndian_compute_offsets,
+    (const char *)&littleEndian_compute_offsets.le_uint32 - (const char *)&littleEndian_compute_offsets,
+    (const char *)&littleEndian_compute_offsets.le_uint16 - (const char *)&littleEndian_compute_offsets,
+    (const char *)&littleEndian_compute_offsets.le_uint8 - (const char *)&littleEndian_compute_offsets,
+    (const char *)&littleEndian_compute_offsets.le_int64 - (const char *)&littleEndian_compute_offsets,
+    (const char *)&littleEndian_compute_offsets.le_int32 - (const char *)&littleEndian_compute_offsets,
+    (const char *)&littleEndian_compute_offsets.le_int16 - (const char *)&littleEndian_compute_offsets,
+    (const char *)&littleEndian_compute_offsets.le_int8 - (const char *)&littleEndian_compute_offsets,
+    (const char *)&littleEndian_compute_offsets.le_float - (const char *)&littleEndian_compute_offsets,
+    (const char *)&littleEndian_compute_offsets.le_double - (const char *)&littleEndian_compute_offsets
+};
+
+static const ERD *littleEndian_childrenERDs[10] = {
+    &le_uint64_littleEndian_ex_nums__ERD,
+    &le_uint32_littleEndian_ex_nums__ERD,
+    &le_uint16_littleEndian_ex_nums__ERD,
+    &le_uint8_littleEndian_ex_nums__ERD,
+    &le_int64_littleEndian_ex_nums__ERD,
+    &le_int32_littleEndian_ex_nums__ERD,
+    &le_int16_littleEndian_ex_nums__ERD,
+    &le_int8_littleEndian_ex_nums__ERD,
+    &le_float_littleEndian_ex_nums__ERD,
+    &le_double_littleEndian_ex_nums__ERD
+};
+
+static const ERD littleEndian_ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "littleEndian", // namedQName.local
+        NULL, // namedQName.ns
+    },
+    COMPLEX,                         // typeCode
+    10,                               // numChildren
+    littleEndian_offsets,                      // offsets
+    littleEndian_childrenERDs,                 // childrenERDs
+    (ERDInitSelf)&littleEndian_initSelf,       // initSelf
+    (ERDParseSelf)&littleEndian_parseSelf,     // parseSelf
+    (ERDUnparseSelf)&littleEndian_unparseSelf, // unparseSelf
+};
+
+static const ex_nums ex_nums_compute_offsets;
+
+static const ptrdiff_t ex_nums_offsets[3] = {
+    (const char *)&ex_nums_compute_offsets.array - (const char *)&ex_nums_compute_offsets,
+    (const char *)&ex_nums_compute_offsets.bigEndian - (const char *)&ex_nums_compute_offsets,
+    (const char *)&ex_nums_compute_offsets.littleEndian - (const char *)&ex_nums_compute_offsets
+};
+
+static const ERD *ex_nums_childrenERDs[3] = {
+    &array_ex_nums__ERD,
+    &bigEndian_ex_nums__ERD,
+    &littleEndian_ex_nums__ERD
+};
+
+static const ERD ex_nums__ERD = {
+    {
+        NULL, // namedQName.prefix
+        "ex_nums", // namedQName.local
+        "http://example.com", // namedQName.ns
+    },
+    COMPLEX,                         // typeCode
+    3,                               // numChildren
+    ex_nums_offsets,                      // offsets
+    ex_nums_childrenERDs,                 // childrenERDs
+    (ERDInitSelf)&ex_nums_initSelf,       // initSelf
+    (ERDParseSelf)&ex_nums_parseSelf,     // parseSelf
+    (ERDUnparseSelf)&ex_nums_unparseSelf, // unparseSelf
+};
+
+// Return a root element to be used for parsing or unparsing
+
+extern InfosetBase *
+rootElement(void)
+{
+    static ex_nums instance;
+    InfosetBase *root = &instance._base;
+    ex_nums__ERD.initSelf(root);
+    return root;
+}
+
+// Methods to initialize, parse, and unparse infoset nodes
+
+static void
+array_initSelf(array *instance)
+{
+    instance->be_int16[0] = 0xCCCC;
+    instance->be_int16[1] = 0xCCCC;
+    instance->be_int16[2] = 0xCCCC;
+    instance->be_float[0] = NAN;
+    instance->be_float[1] = NAN;
+    instance->be_float[2] = NAN;
+    instance->_base.erd = &array_ex_nums__ERD;
+}
+
+static void
+array_parseSelf(array *instance, PState *pstate)
+{
+    parse_be_int16(&instance->be_int16[0], pstate);
+    parse_be_int16(&instance->be_int16[1], pstate);
+    parse_be_int16(&instance->be_int16[2], pstate);
+    parse_be_float(&instance->be_float[0], pstate);
+    parse_be_float(&instance->be_float[1], pstate);
+    parse_be_float(&instance->be_float[2], pstate);
+}
+
+static void
+array_unparseSelf(const array *instance, UState *ustate)
+{
+    unparse_be_int16(instance->be_int16[0], ustate);
+    unparse_be_int16(instance->be_int16[1], ustate);
+    unparse_be_int16(instance->be_int16[2], ustate);
+    unparse_be_float(instance->be_float[0], ustate);
+    unparse_be_float(instance->be_float[1], ustate);
+    unparse_be_float(instance->be_float[2], ustate);
+}
+
+static void
+bigEndian_initSelf(bigEndian *instance)
+{
+    instance->be_double = NAN;
+    instance->be_float = NAN;
+    instance->be_uint64 = 0xCCCCCCCCCCCCCCCC;
+    instance->be_uint32 = 0xCCCCCCCC;
+    instance->be_uint16 = 0xCCCC;
+    instance->be_uint8 = 0xCC;
+    instance->be_int64 = 0xCCCCCCCCCCCCCCCC;
+    instance->be_int32 = 0xCCCCCCCC;
+    instance->be_int16 = 0xCCCC;
+    instance->be_int8 = 0xCC;
+    instance->_base.erd = &bigEndian_ex_nums__ERD;
+}
+
+static void
+bigEndian_parseSelf(bigEndian *instance, PState *pstate)
+{
+    parse_be_double(&instance->be_double, pstate);
+    parse_be_float(&instance->be_float, pstate);
+    parse_be_uint64(&instance->be_uint64, pstate);
+    parse_be_uint32(&instance->be_uint32, pstate);
+    parse_be_uint16(&instance->be_uint16, pstate);
+    parse_be_uint8(&instance->be_uint8, pstate);
+    parse_be_int64(&instance->be_int64, pstate);
+    parse_be_int32(&instance->be_int32, pstate);
+    parse_be_int16(&instance->be_int16, pstate);
+    parse_be_int8(&instance->be_int8, pstate);
+}
+
+static void
+bigEndian_unparseSelf(const bigEndian *instance, UState *ustate)
+{
+    unparse_be_double(instance->be_double, ustate);
+    unparse_be_float(instance->be_float, ustate);
+    unparse_be_uint64(instance->be_uint64, ustate);
+    unparse_be_uint32(instance->be_uint32, ustate);
+    unparse_be_uint16(instance->be_uint16, ustate);
+    unparse_be_uint8(instance->be_uint8, ustate);
+    unparse_be_int64(instance->be_int64, ustate);
+    unparse_be_int32(instance->be_int32, ustate);
+    unparse_be_int16(instance->be_int16, ustate);
+    unparse_be_int8(instance->be_int8, ustate);
+}
+
+static void
+littleEndian_initSelf(littleEndian *instance)
+{
+    instance->le_uint64 = 0xCCCCCCCCCCCCCCCC;
+    instance->le_uint32 = 0xCCCCCCCC;
+    instance->le_uint16 = 0xCCCC;
+    instance->le_uint8 = 0xCC;
+    instance->le_int64 = 0xCCCCCCCCCCCCCCCC;
+    instance->le_int32 = 0xCCCCCCCC;
+    instance->le_int16 = 0xCCCC;
+    instance->le_int8 = 0xCC;
+    instance->le_float = NAN;
+    instance->le_double = NAN;
+    instance->_base.erd = &littleEndian_ex_nums__ERD;
+}
+
+static void
+littleEndian_parseSelf(littleEndian *instance, PState *pstate)
+{
+    parse_le_uint64(&instance->le_uint64, pstate);
+    parse_le_uint32(&instance->le_uint32, pstate);
+    parse_le_uint16(&instance->le_uint16, pstate);
+    parse_le_uint8(&instance->le_uint8, pstate);
+    parse_le_int64(&instance->le_int64, pstate);
+    parse_le_int32(&instance->le_int32, pstate);
+    parse_le_int16(&instance->le_int16, pstate);
+    parse_le_int8(&instance->le_int8, pstate);
+    parse_le_float(&instance->le_float, pstate);
+    parse_le_double(&instance->le_double, pstate);
+}
+
+static void
+littleEndian_unparseSelf(const littleEndian *instance, UState *ustate)
+{
+    unparse_le_uint64(instance->le_uint64, ustate);
+    unparse_le_uint32(instance->le_uint32, ustate);
+    unparse_le_uint16(instance->le_uint16, ustate);
+    unparse_le_uint8(instance->le_uint8, ustate);
+    unparse_le_int64(instance->le_int64, ustate);
+    unparse_le_int32(instance->le_int32, ustate);
+    unparse_le_int16(instance->le_int16, ustate);
+    unparse_le_int8(instance->le_int8, ustate);
+    unparse_le_float(instance->le_float, ustate);
+    unparse_le_double(instance->le_double, ustate);
+}
+
+static void
+ex_nums_initSelf(ex_nums *instance)
+{
+    array_initSelf(&instance->array);
+    bigEndian_initSelf(&instance->bigEndian);
+    littleEndian_initSelf(&instance->littleEndian);
+    instance->_base.erd = &ex_nums__ERD;
+}
+
+static void
+ex_nums_parseSelf(ex_nums *instance, PState *pstate)
+{
+    array_parseSelf(&instance->array, pstate);
+    bigEndian_parseSelf(&instance->bigEndian, pstate);
+    littleEndian_parseSelf(&instance->littleEndian, pstate);
+}
+
+static void
+ex_nums_unparseSelf(const ex_nums *instance, UState *ustate)
+{
+    array_unparseSelf(&instance->array, ustate);
+    bigEndian_unparseSelf(&instance->bigEndian, ustate);
+    littleEndian_unparseSelf(&instance->littleEndian, ustate);
+}
+
diff --git a/daffodil-runtime2/src/main/resources/examples/ex_ints.h b/daffodil-runtime2/src/main/resources/examples/ex_nums.h
similarity index 69%
rename from daffodil-runtime2/src/main/resources/examples/ex_ints.h
rename to daffodil-runtime2/src/main/resources/examples/ex_nums.h
index bc8ffd8..9e2c1bb 100644
--- a/daffodil-runtime2/src/main/resources/examples/ex_ints.h
+++ b/daffodil-runtime2/src/main/resources/examples/ex_nums.h
@@ -18,14 +18,23 @@
 #ifndef GENERATED_CODE_H
 #define GENERATED_CODE_H
 
-#include "infoset.h" // for InfosetBase
-#include <stdint.h>  // for int32_t
+#include "infoset.h"  // for InfosetBase
+#include <stdint.h>   // for int16_t, int32_t, int64_t, int8_t, uint16_t, uint32_t, uint64_t, uint8_t
 
 // Define some infoset structures
 
-typedef struct ex_ints
+typedef struct array
 {
     InfosetBase _base;
+    int16_t     be_int16[3];
+    float       be_float[3];
+} array;
+
+typedef struct bigEndian
+{
+    InfosetBase _base;
+    double      be_double;
+    float       be_float;
     uint64_t    be_uint64;
     uint32_t    be_uint32;
     uint16_t    be_uint16;
@@ -34,6 +43,11 @@ typedef struct ex_ints
     int32_t     be_int32;
     int16_t     be_int16;
     int8_t      be_int8;
+} bigEndian;
+
+typedef struct littleEndian
+{
+    InfosetBase _base;
     uint64_t    le_uint64;
     uint32_t    le_uint32;
     uint16_t    le_uint16;
@@ -42,6 +56,16 @@ typedef struct ex_ints
     int32_t     le_int32;
     int16_t     le_int16;
     int8_t      le_int8;
-} ex_ints;
+    float       le_float;
+    double      le_double;
+} littleEndian;
+
+typedef struct ex_nums
+{
+    InfosetBase _base;
+    array array;
+    bigEndian bigEndian;
+    littleEndian littleEndian;
+} ex_nums;
 
 #endif // GENERATED_CODE_H
diff --git a/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/CodeGenerator.scala b/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/CodeGenerator.scala
index 4f2a776..385657c 100644
--- a/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/CodeGenerator.scala
+++ b/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/CodeGenerator.scala
@@ -44,7 +44,7 @@ class CodeGenerator(root: Root) extends DFDL.CodeGenerator {
   private var errorStatus: Boolean = false
 
   // Writes C source files into a "c" subdirectory of the given output directory.
-  // Removes the "c" subdirectory if it existed before.
+  // Removes the "c" subdirectory if it existed before.  Returns the "c" subdirectory.
   override def generateCode(rootNS: Option[RefQName], outputDirArg: String): os.Path = {
     // Get the paths of the output directory and its code subdirectory
     val outputDir = os.Path(Paths.get(outputDirArg).toAbsolutePath)
@@ -82,15 +82,14 @@ class CodeGenerator(root: Root) extends DFDL.CodeGenerator {
     os.write(generatedCodeHeader, codeHeaderText)
     os.write(generatedCodeFile, codeFileText)
 
-    // Return our output directory in case caller wants to call compileCode next
-    outputDir
+    // Return our code directory in case caller wants to call compileCode next
+    codeDir
   }
 
-  // Compiles any C source files inside a "c" subdirectory of the given output directory.
-  // Returns the path of the newly created executable to use in TDML tests or something else.
-  override def compileCode(outputDir: os.Path): os.Path = {
-    // Get the paths of the code subdirectory and the executable we will build
-    val codeDir = outputDir/"c"
+  // Compiles any C source files inside the given code directory.  Returns the path
+  // of the newly created executable to use in TDML tests or somewhere else.
+  override def compileCode(codeDir: os.Path): os.Path = {
+    // Get the path of the executable we will build
     val exe = if (isWindows) codeDir/"daffodil.exe" else codeDir/"daffodil"
 
     try {
@@ -99,14 +98,12 @@ class CodeGenerator(root: Root) extends DFDL.CodeGenerator {
       val files = os.walk(codeDir).filter(_.ext == "c")
       val libs = Seq("-lmxml", if (isWindows) "-largp" else "-lpthread")
 
-      // Call the compiler if it was found.  We run the compiler in the output directory,
-      // not in the "c" subdirectory, in order to let the compiler (which might be "zig cc")
-      // cache/reuse previously built files (which might be in a "zig_cache" subdirectory).
-      // We can't let "zig_cache" be put into "c" because we always remove and re-generate
-      // everything in "c" from scratch.
+      // Run the compiler in the code directory (if we found "zig cc"
+      // as a compiler, it will cache previously built files in zig's
+      // global cache directory, not a local zig_cache directory)
       if (compiler.nonEmpty) {
         val result = os.proc(compiler, "-I", codeDir/"libcli", "-I", codeDir/"libruntime",
-          files, libs, "-o", exe).call(cwd = outputDir, stderr = os.Pipe)
+          files, libs, "-o", exe).call(cwd = codeDir, stderr = os.Pipe)
 
         // Report any compiler output as a warning
         if (result.out.text.nonEmpty || result.err.text.nonEmpty) {
@@ -116,7 +113,7 @@ class CodeGenerator(root: Root) extends DFDL.CodeGenerator {
     } catch {
       // Report any subprocess termination error as an error
       case e: os.SubprocessException =>
-        error("Error compiling generated code: %s wd: %s", Misc.getSomeMessage(e).get, outputDir.toString)
+        error("Error compiling generated code: %s wd: %s", Misc.getSomeMessage(e).get, codeDir.toString)
     }
 
     // Report any failure to build the executable as an error
diff --git a/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/Runtime2CodeGenerator.scala b/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/Runtime2CodeGenerator.scala
index fbf704f..65c2c1c 100644
--- a/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/Runtime2CodeGenerator.scala
+++ b/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/Runtime2CodeGenerator.scala
@@ -21,6 +21,8 @@ import org.apache.daffodil.grammar.Gram
 import org.apache.daffodil.grammar.Prod
 import org.apache.daffodil.grammar.RootGrammarMixin
 import org.apache.daffodil.grammar.SeqComp
+import org.apache.daffodil.grammar.primitives.BinaryDouble
+import org.apache.daffodil.grammar.primitives.BinaryFloat
 import org.apache.daffodil.grammar.primitives.BinaryIntegerKnownLength
 import org.apache.daffodil.grammar.primitives.CaptureContentLengthEnd
 import org.apache.daffodil.grammar.primitives.CaptureContentLengthStart
@@ -31,6 +33,7 @@ import org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength
 import org.apache.daffodil.grammar.primitives.OrderedSequence
 import org.apache.daffodil.grammar.primitives.ScalarOrderedSequenceChild
 import org.apache.daffodil.grammar.primitives.SpecifiedLengthImplicit
+import org.apache.daffodil.runtime2.generators.BinaryFloatCodeGenerator
 import org.apache.daffodil.runtime2.generators.BinaryIntegerKnownLengthCodeGenerator
 import org.apache.daffodil.runtime2.generators.CodeGeneratorState
 import org.apache.daffodil.runtime2.generators.ElementParseAndUnspecifiedLengthCodeGenerator
@@ -42,6 +45,7 @@ import scala.annotation.tailrec
 
 object Runtime2CodeGenerator
   extends BinaryIntegerKnownLengthCodeGenerator
+    with BinaryFloatCodeGenerator
     with ElementParseAndUnspecifiedLengthCodeGenerator
     with OrderedSequenceCodeGenerator
     with SeqCompCodeGenerator {
@@ -58,10 +62,16 @@ object Runtime2CodeGenerator
       case g: OrderedSequence => orderedSequenceGenerateCode(g, state)
       case g: ElementParseAndUnspecifiedLength => elementParseAndUnspecifiedLengthGenerateCode(g, state)
       case g: BinaryIntegerKnownLength => binaryIntegerKnownLengthGenerateCode(g, state)
-      case _: CaptureContentLengthStart => // not generating code here
-      case _: CaptureContentLengthEnd => // not generating code here
-      case _: CaptureValueLengthStart => //not generating code here
-      case _: CaptureValueLengthEnd => // not generating code here
+      case g: BinaryFloat => binaryFloatGenerateCode(g.e, 32, state)
+      case g: BinaryDouble => binaryFloatGenerateCode(g.e, 64, state)
+      case _: CaptureContentLengthStart => noop
+      case _: CaptureContentLengthEnd => noop
+      case _: CaptureValueLengthStart => noop
+      case _: CaptureValueLengthEnd => noop
       case _ => gram.SDE("Code generation not supported for: %s", Misc.getNameFromClass(gram))
     }
+
+  private def noop: Unit = {
+    // Not generating code here, but can use as a breakpoint
+  }
 }
diff --git a/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/generators/BinaryFloatCodeGenerator.scala b/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/generators/BinaryFloatCodeGenerator.scala
new file mode 100644
index 0000000..2567ae0
--- /dev/null
+++ b/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/generators/BinaryFloatCodeGenerator.scala
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.daffodil.runtime2.generators
+
+import org.apache.daffodil.dsom.ElementBase
+import org.apache.daffodil.schema.annotation.props.gen.ByteOrder
+import org.apache.daffodil.schema.annotation.props.gen.OccursCountKind
+
+trait BinaryFloatCodeGenerator {
+
+  def binaryFloatGenerateCode(e: ElementBase, lengthInBits: Int, cgState: CodeGeneratorState): Unit = {
+    // For the time being this is a very limited back end.
+    // So there are some restrictions to enforce.
+    assert(lengthInBits == 32 || lengthInBits == 64)
+    val byteOrder: ByteOrder = {
+      e.schemaDefinitionUnless(e.byteOrderEv.isConstant, "Runtime dfdl:byteOrder expressions not supported.")
+      val bo = e.byteOrderEv.constValue
+      bo
+    }
+
+    // Use a NAN to mark our field as uninitialized in case parsing or unparsing
+    // fails to set the field.
+    val fieldName = e.namedQName.local
+    val float = if (lengthInBits == 32) "float" else "double"
+    val conv = if (byteOrder eq ByteOrder.BigEndian) "be" else "le"
+    val arraySize = if (e.occursCountKind == OccursCountKind.Fixed) e.maxOccurs else 0
+
+    def addSimpleTypeStatements(deref: String): Unit = {
+      val initStatement = s"    instance->$fieldName$deref = NAN;"
+      val parseStatement = s"    parse_${conv}_$float(&instance->$fieldName$deref, pstate);"
+      val unparseStatement = s"    unparse_${conv}_$float(instance->$fieldName$deref, ustate);"
+      cgState.addSimpleTypeStatements(initStatement, parseStatement, unparseStatement)
+    }
+    if (arraySize > 0)
+      for (i <- 0 until arraySize)
+        addSimpleTypeStatements(s"[$i]")
+    else
+      addSimpleTypeStatements("")
+  }
+}
diff --git a/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/generators/BinaryIntegerKnownLengthCodeGenerator.scala b/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/generators/BinaryIntegerKnownLengthCodeGenerator.scala
index f31a162..c3ac488 100644
--- a/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/generators/BinaryIntegerKnownLengthCodeGenerator.scala
+++ b/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/generators/BinaryIntegerKnownLengthCodeGenerator.scala
@@ -18,35 +18,29 @@
 package org.apache.daffodil.runtime2.generators
 
 import org.apache.daffodil.grammar.primitives.BinaryIntegerKnownLength
+import org.apache.daffodil.schema.annotation.props.gen.OccursCountKind
 import org.apache.daffodil.schema.annotation.props.gen.{ BitOrder, ByteOrder }
 
 trait BinaryIntegerKnownLengthCodeGenerator {
 
   def binaryIntegerKnownLengthGenerateCode(g: BinaryIntegerKnownLength, cgState: CodeGeneratorState): Unit = {
     // For the time being this is a very limited back end.
-    // So there are numerous restrictions to enforce.
+    // So there are some restrictions to enforce.
     val e = g.e
-    val fieldName = e.namedQName.local
     val lengthInBits: Long = {
       e.schemaDefinitionUnless(e.elementLengthInBitsEv.isConstant, "Runtime dfdl:length expressions not supported.")
       val len = e.elementLengthInBitsEv.constValue.get
       len
     }
-
+    e.schemaDefinitionUnless(e.bitOrder eq BitOrder.MostSignificantBitFirst, "Only dfdl:bitOrder 'mostSignificantBitFirst' is supported.")
     val byteOrder: ByteOrder = {
       e.schemaDefinitionUnless(e.byteOrderEv.isConstant, "Runtime dfdl:byteOrder expressions not supported.")
       val bo = e.byteOrderEv.constValue
       bo
     }
 
-    // We eventually want to lift this restriction.
-    if (e.bitOrder ne BitOrder.MostSignificantBitFirst)
-      e.SDE("Only dfdl:bitOrder 'mostSignificantBitFirst' is supported.")
-    if (e.alignmentValueInBits.intValue() % 8 != 0)
-      e.SDE("Only alignment to 8-bit (1 byte) boundaries is supported.")
-
-    // Use an unusual memory bit pattern (magic debug value) to mark fields as
-    // uninitialized in case generated code fails to set them during parsing.
+    // Use an unusual memory bit pattern (magic debug value) to mark our field
+    // as uninitialized in case parsing or unparsing fails to set the field.
     val initialValue = lengthInBits match {
       case 8 => "0xCC"
       case 16 => "0xCCCC"
@@ -54,34 +48,21 @@ trait BinaryIntegerKnownLengthCodeGenerator {
       case 64 => "0xCCCCCCCCCCCCCCCC"
       case _ => e.SDE("Lengths other than 8, 16, 32, or 64 bits are not supported.")
     }
-    val initStatement = s"    instance->$fieldName = $initialValue;"
+    val fieldName = e.namedQName.local
+    val integer = if (g.signed) s"int${lengthInBits}" else s"uint${lengthInBits}"
     val conv = if (byteOrder eq ByteOrder.BigEndian) "be" else "le"
-    val parseStatement =
-      s"""    if (!error_msg)
-         |    {
-         |        char   buffer[sizeof(uint${lengthInBits}_t)];
-         |        size_t count = fread(&buffer, 1, sizeof(buffer), pstate->stream);
-         |        if (count < sizeof(buffer))
-         |        {
-         |            error_msg = eof_or_error_msg(pstate->stream);
-         |        }
-         |        instance->$fieldName = ${conv}${lengthInBits}toh(*((uint${lengthInBits}_t *)(&buffer)));
-         |    }""".stripMargin
-    val unparseStatement =
-      s"""    if (!error_msg)
-         |    {
-         |        union
-         |        {
-         |            char     c_val[sizeof(uint${lengthInBits}_t)];
-         |            uint${lengthInBits}_t i_val;
-         |        } buffer;
-         |        buffer.i_val = hto${conv}${lengthInBits}(instance->$fieldName);
-         |        size_t count = fwrite(buffer.c_val, 1, sizeof(buffer), ustate->stream);
-         |        if (count < sizeof(buffer))
-         |        {
-         |            error_msg = eof_or_error_msg(ustate->stream);
-         |        }
-         |    }""".stripMargin
-    cgState.addSimpleTypeStatements(initStatement, parseStatement, unparseStatement)
+    val arraySize = if (e.occursCountKind == OccursCountKind.Fixed) e.maxOccurs else 0
+
+    def addSimpleTypeStatements(deref: String): Unit = {
+      val initStatement = s"    instance->$fieldName$deref = $initialValue;"
+      val parseStatement = s"    parse_${conv}_$integer(&instance->$fieldName$deref, pstate);"
+      val unparseStatement = s"    unparse_${conv}_$integer(instance->$fieldName$deref, ustate);"
+      cgState.addSimpleTypeStatements(initStatement, parseStatement, unparseStatement)
+    }
+    if (arraySize > 0)
+      for (i <- 0 until arraySize)
+        addSimpleTypeStatements(s"[$i]")
+    else
+      addSimpleTypeStatements("")
   }
 }
diff --git a/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/generators/CodeGeneratorState.scala b/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/generators/CodeGeneratorState.scala
index f629f14..a1db02c 100644
--- a/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/generators/CodeGeneratorState.scala
+++ b/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/generators/CodeGeneratorState.scala
@@ -20,7 +20,10 @@ package org.apache.daffodil.runtime2.generators
 import org.apache.daffodil.dpath.NodeInfo
 import org.apache.daffodil.dpath.NodeInfo.PrimType
 import org.apache.daffodil.dsom.ElementBase
+import org.apache.daffodil.dsom.GlobalElementDecl
+import org.apache.daffodil.dsom.SchemaComponent
 import org.apache.daffodil.exceptions.ThrowsSDE
+import org.apache.daffodil.schema.annotation.props.gen.OccursCountKind
 
 import scala.collection.mutable
 
@@ -34,15 +37,35 @@ class CodeGeneratorState {
   private val finalStructs = mutable.ArrayBuffer[String]()
   private val finalImplementation = mutable.ArrayBuffer[String]()
 
+  // Builds a name for the given element that needs to be unique in C file scope
+  private def qualifiedName(context: ElementBase): String = {
+    def buildName(sc: SchemaComponent, sb: StringBuilder): StringBuilder = {
+      sc match {
+        case gd: GlobalElementDecl => sb ++= gd.namedQName.local += '_'
+        case eb: ElementBase => sb ++= eb.namedQName.local += '_'
+        case _ => // don't include other schema components in qualified name
+      }
+      sc.optLexicalParent.foreach {
+        buildName(_, sb)
+      }
+      sb
+    }
+    val sb = buildName(context, new StringBuilder)
+    sb.toString()
+  }
+
+  // Returns the given element's local name (doesn't have to be unique)
+  private def localName(context: ElementBase): String = context.namedQName.local
+
   def addImplementation(context: ElementBase): Unit = {
-    val C = context.namedQName.local
+    val C = localName(context)
     val initStatements = structs.top.initStatements.mkString("\n")
     val parserStatements = structs.top.parserStatements.mkString("\n")
     val unparserStatements = structs.top.unparserStatements.mkString("\n")
     val prototypeFunctions =
-      s"""static void        ${C}_initSelf($C *instance);
-         |static const char *${C}_parseSelf($C *instance, const PState *pstate);
-         |static const char *${C}_unparseSelf(const $C *instance, const UState *ustate);""".stripMargin
+      s"""static void ${C}_initSelf($C *instance);
+         |static void ${C}_parseSelf($C *instance, PState *pstate);
+         |static void ${C}_unparseSelf(const $C *instance, UState *ustate);""".stripMargin
     prototypes += prototypeFunctions
     val functions =
       s"""static void
@@ -51,20 +74,16 @@ class CodeGeneratorState {
          |$initStatements
          |}
          |
-         |static const char *
-         |${C}_parseSelf($C *instance, const PState *pstate)
+         |static void
+         |${C}_parseSelf($C *instance, PState *pstate)
          |{
-         |    const char *error_msg = NULL;
          |$parserStatements
-         |    return error_msg;
          |}
          |
-         |static const char *
-         |${C}_unparseSelf(const $C *instance, const UState *ustate)
+         |static void
+         |${C}_unparseSelf(const $C *instance, UState *ustate)
          |{
-         |    const char *error_msg = NULL;
          |$unparserStatements
-         |    return error_msg;
          |}
          |""".stripMargin
     finalImplementation += functions
@@ -72,7 +91,7 @@ class CodeGeneratorState {
 
   private def defineQNameInit(context: ElementBase): String = {
     val prefix = context.namedQName.prefix.map(p => s""""$p"""").getOrElse("NULL")
-    val local = context.namedQName.local
+    val local = localName(context)
     val nsUri = context.namedQName.namespace.toStringOrNullIfNoNS
     // Optimize away ns declaration if possible, although this approach may not be entirely correct
     val parentNsUri = context.enclosingElements.headOption.map(_.namedQName.namespace.toStringOrNullIfNoNS).getOrElse("no-ns")
@@ -87,13 +106,14 @@ class CodeGeneratorState {
   }
 
   def addComplexTypeERD(context: ElementBase): Unit = {
-    val C = context.namedQName.local
-    val count = structs.top.declarations.length
+    val C = localName(context)
+    val qn = qualifiedName(context)
+    val count = structs.top.offsetComputations.length
     val offsetComputations = structs.top.offsetComputations.mkString(",\n")
     val erdComputations = structs.top.erdComputations.mkString(",\n")
     val qnameInit = defineQNameInit(context)
     val complexERD =
-      s"""static const $C ${C}_compute_ERD_offsets;
+      s"""static const $C ${C}_compute_offsets;
          |
          |static const ptrdiff_t ${C}_offsets[$count] = {
          |$offsetComputations
@@ -103,7 +123,7 @@ class CodeGeneratorState {
          |$erdComputations
          |};
          |
-         |static const ERD ${C}_ERD = {
+         |static const ERD ${qn}_ERD = {
          |$qnameInit
          |    COMPLEX,                         // typeCode
          |    $count,                               // numChildren
@@ -118,7 +138,8 @@ class CodeGeneratorState {
   }
 
   def addStruct(context: ElementBase): Unit = {
-    val C = context.namedQName.local
+    val C = localName(context)
+    val qn = qualifiedName(context)
     val declarations = structs.top.declarations.mkString("\n")
     val struct =
       s"""typedef struct $C
@@ -128,7 +149,7 @@ class CodeGeneratorState {
          |} $C;
          |""".stripMargin
     finalStructs += struct
-    val initStatement = s"    instance->_base.erd = &${C}_ERD;"
+    val initStatement = s"    instance->_base.erd = &${qn}_ERD;"
     structs.top.initStatements += initStatement
   }
 
@@ -139,26 +160,18 @@ class CodeGeneratorState {
   }
 
   def addComplexTypeStatements(child: ElementBase): Unit = {
-    val C = child.namedQName.local
+    val C = localName(child)
     val e = child.name
     val initStatement = s"    ${C}_initSelf(&instance->$e);"
-    val parseStatement =
-      s"""    if (!error_msg)
-         |    {
-         |        error_msg = ${C}_parseSelf(&instance->$e, pstate);
-         |    }""".stripMargin
-    val unparseStatement =
-      s"""    if (!error_msg)
-         |    {
-         |        error_msg = ${C}_unparseSelf(&instance->$e, ustate);
-         |    }""".stripMargin
+    val parseStatement = s"    ${C}_parseSelf(&instance->$e, pstate);"
+    val unparseStatement = s"    ${C}_unparseSelf(&instance->$e, ustate);"
     structs.top.initStatements += initStatement
     structs.top.parserStatements += parseStatement
     structs.top.unparserStatements += unparseStatement
   }
 
   def pushComplexElement(context: ElementBase): Unit = {
-    val C = context.namedQName.local
+    val C = localName(context)
     structs.push(new ComplexCGState(C))
   }
 
@@ -167,7 +180,7 @@ class CodeGeneratorState {
   }
 
   def addSimpleTypeERD(context: ElementBase): Unit = {
-    val e = context.namedQName.local
+    val qn = qualifiedName(context)
     val qnameInit = defineQNameInit(context)
     val typeCode = context.optPrimType.get match {
       case PrimType.UnsignedLong => "PRIMITIVE_UINT64"
@@ -178,10 +191,12 @@ class CodeGeneratorState {
       case PrimType.Int => "PRIMITIVE_INT32"
       case PrimType.Short => "PRIMITIVE_INT16"
       case PrimType.Byte => "PRIMITIVE_INT8"
+      case PrimType.Float => "PRIMITIVE_FLOAT"
+      case PrimType.Double => "PRIMITIVE_DOUBLE"
       case p: PrimType => context.SDE("PrimType %s not supported yet.", p.toString)
     }
     val erd =
-      s"""static const ERD ${e}_ERD = {
+      s"""static const ERD ${qn}_ERD = {
          |$qnameInit
          |    $typeCode, // typeCode
          |    0,               // numChildren
@@ -198,11 +213,20 @@ class CodeGeneratorState {
 
   def addComputations(child: ElementBase): Unit = {
     val C = structs.top.C
-    val e = child.namedQName.local
-    val offsetComputation = s"    (char *)&${C}_compute_ERD_offsets.$e - (char *)&${C}_compute_ERD_offsets"
-    val erdComputation = s"    &${e}_ERD"
-    structs.top.offsetComputations += offsetComputation
-    structs.top.erdComputations += erdComputation
+    val e = localName(child)
+    val qn = qualifiedName(child)
+    val arraySize = if (child.occursCountKind == OccursCountKind.Fixed) child.maxOccurs else 0
+    def addComputation(deref: String): Unit = {
+      val offsetComputation = s"    (const char *)&${C}_compute_offsets.$e$deref - (const char *)&${C}_compute_offsets"
+      val erdComputation = s"    &${qn}_ERD"
+      structs.top.offsetComputations += offsetComputation
+      structs.top.erdComputations += erdComputation
+    }
+    if (arraySize > 0)
+      for (i <- 0 until arraySize)
+        addComputation(s"[$i]")
+    else
+      addComputation("")
   }
 
   def addFieldDeclaration(context: ThrowsSDE, child: ElementBase): Unit = {
@@ -217,12 +241,16 @@ class CodeGeneratorState {
         case PrimType.Int => "int32_t    "
         case PrimType.Short => "int16_t    "
         case PrimType.Byte => "int8_t     "
+        case PrimType.Float => "float      "
+        case PrimType.Double => "double     "
         case x => context.SDE("Unsupported primitive type: " + x)
       }
     } else {
-      child.namedQName.local + "         "
+      localName(child)
     }
-    structs.top.declarations += s"    $definition ${child.name};"
+    val e = child.name
+    val arrayDef = if (child.occursCountKind == OccursCountKind.Fixed) s"[${child.maxOccurs}]" else ""
+    structs.top.declarations += s"    $definition $e$arrayDef;"
   }
 
   def generateCodeHeader: String = {
@@ -231,8 +259,8 @@ class CodeGeneratorState {
       s"""#ifndef GENERATED_CODE_H
          |#define GENERATED_CODE_H
          |
-         |#include "infoset.h" // for InfosetBase
-         |#include <stdint.h>  // for int32_t
+         |#include "infoset.h"  // for InfosetBase
+         |#include <stdint.h>   // for int16_t, int32_t, int64_t, int8_t, uint16_t, uint32_t, uint64_t, uint8_t
 
          |// Define some infoset structures
          |
@@ -247,10 +275,11 @@ class CodeGeneratorState {
     val erds = this.erds.mkString("\n")
     val finalImplementation = this.finalImplementation.mkString("\n")
     val code =
-      s"""#include "generated_code.h" // for generated code structs
-         |#include <endian.h>         // for be32toh, htobe32, etc.
-         |#include <stddef.h>         // for ptrdiff_t
-         |#include <stdio.h>          // for NULL, fread, fwrite, size_t, FILE
+      s"""#include "generated_code.h"
+         |#include "parsers.h"    // for parse_be_double, parse_be_float, parse_be_int16, parse_be_int32, parse_be_int64, parse_be_int8, parse_be_uint16, parse_be_uint32, parse_be_uint64, parse_be_uint8, parse_le_double, parse_le_float, parse_le_int16, parse_le_int32, parse_le_int64, parse_le_int8, parse_le_uint16, parse_le_uint32, parse_le_uint64, parse_le_uint8
+         |#include "unparsers.h"  // for unparse_be_double, unparse_be_float, unparse_be_int16, unparse_be_int32, unparse_be_int64, unparse_be_int8, unparse_be_uint16, unparse_be_uint32, unparse_be_uint64, unparse_be_uint8, unparse_le_double, unparse_le_float, unparse_le_int16, unparse_le_int32, unparse_le_int64, unparse_le_int8, unparse_le_uint16, unparse_le_uint32, unparse_le_uint64, unparse_le_uint8
+         |#include <math.h>       // for NAN
+         |#include <stddef.h>     // for NULL, ptrdiff_t
          |
          |// Prototypes needed for compilation
          |
@@ -261,23 +290,15 @@ class CodeGeneratorState {
          |$erds
          |// Return a root element to be used for parsing or unparsing
          |
-         |InfosetBase *
-         |rootElement()
+         |extern InfosetBase *
+         |rootElement(void)
          |{
-         |    static $rootElementName    instance;
+         |    static $rootElementName instance;
          |    InfosetBase *root = &instance._base;
-         |    ${rootElementName}_ERD.initSelf(root);
+         |    ${rootElementName}__ERD.initSelf(root);
          |    return root;
          |}
          |
-         |// Degenerate cases of endian-conversion functions called by code
-         |// generator since <endian.h> handles only 16, 32, and 64-bit cases
-         |
-         |static inline uint8_t htobe8(uint8_t h8b) { return h8b; }
-         |static inline uint8_t htole8(uint8_t h8b) { return h8b; }
-         |static inline uint8_t be8toh(uint8_t be8b) { return be8b; }
-         |static inline uint8_t le8toh(uint8_t le8b) { return le8b; }
-         |
          |// Methods to initialize, parse, and unparse infoset nodes
          |
          |$finalImplementation
diff --git a/daffodil-runtime2/src/main/scala/org/apache/daffodil/tdml/processor/runtime2/Runtime2TDMLDFDLProcessor.scala b/daffodil-runtime2/src/main/scala/org/apache/daffodil/tdml/processor/runtime2/Runtime2TDMLDFDLProcessor.scala
index 97e2e4b..a18698f 100644
--- a/daffodil-runtime2/src/main/scala/org/apache/daffodil/tdml/processor/runtime2/Runtime2TDMLDFDLProcessor.scala
+++ b/daffodil-runtime2/src/main/scala/org/apache/daffodil/tdml/processor/runtime2/Runtime2TDMLDFDLProcessor.scala
@@ -17,7 +17,6 @@
 
 package org.apache.daffodil.tdml.processor.runtime2
 
-import dev.dirs.ProjectDirectories
 import org.apache.daffodil.api._
 import org.apache.daffodil.compiler.Compiler
 import org.apache.daffodil.externalvars.Binding
@@ -107,20 +106,20 @@ final class TDMLDFDLProcessorFactory private(
       // Create a CodeGenerator from the DFDL schema for the C language
       val generator = pf.forLanguage("c")
 
-      // Generate the C source code in our cache directory
+      // Generate the C source code in a temporary unique directory
       val rootNS = QName.refQNameFromExtendedSyntax(optRootName.getOrElse("")).toOption
-      val directories = ProjectDirectories.from("org", "Apache Software Foundation", "Daffodil")
-      val outputDir = generator.generateCode(rootNS, directories.cacheDir)
+      val tempDir = os.temp.dir()
+      val codeDir = generator.generateCode(rootNS, tempDir.toString)
 
       // Compile the generated code into an executable
-      val executable = generator.compileCode(outputDir)
+      val executable = generator.compileCode(codeDir)
 
       // Summarize the result of compiling the schema for the test
       val compileResult = if (generator.isError) {
         Left(generator.getDiagnostics) // C code compilation diagnostics
       } else {
         // Create a processor for running the test using the executable
-        val processor = new Runtime2TDMLDFDLProcessor(executable)
+        val processor = new Runtime2TDMLDFDLProcessor(tempDir, executable)
         Right((generator.getDiagnostics, processor))
       }
       compileResult
@@ -136,7 +135,7 @@ final class TDMLDFDLProcessorFactory private(
  * XML Infosets, feeding to the unparser, creating XML from the result created by the
  * [[Runtime2DataProcessor]]. All the "real work" is done by [[Runtime2DataProcessor]].
  */
-class Runtime2TDMLDFDLProcessor(executable: os.Path) extends TDMLDFDLProcessor {
+class Runtime2TDMLDFDLProcessor(tempDir: os.Path, executable: os.Path) extends TDMLDFDLProcessor {
 
   override type R = Runtime2TDMLDFDLProcessor
 
@@ -178,7 +177,7 @@ class Runtime2TDMLDFDLProcessor(executable: os.Path) extends TDMLDFDLProcessor {
     val pr = dataProcessor.parse(is)
     anyErrors = pr.isError
     diagnostics = pr.getDiagnostics
-    new Runtime2TDMLParseResult(pr)
+    new Runtime2TDMLParseResult(pr, tempDir)
   }
 
   // Run the C code, collect and save the unparsed data with any errors and
@@ -187,13 +186,12 @@ class Runtime2TDMLDFDLProcessor(executable: os.Path) extends TDMLDFDLProcessor {
   // the unparsed data on its standard output, and write any error messages
   // on its standard output (all done in [[Runtime2DataProcessor.unparse]]).
   override def unparse(infosetXML: scala.xml.Node, outStream: java.io.OutputStream): TDMLUnparseResult = {
-    val tempDir = null
-    val tempInputFile = XMLUtils.convertNodeToTempFile(infosetXML, tempDir)
+    val tempInputFile = XMLUtils.convertNodeToTempFile(infosetXML, tempDir.toIO)
     val inStream = os.read.inputStream(os.Path(tempInputFile))
     val upr = dataProcessor.unparse(inStream, outStream)
     anyErrors = upr.isError
     diagnostics = upr.getDiagnostics
-    new Runtime2TDMLUnparseResult(upr)
+    new Runtime2TDMLUnparseResult(upr, tempDir)
   }
 
   def unparse(parseResult: TDMLParseResult, outStream: java.io.OutputStream): TDMLUnparseResult = {
@@ -201,7 +199,7 @@ class Runtime2TDMLDFDLProcessor(executable: os.Path) extends TDMLDFDLProcessor {
   }
 }
 
-final class Runtime2TDMLParseResult(pr: ParseResult) extends TDMLParseResult {
+final class Runtime2TDMLParseResult(pr: ParseResult, tempDir: os.Path) extends TDMLParseResult {
   override def addDiagnostic(failure: Diagnostic): Unit = pr.addDiagnostic(failure)
 
   override def getResult: Node = pr.infosetAsXML
@@ -213,9 +211,11 @@ final class Runtime2TDMLParseResult(pr: ParseResult) extends TDMLParseResult {
   override def isProcessingError: Boolean = pr.isProcessingError
 
   override def getDiagnostics: Seq[Diagnostic] = pr.getDiagnostics
+
+  override def cleanUp(): Unit = os.remove.all(tempDir)
 }
 
-final class Runtime2TDMLUnparseResult(upr: UnparseResult) extends TDMLUnparseResult {
+final class Runtime2TDMLUnparseResult(upr: UnparseResult, tempDir: os.Path) extends TDMLUnparseResult {
   override def bitPos0b: Long = upr.finalBitPos0b
 
   override def finalBitPos0b: Long = upr.finalBitPos0b
@@ -229,4 +229,6 @@ final class Runtime2TDMLUnparseResult(upr: UnparseResult) extends TDMLUnparseRes
   override def isProcessingError: Boolean = upr.isProcessingError
 
   override def getDiagnostics: Seq[Diagnostic] = upr.getDiagnostics
+
+  override def cleanUp(): Unit = os.remove.all(tempDir)
 }
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/TestRuntime2.dfdl.xsd b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/TestRuntime2.dfdl.xsd
index 5998338..06355f0 100644
--- a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/TestRuntime2.dfdl.xsd
+++ b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/TestRuntime2.dfdl.xsd
@@ -19,10 +19,9 @@
 <xs:schema
     elementFormDefault="qualified"
     targetNamespace="http://example.com"
+    xmlns="http://example.com"
     xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
-    xmlns:ex="http://example.com"
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns="http://example.com">
+    xmlns:xs="http://www.w3.org/2001/XMLSchema">
 
     <xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
 
@@ -31,67 +30,56 @@
             <dfdl:format
                 byteOrder="bigEndian"
                 encoding="UTF-8"
-                lengthUnits="bits"
                 representation="binary"
                 ref="GeneralFormat"/>
         </xs:appinfo>
     </xs:annotation>
 
-    <xs:element name="ex_ints">
+    <xs:element name="ex_nums">
         <xs:complexType>
             <xs:sequence>
-                <xs:element name="be_uint64" type="xs:unsignedLong" />
-                <xs:element name="be_uint32" type="xs:unsignedInt" />
-                <xs:element name="be_uint16" type="xs:unsignedShort" />
-                <xs:element name="be_uint8" type="xs:unsignedByte" />
-                <xs:element name="be_int64" type="xs:long" />
-                <xs:element name="be_int32" type="xs:int" />
-                <xs:element name="be_int16" type="xs:short" />
-                <xs:element name="be_int8" type="xs:byte" />
-                <xs:element name="le_uint64" type="xs:unsignedLong" dfdl:byteOrder="littleEndian" />
-                <xs:element name="le_uint32" type="xs:unsignedInt" dfdl:byteOrder="littleEndian" />
-                <xs:element name="le_uint16" type="xs:unsignedShort" dfdl:byteOrder="littleEndian" />
-                <xs:element name="le_uint8" type="xs:unsignedByte" dfdl:byteOrder="littleEndian" />
-                <xs:element name="le_int64" type="xs:long" dfdl:byteOrder="littleEndian" />
-                <xs:element name="le_int32" type="xs:int" dfdl:byteOrder="littleEndian" />
-                <xs:element name="le_int16" type="xs:short" dfdl:byteOrder="littleEndian" />
-                <xs:element name="le_int8" type="xs:byte" dfdl:byteOrder="littleEndian" />
-            </xs:sequence>
-        </xs:complexType>
-    </xs:element>
-
-    <xs:simpleType
-        name="int16"
-        dfdl:length="16"
-        dfdl:lengthKind="explicit">
-        <xs:restriction base="xs:short"/>
-    </xs:simpleType>
-    <xs:simpleType
-        name="uint8"
-        dfdl:length="8"
-        dfdl:lengthKind="explicit">
-        <xs:restriction base="xs:unsignedByte"/>
-    </xs:simpleType>
-    <xs:simpleType
-        name="uint16"
-        dfdl:length="16"
-        dfdl:lengthKind="explicit">
-        <xs:restriction base="xs:unsignedShort"/>
-    </xs:simpleType>
-
-    <xs:element name="orion_command">
-        <xs:complexType>
-            <xs:sequence>
-                <xs:element name="sync0" type="uint8" fixed="208"/>
-                <xs:element name="sync1" type="uint8" fixed="13"/>
-                <xs:element name="id" type="uint8" fixed="1"/>
-                <xs:element name="length" type="uint8" fixed="7"/>
-                <xs:element name="pan" type="int16"/>
-                <xs:element name="tilt" type="int16"/>
-                <xs:element name="mode" type="uint8" fixed="80"/>
-                <xs:element name="stabilized" type="uint8" fixed="0"/>
-                <xs:element name="impulse" type="uint8" fixed="0"/>
-                <xs:element name="checksum" type="uint16"/>
+                <xs:element name="array">
+                    <xs:complexType>
+                        <xs:sequence>
+                            <xs:element name="be_int16" type="xs:short"
+                                        minOccurs="3" maxOccurs="3" dfdl:occursCountKind="fixed" />
+                            <xs:element name="be_float" type="xs:float"
+                                        minOccurs="3" maxOccurs="3" dfdl:occursCountKind="fixed" />
+                        </xs:sequence>
+                    </xs:complexType>
+                </xs:element>
+                <xs:element name="bigEndian">
+                  <xs:complexType>
+                    <xs:sequence>
+                      <xs:element name="be_double" type="xs:double" />
+                      <xs:element name="be_float" type="xs:float" />
+                      <xs:element name="be_uint64" type="xs:unsignedLong" />
+                      <xs:element name="be_uint32" type="xs:unsignedInt" />
+                      <xs:element name="be_uint16" type="xs:unsignedShort" />
+                      <xs:element name="be_uint8" type="xs:unsignedByte" />
+                      <xs:element name="be_int64" type="xs:long" />
+                      <xs:element name="be_int32" type="xs:int" />
+                      <xs:element name="be_int16" type="xs:short" />
+                      <xs:element name="be_int8" type="xs:byte" />
+                    </xs:sequence>
+                  </xs:complexType>
+                </xs:element>
+                <xs:element name="littleEndian">
+                  <xs:complexType>
+                    <xs:sequence>
+                      <xs:element name="le_uint64" type="xs:unsignedLong" dfdl:byteOrder="littleEndian" />
+                      <xs:element name="le_uint32" type="xs:unsignedInt" dfdl:byteOrder="littleEndian" />
+                      <xs:element name="le_uint16" type="xs:unsignedShort" dfdl:byteOrder="littleEndian" />
+                      <xs:element name="le_uint8" type="xs:unsignedByte" dfdl:byteOrder="littleEndian" />
+                      <xs:element name="le_int64" type="xs:long" dfdl:byteOrder="littleEndian" />
+                      <xs:element name="le_int32" type="xs:int" dfdl:byteOrder="littleEndian" />
+                      <xs:element name="le_int16" type="xs:short" dfdl:byteOrder="littleEndian" />
+                      <xs:element name="le_int8" type="xs:byte" dfdl:byteOrder="littleEndian" />
+                      <xs:element name="le_float" type="xs:float" dfdl:byteOrder="littleEndian" />
+                      <xs:element name="le_double" type="xs:double" dfdl:byteOrder="littleEndian" />
+                    </xs:sequence>
+                  </xs:complexType>
+                </xs:element>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/TestRuntime2.tdml b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/TestRuntime2.tdml
index 3db679c..09021a3 100644
--- a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/TestRuntime2.tdml
+++ b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/TestRuntime2.tdml
@@ -1,31 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements.  See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License.  You may obtain a copy of the License at
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
 
-http://www.apache.org/licenses/LICENSE-2.0
+      http://www.apache.org/licenses/LICENSE-2.0
 
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
 -->
 
 <tdml:testSuite
-  defaultConfig="config-runtime2"
   defaultImplementations="daffodil daffodil-runtime2"
   defaultRoundTrip="onePass"
-  description="TDML tests for runtime2"
-  suiteName="TestRuntime2"
+  description="TDML tests for daffodil-runtime2"
   xmlns:daf="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext"
   xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
-  xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData"
-  xmlns="http://example.com">
+  xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData">
 
   <tdml:defineConfig name="config-runtime1">
     <daf:tunables>
@@ -40,54 +37,58 @@ limitations under the License.
   </tdml:defineConfig>
 
   <tdml:parserTestCase
-    description="Parse example ex_ints"
+    config="config-runtime1"
+    description="ex_nums parse test with runtime1"
     model="TestRuntime2.dfdl.xsd"
-    name="ex_ints_parse"
-    root="ex_ints">
+    name="ex_nums_parse1"
+    root="ex_nums">
     <tdml:document>
-      <tdml:documentPart type="file">ex_ints_parse.dat</tdml:documentPart>
+      <tdml:documentPart type="file">ex_nums_parse.dat</tdml:documentPart>
     </tdml:document>
     <tdml:infoset>
-      <tdml:dfdlInfoset type="file">ex_ints_unparse.xml</tdml:dfdlInfoset>
+      <tdml:dfdlInfoset type="file">ex_nums_unparse1.xml</tdml:dfdlInfoset>
     </tdml:infoset>
   </tdml:parserTestCase>
 
   <tdml:unparserTestCase
-    description="Unparse example ex_ints"
+    config="config-runtime1"
+    description="ex_nums unparse test with runtime1"
     model="TestRuntime2.dfdl.xsd"
-    name="ex_ints_unparse"
-    root="ex_ints">
+    name="ex_nums_unparse1"
+    root="ex_nums">
     <tdml:infoset>
-      <tdml:dfdlInfoset type="file">ex_ints_unparse.xml</tdml:dfdlInfoset>
+      <tdml:dfdlInfoset type="file">ex_nums_unparse1.xml</tdml:dfdlInfoset>
     </tdml:infoset>
     <tdml:document>
-      <tdml:documentPart type="file">ex_ints_parse.dat</tdml:documentPart>
+      <tdml:documentPart type="file">ex_nums_parse.dat</tdml:documentPart>
     </tdml:document>
   </tdml:unparserTestCase>
 
   <tdml:parserTestCase
-    description="Parse example orion_command"
+    config="config-runtime2"
+    description="ex_nums parse test with runtime2"
     model="TestRuntime2.dfdl.xsd"
-    name="orion_command_parse"
-    root="orion_command">
+    name="ex_nums_parse2"
+    root="ex_nums">
     <tdml:document>
-      <tdml:documentPart type="file">orion_command_parse.dat</tdml:documentPart>
+      <tdml:documentPart type="file">ex_nums_parse.dat</tdml:documentPart>
     </tdml:document>
     <tdml:infoset>
-      <tdml:dfdlInfoset type="file">orion_command_unparse.xml</tdml:dfdlInfoset>
+      <tdml:dfdlInfoset type="file">ex_nums_unparse2.xml</tdml:dfdlInfoset>
     </tdml:infoset>
   </tdml:parserTestCase>
 
   <tdml:unparserTestCase
-    description="Unparse example orion_command"
+    config="config-runtime2"
+    description="ex_nums unparse test with runtime2"
     model="TestRuntime2.dfdl.xsd"
-    name="orion_command_unparse"
-    root="orion_command">
+    name="ex_nums_unparse2"
+    root="ex_nums">
     <tdml:infoset>
-      <tdml:dfdlInfoset type="file">orion_command_unparse.xml</tdml:dfdlInfoset>
+      <tdml:dfdlInfoset type="file">ex_nums_unparse2.xml</tdml:dfdlInfoset>
     </tdml:infoset>
     <tdml:document>
-      <tdml:documentPart type="file">orion_command_parse.dat</tdml:documentPart>
+      <tdml:documentPart type="file">ex_nums_parse.dat</tdml:documentPart>
     </tdml:document>
   </tdml:unparserTestCase>
 
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/command_parse.dat b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/command_parse.dat
new file mode 100644
index 0000000..3995cb0
Binary files /dev/null and b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/command_parse.dat differ
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion_command_unparse.xml b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/command_unparse.xml
similarity index 90%
rename from daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion_command_unparse.xml
rename to daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/command_unparse.xml
index 8cda886..9a1d4a1 100644
--- a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion_command_unparse.xml
+++ b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/command_unparse.xml
@@ -16,15 +16,15 @@
   limitations under the License.
 -->
 
-<orion_command xmlns="http://example.com">
+<idl:Command xmlns:idl="urn:idl:1.0">
   <sync0>208</sync0>
-  <sync1>12</sync1>
+  <sync1>13</sync1>
   <id>1</id>
   <length>7</length>
   <pan>-999</pan>
-  <tilt>-21231</tilt>
+  <tilt>-1231</tilt>
   <mode>80</mode>
   <stabilized>0</stabilized>
   <impulse>0</impulse>
   <checksum>30149</checksum>
-</orion_command>
+</idl:Command>
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_ints_parse.dat b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_ints_parse.dat
deleted file mode 100644
index e16cc72..0000000
Binary files a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_ints_parse.dat and /dev/null differ
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums_parse.dat b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums_parse.dat
new file mode 100644
index 0000000..7df03f3
Binary files /dev/null and b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums_parse.dat differ
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums_unparse1.xml b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums_unparse1.xml
new file mode 100644
index 0000000..d30a688
--- /dev/null
+++ b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums_unparse1.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<ex_nums xmlns="http://example.com">
+  <array>
+    <be_int16>1</be_int16>
+    <be_int16>2</be_int16>
+    <be_int16>3</be_int16>
+    <be_float>1.0</be_float>
+    <be_float>INF</be_float>
+    <be_float>NaN</be_float>
+  </array>
+  <bigEndian>
+    <be_double>1.7976931348623157E308</be_double>
+    <be_float>3.4028235E38</be_float>
+    <be_uint64>64</be_uint64>
+    <be_uint32>32</be_uint32>
+    <be_uint16>16</be_uint16>
+    <be_uint8>8</be_uint8>
+    <be_int64>-64</be_int64>
+    <be_int32>-32</be_int32>
+    <be_int16>-16</be_int16>
+    <be_int8>-8</be_int8>
+  </bigEndian>
+  <littleEndian>
+    <le_uint64>64</le_uint64>
+    <le_uint32>32</le_uint32>
+    <le_uint16>16</le_uint16>
+    <le_uint8>8</le_uint8>
+    <le_int64>-64</le_int64>
+    <le_int32>-32</le_int32>
+    <le_int16>-16</le_int16>
+    <le_int8>-8</le_int8>
+    <le_float>-1.17549435E-38</le_float>
+    <le_double>-2.2250738585072014E-308</le_double>
+  </littleEndian>
+</ex_nums>
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums_unparse2.xml b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums_unparse2.xml
new file mode 100644
index 0000000..f45a9fc
--- /dev/null
+++ b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums_unparse2.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<ex_nums xmlns="http://example.com">
+  <array>
+    <be_int16>1</be_int16>
+    <be_int16>2</be_int16>
+    <be_int16>3</be_int16>
+    <be_float>1</be_float>
+    <be_float>INF</be_float>
+    <be_float>NaN</be_float>
+  </array>
+  <bigEndian>
+    <be_double>1.7976931348623157E+308</be_double>
+    <be_float>3.40282347E+38</be_float>
+    <be_uint64>64</be_uint64>
+    <be_uint32>32</be_uint32>
+    <be_uint16>16</be_uint16>
+    <be_uint8>8</be_uint8>
+    <be_int64>-64</be_int64>
+    <be_int32>-32</be_int32>
+    <be_int16>-16</be_int16>
+    <be_int8>-8</be_int8>
+  </bigEndian>
+  <littleEndian>
+    <le_uint64>64</le_uint64>
+    <le_uint32>32</le_uint32>
+    <le_uint16>16</le_uint16>
+    <le_uint8>8</le_uint8>
+    <le_int64>-64</le_int64>
+    <le_int32>-32</le_int32>
+    <le_int16>-16</le_int16>
+    <le_int8>-8</le_int8>
+    <le_float>-1.17549435E-38</le_float>
+    <le_double>-2.2250738585072014E-308</le_double>
+  </littleEndian>
+</ex_nums>
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion-command.dfdl.xsd b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion-command.dfdl.xsd
new file mode 100644
index 0000000..8b37108
--- /dev/null
+++ b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion-command.dfdl.xsd
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:idl="urn:idl:1.0" targetNamespace="urn:idl:1.0">
+  <xs:annotation>
+    <xs:appinfo source="http://www.ogf.org/dfdl/">
+      <dfdl:defineFormat name="defaults">
+        <dfdl:format alignment="8" alignmentUnits="bits" binaryBooleanFalseRep="0" binaryBooleanTrueRep="1" binaryFloatRep="ieee" binaryNumberCheckPolicy="lax" binaryNumberRep="binary" bitOrder="mostSignificantBitFirst" byteOrder="bigEndian" choiceLengthKind="implicit" encoding="utf-8" encodingErrorPolicy="replace" escapeSchemeRef="" fillByte="%#r20;" floating="no" ignoreCase="no" initiatedContent="no" initiator="" leadingSkip="0" lengthKind="implicit" lengthUnits="bits" occursCountKind= [...]
+      </dfdl:defineFormat>
+      <dfdl:format ref="idl:defaults"/>
+    </xs:appinfo>
+  </xs:annotation>
+  <xs:simpleType name="int8" dfdl:length="8" dfdl:lengthKind="explicit">
+    <xs:restriction base="xs:byte"/>
+  </xs:simpleType>
+  <xs:simpleType name="int16" dfdl:length="16" dfdl:lengthKind="explicit">
+    <xs:restriction base="xs:short"/>
+  </xs:simpleType>
+  <xs:simpleType name="uint8" dfdl:length="8" dfdl:lengthKind="explicit">
+    <xs:restriction base="xs:unsignedByte"/>
+  </xs:simpleType>
+  <xs:simpleType name="uint16" dfdl:length="16" dfdl:lengthKind="explicit">
+    <xs:restriction base="xs:unsignedShort"/>
+  </xs:simpleType>
+  <xs:simpleType name="uint32" dfdl:length="32" dfdl:lengthKind="explicit">
+    <xs:restriction base="xs:unsignedInt"/>
+  </xs:simpleType>
+  <xs:element name="Command">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="sync0" fixed="208" type="idl:uint8"/>
+        <xs:element name="sync1" fixed="13" type="idl:uint8"/>
+        <xs:element name="id" fixed="1" type="idl:uint8"/>
+        <xs:element name="length" fixed="7" type="idl:uint8"/>
+        <xs:element name="pan" type="idl:int16"/>
+        <xs:element name="tilt">
+          <xs:simpleType>
+            <xs:restriction base="idl:int16">
+              <xs:minInclusive value="-1396"/>
+              <xs:maxInclusive value="733"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+        <xs:element name="mode" fixed="80" type="idl:uint8"/>
+        <xs:element name="stabilized" fixed="0" type="idl:uint8"/>
+        <xs:element name="impulse" fixed="0" type="idl:uint8"/>
+        <xs:element name="checksum" type="idl:uint16"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="CameraState">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="sync0" fixed="208" type="idl:uint8"/>
+        <xs:element name="sync1" fixed="13" type="idl:uint8"/>
+        <xs:element name="id" fixed="97" type="idl:uint8"/>
+        <xs:element name="length" fixed="5" type="idl:uint8"/>
+        <xs:element name="zoom" type="idl:int16"/>
+        <xs:element name="focus" type="idl:int16"/>
+        <xs:element name="index" fixed="0" type="idl:uint8"/>
+        <xs:element name="checksum" type="idl:uint16"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="VideoSettings">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="sync0" fixed="208" type="idl:uint8"/>
+        <xs:element name="sync1" fixed="13" type="idl:uint8"/>
+        <xs:element name="id" fixed="98" type="idl:uint8"/>
+        <xs:element name="length" fixed="14" type="idl:uint8"/>
+        <xs:element name="destIp">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="item" minOccurs="4" maxOccurs="4" dfdl:occursCountKind="fixed" type="idl:uint8"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="port" type="idl:uint16"/>
+        <xs:element name="bitrate" fixed="0" type="idl:uint32"/>
+        <xs:element name="ttl" fixed="0" type="idl:int8"/>
+        <xs:element name="streamType" fixed="0" type="idl:uint8"/>
+        <xs:element name="mjpegQuality" fixed="0" type="idl:uint8"/>
+        <xs:element name="saveSettingsAndTsPacketCount" fixed="0" type="idl:uint8"/>
+        <xs:element name="checksum" type="idl:uint16"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion-command.tdml b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion-command.tdml
new file mode 100644
index 0000000..110322d
--- /dev/null
+++ b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion-command.tdml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<tdml:testSuite
+  defaultConfig="config-runtime2"
+  defaultImplementations="daffodil daffodil-runtime2"
+  defaultRoundTrip="onePass"
+  description="TDML tests for orion-command"
+  xmlns:daf="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext"
+  xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
+  xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData">
+
+  <tdml:defineConfig name="config-runtime1">
+    <daf:tunables>
+      <daf:tdmlImplementation>daffodil</daf:tdmlImplementation>
+    </daf:tunables>
+  </tdml:defineConfig>
+
+  <tdml:defineConfig name="config-runtime2">
+    <daf:tunables>
+      <daf:tdmlImplementation>daffodil-runtime2</daf:tdmlImplementation>
+    </daf:tunables>
+  </tdml:defineConfig>
+
+  <tdml:parserTestCase
+    description="orion-command Command parse test"
+    model="orion-command.dfdl.xsd"
+    name="command_parse"
+    root="Command">
+    <tdml:document>
+      <tdml:documentPart type="file">command_parse.dat</tdml:documentPart>
+    </tdml:document>
+    <tdml:infoset>
+      <tdml:dfdlInfoset type="file">command_unparse.xml</tdml:dfdlInfoset>
+    </tdml:infoset>
+  </tdml:parserTestCase>
+
+  <tdml:unparserTestCase
+    description="orion-command Command unparse test"
+    model="orion-command.dfdl.xsd"
+    name="command_unparse"
+    root="Command">
+    <tdml:infoset>
+      <tdml:dfdlInfoset type="file">command_unparse.xml</tdml:dfdlInfoset>
+    </tdml:infoset>
+    <tdml:document>
+      <tdml:documentPart type="file">command_parse.dat</tdml:documentPart>
+    </tdml:document>
+  </tdml:unparserTestCase>
+
+  <tdml:parserTestCase
+    description="orion-command VideoSettings parse test"
+    model="orion-command.dfdl.xsd"
+    name="video_settings_parse"
+    root="VideoSettings">
+    <tdml:document>
+      <tdml:documentPart type="file">video_settings_parse.dat</tdml:documentPart>
+    </tdml:document>
+    <tdml:infoset>
+      <tdml:dfdlInfoset type="file">video_settings_unparse.xml</tdml:dfdlInfoset>
+    </tdml:infoset>
+  </tdml:parserTestCase>
+
+  <tdml:unparserTestCase
+    description="orion-command VideoSettings unparse test"
+    model="orion-command.dfdl.xsd"
+    name="video_settings_unparse"
+    root="VideoSettings">
+    <tdml:infoset>
+      <tdml:dfdlInfoset type="file">video_settings_unparse.xml</tdml:dfdlInfoset>
+    </tdml:infoset>
+    <tdml:document>
+      <tdml:documentPart type="file">video_settings_parse.dat</tdml:documentPart>
+    </tdml:document>
+  </tdml:unparserTestCase>
+
+</tdml:testSuite>
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion_command_parse.dat b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion_command_parse.dat
deleted file mode 100644
index 4484b44..0000000
Binary files a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion_command_parse.dat and /dev/null differ
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/video_settings_parse.dat b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/video_settings_parse.dat
new file mode 100644
index 0000000..4605ef8
Binary files /dev/null and b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/video_settings_parse.dat differ
diff --git a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_ints_unparse.xml b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/video_settings_unparse.xml
similarity index 63%
rename from daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_ints_unparse.xml
rename to daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/video_settings_unparse.xml
index 8874561..0307283 100644
--- a/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_ints_unparse.xml
+++ b/daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/video_settings_unparse.xml
@@ -16,21 +16,22 @@
   limitations under the License.
 -->
 
-<ex_ints xmlns="http://example.com">
-  <be_uint64>64</be_uint64>
-  <be_uint32>32</be_uint32>
-  <be_uint16>16</be_uint16>
-  <be_uint8>8</be_uint8>
-  <be_int64>-64</be_int64>
-  <be_int32>-32</be_int32>
-  <be_int16>-16</be_int16>
-  <be_int8>-8</be_int8>
-  <le_uint64>64</le_uint64>
-  <le_uint32>32</le_uint32>
-  <le_uint16>16</le_uint16>
-  <le_uint8>8</le_uint8>
-  <le_int64>-64</le_int64>
-  <le_int32>-32</le_int32>
-  <le_int16>-16</le_int16>
-  <le_int8>-8</le_int8>
-</ex_ints>
+<idl:VideoSettings xmlns:idl="urn:idl:1.0">
+  <sync0>208</sync0>
+  <sync1>13</sync1>
+  <id>98</id>
+  <length>14</length>
+  <destIp>
+    <item>1</item>
+    <item>2</item>
+    <item>3</item>
+    <item>4</item>
+  </destIp>
+  <port>8080</port>
+  <bitrate>0</bitrate>
+  <ttl>0</ttl>
+  <streamType>0</streamType>
+  <mjpegQuality>0</mjpegQuality>
+  <saveSettingsAndTsPacketCount>0</saveSettingsAndTsPacketCount>
+  <checksum>3073</checksum>
+</idl:VideoSettings>
diff --git a/daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestCodeGenerator.scala b/daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestCodeGenerator.scala
index f64d6b9..3069efa 100644
--- a/daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestCodeGenerator.scala
+++ b/daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestCodeGenerator.scala
@@ -39,15 +39,15 @@ import org.junit.Test
  * as you could want.
  */
 class TestCodeGenerator {
-  // Ensure all tests remove outputDir after using it
-  var outputDir: os.Path = _
+  // Ensure all tests remove tempDir after using it
+  var tempDir: os.Path = _
 
   @Before def before(): Unit = {
-    outputDir = os.temp.dir()
+    tempDir = os.temp.dir()
   }
 
   @After def after(): Unit = {
-    os.remove.all(outputDir)
+    os.remove.all(tempDir)
   }
 
   // Define a simple DFDL test schema for debugging our code path
@@ -90,20 +90,20 @@ class TestCodeGenerator {
     val cg = pf.forLanguage("c")
 
     // Generate code from the test schema successfully
-    val outputDir = cg.generateCode(None, s"${this.outputDir}")
+    val codeDir = cg.generateCode(None, tempDir.toString)
     assert(!cg.isError, cg.getDiagnostics.map(_.getMessage()).mkString("\n"))
-    assert(os.exists(outputDir))
-    assert(os.exists(outputDir/"c"/"libruntime"/"generated_code.c"))
+    assert(os.exists(codeDir))
+    assert(os.exists(codeDir/"libruntime"/"generated_code.c"))
   }
 
   @Test def test_compileCode_success(): Unit = {
     // Create a CodeGenerator and generate code from the test schema
     val pf = Compiler().compileNode(testSchema)
     val cg = pf.forLanguage("c")
-    val outputDir = cg.generateCode(None, s"${this.outputDir}")
+    val codeDir = cg.generateCode(None, tempDir.toString)
 
     // Compile the generated code into an executable successfully
-    val executable = cg.compileCode(outputDir)
+    val executable = cg.compileCode(codeDir)
     assert(!cg.isError, cg.getDiagnostics.map(_.getMessage()).mkString("\n"))
     assert(os.exists(executable))
   }
@@ -112,8 +112,8 @@ class TestCodeGenerator {
     // Compile the test schema into a C executable
     val pf = Compiler().compileNode(testSchema)
     val cg = pf.forLanguage("c")
-    val outputDir = cg.generateCode(None, s"${this.outputDir}")
-    val executable = cg.compileCode(outputDir)
+    val codeDir = cg.generateCode(None, tempDir.toString)
+    val executable = cg.compileCode(codeDir)
 
     // Create a Runtime2DataProcessor and parse a binary int32 number successfully
     val dp = new Runtime2DataProcessor(executable)
@@ -129,8 +129,8 @@ class TestCodeGenerator {
     // Compile the test schema into a C executable
     val pf = Compiler().compileNode(testSchema)
     val cg = pf.forLanguage("c")
-    val outputDir = cg.generateCode(None, s"${this.outputDir}")
-    val executable = cg.compileCode(outputDir)
+    val codeDir = cg.generateCode(None, tempDir.toString)
+    val executable = cg.compileCode(codeDir)
 
     // Create a Runtime2DataProcessor and unparse a binary int32 number successfully
     val dp = new Runtime2DataProcessor(executable)
diff --git a/daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestRuntime2.scala b/daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestOrionCommand.scala
similarity index 68%
copy from daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestRuntime2.scala
copy to daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestOrionCommand.scala
index 88d7e12..939d9ca 100644
--- a/daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestRuntime2.scala
+++ b/daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestOrionCommand.scala
@@ -21,18 +21,18 @@ import org.junit.Test
 import org.apache.daffodil.tdml.Runner
 import org.junit.AfterClass
 
-object TestRuntime2 {
+object TestOrionCommand {
   val testDir = "/org/apache/daffodil/runtime2/"
-  val runner = Runner(testDir, "TestRuntime2.tdml")
+  val runner = Runner(testDir, "orion-command.tdml")
 
   @AfterClass def shutDown(): Unit = { runner.reset }
 }
 
-class TestRuntime2 {
-  import TestRuntime2._
+class TestOrionCommand {
+  import TestOrionCommand._
 
-  @Test def test_ex_ints_parse(): Unit = { runner.runOneTest("ex_ints_parse") }
-  @Test def test_ex_ints_unparse(): Unit = { runner.runOneTest("ex_ints_unparse") }
-  @Test def test_orion_command_parse(): Unit = { runner.runOneTest("orion_command_parse") }
-  @Test def test_orion_command_unparse(): Unit = { runner.runOneTest("orion_command_unparse") }
+  @Test def test_command_parse(): Unit = { runner.runOneTest("command_parse") }
+  @Test def test_command_unparse(): Unit = { runner.runOneTest("command_unparse") }
+  @Test def test_video_settings_parse(): Unit = { runner.runOneTest("video_settings_parse") }
+  @Test def test_video_settings_unparse(): Unit = { runner.runOneTest("video_settings_unparse") }
 }
diff --git a/daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestRuntime2.scala b/daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestRuntime2.scala
index 88d7e12..719acae 100644
--- a/daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestRuntime2.scala
+++ b/daffodil-runtime2/src/test/scala/org/apache/daffodil/runtime2/TestRuntime2.scala
@@ -31,8 +31,8 @@ object TestRuntime2 {
 class TestRuntime2 {
   import TestRuntime2._
 
-  @Test def test_ex_ints_parse(): Unit = { runner.runOneTest("ex_ints_parse") }
-  @Test def test_ex_ints_unparse(): Unit = { runner.runOneTest("ex_ints_unparse") }
-  @Test def test_orion_command_parse(): Unit = { runner.runOneTest("orion_command_parse") }
-  @Test def test_orion_command_unparse(): Unit = { runner.runOneTest("orion_command_unparse") }
+  @Test def test_ex_nums_parse1(): Unit = { runner.runOneTest("ex_nums_parse1") }
+  @Test def test_ex_nums_unparse1(): Unit = { runner.runOneTest("ex_nums_unparse1") }
+  @Test def test_ex_nums_parse2(): Unit = { runner.runOneTest("ex_nums_parse2") }
+  @Test def test_ex_nums_unparse2(): Unit = { runner.runOneTest("ex_nums_unparse2") }
 }
diff --git a/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala b/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala
index a337045..f11cd27 100644
--- a/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala
+++ b/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala
@@ -28,7 +28,6 @@ import java.nio.CharBuffer
 import java.nio.LongBuffer
 import java.nio.charset.CoderResult
 import java.nio.charset.{Charset => JavaCharset}
-import java.nio.file.Files
 
 import scala.language.postfixOps
 import scala.util.Try
@@ -900,9 +899,7 @@ case class ParserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
 
         // we should never need blobs if we're expecting an error even if we
         // don't get errors. So clean them up immediately
-        actual.getBlobPaths.foreach { blobPath =>
-          Files.delete(blobPath)
-        }
+        actual.cleanUp()
 
         val isErr: Boolean =
           if (actual.isProcessingError) true
@@ -1155,9 +1152,7 @@ case class ParserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
         // Done with the first parse result, safe to clean up blobs if there
         // was success. This won't get called on failure, which is fine--leave
         // blobs around for debugging
-        firstParseResult.getBlobPaths.foreach { blobPath =>
-          Files.delete(blobPath)
-        }
+        firstParseResult.cleanUp()
       }
       case OnePassRoundTrip => {
         val outStream = new java.io.ByteArrayOutputStream()
@@ -1172,9 +1167,7 @@ case class ParserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
         // Done with the first parse result, safe to clean up blobs if there
         // was success. This won't get called on failure, which is fine--leave
         // blobs around for debugging
-        firstParseResult.getBlobPaths.foreach { blobPath =>
-          Files.delete(blobPath)
-        }
+        firstParseResult.cleanUp()
       }
       case TwoPassRoundTrip => {
         //
@@ -1199,12 +1192,8 @@ case class ParserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
         // Done with the first and second parse resultrs, safe to clean up
         // blobs if there was success. This won't get called on failure, which
         // is fine--leave blobs around for debugging
-        firstParseResult.getBlobPaths.foreach { blobPath =>
-          Files.delete(blobPath)
-        }
-        actual.getBlobPaths.foreach { blobPath =>
-          Files.delete(blobPath)
-        }
+        firstParseResult.cleanUp()
+        actual.cleanUp()
       }
       case ThreePassRoundTrip => {
         //
@@ -1248,12 +1237,8 @@ case class ParserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
         // Done with the first parse result and second parse results. Safe to
         // clean up blobs if there was success. Leave them around for debugging
         // if there was a failure
-        firstParseResult.getBlobPaths.foreach { blobPath =>
-          Files.delete(blobPath)
-        }
-        secondParseResult.getBlobPaths.foreach { blobPath =>
-          Files.delete(blobPath)
-        }
+        firstParseResult.cleanUp()
+        secondParseResult.cleanUp()
       }
     }
 
@@ -1409,11 +1394,12 @@ case class UnparserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
       // Done with the parse results, safe to clean up blobs if there was
       // success. This won't get called on failure, which is fine--leave blobs
       // around for debugging
-      parseActual.getBlobPaths.foreach { blobPath =>
-        Files.delete(blobPath)
-      }
-
+      parseActual.cleanUp()
     }
+
+    // Done with the unparse results, safe to clean up any temporary files
+    // if they were not already cleaned up by parseActual.cleanUp() above
+    actual.cleanUp()
   }
 
   def runUnparserExpectErrors(
@@ -1477,6 +1463,10 @@ case class UnparserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
             }
           }
         }
+
+        // Done with the unparse results, safe to clean up any temporary files
+        actual.cleanUp()
+
         processor.getDiagnostics ++ actual.getDiagnostics ++ dataErrors
       }
     }
diff --git a/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/processor/TDMLDFDLProcessor.scala b/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/processor/TDMLDFDLProcessor.scala
index 48fa414..f8a7769 100644
--- a/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/processor/TDMLDFDLProcessor.scala
+++ b/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/processor/TDMLDFDLProcessor.scala
@@ -124,7 +124,10 @@ trait TDMLResult {
   def isValidationError: Boolean
   def isProcessingError: Boolean
   def getDiagnostics: Seq[Diagnostic]
-
+  /**
+   * Deletes any temporary files that have been generated
+   */
+  def cleanUp(): Unit
 }
 
 trait TDMLParseResult extends TDMLResult {
diff --git a/daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/DaffodilTDMLDFDLProcessor.scala b/daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/DaffodilTDMLDFDLProcessor.scala
index 523b8c0..fc9141b 100644
--- a/daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/DaffodilTDMLDFDLProcessor.scala
+++ b/daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/DaffodilTDMLDFDLProcessor.scala
@@ -21,6 +21,7 @@ import java.io.ByteArrayInputStream
 import java.io.ByteArrayOutputStream
 import java.io.OutputStreamWriter
 import java.nio.channels.Channels
+import java.nio.file.Files
 import java.nio.file.Path
 import java.nio.file.Paths
 
@@ -433,6 +434,8 @@ final class DaffodilTDMLParseResult(actual: DFDL.ParseResult, outputter: TDMLInf
   override def currentLocation: DataLocation = actual.resultState.currentLocation
 
   override def addDiagnostic(diag: Diagnostic): Unit = actual.addDiagnostic(diag)
+
+  override def cleanUp(): Unit = getBlobPaths.foreach { Files.delete }
 }
 
 final class DaffodilTDMLUnparseResult(actual: DFDL.UnparseResult, outStream: java.io.OutputStream) extends TDMLUnparseResult {
@@ -452,6 +455,8 @@ final class DaffodilTDMLUnparseResult(actual: DFDL.UnparseResult, outStream: jav
   override def getDiagnostics: Seq[Diagnostic] = actual.getDiagnostics
 
   override def bitPos0b: Long = ustate.bitPos0b
+
+  override def cleanUp(): Unit = { /* do nothing */ }
 }
 
 class DaffodilTDMLSAXErrorHandler extends ErrorHandler with WithDiagnostics {
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index 61bb2bc..e879778 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -31,7 +31,6 @@ object Dependencies {
     "jline" % "jline" % "2.14.6",
     "com.typesafe" % "config" % "1.4.1",
     "com.lihaoyi" %% "os-lib" % "0.7.1", // for generating C source files
-    "dev.dirs" % "directories" % "21" // for caching compiled C files
   )
 
   lazy val infoset = Seq(
diff --git a/project/Rat.scala b/project/Rat.scala
index 803027b..2b646d2 100644
--- a/project/Rat.scala
+++ b/project/Rat.scala
@@ -107,8 +107,9 @@ object Rat {
     file("daffodil-japi/src/test/resources/test/japi/myData16.dat"),
     file("daffodil-japi/src/test/resources/test/japi/myData19.dat"),
     file("daffodil-japi/src/test/resources/test/japi/myDataBroken.dat"),
-    file("daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_ints_parse.dat"),
-    file("daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/orion_command_parse.dat"),
+    file("daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/command_parse.dat"),
+    file("daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums_parse.dat"),
+    file("daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/video_settings_parse.dat"),
     file("daffodil-sapi/src/test/resources/test/sapi/01very_simple.txt"),
     file("daffodil-sapi/src/test/resources/test/sapi/myData.dat"),
     file("daffodil-sapi/src/test/resources/test/sapi/myData2.dat"),