From 741bfb659caaa771c748d03df26792fab10e5778 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Sep 2023 10:43:31 +0200 Subject: Add XSD and C++ compiler command lines to example READMEs --- xsd-examples/cxx/parser/performance/README | 44 ++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 8 deletions(-) (limited to 'xsd-examples/cxx/parser/performance') diff --git a/xsd-examples/cxx/parser/performance/README b/xsd-examples/cxx/parser/performance/README index 46137d0..eda0b16 100644 --- a/xsd-examples/cxx/parser/performance/README +++ b/xsd-examples/cxx/parser/performance/README @@ -13,6 +13,16 @@ test-50k.xml gen.cxx Program to generate a test document of desired size. + To compile and link this program we can use the following commands (replace + 'c++' with your C++ compiler name): + + c++ -c gen.cxx + c++ -o gen gen.o + + To generate the test document execute, for example: + + ./gen 633 test-100k.xml + time.hxx time.cxx Class definition that represents time. @@ -20,7 +30,14 @@ time.cxx test-pskel.hxx test-pskel.ixx test-pskel.cxx - Parser skeletons generated by the XSD compiler from test.xsd. + Parser skeletons generated by the XSD compiler from test.xsd using the + following command line: + + xsd cxx-parser --skel-file-suffix=-xerces-pskel test.xsd + + Or if using Expat instead of Xerces-C++ as the underlying XML parser: + + xsd cxx-parser --xml-parser=expat --skel-file-suffix=-expat-pskel test.xsd driver.cxx Driver for the example. It first parses the command line arguments @@ -30,17 +47,28 @@ driver.cxx measurement loop which on each iteration parses the XML document from the in-memory buffer. -To run the example on a test XML document simply execute: +To compile and link the example manually from the command line we can use +the following commands (replace 'c++' with your C++ compiler name): -$ ./driver test-50k.xml +c++ -c test-xerces-pskel.cxx +c++ -c time.cxx +c++ -DXERCES_PARSER -c driver.cxx +c++ -o driver driver.o time.o test-xerces-pskel.o -lxerces-c + +Or if using Expat as the underlying XML parser: + +c++ -c test-expat-pskel.cxx +c++ -c time.cxx +c++ -c driver.cxx +c++ -o driver driver.o time.o test-expat-pskel.o -lexpat + +To run the example on a test XML document execute: + +./driver test-50k.xml The -v option can be used to turn on validation in the underlying XML parser (only makes sense for Xerces-C++, off by default). The -i option can be used to specify the number of parsing iterations (1000 by default). For example: -$ ./driver -v -i 100 test-50k.xml - -To generate the test document execute, for example: - -$ ./gen 633 test-100k.xml +./driver -v -i 100 test-50k.xml -- cgit v1.1