aboutsummaryrefslogtreecommitdiff
path: root/dist/examples
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-10-18 11:17:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-10-18 11:17:51 +0200
commitd80d096ee8743fd6f7382d274272b0b6d7faf9bf (patch)
treed0f0bee1e645cb2b86b6837ac0db8a7d2821e533 /dist/examples
parent0e4637025fa8d1b4234b0512561d31f0dd023843 (diff)
Support for schema evolution using substitution groups
New examples: hybrid/evolution/ignore and hybrid/evolution/passthrough.
Diffstat (limited to 'dist/examples')
-rw-r--r--dist/examples/cxx/hybrid/evolution/ignore/makefile68
-rw-r--r--dist/examples/cxx/hybrid/evolution/ignore/nmakefile66
-rw-r--r--dist/examples/cxx/hybrid/evolution/makefile27
-rw-r--r--dist/examples/cxx/hybrid/evolution/nmakefile27
-rw-r--r--dist/examples/cxx/hybrid/evolution/passthrough/makefile82
-rw-r--r--dist/examples/cxx/hybrid/evolution/passthrough/nmakefile80
-rw-r--r--dist/examples/cxx/hybrid/evolution/passthrough/options8
-rw-r--r--dist/examples/cxx/hybrid/makefile2
-rw-r--r--dist/examples/cxx/hybrid/nmakefile2
9 files changed, 360 insertions, 2 deletions
diff --git a/dist/examples/cxx/hybrid/evolution/ignore/makefile b/dist/examples/cxx/hybrid/evolution/ignore/makefile
new file mode 100644
index 0000000..146a31d
--- /dev/null
+++ b/dist/examples/cxx/hybrid/evolution/ignore/makefile
@@ -0,0 +1,68 @@
+root := ../../../../..
+
+include $(root)/build/cxx/rules.make
+
+# Build.
+#
+EXTRA_CPPFLAGS := -I$(root)/libxsde
+
+ifeq ($(XSDE_ENCODING),iso8859-1)
+EXTRA_XSDFLAGS += --char-encoding iso8859-1
+endif
+
+ifeq ($(XSDE_LONGLONG),n)
+EXTRA_XSDFLAGS += --no-long-long
+endif
+
+ifeq ($(XSDE_PARSER_VALIDATION),n)
+EXTRA_XSDFLAGS += --suppress-parser-val
+endif
+
+ifeq ($(XSDE_SERIALIZER_VALIDATION),n)
+EXTRA_XSDFLAGS += --suppress-serializer-val
+endif
+
+ifeq ($(XSDE_REUSE_STYLE),mixin)
+EXTRA_XSDFLAGS += --reuse-style-mixin
+endif
+
+ifeq ($(XSDE_POLYMORPHIC),y)
+EXTRA_XSDFLAGS += --runtime-polymorphic
+endif
+
+driver: driver.o transform.o transform-pskel.o transform-pimpl.o \
+$(root)/libxsde/xsde/libxsde.a
+
+driver.o: driver.cxx transform.hxx transform-pimpl.hxx
+transform.o: transform.cxx transform.hxx
+transform-pskel.o: transform-pskel.cxx
+transform-pimpl.o: transform-pimpl.cxx
+
+.PRECIOUS: %.hxx %.cxx %-pskel.hxx %-pskel.cxx %-pimpl.hxx %-pimpl.cxx
+
+%.hxx %.cxx %-pskel.hxx %-pskel.cxx %-pimpl.hxx %-pimpl.cxx: %.xsd
+ $(root)/bin/xsde cxx-hybrid $(XSDFLAGS) $(EXTRA_XSDFLAGS) \
+--generate-parser --generate-aggregate --root-element transformations \
+--generate-polymorphic $<
+
+
+# Generate.
+#
+.PHONY: gen
+gen: transform.hxx
+
+
+# Test.
+#
+.PHONY: test
+test: driver transform.xml
+ ./driver transform.xml
+
+# Clean.
+#
+.PHONY: clean cleanobj
+cleanobj:
+ rm -f transform-pimpl.o transform-pskel.o transform.o driver.o driver
+
+clean: cleanobj
+ rm -f transform-pimpl.?xx transform-pskel.?xx transform.?xx
diff --git a/dist/examples/cxx/hybrid/evolution/ignore/nmakefile b/dist/examples/cxx/hybrid/evolution/ignore/nmakefile
new file mode 100644
index 0000000..188fa79
--- /dev/null
+++ b/dist/examples/cxx/hybrid/evolution/ignore/nmakefile
@@ -0,0 +1,66 @@
+root = ..\..\..\..\..
+
+!include $(root)\build\cxx\rules.nmake
+
+# Build.
+#
+EXTRA_CPPFLAGS = /I$(root)\libxsde
+
+!if "$(XSDE_ENCODING)" == "iso8859-1"
+EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --char-encoding iso8859-1
+!endif
+
+!if "$(XSDE_LONGLONG)" == "n"
+EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long
+!endif
+
+!if "$(XSDE_PARSER_VALIDATION)" == "n"
+EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-parser-val
+!endif
+
+!if "$(XSDE_SERIALIZER_VALIDATION)" == "n"
+EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-serializer-val
+!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
+
+driver.exe: driver.obj transform.obj transform-pskel.obj transform-pimpl.obj \
+$(root)\libxsde\xsde\xsde.lib
+
+driver.obj: driver.cxx transform.hxx transform-pimpl.hxx
+transform.obj: transform.cxx transform.hxx
+transform-pskel.obj: transform-pskel.cxx
+transform-pimpl.obj: transform-pimpl.cxx
+
+transform.cxx transform.hxx \
+transform-pskel.cxx transform-pskel.hxx transform-pimpl.cxx transform-pimpl.hxx \
+: transform.xsd
+ $(root)\bin\xsde.exe cxx-hybrid $(XSDFLAGS) $(EXTRA_XSDFLAGS) \
+--generate-parser --generate-aggregate --root-element transformations \
+--generate-polymorphic transform.xsd
+
+
+# Generate.
+#
+gen: transform.hxx
+
+
+# Test.
+#
+test: driver.exe transform.xml
+ .\driver.exe transform.xml
+
+# Clean.
+#
+cleanobj:
+ -del transform-pimpl.obj transform-pskel.obj transform.obj \
+driver.obj driver.exe
+
+clean: cleanobj
+ -del transform-pimpl.?xx transform-pskel.?xx transform.?xx
diff --git a/dist/examples/cxx/hybrid/evolution/makefile b/dist/examples/cxx/hybrid/evolution/makefile
new file mode 100644
index 0000000..7a87d36
--- /dev/null
+++ b/dist/examples/cxx/hybrid/evolution/makefile
@@ -0,0 +1,27 @@
+root := ../../../..
+
+include $(root)/build/config.make
+
+dirs :=
+
+ifeq ($(XSDE_IOSTREAM),y)
+ifeq ($(XSDE_EXCEPTIONS),y)
+
+ifeq ($(XSDE_STL),y)
+dirs += ignore passthrough
+endif
+
+endif
+endif
+
+.PHONY: all $(dirs)
+
+all: $(dirs)
+
+$(dirs):
+ @$(MAKE) -C $@ $(MAKECMDGOALS)
+
+makefile: ;
+%.make:: ;
+
+%:: $(dirs) ;
diff --git a/dist/examples/cxx/hybrid/evolution/nmakefile b/dist/examples/cxx/hybrid/evolution/nmakefile
new file mode 100644
index 0000000..61d6546
--- /dev/null
+++ b/dist/examples/cxx/hybrid/evolution/nmakefile
@@ -0,0 +1,27 @@
+root = ..\..\..\..
+
+!include $(root)\build\config.nmake
+
+dirs =
+
+!if "$(XSDE_IOSTREAM)" == "y"
+!if "$(XSDE_EXCEPTIONS)" == "y"
+
+!if "$(XSDE_STL)" == "y"
+dirs = $(dirs) ignore passthrough
+!endif
+
+!endif
+!endif
+
+all:
+ @for %i in ( $(dirs) ) do \
+@cmd /c "echo entering %i && cd %i && $(MAKE) /nologo /f nmakefile" || exit 1
+
+gen test:
+ @for %i in ( $(dirs) ) do \
+@cmd /c "echo entering %i && cd %i && $(MAKE) /nologo /f nmakefile $@" || exit 1
+
+clean cleanobj:
+ @for %i in ( $(dirs) ) do \
+@cmd /c "echo entering %i && cd %i && $(MAKE) /nologo /f nmakefile $@"
diff --git a/dist/examples/cxx/hybrid/evolution/passthrough/makefile b/dist/examples/cxx/hybrid/evolution/passthrough/makefile
new file mode 100644
index 0000000..4f6520c
--- /dev/null
+++ b/dist/examples/cxx/hybrid/evolution/passthrough/makefile
@@ -0,0 +1,82 @@
+root := ../../../../..
+
+include $(root)/build/cxx/rules.make
+
+# Build.
+#
+EXTRA_CPPFLAGS := -I$(root)/libxsde
+
+ifeq ($(XSDE_ENCODING),iso8859-1)
+EXTRA_XSDFLAGS += --char-encoding iso8859-1
+endif
+
+ifeq ($(XSDE_LONGLONG),n)
+EXTRA_XSDFLAGS += --no-long-long
+endif
+
+ifeq ($(XSDE_PARSER_VALIDATION),n)
+EXTRA_XSDFLAGS += --suppress-parser-val
+endif
+
+ifeq ($(XSDE_SERIALIZER_VALIDATION),n)
+EXTRA_XSDFLAGS += --suppress-serializer-val
+endif
+
+ifeq ($(XSDE_REUSE_STYLE),mixin)
+EXTRA_XSDFLAGS += --reuse-style-mixin
+endif
+
+ifeq ($(XSDE_POLYMORPHIC),y)
+EXTRA_XSDFLAGS += --runtime-polymorphic
+endif
+
+driver: driver.o unknown-type.o transform.o xml.o transform-pskel.o \
+transform-pimpl.o transform-sskel.o transform-simpl.o unknown-type-pimpl.o \
+unknown-type-simpl.o $(root)/libxsde/xsde/libxsde.a
+
+driver.o: driver.cxx transform.hxx unknown-type.hxx xml.hxx xml.ixx \
+transform-pimpl.hxx transform-simpl.hxx
+transform.o: transform.cxx transform.hxx unknown-type.hxx
+xml.o: xml.cxx xml.hxx xml.ixx transform.hxx
+transform-pskel.o: transform-pskel.cxx
+transform-pimpl.o: transform-pimpl.cxx
+transform-simpl.o: transform-simpl.cxx
+transform-simpl.o: transform-simpl.cxx
+unknown-type.o: unknown-type.cxx unknown-type.hxx transform.hxx xml.hxx xml.ixx
+unknown-type-pimpl.o: unknown-type-pimpl.cxx unknown-type-pimpl.hxx \
+transform.hxx xml.hxx xml.ixx
+unknown-type-simpl.o: unknown-type-simpl.cxx unknown-type-simpl.hxx \
+transform.hxx xml.hxx xml.ixx
+
+.PRECIOUS: %.hxx %.cxx %-pskel.hxx %-pskel.cxx %-pimpl.hxx %-pimpl.cxx \
+%-sskel.hxx %-sskel.cxx %-simpl.hxx %-simpl.cxx
+
+%.hxx %.cxx %-pskel.hxx %-pskel.cxx %-pimpl.hxx %-pimpl.cxx \
+%-sskel.hxx %-sskel.cxx %-simpl.hxx %-simpl.cxx: %.xsd
+ $(root)/bin/xsde cxx-hybrid $(XSDFLAGS) $(EXTRA_XSDFLAGS) \
+--options-file options $<
+
+
+# Generate.
+#
+.PHONY: gen
+gen: transform.hxx
+
+
+# Test.
+#
+.PHONY: test
+test: driver transform.xml
+ ./driver transform.xml
+
+# Clean.
+#
+.PHONY: clean cleanobj
+cleanobj:
+ rm -f unknown-type.o unknown-type-pimpl.o unknown-type-simpl.o \
+transform-pimpl.o transform-pskel.o transform-simpl.o transform-sskel.o \
+xml.o transform.o driver.o driver
+
+clean: cleanobj
+ rm -f transform-pimpl.?xx transform-pskel.?xx transform-simpl.?xx \
+transform-sskel.?xx transform.?xx
diff --git a/dist/examples/cxx/hybrid/evolution/passthrough/nmakefile b/dist/examples/cxx/hybrid/evolution/passthrough/nmakefile
new file mode 100644
index 0000000..fe85b4a
--- /dev/null
+++ b/dist/examples/cxx/hybrid/evolution/passthrough/nmakefile
@@ -0,0 +1,80 @@
+root = ..\..\..\..\..
+
+!include $(root)\build\cxx\rules.nmake
+
+# Build.
+#
+EXTRA_CPPFLAGS = /I$(root)\libxsde
+
+!if "$(XSDE_ENCODING)" == "iso8859-1"
+EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --char-encoding iso8859-1
+!endif
+
+!if "$(XSDE_LONGLONG)" == "n"
+EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long
+!endif
+
+!if "$(XSDE_PARSER_VALIDATION)" == "n"
+EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-parser-val
+!endif
+
+!if "$(XSDE_SERIALIZER_VALIDATION)" == "n"
+EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-serializer-val
+!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
+
+driver.exe: driver.obj unknown-type.obj transform.obj xml.obj \
+transform-pskel.obj transform-pimpl.obj transform-sskel.obj \
+transform-simpl.obj unknown-type-pimpl.obj unknown-type-simpl.obj \
+$(root)\libxsde\xsde\xsde.lib
+
+driver.obj: driver.cxx transform.hxx unknown-type.hxx xml.hxx xml.ixx \
+transform-pimpl.hxx transform-simpl.hxx
+transform.obj: transform.cxx transform.hxx unknown-type.hxx
+xml.obj: xml.cxx xml.hxx xml.ixx transform.hxx
+transform-pskel.obj: transform-pskel.cxx
+transform-pimpl.obj: transform-pimpl.cxx
+transform-simpl.obj: transform-simpl.cxx
+transform-simpl.obj: transform-simpl.cxx
+unknown-type.obj: unknown-type.cxx unknown-type.hxx transform.hxx xml.hxx \
+xml.ixx
+unknown-type-pimpl.obj: unknown-type-pimpl.cxx unknown-type-pimpl.hxx \
+transform.hxx xml.hxx xml.ixx
+unknown-type-simpl.obj: unknown-type-simpl.cxx unknown-type-simpl.hxx \
+transform.hxx xml.hxx xml.ixx
+
+transform.cxx transform.hxx \
+transform-pskel.cxx transform-pskel.hxx transform-pimpl.cxx transform-pimpl.hxx \
+transform-sskel.cxx transform-sskel.hxx transform-simpl.cxx transform-simpl.hxx \
+: transform.xsd
+ $(root)\bin\xsde.exe cxx-hybrid $(XSDFLAGS) $(EXTRA_XSDFLAGS) \
+--options-file options transform.xsd
+
+
+# Generate.
+#
+gen: transform.hxx
+
+
+# Test.
+#
+test: driver.exe transform.xml
+ .\driver.exe transform.xml
+
+# Clean.
+#
+cleanobj:
+ -del unknown-type.obj unknown-type-pimpl.obj unknown-type-simpl.obj \
+transform-pimpl.obj transform-pskel.obj transform-simpl.obj \
+transform-sskel.obj xml.obj transform.obj driver.obj driver.exe
+
+clean: cleanobj
+ -del transform-pimpl.?xx transform-pskel.?xx transform-simpl.?xx \
+transform-sskel.?xx transform.?xx
diff --git a/dist/examples/cxx/hybrid/evolution/passthrough/options b/dist/examples/cxx/hybrid/evolution/passthrough/options
new file mode 100644
index 0000000..cd0eadc
--- /dev/null
+++ b/dist/examples/cxx/hybrid/evolution/passthrough/options
@@ -0,0 +1,8 @@
+--generate-parser
+--generate-serializer
+--generate-aggregate
+--root-element transformations
+--generate-polymorphic
+--custom-type unknown_type=//unknown_type_base/unknown-type.hxx
+--custom-parser unknown_type=unknown_type_base_pimpl/unknown-type-pimpl.hxx
+--custom-serializer unknown_type=unknown_type_base_simpl/unknown-type-simpl.hxx
diff --git a/dist/examples/cxx/hybrid/makefile b/dist/examples/cxx/hybrid/makefile
index 859451b..76c246b 100644
--- a/dist/examples/cxx/hybrid/makefile
+++ b/dist/examples/cxx/hybrid/makefile
@@ -6,7 +6,7 @@ dirs :=
ifeq ($(XSDE_CUSTOM_ALLOCATOR),n)
-dirs += binary compositors custom
+dirs += binary compositors custom evolution
ifeq ($(XSDE_IOSTREAM),y)
ifeq ($(XSDE_EXCEPTIONS),y)
diff --git a/dist/examples/cxx/hybrid/nmakefile b/dist/examples/cxx/hybrid/nmakefile
index 45c57ca..515fed9 100644
--- a/dist/examples/cxx/hybrid/nmakefile
+++ b/dist/examples/cxx/hybrid/nmakefile
@@ -6,7 +6,7 @@ dirs =
!if "$(XSDE_CUSTOM_ALLOCATOR)" == "n"
-dirs = $(dirs) binary compositors custom
+dirs = $(dirs) binary compositors custom evolution
!if "$(XSDE_IOSTREAM)" == "y"
!if "$(XSDE_EXCEPTIONS)" == "y"