diff options
Diffstat (limited to 'dist/examples/cxx/parser')
20 files changed, 1039 insertions, 0 deletions
diff --git a/dist/examples/cxx/parser/generated/makefile b/dist/examples/cxx/parser/generated/makefile new file mode 100644 index 0000000..6e5e960 --- /dev/null +++ b/dist/examples/cxx/parser/generated/makefile @@ -0,0 +1,69 @@ +root := ../../../.. + +include $(root)/build/cxx/rules.make + +# Build. +# +EXTRA_CPPFLAGS += -I$(root)/libxsde + +EXTRA_XSDFLAGS := --generate-print-impl --generate-test-driver + +# If you are basing your own code on this example and make changes +# to the sample implementation and/or test driver, make sure you +# remove this option or your changes will be lost forever. +# +EXTRA_XSDFLAGS += --force-overwrite + +ifeq ($(XSDE_STL),n) +EXTRA_XSDFLAGS += --no-stl +endif + +ifeq ($(XSDE_IOSTREAM),n) +EXTRA_XSDFLAGS += --no-iostream +endif + +ifeq ($(XSDE_EXCEPTIONS),n) +EXTRA_XSDFLAGS += --no-exceptions +endif + +ifeq ($(XSDE_LONGLONG),n) +EXTRA_XSDFLAGS += --no-long-long +endif + +ifeq ($(XSDE_PARSER_VALIDATION),n) +EXTRA_XSDFLAGS += --suppress-validation +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +EXTRA_XSDFLAGS += --reuse-style-mixin +endif + +ifeq ($(XSDE_POLYMORPHIC),y) +EXTRA_XSDFLAGS += --runtime-polymorphic +endif + +library-pdriver: library-pdriver.o library-pskel.o library-pimpl.o $(root)/libxsde/xsde/libxsde.a + +library-pdriver.o: library-pdriver.cxx library-pimpl.hxx library-pskel.hxx +library-pimpl.o: library-pimpl.cxx library-pimpl.hxx library-pskel.hxx +library-pskel.o: library-pskel.cxx library-pskel.hxx + +.PRECIOUS: %-pskel.hxx %-pskel.cxx %-pimpl.hxx %-pimpl.cxx %-pdriver.cxx + +%-pskel.hxx %-pskel.cxx %-pimpl.hxx %-pimpl.cxx %-pdriver.cxx: %.xsd + $(root)/bin/xsde cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) $< + + +# Test. +# +.PHONY: test +test: library-pdriver library.xml + ./library-pdriver library.xml + + +# Clean. +# +.PHONY: clean +clean: + rm -f library-pdriver.?xx library-pimpl.?xx library-pskel.?xx + rm -f library-pdriver.o library-pimpl.o library-pskel.o library-pdriver diff --git a/dist/examples/cxx/parser/generated/nmakefile b/dist/examples/cxx/parser/generated/nmakefile new file mode 100644 index 0000000..ee4597e --- /dev/null +++ b/dist/examples/cxx/parser/generated/nmakefile @@ -0,0 +1,68 @@ +root = ..\..\..\.. + +!include $(root)\build\cxx\rules.nmake + +# Build. +# +EXTRA_CPPFLAGS = /I$(root)\libxsde + +EXTRA_XSDFLAGS = --generate-print-impl --generate-test-driver + +# If you are basing your own code on this example and make changes +# to the sample implementation and/or test driver, make sure you +# remove this option or your changes will be lost forever. +# +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --force-overwrite + +!if "$(XSDE_STL)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-stl +!endif + +!if "$(XSDE_IOSTREAM)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-iostream +!endif + +!if "$(XSDE_EXCEPTIONS)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-exceptions +!endif + +!if "$(XSDE_LONGLONG)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long +!endif + +!if "$(XSDE_PARSER_VALIDATION)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-validation +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --reuse-style-mixin +!endif + +!if "$(XSDE_POLYMORPHIC)" == "y" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --runtime-polymorphic +!endif + +library-pdriver.exe: library-pdriver.obj library-pskel.obj library-pimpl.obj $(root)\libxsde\xsde\xsde.lib + +library-pdriver.obj: library-pdriver.cxx library-pimpl.hxx library-pskel.hxx +library-pimpl.obj: library-pimpl.cxx library-pimpl.hxx library-pskel.hxx +library-pskel.obj: library-pskel.cxx library-pskel.hxx + + +library-pskel.hxx library-pskel.cxx \ +library-pimpl.hxx library-pimpl.cxx \ +library-pdriver.cxx: library.xsd + $(root)\bin\xsde.exe cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) library.xsd + + +# Test. +# +test: library-pdriver.exe library.xml + .\library-pdriver.exe library.xml + + +# Clean. +# +clean: + -del library-pdriver.?xx library-pimpl.?xx library-pskel.?xx + -del library-pdriver.obj library-pimpl.obj library-pskel.obj library-pdriver.exe diff --git a/dist/examples/cxx/parser/hello/makefile b/dist/examples/cxx/parser/hello/makefile new file mode 100644 index 0000000..d31ecff --- /dev/null +++ b/dist/examples/cxx/parser/hello/makefile @@ -0,0 +1,50 @@ +root := ../../../.. + +include $(root)/build/cxx/rules.make + +# Build. +# +EXTRA_CPPFLAGS := -I$(root)/libxsde + +ifeq ($(XSDE_LONGLONG),n) +EXTRA_XSDFLAGS += --no-long-long +endif + +ifeq ($(XSDE_PARSER_VALIDATION),n) +EXTRA_XSDFLAGS += --suppress-validation +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +EXTRA_XSDFLAGS += --reuse-style-mixin +endif + +ifeq ($(XSDE_REUSE_STYLE),none) +EXTRA_XSDFLAGS += --reuse-style-none +endif + +ifeq ($(XSDE_POLYMORPHIC),y) +EXTRA_XSDFLAGS += --runtime-polymorphic +endif + +driver: driver.o hello-pskel.o $(root)/libxsde/xsde/libxsde.a + +driver.o: driver.cxx hello-pskel.hxx +hello-pskel.o: hello-pskel.cxx hello-pskel.hxx + +.PRECIOUS: %-pskel.hxx %-pskel.cxx +%-pskel.hxx %-pskel.cxx: %.xsd + $(root)/bin/xsde cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) $< + +# Test. +# +.PHONY: test +test: driver hello.xml + ./driver hello.xml + + +# Clean. +# +.PHONY: clean +clean: + rm -f hello-pskel.?xx hello-pskel.o driver.o driver + diff --git a/dist/examples/cxx/parser/hello/nmakefile b/dist/examples/cxx/parser/hello/nmakefile new file mode 100644 index 0000000..e8b6ccf --- /dev/null +++ b/dist/examples/cxx/parser/hello/nmakefile @@ -0,0 +1,47 @@ +root = ..\..\..\.. + +!include $(root)\build\cxx\rules.nmake + +# Build. +# +EXTRA_CPPFLAGS = /I$(root)\libxsde + +!if "$(XSDE_LONGLONG)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long +!endif + +!if "$(XSDE_PARSER_VALIDATION)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-validation +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --reuse-style-mixin +!endif + +!if "$(XSDE_REUSE_STYLE)" == "none" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --reuse-style-none +!endif + +!if "$(XSDE_POLYMORPHIC)" == "y" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --runtime-polymorphic +!endif + +driver.exe: driver.obj hello-pskel.obj $(root)\libxsde\xsde\xsde.lib + +driver.obj: driver.cxx hello-pskel.hxx +hello-pskel.obj: hello-pskel.cxx hello-pskel.hxx + +hello-pskel.cxx hello-pskel.hxx: hello.xsd + $(root)\bin\xsde.exe cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) hello.xsd + +# Test. +# +test: driver.exe hello.xml + .\driver.exe hello.xml + + +# Clean. +# +clean: + -del hello-pskel.?xx hello-pskel.obj driver.obj driver.exe + diff --git a/dist/examples/cxx/parser/library/makefile b/dist/examples/cxx/parser/library/makefile new file mode 100644 index 0000000..a0ed792 --- /dev/null +++ b/dist/examples/cxx/parser/library/makefile @@ -0,0 +1,55 @@ +root := ../../../.. + +include $(root)/build/cxx/rules.make + +# Build. +# +EXTRA_CPPFLAGS += -I$(root)/libxsde + +ifeq ($(XSDE_LONGLONG),n) +EXTRA_XSDFLAGS += --no-long-long +endif + +ifeq ($(XSDE_PARSER_VALIDATION),n) +EXTRA_XSDFLAGS += --suppress-validation +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +EXTRA_XSDFLAGS += --reuse-style-mixin +endif + +ifeq ($(XSDE_POLYMORPHIC),y) +EXTRA_XSDFLAGS += --runtime-polymorphic +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +impl := library-pimpl-mixin +else +impl := library-pimpl-tiein +endif + +driver: driver.o library-pskel.o $(impl).o $(root)/libxsde/xsde/libxsde.a + +driver.o: driver.cxx $(impl).hxx library-pskel.hxx library.hxx +$(impl).o: $(impl).cxx $(impl).hxx library-pskel.hxx library.hxx +library-pskel.o: library-pskel.cxx library-pskel.hxx library.hxx + +.PRECIOUS: %-pskel.hxx %-pskel.cxx + +%-pskel.hxx %-pskel.cxx: %.xsd %.map + $(root)/bin/xsde cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--type-map $*.map $< + + +# Test. +# +.PHONY: test +test: driver library.xml + ./driver library.xml + + +# Clean. +# +.PHONY: clean +clean: + rm -f library-pskel.?xx $(impl).o library-pskel.o driver.o driver diff --git a/dist/examples/cxx/parser/library/nmakefile b/dist/examples/cxx/parser/library/nmakefile new file mode 100644 index 0000000..42d2a71 --- /dev/null +++ b/dist/examples/cxx/parser/library/nmakefile @@ -0,0 +1,53 @@ +root = ..\..\..\.. + +!include $(root)\build\cxx\rules.nmake + +# Build. +# +EXTRA_CPPFLAGS = /I$(root)\libxsde + +!if "$(XSDE_LONGLONG)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long +!endif + +!if "$(XSDE_PARSER_VALIDATION)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-validation +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --reuse-style-mixin +!endif + +!if "$(XSDE_POLYMORPHIC)" == "y" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --runtime-polymorphic +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +impl = library-pimpl-mixin +!else +impl = library-pimpl-tiein +!endif + +driver.exe: driver.obj library-pskel.obj $(impl).obj $(root)\libxsde\xsde\xsde.lib + +driver.obj: driver.cxx $(impl).hxx library-pskel.hxx library.hxx +$(impl).obj: $(impl).cxx $(impl).hxx library-pskel.hxx library.hxx +library-pskel.obj: library-pskel.cxx library-pskel.hxx library.hxx + + +library-pskel.hxx library-pskel.cxx: library.xsd library.map + $(root)\bin\xsde.exe cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--type-map library.map library.xsd + + +# Test. +# +test: driver.exe library.xml + .\driver.exe library.xml + + +# Clean. +# +clean: + -del library-pskel.?xx $(impl).obj library-pskel.obj driver.obj driver.exe + diff --git a/dist/examples/cxx/parser/makefile b/dist/examples/cxx/parser/makefile new file mode 100644 index 0000000..c286089 --- /dev/null +++ b/dist/examples/cxx/parser/makefile @@ -0,0 +1,53 @@ +root := ../../.. + +include $(root)/build/config.make + +dirs := + +ifneq ($(XSDE_REUSE_STYLE),none) +dirs += generated +endif + +ifeq ($(XSDE_STL),y) +ifeq ($(XSDE_IOSTREAM),y) +ifeq ($(XSDE_EXCEPTIONS),y) + +dirs += hello + +ifneq ($(XSDE_REUSE_STYLE),none) +dirs += library multiroot + +ifeq ($(XSDE_POLYMORPHIC),y) +dirs += polymorphism polyroot +endif + +endif + +ifeq ($(XSDE_REUSE_STYLE),tiein) +dirs += mixed wildcard +endif + +endif +endif +endif + +ifeq ($(XSDE_STL),n) +ifeq ($(XSDE_EXCEPTIONS),n) +ifneq ($(XSDE_REUSE_STYLE),none) +dirs += minimal +endif +endif +endif + + +.PHONY: all $(dirs) + +all: $(dirs) + +$(dirs): + @$(MAKE) -C $@ $(MAKECMDGOALS) + +makefile: ; +%.make:: ; + +%:: $(dirs) ; diff --git a/dist/examples/cxx/parser/minimal/makefile b/dist/examples/cxx/parser/minimal/makefile new file mode 100644 index 0000000..bf1ac74 --- /dev/null +++ b/dist/examples/cxx/parser/minimal/makefile @@ -0,0 +1,60 @@ +root := ../../../.. + +include $(root)/build/cxx/rules.make + +# Build. +# +EXTRA_CPPFLAGS += -I$(root)/libxsde + +EXTRA_XSDFLAGS := --no-stl --no-exceptions + +ifeq ($(XSDE_IOSTREAM),n) +EXTRA_XSDFLAGS += --no-iostream +endif + +ifeq ($(XSDE_LONGLONG),n) +EXTRA_XSDFLAGS += --no-long-long +endif + +ifeq ($(XSDE_PARSER_VALIDATION),n) +EXTRA_XSDFLAGS += --suppress-validation +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +EXTRA_XSDFLAGS += --reuse-style-mixin +endif + +ifeq ($(XSDE_POLYMORPHIC),y) +EXTRA_XSDFLAGS += --runtime-polymorphic +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +impl := people-pimpl-mixin +else +impl := people-pimpl-tiein +endif + +driver: driver.o people-pskel.o $(root)/libxsde/xsde/libxsde.a + +driver.o: driver.cxx $(impl).hxx people-pskel.hxx gender.hxx +people-pskel.o: people-pskel.cxx people-pskel.hxx gender.hxx + +.PRECIOUS: %-pskel.hxx %-pskel.cxx + +%-pskel.hxx %-pskel.cxx: %.xsd %.map + $(root)/bin/xsde cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--type-map $*.map $< + +# Test. +# +.PHONY: test +test: driver people.xml + ./driver people.xml + + +# Clean. +# +.PHONY: clean +clean: + rm -f people-pskel.?xx people-pskel.o driver.o driver + diff --git a/dist/examples/cxx/parser/minimal/nmakefile b/dist/examples/cxx/parser/minimal/nmakefile new file mode 100644 index 0000000..4230425 --- /dev/null +++ b/dist/examples/cxx/parser/minimal/nmakefile @@ -0,0 +1,56 @@ +root = ..\..\..\.. + +!include $(root)\build\cxx\rules.nmake + +# Build. +# +EXTRA_CPPFLAGS = /I$(root)\libxsde + +EXTRA_XSDFLAGS = --no-stl --no-exceptions + +!if "$(XSDE_IOSTREAM)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-iostream +!endif + +!if "$(XSDE_LONGLONG)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long +!endif + +!if "$(XSDE_PARSER_VALIDATION)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-validation +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --reuse-style-mixin +!endif + +!if "$(XSDE_POLYMORPHIC)" == "y" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --runtime-polymorphic +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +impl = people-pimpl-mixin +!else +impl = people-pimpl-tiein +!endif + +driver.exe: driver.obj people-pskel.obj $(root)\libxsde\xsde\xsde.lib + +driver.obj: driver.cxx $(impl).hxx people-pskel.hxx gender.hxx +people-pskel.obj: people-pskel.cxx people-pskel.hxx gender.hxx + +people-pskel.cxx people-pskel.hxx: people.xsd people.map + $(root)\bin\xsde.exe cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--type-map people.map people.xsd + +# Test. +# +test: driver.exe people.xml + .\driver.exe people.xml + + +# Clean. +# +clean: + -del people-pskel.?xx people-pskel.obj driver.obj driver.exe + diff --git a/dist/examples/cxx/parser/mixed/makefile b/dist/examples/cxx/parser/mixed/makefile new file mode 100644 index 0000000..412edfe --- /dev/null +++ b/dist/examples/cxx/parser/mixed/makefile @@ -0,0 +1,43 @@ +root := ../../../.. + +include $(root)/build/cxx/rules.make + +# Build. +# +EXTRA_CPPFLAGS += -I$(root)/libxsde + +ifeq ($(XSDE_LONGLONG),n) +EXTRA_XSDFLAGS += --no-long-long +endif + +ifeq ($(XSDE_PARSER_VALIDATION),n) +EXTRA_XSDFLAGS += --suppress-validation +endif + +ifeq ($(XSDE_POLYMORPHIC),y) +EXTRA_XSDFLAGS += --runtime-polymorphic +endif + +driver: driver.o text-pskel.o $(root)/libxsde/xsde/libxsde.a + +driver.o: driver.cxx text-pskel.hxx anchor.hxx +text-pskel.o: text-pskel.cxx text-pskel.hxx anchor.hxx + +.PRECIOUS: %-pskel.hxx %-pskel.cxx + +%-pskel.hxx %-pskel.cxx: %.xsd %.map + $(root)/bin/xsde cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--type-map $*.map $< + +# Test. +# +.PHONY: test +test: driver text.xml + ./driver text.xml + +# Clean. +# +.PHONY: clean +clean: + rm -f text-pskel.?xx text-pskel.o driver.o driver + diff --git a/dist/examples/cxx/parser/mixed/nmakefile b/dist/examples/cxx/parser/mixed/nmakefile new file mode 100644 index 0000000..5f9ebc9 --- /dev/null +++ b/dist/examples/cxx/parser/mixed/nmakefile @@ -0,0 +1,40 @@ +root = ..\..\..\.. + +!include $(root)\build\cxx\rules.nmake + +# Build. +# +EXTRA_CPPFLAGS = /I$(root)\libxsde + +!if "$(XSDE_LONGLONG)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long +!endif + +!if "$(XSDE_PARSER_VALIDATION)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-validation +!endif + +!if "$(XSDE_POLYMORPHIC)" == "y" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --runtime-polymorphic +!endif + +driver.exe: driver.obj text-pskel.obj $(root)\libxsde\xsde\xsde.lib + +driver.obj: driver.cxx text-pskel.hxx anchor.hxx +text-pskel.obj: text-pskel.cxx text-pskel.hxx anchor.hxx + +text-pskel.hxx text-pskel.cxx: text.xsd text.map + $(root)\bin\xsde.exe cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--type-map text.map text.xsd + +# Test. +# +test: driver.exe text.xml + .\driver.exe text.xml + + +# Clean. +# +clean: + -del text-pskel.?xx text-pskel.obj driver.obj driver.exe + diff --git a/dist/examples/cxx/parser/multiroot/makefile b/dist/examples/cxx/parser/multiroot/makefile new file mode 100644 index 0000000..d4d6363 --- /dev/null +++ b/dist/examples/cxx/parser/multiroot/makefile @@ -0,0 +1,58 @@ +root := ../../../.. + +include $(root)/build/cxx/rules.make + +# Build. +# +EXTRA_CPPFLAGS += -I$(root)/libxsde + +ifeq ($(XSDE_LONGLONG),n) +EXTRA_XSDFLAGS += --no-long-long +endif + +ifeq ($(XSDE_PARSER_VALIDATION),n) +EXTRA_XSDFLAGS += --suppress-validation +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +EXTRA_XSDFLAGS += --reuse-style-mixin +endif + +ifeq ($(XSDE_POLYMORPHIC),y) +EXTRA_XSDFLAGS += --runtime-polymorphic +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +impl := protocol-pimpl-mixin +else +impl := protocol-pimpl-tiein +endif + + +driver: driver.o protocol-pskel.o $(impl).o $(root)/libxsde/xsde/libxsde.a + +driver.o: driver.cxx $(impl).hxx protocol-pskel.hxx protocol.hxx +$(impl).o: $(impl).cxx $(impl).hxx protocol-pskel.hxx protocol.hxx +protocol-pskel.o: protocol-pskel.cxx protocol-pskel.hxx protocol.hxx + +.PRECIOUS: %-pskel.hxx %-pskel.cxx + +%-pskel.hxx %-pskel.cxx: %.xsd %.map + $(root)/bin/xsde cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--type-map $*.map $< + + +# Test. +# +.PHONY: test +test: driver balance.xml withdraw.xml deposit.xml + ./driver balance.xml + ./driver withdraw.xml + ./driver deposit.xml + +# Clean. +# +.PHONY: clean +clean: + rm -f protocol-pskel.?xx $(impl).o protocol-pskel.o driver.o driver + diff --git a/dist/examples/cxx/parser/multiroot/nmakefile b/dist/examples/cxx/parser/multiroot/nmakefile new file mode 100644 index 0000000..05e6a7d --- /dev/null +++ b/dist/examples/cxx/parser/multiroot/nmakefile @@ -0,0 +1,54 @@ +root = ..\..\..\.. + +!include $(root)\build\cxx\rules.nmake + +# Build. +# +EXTRA_CPPFLAGS = /I$(root)\libxsde + +!if "$(XSDE_LONGLONG)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long +!endif + +!if "$(XSDE_PARSER_VALIDATION)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-validation +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --reuse-style-mixin +!endif + +!if "$(XSDE_POLYMORPHIC)" == "y" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --runtime-polymorphic +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +impl = protocol-pimpl-mixin +!else +impl = protocol-pimpl-tiein +!endif + + +driver.exe: driver.obj protocol-pskel.obj $(impl).obj $(root)\libxsde\xsde\xsde.lib + +driver.obj: driver.cxx $(impl).hxx protocol-pskel.hxx protocol.hxx +$(impl).obj: $(impl).cxx $(impl).hxx protocol-pskel.hxx protocol.hxx +protocol-pskel.obj: protocol-pskel.cxx protocol-pskel.hxx protocol.hxx + + +protocol-pskel.hxx protocol-pskel.cxx: protocol.xsd protocol.map + $(root)\bin\xsde.exe cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--type-map protocol.map protocol.xsd + + +# Test. +# +test: driver.exe balance.xml withdraw.xml deposit.xml + .\driver balance.xml + .\driver withdraw.xml + .\driver deposit.xml + +# Clean. +# +clean: + -del protocol-pskel.?xx $(impl).obj protocol-pskel.obj driver.obj driver.exe diff --git a/dist/examples/cxx/parser/nmakefile b/dist/examples/cxx/parser/nmakefile new file mode 100644 index 0000000..9964a64 --- /dev/null +++ b/dist/examples/cxx/parser/nmakefile @@ -0,0 +1,48 @@ +root = ..\..\.. + +!include $(root)\build\config.nmake + +dirs = + +!if "$(XSDE_REUSE_STYLE)" != "none" +dirs = $(dirs) generated +!endif + +!if "$(XSDE_STL)" == "y" +!if "$(XSDE_IOSTREAM)" == "y" +!if "$(XSDE_EXCEPTIONS)" == "y" + +dirs = $(dirs) hello + +!if "$(XSDE_REUSE_STYLE)" != "none" +dirs = $(dirs) library multiroot + +!if "$(XSDE_POLYMORPHIC)" == "y" +dirs = $(dirs) polymorphism polyroot +!endif + +!endif + +!if "$(XSDE_REUSE_STYLE)" == "tiein" +dirs = $(dirs) mixed wildcard +!endif + +!endif +!endif +!endif + +!if "$(XSDE_STL)" == "n" +!if "$(XSDE_EXCEPTIONS)" == "n" +!if "$(XSDE_REUSE_STYLE)" != "none" +dirs = $(dirs) minimal +!endif +!endif +!endif + +all: + @for %i in ( $(dirs) ) do \ +@cmd /c "cd %i & $(MAKE) /nologo /f nmakefile" + +test clean: + @for %i in ( $(dirs) ) do \ +@cmd /c "cd %i & $(MAKE) /nologo /f nmakefile $@" diff --git a/dist/examples/cxx/parser/polymorphism/makefile b/dist/examples/cxx/parser/polymorphism/makefile new file mode 100644 index 0000000..f0717a4 --- /dev/null +++ b/dist/examples/cxx/parser/polymorphism/makefile @@ -0,0 +1,51 @@ +root := ../../../.. + +include $(root)/build/cxx/rules.make + +# Build. +# +EXTRA_CPPFLAGS += -I$(root)/libxsde + +ifeq ($(XSDE_LONGLONG),n) +EXTRA_XSDFLAGS += --no-long-long +endif + +ifeq ($(XSDE_PARSER_VALIDATION),n) +EXTRA_XSDFLAGS += --suppress-validation +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +EXTRA_XSDFLAGS += --reuse-style-mixin +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +impl := supermen-pimpl-mixin +else +impl := supermen-pimpl-tiein +endif + +driver: driver.o supermen-pskel.o $(impl).o $(root)/libxsde/xsde/libxsde.a + +driver.o: driver.cxx $(impl).hxx supermen-pskel.hxx +$(impl).o: $(impl).cxx $(impl).hxx supermen-pskel.hxx +supermen-pskel.o: supermen-pskel.cxx supermen-pskel.hxx + +.PRECIOUS: %-pskel.hxx %-pskel.cxx + +%-pskel.hxx %-pskel.cxx: %.xsd + $(root)/bin/xsde cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--generate-polymorphic $< + + +# Test. +# +.PHONY: test +test: driver supermen.xml + ./driver supermen.xml + + +# Clean. +# +.PHONY: clean +clean: + rm -f supermen-pskel.?xx $(impl).o supermen-pskel.o driver.o driver diff --git a/dist/examples/cxx/parser/polymorphism/nmakefile b/dist/examples/cxx/parser/polymorphism/nmakefile new file mode 100644 index 0000000..7047eb1 --- /dev/null +++ b/dist/examples/cxx/parser/polymorphism/nmakefile @@ -0,0 +1,49 @@ +root = ..\..\..\.. + +!include $(root)\build\cxx\rules.nmake + +# Build. +# +EXTRA_CPPFLAGS = /I$(root)\libxsde + +!if "$(XSDE_LONGLONG)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long +!endif + +!if "$(XSDE_PARSER_VALIDATION)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-validation +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --reuse-style-mixin +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +impl = supermen-pimpl-mixin +!else +impl = supermen-pimpl-tiein +!endif + +driver.exe: driver.obj supermen-pskel.obj $(impl).obj $(root)\libxsde\xsde\xsde.lib + +driver.obj: driver.cxx $(impl).hxx supermen-pskel.hxx +$(impl).obj: $(impl).cxx $(impl).hxx supermen-pskel.hxx +supermen-pskel.obj: supermen-pskel.cxx supermen-pskel.hxx + + +supermen-pskel.hxx supermen-pskel.cxx: supermen.xsd + $(root)\bin\xsde.exe cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--generate-polymorphic supermen.xsd + + +# Test. +# +test: driver.exe supermen.xml + .\driver.exe supermen.xml + + +# Clean. +# +clean: + -del supermen-pskel.?xx $(impl).obj supermen-pskel.obj driver.obj driver.exe + diff --git a/dist/examples/cxx/parser/polyroot/makefile b/dist/examples/cxx/parser/polyroot/makefile new file mode 100644 index 0000000..d89e527 --- /dev/null +++ b/dist/examples/cxx/parser/polyroot/makefile @@ -0,0 +1,53 @@ +root := ../../../.. + +include $(root)/build/cxx/rules.make + +# Build. +# +EXTRA_CPPFLAGS += -I$(root)/libxsde + +ifeq ($(XSDE_LONGLONG),n) +EXTRA_XSDFLAGS += --no-long-long +endif + +ifeq ($(XSDE_PARSER_VALIDATION),n) +EXTRA_XSDFLAGS += --suppress-validation +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +EXTRA_XSDFLAGS += --reuse-style-mixin +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +impl := supermen-pimpl-mixin +else +impl := supermen-pimpl-tiein +endif + +driver: driver.o supermen-pskel.o $(impl).o $(root)/libxsde/xsde/libxsde.a + +driver.o: driver.cxx $(impl).hxx supermen-pskel.hxx +$(impl).o: $(impl).cxx $(impl).hxx supermen-pskel.hxx +supermen-pskel.o: supermen-pskel.cxx supermen-pskel.hxx + +.PRECIOUS: %-pskel.hxx %-pskel.cxx + +%-pskel.hxx %-pskel.cxx: %.xsd + $(root)/bin/xsde cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--generate-polymorphic $< + + +# Test. +# +.PHONY: test +test: driver person.xml batman.xml superman.xml + ./driver person.xml + ./driver batman.xml + ./driver superman.xml + + +# Clean. +# +.PHONY: clean +clean: + rm -f supermen-pskel.?xx $(impl).o supermen-pskel.o driver.o driver diff --git a/dist/examples/cxx/parser/polyroot/nmakefile b/dist/examples/cxx/parser/polyroot/nmakefile new file mode 100644 index 0000000..02146ad --- /dev/null +++ b/dist/examples/cxx/parser/polyroot/nmakefile @@ -0,0 +1,51 @@ +root = ..\..\..\.. + +!include $(root)\build\cxx\rules.nmake + +# Build. +# +EXTRA_CPPFLAGS = /I$(root)\libxsde + +!if "$(XSDE_LONGLONG)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long +!endif + +!if "$(XSDE_PARSER_VALIDATION)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-validation +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --reuse-style-mixin +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +impl = supermen-pimpl-mixin +!else +impl = supermen-pimpl-tiein +!endif + +driver.exe: driver.obj supermen-pskel.obj $(impl).obj $(root)\libxsde\xsde\xsde.lib + +driver.obj: driver.cxx $(impl).hxx supermen-pskel.hxx +$(impl).obj: $(impl).cxx $(impl).hxx supermen-pskel.hxx +supermen-pskel.obj: supermen-pskel.cxx supermen-pskel.hxx + + +supermen-pskel.hxx supermen-pskel.cxx: supermen.xsd + $(root)\bin\xsde.exe cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--generate-polymorphic supermen.xsd + + +# Test. +# +test: driver.exe person.xml batman.xml superman.xml + .\driver person.xml + .\driver batman.xml + .\driver superman.xml + + +# Clean. +# +clean: + -del supermen-pskel.?xx $(impl).obj supermen-pskel.obj driver.obj driver.exe + diff --git a/dist/examples/cxx/parser/wildcard/makefile b/dist/examples/cxx/parser/wildcard/makefile new file mode 100644 index 0000000..34830b9 --- /dev/null +++ b/dist/examples/cxx/parser/wildcard/makefile @@ -0,0 +1,42 @@ +root := ../../../.. + +include $(root)/build/cxx/rules.make + +# Build. +# +EXTRA_CPPFLAGS := -I$(root)/libxsde + +ifeq ($(XSDE_LONGLONG),n) +EXTRA_XSDFLAGS += --no-long-long +endif + +ifeq ($(XSDE_PARSER_VALIDATION),n) +EXTRA_XSDFLAGS += --suppress-validation +endif + +ifeq ($(XSDE_POLYMORPHIC),y) +EXTRA_XSDFLAGS += --runtime-polymorphic +endif + +driver: driver.o email-pskel.o $(root)/libxsde/xsde/libxsde.a + +driver.o: driver.cxx email-pskel.hxx +email-pskel.o: email-pskel.cxx email-pskel.hxx + +.PRECIOUS: %-pskel.hxx %-pskel.cxx +%-pskel.hxx %-pskel.cxx: %.xsd + $(root)/bin/xsde cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) $< + +# Test. +# +.PHONY: test +test: driver email.xml + ./driver email.xml + + +# Clean. +# +.PHONY: clean +clean: + rm -f email-pskel.?xx email-pskel.o driver.o driver + diff --git a/dist/examples/cxx/parser/wildcard/nmakefile b/dist/examples/cxx/parser/wildcard/nmakefile new file mode 100644 index 0000000..c1f333b --- /dev/null +++ b/dist/examples/cxx/parser/wildcard/nmakefile @@ -0,0 +1,39 @@ +root = ..\..\..\.. + +!include $(root)\build\cxx\rules.nmake + +# Build. +# +EXTRA_CPPFLAGS = /I$(root)\libxsde + +!if "$(XSDE_LONGLONG)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long +!endif + +!if "$(XSDE_PARSER_VALIDATION)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-validation +!endif + +!if "$(XSDE_POLYMORPHIC)" == "y" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --runtime-polymorphic +!endif + +driver.exe: driver.obj email-pskel.obj $(root)\libxsde\xsde\xsde.lib + +driver.obj: driver.cxx email-pskel.hxx +email-pskel.obj: email-pskel.cxx email-pskel.hxx + +email-pskel.cxx email-pskel.hxx: email.xsd + $(root)\bin\xsde.exe cxx-parser $(XSDFLAGS) $(EXTRA_XSDFLAGS) email.xsd + +# Test. +# +test: driver.exe email.xml + .\driver.exe email.xml + + +# Clean. +# +clean: + -del email-pskel.?xx email-pskel.obj driver.obj driver.exe + |