tuxji opened a new pull request #466: URL: https://github.com/apache/incubator-daffodil/pull/466
Add another example schema to runtime2 tests and make C code generator able to handle more integer types. Starting to run into alignment issues currently causing different behavior between runtime1 and runtime2 and will need to handle these issues later. In xml_reader.c, rename xmlInt32Elem to xmlIntegerElem and expand it to read 8, 16, 32, and 64-bit signed/unsigned integer numbers from XML elements. Have not tested all cases yet. In xml_writer.c, rename xmlInt32Elem to xmlIntegerElem and expand it to write 8, 16, 32, and 64-bit signed/unsigned integers as XML element values. Have not tested all cases yet. In infoset.c, expand walkInfosetNode to call visitIntegerElem method for 8, 16, 32, and 64-bit signed/unsigned integer type codes. In infoset.h, rename VisitInt32Elem type to VisitIntegerElem and visitInteger32Elem field to visitIntegerElem. Add 8, 16, 32, and 64-bit signed/unsigned integer type codes to TypeCode. In ex_int32.c, update to reflect changes to generated code actually generated from ex_int32 root element in TestRuntime2.tdml. In ex_int32.h, update to reflect changes to generated code actually generated from ex_int32 root element in TestRuntime2.tdml. In Runtime2DataProcessor.scala, make parse and unparse methods remove temporary directories after using them and make ParseResult convert output file to XML immediately instead of waiting until called later since output file will no longer be around. In BinaryIntegerKnownLengthCodeGenerator.scala, remove some restrictions from when code generator could handle only 32-bit signed integers. Modify generated code more flexible and capable of handling different integer lengths. In CodeGeneratorState.scala, expand CodeGeneratorState to handle 8, 16, 32, and 64-bit signed/unsigned integers. Modify generated code to define dummy be8toh and htobe8 functions since <endian.h> doesn't define any endian byte-swapping functions for 8-bit integers. In ElementParseAndUnspecifiedLengthCodeGenerator.scala, allow alignment fills to precede elements in order to allow code to be generated, although we still need to generate some extra code to adjust for alignment fills later. In TestRuntime2.dfdl.xsd, expand test schema to add another schema example coming from somewhere else (an orion_command element using 8-bit and 16-bit signed/unsigned integers). This element has inadvertently required an alignment fill of 1 byte before the checksum field that probably should be removed, but we may need to generate code to handle alignment fills anyway. In TestRuntime2.tdml, rename parse_int32 & unparse_int32 tests to ex_int32_parse & ex_int32_unparse and add two new tests orion_command_parse & orion_command_unparse. Specify explicit root elements for every test since we have multiple root elements now. Rename parse_int32 & unparse_int32 data files to ex_int32_parse & ex_int32_unparse. Generated code doesn't expect XML elements to have an ex prefix anymore (need to check why) so remove ex prefixes from ex_int32_unparse elements. Add orion_command_parse && orion_command_unparse data files for new tests. In TestRuntime2.scala, call ex_int32 & orion_command tests. In Rat.scala, exclude renamed & new binary data files from checks. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
