aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/import/cli/LICENSE21
-rw-r--r--build/import/cli/cli-cxx.make48
-rw-r--r--build/import/cli/configuration-rules.make14
-rwxr-xr-xbuild/import/cli/configure54
-rw-r--r--build/import/cli/stub.make29
-rw-r--r--build/import/libbackend-elements/LICENSE340
-rw-r--r--build/import/libbackend-elements/configuration-rules.make15
-rwxr-xr-xbuild/import/libbackend-elements/configure55
-rw-r--r--build/import/libbackend-elements/stub.make32
-rw-r--r--documentation/makefile133
-rw-r--r--documentation/xsde-epilogue.1540
-rw-r--r--documentation/xsde-epilogue.xhtml365
-rw-r--r--documentation/xsde-hybrid-header.14
-rw-r--r--documentation/xsde-hybrid-header.xhtml1
-rw-r--r--documentation/xsde-parser-header.14
-rw-r--r--documentation/xsde-parser-header.xhtml1
-rw-r--r--documentation/xsde-prologue.1171
-rw-r--r--documentation/xsde-prologue.xhtml162
-rw-r--r--documentation/xsde-serializer-header.14
-rw-r--r--documentation/xsde-serializer-header.xhtml1
-rw-r--r--documentation/xsde.12110
-rw-r--r--documentation/xsde.xhtml1725
-rw-r--r--xsde/cxx/hybrid/generator.cxx516
-rw-r--r--xsde/cxx/hybrid/options.cli353
-rw-r--r--xsde/cxx/options.cli515
-rw-r--r--xsde/cxx/parser/generator.cxx347
-rw-r--r--xsde/cxx/parser/options.cli159
-rw-r--r--xsde/cxx/serializer/generator.cxx343
-rw-r--r--xsde/cxx/serializer/options.cli148
-rw-r--r--xsde/makefile80
-rw-r--r--xsde/options.cli302
-rw-r--r--xsde/xsde.cxx117
32 files changed, 3093 insertions, 5616 deletions
diff --git a/build/import/cli/LICENSE b/build/import/cli/LICENSE
new file mode 100644
index 0000000..57ee246
--- /dev/null
+++ b/build/import/cli/LICENSE
@@ -0,0 +1,21 @@
+Copyright (c) 2009-2012 Code Synthesis Tools CC.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER 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.
+
diff --git a/build/import/cli/cli-cxx.make b/build/import/cli/cli-cxx.make
new file mode 100644
index 0000000..cd009d9
--- /dev/null
+++ b/build/import/cli/cli-cxx.make
@@ -0,0 +1,48 @@
+# file : build/import/cli/cli-cxx.make
+# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+# Here we are operating in the importing project's space, not in
+# cli's.
+#
+
+# Get the C++ file extensions.
+#
+$(call include,$(bld_root)/cxx/configuration-static.make)
+
+cli_pattern := \
+$(out_base)/%.$(cxx_s_suffix) \
+$(out_base)/%.$(cxx_h_suffix) \
+$(out_base)/%.$(cxx_i_suffix)
+
+$(cli_pattern): cli_options := \
+--hxx-suffix .$(cxx_h_suffix) \
+--ixx-suffix .$(cxx_i_suffix) \
+--cxx-suffix .$(cxx_s_suffix)
+
+.PRECIOUS: $(cli_pattern)
+
+ifeq ($(out_base),$(src_base))
+
+$(cli_pattern): $(src_base)/%.cli
+ $(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<)
+
+else
+
+$(cli_pattern): $(src_base)/%.cli | $$(dir $$@).
+ $(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<)
+
+$(cli_pattern): $(out_base)/%.cli | $$(dir $$@).
+ $(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<)
+endif
+
+.PHONY: $(out_base)/%.cxx.cli.clean
+
+$(out_base)/%.cxx.cli.clean: cxx_s_suffix := $(cxx_s_suffix)
+$(out_base)/%.cxx.cli.clean: cxx_h_suffix := $(cxx_h_suffix)
+$(out_base)/%.cxx.cli.clean: cxx_i_suffix := $(cxx_i_suffix)
+
+$(out_base)/%.cxx.cli.clean:
+ $(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_s_suffix)))
+ $(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_h_suffix)))
+ $(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_i_suffix)))
diff --git a/build/import/cli/configuration-rules.make b/build/import/cli/configuration-rules.make
new file mode 100644
index 0000000..5fb2485
--- /dev/null
+++ b/build/import/cli/configuration-rules.make
@@ -0,0 +1,14 @@
+# file : build/import/cli/configuration-rules.make
+# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+$(dcf_root)/import/cli/configuration-dynamic.make: | $(dcf_root)/import/cli/.
+ $(call message,,$(scf_root)/import/cli/configure $@)
+
+ifndef %foreign%
+
+$(dcf_root)/.disfigure::
+ $(call message,rm $(dcf_root)/import/cli/configuration-dynamic.make,\
+rm -f $(dcf_root)/import/cli/configuration-dynamic.make)
+
+endif
diff --git a/build/import/cli/configure b/build/import/cli/configure
new file mode 100755
index 0000000..ae1e512
--- /dev/null
+++ b/build/import/cli/configure
@@ -0,0 +1,54 @@
+#! /usr/bin/env bash
+
+# file : build/import/cli/configure
+# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+
+# $1 - out file
+#
+# bld_root - build root
+# project_name - project name
+#
+
+source $bld_root/dialog.bash
+
+
+$echo
+$echo "Configuring external dependency on 'cli' for '$project_name'."
+$echo
+
+$echo
+$echo "Would you like to configure dependency on the installed "
+$echo "version of 'cli' as opposed to the development build?"
+$echo
+
+installed=`read_y_n y`
+
+path=
+
+if [ "$installed" = "n" ]; then
+
+$echo
+$echo "Please enter the src_root for 'cli'."
+$echo
+
+src_root=`read_path --directory --exist`
+
+$echo
+$echo "Please enter the out_root for 'cli'."
+$eche
+
+out_root=`read_path --directory $src_root`
+
+fi
+
+echo cli_installed := $installed >$1
+
+if [ "$installed" = "n" ]; then
+
+echo src_root := $src_root >>$1
+echo scf_root := \$\(src_root\)/build >>$1
+echo out_root := $out_root >>$1
+
+fi
diff --git a/build/import/cli/stub.make b/build/import/cli/stub.make
new file mode 100644
index 0000000..3704723
--- /dev/null
+++ b/build/import/cli/stub.make
@@ -0,0 +1,29 @@
+# file : build/import/cli/stub.make
+# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+$(call include-once,$(scf_root)/import/cli/configuration-rules.make,$(dcf_root))
+
+cli_installed :=
+
+$(call -include,$(dcf_root)/import/cli/configuration-dynamic.make)
+
+ifdef cli_installed
+
+ifeq ($(cli_installed),y)
+
+$(call export,cli: cli,cli-rules: $(scf_root)/import/cli/cli-cxx.make)
+
+else
+
+# Include export stub.
+#
+$(call include,$(scf_root)/export/cli/stub.make)
+
+endif
+
+else
+
+.NOTPARALLEL:
+
+endif
diff --git a/build/import/libbackend-elements/LICENSE b/build/import/libbackend-elements/LICENSE
deleted file mode 100644
index 3912109..0000000
--- a/build/import/libbackend-elements/LICENSE
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/build/import/libbackend-elements/configuration-rules.make b/build/import/libbackend-elements/configuration-rules.make
deleted file mode 100644
index 1766f03..0000000
--- a/build/import/libbackend-elements/configuration-rules.make
+++ /dev/null
@@ -1,15 +0,0 @@
-# file : build/import/libbackend-elements/configuration-rules.make
-# author : Boris Kolpackov <boris@kolpackov.net>
-# copyright : Copyright (c) 2005-2009 Boris Kolpackov
-# license : GNU GPL v2; see accompanying LICENSE file
-
-$(dcf_root)/import/libbackend-elements/configuration-dynamic.make: | $(dcf_root)/import/libbackend-elements/.
- $(call message,,$(scf_root)/import/libbackend-elements/configure $@)
-
-ifndef %foreign%
-
-disfigure::
- $(call message,rm $(dcf_root)/import/libbackend-elements/configuration-dynamic.make,\
-rm -f $(dcf_root)/import/libbackend-elements/configuration-dynamic.make)
-
-endif
diff --git a/build/import/libbackend-elements/configure b/build/import/libbackend-elements/configure
deleted file mode 100755
index db3e44d..0000000
--- a/build/import/libbackend-elements/configure
+++ /dev/null
@@ -1,55 +0,0 @@
-#! /usr/bin/env bash
-
-# file : build/import/libbackend-elements/configure
-# author : Boris Kolpackov <boris@kolpackov.net>
-# copyright : Copyright (c) 2005-2009 Boris Kolpackov
-# license : GNU GPL v2; see accompanying LICENSE file
-
-
-# $1 - out file
-#
-# bld_root - build root
-# project_name - project name
-#
-
-source $bld_root/dialog.bash
-
-
-$echo
-$echo "Configuring external dependency on 'libbackend-elements' for '$project_name'."
-$echo
-
-$echo
-$echo "Would you like to configure dependency on the installed version"
-$echo "of 'libbackend-elements' as opposed to the development build?"
-$echo
-
-installed=`read_y_n y`
-
-path=
-
-if [ "$installed" = "n" ]; then
-
-$echo
-$echo "Please enter the src_root for 'libbackend-elements'."
-$echo
-
-src_root=`read_path --directory --exist`
-
-$echo
-$echo "Please enter the out_root for 'libbackend-elements'."
-$echo
-
-out_root=`read_path --directory $src_root`
-
-fi
-
-echo libbackend_elements_installed := $installed >$1
-
-if [ "$installed" = "n" ]; then
-
-echo src_root := $src_root >>$1
-echo scf_root := \$\(src_root\)/build >>$1
-echo out_root := $out_root >>$1
-
-fi
diff --git a/build/import/libbackend-elements/stub.make b/build/import/libbackend-elements/stub.make
deleted file mode 100644
index b171c30..0000000
--- a/build/import/libbackend-elements/stub.make
+++ /dev/null
@@ -1,32 +0,0 @@
-# file : build/import/libbackend-elements/stub.make
-# author : Boris Kolpackov <boris@kolpackov.net>
-# copyright : Copyright (c) 2005-2009 Boris Kolpackov
-# license : GNU GPL v2; see accompanying LICENSE file
-
-$(call include-once,$(scf_root)/import/libbackend-elements/configuration-rules.make,$(dcf_root))
-
-libbackend_elements_installed :=
-
-$(call -include,$(dcf_root)/import/libbackend-elements/configuration-dynamic.make)
-
-ifdef libbackend_elements_installed
-
-ifeq ($(libbackend_elements_installed),y)
-
-#-lbackend-elements
-
-$(call export,l: -lcult -lboost_regex,cpp_options: )
-
-else
-
-# Include export stub.
-#
-$(call include,$(scf_root)/export/libbackend-elements/stub.make)
-
-endif
-
-else
-
-.NOTPARALLEL:
-
-endif
diff --git a/documentation/makefile b/documentation/makefile
index 5b2f0e8..1a72794 100644
--- a/documentation/makefile
+++ b/documentation/makefile
@@ -11,35 +11,148 @@ dist-win := $(out_base)/.dist-win
install := $(out_base)/.install
cleandoc := $(out_base)/.cleandoc
-$(default): $(out_base)/cxx/
+# Import.
+#
+$(call import,\
+ $(scf_root)/import/cli/stub.make,\
+ cli: cli,cli-rules: cli_rules)
+
+# Build.
+#
+$(default): \
+$(out_base)/cxx/ \
+$(out_base)/xsde.xhtml \
+$(out_base)/xsde.1
+
+# Man/html pages.
+#
+$(out_base)/xsde.xhtml $(out_base)/xsde.1: cli := $(cli)
+$(out_base)/xsde.xhtml $(out_base)/xsde.1: cli_options += -I $(src_root)/xsde
+
+$(out_base)/xsde.xhtml $(out_base)/xsde.1: \
+$(src_root)/xsde/options.cli \
+$(src_root)/xsde/cxx/options.cli \
+$(src_root)/xsde/cxx/hybrid/options.cli \
+$(src_root)/xsde/cxx/parser/options.cli \
+$(src_root)/xsde/cxx/serializer/options.cli
+
+# Assemble the options from different files in a specific order.
+#
+
+# XHTML
+#
+$(out_base)/xsde.xhtml: $(src_base)/xsde-prologue.xhtml \
+ $(src_base)/xsde-epilogue.xhtml \
+ $(src_base)/xsde-hybrid-header.xhtml \
+ $(src_base)/xsde-parser-header.xhtml \
+ $(src_base)/xsde-serializer-header.xhtml \
+ | $(out_base)/.
+# Common options.
+#
+ $(call message,cli-html $$1,$(cli) $(cli_options) --generate-html \
+--stdout --suppress-undocumented --exclude-base --class CXX::options \
+--class options --html-prologue $(src_base)/xsde-prologue.xhtml \
+$$1 >$@, $(src_root)/xsde/cxx/options.cli)
+
+# C++/Hybrid options.
+#
+ $(call message,cli-html $$1,$(cli) $(cli_options) --generate-html \
+--stdout --suppress-undocumented --exclude-base \
+--html-prologue $(src_base)/xsde-hybrid-header.xhtml \
+$$1 >>$@, $(src_root)/xsde/cxx/hybrid/options.cli)
+
+# C++/Parser options.
+#
+ $(call message,cli-html $$1,$(cli) $(cli_options) --generate-html \
+--stdout --suppress-undocumented --exclude-base \
+--html-prologue $(src_base)/xsde-parser-header.xhtml \
+$$1 >>$@, $(src_root)/xsde/cxx/parser/options.cli)
+
+# C++/Serializer options.
+#
+ $(call message,cli-html $$1,$(cli) $(cli_options) --generate-html \
+--stdout --suppress-undocumented --exclude-base \
+--html-prologue $(src_base)/xsde-serializer-header.xhtml \
+--html-epilogue $(src_base)/xsde-epilogue.xhtml \
+$$1 >>$@, $(src_root)/xsde/cxx/serializer/options.cli)
+
+
+# MAN
+#
+$(out_base)/xsde.1: $(src_base)/xsde-prologue.1 \
+ $(src_base)/xsde-epilogue.1 \
+ $(src_base)/xsde-hybrid-header.1 \
+ $(src_base)/xsde-parser-header.1 \
+ $(src_base)/xsde-serializer-header.1 \
+ | $(out_base)/.
+# Common options.
+#
+ $(call message,cli-man $$1,$(cli) $(cli_options) --generate-man \
+--stdout --suppress-undocumented --exclude-base --class CXX::options \
+--class options --man-prologue $(src_base)/xsde-prologue.1 \
+$$1 >$@, $(src_root)/xsde/cxx/options.cli)
+
+# C++/Hybrid options.
+#
+ $(call message,cli-man $$1,$(cli) $(cli_options) --generate-man \
+--stdout --suppress-undocumented --exclude-base \
+--man-prologue $(src_base)/xsde-hybrid-header.1 \
+$$1 >>$@, $(src_root)/xsde/cxx/hybrid/options.cli)
+
+# C++/Parser options.
+#
+ $(call message,cli-man $$1,$(cli) $(cli_options) --generate-man \
+--stdout --suppress-undocumented --exclude-base \
+--man-prologue $(src_base)/xsde-parser-header.1 \
+$$1 >>$@, $(src_root)/xsde/cxx/parser/options.cli)
+
+# C++/Serializer options.
+#
+ $(call message,cli-man $$1,$(cli) $(cli_options) --generate-man \
+--stdout --suppress-undocumented --exclude-base \
+--man-prologue $(src_base)/xsde-serializer-header.1 \
+--man-epilogue $(src_base)/xsde-epilogue.1 \
+$$1 >>$@, $(src_root)/xsde/cxx/serializer/options.cli)
+
# Dist.
#
dist-common := $(out_base)/.dist-common
-$(dist-common):
+$(dist-common): $(out_base)/xsde.xhtml \
+ $(out_base)/xsde.1
$(call install-data,$(src_base)/default.css,$(dist_prefix)/documentation/default.css)
- $(call install-data,$(src_base)/xsde.xhtml,$(dist_prefix)/documentation/xsde.xhtml)
- $(call install-data,$(src_base)/xsde.1,$(dist_prefix)/documentation/xsde.1)
+ $(call install-data,$(out_base)/xsde.xhtml,$(dist_prefix)/documentation/xsde.xhtml)
+ $(call install-data,$(out_base)/xsde.1,$(dist_prefix)/documentation/xsde.1)
$(dist): $(dist-common) $(out_base)/cxx/.dist
$(dist-win): $(dist-common) $(out_base)/cxx/.dist
-
# Install.
#
-$(install):
+$(install): $(out_base)/xsde.xhtml \
+ $(out_base)/xsde.1
$(call install-dir,$(src_base)/cxx,$(install_doc_dir)/xsde/cxx)
$(call install-data,$(src_base)/default.css,$(install_doc_dir)/xsde/default.css)
- $(call install-data,$(src_base)/xsde.xhtml,$(install_doc_dir)/xsde/xsde.xhtml)
- $(call install-data,$(src_base)/xsde.1,$(install_man_dir)/man1/xsde.1)
-
+ $(call install-data,$(out_base)/xsde.xhtml,$(install_doc_dir)/xsde/xsde.xhtml)
+ $(call install-data,$(out_base)/xsde.1,$(install_man_dir)/man1/xsde.1)
# Clean.
#
$(cleandoc): $(src_base)/cxx/.cleandoc
+ $(call message,rm $$1,rm -f $$1,$(out_base)/xsde.1)
+ $(call message,rm $$1,rm -f $$1,$(out_base)/xsde.xhtml)
+# Generated .gitignore.
+#
+ifeq ($(out_base),$(src_base))
+$(out_base)/xsde.xhtml $(out_base)/xsde.1: | $(out_base)/.gitignore
-$(call include,$(bld_root)/install.make)
+$(out_base)/.gitignore: files := xsde.1 xsde.xhtml
+$(clean): $(out_base)/.gitignore.clean
+$(call include,$(bld_root)/git/gitignore.make)
+endif
+
+$(call include,$(bld_root)/install.make)
$(call import,$(src_base)/cxx/makefile)
diff --git a/documentation/xsde-epilogue.1 b/documentation/xsde-epilogue.1
new file mode 100644
index 0000000..3049ab0
--- /dev/null
+++ b/documentation/xsde-epilogue.1
@@ -0,0 +1,540 @@
+.\"
+.\" Type map
+.\"
+.SH TYPE MAP
+
+Type map files are used to define a mapping between XML Schema and
+C++ types. For C++/Parser, the compiler uses this information to
+determine the return types of
+.B post_*
+functions in parser skeletons corresponding to XML Schema types as
+well as argument types for callbacks corresponding to elements and
+attributes of these types. For C++/Serializer, type maps are used
+to determine the argument type of
+.B pre
+functions in serializer skeletons corresponding to XML Schema types
+as well as return types for callbacks corresponding to elements and
+attributes of these types.
+
+The compiler has a set of predefined mapping rules that map the
+built-in XML Schema types to suitable C++ types (discussed in
+the following sub-sections) and all other types to
+.BR void .
+By providing your own type maps you can override these predefined
+rules. The format of the type map file is presented below:
+
+
+.RS
+.B namespace
+.I schema-namespace
+[
+.I cxx-namespace
+]
+.br
+.B {
+.br
+ (
+.B include
+.IB file-name ;
+)*
+.br
+ ([
+.B type
+]
+.I schema-type cxx-ret-type
+[
+.I cxx-arg-type
+.RB ] ;
+)*
+.br
+.B }
+.br
+.RE
+
+Both
+.I schema-namespace
+and
+.I schema-type
+are regex patterns while
+.IR cxx-namespace ,
+.IR cxx-ret-type ,
+and
+.I cxx-arg-type
+are regex pattern substitutions. All names can be optionally enclosed
+in \fR" "\fR, for example, to include white-spaces.
+
+.I schema-namespace
+determines XML Schema namespace. Optional
+.I cxx-namespace
+is prefixed to every C++ type name in this namespace declaration.
+.I cxx-ret-type
+is a C++ type name that is used as a return type for the
+.B post_*
+function in C++/Parser or for element/attribute callbacks in C++/Serializer.
+Optional
+.I cxx-arg-type
+is an argument type for element/attribute callbacks in C++/Parser or for the
+.B pre
+function in C++/Serializer. If
+.I cxx-arg-type
+is not specified, it defaults to
+.I cxx-ret-type
+if
+.I cxx-ret-type
+ends with
+.B *
+or
+.B &
+(that is, it is a pointer or a reference) and
+.B const
+\fIcxx-ret-type\fB&\fR otherwise.
+.I file-name
+is a file name either in the \fR" "\fR or < > format and is added with the
+.B #include
+directive to the generated code.
+
+The \fB#\fR character starts a comment that ends with a new line or end of
+file. To specify a name that contains \fB#\fR enclose it in \fR" "\fR. For
+example:
+
+.RS
+namespace http://www.example.com/xmlns/my my
+.br
+{
+.br
+ include "my.hxx";
+.br
+
+ # Pass apples by value.
+ #
+ apple apple;
+.br
+
+ # Pass oranges as pointers.
+ #
+ orange orange_t*;
+.br
+}
+.br
+.RE
+
+In the example above, for the
+.B http://www.example.com/xmlns/my#orange
+XML Schema type, the
+.B my::orange_t*
+C++ type will be used as both return and argument types.
+
+Several namespace declarations can be specified in a single file.
+The namespace declaration can also be completely omitted to map
+types in a schema without a namespace. For instance:
+
+.RS
+include "my.hxx";
+.br
+apple apple;
+.br
+
+namespace http://www.example.com/xmlns/my
+.br
+{
+.br
+ orange "const orange_t*";
+.br
+}
+.br
+.RE
+
+The compiler has a number of predefined mapping rules for the built-in
+XML Schema types that vary depending on the mapping used. They are
+described in the following subsections. The last predefined rule
+for all the mappings maps anything that wasn't mapped by previous rules to
+.BR void :
+
+.RS
+namespace .*
+.br
+{
+.br
+ .* void void;
+.br
+}
+.br
+.RE
+
+When you provide your own type maps with the
+.B --type-map
+option, they are evaluated first. This allows you to selectively override
+predefined rules.
+
+.\"
+.\" Predefined C++/Parser Type Maps
+.\"
+.SS Predefined C++/Parser Type Maps
+
+The C++/Parser mapping provides a number of predefined type map rules
+for the built-in XML Schema types. They can be presented as the
+following map files:
+
+.RS
+namespace http://www.w3.org/2001/XMLSchema
+.br
+{
+.br
+ boolean bool bool;
+.br
+
+ byte "signed char" "signed char";
+.br
+ unsignedByte "unsigned char" "unsigned char";
+.br
+
+ short short short;
+.br
+ unsignedShort "unsigned short" "unsigned short";
+.br
+
+ int int int;
+.br
+ unsignedInt "unsigned int" "unsigned int";
+.br
+
+ long "long long" "long long";
+.br
+ unsignedLong "unsigned long long" "unsigned long long";
+.br
+
+ integer long long;
+.br
+
+ negativeInteger long long;
+.br
+ nonPositiveInteger long long;
+.br
+
+ positiveInteger "unsigned long" "unsigned long";
+.br
+ nonNegativeInteger "unsigned long" "unsigned long";
+.br
+
+ float float float;
+.br
+ double double double;
+.br
+ decimal double double;
+.br
+
+ NMTOKENS xml_schema::string_sequence*;
+.br
+ IDREFS xml_schema::string_sequence*;
+.br
+
+ base64Binary xml_schema::buffer*;
+.br
+ hexBinary xml_schema::buffer*;
+.br
+
+ date xml_schema::date;
+.br
+ dateTime xml_schema::date_time;
+.br
+ duration xml_schema::duration;
+.br
+ gDay xml_schema::gday;
+.br
+ gMonth xml_schema::gmonth;
+.br
+ gMonthDay xml_schema::gmonth_day;
+.br
+ gYear xml_schema::gyear;
+.br
+ gYearMonth xml_schema::gyear_month;
+.br
+ time xml_schema::time;
+.br
+}
+.br
+.RE
+
+If the
+.B --no-stl
+option is not specified, the following mapping is used for the
+string-based XML Schema built-in types:
+
+.RS
+namespace http://www.w3.org/2001/XMLSchema
+.br
+{
+.br
+ include <string>;
+.br
+
+ string std::string;
+.br
+ normalizedString std::string;
+.br
+ token std::string;
+.br
+ Name std::string;
+.br
+ NMTOKEN std::string;
+.br
+ NCName std::string;
+.br
+ ID std::string;
+.br
+ IDREF std::string;
+.br
+ language std::string;
+.br
+ anyURI std::string;
+.br
+
+ QName xml_schema::qname;
+.br
+}
+.br
+.RE
+
+Otherwise, a C string-based mapping is used:
+
+.RS
+namespace http://www.w3.org/2001/XMLSchema
+.br
+{
+.br
+ string char*;
+.br
+ normalizedString char*;
+.br
+ token char*;
+.br
+ Name char*;
+.br
+ NMTOKEN char*;
+.br
+ NCName char*;
+.br
+ ID char*;
+.br
+ IDREF char*;
+.br
+ language char*;
+.br
+ anyURI char*;
+.br
+
+ QName xml_schema::qname*;
+.br
+}
+.br
+.RE
+
+.\"
+.\" Predefined C++/Serializer Type Maps
+.\"
+.SS Predefined C++/Serializer Type Maps
+
+The C++/Serializer mapping provides a number of predefined type map
+rules for the built-in XML Schema types. They can be presented as the
+following map files:
+
+.RS
+namespace http://www.w3.org/2001/XMLSchema
+.br
+{
+.br
+ boolean bool bool;
+.br
+
+ byte "signed char" "signed char";
+.br
+ unsignedByte "unsigned char" "unsigned char";
+.br
+
+ short short short;
+.br
+ unsignedShort "unsigned short" "unsigned short";
+.br
+
+ int int int;
+.br
+ unsignedInt "unsigned int" "unsigned int";
+.br
+
+ long "long long" "long long";
+.br
+ unsignedLong "unsigned long long" "unsigned long long";
+.br
+
+ integer long long;
+.br
+
+ negativeInteger long long;
+.br
+ nonPositiveInteger long long;
+.br
+
+ positiveInteger "unsigned long" "unsigned long";
+.br
+ nonNegativeInteger "unsigned long" "unsigned long";
+.br
+
+ float float float;
+.br
+ double double double;
+.br
+ decimal double double;
+.br
+
+ NMTOKENS "const xml_schema::string_sequence*";
+.br
+ IDREFS "const xml_schema::string_sequence*";
+.br
+
+ base64Binary "const xml_schema::buffer*";
+.br
+ hexBinary "const xml_schema::buffer*";
+.br
+
+ date xml_schema::date;
+.br
+ dateTime xml_schema::date_time;
+.br
+ duration xml_schema::duration;
+.br
+ gDay xml_schema::gday;
+.br
+ gMonth xml_schema::gmonth;
+.br
+ gMonthDay xml_schema::gmonth_day;
+.br
+ gYear xml_schema::gyear;
+.br
+ gYearMonth xml_schema::gyear_month;
+.br
+ time xml_schema::time;
+.br
+}
+.br
+.RE
+
+If the
+.B --no-stl
+option is not specified, the following mapping is used for the
+string-based XML Schema built-in types:
+
+.RS
+namespace http://www.w3.org/2001/XMLSchema
+.br
+{
+.br
+ include <string>;
+.br
+
+ string std::string;
+.br
+ normalizedString std::string;
+.br
+ token std::string;
+.br
+ Name std::string;
+.br
+ NMTOKEN std::string;
+.br
+ NCName std::string;
+.br
+ ID std::string;
+.br
+ IDREF std::string;
+.br
+ language std::string;
+.br
+ anyURI std::string;
+.br
+
+ QName xml_schema::qname;
+.br
+}
+.br
+.RE
+
+Otherwise, a C string-based mapping is used:
+
+.RS
+namespace http://www.w3.org/2001/XMLSchema
+.br
+{
+.br
+ string "const char*";
+.br
+ normalizedString "const char*";
+.br
+ token "const char*";
+.br
+ Name "const char*";
+.br
+ NMTOKEN "const char*";
+.br
+ NCName "const char*";
+.br
+ ID "const char*";
+.br
+ IDREF "const char*";
+.br
+ language "const char*";
+.br
+ anyURI "const char*";
+.br
+
+ QName "const xml_schema::qname*";
+.br
+}
+.br
+.RE
+
+.\"
+.\" REGEX AND SHELL QUOTING
+.\"
+.SH REGEX AND SHELL QUOTING
+When entering a regular expression argument in the shell command line
+it is often necessary to use quoting (enclosing the argument in " "
+or ' ') in order to prevent the shell from interpreting certain
+characters, for example, spaces as argument separators and $ as
+variable expansions.
+
+Unfortunately it is hard to achieve this in a manner that is portable
+across POSIX shells, such as those found on GNU/Linux and UNIX, and
+Windows shell. For example, if you use " " for quoting you will get
+a wrong result with POSIX shells if your expression contains $. The
+standard way of dealing with this on POSIX systems is to use ' '
+instead. Unfortunately, Windows shell does not remove ' ' from
+arguments when they are passed to applications. As a result you may
+have to use ' ' for POSIX and " " for Windows ($ is not treated as
+a special character on Windows).
+
+Alternatively, you can save regular expression options into a file,
+one option per line, and use this file with the
+.B --options-file
+option. With this approach you don't need to worry about shell quoting.
+
+.\"
+.\" DIAGNOSTICS
+.\"
+.SH DIAGNOSTICS
+If the input file is not a valid W3C XML Schema definition,
+.B xsde
+will issue diagnostic messages to
+.B STDERR
+and exit with non-zero exit code.
+
+.SH BUGS
+Send bug reports to the xsde-users@codesynthesis.com mailing list.
+
+.SH COPYRIGHT
+Copyright (c) 2005-2011 Code Synthesis Tools CC.
+
+Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License,
+version 1.2; with no Invariant Sections, no Front-Cover Texts and
+no Back-Cover Texts. Copy of the license can be obtained from
+http://codesynthesis.com/licenses/fdl-1.2.txt
diff --git a/documentation/xsde-epilogue.xhtml b/documentation/xsde-epilogue.xhtml
new file mode 100644
index 0000000..93701c0
--- /dev/null
+++ b/documentation/xsde-epilogue.xhtml
@@ -0,0 +1,365 @@
+ <h1>TYPE MAP</h1>
+
+ <p>Type map files are used to define a mapping between XML Schema
+ and C++ types. For C++/Parser, the compiler uses
+ this information to determine the return types of
+ <code><b>post_*</b></code> functions in parser skeletons
+ corresponding to XML Schema types as well as argument types
+ for callbacks corresponding to elements and attributes of these
+ types. For C++/Serializer, type maps are used to determine
+ the argument type of <code><b>pre</b></code> functions in
+ serializer skeletons corresponding to XML Schema types as
+ well as return types for callbacks corresponding to elements
+ and attributes of these types.</p>
+
+ <p>The compiler has a set of predefined mapping rules that map
+ the built-in XML Schema types to suitable C++ types (discussed
+ in the following sub-sections) and all other types to
+ <code><b>void</b></code>. By providing your own type maps you
+ can override these predefined rules. The format of the type map
+ file is presented below:
+ </p>
+
+ <pre>
+namespace &lt;schema-namespace> [&lt;cxx-namespace>]
+{
+ (include &lt;file-name>;)*
+ ([type] &lt;schema-type> &lt;cxx-ret-type> [&lt;cxx-arg-type>];)*
+}
+ </pre>
+
+ <p>Both <code><i>&lt;schema-namespace></i></code> and
+ <code><i>&lt;schema-type></i></code> are regex patterns while
+ <code><i>&lt;cxx-namespace></i></code>,
+ <code><i>&lt;cxx-ret-type></i></code>, and
+ <code><i>&lt;cxx-arg-type></i></code> are regex pattern
+ substitutions. All names can be optionally enclosed in
+ <code><b>"&nbsp;"</b></code>, for example, to include white-spaces.</p>
+
+ <p><code><i>&lt;schema-namespace></i></code> determines XML
+ Schema namespace. Optional <code><i>&lt;cxx-namespace></i></code>
+ is prefixed to every C++ type name in this namespace declaration.
+ <code><i>&lt;cxx-ret-type></i></code> is a C++ type name that is
+ used as a return type for the <code><b>post_*</b></code> function
+ in C++/Parser or for element/attribute callbacks in C++/Serializer.
+ Optional <code><i>&lt;cxx-arg-type></i></code> is an argument type
+ for element/attribute callbacks in C++/Parser or for the
+ <code><b>pre</b></code> function in C++/Serializer. If
+ <code><i>&lt;cxx-arg-type></i></code> is not specified, it defaults
+ to <code><i>&lt;cxx-ret-type></i></code> if <code><i>&lt;cxx-ret-type></i></code>
+ ends with <code><b>*</b></code> or <code><b>&amp;</b></code> (that is,
+ it is a pointer or a reference) and
+ <code><b>const</b>&nbsp;<i>&lt;cxx-ret-type></i><b>&amp;</b></code>
+ otherwise.
+ <code><i>&lt;file-name></i></code> is a file name either in the
+ <code><b>"&nbsp;"</b></code> or <code><b>&lt;&nbsp;></b></code> format
+ and is added with the <code><b>#include</b></code> directive to
+ the generated code.</p>
+
+ <p>The <code><b>#</b></code> character starts a comment that ends
+ with a new line or end of file. To specify a name that contains
+ <code><b>#</b></code> enclose it in <code><b>"&nbsp;"</b></code>.
+ For example:</p>
+
+ <pre>
+namespace http://www.example.com/xmlns/my my
+{
+ include "my.hxx";
+
+ # Pass apples by value.
+ #
+ apple apple;
+
+ # Pass oranges as pointers.
+ #
+ orange orange_t*;
+}
+ </pre>
+
+ <p>In the example above, for the
+ <code><b>http://www.example.com/xmlns/my#orange</b></code>
+ XML Schema type, the <code><b>my::orange_t*</b></code> C++ type will
+ be used as both return and argument types.</p>
+
+ <p>Several namespace declarations can be specified in a single
+ file. The namespace declaration can also be completely
+ omitted to map types in a schema without a namespace. For
+ instance:</p>
+
+ <pre>
+include "my.hxx";
+apple apple;
+
+namespace http://www.example.com/xmlns/my
+{
+ orange "const orange_t*";
+}
+ </pre>
+
+ <p>The compiler has a number of predefined mapping rules
+ for the built-in XML Schema types that vary depending on
+ the mapping used. They are described in the following
+ subsections. The last predefined rule for all the mappings
+ maps anything that wasn't mapped by previous rules to
+ <code><b>void</b></code>:</p>
+
+ <pre>
+namespace .*
+{
+ .* void void;
+}
+ </pre>
+
+ <p>When you provide your own type maps with the
+ <code><b>--type-map</b></code> option, they are evaluated first.
+ This allows you to selectively override predefined rules.</p>
+
+
+ <h2>Predefined C++/Parser Type Maps</h2>
+
+ <p>The C++/Parser mapping provides a number of predefined type
+ map rules for the built-in XML Schema types. They can be
+ presented as the following map files:</p>
+
+ <pre>
+namespace http://www.w3.org/2001/XMLSchema
+{
+ boolean bool bool;
+
+ byte "signed char" "signed char";
+ unsignedByte "unsigned char" "unsigned char";
+
+ short short short;
+ unsignedShort "unsigned short" "unsigned short";
+
+ int int int;
+ unsignedInt "unsigned int" "unsigned int";
+
+ long "long long" "long long";
+ unsignedLong "unsigned long long" "unsigned long long";
+
+ integer long long;
+
+ negativeInteger long long;
+ nonPositiveInteger long long;
+
+ positiveInteger "unsigned long" "unsigned long";
+ nonNegativeInteger "unsigned long" "unsigned long";
+
+ float float float;
+ double double double;
+ decimal double double;
+
+ NMTOKENS xml_schema::string_sequence*;
+ IDREFS xml_schema::string_sequence*;
+
+ base64Binary xml_schema::buffer*;
+ hexBinary xml_schema::buffer*;
+
+ date xml_schema::date;
+ dateTime xml_schema::date_time;
+ duration xml_schema::duration;
+ gDay xml_schema::gday;
+ gMonth xml_schema::gmonth;
+ gMonthDay xml_schema::gmonth_day;
+ gYear xml_schema::gyear;
+ gYearMonth xml_schema::gyear_month;
+ time xml_schema::time;
+}
+ </pre>
+
+ <p>If the <code><b>--no-stl</b></code> option is not specified,
+ the following mapping is used for the string-based XML Schema
+ built-in types:</p>
+
+ <pre>
+namespace http://www.w3.org/2001/XMLSchema
+{
+ include &lt;string>;
+
+ string std::string;
+ normalizedString std::string;
+ token std::string;
+ Name std::string;
+ NMTOKEN std::string;
+ NCName std::string;
+ ID std::string;
+ IDREF std::string;
+ language std::string;
+ anyURI std::string;
+
+ QName xml_schema::qname;
+}
+ </pre>
+
+ <p>Otherwise, a C string-based mapping is used:</p>
+
+ <pre>
+namespace http://www.w3.org/2001/XMLSchema
+{
+ string char*;
+ normalizedString char*;
+ token char*;
+ Name char*;
+ NMTOKEN char*;
+ NCName char*;
+ ID char*;
+ IDREF char*;
+ language char*;
+ anyURI char*;
+
+ QName xml_schema::qname*;
+}
+ </pre>
+
+ <h2>Predefined C++/Serializer Type Maps</h2>
+
+ <p>The C++/Serializer mapping provides a number of predefined type
+ map rules for the built-in XML Schema types. They can be
+ presented as the following map files:</p>
+
+ <pre>
+namespace http://www.w3.org/2001/XMLSchema
+{
+ boolean bool bool;
+
+ byte "signed char" "signed char";
+ unsignedByte "unsigned char" "unsigned char";
+
+ short short short;
+ unsignedShort "unsigned short" "unsigned short";
+
+ int int int;
+ unsignedInt "unsigned int" "unsigned int";
+
+ long "long long" "long long";
+ unsignedLong "unsigned long long" "unsigned long long";
+
+ integer long long;
+
+ negativeInteger long long;
+ nonPositiveInteger long long;
+
+ positiveInteger "unsigned long" "unsigned long";
+ nonNegativeInteger "unsigned long" "unsigned long";
+
+ float float float;
+ double double double;
+ decimal double double;
+
+ NMTOKENS "const xml_schema::string_sequence*";
+ IDREFS "const xml_schema::string_sequence*";
+
+ base64Binary "const xml_schema::buffer*";
+ hexBinary "const xml_schema::buffer*";
+
+ date xml_schema::date;
+ dateTime xml_schema::date_time;
+ duration xml_schema::duration;
+ gDay xml_schema::gday;
+ gMonth xml_schema::gmonth;
+ gMonthDay xml_schema::gmonth_day;
+ gYear xml_schema::gyear;
+ gYearMonth xml_schema::gyear_month;
+ time xml_schema::time;
+}
+ </pre>
+
+ <p>If the <code><b>--no-stl</b></code> option is not specified,
+ the following mapping is used for the string-based XML Schema
+ built-in types:</p>
+
+ <pre>
+namespace http://www.w3.org/2001/XMLSchema
+{
+ include &lt;string>;
+
+ string std::string;
+ normalizedString std::string;
+ token std::string;
+ Name std::string;
+ NMTOKEN std::string;
+ NCName std::string;
+ ID std::string;
+ IDREF std::string;
+ language std::string;
+ anyURI std::string;
+
+ QName xml_schema::qname;
+}
+ </pre>
+
+ <p>Otherwise, a C string-based mapping is used:</p>
+
+ <pre>
+namespace http://www.w3.org/2001/XMLSchema
+{
+ string "const char*";
+ normalizedString "const char*";
+ token "const char*";
+ Name "const char*";
+ NMTOKEN "const char*";
+ NCName "const char*";
+ ID "const char*";
+ IDREF "const char*";
+ language "const char*";
+ anyURI "const char*";
+
+ QName "const xml_schema::qname*";
+}
+ </pre>
+
+ <h1>REGEX AND SHELL QUOTING</h1>
+
+ <p>When entering a regular expression argument in the shell
+ command line it is often necessary to use quoting (enclosing
+ the argument in <code><b>"&nbsp;"</b></code> or
+ <code><b>'&nbsp;'</b></code>) in order to prevent the shell
+ from interpreting certain characters, for example, spaces as
+ argument separators and <code><b>$</b></code> as variable
+ expansions.</p>
+
+ <p>Unfortunately it is hard to achieve this in a manner that is
+ portable across POSIX shells, such as those found on
+ GNU/Linux and UNIX, and Windows shell. For example, if you
+ use <code><b>"&nbsp;"</b></code> for quoting you will get a
+ wrong result with POSIX shells if your expression contains
+ <code><b>$</b></code>. The standard way of dealing with this
+ on POSIX systems is to use <code><b>'&nbsp;'</b></code> instead.
+ Unfortunately, Windows shell does not remove <code><b>'&nbsp;'</b></code>
+ from arguments when they are passed to applications. As a result you
+ may have to use <code><b>'&nbsp;'</b></code> for POSIX and
+ <code><b>"&nbsp;"</b></code> for Windows (<code><b>$</b></code> is
+ not treated as a special character on Windows).</p>
+
+ <p>Alternatively, you can save regular expression options into
+ a file, one option per line, and use this file with the
+ <code><b>--options-file</b></code> option. With this approach
+ you don't need to worry about shell quoting.</p>
+
+ <h1>DIAGNOSTICS</h1>
+
+ <p>If the input file is not a valid W3C XML Schema definition,
+ <code><b>xsde</b></code> will issue diagnostic messages to STDERR
+ and exit with non-zero exit code.</p>
+
+ <h1>BUGS</h1>
+
+ <p>Send bug reports to the
+ <a href="mailto:xsde-users@codesynthesis.com">xsde-users@codesynthesis.com</a> mailing list.</p>
+
+ </div>
+ <div id="footer">
+ &copy;2005-2011 <a href="http://codesynthesis.com">CODE SYNTHESIS TOOLS CC</a>
+
+ <div id="terms">
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the
+ <a href="http://codesynthesis.com/licenses/fdl-1.2.txt">GNU Free
+ Documentation License, version 1.2</a>; with no Invariant Sections,
+ no Front-Cover Texts and no Back-Cover Texts.
+ </div>
+ </div>
+</div>
+</body>
+</html>
diff --git a/documentation/xsde-hybrid-header.1 b/documentation/xsde-hybrid-header.1
new file mode 100644
index 0000000..2853956
--- /dev/null
+++ b/documentation/xsde-hybrid-header.1
@@ -0,0 +1,4 @@
+.\"
+.\" C++/Hybrid options.
+.\"
+.SS cxx-hybrid command options
diff --git a/documentation/xsde-hybrid-header.xhtml b/documentation/xsde-hybrid-header.xhtml
new file mode 100644
index 0000000..b208c2a
--- /dev/null
+++ b/documentation/xsde-hybrid-header.xhtml
@@ -0,0 +1 @@
+ <h2>CXX-HYBRID COMMAND OPTIONS</h2>
diff --git a/documentation/xsde-parser-header.1 b/documentation/xsde-parser-header.1
new file mode 100644
index 0000000..b9785f1
--- /dev/null
+++ b/documentation/xsde-parser-header.1
@@ -0,0 +1,4 @@
+.\"
+.\" C++/Parser options.
+.\"
+.SS cxx-parser command options
diff --git a/documentation/xsde-parser-header.xhtml b/documentation/xsde-parser-header.xhtml
new file mode 100644
index 0000000..94fa2c1
--- /dev/null
+++ b/documentation/xsde-parser-header.xhtml
@@ -0,0 +1 @@
+ <h2>CXX-PARSER COMMAND OPTIONS</h2>
diff --git a/documentation/xsde-prologue.1 b/documentation/xsde-prologue.1
new file mode 100644
index 0000000..e03f9e5
--- /dev/null
+++ b/documentation/xsde-prologue.1
@@ -0,0 +1,171 @@
+.\" Process this file with
+.\" groff -man -Tascii xsde.1
+.\"
+.TH XSD/e 1 "September 2011" "XSD/e 3.3.0"
+.SH NAME
+xsde \- W3C XML Schema to C++ Compiler for Embedded Systems
+.\"
+.\"
+.\"
+.\"--------------------------------------------------------------------
+.SH SYNOPSIS
+.\"--------------------------------------------------------------------
+.B xsde
+.I command
+.B [
+.I options
+.B ]
+.I file
+.B [
+.I file
+.B ...]
+.in
+.B xsde help
+.B [
+.I command
+.B ]
+.in
+.B xsde version
+.\"
+.\"
+.\"
+.\"--------------------------------------------------------------------
+.SH DESCRIPTION
+.\"--------------------------------------------------------------------
+.B xsde
+generates vocabulary-specific, statically-typed C++ mapping from W3C XML
+Schema definitions. Particular mapping to produce is selected by a
+.IR command .
+Each mapping has a number of mapping-specific
+.I options
+that should appear, if any, after the
+.IR command .
+Input files should be W3C XML Schema definitions. The exact set of the
+generated files depends on the selected mapping and options.
+.\"
+.\"
+.\"
+.\"--------------------------------------------------------------------
+.SH COMMANDS
+.\"--------------------------------------------------------------------
+.IP \fBcxx-hybrid\fR
+Generate the Embedded C++/Hybrid mapping. For each input file in the
+form
+.B name.xsd
+the following C++ files are generated:
+.B name.hxx
+(object model header file),
+.B name.ixx
+(object model inline file, generated only if the
+.B --generate-inline
+option is specified),
+.B name.cxx
+(object model source file), and
+.B name-fwd.hxx
+(object model forward declaration file, generated only if the
+.B --generate-forward
+option is specified).
+
+If the
+.B --generate-parser
+option is specified, the Embedded C++/Parser mapping is invoked and the
+.BR name-pskel.hxx ,
+.BR name-pskel.ixx ,
+and
+.B name-pskel.cxx
+parser skeleton files are generated, as described below. Additionally,
+the following parser implementation files are generated:
+.B name-pimpl.hxx
+(parser implementation header file) and
+.B name-pimpl.cxx
+(parser implementation source file).
+
+If the
+.B --generate-serializer
+option is specified, the Embedded C++/Serializer mapping is invoked and the
+.BR name-sskel.hxx ,
+.BR name-sskel.ixx ,
+and
+.B name-sskel.cxx
+serializer skeleton files are generated, as described below. Additionally,
+the following serializer implementation files are generated:
+.B name-simpl.hxx
+(serializer implementation header file) and
+.B name-simpl.cxx
+(serializer implementation source file).
+
+.IP \fBcxx-parser\fR
+Generate the Embedded C++/Parser mapping. For each input file in the form
+.B name.xsd
+the following C++ files are generated:
+.B name-pskel.hxx
+(parser skeleton header file),
+.B name-pskel.ixx
+(parser skeleton inline file, generated only if the
+.B --generate-inline
+option is specified), and
+.B name-pskel.cxx
+(parser skeleton source file). If the
+.B --generate-noop-impl
+or
+.B --generate-print-impl
+option is specified, the following additional sample implementation files
+are generated:
+.B name-pimpl.hxx
+(parser implementation header file) and
+.B name-pimpl.cxx
+(parser implementation source file). If the
+.B --generate-test-driver
+option is specified, the additional
+.B name-pdriver.cxx
+test driver file is generated.
+
+.IP \fBcxx-parser\fR
+Generate the Embedded C++/Serializer mapping. For each input file in the form
+.B name.xsd
+the following C++ files are generated:
+.B name-sskel.hxx
+(serializer skeleton header file),
+.B name-sskel.ixx
+(serializer skeleton inline file, generated only if the
+.B --generate-inline
+option is specified), and
+.B name-sskel.cxx
+(serializer skeleton source file). If the
+.B --generate-empty-impl
+option is specified, the following additional sample implementation files
+are generated:
+.B name-simpl.hxx
+(serializer implementation header file) and
+.B name-simpl.cxx
+(serializer implementation source file). If the
+.B --generate-test-driver
+option is specified, the additional
+.B name-sdriver.cxx
+test driver file is generated.
+
+.IP \fBhelp\fR
+Print usage information and exit. Use
+.PP
+.RS
+.RS 3
+.B xsde help
+.I command
+.RE
+.PP
+for command-specific help.
+.RE
+.IP \fBversion\fR
+Print version and exit.
+.\"--------------------------------------------------------------------
+.SH OPTIONS
+.\"--------------------------------------------------------------------
+Command-specific
+.IR options ,
+if any, should appear after the corresponding
+.IR command .
+
+.\"
+.\" Common options.
+.\"
+.SS common options
diff --git a/documentation/xsde-prologue.xhtml b/documentation/xsde-prologue.xhtml
new file mode 100644
index 0000000..c88f65b
--- /dev/null
+++ b/documentation/xsde-prologue.xhtml
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+
+<head>
+ <title>XSD/e 3.3.0 Compiler Command Line Manual</title>
+
+ <meta name="copyright" content="&copy; 2005-2011 Code Synthesis Tools CC"/>
+ <meta name="keywords" content="xsd,xml,schema,c++,mapping,data,binding,code,generator,manual,man,page"/>
+ <meta name="description" content="XSD/e Compiler Command Line Manual"/>
+
+ <link rel="stylesheet" type="text/css" href="default.css" />
+
+<style type="text/css">
+
+ #synopsis {
+ list-style-type: none;
+ }
+
+ #synopsis li {
+ padding-top : 0.0em;
+ padding-bottom : 0.0em;
+ }
+
+ #commands dt {
+ padding-top : 0.4em;
+ }
+
+ #commands dd {
+ padding-bottom : 0.4em;
+ padding-left : 2em;
+ }
+
+ .options dt {
+ padding-top : 0.4em;
+ }
+
+ .options dd {
+ padding-top : 0.1em;
+ padding-bottom : 0.4em;
+ padding-left : 1.4em;
+ }
+
+</style>
+</head>
+
+<body>
+<div id="container">
+ <div id="content">
+
+ <h1>NAME</h1>
+
+ <p>xsde - W3C XML Schema to C++ Compiler for Embedded Systems</p>
+
+ <h1>SYNOPSIS</h1>
+
+ <dl id="synopsis">
+ <dt><code><b>xsde</b> <i>command</i> [<i>options</i>] <i>file</i> [<i>file</i> ...]</code></dt>
+ <dt><code><b>xsde help</b> [<i>command</i>]</code></dt>
+ <dt><code><b>xsde version</b></code></dt>
+ </dl>
+
+ <h1>DESCRIPTION</h1>
+
+ <p><code><b>xsde</b></code> generates vocabulary-specific, statically-typed
+ C++ mapping from W3C XML Schema definitions. Particular mapping to
+ produce is selected by a <code><i>command</i></code>. Each mapping has
+ a number of mapping-specific <code><i>options</i></code> that should
+ appear, if any, after the <code><i>command</i></code>. Input files should
+ be W3C XML Schema definitions. The exact set of the generated files
+ depends on the selected mapping and options.</p>
+
+ <h1>COMMANDS</h1>
+
+ <dl id="commands">
+ <dt><code><b>cxx-hybrid</b></code></dt>
+ <dd>Generate the Embedded C++/Hybrid mapping. For each input file in the
+ form <code><b>name.xsd</b></code> the following C++ files are generated:
+ <code><b>name.hxx</b></code> (object model header file),
+ <code><b>name.ixx</b></code> (object model inline file, generated only
+ if the <code><b>--generate-inline</b></code> option is specified),
+ <code><b>name.cxx</b></code> (object model source file), and
+ <code><b>name-fwd.hxx</b></code> (object model forward declaration
+ file, generated only if the <code><b>--generate-forward</b></code>
+ option is specified).
+
+ <p>If the <code><b>--generate-parser</b></code> option is specified,
+ the Embedded C++/Parser mapping is invoked and the
+ <code><b>name-pskel.hxx</b></code>,
+ <code><b>name-pskel.ixx</b></code>, and
+ <code><b>name-pskel.cxx</b></code> parser skeleton files are
+ generated, as described below. Additionally, the following parser
+ implementation files are generated:
+ <code><b>name-pimpl.hxx</b></code> (parser implementation header
+ file) and
+ <code><b>name-pimpl.cxx</b></code> (parser implementation source
+ file).</p>
+
+ <p>If the <code><b>--generate-serializer</b></code> option is
+ specified, the Embedded C++/Serializer mapping is invoked and the
+ <code><b>name-sskel.hxx</b></code>,
+ <code><b>name-sskel.ixx</b></code>, and
+ <code><b>name-sskel.cxx</b></code> serializer skeleton files are
+ generated, as described below. Additionally, the following serializer
+ implementation files are generated:
+ <code><b>name-simpl.hxx</b></code> (serializer implementation header
+ file) and
+ <code><b>name-simpl.cxx</b></code> (serializer implementation source
+ file).</p>
+ </dd>
+
+ <dt><code><b>cxx-parser</b></code></dt>
+ <dd>Generate the Embedded C++/Parser mapping. For each input file in the
+ form <code><b>name.xsd</b></code> the following C++ files are generated:
+ <code><b>name-pskel.hxx</b></code> (parser skeleton header file),
+ <code><b>name-pskel.ixx</b></code> (parser skeleton inline file,
+ generated only if the <code><b>--generate-inline</b></code>
+ option is specified), and
+ <code><b>name-pskel.cxx</b></code> (parser skeleton source file).
+ If the <code><b>--generate-noop-impl</b></code> or
+ <code><b>--generate-print-impl</b></code> option is specified,
+ the following additional sample implementation files are generated:
+ <code><b>name-pimpl.hxx</b></code> (parser implementation header
+ file) and
+ <code><b>name-pimpl.cxx</b></code> (parser implementation source
+ file). If the <code><b>--generate-test-driver</b></code> option
+ is specified, the additional <code><b>name-pdriver.cxx</b></code>
+ test driver file is generated.</dd>
+
+ <dt><code><b>cxx-serializer</b></code></dt>
+ <dd>Generate the Embedded C++/Serializer mapping. For each input file
+ in the form <code><b>name.xsd</b></code> the following C++ files
+ are generated: <code><b>name-sskel.hxx</b></code> (serializer
+ skeleton header file), <code><b>name-sskel.ixx</b></code> (serializer
+ skeleton inline file, generated only if the
+ <code><b>--generate-inline</b></code> option is specified), and
+ <code><b>name-sskel.cxx</b></code> (serializer skeleton source file).
+ If the <code><b>--generate-empty-impl</b></code> option is specified,
+ the following additional sample implementation files are generated:
+ <code><b>name-simpl.hxx</b></code> (serializer implementation header
+ file) and <code><b>name-simpl.cxx</b></code> (serializer
+ implementation source file). If the <code><b>--generate-test-driver</b></code>
+ option is specified, the additional <code><b>name-sdriver.cxx</b></code>
+ test driver file is generated.
+ </dd>
+
+ <dt><code><b>help</b></code></dt>
+ <dd>Print usage information and exit. Use
+ <p><code><b>xsde help</b> <i>command</i></code></p>
+ for command-specific help.
+ </dd>
+
+ <dt><code><b>version</b></code></dt>
+ <dd>Print version and exit.</dd>
+ </dl>
+
+ <h1>OPTIONS</h1>
+
+ <p>Command-specific <code><i>options</i></code>, if any, should appear
+ after the corresponding <code><i>command</i></code>.</p>
+
+ <h2>COMMON OPTIONS</h2>
diff --git a/documentation/xsde-serializer-header.1 b/documentation/xsde-serializer-header.1
new file mode 100644
index 0000000..e977500
--- /dev/null
+++ b/documentation/xsde-serializer-header.1
@@ -0,0 +1,4 @@
+.\"
+.\" C++/Serializer options.
+.\"
+.SS cxx-serializer command options
diff --git a/documentation/xsde-serializer-header.xhtml b/documentation/xsde-serializer-header.xhtml
new file mode 100644
index 0000000..78988bd
--- /dev/null
+++ b/documentation/xsde-serializer-header.xhtml
@@ -0,0 +1 @@
+ <h2>CXX-SERIALIZER COMMAND OPTIONS</h2>
diff --git a/documentation/xsde.1 b/documentation/xsde.1
deleted file mode 100644
index eee915e..0000000
--- a/documentation/xsde.1
+++ /dev/null
@@ -1,2110 +0,0 @@
-.\" Process this file with
-.\" groff -man -Tascii xsde.1
-.\"
-.TH XSD/e 1 "September 2011" "XSD/e 3.3.0"
-.SH NAME
-xsde \- W3C XML Schema to C++ Compiler for Embedded Systems
-.\"
-.\"
-.\"
-.\"--------------------------------------------------------------------
-.SH SYNOPSIS
-.\"--------------------------------------------------------------------
-.B xsde
-.I command
-.B [
-.I options
-.B ]
-.I file
-.B [
-.I file
-.B ...]
-.in
-.B xsde help
-.B [
-.I command
-.B ]
-.in
-.B xsde version
-.\"
-.\"
-.\"
-.\"--------------------------------------------------------------------
-.SH DESCRIPTION
-.\"--------------------------------------------------------------------
-.B xsde
-generates vocabulary-specific, statically-typed C++ mapping from W3C XML
-Schema definitions. Particular mapping to produce is selected by a
-.IR command .
-Each mapping has a number of mapping-specific
-.I options
-that should appear, if any, after the
-.IR command .
-Input files should be W3C XML Schema definitions. The exact set of the
-generated files depends on the selected mapping and options.
-.\"
-.\"
-.\"
-.\"--------------------------------------------------------------------
-.SH COMMANDS
-.\"--------------------------------------------------------------------
-.IP \fBcxx-hybrid\fR
-Generate the Embedded C++/Hybrid mapping. For each input file in the
-form
-.B name.xsd
-the following C++ files are generated:
-.B name.hxx
-(object model header file),
-.B name.ixx
-(object model inline file, generated only if the
-.B --generate-inline
-option is specified),
-.B name.cxx
-(object model source file), and
-.B name-fwd.hxx
-(object model forward declaration file, generated only if the
-.B --generate-forward
-option is specified).
-
-If the
-.B --generate-parser
-option is specified, the Embedded C++/Parser mapping is invoked and the
-.BR name-pskel.hxx ,
-.BR name-pskel.ixx ,
-and
-.B name-pskel.cxx
-parser skeleton files are generated, as described below. Additionally,
-the following parser implementation files are generated:
-.B name-pimpl.hxx
-(parser implementation header file) and
-.B name-pimpl.cxx
-(parser implementation source file).
-
-If the
-.B --generate-serializer
-option is specified, the Embedded C++/Serializer mapping is invoked and the
-.BR name-sskel.hxx ,
-.BR name-sskel.ixx ,
-and
-.B name-sskel.cxx
-serializer skeleton files are generated, as described below. Additionally,
-the following serializer implementation files are generated:
-.B name-simpl.hxx
-(serializer implementation header file) and
-.B name-simpl.cxx
-(serializer implementation source file).
-
-.IP \fBcxx-parser\fR
-Generate the Embedded C++/Parser mapping. For each input file in the form
-.B name.xsd
-the following C++ files are generated:
-.B name-pskel.hxx
-(parser skeleton header file),
-.B name-pskel.ixx
-(parser skeleton inline file, generated only if the
-.B --generate-inline
-option is specified), and
-.B name-pskel.cxx
-(parser skeleton source file). If the
-.B --generate-noop-impl
-or
-.B --generate-print-impl
-option is specified, the following additional sample implementation files
-are generated:
-.B name-pimpl.hxx
-(parser implementation header file) and
-.B name-pimpl.cxx
-(parser implementation source file). If the
-.B --generate-test-driver
-option is specified, the additional
-.B name-pdriver.cxx
-test driver file is generated.
-
-.IP \fBcxx-parser\fR
-Generate the Embedded C++/Serializer mapping. For each input file in the form
-.B name.xsd
-the following C++ files are generated:
-.B name-sskel.hxx
-(serializer skeleton header file),
-.B name-sskel.ixx
-(serializer skeleton inline file, generated only if the
-.B --generate-inline
-option is specified), and
-.B name-sskel.cxx
-(serializer skeleton source file). If the
-.B --generate-empty-impl
-option is specified, the following additional sample implementation files
-are generated:
-.B name-simpl.hxx
-(serializer implementation header file) and
-.B name-simpl.cxx
-(serializer implementation source file). If the
-.B --generate-test-driver
-option is specified, the additional
-.B name-sdriver.cxx
-test driver file is generated.
-
-.IP \fBhelp\fR
-Print usage information and exit. Use
-.PP
-.RS
-.RS 3
-.B xsde help
-.I command
-.RE
-.PP
-for command-specific help.
-.RE
-.IP \fBversion\fR
-Print version and exit.
-.\"--------------------------------------------------------------------
-.SH OPTIONS
-.\"--------------------------------------------------------------------
-Command-specific
-.IR options ,
-if any, should appear after the corresponding
-.IR command .
-
-.\"
-.\" Common options
-.\"
-.SS common options
-
-.IP "\fB\--output-dir \fIdir\fR"
-Write generated files to
-.I dir
-instead of the current directory.
-
-.IP "\fB\--char-encoding \fIenc\fR"
-Specify the application character encoding. Valid values are
-.B utf8
-(default) and
-.BR iso8859-1 .
-Note that this encoding is not the same as the XML document encoding
-that is being parsed or serialized. Rather, it is the encoding that
-is used inside the application. When an XML document is parsed, the
-character data is automatically converted to the application encoding.
-Similarly, when an XML document is serialized, the data in the
-application encoding is automatically converted to the resulting
-document encoding.
-
-.IP "\fB\--no-stl\fR"
-Generate code that does not use the Standard Template Library (STL).
-
-.IP "\fB\--no-iostream\fR"
-Generate code that does not use the standard input/output stream
-library (iostream).
-
-.IP "\fB\--no-exceptions\fR"
-Generate code that does not use C++ exceptions.
-
-.IP "\fB\--no-long-long\fR"
-Generate code that does not use the
-.B long long
-and
-.B unsigned long long
-types. The 64 bit
-.B long
-and
-.B unsignedLong
-built-in XML Schema types are then mapped to
-.B long
-and
-.B unsigned
-.BR long .
-
-.IP "\fB\--custom-allocator\fR"
-Generate code that performs memory management using custom allocator
-functions provided by your application instead of the standard operator
-new/delete.
-
-.IP "\fB\--generate-inline\fR"
-Generate simple functions inline. This option triggers creation of the
-inline file.
-
-.IP "\fB\--namespace-map \fIxns\fB=\fIcns"
-Map XML Schema namespace
-.I xns
-to C++ namespace
-.IR cns .
-Repeat this option to specify mapping for more than one XML Schema namespace.
-For example, the following option:
-
-.B --namespace-map http://example.com/foo/bar=foo::bar
-
-will map the
-.B http://example.com/foo/bar
-XML Schema namespace to the
-.B foo::bar
-C++ namespace.
-.
-.IP "\fB\--namespace-regex \fIregex\fR"
-Add
-.I regex
-to the list of regular expressions used to translate XML Schema namespace
-names to C++ namespace names.
-.I regex
-is a perl-like regular expression in the form
-.BI / pattern / replacement /\fR.
-Any character can be used as a delimiter instead of
-.BR / .
-Escaping of the delimiter character in
-.I pattern
-or
-.I replacement
-is not supported.
-
-All the regular expressions are pushed into a stack with the last specified
-expression considered first. The first match that succeeds is used. Regular
-expressions are applied to a string in the form
-
-.I filename namespace
-
-For example, if you have file
-.B hello.xsd
-with namespace
-.B http://example.com/hello
-and you run
-.B xsd
-on this file, then the string in question will be:
-
-.B hello.xsd. http://example.com/hello
-
-For the built-in XML Schema namespace the string is:
-
-.B XMLSchema.xsd http://www.w3.org/2001/XMLSchema
-
-The following three steps are performed for each regular expression until
-the match is found:
-.RS
-.RS 3
-.TP 3
-1.
-The expression is applied and if the result is empty the next expression
-is considered.
-.TP 3
-2.
-All
-.B /
-are replaced with
-.BR :: .
-.TP 3
-3.
-The result is verified to be a valid C++ scope name (e.g.,
-.BR foo::bar ).
-If this test succeeds, the result is used as a C++ namespace name.
-.RE
-.PP
-As an example, the following expression maps XML Schema namespaces in the
-form
-.B http://example.com/foo/bar
-to C++ namespaces in the form
-.BR foo::bar :
-.PP
-.B "%.* http://example.com/(.+)%$1%"
-
-See also the REGEX AND SHELL QUOTING section below.
-.RE
-
-.IP "\fB\--namespace-regex-trace\fR"
-Trace the process of applying regular expressions specified with
-the
-.B --namespace-regex
-option. Use this option to find out why your regular expressions
-don't do what you expected them to do.
-
-\"
-\" Reserved names.
-\"
-
-.IP "\fB\--reserved-name \fIname\fR[\fB=\fIrep\fR]"
-Add
-.I name
-to the list of names that should not be used as identifiers. The name
-can optionally be followed by
-.B =
-and the replacement name that should be used instead. All the C++ keywords
-are already in this list.
-
-.IP "\fB\--include-with-brackets\fR"
-Use angle brackets (<>) instead of quotes ("") in generated
-.B #include
-directives.
-
-.IP "\fB\--include-prefix \fIprefix\fR"
-Add
-.I prefix
-to generated
-.B #include
-directive paths.
-
-For example, if you had the following import element in your schema
-
-.B <import namespace="..." schemaLocation="base.xsd"/>
-
-and compiled this fragment with
-.B --include-prefix schemas/\fR,
-then the include directive in the generated code would be:
-
-.B #include "schemas/base.hxx"
-
-.IP "\fB\--include-regex \fIregex\fR"
-Add
-.I regex
-to the list of regular expressions used to transform
-.B #include
-directive paths.
-.I regex
-is a perl-like regular expression in the form
-.BI / pattern / replacement /\fR.
-Any character can be used as a delimiter instead of
-.BR / .
-Escaping of the delimiter character in
-.I pattern
-or
-.I replacement
-is not supported.
-
-All the regular expressions are pushed into a stack with the last specified
-expression considered first. The first match that succeeds is used.
-
-As an example, the following expression transforms paths in the form
-.B schemas/foo/bar
-to paths in the form
-.BR generated/foo/bar :
-
-.B "%schemas/(.+)%generated/$1%"
-
-See also the REGEX AND SHELL QUOTING section below.
-
-.IP "\fB\--include-regex-trace\fR"
-Trace the process of applying regular expressions specified with
-the
-.B --include-regex
-option. Use this option to find out why your regular expressions
-don't do what you expected them to do.
-
-.IP "\fB\--guard-prefix \fIprefix\fR"
-Add
-.I prefix
-to generated header inclusion guards. The prefix is transformed to upper
-case and characters that are illegal in a preprocessor macro name are
-replaced with underscores. If this option is not specified then the
-directory part of the input schema file is used as a prefix.
-
-.IP "\fB\--hxx-suffix \fIsuffix\fR"
-Use the provided
-.I suffix
-instead of the default
-.B .hxx
-to construct the name of the header file. Note that this suffix is also
-used to construct names for included/imported schemas.
-.IP "\fB\--ixx-suffix \fIsuffix\fR"
-Use the provided
-.I suffix
-instead of the default
-.B .ixx
-to construct the name of the inline file.
-.IP "\fB\--cxx-suffix \fIsuffix\fR"
-Use the provided
-.I suffix
-instead of the default
-.B .cxx
-to construct the name of the source file.
-.IP "\fB\--fwd-suffix \fIsuffix\fR"
-Use the provided
-.I suffix
-instead of the default
-.B -fwd.hxx
-to construct the name of the forward declaration file (C++/Hybrid
-mapping only).
-
-.IP "\fB\--hxx-regex \fIregex\fR"
-Use the provided expression to construct the name of the header file.
-.I regex
-is a perl-like regular expression in the form
-.BI / pattern / replacement /\fR.
-This expression is also used to construct names for included/imported schemas.
-
-For the C++/Hybrid mapping, the
-.I regex
-argument can be optionally prefixed with a file key in the form
-.IB key = regex\fR.
-The valid values for
-.I key
-are
-.B pskel
-(parser skeleton files),
-.B pimpl
-(parser implementation files),
-.B sskel
-(serializer skeleton files),
-.B simpl
-(serializer implementation files), and
-.B *
-(all files). If
-.I key
-is empty or not present then the expression is used for the object model
-files only.
-
-See also the REGEX AND SHELL QUOTING section below.
-
-.IP "\fB\--ixx-regex \fIregex\fR"
-Use the provided expression to construct the name of the inline file.
-.I regex
-is a perl-like regular expression in the form
-.BI / pattern / replacement /\fR.
-For the C++/Hybrid mapping, the
-.I regex
-argument can be optionally prefixed with a file key. See the
-.B --hxx-regex
-option for details.
-See also the REGEX AND SHELL QUOTING section below.
-
-.IP "\fB\--cxx-regex \fIregex\fR"
-Use the provided expression to construct the name of the source file.
-.I regex
-is a perl-like regular expression in the form
-.BI / pattern / replacement /\fR.
-For the C++/Hybrid mapping, the
-.I regex
-argument can be optionally prefixed with a file key. See the
-.B --hxx-regex
-option for details.
-See also the REGEX AND SHELL QUOTING section below.
-
-.IP "\fB\--fwd-regex \fIregex\fR"
-Use the provided expression to construct the name of the forward
-declaration file (C++/Hybrid mapping only).
-.I regex
-is a perl-like regular expression in the form
-.BI / pattern / replacement /\fR.
-See also the REGEX AND SHELL QUOTING section below.
-
-.IP "\fB\--hxx-prologue \fItext\fR"
-Insert
-.I text
-at the beginning of the header file.
-
-For the C++/Hybrid mapping, the
-.I text
-argument can be optionally prefixed with a file key in the form
-.IB key = text\fR.
-The valid values for
-.I key
-are
-.B pskel
-(parser skeleton files),
-.B pimpl
-(parser implementation files),
-.B sskel
-(serializer skeleton files),
-.B simpl
-(serializer implementation files), and
-.B *
-(all files). If
-.I key
-is empty or not present then the text is used for the object model files only.
-
-.IP "\fB\--ixx-prologue \fItext\fR"
-Insert
-.I text
-at the beginning of the inline file.
-For the C++/Hybrid mapping, the
-.I text
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue
-option for details.
-
-.IP "\fB\--cxx-prologue \fItext\fR"
-Insert
-.I text
-at the beginning of the source file.
-For the C++/Hybrid mapping, the
-.I text
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue
-option for details.
-
-.IP "\fB\--fwd-prologue \fItext\fR"
-Insert
-.I text
-at the beginning of the forward declaration file (C++/Hybrid mapping only).
-
-.IP "\fB\--prologue \fItext\fR"
-Insert
-.I text
-at the beginning of each generated file for which there is no file-specific
-prologue.
-For the C++/Hybrid mapping, the
-.I text
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue
-option for details.
-
-.IP "\fB\--hxx-epilogue \fItext\fR"
-Insert
-.I text
-at the end of the header file.
-For the C++/Hybrid mapping, the
-.I text
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue
-option for details.
-
-.IP "\fB\--ixx-epilogue \fItext\fR"
-Insert
-.I text
-at the end of the inline file.
-For the C++/Hybrid mapping, the
-.I text
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue
-option for details.
-
-.IP "\fB\--cxx-epilogue \fItext\fR"
-Insert
-.I text
-at the end of the source file.
-For the C++/Hybrid mapping, the
-.I text
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue
-option for details.
-
-.IP "\fB\--fwd-epilogue \fItext\fR"
-Insert
-.I text
-at the end of the forward declaration file (C++/Hybrid mapping only).
-
-.IP "\fB\--epilogue \fItext\fR"
-Insert
-.I text
-at the end of each generated file for which there is no file-specific
-epilogue.
-For the C++/Hybrid mapping, the
-.I text
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue
-option for details.
-
-.IP "\fB\--hxx-prologue-file \fIfile\fR"
-Insert the content of the
-.I file
-at the beginning of the header file.
-
-For the C++/Hybrid mapping, the
-.I file
-argument can be optionally prefixed with a file key in the form
-.IB key = file\fR.
-The valid values for
-.I key
-are
-.B pskel
-(parser skeleton files),
-.B pimpl
-(parser implementation files),
-.B sskel
-(serializer skeleton files),
-.B simpl
-(serializer implementation files), and
-.B *
-(all files). If
-.I key
-is empty or not present then the file is used for the object model files only.
-
-.IP "\fB\--ixx-prologue-file \fIfile\fR"
-Insert the content of the
-.I file
-at the beginning of the inline file.
-For the C++/Hybrid mapping, the
-.I file
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue-file
-option for details.
-
-.IP "\fB\--cxx-prologue-file \fIfile\fR"
-Insert the content of the
-.I file
-at the beginning of the source file.
-For the C++/Hybrid mapping, the
-.I file
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue-file
-option for details.
-
-.IP "\fB\--fwd-prologue-file \fIfile\fR"
-Insert the content of the
-.I file
-at the beginning of the forward declaration file (C++/Hybrid mapping only).
-
-.IP "\fB\--prologue-file \fIfile\fR"
-Insert the content of the
-.I file
-at the beginning of each generated file for which there is no file-specific
-prologue file.
-For the C++/Hybrid mapping, the
-.I file
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue-file
-option for details.
-
-.IP "\fB\--hxx-epilogue-file \fIfile\fR"
-Insert the content of the
-.I file
-at the end of the header file.
-For the C++/Hybrid mapping, the
-.I file
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue-file
-option for details.
-
-.IP "\fB\--ixx-epilogue-file \fIfile\fR"
-Insert the content of the
-.I file
-at the end of the inline file.
-For the C++/Hybrid mapping, the
-.I file
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue-file
-option for details.
-
-.IP "\fB\--cxx-epilogue-file \fIfile\fR"
-Insert the content of the
-.I file
-at the end of the source file.
-For the C++/Hybrid mapping, the
-.I file
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue-file
-option for details.
-
-.IP "\fB\--fwd-epilogue-file \fIfile\fR"
-Insert the content of the
-.I file
-at the end of the forward declaration file (C++/Hybrid mapping only).
-
-.IP "\fB\--epilogue-file \fIfile\fR"
-Insert the content of the
-.I file
-at the end of each generated file for which there is no file-specific
-epilogue file.
-For the C++/Hybrid mapping, the
-.I file
-argument can be optionally prefixed with a file key. See the
-.B --hxx-prologue-file
-option for details.
-
-.IP "\fB\--disable-warning \fIwarn\fR"
-Disable printing warning with id
-.IR warn .
-If
-.B all
-is specified for the warning id then all the warnings are disabled.
-
-.IP "\fB\--show-sloc\fR"
-Show the number of generated physical source lines of code (SLOC).
-
-.IP "\fB\--sloc-limit \fInum\fR"
-Check that the number of generated physical source lines of code (SLOC)
-does not exceed
-.I num.
-
-.IP "\fB\--options-file \fIfile\fR"
-Read additional options from
-.IR file .
-Each option should appear on a separate line optionally followed by
-space and an argument. Empty lines and lines starting with
-.B #
-are ignored. The semantics of providing options in a file is equivalent
-to providing the same set of options in the same order in the command
-line at the point where the
-.B --options-file
-option is specified except that shell escaping and quoting is not
-required. Repeat this option to specify more than one options files.
-
-.IP "\fB\--proprietary-license\fR"
-Indicate that the generated code is licensed under a proprietary license
-instead of the GPL.
-
-.IP "\fB\--preserve-anonymous\fR"
-Preserve anonymous types. By default anonymous types are
-automatically named with names derived from the enclosing
-elements/attributes. Because mappings implemented by this
-compiler require all types to be named, this option is only
-useful if you want to make sure your schemas don't have
-anonymous types.
-
-.IP "\fB\--show-anonymous\fR"
-Show elements and attributes that are of anonymous types. This option
-only makes sense together with the
-.B --preserve-anonymous
-option.
-
-.IP "\fB\--anonymous-regex \fIregex\fR"
-Add
-.I regex
-to the list of regular expressions used to derive names for anonymous
-types from the enclosing attributes/elements.
-.I regex
-is a perl-like regular expression in the form
-.BI / pattern / replacement /\fR.
-Any character can be used as a delimiter instead of
-.BR / .
-Escaping of the delimiter character in
-.I pattern
-or
-.I replacement
-is not supported.
-
-All the regular expressions are pushed into a stack with the last
-specified expression considered first. The first match that
-succeeds is used. Regular expressions are applied to a string
-in the form
-
-.I filename namespace xpath
-
-For instance:
-
-.B hello.xsd http://example.com/hello element
-
-.B hello.xsd http://example.com/hello type/element
-
-As an example, the following expression makes all the derived
-names start with capital letters. This could be useful when
-your naming convention requires type names to start with
-capital letters:
-
-.B %.* .* (.+/)*(.+)%\\\\u$2%
-
-See also the REGEX AND SHELL QUOTING section below.
-
-.IP "\fB\--anonymous-regex-trace\fR"
-Trace the process of applying regular expressions specified with
-the
-.B --anonymous-regex
-option. Use this option to find out why your regular expressions
-don't do what you expected them to do.
-
-.IP "\fB\--location-map \fIol\fB=\fInl"
-Map the original schema location
-.I ol
-that is specified in the XML Schema include or import elements to new
-schema location
-.IR nl .
-Repeat this option to map more than one schema location. For example,
-the following option maps the
-.B http://example.com/foo.xsd
-URL to the
-.B foo.xsd
-local file.
-
-.B --location-map http://example.com/foo.xsd=foo.xsd
-
-.IP "\fB\--location-regex \fIregex\fR"
-Add
-.I regex
-to the list of regular expressions used to map schema locations that are
-specified in the XML Schema include or import elements.
-.I regex
-is a perl-like regular expression in the form
-.BI / pattern / replacement /\fR.
-Any character can be used as a delimiter instead of
-.BR / .
-Escaping of the delimiter character in
-.I pattern
-or
-.I replacement
-is not supported. All the regular expressions are pushed into a stack with the
-last specified expression considered first. The first match that succeeds
-is used.
-
-For example, the following expression maps URL locations in the form
-.B http://example.com/foo/bar.xsd
-to local files in the form
-.BR bar.xsd :
-
-.B %http://.+/(.+)%$1%
-
-See also the REGEX AND SHELL QUOTING section below.
-
-.IP "\fB\--location-regex-trace\fR"
-Trace the process of applying regular expressions specified with
-the
-.B --location-regex
-option. Use this option to find out why your regular expressions
-don't do what you expected them to do.
-
-.IP "\fB\--file-per-type\fR"
-Generate a separate set of C++ files for each type defined in XML Schema.
-Note that in this mode you only need to compile the root schema(s) and the
-code will be generated for all included and imported schemas. This
-compilation mode is primarily useful when some of your schemas cannot be
-compiled separately or have cyclic dependencies which involve type
-inheritance. Other options related to this mode are:
-.BR --type-file-regex ,
-.BR --schema-file-regex,
-and
-.BR --file-list .
-
-.IP "\fB\--type-file-regex \fIregex\fR"
-Add
-.I regex
-to the list of regular expressions used to translate type names to file
-names when the
-.B --file-per-type
-option is specified.
-.I regex
-is a perl-like regular expression in the form
-.BI / pattern / replacement /\fR.
-Any character can be used as a delimiter instead of
-.BR / .
-Escaping of the delimiter character in
-.I pattern
-or
-.I replacement
-is not supported. All the regular expressions are pushed into a stack with
-the last specified expression considered first. The first match that
-succeeds is used. Regular expressions are applied to a string
-in the form
-
-.I namespace type-name
-
-For example, the following expression maps type
-.B foo
-that is defined in the
-.B http://example.com/bar
-namespace to file name
-.BR bar-foo :
-
-.B %http://example.com/(.+) (.+)%$1-$2%
-
-See also the REGEX AND SHELL QUOTING section below.
-
-.IP "\fB\--type-file-regex-trace\fR"
-Trace the process of applying regular expressions specified with
-the
-.B --type-file-regex
-option. Use this option to find out why your regular expressions
-don't do what you expected them to do.
-
-.IP "\fB\--schema-file-regex \fIregex\fR"
-Add
-.I regex
-to the list of regular expressions used to translate schema file names
-when the
-.B --file-per-type
-option is specified.
-.I regex
-is a perl-like regular expression in the form
-.BI / pattern / replacement /\fR.
-Any character can be used as a delimiter instead of
-.BR / .
-Escaping of the delimiter character in
-.I pattern
-or
-.I replacement
-is not supported. All the regular expressions are pushed into a stack
-with the last specified expression considered first. The first match
-that succeeds is used. Regular expressions are applied to the absolute
-filesystem path of a schema file and the result, including the directory
-part, if any, is used to derive the
-.B #include
-directive paths as well as the generated C++ file paths. This option, along
-with
-.B --type-file-regex
-are primarily used to place the generated files into subdirectories or to
-resolve file name conflicts.
-
-For example, the following expression maps schema files in the
-.B foo/1.0.0/
-subdirectory to the files in the
-.B foo/
-subdirectory. As a result, the
-.B #include
-directive paths for such schemas will be in the
-.B foo/schema.hxx
-form and the generated C++ files will be placed into the
-.B foo/
-subdirectory:
-
-.B %.*/foo/1.0.0/(.+)%foo/$1%
-
-See also the REGEX AND SHELL QUOTING section below.
-
-.IP "\fB\--schema-file-regex-trace\fR"
-Trace the process of applying regular expressions specified with
-the
-.B --schema-file-regex
-option. Use this option to find out why your regular expressions
-don't do what you expected them to do.
-
-.IP "\fB\--fat-type-file\fR"
-Generate code corresponding to global elements into type files
-instead of schema files when the
-.B --type-file-regex
-option is specified. This option is primarily useful when trying
-to minimize the amount of object code that is linked to an executable
-by packaging compiled generated code into a static (archive) library.
-
-.IP "\fB\--file-list \fIfile\fR"
-Write a list of generated C++ files to
-.IR file .
-This option is primarily useful in the file-per-type compilation mode
-.RB ( --file-per-type )
-to create a list of generated C++ files, for example, as a makefile fragment.
-
-.IP "\fB\--file-list-prologue \fItext\fR"
-Insert
-.I text
-at the beginning of the file list. As a convenience, all occurrences of the
-\\n character sequence in
-.I text
-are replaced with new lines. This option can, for example, be used to assign
-the generated file list to a makefile variable.
-
-.IP "\fB\--file-list-epilogue \fItext\fR"
-Insert
-.I text
-at the end of the file list. As a convenience, all occurrences of the
-\\n character sequence in
-.I text
-are replaced with new lines.
-
-.IP "\fB\--file-list-delim \fItext\fR"
-Delimit file names written to the file list with
-.I text
-instead of new lines. As a convenience, all occurrences of the \\n character
-sequence in
-.I text
-are replaced with new lines.
-
-.\"
-.\" C++/Hybrid options
-.\"
-.SS cxx-hybrid command options
-
-.IP "\fB\--generate-parser\fR"
-Generate XML parsing code.
-
-.IP "\fB\--generate-serializer\fR"
-Generate XML serialization code.
-
-.IP "\fB\--generate-aggregate\fR"
-Generate parser/serializer aggregates for root elements and/or
-types. See also the
-.B --root-element-*
-and
-.B --root-type
-options.
-
-.IP "\fB\--suppress-validation\fR"
-Suppress the generation of validation code in parser and serializer.
-
-.IP "\fB\--suppress-parser-val\fR"
-Suppress the generation of validation code in parser.
-
-.IP "\fB\--suppress-serializer-val\fR"
-Suppress the generation of validation code in serializer.
-
-.IP "\fB\--omit-default-attributes\fR"
-Omit attributes with default and fixed values from serialized XML
-documents.
-
-.IP "\fB\--suppress-enum\fR"
-Suppress the generation of the XML Schema enumeration to C++ enum mapping.
-
-.IP "\fB\--generate-clone\fR"
-Generate clone functions for variable-length types. These functions allow
-you to make dynamically-allocated copies of variable-length objects.
-
-.IP "\fB\--generate-detach\fR"
-Generate detach functions for elements and attributes of variable-length
-types. These functions, for example, allow you to move sub-trees in the
-object model either within the same tree or between different trees.
-
-.IP "\fB\--generate-insertion \fIos\fR"
-Generate data representation stream insertion operators for the
-.I os
-output stream type. Repeat this option to specify more than one stream
-type. The special
-.B CDR
-and
-.B XDR
-arguments are recognized as ACE CDR and Sun RPC XDR stream types and the
-corresponding stream wrappers provided by the XSD/e runtime are automatically
-used. For custom stream types use the
-.B --hxx-prologue*
-options to include the necessary declarations.
-
-.IP "\fB\--generate-extraction \fIis\fR"
-Generate data representation stream extraction operators for the
-.I is
-input stream type. Repeat this option to specify more than one stream
-type. The special
-.B CDR
-and
-.B XDR
-arguments are recognized as ACE CDR and Sun RPC XDR stream types and the
-corresponding stream wrappers provided by the XSD/e runtime are automatically
-used. For custom stream types use the
-.B --hxx-prologue*
-options to include the necessary declarations.
-
-.IP "\fB\--generate-forward\fR"
-Generate forward declaration file.
-
-.IP "\fB\--generate-xml-schema\fR"
-Generate C++ header files as if the schema being compiled defines
-the XML Schema namespace. In particular, the resulting files will
-have definitions for all object model types, parser skeletons and
-implementations, as well as serializer skeletons and implementations
-corresponding to the XML Schema built-in types. The schema file
-provided to the compiler need not exist and is only used to derive
-the names of the resulting header files. Use the
-.B --extern-xml-schema
-option to include these file in the generated files for other schemas.
-
-.IP "\fB\--extern-xml-schema \fIfile\fR"
-Include header files derived from
-.I file
-instead of generating the XML Schema namespace mapping inline. The
-provided file need not exist and is only used to derive the names
-of the included header files. Use the
-.B --generate-xml-schema
-option to generate these header files.
-
-.IP "\fB\--suppress-reset\fR"
-Suppress the generation of parser and serializer reset code.
-Reset support allows you to reuse parsers and serializers
-after an error.
-
-.IP "\fB\--generate-polymorphic\fR"
-Generate polymorphism-aware code. Specify this option if you use substitution
-groups or
-.BR xsi:type .
-Use the
-.B --polymorphic-type
-option to specify which type hierarchies are polymorphic.
-
-.IP "\fB\--runtime-polymorphic\fR"
-Generate non-polymorphic code that uses the runtime library configured with
-polymorphism support.
-
-.IP "\fB\--polymorphic-type \fItype\fR"
-Indicate that
-.I type
-is a root of a polymorphic type hierarchy. The compiler can often
-automatically determine which types are polymorphic based on the
-substitution group declarations. However, you may need to use this
-option if you are not using substitution groups or if substitution
-groups are defined in another schema. You need to specify this option
-when compiling every schema file that references
-.IR type .
-
-.IP "\fB\--generate-typeinfo\fR"
-Generate custom type information querying functions for polymorphic
-object model types. These functions can be used instead of the standard
-C++ RTTI mechanism to determine object's type at runtime.
-
-.IP "\fB\--polymorphic-schema \fIfile\fR"
-Indicate that
-.I file
-contains derivations of polymorphic types that are not otherwise visible
-from the schema being compiled. This option is used to make sure that
-during the generation of parser and serializer aggregates the compiler
-is aware of all possible derivations of polymorphic types. Repeat this
-option to specify more than one schema file.
-
-.IP "\fB\--reuse-style-mixin\fR"
-Generate code that supports the mixin base parser/serializer
-implementation reuse style. Note that this reuse style
-relies on virtual inheritance and may result in a substantial
-object code size increase for large vocabularies. By default
-the tiein reuse style is used.
-
-.IP "\fB\--custom-data \fItype\fR"
-Add the ability to store custom data to the C++ class generated
-for XML Schema type
-.IR type .
-To add custom data to a nested compositor class use the qualified
-name starting from the XML Schema type containing the compositor,
-for example,
-.BR foo::sequence::choise1 .
-
-.IP "\fB\--custom-type \fIname\fR[\fB=\fR[\fIflags\fR][\fB/\fR[\fIbase\fR][\fB/\fR[\fItype\fR][\fB/\fIinclude\fR]]]]"
-Use a custom type implementation instead of the generated version. The
-.I name
-component is the XML Schema type name being customized. Optional
-.I flags
-allow you to specify whether the custom type is fixed or variable-length. The
-.B f
-flag indicates the type is fixed-length and the
-.B v
-flag indicates the type is variable-length. If omitted, the default rules
-are used to determine the type length. Optional
-.I type
-is a C++ type name that should be used instead. If specified, the object
-model type is defined as a
-.B typedef
-alias for this C++ type. Optional
-.I base
-is a C++ name that should be given to the generated version. It is normally
-used as a base for the custom implementation. Optional
-.I include
-is the header file that defines the custom implementation. It is
-.BR #include 'ed
-into the generated code immediately after (if
-.I base
-is specified) or instead of the generated version.
-
-.IP "\fB\--custom-parser \fIname\fR[\fB=\fR[\fIbase\fR][\fB/\fIinclude\fR]]"
-Use a custom parser implementation instead of the generated version.
-The
-.I name
-component is the XML Schema type name being customized. Optional
-.I base
-is a C++ name that should be given to the generated version. It is
-normally used as a base for the custom implementation. Optional
-.I include
-is the header file that defines the custom implementation. It is
-.BR #include 'ed
-into the generated code immediately after (if
-.I base
-is specified) or instead of the generated version.
-
-.IP "\fB\--custom-serializer \fIname\fR[\fB=\fR[\fIbase\fR][\fB/\fIinclude\fR]]"
-Use a custom serializer implementation instead of the generated version.
-The
-.I name
-component is the XML Schema type name being customized. Optional
-.I base
-is a C++ name that should be given to the generated version. It is
-normally used as a base for the custom implementation. Optional
-.I include
-is the header file that defines the custom implementation. It is
-.BR #include 'ed
-into the generated code immediately after (if
-.I base
-is specified) or instead of the generated version.
-
-.IP "\fB\--root-element-first\fR"
-Treat only the first global element as a document root. This
-determines for which elements parser and serializer aggregates
-are generated. By default all global elements are considered
-document roots. See also the
-.B --generate-aggregate
-option.
-
-.IP "\fB\--root-element-last\fR"
-Treat only the last global element as a document root. This
-determines for which elements parser and serializer aggregates
-are generated. By default all global elements are considered
-document roots. See also the
-.B --generate-aggregate
-option.
-
-.IP "\fB\--root-element-all\fR"
-Treat all global elements as document roots (the default
-behavior). This determines for which elements parser and
-serializer aggregates are generated. By explicitly specifying
-this option you can suppress the warning that is issued if
-more than one global element is defined. See also the
-.B --generate-aggregate
-option.
-
-.IP "\fB\--root-element-none\fR"
-Do not treat any global elements as document roots. This
-determines for which elements parser and serializer aggregates
-are generated. By default all global elements are considered
-document roots. See also the
-.B --generate-aggregate
-option.
-
-.IP "\fB\--root-element \fIelement\fR"
-Treat only
-.I element
-as a document root. This
-determines for which elements parser and serializer aggregates
-are generated. Repeat this option to specify more than one root
-element. See also the
-.B --generate-aggregate
-option.
-
-.IP "\fB\--root-type \fItype\fR"
-Generate parser/serializer aggregate for
-.IR type .
-Repeat this option to specify more than one type. See also the
-.B --generate-aggregate
-option.
-
-.IP "\fB\--pskel-type-suffix \fIsuffix\fR"
-Use
-.I suffix
-instead of the default
-.B _pskel
-to construct the names of generated parser skeletons.
-
-.IP "\fB\--sskel-type-suffix \fIsuffix\fR"
-Use
-.I suffix
-instead of the default
-.B _sskel
-to construct the names of generated serializer skeletons.
-
-.IP "\fB\--pskel-file-suffix \fIsuffix\fR"
-Use
-.I suffix
-instead of the default
-.B -pskel
-to construct the names of generated parser skeleton files.
-
-.IP "\fB\--sskel-file-suffix \fIsuffix\fR"
-Use
-.I suffix
-instead of the default
-.B -sskel
-to construct the names of generated serializer skeleton files.
-
-.IP "\fB\--pimpl-type-suffix \fIsuffix\fR"
-Use
-.I suffix
-instead of the default
-.B _pimpl
-to construct the names of generated parser implementations.
-
-.IP "\fB\--simpl-type-suffix \fIsuffix\fR"
-Use
-.I suffix
-instead of the default
-.B _simpl
-to construct the names of generated serializer implementations.
-
-.IP "\fB\--pimpl-file-suffix \fIsuffix\fR"
-Use
-.I suffix
-instead of the default
-.B -pimpl
-to construct the names of generated parser implementation files.
-
-.IP "\fB\--simpl-file-suffix \fIsuffix\fR"
-Use
-.I suffix
-instead of the default
-.B -simpl
-to construct the names of generated serializer implementation files.
-
-.IP "\fB\--paggr-type-suffix \fIsuffix\fR"
-Use
-.I suffix
-instead of the default
-.B _paggs
-to construct the names of generated parser aggregates.
-
-.IP "\fB\--saggr-type-suffix \fIsuffix\fR"
-Use
-.I suffix
-instead of the default
-.B _saggr
-to construct the names of generated serializer aggregates.
-
-.\"
-.\" C++/Parser options
-.\"
-.SS cxx-parser command options
-
-.IP "\fB\--type-map \fImapfile\fR"
-Read XML Schema to C++ type mapping information from
-.I mapfile
-Repeat this option to specify several type maps. Type maps are
-considered in order of appearance and the first match is used.
-By default all user-defined types are mapped to
-.BR void .
-See the TYPE MAP section below for more information.
-
-.IP "\fB\--reuse-style-mixin\fR"
-Generate code that supports the mixin base parser implementation reuse
-style. Note that this reuse style relies on virtual inheritance and may
-result in a substantial object code size increase for large vocabularies.
-By default support for the tiein style is generated.
-
-.IP "\fB\--reuse-style-none\fR"
-Do not generate any support for base parser implementation reuse. By
-default support for the tiein style is generated.
-
-.IP "\fB\--suppress-validation\fR"
-Suppress the generation of validation code.
-
-.IP "\fB\--generate-polymorphic\fR"
-Generate polymorphism-aware code. Specify this option if you use substitution
-groups or
-.BR xsi:type .
-
-.IP "\fB\--runtime-polymorphic\fR"
-Generate non-polymorphic code that uses the runtime library configured with
-polymorphism support.
-
-.IP "\fB\--suppress-reset\fR"
-Suppress the generation of parser reset code. Reset support allows you to reuse
-parsers after an error.
-
-.IP "\fB\--generate-noop-impl\fR"
-Generate a sample parser implementation that does nothing (no operation).
-The sample implementation can then be filled with the application-specific
-code. For an input file in the form
-.B name.xsd
-this option triggers the generation of the two additional C++ files in the form:
-.B name-pimpl.hxx
-(parser implementation header file) and
-.B name-pimpl.cxx
-(parser implementation source file).
-
-.IP "\fB\--generate-print-impl\fR"
-Generate a sample parser implementation that prints the XML data to STDOUT.
-For an input file in the form
-.B name.xsd
-this option triggers the generation of the two additional C++ files in the form:
-.B name-pimpl.hxx
-(parser implementation header file) and
-.B name-pimpl.cxx
-(parser implementation source file).
-
-.IP "\fB\--generate-test-driver\fR"
-Generate a test driver for the sample parser implementation. For an input
-file in the form
-.B name.xsd
-this option triggers the generation of an additional C++ file in the form
-.BR name-pdriver.cxx .
-
-.IP "\fB\--force-overwrite\fR"
-Force overwriting of the existing implementation and test driver files.
-Use this option only if you do not mind loosing the changes you have made
-in the sample implementation or test driver files.
-
-.IP "\fB\--root-element-first\fR"
-Indicate that the first global element is the document root. This information
-is used to generate the test driver for the sample implementation.
-
-.IP "\fB\--root-element-last\fR"
-Indicate that the last global element is the document root. This information
-is used to generate the test driver for the sample implementation.
-
-.IP "\fB\--root-element \fIelement\fR"
-Indicate that
-.I element
-is the document root. This information is used to generate the test driver
-for the sample implementation.
-
-.IP "\fB\--generate-xml-schema\fR"
-Generate a C++ header file as if the schema being compiled defines the
-XML Schema namespace. In particular, the resulting file will have
-definitions for all parser skeletons and implementations corresponding
-to the XML Schema built-in types. The schema file provided to the compiler
-need not exist and is only used to derive the name of the resulting header
-file. Use the
-.B --extern-xml-schema
-option to include this file in the generated files for other schemas.
-
-.IP "\fB\--extern-xml-schema \fIfile\fR"
-Include a header file derived from
-.I file
-instead of generating the XML Schema namespace mapping inline. The provided
-file need not exist and is only used to derive the name of the included
-header file. Use the
-.B --generate-xml-schema
-option to generate this header file.
-
-.IP "\fB\--skel-type-suffix \fIsuffix\fR"
-Use the provided
-.I suffix
-instead of the default
-.B _pskel
-to construct the names of generated parser skeletons.
-
-.IP "\fB\--skel-file-suffix \fIsuffix\fR"
-Use the provided
-.I suffix
-instead of the default
-.B -pskel
-to construct the names of generated parser skeleton files.
-
-.IP "\fB\--impl-type-suffix \fIsuffix\fR"
-Use the provided
-.I suffix
-instead of the default
-.B _pimpl
-to construct the names of parser implementations for the built-in XML
-Schema types and sample parser implementations.
-
-.IP "\fB\--impl-file-suffix \fIsuffix\fR"
-Use the provided
-.I suffix
-instead of the default
-.B -pimpl
-to construct the names of generated sample parser implementation files.
-
-.\"
-.\" C++/Serializer options
-.\"
-.SS cxx-serializer command options
-
-.IP "\fB\--type-map \fImapfile\fR"
-Read XML Schema to C++ type mapping information from
-.I mapfile
-Repeat this option to specify several type maps. Type maps are
-considered in order of appearance and the first match is used.
-By default all user-defined types are mapped to
-.BR void .
-See the TYPE MAP section below for more information.
-
-.IP "\fB\--reuse-style-mixin\fR"
-Generate code that supports the mixin base serializer implementation reuse
-style. Note that this reuse style relies on virtual inheritance and may
-result in a substantial object code size increase for large vocabularies.
-By default support for the tiein style is generated.
-
-.IP "\fB\--reuse-style-none\fR"
-Do not generate any support for base serializer implementation reuse. By
-default support for the tiein style is generated.
-
-.IP "\fB\--suppress-validation\fR"
-Suppress the generation of validation code.
-
-.IP "\fB\--generate-polymorphic\fR"
-Generate polymorphism-aware code. Specify this option if you use substitution
-groups or
-.BR xsi:type .
-
-.IP "\fB\--runtime-polymorphic\fR"
-Generate non-polymorphic code that uses the runtime library configured with
-polymorphism support.
-
-.IP "\fB\--suppress-reset\fR"
-Suppress the generation of serializer reset code. Reset support allows you to
-reuse serializers after an error.
-
-.IP "\fB\--generate-empty-impl\fR"
-Generate a sample serializer implementation with empty function bodies
-which can then be filled with the application-specific code. For an input
-file in the form
-.B name.xsd
-this option triggers the generation of the two additional C++ files in the form:
-.B name-simpl.hxx
-(serializer implementation header file) and
-.B name-simpl.cxx
-(serializer implementation source file).
-
-.IP "\fB\--generate-test-driver\fR"
-Generate a test driver for the sample serializer implementation. For an input
-file in the form
-.B name.xsd
-this option triggers the generation of an additional C++ file in the form
-.BR name-sdriver.cxx .
-
-.IP "\fB\--force-overwrite\fR"
-Force overwriting of the existing implementation and test driver files.
-Use this option only if you do not mind loosing the changes you have made
-in the sample implementation or test driver files.
-
-.IP "\fB\--root-element-first\fR"
-Indicate that the first global element is the document root. This information
-is used to generate the test driver for the sample implementation.
-
-.IP "\fB\--root-element-last\fR"
-Indicate that the last global element is the document root. This information
-is used to generate the test driver for the sample implementation.
-
-.IP "\fB\--root-element \fIelement\fR"
-Indicate that
-.I element
-is the document root. This information is used to generate the test driver
-for the sample implementation.
-
-.IP "\fB\--generate-xml-schema\fR"
-Generate a C++ header file as if the schema being compiled defines the
-XML Schema namespace. In particular, the resulting file will have
-definitions for all serializer skeletons and implementations corresponding
-to the XML Schema built-in types. The schema file provided to the compiler
-need not exist and is only used to derive the name of the resulting header
-file. Use the
-.B --extern-xml-schema
-option to include this file in the generated files for other schemas.
-
-.IP "\fB\--extern-xml-schema \fIfile\fR"
-Include a header file derived from
-.I file
-instead of generating the XML Schema namespace mapping inline. The provided
-file need not exist and is only used to derive the name of the included
-header file. Use the
-.B --generate-xml-schema
-option to generate this header file.
-
-.IP "\fB\--skel-type-suffix \fIsuffix\fR"
-Use the provided
-.I suffix
-instead of the default
-.B _sskel
-to construct the names of generated serializer skeletons.
-
-.IP "\fB\--skel-file-suffix \fIsuffix\fR"
-Use the provided
-.I suffix
-instead of the default
-.B -sskel
-to construct the names of generated serializer skeleton files.
-
-.IP "\fB\--impl-type-suffix \fIsuffix\fR"
-Use the provided
-.I suffix
-instead of the default
-.B _simpl
-to construct the names of serializer implementations for the built-in XML
-Schema types and sample serializer implementations.
-
-.IP "\fB\--impl-file-suffix \fIsuffix\fR"
-Use the provided
-.I suffix
-instead of the default
-.B -simpl
-to construct the names of generated sample serializer implementation files.
-
-.\"
-.\" Type map
-.\"
-.SH TYPE MAP
-
-Type map files are used to define a mapping between XML Schema and
-C++ types. For C++/Parser, the compiler uses this information to
-determine the return types of
-.B post_*
-functions in parser skeletons corresponding to XML Schema types as
-well as argument types for callbacks corresponding to elements and
-attributes of these types. For C++/Serializer, type maps are used
-to determine the argument type of
-.B pre
-functions in serializer skeletons corresponding to XML Schema types
-as well as return types for callbacks corresponding to elements and
-attributes of these types.
-
-The compiler has a set of predefined mapping rules that map the
-built-in XML Schema types to suitable C++ types (discussed in
-the following sub-sections) and all other types to
-.BR void .
-By providing your own type maps you can override these predefined
-rules. The format of the type map file is presented below:
-
-
-.RS
-.B namespace
-.I schema-namespace
-[
-.I cxx-namespace
-]
-.br
-.B {
-.br
- (
-.B include
-.IB file-name ;
-)*
-.br
- ([
-.B type
-]
-.I schema-type cxx-ret-type
-[
-.I cxx-arg-type
-.RB ] ;
-)*
-.br
-.B }
-.br
-.RE
-
-Both
-.I schema-namespace
-and
-.I schema-type
-are regex patterns while
-.IR cxx-namespace ,
-.IR cxx-ret-type ,
-and
-.I cxx-arg-type
-are regex pattern substitutions. All names can be optionally enclosed
-in \fR" "\fR, for example, to include white-spaces.
-
-.I schema-namespace
-determines XML Schema namespace. Optional
-.I cxx-namespace
-is prefixed to every C++ type name in this namespace declaration.
-.I cxx-ret-type
-is a C++ type name that is used as a return type for the
-.B post_*
-function in C++/Parser or for element/attribute callbacks in C++/Serializer.
-Optional
-.I cxx-arg-type
-is an argument type for element/attribute callbacks in C++/Parser or for the
-.B pre
-function in C++/Serializer. If
-.I cxx-arg-type
-is not specified, it defaults to
-.I cxx-ret-type
-if
-.I cxx-ret-type
-ends with
-.B *
-or
-.B &
-(that is, it is a pointer or a reference) and
-.B const
-\fIcxx-ret-type\fB&\fR otherwise.
-.I file-name
-is a file name either in the \fR" "\fR or < > format and is added with the
-.B #include
-directive to the generated code.
-
-The \fB#\fR character starts a comment that ends with a new line or end of
-file. To specify a name that contains \fB#\fR enclose it in \fR" "\fR. For
-example:
-
-.RS
-namespace http://www.example.com/xmlns/my my
-.br
-{
-.br
- include "my.hxx";
-.br
-
- # Pass apples by value.
- #
- apple apple;
-.br
-
- # Pass oranges as pointers.
- #
- orange orange_t*;
-.br
-}
-.br
-.RE
-
-In the example above, for the
-.B http://www.example.com/xmlns/my#orange
-XML Schema type, the
-.B my::orange_t*
-C++ type will be used as both return and argument types.
-
-Several namespace declarations can be specified in a single file.
-The namespace declaration can also be completely omitted to map
-types in a schema without a namespace. For instance:
-
-.RS
-include "my.hxx";
-.br
-apple apple;
-.br
-
-namespace http://www.example.com/xmlns/my
-.br
-{
-.br
- orange "const orange_t*";
-.br
-}
-.br
-.RE
-
-The compiler has a number of predefined mapping rules for the built-in
-XML Schema types that vary depending on the mapping used. They are
-described in the following subsections. The last predefined rule
-for all the mappings maps anything that wasn't mapped by previous rules to
-.BR void :
-
-.RS
-namespace .*
-.br
-{
-.br
- .* void void;
-.br
-}
-.br
-.RE
-
-When you provide your own type maps with the
-.B --type-map
-option, they are evaluated first. This allows you to selectively override
-predefined rules.
-
-.\"
-.\" Predefined C++/Parser Type Maps
-.\"
-.SS Predefined C++/Parser Type Maps
-
-The C++/Parser mapping provides a number of predefined type map rules
-for the built-in XML Schema types. They can be presented as the
-following map files:
-
-.RS
-namespace http://www.w3.org/2001/XMLSchema
-.br
-{
-.br
- boolean bool bool;
-.br
-
- byte "signed char" "signed char";
-.br
- unsignedByte "unsigned char" "unsigned char";
-.br
-
- short short short;
-.br
- unsignedShort "unsigned short" "unsigned short";
-.br
-
- int int int;
-.br
- unsignedInt "unsigned int" "unsigned int";
-.br
-
- long "long long" "long long";
-.br
- unsignedLong "unsigned long long" "unsigned long long";
-.br
-
- integer long long;
-.br
-
- negativeInteger long long;
-.br
- nonPositiveInteger long long;
-.br
-
- positiveInteger "unsigned long" "unsigned long";
-.br
- nonNegativeInteger "unsigned long" "unsigned long";
-.br
-
- float float float;
-.br
- double double double;
-.br
- decimal double double;
-.br
-
- NMTOKENS xml_schema::string_sequence*;
-.br
- IDREFS xml_schema::string_sequence*;
-.br
-
- base64Binary xml_schema::buffer*;
-.br
- hexBinary xml_schema::buffer*;
-.br
-
- date xml_schema::date;
-.br
- dateTime xml_schema::date_time;
-.br
- duration xml_schema::duration;
-.br
- gDay xml_schema::gday;
-.br
- gMonth xml_schema::gmonth;
-.br
- gMonthDay xml_schema::gmonth_day;
-.br
- gYear xml_schema::gyear;
-.br
- gYearMonth xml_schema::gyear_month;
-.br
- time xml_schema::time;
-.br
-}
-.br
-.RE
-
-If the
-.B --no-stl
-option is not specified, the following mapping is used for the
-string-based XML Schema built-in types:
-
-.RS
-namespace http://www.w3.org/2001/XMLSchema
-.br
-{
-.br
- include <string>;
-.br
-
- string std::string;
-.br
- normalizedString std::string;
-.br
- token std::string;
-.br
- Name std::string;
-.br
- NMTOKEN std::string;
-.br
- NCName std::string;
-.br
- ID std::string;
-.br
- IDREF std::string;
-.br
- language std::string;
-.br
- anyURI std::string;
-.br
-
- QName xml_schema::qname;
-.br
-}
-.br
-.RE
-
-Otherwise, a C string-based mapping is used:
-
-.RS
-namespace http://www.w3.org/2001/XMLSchema
-.br
-{
-.br
- string char*;
-.br
- normalizedString char*;
-.br
- token char*;
-.br
- Name char*;
-.br
- NMTOKEN char*;
-.br
- NCName char*;
-.br
- ID char*;
-.br
- IDREF char*;
-.br
- language char*;
-.br
- anyURI char*;
-.br
-
- QName xml_schema::qname*;
-.br
-}
-.br
-.RE
-
-.\"
-.\" Predefined C++/Serializer Type Maps
-.\"
-.SS Predefined C++/Serializer Type Maps
-
-The C++/Serializer mapping provides a number of predefined type map
-rules for the built-in XML Schema types. They can be presented as the
-following map files:
-
-.RS
-namespace http://www.w3.org/2001/XMLSchema
-.br
-{
-.br
- boolean bool bool;
-.br
-
- byte "signed char" "signed char";
-.br
- unsignedByte "unsigned char" "unsigned char";
-.br
-
- short short short;
-.br
- unsignedShort "unsigned short" "unsigned short";
-.br
-
- int int int;
-.br
- unsignedInt "unsigned int" "unsigned int";
-.br
-
- long "long long" "long long";
-.br
- unsignedLong "unsigned long long" "unsigned long long";
-.br
-
- integer long long;
-.br
-
- negativeInteger long long;
-.br
- nonPositiveInteger long long;
-.br
-
- positiveInteger "unsigned long" "unsigned long";
-.br
- nonNegativeInteger "unsigned long" "unsigned long";
-.br
-
- float float float;
-.br
- double double double;
-.br
- decimal double double;
-.br
-
- NMTOKENS "const xml_schema::string_sequence*";
-.br
- IDREFS "const xml_schema::string_sequence*";
-.br
-
- base64Binary "const xml_schema::buffer*";
-.br
- hexBinary "const xml_schema::buffer*";
-.br
-
- date xml_schema::date;
-.br
- dateTime xml_schema::date_time;
-.br
- duration xml_schema::duration;
-.br
- gDay xml_schema::gday;
-.br
- gMonth xml_schema::gmonth;
-.br
- gMonthDay xml_schema::gmonth_day;
-.br
- gYear xml_schema::gyear;
-.br
- gYearMonth xml_schema::gyear_month;
-.br
- time xml_schema::time;
-.br
-}
-.br
-.RE
-
-If the
-.B --no-stl
-option is not specified, the following mapping is used for the
-string-based XML Schema built-in types:
-
-.RS
-namespace http://www.w3.org/2001/XMLSchema
-.br
-{
-.br
- include <string>;
-.br
-
- string std::string;
-.br
- normalizedString std::string;
-.br
- token std::string;
-.br
- Name std::string;
-.br
- NMTOKEN std::string;
-.br
- NCName std::string;
-.br
- ID std::string;
-.br
- IDREF std::string;
-.br
- language std::string;
-.br
- anyURI std::string;
-.br
-
- QName xml_schema::qname;
-.br
-}
-.br
-.RE
-
-Otherwise, a C string-based mapping is used:
-
-.RS
-namespace http://www.w3.org/2001/XMLSchema
-.br
-{
-.br
- string "const char*";
-.br
- normalizedString "const char*";
-.br
- token "const char*";
-.br
- Name "const char*";
-.br
- NMTOKEN "const char*";
-.br
- NCName "const char*";
-.br
- ID "const char*";
-.br
- IDREF "const char*";
-.br
- language "const char*";
-.br
- anyURI "const char*";
-.br
-
- QName "const xml_schema::qname*";
-.br
-}
-.br
-.RE
-
-.\"
-.\" REGEX AND SHELL QUOTING
-.\"
-.SH REGEX AND SHELL QUOTING
-When entering a regular expression argument in the shell command line
-it is often necessary to use quoting (enclosing the argument in " "
-or ' ') in order to prevent the shell from interpreting certain
-characters, for example, spaces as argument separators and $ as
-variable expansions.
-
-Unfortunately it is hard to achieve this in a manner that is portable
-across POSIX shells, such as those found on GNU/Linux and UNIX, and
-Windows shell. For example, if you use " " for quoting you will get
-a wrong result with POSIX shells if your expression contains $. The
-standard way of dealing with this on POSIX systems is to use ' '
-instead. Unfortunately, Windows shell does not remove ' ' from
-arguments when they are passed to applications. As a result you may
-have to use ' ' for POSIX and " " for Windows ($ is not treated as
-a special character on Windows).
-
-Alternatively, you can save regular expression options into a file,
-one option per line, and use this file with the
-.B --options-file
-option. With this approach you don't need to worry about shell quoting.
-
-.\"
-.\" DIAGNOSTICS
-.\"
-.SH DIAGNOSTICS
-If the input file is not a valid W3C XML Schema definition,
-.B xsde
-will issue diagnostic messages to
-.B STDERR
-and exit with non-zero exit code.
-
-.SH BUGS
-Send bug reports to the xsde-users@codesynthesis.com mailing list.
-
-.SH COPYRIGHT
-Copyright (c) 2005-2011 Code Synthesis Tools CC.
-
-Permission is granted to copy, distribute and/or modify this
-document under the terms of the GNU Free Documentation License,
-version 1.2; with no Invariant Sections, no Front-Cover Texts and
-no Back-Cover Texts. Copy of the license can be obtained from
-http://codesynthesis.com/licenses/fdl-1.2.txt
diff --git a/documentation/xsde.xhtml b/documentation/xsde.xhtml
deleted file mode 100644
index f0b0c76..0000000
--- a/documentation/xsde.xhtml
+++ /dev/null
@@ -1,1725 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-
-<head>
- <title>XSD/e 3.3.0 Compiler Command Line Manual</title>
-
- <meta name="copyright" content="&copy; 2005-2011 Code Synthesis Tools CC"/>
- <meta name="keywords" content="xsd,xml,schema,c++,mapping,data,binding,code,generator,manual,man,page"/>
- <meta name="description" content="XSD/e Compiler Command Line Manual"/>
-
- <link rel="stylesheet" type="text/css" href="default.css" />
-
-<style type="text/css">
-
- #synopsis {
- list-style-type: none;
- }
-
- #synopsis li {
- padding-top : 0.0em;
- padding-bottom : 0.0em;
- }
-
- #commands dt {
- padding-top : 0.4em;
- }
-
- #commands dd {
- padding-bottom : 0.4em;
- padding-left : 2em;
- }
-
- .options dt {
- padding-top : 0.4em;
- }
-
- .options dd {
- padding-top : 0.1em;
- padding-bottom : 0.4em;
- padding-left : 1.4em;
- }
-
-</style>
-</head>
-
-<body>
-<div id="container">
- <div id="content">
-
- <h1>NAME</h1>
-
- <p>xsde - W3C XML Schema to C++ Compiler for Embedded Systems</p>
-
- <h1>SYNOPSIS</h1>
-
- <dl id="synopsis">
- <dt><code><b>xsde</b> <i>command</i> [<i>options</i>] <i>file</i> [<i>file</i> ...]</code></dt>
- <dt><code><b>xsde help</b> [<i>command</i>]</code></dt>
- <dt><code><b>xsde version</b></code></dt>
- </dl>
-
- <h1>DESCRIPTION</h1>
-
- <p><code><b>xsde</b></code> generates vocabulary-specific, statically-typed
- C++ mapping from W3C XML Schema definitions. Particular mapping to
- produce is selected by a <code><i>command</i></code>. Each mapping has
- a number of mapping-specific <code><i>options</i></code> that should
- appear, if any, after the <code><i>command</i></code>. Input files should
- be W3C XML Schema definitions. The exact set of the generated files
- depends on the selected mapping and options.</p>
-
- <h1>COMMANDS</h1>
-
- <dl id="commands">
- <dt><code><b>cxx-hybrid</b></code></dt>
- <dd>Generate the Embedded C++/Hybrid mapping. For each input file in the
- form <code><b>name.xsd</b></code> the following C++ files are generated:
- <code><b>name.hxx</b></code> (object model header file),
- <code><b>name.ixx</b></code> (object model inline file, generated only
- if the <code><b>--generate-inline</b></code> option is specified),
- <code><b>name.cxx</b></code> (object model source file), and
- <code><b>name-fwd.hxx</b></code> (object model forward declaration
- file, generated only if the <code><b>--generate-forward</b></code>
- option is specified).
-
- <p>If the <code><b>--generate-parser</b></code> option is specified,
- the Embedded C++/Parser mapping is invoked and the
- <code><b>name-pskel.hxx</b></code>,
- <code><b>name-pskel.ixx</b></code>, and
- <code><b>name-pskel.cxx</b></code> parser skeleton files are
- generated, as described below. Additionally, the following parser
- implementation files are generated:
- <code><b>name-pimpl.hxx</b></code> (parser implementation header
- file) and
- <code><b>name-pimpl.cxx</b></code> (parser implementation source
- file).</p>
-
- <p>If the <code><b>--generate-serializer</b></code> option is
- specified, the Embedded C++/Serializer mapping is invoked and the
- <code><b>name-sskel.hxx</b></code>,
- <code><b>name-sskel.ixx</b></code>, and
- <code><b>name-sskel.cxx</b></code> serializer skeleton files are
- generated, as described below. Additionally, the following serializer
- implementation files are generated:
- <code><b>name-simpl.hxx</b></code> (serializer implementation header
- file) and
- <code><b>name-simpl.cxx</b></code> (serializer implementation source
- file).</p>
- </dd>
-
- <dt><code><b>cxx-parser</b></code></dt>
- <dd>Generate the Embedded C++/Parser mapping. For each input file in the
- form <code><b>name.xsd</b></code> the following C++ files are generated:
- <code><b>name-pskel.hxx</b></code> (parser skeleton header file),
- <code><b>name-pskel.ixx</b></code> (parser skeleton inline file,
- generated only if the <code><b>--generate-inline</b></code>
- option is specified), and
- <code><b>name-pskel.cxx</b></code> (parser skeleton source file).
- If the <code><b>--generate-noop-impl</b></code> or
- <code><b>--generate-print-impl</b></code> option is specified,
- the following additional sample implementation files are generated:
- <code><b>name-pimpl.hxx</b></code> (parser implementation header
- file) and
- <code><b>name-pimpl.cxx</b></code> (parser implementation source
- file). If the <code><b>--generate-test-driver</b></code> option
- is specified, the additional <code><b>name-pdriver.cxx</b></code>
- test driver file is generated.</dd>
-
- <dt><code><b>cxx-serializer</b></code></dt>
- <dd>Generate the Embedded C++/Serializer mapping. For each input file
- in the form <code><b>name.xsd</b></code> the following C++ files
- are generated: <code><b>name-sskel.hxx</b></code> (serializer
- skeleton header file), <code><b>name-sskel.ixx</b></code> (serializer
- skeleton inline file, generated only if the
- <code><b>--generate-inline</b></code> option is specified), and
- <code><b>name-sskel.cxx</b></code> (serializer skeleton source file).
- If the <code><b>--generate-empty-impl</b></code> option is specified,
- the following additional sample implementation files are generated:
- <code><b>name-simpl.hxx</b></code> (serializer implementation header
- file) and <code><b>name-simpl.cxx</b></code> (serializer
- implementation source file). If the <code><b>--generate-test-driver</b></code>
- option is specified, the additional <code><b>name-sdriver.cxx</b></code>
- test driver file is generated.
- </dd>
-
- <dt><code><b>help</b></code></dt>
- <dd>Print usage information and exit. Use
- <p><code><b>xsde help</b> <i>command</i></code></p>
- for command-specific help.
- </dd>
-
- <dt><code><b>version</b></code></dt>
- <dd>Print version and exit.</dd>
- </dl>
-
- <h1>OPTIONS</h1>
-
- <p>Command-specific <code><i>options</i></code>, if any, should appear
- after the corresponding <code><i>command</i></code>.</p>
-
- <h2>COMMON OPTIONS</h2>
-
- <dl class="options">
- <dt><code><b>--output-dir</b> <i>dir</i></code></dt>
- <dd>Write generated files to <code><i>dir</i></code> instead of
- the current directory.</dd>
-
- <dt><code><b>--char-encoding</b> <i>enc</i></code></dt>
- <dd>Specify the application character encoding. Valid values are
- <code><b>utf8</b></code> (default) and <code><b>iso8859-1</b></code>.
- Note that this encoding is not the same as the XML document encoding
- that is being parsed or serialized. Rather, it is the encoding that
- is used inside the application. When an XML document is parsed, the
- character data is automatically converted to the application encoding.
- Similarly, when an XML document is serialized, the data in the
- application encoding is automatically converted to the resulting
- document encoding.</dd>
-
- <dt><code><b>--no-stl</b></code></dt>
- <dd>Generate code that does not use the Standard Template Library
- (STL).</dd>
-
- <dt><code><b>--no-iostream</b></code></dt>
- <dd>Generate code that does not use the standard input/output
- stream library (iostream).</dd>
-
- <dt><code><b>--no-exceptions</b></code></dt>
- <dd>Generate code that does not use C++ exceptions.</dd>
-
- <dt><code><b>--no-long-long</b></code></dt>
- <dd>Generate code that does not use the <code><b>long long</b></code>
- and <code><b>unsigned long long</b></code> types. The
- 64 bit <code><b>long</b></code> and <code><b>unsignedLong</b></code>
- built-in XML Schema types are then mapped to <code><b>long</b></code>
- and <code><b>unsigned long</b></code>.</dd>
-
- <dt><code><b>--custom-allocator</b></code></dt>
- <dd>Generate code that performs memory management using custom allocator
- functions provided by your application instead of the standard
- operator new/delete.</dd>
-
- <dt><code><b>--generate-inline</b></code></dt>
- <dd>Generate simple functions inline. This option triggers creation
- of the inline file.</dd>
-
- <dt><code><b>--namespace-map</b> <i>xns</i><b>=</b><i>cns</i></code></dt>
- <dd>Map XML Schema namespace <i>xns</i> to C++ namespace <i>cns</i>.
- Repeat this option to specify mapping for more than one XML Schema
- namespace. For example, the following option:
-
- <p><code><b>--namespace-map http://example.com/foo/bar=foo::bar</b></code></p>
-
- <p>will map the <code><b>http://example.com/foo/bar</b></code>
- XML Schema namespace to the <code><b>foo::bar</b></code> C++
- namespace.</p>
- </dd>
-
- <dt><code><b>--namespace-regex</b> <i>regex</i></code></dt>
- <dd>Add <code><i>regex</i></code> to the list of regular expressions
- used to translate XML Schema namespace names to C++ namespace
- names. <code><i>regex</i></code> is a perl-like regular expression in
- the form <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>.
- Any character can be used as a delimiter instead of <code><b>/</b></code>.
- Escaping of the delimiter character in <code><i>pattern</i></code> or
- <code><i>replacement</i></code> is not supported.
-
- <p>All the regular expressions are pushed into a stack with the last
- specified expression considered first. The first match that
- succeeds is used. Regular expressions are applied to a string
- in the form</p>
-
- <p><code><i>filename</i> <i>namespace</i></code></p>
-
- <p>For example, if you have file <code><b>hello.xsd</b></code>
- with namespace <code><b>http://example.com/hello</b></code> and you run
- <code><b>xsd</b></code> on this file, then the string in question
- will be:</p>
-
- <p><code><b>hello.xsd. http://example.com/hello</b></code></p>
-
- <p>For the built-in XML Schema namespace the string is:</p>
-
- <p><code><b>XMLSchema.xsd http://www.w3.org/2001/XMLSchema</b></code></p>
-
- <p>The following three steps are performed for each regular expression
- until the match is found:</p>
-
- <ol>
- <li>The expression is applied and if the result is empty the
- next expression is considered.</li>
-
- <li>All <code><b>/</b></code> are replaced with
- <code><b>::</b></code>.</li>
-
- <li>The result is verified to be a valid C++ scope name (e.g.,
- <code><b>foo::bar</b></code>). If this test succeeds, the
- result is used as a C++ namespace name.</li>
- </ol>
-
- <p>As an example, the following expression maps XML Schema
- namespaces in the form
- <code><b>http://example.com/foo/bar</b></code> to C++
- namespaces in the form <code><b>foo::bar</b></code>:</p>
-
- <p><code><b>%.* http://example.com/(.+)%$1%</b></code></p>
-
- <p>See also the REGEX AND SHELL QUOTING section below.</p>
- </dd>
-
- <dt><code><b>--namespace-regex-trace</b></code></dt>
- <dd>Trace the process of applying regular expressions specified with
- the <code><b>--namespace-regex</b></code> option. Use this option
- to find out why your regular expressions don't do what you expected
- them to do.
- </dd>
-
- <!-- Reserved names -->
-
- <dt><code><b>--reserved-name</b> <i>name</i>[<b>=</b><i>rep</i>]</code></dt>
- <dd>Add <code><i>name</i></code> to the list of names that should not
- be used as identifiers. The name can optionally be followed by
- <code><b>=</b></code> and the replacement name that should be
- used instead. All the C++ keywords are already in this list.
- </dd>
-
- <dt><code><b>--include-with-brackets</b></code></dt>
- <dd>Use angle brackets (&lt;&gt;) instead of quotes ("") in
- generated <code><b>#include</b></code> directives.
- </dd>
-
- <dt><code><b>--include-prefix</b> <i>prefix</i></code></dt>
- <dd>Add <code><i>prefix</i></code> to generated <code><b>#include</b></code>
- directive paths.
-
- <p>For example, if you had the following import element in your
- schema</p>
-
- <p><code><b>&lt;import namespace="..." schemaLocation="base.xsd"/&gt;</b></code></p>
-
- <p>and compiled this fragment with <code><b>--include-prefix schemas/</b></code>,
- then the include directive in the generated code would be:</p>
-
- <p><code><b>#include "schemas/base.hxx"</b></code></p>
- </dd>
-
- <dt><code><b>--include-regex</b> <i>regex</i></code></dt>
- <dd>Add <code><i>regex</i></code> to the list of regular expressions
- used to transform <code><b>#include</b></code> directive paths.
- <code><i>regex</i></code> is a perl-like regular expression in
- the form <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>.
- Any character can be used as a delimiter instead of <code><b>/</b></code>.
- Escaping of the delimiter character in <code><i>pattern</i></code> or
- <code><i>replacement</i></code> is not supported.
-
- <p>All the regular expressions are pushed into a stack with the last
- specified expression considered first. The first match that
- succeeds is used.</p>
-
- <p>As an example, the following expression transforms paths
- in the form <code><b>schemas/foo/bar</b></code> to paths
- in the form <code><b>generated/foo/bar</b></code>:</p>
-
- <p><code><b>%schemas/(.+)%generated/$1%</b></code></p>
-
- <p>See also the REGEX AND SHELL QUOTING section below.</p>
- </dd>
-
- <dt><code><b>--include-regex-trace</b></code></dt>
- <dd>Trace the process of applying regular expressions specified with
- the <code><b>--include-regex</b></code> option. Use this option
- to find out why your regular expressions don't do what you expected
- them to do.
- </dd>
-
- <dt><code><b>--guard-prefix</b> <i>prefix</i></code></dt>
- <dd>Add <code><i>prefix</i></code> to generated header inclusion guards.
- The prefix is transformed to upper case and characters that are
- illegal in a preprocessor macro name are replaced with underscores.
- If this option is not specified then the directory part of the
- input schema file is used as a prefix.
- </dd>
-
- <dt><code><b>--hxx-suffix</b> <i>suffix</i></code></dt>
- <dd>Use the provided <code><i>suffix</i></code> instead of the default
- <code><b>.hxx</b></code> to construct the name of the header file.
- Note that this suffix is also used to construct names for
- included/imported schemas.
- </dd>
-
- <dt><code><b>--ixx-suffix</b> <i>suffix</i></code></dt>
- <dd>Use the provided <code><i>suffix</i></code> instead of the default
- <code><b>.ixx</b></code> to construct the name of the inline file.
- </dd>
-
- <dt><code><b>--cxx-suffix</b> <i>suffix</i></code></dt>
- <dd>Use the provided <code><i>suffix</i></code> instead of the default
- <code><b>.cxx</b></code> to construct the name of the source file.
- </dd>
-
- <dt><code><b>--fwd-suffix</b> <i>suffix</i></code></dt>
- <dd>Use the provided <code><i>suffix</i></code> instead of the default
- <code><b>-fwd.hxx</b></code> to construct the name of the forward
- declaration file (C++/Hybrid mapping only).
- </dd>
-
- <dt><code><b>--hxx-regex</b> <i>regex</i></code></dt>
- <dd>Use the provided expression to construct the name of the header
- file. <code><i>regex</i></code> is a perl-like regular expression
- in the form
- <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>.
- This expression is also used to construct names for included/imported
- schemas.
-
- <p>
- For the C++/Hybrid mapping, the <code><i>regex</i></code> argument
- can be optionally prefixed with a file key in the form
- <code><i>key</i>=<i>regex</i></code>. The valid values for
- <code><i>key</i></code> are <code><b>pskel</b></code> (parser
- skeleton files), <code><b>pimpl</b></code> (parser implementation
- files), <code><b>sskel</b></code> (serializer skeleton files),
- <code><b>simpl</b></code> (serializer implementation files),
- and <code><b>*</b></code> (all files). If <code><i>key</i></code>
- is empty or not present then the expression is used for the
- object model files only.
- </p>
-
- <p>See also the REGEX AND SHELL QUOTING section below.</p>
- </dd>
-
- <dt><code><b>--ixx-regex</b> <i>regex</i></code></dt>
- <dd>Use the provided expression to construct the name of the inline
- file. <code><i>regex</i></code> is a perl-like regular expression
- in the form
- <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>.
- For the C++/Hybrid mapping, the <code><i>regex</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-regex</b></code> option for details.
- See also the REGEX AND SHELL QUOTING section below.
- </dd>
-
- <dt><code><b>--cxx-regex</b> <i>regex</i></code></dt>
- <dd>Use the provided expression to construct the name of the source
- file. <code><i>regex</i></code> is a perl-like regular expression
- in the form
- <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>.
- For the C++/Hybrid mapping, the <code><i>regex</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-regex</b></code> option for details.
- See also the REGEX AND SHELL QUOTING section below.
- </dd>
-
- <dt><code><b>--fwd-regex</b> <i>regex</i></code></dt>
- <dd>Use the provided expression to construct the name of the forward
- declaration file (C++/Hybrid mapping only). <code><i>regex</i></code>
- is a perl-like regular expression in the form
- <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>.
- See also the REGEX AND SHELL QUOTING section below.
- </dd>
-
- <!-- prologue options -->
-
- <dt><code><b>--hxx-prologue</b> <i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the beginning of the header file.
-
- <p>
- For the C++/Hybrid mapping, the <code><i>text</i></code> argument
- can be optionally prefixed with a file key in the form
- <code><i>key</i>=<i>text</i></code>. The valid values for
- <code><i>key</i></code> are <code><b>pskel</b></code> (parser
- skeleton files), <code><b>pimpl</b></code> (parser implementation
- files), <code><b>sskel</b></code> (serializer skeleton files),
- <code><b>simpl</b></code> (serializer implementation files),
- and <code><b>*</b></code> (all files). If <code><i>key</i></code>
- is empty or not present then the text is used for the
- object model files only.
- </p>
-
- </dd>
-
- <dt><code><b>--ixx-prologue</b> <i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the beginning of the inline file.
- For the C++/Hybrid mapping, the <code><i>text</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue</b></code> option for details.
- </dd>
-
- <dt><code><b>--cxx-prologue</b> <i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the beginning of the source file.
- For the C++/Hybrid mapping, the <code><i>text</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue</b></code> option for details.
- </dd>
-
- <dt><code><b>--fwd-prologue</b> <i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the beginning of the forward
- declaration file (C++/Hybrid mapping only).
- </dd>
-
- <dt><code><b>--prologue</b> <i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the beginning of each generated
- file for which there is no file-specific prologue.
- For the C++/Hybrid mapping, the <code><i>text</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue</b></code> option for details.
- </dd>
-
- <!-- epilogue options -->
-
- <dt><code><b>--hxx-epilogue</b> <i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the end of the header file.
- For the C++/Hybrid mapping, the <code><i>text</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue</b></code> option for details.
- </dd>
-
- <dt><code><b>--ixx-epilogue</b> <i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the end of the inline file.
- For the C++/Hybrid mapping, the <code><i>text</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue</b></code> option for details.
- </dd>
-
- <dt><code><b>--cxx-epilogue</b> <i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the end of the source file.
- For the C++/Hybrid mapping, the <code><i>text</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue</b></code> option for details.
- </dd>
-
- <dt><code><b>--fwd-epilogue</b> <i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the end of the forward
- declaration file (C++/Hybrid mapping only).
- </dd>
-
- <dt><code><b>--epilogue</b> <i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the end of each generated
- file for which there is no file-specific epilogue.
- For the C++/Hybrid mapping, the <code><i>text</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue</b></code> option for details.
- </dd>
-
- <!-- prologue file options -->
-
- <dt><code><b>--hxx-prologue-file</b> <i>file</i></code></dt>
- <dd>Insert the content of the <code><i>file</i></code> at the beginning
- of the header file.
-
- <p>
- For the C++/Hybrid mapping, the <code><i>file</i></code> argument
- can be optionally prefixed with a file key in the form
- <code><i>key</i>=<i>file</i></code>. The valid values for
- <code><i>key</i></code> are <code><b>pskel</b></code> (parser
- skeleton files), <code><b>pimpl</b></code> (parser implementation
- files), <code><b>sskel</b></code> (serializer skeleton files),
- <code><b>simpl</b></code> (serializer implementation files),
- and <code><b>*</b></code> (all files). If <code><i>key</i></code>
- is empty or not present then the file is used for the
- object model files only.
- </p>
- </dd>
-
- <dt><code><b>--ixx-prologue-file</b> <i>file</i></code></dt>
- <dd>Insert the content of the <code><i>file</i></code> at the beginning
- of the inline file.
- For the C++/Hybrid mapping, the <code><i>file</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue-file</b></code> option for details.
- </dd>
-
- <dt><code><b>--cxx-prologue-file</b> <i>file</i></code></dt>
- <dd>Insert the content of the <code><i>file</i></code> at the beginning
- of the source file.
- For the C++/Hybrid mapping, the <code><i>file</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue-file</b></code> option for details.
- </dd>
-
- <dt><code><b>--fwd-prologue-file</b> <i>file</i></code></dt>
- <dd>Insert the content of the <code><i>file</i></code> at the beginning
- of the forward declaration file (C++/Hybrid mapping only).
- </dd>
-
- <dt><code><b>--prologue-file</b> <i>file</i></code></dt>
- <dd>Insert the content of the <code><i>file</i></code> at the beginning
- of each generated file for which there is no file-specific prologue
- file.
- For the C++/Hybrid mapping, the <code><i>file</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue-file</b></code> option for details.
- </dd>
-
- <!-- epilogue file options -->
-
- <dt><code><b>--hxx-epilogue-file</b> <i>file</i></code></dt>
- <dd>Insert the content of the <code><i>file</i></code> at the end of the
- header file.
- For the C++/Hybrid mapping, the <code><i>file</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue-file</b></code> option for details.
- </dd>
-
- <dt><code><b>--ixx-epilogue-file</b> <i>file</i></code></dt>
- <dd>Insert the content of the <code><i>file</i></code> at the end of the
- inline file.
- For the C++/Hybrid mapping, the <code><i>file</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue-file</b></code> option for details.
- </dd>
-
- <dt><code><b>--cxx-epilogue-file</b> <i>file</i></code></dt>
- <dd>Insert the content of the <code><i>file</i></code> at the end of the
- source file.
- For the C++/Hybrid mapping, the <code><i>file</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue-file</b></code> option for details.
- </dd>
-
- <dt><code><b>--fwd-epilogue-file</b> <i>file</i></code></dt>
- <dd>Insert the content of the <code><i>file</i></code> at the end of the
- forward declaration file (C++/Hybrid mapping only).
- </dd>
-
- <dt><code><b>--epilogue-file</b> <i>file</i></code></dt>
- <dd>Insert the content of the <code><i>file</i></code> at the end of each
- generated file for which there is no file-specific epilogue file.
- For the C++/Hybrid mapping, the <code><i>file</i></code> argument
- can be optionally prefixed with a file key. See the
- <code><b>--hxx-prologue-file</b></code> option for details.
- </dd>
-
-
- <dt><code><b>--disable-warning</b> <i>warn</i></code></dt>
- <dd>Disable printing warning with id <i>warn</i>. If <code><b>all</b></code>
- is specified for the warning id then all the warnings are disabled.
- </dd>
-
- <!-- misc options -->
-
- <dt><code><b>--show-sloc</b></code></dt>
- <dd>Show the number of generated physical source lines of code (SLOC).
- </dd>
-
- <dt><code><b>--sloc-limit</b> <i>num</i></code></dt>
- <dd>Check that the number of generated physical source lines of code
- (SLOC) does not exceed <code><i>num</i></code>.
- </dd>
-
- <dt><code><b>--options-file</b> <i>file</i></code></dt>
- <dd>Read additional options from <code><i>file</i></code>. Each option
- should appear on a separate line optionally followed by space and
- an argument. Empty lines and lines starting with <code><b>#</b></code>
- are ignored. The semantics of providing options in a
- file is equivalent to providing the same set of options in
- the same order in the command line at the point where the
- <code><b>--options-file</b></code> option is specified
- except that shell escaping and quoting is not required.
- Repeat this option to specify more than one options files.
- </dd>
-
- <dt><code><b>--proprietary-license</b></code></dt>
- <dd>Indicate that the generated code is licensed under a proprietary
- license instead of the GPL.
- </dd>
-
- <!-- Anonymous options. -->
-
- <dt><code><b>--preserve-anonymous</b></code></dt>
- <dd>Preserve anonymous types. By default anonymous types are
- automatically named with names derived from the enclosing
- elements/attributes. Because mappings implemented by this
- compiler require all types to be named, this option is only
- useful if you want to make sure your schemas don't have
- anonymous types.
- </dd>
-
- <dt><code><b>--show-anonymous</b></code></dt>
- <dd>Show elements and attributes that are of anonymous types.
- This option only makes sense together with the
- <code><b>--preserve-anonymous</b></code> option.
- </dd>
-
- <dt><code><b>--anonymous-regex</b> <i>regex</i></code></dt>
- <dd>Add <code><i>regex</i></code> to the list of regular expressions
- used to derive names for anonymous types from the enclosing
- attributes/elements. <code><i>regex</i></code> is a perl-like regular
- expression in the form
- <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>.
- Any character can be used as a delimiter instead of <code><b>/</b></code>.
- Escaping of the delimiter character in <code><i>pattern</i></code> or
- <code><i>replacement</i></code> is not supported.
-
- <p>All the regular expressions are pushed into a stack with the last
- specified expression considered first. The first match that
- succeeds is used. Regular expressions are applied to a string
- in the form</p>
-
- <p><code><i>filename</i> <i>namespace</i> <i>xpath</i></code></p>
-
- <p>For instance:</p>
-
- <p><code><b>hello.xsd http://example.com/hello element</b></code></p>
- <p><code><b>hello.xsd http://example.com/hello type/element</b></code></p>
-
- <p>As an example, the following expression makes all the derived
- names start with capital letters. This could be useful when
- your naming convention requires type names to start with
- capital letters:</p>
-
- <p><code><b>%.* .* (.+/)*(.+)%\u$2%</b></code></p>
-
- <p>See also the REGEX AND SHELL QUOTING section below.</p>
- </dd>
-
- <dt><code><b>--anonymous-regex-trace</b></code></dt>
- <dd>Trace the process of applying regular expressions specified with
- the <code><b>--anonymous-regex</b></code> option. Use this option
- to find out why your regular expressions don't do what you expected
- them to do.
- </dd>
-
- <!-- Location mapping options. -->
-
- <dt><code><b>--location-map</b> <i>ol</i><b>=</b><i>nl</i></code></dt>
- <dd>Map the original schema location <i>ol</i> that is specified in
- the XML Schema include or import elements to new schema
- location <i>nl</i>. Repeat this option to map more than one
- schema location. For example, the following option maps the
- <code><b>http://example.com/foo.xsd</b></code> URL to the
- <code><b>foo.xsd</b></code> local file.
-
- <p><code><b>--location-map http://example.com/foo.xsd=foo.xsd</b></code></p>
- </dd>
-
- <dt><code><b>--location-regex</b> <i>regex</i></code></dt>
- <dd>Add <code><i>regex</i></code> to the list of regular expressions
- used to map schema locations that are specified in the XML Schema
- include or import elements. <code><i>regex</i></code> is a perl-like
- regular expression in the form
- <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>.
- Any character can be used as a delimiter instead of <code><b>/</b></code>.
- Escaping of the delimiter character in <code><i>pattern</i></code> or
- <code><i>replacement</i></code> is not supported. All the regular
- expressions are pushed into a stack with the last specified
- expression considered first. The first match that succeeds is used.
-
- <p>For example, the following expression maps URL locations in the form
- <code><b>http://example.com/foo/bar.xsd</b></code> to local files
- in the form <code><b>bar.xsd</b></code>:</p>
-
- <p><code><b>%http://.+/(.+)%$1%</b></code></p>
-
- <p>See also the REGEX AND SHELL QUOTING section below.</p>
- </dd>
-
- <dt><code><b>--location-regex-trace</b></code></dt>
- <dd>Trace the process of applying regular expressions specified with
- the <code><b>--location-regex</b></code> option. Use this option
- to find out why your regular expressions don't do what you expected
- them to do.
- </dd>
-
- <!-- File-per-type compilation mode options. -->
-
- <dt><code><b>--file-per-type</b></code></dt>
- <dd>Generate a separate set of C++ files for each type defined in XML
- Schema. Note that in this mode you only need to compile the root
- schema(s) and the code will be generated for all included and
- imported schemas. This compilation mode is primarily useful when
- some of your schemas cannot be compiled separately or have cyclic
- dependencies which involve type inheritance. Other options related
- to this mode are:
- <code><b>--type-file-regex</b></code>,
- <code><b>--schema-file-regex</b></code>, and
- <code><b>--file-list</b></code>.
- </dd>
-
-
- <dt><code><b>--type-file-regex</b> <i>regex</i></code></dt>
- <dd>Add <code><i>regex</i></code> to the list of regular expressions
- used to translate type names to file names when the
- <code><b>--file-per-type</b></code> option is specified.
- <code><i>regex</i></code> is a perl-like regular expression in the form
- <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>.
- Any character can be used as a delimiter instead of <code><b>/</b></code>.
- Escaping of the delimiter character in <code><i>pattern</i></code> or
- <code><i>replacement</i></code> is not supported. All the regular
- expressions are pushed into a stack with the last specified
- expression considered first. The first match that succeeds is used.
- Regular expressions are applied to a string in the form
-
- <p><code><i>namespace</i> <i>type-name</i></code></p>
-
- <p>For example, the following expression maps type <code><b>foo</b></code>
- that is defined in the <code><b>http://example.com/bar</b></code>
- namespace to file name <code><b>bar-foo</b></code>:</p>
-
- <p><code><b>%http://example.com/(.+) (.+)%$1-$2%</b></code></p>
-
- <p>See also the REGEX AND SHELL QUOTING section below.</p>
- </dd>
-
- <dt><code><b>--type-file-regex-trace</b></code></dt>
- <dd>Trace the process of applying regular expressions specified with
- the <code><b>--type-file-regex</b></code> option. Use this option
- to find out why your regular expressions don't do what you expected
- them to do.
- </dd>
-
- <dt><code><b>--schema-file-regex</b> <i>regex</i></code></dt>
- <dd>Add <code><i>regex</i></code> to the list of regular expressions
- used to translate schema file names when the
- <code><b>--file-per-type</b></code> option is specified.
- <code><i>regex</i></code> is a perl-like regular expression in the form
- <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>.
- Any character can be used as a delimiter instead of <code><b>/</b></code>.
- Escaping of the delimiter character in <code><i>pattern</i></code> or
- <code><i>replacement</i></code> is not supported. All the regular
- expressions are pushed into a stack with the last specified
- expression considered first. The first match that succeeds is used.
- Regular expressions are applied to the absolute filesystem path
- of a schema file and the result, including the directory part,
- if any, is used to derive the <code><b>#include</b></code> directive
- paths as well as the generated C++ file paths. This option, along
- with <code><b>--type-file-regex</b></code> are primarily used to
- place the generated files into subdirectories or to resolve file
- name conflicts.
-
- <p>For example, the following expression maps schema files in the
- <code><b>foo/1.0.0/</b></code> subdirectory to the files in
- the <code><b>foo/</b></code> subdirectory. As a result, the
- <code><b>#include</b></code> directive paths for such schemas
- will be in the <code><b>foo/schema.hxx</b></code> form and
- the generated C++ files will be placed into the
- <code><b>foo/</b></code> subdirectory:</p>
-
- <p><code><b>%.*/foo/1.0.0/(.+)%foo/$1%</b></code></p>
-
- <p>See also the REGEX AND SHELL QUOTING section below.</p>
- </dd>
-
- <dt><code><b>--schema-file-regex-trace</b></code></dt>
- <dd>Trace the process of applying regular expressions specified with
- the <code><b>--schema-file-regex</b></code> option. Use this option
- to find out why your regular expressions don't do what you expected
- them to do.
- </dd>
-
- <dt><code><b>--fat-type-file</b></code></dt>
- <dd>Generate code corresponding to global elements into type files
- instead of schema files when the <code><b>--type-file-regex</b></code>
- option is specified. This option is primarily useful when trying
- to minimize the amount of object code that is linked to an executable
- by packaging compiled generated code into a static (archive) library.
- </dd>
-
- <!-- File list options. -->
-
- <dt><code><b>--file-list</b> <i>file</i></code></dt>
- <dd>Write a list of generated C++ files to <code><i>file</i></code>.
- This option is primarily useful in the file-per-type compilation
- mode (<code><b>--file-per-type</b></code>) to create a list of
- generated C++ files, for example, as a makefile fragment.
- </dd>
-
- <dt><code><b>--file-list-prologue</b> <i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the beginning of the file list.
- As a convenience, all occurrences of the \n character sequence in
- <code><i>text</i></code> are replaced with new lines. This option
- can, for example, be used to assign the generated file list to a
- makefile variable.
- </dd>
-
- <dt><code><b>--file-list-epilogue</b> <i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the end of the file list.
- As a convenience, all occurrences of the \n character sequence in
- <code><i>text</i></code> are replaced with new lines.
- </dd>
-
- <dt><code><b>--file-list-delim</b> <i>text</i></code></dt>
- <dd>Delimit file names written to the file list with
- <code><i>text</i></code> instead of new lines. As a convenience,
- all occurrences of the \n character sequence in
- <code><i>text</i></code> are replaced with new lines.
- </dd>
-
- </dl>
-
- <h2>CXX-HYBRID COMMAND OPTIONS</h2>
-
- <dl class="options">
- <dt><code><b>--generate-parser</b></code></dt>
- <dd>Generate XML parsing code.</dd>
-
- <dt><code><b>--generate-serializer</b></code></dt>
- <dd>Generate XML serialization code.</dd>
-
- <dt><code><b>--generate-aggregate</b></code></dt>
- <dd>Generate parser/serializer aggregates for root elements and/or
- types. See also the <code><b>--root-element-*</b></code> and
- <code><b>--root-type</b></code> options.</dd>
-
- <dt><code><b>--suppress-validation</b></code></dt>
- <dd>Suppress the generation of validation code in parser and serializer.</dd>
-
- <dt><code><b>--suppress-parser-val</b></code></dt>
- <dd>Suppress the generation of validation code in parser.</dd>
-
- <dt><code><b>--suppress-serializer-val</b></code></dt>
- <dd>Suppress the generation of validation code in serializer.</dd>
-
- <dt><code><b>--omit-default-attributes</b></code></dt>
- <dd>Omit attributes with default and fixed values from serialized
- XML documents.</dd>
-
- <dt><code><b>--suppress-enum</b></code></dt>
- <dd>Suppress the generation of the XML Schema enumeration to C++
- enum mapping.</dd>
-
- <dt><code><b>--generate-clone</b></code></dt>
- <dd>Generate clone functions for variable-length types. These
- functions allow you to make dynamically-allocated copies of
- variable-length objects.</dd>
-
- <dt><code><b>--generate-detach</b></code></dt>
- <dd>Generate detach functions for elements and attributes of
- variable-length types. These functions, for example, allow
- you to move sub-trees in the object model either within the
- same tree or between different trees.</dd>
-
- <dt><code><b>--generate-insertion</b> <i>os</i></code></dt>
- <dd>Generate data representation stream insertion operators for
- the <code><i>os</i></code> output stream type. Repeat this
- option to specify more than one stream type. The special
- <code><b>CDR</b></code> and <code><b>XDR</b></code> arguments
- are recognized as ACE CDR and Sun RPC XDR stream types and
- the corresponding stream wrappers provided by the XSD/e runtime
- are automatically used. For custom stream types use the
- <code><b>--hxx-prologue*</b></code> options to include the
- necessary declarations.</dd>
-
- <dt><code><b>--generate-extraction</b> <i>is</i></code></dt>
- <dd>Generate data representation stream extraction operators for
- the <code><i>is</i></code> input stream type. Repeat this
- option to specify more than one stream type. The special
- <code><b>CDR</b></code> and <code><b>XDR</b></code> arguments
- are recognized as ACE CDR and Sun RPC XDR stream types and
- the corresponding stream wrappers provided by the XSD/e runtime
- are automatically used. For custom stream types use the
- <code><b>--hxx-prologue*</b></code> options to include the
- necessary declarations.</dd>
-
- <dt><code><b>--generate-forward</b></code></dt>
- <dd>Generate forward declaration file.</dd>
-
- <dt><code><b>--generate-xml-schema</b></code></dt>
- <dd>Generate C++ header files as if the schema being compiled defines
- the XML Schema namespace. In particular, the resulting files will
- have definitions for all object model types, parser skeletons and
- implementations, as well as serializer skeletons and implementations
- corresponding to the XML Schema built-in types. The schema file
- provided to the compiler need not exist and is only used to derive
- the names of the resulting header files. Use the
- <code><b>--extern-xml-schema</b></code> option to include these file
- in the generated files for other schemas.</dd>
-
- <dt><code><b>--extern-xml-schema</b> <i>file</i></code></dt>
- <dd>Include header files derived from <i>file</i> instead of
- generating the XML Schema namespace mapping inline. The provided
- file need not exist and is only used to derive the names of the
- included header files. Use the <code><b>--generate-xml-schema</b></code>
- option to generate these header files.</dd>
-
- <dt><code><b>--suppress-reset</b></code></dt>
- <dd>Suppress the generation of parser and serializer reset code.
- Reset support allows you to reuse parsers and serializers
- after an error.</dd>
-
- <dt><code><b>--generate-polymorphic</b></code></dt>
- <dd>Generate polymorphism-aware code. Specify this option if you use
- substitution groups or <code><b>xsi:type</b></code>. Use the
- <code><b>--polymorphic-type</b></code> option to specify which
- type hierarchies are polymorphic.</dd>
-
- <dt><code><b>--runtime-polymorphic</b></code></dt>
- <dd>Generate non-polymorphic code that uses the runtime library
- configured with polymorphism support.</dd>
-
- <dt><code><b>--polymorphic-type</b></code> <i>type</i></dt>
- <dd>Indicate that <code><i>type</i></code> is a root of a polymorphic
- type hierarchy. The compiler can often automatically determine
- which types are polymorphic based on the substitution group
- declarations. However, you may need to use this option if you are
- not using substitution groups or if substitution groups are defined
- in another schema. You need to specify this option when compiling
- every schema file that references <code><i>type</i></code>.</dd>
-
- <dt><code><b>--generate-typeinfo</b></code></dt>
- <dd>Generate custom type information querying functions for
- polymorphic object model types. These functions can be used
- instead of the standard C++ RTTI mechanism to determine
- object's type at runtime.</dd>
-
- <dt><code><b>--polymorphic-schema</b></code> <i>file</i></dt>
- <dd>Indicate that <code><i>file</i></code> contains derivations of
- polymorphic types that are not otherwise visible from the schema
- being compiled. This option is used to make sure that during the
- generation of parser and serializer aggregates the compiler is
- aware of all possible derivations of polymorphic types. Repeat
- this option to specify more than one schema file.</dd>
-
- <dt><code><b>--reuse-style-mixin</b></code></dt>
- <dd>Generate code that supports the mixin base parser/serializer
- implementation reuse style. Note that this reuse style
- relies on virtual inheritance and may result in a substantial
- object code size increase for large vocabularies. By default
- the tiein reuse style is used.</dd>
-
- <dt><code><b>--custom-data</b></code> <i>type</i></dt>
- <dd>Add the ability to store custom data to the C++ class generated
- for XML Schema type <code><i>type</i></code>. To add custom
- data to a nested compositor class use the qualified name
- starting from the XML Schema type containing the compositor,
- for example, <code><b>foo::sequence::choise1</b></code>.</dd>
-
- <dt><code><b>--custom-type</b>
- <i>name</i>[<b>=</b>[<i>flags</i>][<b>/</b>[<i>type</i>][<b>/</b>[<i>base</i>][<b>/</b><i>include</i>]]]]</code></dt>
- <dd>Use a custom type implementation instead of the generated version.
- The <code><i>name</i></code> component is the XML Schema type name
- being customized. Optional <code><i>flags</i></code> allow you to
- specify whether the custom type is fixed or variable-length. The
- <code><b>f</b></code> flag indicates the type is fixed-length and
- the <code><b>v</b></code> flag indicates the type is variable-length.
- If omitted, the default rules are used to determine the type length.
- Optional <code><i>type</i></code> is a C++ type name that should
- be used instead. If specified, the object model type is defined
- as a <code><b>typedef</b></code> alias for this C++ type. Optional
- <code><i>base</i></code> is a C++ name that should be given to the
- generated version. It is normally used as a base for the custom
- implementation. Optional <code><i>include</i></code> is the header
- file that defines the custom implementation. It is
- <code><b>#include</b></code>'ed into the generated code immediately
- after (if <code><i>base</i></code> is specified) or instead of the
- generated version.</dd>
-
- <dt><code><b>--custom-parser</b>
- <i>name</i>[<b>=</b>[<i>base</i>][<b>/</b><i>include</i>]]</code></dt>
- <dd>Use a custom parser implementation instead of the generated version.
- The <code><i>name</i></code> component is the XML Schema type name
- being customized. Optional <code><i>base</i></code> is a C++ name
- that should be given to the generated version. It is normally used
- as a base for the custom implementation. Optional
- <code><i>include</i></code> is the header file that defines the
- custom implementation. It is <code><b>#include</b></code>'ed
- into the generated code immediately after (if <code><i>base</i></code>
- is specified) or instead of the generated version.</dd>
-
- <dt><code><b>--custom-serializer</b>
- <i>name</i>[<b>=</b>[<i>base</i>][<b>/</b><i>include</i>]]</code></dt>
- <dd>Use a custom serializer implementation instead of the generated version.
- The <code><i>name</i></code> component is the XML Schema type name
- being customized. Optional <code><i>base</i></code> is a C++ name
- that should be given to the generated version. It is normally used
- as a base for the custom implementation. Optional
- <code><i>include</i></code> is the header file that defines the
- custom implementation. It is <code><b>#include</b></code>'ed
- into the generated code immediately after (if <code><i>base</i></code>
- is specified) or instead of the generated version.</dd>
-
- <!-- Root element/type. -->
-
- <dt><code><b>--root-element-first</b></code></dt>
- <dd>Treat only the first global element as a document root. This
- determines for which elements parser and serializer aggregates
- are generated. By default all global elements are considered
- document roots. See also the <code><b>--generate-aggregate</b></code>
- option.
- </dd>
-
- <dt><code><b>--root-element-last</b></code></dt>
- <dd>Treat only the last global element as a document root. This
- determines for which elements parser and serializer aggregates
- are generated. By default all global elements are considered
- document roots. See also the <code><b>--generate-aggregate</b></code>
- option.
- </dd>
-
- <dt><code><b>--root-element-all</b></code></dt>
- <dd>Treat all global elements as document roots (the default
- behavior). This determines for which elements parser and
- serializer aggregates are generated. By explicitly specifying
- this option you can suppress the warning that is issued if
- more than one global element is defined. See also the
- <code><b>--generate-aggregate</b></code> option.
- </dd>
-
- <dt><code><b>--root-element-none</b></code></dt>
- <dd>Do not treat any global elements as document roots. This
- determines for which elements parser and serializer aggregates
- are generated. By default all global elements are considered
- document roots. See also the <code><b>--generate-aggregate</b></code>
- option.
- </dd>
-
- <dt><code><b>--root-element</b> <i>element</i></code></dt>
- <dd>Treat only <code><i>element</i></code> as a document root. This
- determines for which elements parser and serializer aggregates
- are generated. Repeat this option to specify more than one root
- element. See also the <code><b>--generate-aggregate</b></code> option.
- </dd>
-
- <dt><code><b>--root-type</b> <i>type</i></code></dt>
- <dd>Generate parser/serializer aggregate for <code><i>type</i></code>.
- Repeat this option to specify more than one type. See also the
- <code><b>--generate-aggregate</b></code> option.</dd>
-
- <dt><code><b>--pskel-type-suffix</b> <i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>_pskel</b></code> to construct the names of generated parser
- skeletons.</dd>
-
- <dt><code><b>--sskel-type-suffix</b> <i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>_sskel</b></code> to construct the names of generated
- serializer skeletons.</dd>
-
- <dt><code><b>--pskel-file-suffix</b> <i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>-pskel</b></code> to construct the names of generated
- parser skeleton files.</dd>
-
- <dt><code><b>--sskel-file-suffix</b> <i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>-sskel</b></code> to construct the names of generated
- serializer skeleton files.</dd>
-
- <dt><code><b>--pimpl-type-suffix</b> <i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>_pimpl</b></code> to construct the names of generated
- parser implementations.</dd>
-
- <dt><code><b>--simpl-type-suffix</b> <i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>_simpl</b></code> to construct the names of generated
- serializer implementations.</dd>
-
- <dt><code><b>--pimpl-file-suffix</b> <i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>-pimpl</b></code> to construct the names of generated
- parser implementation files.</dd>
-
- <dt><code><b>--simpl-file-suffix</b> <i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>-simpl</b></code> to construct the names of generated
- serializer implementation files.</dd>
-
- <dt><code><b>--paggr-type-suffix</b> <i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>_paggs</b></code> to construct the names of generated
- parser aggregates.</dd>
-
- <dt><code><b>--saggr-type-suffix</b> <i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>_saggr</b></code> to construct the names of generated
- serializer aggregates.</dd>
- </dl>
-
- <h2>CXX-PARSER COMMAND OPTIONS</h2>
-
- <dl class="options">
- <dt><code><b>--type-map</b> <i>mapfile</i></code></dt>
- <dd>Read XML Schema to C++ type mapping information from
- <code><i>mapfile</i></code>. Repeat this option to specify
- several type maps. Type maps are considered in order of
- appearance and the first match is used. By default all
- user-defined types are mapped to <code><b>void</b></code>.
- See the TYPE MAP section below for more information.</dd>
-
- <dt><code><b>--reuse-style-mixin</b></code></dt>
- <dd>Generate code that supports the mixin base parser
- implementation reuse style. Note that this reuse style
- relies on virtual inheritance and may result in a substantial
- object code size increase for large vocabularies. By default
- support for the tiein style is generated.</dd>
-
- <dt><code><b>--reuse-style-none</b></code></dt>
- <dd>Do not generate any support for base parser implementation
- reuse. By default support for the tiein style is generated.</dd>
-
- <dt><code><b>--suppress-validation</b></code></dt>
- <dd>Suppress the generation of validation code.</dd>
-
- <dt><code><b>--generate-polymorphic</b></code></dt>
- <dd>Generate polymorphism-aware code. Specify this option if you use
- substitution groups or <code><b>xsi:type</b></code>.</dd>
-
- <dt><code><b>--runtime-polymorphic</b></code></dt>
- <dd>Generate non-polymorphic code that uses the runtime library
- configured with polymorphism support.</dd>
-
- <dt><code><b>--suppress-reset</b></code></dt>
- <dd>Suppress the generation of parser reset code. Reset
- support allows you to reuse parsers after an error.</dd>
-
- <dt><code><b>--generate-noop-impl</b></code></dt>
- <dd>Generate a sample parser implementation that does nothing (no
- operation). The sample implementation can then be filled with
- the application-specific code. For an input file in the form
- <code><b>name.xsd</b></code> this option triggers the generation
- of the two additional C++ files in the form:
- <code><b>name-pimpl.hxx</b></code> (parser implementation header
- file) and <code><b>name-pimpl.cxx</b></code> (parser implementation
- source file).</dd>
-
- <dt><code><b>--generate-print-impl</b></code></dt>
- <dd>Generate a sample parser implementation that prints the XML data
- to STDOUT. For an input file in the form <code><b>name.xsd</b></code>
- this option triggers the generation of the two additional C++ files
- in the form: <code><b>name-pimpl.hxx</b></code> (parser implementation
- header file) and <code><b>name-pimpl.cxx</b></code> (parser
- implementation source file).</dd>
-
- <dt><code><b>--generate-test-driver</b></code></dt>
- <dd>Generate a test driver for the sample parser implementation. For an
- input file in the form <code><b>name.xsd</b></code> this option
- triggers the generation of an additional C++ file in the form
- <code><b>name-pdriver.cxx</b></code>.</dd>
-
- <dt><code><b>--force-overwrite</b></code></dt>
- <dd>Force overwriting of the existing implementation and test driver
- files. Use this option only if you do not mind loosing the changes
- you have made in the sample implementation or test driver files.</dd>
-
- <dt><code><b>--root-element-first</b></code></dt>
- <dd>Indicate that the first global element is the document root. This
- information is used to generate the test driver for the sample
- implementation.</dd>
-
- <dt><code><b>--root-element-last</b></code></dt>
- <dd>Indicate that the last global element is the document root. This
- information is used to generate the test driver for the sample
- implementation.</dd>
-
- <dt><code><b>--root-element <i>element</i></b></code></dt>
- <dd>Indicate that <code><i>element</i></code> is the document root.
- This information is used to generate the test driver for the
- sample implementation.</dd>
-
- <dt><code><b>--generate-xml-schema</b></code></dt>
- <dd>Generate a C++ header file as if the schema being compiled defines
- the XML Schema namespace. In particular, the resulting file will
- have definitions for all parser skeletons and implementations
- corresponding to the XML Schema built-in types. The schema file
- provided to the compiler need not exist and is only used to derive
- the name of the resulting header file. Use the
- <code><b>--extern-xml-schema</b></code> option to include this file
- in the generated files for other schemas.</dd>
-
- <dt><code><b>--extern-xml-schema</b> <i>file</i></code></dt>
- <dd>Include a header file derived from <i>file</i> instead of
- generating the XML Schema namespace mapping inline. The provided
- file need not exist and is only used to derive the name of the
- included header file. Use the <code><b>--generate-xml-schema</b></code>
- option to generate this header file.</dd>
-
- <dt><code><b>--skel-type-suffix</b> <i>suffix</i></code></dt>
- <dd>Use the provided <code><i>suffix</i></code> instead of the
- default <code><b>_pskel</b></code> to construct the names
- of generated parser skeletons.</dd>
-
- <dt><code><b>--skel-file-suffix</b> <i>suffix</i></code></dt>
- <dd>Use the provided <code><i>suffix</i></code> instead of the
- default <code><b>-pskel</b></code> to construct the names of
- generated parser skeleton files.</dd>
-
- <dt><code><b>--impl-type-suffix</b> <i>suffix</i></code></dt>
- <dd>Use the provided <code><i>suffix</i></code> instead of the
- default <code><b>_pimpl</b></code> to construct the names of
- parser implementations for the built-in XML Schema types
- and sample parser implementations.</dd>
-
- <dt><code><b>--impl-file-suffix</b> <i>suffix</i></code></dt>
- <dd>Use the provided <code><i>suffix</i></code> instead of the
- default <code><b>-pimpl</b></code> to construct the names of
- generated sample parser implementation files.</dd>
- </dl>
-
- <h2>CXX-SERIALIZER COMMAND OPTIONS</h2>
-
- <dl class="options">
- <dt><code><b>--type-map</b> <i>mapfile</i></code></dt>
- <dd>Read XML Schema to C++ type mapping information from
- <code><i>mapfile</i></code>. Repeat this option to specify
- several type maps. Type maps are considered in order of
- appearance and the first match is used. By default all
- user-defined types are mapped to <code><b>void</b></code>.
- See the TYPE MAP section below for more information.</dd>
-
- <dt><code><b>--reuse-style-mixin</b></code></dt>
- <dd>Generate code that supports the mixin base serializer
- implementation reuse style. Note that this reuse style
- relies on virtual inheritance and may result in a substantial
- object code size increase for large vocabularies. By default
- support for the tiein style is generated.</dd>
-
- <dt><code><b>--reuse-style-none</b></code></dt>
- <dd>Do not generate any support for base serializer implementation
- reuse. By default support for the tiein style is generated.</dd>
-
- <dt><code><b>--suppress-validation</b></code></dt>
- <dd>Suppress the generation of validation code.</dd>
-
- <dt><code><b>--generate-polymorphic</b></code></dt>
- <dd>Generate polymorphism-aware code. Specify this option if you use
- substitution groups or <code><b>xsi:type</b></code>.</dd>
-
- <dt><code><b>--runtime-polymorphic</b></code></dt>
- <dd>Generate non-polymorphic code that uses the runtime library
- configured with polymorphism support.</dd>
-
- <dt><code><b>--suppress-reset</b></code></dt>
- <dd>Suppress the generation of serializer reset code. Reset
- support allows you to reuse serializers after an error.</dd>
-
- <dt><code><b>--generate-empty-impl</b></code></dt>
- <dd>Generate a sample serializer implementation with empty function
- bodies which can then be filled with the application-specific code.
- For an input file in the form <code><b>name.xsd</b></code> this
- option triggers the generation of the two additional C++ files in the
- form: <code><b>name-simpl.hxx</b></code> (serializer implementation
- header file) and <code><b>name-simpl.cxx</b></code> (serializer
- implementation source file).</dd>
-
- <dt><code><b>--generate-test-driver</b></code></dt>
- <dd>Generate a test driver for the sample serializer implementation. For
- an input file in the form <code><b>name.xsd</b></code> this option
- triggers the generation of an additional C++ file in the form
- <code><b>name-sdriver.cxx</b></code>.</dd>
-
- <dt><code><b>--force-overwrite</b></code></dt>
- <dd>Force overwriting of the existing implementation and test driver
- files. Use this option only if you do not mind loosing the changes
- you have made in the sample implementation or test driver files.</dd>
-
- <dt><code><b>--root-element-first</b></code></dt>
- <dd>Indicate that the first global element is the document root. This
- information is used to generate the test driver for the sample
- implementation.</dd>
-
- <dt><code><b>--root-element-last</b></code></dt>
- <dd>Indicate that the last global element is the document root. This
- information is used to generate the test driver for the sample
- implementation.</dd>
-
- <dt><code><b>--root-element <i>element</i></b></code></dt>
- <dd>Indicate that <code><i>element</i></code> is the document root.
- This information is used to generate the test driver for the
- sample implementation.</dd>
-
- <dt><code><b>--generate-xml-schema</b></code></dt>
- <dd>Generate a C++ header file as if the schema being compiled defines
- the XML Schema namespace. In particular, the resulting file will
- have definitions for all serializer skeletons and implementations
- corresponding to the XML Schema built-in types. The schema file
- provided to the compiler need not exist and is only used to derive
- the name of the resulting header file. Use the
- <code><b>--extern-xml-schema</b></code> option to include this file
- in the generated files for other schemas.</dd>
-
- <dt><code><b>--extern-xml-schema</b> <i>file</i></code></dt>
- <dd>Include a header file derived from <i>file</i> instead of
- generating the XML Schema namespace mapping inline. The provided
- file need not exist and is only used to derive the name of the
- included header file. Use the <code><b>--generate-xml-schema</b></code>
- option to generate this header file.</dd>
-
- <dt><code><b>--skel-type-suffix</b> <i>suffix</i></code></dt>
- <dd>Use the provided <code><i>suffix</i></code> instead of the
- default <code><b>_sskel</b></code> to construct the names
- of generated serializer skeletons.</dd>
-
- <dt><code><b>--skel-file-suffix</b> <i>suffix</i></code></dt>
- <dd>Use the provided <code><i>suffix</i></code> instead of the
- default <code><b>-sskel</b></code> to construct the names of
- generated serializer skeleton files.</dd>
-
- <dt><code><b>--impl-type-suffix</b> <i>suffix</i></code></dt>
- <dd>Use the provided <code><i>suffix</i></code> instead of the
- default <code><b>_simpl</b></code> to construct the names of
- serializer implementations for the built-in XML Schema types
- and sample serializer implementations.</dd>
-
- <dt><code><b>--impl-file-suffix</b> <i>suffix</i></code></dt>
- <dd>Use the provided <code><i>suffix</i></code> instead of the
- default <code><b>-simpl</b></code> to construct the names of
- generated sample serializer implementation files.</dd>
- </dl>
-
-
- <h1>TYPE MAP</h1>
-
- <p>Type map files are used to define a mapping between XML Schema
- and C++ types. For C++/Parser, the compiler uses
- this information to determine the return types of
- <code><b>post_*</b></code> functions in parser skeletons
- corresponding to XML Schema types as well as argument types
- for callbacks corresponding to elements and attributes of these
- types. For C++/Serializer, type maps are used to determine
- the argument type of <code><b>pre</b></code> functions in
- serializer skeletons corresponding to XML Schema types as
- well as return types for callbacks corresponding to elements
- and attributes of these types.</p>
-
- <p>The compiler has a set of predefined mapping rules that map
- the built-in XML Schema types to suitable C++ types (discussed
- in the following sub-sections) and all other types to
- <code><b>void</b></code>. By providing your own type maps you
- can override these predefined rules. The format of the type map
- file is presented below:
- </p>
-
- <pre>
-namespace &lt;schema-namespace> [&lt;cxx-namespace>]
-{
- (include &lt;file-name>;)*
- ([type] &lt;schema-type> &lt;cxx-ret-type> [&lt;cxx-arg-type>];)*
-}
- </pre>
-
- <p>Both <code><i>&lt;schema-namespace></i></code> and
- <code><i>&lt;schema-type></i></code> are regex patterns while
- <code><i>&lt;cxx-namespace></i></code>,
- <code><i>&lt;cxx-ret-type></i></code>, and
- <code><i>&lt;cxx-arg-type></i></code> are regex pattern
- substitutions. All names can be optionally enclosed in
- <code><b>"&nbsp;"</b></code>, for example, to include white-spaces.</p>
-
- <p><code><i>&lt;schema-namespace></i></code> determines XML
- Schema namespace. Optional <code><i>&lt;cxx-namespace></i></code>
- is prefixed to every C++ type name in this namespace declaration.
- <code><i>&lt;cxx-ret-type></i></code> is a C++ type name that is
- used as a return type for the <code><b>post_*</b></code> function
- in C++/Parser or for element/attribute callbacks in C++/Serializer.
- Optional <code><i>&lt;cxx-arg-type></i></code> is an argument type
- for element/attribute callbacks in C++/Parser or for the
- <code><b>pre</b></code> function in C++/Serializer. If
- <code><i>&lt;cxx-arg-type></i></code> is not specified, it defaults
- to <code><i>&lt;cxx-ret-type></i></code> if <code><i>&lt;cxx-ret-type></i></code>
- ends with <code><b>*</b></code> or <code><b>&amp;</b></code> (that is,
- it is a pointer or a reference) and
- <code><b>const</b>&nbsp;<i>&lt;cxx-ret-type></i><b>&amp;</b></code>
- otherwise.
- <code><i>&lt;file-name></i></code> is a file name either in the
- <code><b>"&nbsp;"</b></code> or <code><b>&lt;&nbsp;></b></code> format
- and is added with the <code><b>#include</b></code> directive to
- the generated code.</p>
-
- <p>The <code><b>#</b></code> character starts a comment that ends
- with a new line or end of file. To specify a name that contains
- <code><b>#</b></code> enclose it in <code><b>"&nbsp;"</b></code>.
- For example:</p>
-
- <pre>
-namespace http://www.example.com/xmlns/my my
-{
- include "my.hxx";
-
- # Pass apples by value.
- #
- apple apple;
-
- # Pass oranges as pointers.
- #
- orange orange_t*;
-}
- </pre>
-
- <p>In the example above, for the
- <code><b>http://www.example.com/xmlns/my#orange</b></code>
- XML Schema type, the <code><b>my::orange_t*</b></code> C++ type will
- be used as both return and argument types.</p>
-
- <p>Several namespace declarations can be specified in a single
- file. The namespace declaration can also be completely
- omitted to map types in a schema without a namespace. For
- instance:</p>
-
- <pre>
-include "my.hxx";
-apple apple;
-
-namespace http://www.example.com/xmlns/my
-{
- orange "const orange_t*";
-}
- </pre>
-
- <p>The compiler has a number of predefined mapping rules
- for the built-in XML Schema types that vary depending on
- the mapping used. They are described in the following
- subsections. The last predefined rule for all the mappings
- maps anything that wasn't mapped by previous rules to
- <code><b>void</b></code>:</p>
-
- <pre>
-namespace .*
-{
- .* void void;
-}
- </pre>
-
- <p>When you provide your own type maps with the
- <code><b>--type-map</b></code> option, they are evaluated first.
- This allows you to selectively override predefined rules.</p>
-
-
- <h2>Predefined C++/Parser Type Maps</h2>
-
- <p>The C++/Parser mapping provides a number of predefined type
- map rules for the built-in XML Schema types. They can be
- presented as the following map files:</p>
-
- <pre>
-namespace http://www.w3.org/2001/XMLSchema
-{
- boolean bool bool;
-
- byte "signed char" "signed char";
- unsignedByte "unsigned char" "unsigned char";
-
- short short short;
- unsignedShort "unsigned short" "unsigned short";
-
- int int int;
- unsignedInt "unsigned int" "unsigned int";
-
- long "long long" "long long";
- unsignedLong "unsigned long long" "unsigned long long";
-
- integer long long;
-
- negativeInteger long long;
- nonPositiveInteger long long;
-
- positiveInteger "unsigned long" "unsigned long";
- nonNegativeInteger "unsigned long" "unsigned long";
-
- float float float;
- double double double;
- decimal double double;
-
- NMTOKENS xml_schema::string_sequence*;
- IDREFS xml_schema::string_sequence*;
-
- base64Binary xml_schema::buffer*;
- hexBinary xml_schema::buffer*;
-
- date xml_schema::date;
- dateTime xml_schema::date_time;
- duration xml_schema::duration;
- gDay xml_schema::gday;
- gMonth xml_schema::gmonth;
- gMonthDay xml_schema::gmonth_day;
- gYear xml_schema::gyear;
- gYearMonth xml_schema::gyear_month;
- time xml_schema::time;
-}
- </pre>
-
- <p>If the <code><b>--no-stl</b></code> option is not specified,
- the following mapping is used for the string-based XML Schema
- built-in types:</p>
-
- <pre>
-namespace http://www.w3.org/2001/XMLSchema
-{
- include &lt;string>;
-
- string std::string;
- normalizedString std::string;
- token std::string;
- Name std::string;
- NMTOKEN std::string;
- NCName std::string;
- ID std::string;
- IDREF std::string;
- language std::string;
- anyURI std::string;
-
- QName xml_schema::qname;
-}
- </pre>
-
- <p>Otherwise, a C string-based mapping is used:</p>
-
- <pre>
-namespace http://www.w3.org/2001/XMLSchema
-{
- string char*;
- normalizedString char*;
- token char*;
- Name char*;
- NMTOKEN char*;
- NCName char*;
- ID char*;
- IDREF char*;
- language char*;
- anyURI char*;
-
- QName xml_schema::qname*;
-}
- </pre>
-
- <h2>Predefined C++/Serializer Type Maps</h2>
-
- <p>The C++/Serializer mapping provides a number of predefined type
- map rules for the built-in XML Schema types. They can be
- presented as the following map files:</p>
-
- <pre>
-namespace http://www.w3.org/2001/XMLSchema
-{
- boolean bool bool;
-
- byte "signed char" "signed char";
- unsignedByte "unsigned char" "unsigned char";
-
- short short short;
- unsignedShort "unsigned short" "unsigned short";
-
- int int int;
- unsignedInt "unsigned int" "unsigned int";
-
- long "long long" "long long";
- unsignedLong "unsigned long long" "unsigned long long";
-
- integer long long;
-
- negativeInteger long long;
- nonPositiveInteger long long;
-
- positiveInteger "unsigned long" "unsigned long";
- nonNegativeInteger "unsigned long" "unsigned long";
-
- float float float;
- double double double;
- decimal double double;
-
- NMTOKENS "const xml_schema::string_sequence*";
- IDREFS "const xml_schema::string_sequence*";
-
- base64Binary "const xml_schema::buffer*";
- hexBinary "const xml_schema::buffer*";
-
- date xml_schema::date;
- dateTime xml_schema::date_time;
- duration xml_schema::duration;
- gDay xml_schema::gday;
- gMonth xml_schema::gmonth;
- gMonthDay xml_schema::gmonth_day;
- gYear xml_schema::gyear;
- gYearMonth xml_schema::gyear_month;
- time xml_schema::time;
-}
- </pre>
-
- <p>If the <code><b>--no-stl</b></code> option is not specified,
- the following mapping is used for the string-based XML Schema
- built-in types:</p>
-
- <pre>
-namespace http://www.w3.org/2001/XMLSchema
-{
- include &lt;string>;
-
- string std::string;
- normalizedString std::string;
- token std::string;
- Name std::string;
- NMTOKEN std::string;
- NCName std::string;
- ID std::string;
- IDREF std::string;
- language std::string;
- anyURI std::string;
-
- QName xml_schema::qname;
-}
- </pre>
-
- <p>Otherwise, a C string-based mapping is used:</p>
-
- <pre>
-namespace http://www.w3.org/2001/XMLSchema
-{
- string "const char*";
- normalizedString "const char*";
- token "const char*";
- Name "const char*";
- NMTOKEN "const char*";
- NCName "const char*";
- ID "const char*";
- IDREF "const char*";
- language "const char*";
- anyURI "const char*";
-
- QName "const xml_schema::qname*";
-}
- </pre>
-
- <h1>REGEX AND SHELL QUOTING</h1>
-
- <p>When entering a regular expression argument in the shell
- command line it is often necessary to use quoting (enclosing
- the argument in <code><b>"&nbsp;"</b></code> or
- <code><b>'&nbsp;'</b></code>) in order to prevent the shell
- from interpreting certain characters, for example, spaces as
- argument separators and <code><b>$</b></code> as variable
- expansions.</p>
-
- <p>Unfortunately it is hard to achieve this in a manner that is
- portable across POSIX shells, such as those found on
- GNU/Linux and UNIX, and Windows shell. For example, if you
- use <code><b>"&nbsp;"</b></code> for quoting you will get a
- wrong result with POSIX shells if your expression contains
- <code><b>$</b></code>. The standard way of dealing with this
- on POSIX systems is to use <code><b>'&nbsp;'</b></code> instead.
- Unfortunately, Windows shell does not remove <code><b>'&nbsp;'</b></code>
- from arguments when they are passed to applications. As a result you
- may have to use <code><b>'&nbsp;'</b></code> for POSIX and
- <code><b>"&nbsp;"</b></code> for Windows (<code><b>$</b></code> is
- not treated as a special character on Windows).</p>
-
- <p>Alternatively, you can save regular expression options into
- a file, one option per line, and use this file with the
- <code><b>--options-file</b></code> option. With this approach
- you don't need to worry about shell quoting.</p>
-
- <h1>DIAGNOSTICS</h1>
-
- <p>If the input file is not a valid W3C XML Schema definition,
- <code><b>xsde</b></code> will issue diagnostic messages to STDERR
- and exit with non-zero exit code.</p>
-
- <h1>BUGS</h1>
-
- <p>Send bug reports to the
- <a href="mailto:xsde-users@codesynthesis.com">xsde-users@codesynthesis.com</a> mailing list.</p>
-
- </div>
- <div id="footer">
- &copy;2005-2011 <a href="http://codesynthesis.com">CODE SYNTHESIS TOOLS CC</a>
-
- <div id="terms">
- Permission is granted to copy, distribute and/or modify this
- document under the terms of the
- <a href="http://codesynthesis.com/licenses/fdl-1.2.txt">GNU Free
- Documentation License, version 1.2</a>; with no Invariant Sections,
- no Front-Cover Texts and no Back-Cover Texts.
- </div>
- </div>
-</div>
-</body>
-</html>
diff --git a/xsde/cxx/hybrid/generator.cxx b/xsde/cxx/hybrid/generator.cxx
index 4db77ea..3a61c95 100644
--- a/xsde/cxx/hybrid/generator.cxx
+++ b/xsde/cxx/hybrid/generator.cxx
@@ -17,8 +17,6 @@
#include <cutl/compiler/cxx-indenter.hxx>
#include <cutl/compiler/sloc-counter.hxx>
-#include <backend-elements/indentation/clip.hxx>
-
#include <xsd-frontend/semantic-graph.hxx>
#include <cxx/hybrid/elements.hxx>
@@ -52,7 +50,7 @@
#include <cxx/hybrid/serializer-aggregate-header.hxx>
#include <cxx/hybrid/serializer-aggregate-source.hxx>
-#include <usage.hxx>
+#include <cxx/hybrid/options.hxx>
#include "../../../libxsde/xsde/cxx/version.hxx"
@@ -61,7 +59,6 @@ using std::wcerr;
using std::wcout;
using namespace XSDFrontend::SemanticGraph;
-namespace Indentation = BackendElements::Indentation;
//
//
@@ -213,515 +210,8 @@ namespace CXX
Void Hybrid::Generator::
usage ()
{
- std::wostream& o (wcout);
- ::CLI::Indent::Clip< ::CLI::OptionsUsage, WideChar> clip (o);
-
- o << "--char-encoding <enc>" << endl
- << " Specify the character encoding that should be\n"
- << " used in the object model. Valid values are 'utf8'\n"
- << " (default) and 'iso8859-1'."
- << endl;
-
- o << "--no-stl" << endl
- << " Generate code that does not use STL."
- << endl;
-
- o << "--no-iostream" << endl
- << " Generate code that does not use the iostream\n"
- << " library."
- << endl;
-
- o << "--no-exceptions" << endl
- << " Generate code that does not use C++ exceptions."
- << endl;
-
- o << "--no-long-long" << endl
- << " Generate code that does not use the long long\n"
- << " and unsigned long long types."
- << endl;
-
- o << "--generate-parser" << endl
- << " Generate XML parsing code."
- << endl;
-
- o << "--generate-serializer" << endl
- << " Generate XML serialization code."
- << endl;
-
- o << "--generate-aggregate" << endl
- << " Generate parser/serializer aggregates for root\n"
- << " elements and/or types."
- << endl;
-
- o << "--suppress-validation" << endl
- << " Suppress the generation of validation code in\n"
- << " parser and serializer."
- << endl;
-
- o << "--suppress-parser-val" << endl
- << " Suppress the generation of validation code in\n"
- << " parser."
- << endl;
-
- o << "--suppress-serializer-val" << endl
- << " Suppress the generation of validation code in\n"
- << " serializer."
- << endl;
-
- o << "--omit-default-attributes" << endl
- << " Omit attributes with default and fixed values\n"
- << " from serialized XML documents."
- << endl;
-
- o << "--suppress-enum" << endl
- << " Suppress the generation of the XML Schema\n"
- << " enumeration to C++ enum mapping."
- << endl;
-
- o << "--generate-clone" << endl
- << " Generate clone functions for variable-length\n"
- << " types."
- << endl;
-
- o << "--generate-detach" << endl
- << " Generate detach functions for elements and\n"
- << " attributes of variable-length types."
- << endl;
-
- o << "--generate-insertion <os>" << endl
- << " Generate data representation stream insertion\n"
- << " operators for the <os> output stream type."
- << endl;
-
- o << "--generate-extraction <is>" << endl
- << " Generate data representation stream extraction\n"
- << " operators for the <is> input stream type."
- << endl;
-
- o << "--generate-inline" << endl
- << " Generate certain functions inline."
- << endl;
-
- o << "--generate-forward" << endl
- << " Generate forward declaration file."
- << endl;
-
- o << "--generate-xml-schema" << endl
- << " Generate C++ header files as if the schema being\n"
- << " compiled defines the XML Schema namespace."
- << endl;
-
- o << "--extern-xml-schema <file>" << endl
- << " Generate code as if the XML Schema namespace was\n"
- << " defined in <file> and xsd:included in the schema\n"
- << " being compiled."
- << endl;
-
- o << "--suppress-reset" << endl
- << " Suppress the generation of parser and serializer\n"
- << " reset code."
- << endl;
-
- o << "--custom-allocator" << endl
- << " Generate code that uses custom allocator functions\n"
- << " instead of operator new/delete."
- << endl;
-
- o << "--generate-polymorphic" << endl
- << " Generate polymorphism-aware code. Specify this\n"
- << " option if you use substitution groups or xsi:type."
- << endl;
-
- o << "--runtime-polymorphic" << endl
- << " Generate non-polymorphic code that uses the\n"
- << " runtime library configured with polymorphism\n"
- << " support."
- << endl;
-
- o << "--polymorphic-type <type>" << endl
- << " Indicate that <type> is a root of a polymorphic\n"
- << " type hierarchy."
- << endl;
-
- o << "--generate-typeinfo" << endl
- << " Generate type information functions for\n"
- << " polymorphic object model types."
- << endl;
-
- o << "--polymorphic-schema <file>" << endl
- << " Indicate that <file> contains derivations of\n"
- << " polymorphic types."
- << endl;
-
- o << "--reuse-style-mixin" << endl
- << " Generate code that supports the mixin base\n"
- << " parser/serializer implementation reuse style."
- << endl;
-
- o << "--custom-data <type>" << endl
- << " Add custom data to the C++ class generated for\n"
- << " XML Schema type <type>."
- << endl;
-
- o << "--custom-type <map>" << endl
- << " Use a custom type implementation instead of the\n"
- << " generated version. The <map> argument is in the\n"
- << " form name[=[flags][/[type][/[base][/include]]]],\n"
- << " where <name> is an XML Schema type name,\n"
- << " optional <flags> specify whether the custom type\n"
- << " is fixed or variable-length, optional <type> is\n"
- << " a C++ type name that should be used instead,\n"
- << " optional <base> is a C++ name that should be\n"
- << " given to the generated version, and optional\n"
- << " <include> is the header file that defines the\n"
- << " custom implementation."
- << endl;
-
- o << "--custom-parser <map>" << endl
- << " Use a custom parser implementation instead of the\n"
- << " generated version. The <map> argument is in the\n"
- << " form name[=[base][/include]], where <name> is an\n"
- << " XML Schema type name, optional <base> is a C++\n"
- << " name that should be given to the generated\n"
- << " version, and optional <include> is the header\n"
- << " file that defines the custom implementation."
- << endl;
-
- o << "--custom-serializer <map>" << endl
- << " Use a custom serializer implementation instead of\n"
- << " the generated version. The <map> argument is in\n"
- << " the form name[=[base][/include]], where <name> is\n"
- << " an XML Schema type name, optional <base> is a C++\n"
- << " name that should be given to the generated\n"
- << " version, and optional <include> is the header\n"
- << " file that defines the custom implementation."
- << endl;
-
- o << "--root-element-first" << endl
- << " Treat only the first global element as a document\n"
- << " root."
- << endl;
-
- o << "--root-element-last" << endl
- << " Treat only the last global element as a document\n"
- << " root."
- << endl;
-
- o << "--root-element-all" << endl
- << " Treat all global elements as document roots."
- << endl;
-
- o << "--root-element-none" << endl
- << " Don't treat any global elements as document roots."
- << endl;
-
- o << "--root-element <element>" << endl
- << " Treat only <element> as a document root. Repeat\n"
- << " this option to specify more than one root element."
- << endl;
-
- o << "--root-type <type>" << endl
- << " Generate parser/serializer aggregate for <type>.\n"
- << " Repeat this option to specify more than one type."
- << endl;
-
- o << "--output-dir <dir>" << endl
- << " Write generated files to <dir> instead of the\n"
- << " current directory."
- << endl;
-
- o << "--pskel-type-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '_pskel' suffix\n"
- << " to construct the names of generated parser\n"
- << " skeletons."
- << endl;
-
- o << "--sskel-type-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '_sskel' suffix\n"
- << " to construct the names of generated serializer\n"
- << " skeletons."
- << endl;
-
- o << "--pskel-file-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '-pskel' suffix\n"
- << " to construct the names of generated parser\n"
- << " skeleton files."
- << endl;
-
- o << "--sskel-file-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '-sskel' suffix\n"
- << " to construct the names of generated serializer\n"
- << " skeleton files."
- << endl;
-
- o << "--pimpl-type-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '_pimpl' suffix\n"
- << " to construct the names of generated parser\n"
- << " implementations."
- << endl;
-
- o << "--simpl-type-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '_simpl' suffix\n"
- << " to construct the names of generated serializer\n"
- << " implementations."
- << endl;
-
- o << "--pimpl-file-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '-pimpl' suffix\n"
- << " to construct the names of generated parser\n"
- << " implementation files."
- << endl;
-
- o << "--simpl-file-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '-simpl' suffix\n"
- << " to construct the names of generated serializer\n"
- << " implementation files."
- << endl;
-
- o << "--paggr-type-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '_paggs' suffix\n"
- << " to construct the names of generated parser\n"
- << " aggregates."
- << endl;
-
- o << "--saggr-type-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '_saggr' suffix\n"
- << " to construct the names of generated serializer\n"
- << " aggregates."
- << endl;
-
- o << "--namespace-map <xns>=<cns>" << endl
- << " Map XML Schema namespace <xns> to C++ namespace\n"
- << " <cns>. Repeat this option to specify mapping for\n"
- << " more than one XML Schema namespace."
- << endl;
-
- o << "--namespace-regex <regex>" << endl
- << " Add <regex> to the list of regular expressions\n"
- << " used to translate XML Schema namespace names to\n"
- << " C++ namespace names."
- << endl;
-
- o << "--namespace-regex-trace" << endl
- << " Trace the process of applying regular expressions\n"
- << " specified with the --namespace-regex option."
- << endl;
-
- o << "--reserved-name <name>" << endl
- << " Add <name> to the list of names that should not\n"
- << " be used as identifiers. The name can optionally\n"
- << " be followed by '=' and the replacement name that\n"
- << " should be used instead."
- << endl;
-
- o << "--include-with-brackets" << endl
- << " Use angle brackets (<>) instead of quotes (\"\") in\n"
- << " generated #include directives."
- << endl;
-
- o << "--include-prefix <prefix>" << endl
- << " Add <prefix> to generated #include directive\n"
- << " paths."
- << endl;
-
- o << "--include-regex <regex>" << endl
- << " Add <regex> to the list of regular expressions\n"
- << " used to transform #include directive paths."
- << endl;
-
- o << "--include-regex-trace" << endl
- << " Trace the process of applying regular expressions\n"
- << " specified with the --include-regex option."
- << endl;
-
- o << "--guard-prefix <prefix>" << endl
- << " Add <prefix> to generated header inclusion guards."
- << endl;
-
- // File suffix.
- //
- o << "--hxx-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '.hxx' to\n"
- << " construct the name of the header files."
- << endl;
-
- o << "--ixx-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '.ixx' to\n"
- << " construct the name of the inline files."
- << endl;
-
- o << "--cxx-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '.cxx' to\n"
- << " construct the name of the source files."
- << endl;
-
- o << "--fwd-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '-fwd.hxx'\n"
- << " to construct the name of the forward declaration\n"
- << " file."
- << endl;
-
- // File regex.
- //
- o << "--hxx-regex <regex>" << endl
- << " Use <regex> to construct the names of the header\n"
- << " files."
- << endl;
-
- o << "--ixx-regex <regex>" << endl
- << " Use <regex> to construct the names of the inline\n"
- << " files."
- << endl;
-
- o << "--cxx-regex <regex>" << endl
- << " Use <regex> to construct the names of the source\n"
- << " files."
- << endl;
-
- o << "--fwd-regex <regex>" << endl
- << " Use <regex> to construct the name of the forward\n"
- << " declaration file."
- << endl;
-
-
- // Prologues.
- //
- o << "--hxx-prologue <text>" << endl
- << " Insert <text> at the beginning of the header\n"
- << " files."
- << endl;
-
- o << "--ixx-prologue <text>" << endl
- << " Insert <text> at the beginning of the inline\n"
- << " files."
- << endl;
-
- o << "--cxx-prologue <text>" << endl
- << " Insert <text> at the beginning of the source\n"
- << " files."
- << endl;
-
- o << "--fwd-prologue <text>" << endl
- << " Insert <text> at the beginning of the forward\n"
- << " declaration file."
- << endl;
-
- o << "--prologue <text>" << endl
- << " Insert <text> at the beginning of each generated\n"
- << " file for which there is no file-specific prologue."
- << endl;
-
-
- // Epilogues.
- //
- o << "--hxx-epilogue <text>" << endl
- << " Insert <text> at the end of the header files."
- << endl;
-
- o << "--ixx-epilogue <text>" << endl
- << " Insert <text> at the end of the inline files."
- << endl;
-
- o << "--cxx-epilogue <text>" << endl
- << " Insert <text> at the end of the source files."
- << endl;
-
- o << "--fwd-epilogue <text>" << endl
- << " Insert <text> at the end of the forward\n"
- << " declaration file."
- << endl;
-
- o << "--epilogue <text>" << endl
- << " Insert <text> at the end of each generated file\n"
- << " for which there is no file-specific epilogue."
- << endl;
-
-
- // Prologue files.
- //
- o << "--hxx-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the header files."
- << endl;
-
- o << "--ixx-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the inline files."
- << endl;
-
- o << "--cxx-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the source files."
- << endl;
-
- o << "--fwd-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the forward declaration file."
- << endl;
-
- o << "--prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of each generated file for which there is no file-\n"
- << " specific prologue file."
- << endl;
-
-
- // Epilogue files.
- //
- o << "--hxx-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the header files."
- << endl;
-
- o << "--ixx-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the inline files."
- << endl;
-
- o << "--cxx-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the source files."
- << endl;
-
- o << "--fwd-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the forward declaration file."
- << endl;
-
- o << "--epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " each generated file for which there is no file-\n"
- << " specific epilogue file."
- << endl;
-
-
- // Misc.
- //
- o << "--show-anonymous" << endl
- << " Show elements and attributes that are of anonymous\n"
- << " types."
- << endl;
-
- o << "--show-sloc" << endl
- << " Show the number of generated physical source lines\n"
- << " of code (SLOC)."
- << endl;
-
- o << "--sloc-limit <num>" << endl
- << " Check that the number of generated physical source\n"
- << " lines of code (SLOC) does not exceed <num>."
- << endl;
-
- o << "--options-file <file>" << endl
- << " Read additional options from <file>. Each option\n"
- << " should appear on a separate line optionally\n"
- << " followed by space and an argument."
- << endl;
-
- o << "--proprietary-license" << endl
- << " Indicate that the generated code is licensed under\n"
- << " a proprietary license instead of the GPL."
- << endl;
+ CXX::Hybrid::options::print_usage (wcout);
+ CXX::options::print_usage (wcout);
}
Hybrid::CLI::OptionsSpec Hybrid::Generator::
diff --git a/xsde/cxx/hybrid/options.cli b/xsde/cxx/hybrid/options.cli
new file mode 100644
index 0000000..40df945
--- /dev/null
+++ b/xsde/cxx/hybrid/options.cli
@@ -0,0 +1,353 @@
+// file : xsde/cxx/hybrid/options.cli
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+include <vector>;
+include <string>;
+include <cstddef>; // std::size_t
+
+include <cult/types.hxx>; // NarrowString
+
+include <cxx/options.cli>;
+
+namespace CXX
+{
+ namespace Hybrid
+ {
+ class options: CXX::options
+ {
+ // Features.
+ //
+ bool --generate-parser
+ {
+ "Generate XML parsing code."
+ };
+
+ bool --generate-serializer
+ {
+ "Generate XML serialization code."
+ };
+
+ bool --generate-aggregate
+ {
+ "Generate parser/serializer aggregates for root elements and/or types.
+ See also the \cb{--root-element-*} and \cb{--root-type} options."
+ };
+
+ bool --suppress-validation
+ {
+ "Suppress the generation of validation code in parser and serializer."
+ };
+
+ bool --suppress-parser-val
+ {
+ "Suppress the generation of validation code in parser."
+ };
+
+ bool --suppress-serializer-val
+ {
+ "Suppress the generation of validation code in serializer."
+ };
+
+ bool --omit-default-attributes
+ {
+ "Omit attributes with default and fixed values from serialized
+ XML documents."
+ };
+
+ bool --suppress-enum
+ {
+ "Suppress the generation of the XML Schema enumeration to C++
+ \cb{enum} mapping."
+ };
+
+ bool --generate-clone
+ {
+ "Generate clone functions for variable-length types. These
+ functions allow you to make dynamically-allocated copies of
+ variable-length objects."
+ };
+
+ bool --generate-detach
+ {
+ "Generate detach functions for elements and attributes of
+ variable-length types. These functions, for example, allow
+ you to move sub-trees in the object model either within the
+ same tree or between different trees."
+ };
+
+ std::vector<Cult::Types::NarrowString> --generate-insertion
+ {
+ "<os>",
+ "Generate data representation stream insertion operators for the
+ <os> output stream type. Repeat this option to specify more than
+ one stream type. The special \cb{CDR} and \cb{XDR} arguments are
+ recognized as ACE CDR and Sun RPC XDR stream types and the
+ corresponding stream wrappers provided by the XSD/e runtime are
+ automatically used. For custom stream types use the
+ \cb{--hxx-prologue*} options to include the necessary declarations."
+ };
+
+ std::vector<Cult::Types::NarrowString> --generate-extraction
+ {
+ "<is>",
+ "Generate data representation stream extraction operators for the
+ <is> input stream type. Repeat this option to specify more than
+ one stream type. The special \cb{CDR} and \cb{XDR} arguments are
+ recognized as ACE CDR and Sun RPC XDR stream types and the
+ corresponding stream wrappers provided by the XSD/e runtime are
+ automatically used. For custom stream types use the
+ \cb{--hxx-prologue*} options to include the necessary declarations."
+ };
+
+ bool --generate-forward
+ {
+ "Generate forward declaration file."
+ };
+
+ // Polymorphism.
+ //
+ bool --generate-polymorphic
+ {
+ "Generate polymorphism-aware code. Specify this option if you use
+ substitution groups or \cb{xsi:type}. Use the \cb{--polymorphic-type}
+ option to specify which type hierarchies are polymorphic."
+ };
+
+ bool --runtime-polymorphic
+ {
+ "Generate non-polymorphic code that uses the runtime library
+ configured with polymorphism support."
+ };
+
+ std::vector<Cult::Types::NarrowString> --polymorphic-type
+ {
+ "<type>",
+ "Indicate that <type> is a root of a polymorphic type hierarchy. The
+ XSD/e compiler can often automatically determine which types are
+ polymorphic based on the substitution group declarations. However,
+ you may need to use this option if you are not using substitution
+ groups or if substitution groups are defined in another schema.
+ You need to specify this option when compiling every schema file
+ that references <type>."
+ };
+
+ bool --generate-typeinfo
+ {
+ "Generate custom type information querying functions for polymorphic
+ object model types. These functions can be used instead of the
+ standard C++ RTTI mechanism to determine object's type at runtime."
+ };
+
+ std::vector<Cult::Types::NarrowString> --polymorphic-schema
+ {
+ "<file>",
+ "Indicate that <file> contains derivations of polymorphic types that
+ are not otherwise visible from the schema being compiled. This
+ option is used to make sure that during the generation of parser
+ and serializer aggregates the compiler is aware of all possible
+ derivations of polymorphic types. Repeat this option to specify
+ more than one schema file."
+ };
+
+ // Reuse style.
+ //
+ bool --reuse-style-mixin
+ {
+ "Generate code that supports the mixin base parser/serializer
+ implementation reuse style. Note that this reuse style relies on
+ virtual inheritance and may result in a substantial object code
+ size increase for large vocabularies. By default the tiein reuse
+ style is used."
+ };
+
+ // Custom data/type.
+ //
+ std::vector<Cult::Types::NarrowString> --custom-data
+ {
+ "<type>",
+ "Add the ability to store custom data to the C++ class generated for
+ XML Schema type <type>. To add custom data to a nested compositor
+ class use the qualified name starting from the XML Schema type
+ containing the compositor, for example, \cb{foo::sequence::choise1}."
+ };
+
+ std::vector<Cult::Types::NarrowString> --custom-type
+ {
+ "<map>",
+ "Use a custom type implementation instead of the generated version.
+ The <map> argument is in the form
+ \c{\i{name}[\b{=}[\i{flags}][\b{/}[\i{type}][\b{/}[\i{base}][\b{/}\i{include}]]]]},
+ where the \ci{name} component is the XML Schema type name being
+ customized. Optional \ci{flags} allow you to specify whether the
+ custom type is fixed or variable-length. The \cb{f} flag indicates
+ the type is fixed-length and the \cb{v} flag indicates the type is
+ variable-length. If omitted, the default rules are used to determine
+ the type length. Optional \ci{type} is a C++ type name that should
+ be used instead. If specified, the object model type is defined as
+ a \cb{typedef} alias for this C++ type. Optional \ci{base} is a C++
+ name that should be given to the generated version. It is normally
+ used as a base for the custom implementation. Optional \ci{include}
+ is the header file that defines the custom implementation. It is
+ \cb{#include}'ed into the generated code immediately after (if
+ \ci{base} is specified) or instead of the generated version."
+ };
+
+ std::vector<Cult::Types::NarrowString> --custom-parser
+ {
+ "<map>",
+ "Use a custom parser implementation instead of the generated version.
+ The <map> argument is in the form
+ \c{\i{name}[\b{=}[\i{base}][\b{/}\i{include}]]}, where the \ci{name}
+ component is the XML Schema type name being customized. Optional
+ \ci{base} is a C++ name that should be given to the generated
+ version. It is normally used as a base for the custom implementation.
+ Optional \ci{include} is the header file that defines the custom
+ implementation. It is \cb{#include}'ed into the generated code
+ immediately after (if \ci{base} is specified) or instead of the
+ generated version."
+ };
+
+ std::vector<Cult::Types::NarrowString> --custom-serializer
+ {
+ "<map>",
+ "Use a custom serializer implementation instead of the generated
+ version. The <map> argument is in the form
+ \c{\i{name}[\b{=}[\i{base}][\b{/}\i{include}]]}, where The \ci{name}
+ component is the XML Schema type name being customized. Optional
+ \ci{base} is a C++ name that should be given to the generated
+ version. It is normally used as a base for the custom implementation.
+ Optional \ci{include} is the header file that defines the custom
+ implementation. It is \cb{#include}'ed into the generated code
+ immediately after (if \ci{base} is specified) or instead of the
+ generated version."
+ };
+
+ // Root element/type.
+ //
+
+ bool --root-element-first
+ {
+ "Treat only the first global element as a document root. This
+ determines for which elements parser and serializer aggregates
+ are generated. By default all global elements are considered
+ document roots. See also the \cb{--generate-aggregate} option."
+ };
+
+ bool --root-element-last
+ {
+ "Treat only the last global element as a document root. This
+ determines for which elements parser and serializer aggregates
+ are generated. By default all global elements are considered
+ document roots. See also the \cb{--generate-aggregate} option."
+ };
+
+ bool --root-element-all
+ {
+ "Treat all global elements as document roots (the default behavior).
+ This determines for which elements parser and serializer aggregates
+ are generated. By explicitly specifying this option you can suppress
+ the warning that is issued if more than one global element is
+ defined. See also the \cb{--generate-aggregate} option."
+ };
+
+ bool --root-element-none
+ {
+ "Do not treat any global elements as document roots. This determines
+ for which elements parser and serializer aggregates are generated.
+ By default all global elements are considered document roots. See
+ also the \cb{--generate-aggregate} option."
+ };
+
+ std::vector<Cult::Types::NarrowString> --root-element
+ {
+ "<element>",
+ "Treat only <element> as a document root. This determines for which
+ elements parser and serializer aggregates are generated. Repeat
+ this option to specify more than one root element. See also the
+ \cb{--generate-aggregate} option."
+ };
+
+ std::vector<Cult::Types::NarrowString> --root-type
+ {
+ "<type>",
+ "Generate parser/serializer aggregate for <type>. Repeat this option
+ to specify more than one type. See also the \cb{--generate-aggregate}
+ option."
+ };
+
+ // Suffixes.
+ //
+ Cult::Types::NarrowString --pskel-type-suffix = "_pskel"
+ {
+ "<suffix>",
+ "Use <suffix> instead of the default \cb{_pskel} to construct the
+ names of generated parser skeletons."
+ };
+
+ Cult::Types::NarrowString --sskel-type-suffix = "_sskel"
+ {
+ "<suffix>",
+ "Use <suffix> instead of the default \cb{_sskel} to construct the
+ names of generated serializer skeletons."
+ };
+
+ Cult::Types::NarrowString --pskel-file-suffix = "-pskel"
+ {
+ "<suffix>",
+ "Use <suffix> instead of the default \cb{-pskel} to construct the
+ names of generated parser skeleton files."
+ };
+
+ Cult::Types::NarrowString --sskel-file-suffix = "-sskel"
+ {
+ "<suffix>",
+ "Use <suffix> instead of the default \cb{-sskel} to construct the
+ names of generated serializer skeleton files."
+ };
+
+ Cult::Types::NarrowString --pimpl-type-suffix = "_pimpl"
+ {
+ "<suffix>",
+ "Use <suffix> instead of the default \cb{_pimpl} to construct the
+ names of generated parser implementations."
+ };
+
+ Cult::Types::NarrowString --simpl-type-suffix = "_simpl"
+ {
+ "<suffix>",
+ "Use <suffix> instead of the default \cb{_simpl} to construct the
+ names of generated serializer implementations."
+ };
+
+ Cult::Types::NarrowString --pimpl-file-suffix = "-pimpl"
+ {
+ "<suffix>",
+ "Use <suffix> instead of the default \cb{-pimpl} to construct the
+ names of generated parser implementation files."
+ };
+
+ Cult::Types::NarrowString --simpl-file-suffix = "-simpl"
+ {
+ "<suffix>",
+ "Use <suffix> instead of the default \cb{-simpl} to construct the
+ names of generated serializer implementation files."
+ };
+
+ Cult::Types::NarrowString --paggr-type-suffix = "_paggs"
+ {
+ "<suffix>",
+ "Use <suffix> instead of the default \cb{_paggs} to construct the
+ names of generated parser aggregates."
+ };
+
+ Cult::Types::NarrowString --saggr-type-suffix = "_saggr"
+ {
+ "<suffix>",
+ "Use <suffix> instead of the default \cb{_saggr} to construct the
+ names of generated serializer aggregates."
+ };
+ };
+ }
+}
diff --git a/xsde/cxx/options.cli b/xsde/cxx/options.cli
new file mode 100644
index 0000000..45425ea
--- /dev/null
+++ b/xsde/cxx/options.cli
@@ -0,0 +1,515 @@
+// file : xsde/cxx/options.cli
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+include <vector>;
+include <string>;
+include <cstddef>; // std::size_t
+
+include <cult/types.hxx>; // NarrowString
+
+include <options.cli>;
+
+namespace CXX
+{
+ class options: ::options = 0
+ {
+ Cult::Types::NarrowString --output-dir
+ {
+ "<dir>",
+ "Write generated files to <dir> instead of the current directory."
+ };
+
+ Cult::Types::NarrowString --char-encoding = "utf8"
+ {
+ "<enc>",
+ "Specify the application character encoding. Valid values are \cb{utf8}
+ (default) and \cb{iso8859-1}. Note that this encoding is not the same
+ as the XML document encoding that is being parsed or serialized.
+ Rather, it is the encoding that is used inside the application. When
+ an XML document is parsed, the character data is automatically
+ converted to the application encoding. Similarly, when an XML
+ document is serialized, the data in the application encoding is
+ automatically converted to the resulting document encoding."
+ };
+
+ // C++ features.
+ //
+ bool --no-stl
+ {
+ "Generate code that does not use the C++ Standard Template Library
+ (STL)."
+ };
+
+ bool --no-iostream
+ {
+ "Generate code that does not use the C++ standard input/output stream
+ library (iostream)."
+ };
+
+ bool --no-exceptions
+ {
+ "Generate code that does not use C++ exceptions."
+ };
+
+ bool --no-long-long
+ {
+ "Generate code that does not use the \cb{long long} and \cb{unsigned
+ long long} types. The 64 bit \cb{long} and \cb{unsignedLong} built-in
+ XML Schema types are then mapped to \cb{long} and \cb{unsigned long}."
+ };
+
+ bool --custom-allocator
+ {
+ "Generate code that performs memory management using custom allocator
+ functions provided by your application instead of the standard operator
+ \cb{new} and \cb{delete}."
+ };
+
+ bool --generate-inline
+ {
+ "Generate simple functions inline. This option triggers creation of the
+ inline file."
+ };
+
+ bool --suppress-reset
+ {
+ "Suppress the generation of parser/serializer reset code. Reset support
+ allows you to reuse parsers/serializers after an error."
+ };
+
+ // Extern XML Schema.
+ //
+ bool --generate-xml-schema
+ {
+ "Generate a C++ header files as if the schema being compiled defines the
+ XML Schema namespace. For the C++/Parser mapping, the resulting file
+ will contain definitions for all the parser skeletons and
+ implementations corresponding to the XML Schema built-in types. For
+ the C++/Serializer mapping, the resulting file will contain definitions
+ for all the serializer skeletons and implementations corresponding to
+ the XML Schema built-in types. For the C++/Hybrid mapping, in addition
+ the the above, a third header file will contain definitions for all
+ the object model types corresponding to the XML Schema built-in types.
+
+ The schema file provided to the compiler need not exist and is only
+ used to derive the name of the resulting header file. Use the
+ \cb{--extern-xml-schema} option to include this file in the
+ generated files for other schemas."
+ };
+
+ Cult::Types::NarrowString --extern-xml-schema
+ {
+ "<file>",
+ "Include a header file derived from <file> instead of generating the
+ XML Schema namespace mapping inline. The provided file need not
+ exist and is only used to derive the name of the included header
+ file. Use the \cb{--generate-xml-schema} option to generate this
+ header file."
+ };
+
+ // Namespace mapping.
+ //
+ std::vector<Cult::Types::NarrowString> --namespace-map
+ {
+ "<xns>=<cns>",
+ "Map XML Schema namespace <xns> to C++ namespace <cns>. Repeat
+ this option to specify mapping for more than one XML Schema namespace.
+ For example, the following option:
+
+ \cb{--namespace-map http://example.com/foo/bar=foo::bar}
+
+ Will map the \cb{http://example.com/foo/bar} XML Schema namespace to
+ the \cb{foo::bar} C++ namespace."
+ };
+
+ std::vector<Cult::Types::NarrowString> --namespace-regex
+ {
+ "<regex>",
+ "Add <regex> to the list of regular expressions used to translate XML
+ Schema namespace names to C++ namespace names. <regex> is a Perl-like
+ regular expression in the form
+ \c{\b{/}\i{pattern}\b{/}\i{replacement}\b{/}}. Any character can be
+ used as a delimiter instead of \cb{/}. Escaping of the delimiter
+ character in \ci{pattern} or \ci{replacement} is not supported.
+
+ All the regular expressions are pushed into a stack with the last
+ specified expression considered first. The first match that
+ succeeds is used. Regular expressions are applied to a string in
+ the form
+
+ \c{\i{filename} \i{namespace}}
+
+ For example, if you have file \cb{hello.xsd} with namespace
+ \cb{http://example.com/hello} and you run \cb{xsd} on this file,
+ then the string in question will be:
+
+ \cb{hello.xsd. http://example.com/hello}
+
+ For the built-in XML Schema namespace the string is:
+
+ \cb{XMLSchema.xsd http://www.w3.org/2001/XMLSchema}
+
+ The following three steps are performed for each regular expression
+ until the match is found:
+
+ 1. The expression is applied and if the result is empty the next
+ expression is considered.
+
+ 2. All \cb{/} are replaced with \cb{::}.
+
+ 3. The result is verified to be a valid C++ scope name (e.g.,
+ \cb{foo::bar}). If this test succeeds, the result is used as a
+ C++ namespace name.
+
+ As an example, the following expression maps XML Schema namespaces
+ in the form \cb{http://example.com/foo/bar} to C++ namespaces in the
+ form \cb{foo::bar}:
+
+ \cb{%.* http://example.com/(.+)%$1%}
+
+ See also the REGEX AND SHELL QUOTING section below."
+ };
+
+ bool --namespace-regex-trace
+ {
+ "Trace the process of applying regular expressions specified with the
+ \cb{--namespace-regex} option. Use this option to find out why your
+ regular expressions don't do what you expected them to do."
+ };
+
+ // Reserved names.
+ //
+ std::vector<Cult::Types::NarrowString> --reserved-name
+ {
+ "<n>[=<r>]",
+ "Add name <n> to the list of names that should not be used as
+ identifiers. The name can optionally be followed by \cb{=} and the
+ replacement name <r> that should be used instead. All the C++ keywords
+ are already in this list."
+ };
+
+ // Include options.
+ //
+ bool --include-with-brackets
+ {
+ "Use angle brackets (<>) instead of quotes (\"\") in generated
+ \cb{#include} directives."
+ };
+
+ Cult::Types::NarrowString --include-prefix
+ {
+ "<prefix>",
+ "Add <prefix> to generated \cb{#include} directive paths.
+
+ For example, if you had the following import element in your schema
+
+ \cb{<import namespace=\"...\" schemaLocation=\"base.xsd\"/>}
+
+ and compiled this fragment with \cb{--include-prefix schemas/}, then
+ the include directive in the generated code would be:
+
+ \cb{#include \"schemas/base.hxx\"}"
+ };
+
+ std::vector<Cult::Types::NarrowString> --include-regex
+ {
+ "<regex>",
+ "Add <regex> to the list of regular expressions used to transform
+ \cb{#include} directive paths. <regex> is a Perl-like regular
+ expression in the form \c{\b{/}\i{pattern}\b{/}\i{replacement}\b{/}}.
+ Any character can be used as a delimiter instead of \cb{/}. Escaping
+ of the delimiter character in \ci{pattern} or \ci{replacement} is not
+ supported.
+
+ All the regular expressions are pushed into a stack with the last
+ specified expression considered first. The first match that succeeds
+ is used.
+
+ As an example, the following expression transforms paths in the form
+ \cb{schemas/foo/bar} to paths in the form \cb{generated/foo/bar}:
+
+ \cb{%schemas/(.+)%generated/$1%}
+
+ See also the REGEX AND SHELL QUOTING section below."
+ };
+
+ bool --include-regex-trace
+ {
+ "Trace the process of applying regular expressions specified with the
+ \cb{--include-regex} option. Use this option to find out why your
+ regular expressions don't do what you expected them to do."
+ };
+
+ Cult::Types::NarrowString --guard-prefix
+ {
+ "<prefix>",
+ "Add <prefix> to generated header inclusion guards. The prefix is
+ transformed to upper case and characters that are illegal in a
+ preprocessor macro name are replaced with underscores. If this
+ option is not specified then the directory part of the input schema
+ file is used as a prefix."
+ };
+
+ // File suffixes.
+ //
+ Cult::Types::NarrowString --hxx-suffix = ".hxx"
+ {
+ "<suffix>",
+ "Use the provided <suffix> instead of the default \cb{.hxx} to
+ construct the name of the header file. Note that this suffix is also
+ used to construct names of header files corresponding to
+ included/imported schemas."
+ };
+
+ Cult::Types::NarrowString --ixx-suffix = ".ixx"
+ {
+ "<suffix>",
+ "Use the provided <suffix> instead of the default \cb{.ixx} to
+ construct the name of the inline file."
+ };
+
+ Cult::Types::NarrowString --cxx-suffix = ".cxx"
+ {
+ "<suffix>",
+ "Use the provided <suffix> instead of the default \cb{.cxx} to
+ construct the name of the source file."
+ };
+
+ Cult::Types::NarrowString --fwd-suffix = "-fwd.hxx"
+ {
+ "<suffix>",
+ "Use the provided <suffix> instead of the default \cb{-fwd.hxx} to
+ construct the name of the forward declaration file."
+ };
+
+ Cult::Types::NarrowString --hxx-regex
+ {
+ "<regex>",
+ "Use the provided expression to construct the name of the header file.
+ <regex> is a Perl-like regular expression in the form
+ \c{\b{/}\i{pattern}\b{/}\i{replacement}\b{/}}.
+ Note that this expression is also used to construct names of header
+ files corresponding to included/imported schemas.
+
+ For the C++/Hybrid mapping, the <regex> argument can be optionally
+ prefixed with a file key in the form \c{\i{key}=\i{regex}}. The valid
+ values for \ci{key} are \cb{pskel} (parser skeleton files), \cb{pimpl}
+ (parser implementation files), \cb{sskel} (serializer skeleton files),
+ \cb{simpl} (serializer implementation files), and \cb{*} (all files).
+ If \ci{key} is empty or not present then the expression is used for the
+ object model files only.
+
+ See also the REGEX AND SHELL QUOTING section below."
+ };
+
+ Cult::Types::NarrowString --ixx-regex
+ {
+ "<regex>",
+ "Use the provided expression to construct the name of the inline file.
+ <regex> is a Perl-like regular expression in the form
+ \c{\b{/}\i{pattern}\b{/}\i{replacement}\b{/}}. For the C++/Hybrid
+ mapping, the <regex> argument can be optionally prefixed with a file
+ key. See the \cb{--hxx-regex} option for details. See also the REGEX
+ AND SHELL QUOTING section below."
+ };
+
+ Cult::Types::NarrowString --cxx-regex
+ {
+ "<regex>",
+ "Use the provided expression to construct the name of the source file.
+ <regex> is a Perl-like regular expression in the form
+ \c{\b{/}\i{pattern}\b{/}\i{replacement}\b{/}}. For the C++/Hybrid
+ mapping, the <regex> argument can be optionally prefixed with a file
+ key. See the \cb{--hxx-regex} option for details. See also the REGEX
+ AND SHELL QUOTING section below."
+ };
+
+ Cult::Types::NarrowString --fwd-regex
+ {
+ "<regex>",
+ "Use the provided expression to construct the name of the forward
+ declaration file. <regex> is a Perl-like regular expression in the
+ form \c{\b{/}\i{pattern}\b{/}\i{replacement}\b{/}}. See also the REGEX
+ AND SHELL QUOTING section below."
+ };
+
+ // Prologues/epilogues.
+ //
+ std::vector<Cult::Types::NarrowString> --hxx-prologue
+ {
+ "<text>",
+ "Insert <text> at the beginning of the header file.
+
+ For the C++/Hybrid mapping, the <text> argument can be optionally
+ prefixed with a file key in the form \c{\i{key}=\i{text}}. The valid
+ values for \ci{key} are \cb{pskel} (parser skeleton files), \cb{pimpl}
+ (parser implementation files), \cb{sskel} (serializer skeleton files),
+ \cb{simpl} (serializer implementation files), and \cb{*} (all files).
+ If \ci{key} is empty or not present then the text is used for the
+ object model files only."
+ };
+
+ std::vector<Cult::Types::NarrowString> --ixx-prologue
+ {
+ "<text>",
+ "Insert <text> at the beginning of the inline file. For the C++/Hybrid
+ mapping, the <text> argument can be optionally prefixed with a file
+ key. See the \cb{--hxx-prologue} option for details."
+ };
+
+ std::vector<Cult::Types::NarrowString> --cxx-prologue
+ {
+ "<text>",
+ "Insert <text> at the beginning of the source file. For the C++/Hybrid
+ mapping, the <text> argument can be optionally prefixed with a file
+ key. See the \cb{--hxx-prologue} option for details."
+ };
+
+ std::vector<Cult::Types::NarrowString> --fwd-prologue
+ {
+ "<text>",
+ "Insert <text> at the beginning of the forward declaration file."
+ };
+
+ std::vector<Cult::Types::NarrowString> --prologue
+ {
+ "<text>",
+ "Insert <text> at the beginning of each generated file for which
+ there is no file-specific prologue. For the C++/Hybrid mapping, the
+ <text> argument can be optionally prefixed with a file key. See the
+ \cb{--hxx-prologue} option for details."
+ };
+
+ std::vector<Cult::Types::NarrowString> --hxx-epilogue
+ {
+ "<text>",
+ "Insert <text> at the end of the header file. For the C++/Hybrid
+ mapping, the <text> argument can be optionally prefixed with a file
+ key. See the \cb{--hxx-prologue} option for details."
+ };
+
+ std::vector<Cult::Types::NarrowString> --ixx-epilogue
+ {
+ "<text>",
+ "Insert <text> at the end of the inline file. For the C++/Hybrid
+ mapping, the <text> argument can be optionally prefixed with a file
+ key. See the \cb{--hxx-prologue} option for details."
+ };
+
+ std::vector<Cult::Types::NarrowString> --cxx-epilogue
+ {
+ "<text>",
+ "Insert <text> at the end of the source file. For the C++/Hybrid
+ mapping, the <text> argument can be optionally prefixed with a file
+ key. See the \cb{--hxx-prologue} option for details."
+ };
+
+ std::vector<Cult::Types::NarrowString> --fwd-epilogue
+ {
+ "<text>",
+ "Insert <text> at the end of the forward declaration file."
+ };
+
+ std::vector<Cult::Types::NarrowString> --epilogue
+ {
+ "<text>",
+ "Insert <text> at the end of each generated file for which there
+ is no file-specific epilogue. For the C++/Hybrid mapping, the <text>
+ argument can be optionally prefixed with a file key. See the
+ \cb{--hxx-prologue} option for details."
+ };
+
+ Cult::Types::NarrowString --hxx-prologue-file
+ {
+ "<file>",
+ "Insert the content of the <file> at the beginning of the header file.
+
+ For the C++/Hybrid mapping, the <file> argument can be optionally
+ prefixed with a file key in the form \c{\i{key}=\i{file}}. The valid
+ values for \ci{key} are \cb{pskel} (parser skeleton files), \cb{pimpl}
+ (parser implementation files), \cb{sskel} (serializer skeleton files),
+ \cb{simpl} (serializer implementation files), and \cb{*} (all files).
+ If \ci{key} is empty or not present then the file is used for the
+ object model files only."
+ };
+
+ Cult::Types::NarrowString --ixx-prologue-file
+ {
+ "<file>",
+ "Insert the content of the <file> at the beginning of the inline file.
+ For the C++/Hybrid mapping, the <file> argument can be optionally
+ prefixed with a file key. See the \cb{--hxx-prologue-file} option
+ for details."
+ };
+
+ Cult::Types::NarrowString --cxx-prologue-file
+ {
+ "<file>",
+ "Insert the content of the <file> at the beginning of the source file.
+ For the C++/Hybrid mapping, the <file> argument can be optionally
+ prefixed with a file key. See the \cb{--hxx-prologue-file} option
+ for details."
+ };
+
+ Cult::Types::NarrowString --fwd-prologue-file
+ {
+ "<file>",
+ "Insert the content of the <file> at the beginning of the forward
+ declaration file."
+ };
+
+ Cult::Types::NarrowString --prologue-file
+ {
+ "<file>",
+ "Insert the content of the <file> at the beginning of each generated
+ file for which there is no file-specific prologue file. For the
+ C++/Hybrid mapping, the <file> argument can be optionally prefixed
+ with a file key. See the \cb{--hxx-prologue-file} option for details."
+ };
+
+ Cult::Types::NarrowString --hxx-epilogue-file
+ {
+ "<file>",
+ "Insert the content of the <file> at the end of the header file.
+ For the C++/Hybrid mapping, the <file> argument can be optionally
+ prefixed with a file key. See the \cb{--hxx-prologue-file} option
+ for details."
+ };
+
+ Cult::Types::NarrowString --ixx-epilogue-file
+ {
+ "<file>",
+ "Insert the content of the <file> at the end of the inline file.
+ For the C++/Hybrid mapping, the <file> argument can be optionally
+ prefixed with a file key. See the \cb{--hxx-prologue-file} option
+ for details."
+ };
+
+ Cult::Types::NarrowString --cxx-epilogue-file
+ {
+ "<file>",
+ "Insert the content of the <file> at the end of the source file.
+ For the C++/Hybrid mapping, the <file> argument can be optionally
+ prefixed with a file key. See the \cb{--hxx-prologue-file} option
+ for details."
+ };
+
+ Cult::Types::NarrowString --fwd-epilogue-file
+ {
+ "<file>",
+ "Insert the content of the <file> at the end of the forward declaration
+ file."
+ };
+
+ Cult::Types::NarrowString --epilogue-file
+ {
+ "<file>",
+ "Insert the content of the <file> at the end of each generated file
+ for which there is no file-specific epilogue file. For the C++/Hybrid
+ mapping, the <file> argument can be optionally prefixed with a file
+ key. See the \cb{--hxx-prologue-file} option for details."
+ };
+ };
+}
diff --git a/xsde/cxx/parser/generator.cxx b/xsde/cxx/parser/generator.cxx
index 6c8f8c7..828368a 100644
--- a/xsde/cxx/parser/generator.cxx
+++ b/xsde/cxx/parser/generator.cxx
@@ -16,8 +16,6 @@
#include <cutl/compiler/cxx-indenter.hxx>
#include <cutl/compiler/sloc-counter.hxx>
-#include <backend-elements/indentation/clip.hxx>
-
#include <xsd-frontend/semantic-graph.hxx>
#include <type-map/lexer.hxx>
@@ -44,7 +42,7 @@
#include <cxx/parser/attribute-validation-source.hxx>
#include <cxx/parser/characters-validation-source.hxx>
-#include <usage.hxx>
+#include <cxx/parser/options.hxx>
#include "../../../libxsde/xsde/cxx/version.hxx"
@@ -184,346 +182,8 @@ namespace CXX
Void Parser::Generator::
usage ()
{
- std::wostream& o (wcout);
- ::CLI::Indent::Clip< ::CLI::OptionsUsage, WideChar> clip (o);
-
- o << "--type-map <mapfile>" << endl
- << " Read XML Schema to C++ type mapping information\n"
- << " from <mapfile>. Repeat this option to specify\n"
- << " several type maps. Type maps are considered in\n"
- << " order of appearance and the first match is used."
- << endl;
-
- o << "--char-encoding <enc>" << endl
- << " Specify the character encoding that should be\n"
- << " used for the extracted text data. Valid values\n"
- << " are 'utf8' (default) and 'iso8859-1'."
- << endl;
-
- o << "--no-stl" << endl
- << " Generate code that does not use STL."
- << endl;
-
- o << "--no-iostream" << endl
- << " Generate code that does not use the iostream\n"
- << " library."
- << endl;
-
- o << "--no-exceptions" << endl
- << " Generate code that does not use C++ exceptions."
- << endl;
-
- o << "--no-long-long" << endl
- << " Generate code that does not use the long long\n"
- << " and unsigned long long types."
- << endl;
-
- o << "--reuse-style-mixin" << endl
- << " Generate code that supports the mixin base parser\n"
- << " implementation reuse style."
- << endl;
-
- o << "--reuse-style-none" << endl
- << " Do not generate any support for base parser\n"
- << " implementation reuse."
- << endl;
-
- o << "--generate-inline" << endl
- << " Generate certain functions inline."
- << endl;
-
- o << "--suppress-validation" << endl
- << " Suppress the generation of validation code."
- << endl;
-
- o << "--generate-polymorphic" << endl
- << " Generate polymorphism-aware code. Specify this\n"
- << " option if you use substitution groups or xsi:type."
- << endl;
-
- o << "--runtime-polymorphic" << endl
- << " Generate non-polymorphic code that uses the\n"
- << " runtime library configured with polymorphism\n"
- << " support."
- << endl;
-
- o << "--suppress-reset" << endl
- << " Suppress the generation of parser reset code."
- << endl;
-
- o << "--custom-allocator" << endl
- << " Generate code that uses custom allocator functions\n"
- << " instead of operator new/delete."
- << endl;
-
- o << "--generate-noop-impl" << endl
- << " Generate a sample parser implementation that\n"
- << " does nothing (no operation)."
- << endl;
-
- o << "--generate-print-impl" << endl
- << " Generate a sample parser implementation that\n"
- << " prints the XML data to STDOUT."
- << endl;
-
- o << "--generate-test-driver" << endl
- << " Generate a test driver for the sample parser\n"
- << " implementation."
- << endl;
-
- o << "--force-overwrite" << endl
- << " Force overwriting of the existing implementation\n"
- << " and test driver files."
- << endl;
-
- o << "--root-element-first" << endl
- << " Indicate that the first global element is the\n"
- << " document root."
- << endl;
-
- o << "--root-element-last" << endl
- << " Indicate that the last global element is the\n"
- << " document root."
- << endl;
-
- o << "--root-element <element>" << endl
- << " Indicate that <element> is the document root."
- << endl;
-
- o << "--generate-xml-schema" << endl
- << " Generate a C++ header file as if the schema being\n"
- << " compiled defines the XML Schema namespace."
- << endl;
-
- o << "--extern-xml-schema <file>" << endl
- << " Generate code as if the XML Schema namespace was\n"
- << " defined in <file> and xsd:included in the schema\n"
- << " being compiled."
- << endl;
-
- o << "--output-dir <dir>" << endl
- << " Write generated files to <dir> instead of the\n"
- << " current directory."
- << endl;
-
- o << "--skel-type-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '_pskel' to\n"
- << " construct the names of generated parser skeletons."
- << endl;
-
- o << "--skel-file-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '-pskel' to\n"
- << " construct the names of generated parser skeleton\n"
- << " files."
- << endl;
-
- o << "--impl-type-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '_pimpl' to\n"
- << " construct the names of parser implementations for\n"
- << " the built-in XML Schema types and sample parser\n"
- << " implementations."
- << endl;
-
- o << "--impl-file-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '-pimpl' to\n"
- << " construct the names of generated sample parser\n"
- << " implementation files."
- << endl;
-
- o << "--namespace-map <xns>=<cns>" << endl
- << " Map XML Schema namespace <xns> to C++ namespace\n"
- << " <cns>. Repeat this option to specify mapping for\n"
- << " more than one XML Schema namespace."
- << endl;
-
- o << "--namespace-regex <regex>" << endl
- << " Add <regex> to the list of regular expressions\n"
- << " used to translate XML Schema namespace names to\n"
- << " C++ namespace names."
- << endl;
-
- o << "--namespace-regex-trace" << endl
- << " Trace the process of applying regular expressions\n"
- << " specified with the --namespace-regex option."
- << endl;
-
- o << "--reserved-name <name>" << endl
- << " Add <name> to the list of names that should not\n"
- << " be used as identifiers. The name can optionally\n"
- << " be followed by '=' and the replacement name that\n"
- << " should be used instead."
- << endl;
-
- o << "--include-with-brackets" << endl
- << " Use angle brackets (<>) instead of quotes (\"\") in\n"
- << " generated #include directives."
- << endl;
-
- o << "--include-prefix <prefix>" << endl
- << " Add <prefix> to generated #include directive\n"
- << " paths."
- << endl;
-
- o << "--include-regex <regex>" << endl
- << " Add <regex> to the list of regular expressions\n"
- << " used to transform #include directive paths."
- << endl;
-
- o << "--include-regex-trace" << endl
- << " Trace the process of applying regular expressions\n"
- << " specified with the --include-regex option."
- << endl;
-
- o << "--guard-prefix <prefix>" << endl
- << " Add <prefix> to generated header inclusion guards."
- << endl;
-
- o << "--hxx-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '.hxx' to\n"
- << " construct the name of the header file."
- << endl;
-
- o << "--ixx-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '.ixx' to\n"
- << " construct the name of the inline file."
- << endl;
-
- o << "--cxx-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '.cxx' to\n"
- << " construct the name of the source file."
- << endl;
-
- o << "--hxx-regex <regex>" << endl
- << " Use <regex> to construct the name of the header\n"
- << " file."
- << endl;
-
- o << "--ixx-regex <regex>" << endl
- << " Use <regex> to construct the name of the inline\n"
- << " file."
- << endl;
-
- o << "--cxx-regex <regex>" << endl
- << " Use <regex> to construct the name of the source\n"
- << " file."
- << endl;
-
-
- // Prologues.
- //
- o << "--hxx-prologue <text>" << endl
- << " Insert <text> at the beginning of the header file."
- << endl;
-
- o << "--ixx-prologue <text>" << endl
- << " Insert <text> at the beginning of the inline file."
- << endl;
-
- o << "--cxx-prologue <text>" << endl
- << " Insert <text> at the beginning of the source file."
- << endl;
-
- o << "--prologue <text>" << endl
- << " Insert <text> at the beginning of each generated\n"
- << " file for which there is no file-specific prologue."
- << endl;
-
-
- // Epilogues.
- //
- o << "--hxx-epilogue <text>" << endl
- << " Insert <text> at the end of the header file."
- << endl;
-
- o << "--ixx-epilogue <text>" << endl
- << " Insert <text> at the end of the inline file."
- << endl;
-
- o << "--cxx-epilogue <text>" << endl
- << " Insert <text> at the end of the source file."
- << endl;
-
- o << "--epilogue <text>" << endl
- << " Insert <text> at the end of each generated file\n"
- << " for which there is no file-specific epilogue."
- << endl;
-
-
- // Prologue files.
- //
- o << "--hxx-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the header file."
- << endl;
-
- o << "--ixx-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the inline file."
- << endl;
-
- o << "--cxx-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the source file."
- << endl;
-
- o << "--prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of each generated file for which there is no file-\n"
- << " specific prologue file."
- << endl;
-
-
- // Epilogue files.
- //
- o << "--hxx-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the header file."
- << endl;
-
- o << "--ixx-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the inline file."
- << endl;
-
- o << "--cxx-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the source file."
- << endl;
-
- o << "--epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " each generated file for which there is no file-\n"
- << " specific epilogue file."
- << endl;
-
-
- // Misc.
- //
- o << "--show-anonymous" << endl
- << " Show elements and attributes that are of anonymous\n"
- << " types."
- << endl;
-
- o << "--show-sloc" << endl
- << " Show the number of generated physical source lines\n"
- << " of code (SLOC)."
- << endl;
-
- o << "--sloc-limit <num>" << endl
- << " Check that the number of generated physical source\n"
- << " lines of code (SLOC) does not exceed <num>."
- << endl;
-
- o << "--options-file <file>" << endl
- << " Read additional options from <file>. Each option\n"
- << " should appear on a separate line optionally\n"
- << " followed by space and an argument."
- << endl;
-
- o << "--proprietary-license" << endl
- << " Indicate that the generated code is licensed under\n"
- << " a proprietary license instead of the GPL."
- << endl;
+ CXX::Parser::options::print_usage (wcout);
+ CXX::options::print_usage (wcout);
}
Parser::CLI::OptionsSpec Parser::Generator::
@@ -631,7 +291,6 @@ namespace CXX
AutoUnlinks& unlinks)
{
using std::ios_base;
- namespace Indentation = BackendElements::Indentation;
typedef cutl::re::regexsub Regex;
diff --git a/xsde/cxx/parser/options.cli b/xsde/cxx/parser/options.cli
new file mode 100644
index 0000000..552b473
--- /dev/null
+++ b/xsde/cxx/parser/options.cli
@@ -0,0 +1,159 @@
+// file : xsde/cxx/parser/options.cli
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+include <vector>;
+include <string>;
+include <cstddef>; // std::size_t
+
+include <cult/types.hxx>; // NarrowString
+
+include <cxx/options.cli>;
+
+namespace CXX
+{
+ namespace Parser
+ {
+ class options: CXX::options
+ {
+ std::vector<Cult::Types::NarrowString> --type-map
+ {
+ "<mapfile>",
+ "Read XML Schema to C++ type mapping information from <mapfile>.
+ Repeat this option to specify several type maps. Type maps are
+ considered in order of appearance and the first match is used.
+ By default all user-defined types are mapped to \cb{void}. See
+ the TYPE MAP section below for more information."
+ };
+
+ bool --suppress-validation
+ {
+ "Suppress the generation of validation code."
+ };
+
+ // Reuse style.
+ //
+ bool --reuse-style-mixin
+ {
+ "Generate code that supports the mixin base parser implementation
+ reuse style. Note that this reuse style relies on virtual
+ inheritance and may result in a substantial object code size
+ increase for large vocabularies. By default support for the tiein
+ style is generated."
+ };
+
+ bool --reuse-style-none
+ {
+ "Do not generate any support for base parser implementation reuse.
+ By default support for the tiein style is generated."
+ };
+
+ // Polymorphism.
+ //
+ bool --generate-polymorphic
+ {
+ "Generate polymorphism-aware code. Specify this option if you use
+ substitution groups or \cb{xsi:type}."
+ };
+
+ bool --runtime-polymorphic
+ {
+ "Generate non-polymorphic code that uses the runtime library
+ configured with polymorphism support."
+ };
+
+ // Implementation/driver.
+ //
+ bool --generate-noop-impl
+ {
+ "Generate a sample parser implementation that does nothing (no
+ operation). The sample implementation can then be filled with
+ the application-specific code. For an input file in the form
+ \cb{name.xsd} this option triggers the generation of the two
+ additional C++ files in the form: \cb{name-pimpl.hxx} (parser
+ implementation header file) and \cb{name-pimpl.cxx} (parser
+ implementation source file)."
+ };
+
+ bool --generate-print-impl
+ {
+ "Generate a sample parser implementation that prints the XML data
+ to \c{STDOUT}. For an input file in the form \cb{name.xsd} this
+ option triggers the generation of the two additional C++ files
+ in the form: \cb{name-pimpl.hxx} (parser implementation header
+ file) and \cb{name-pimpl.cxx} (parser implementation source file)."
+ };
+
+ bool --generate-test-driver
+ {
+ "Generate a test driver for the sample parser implementation. For
+ an input file in the form \cb{name.xsd} this option triggers the
+ generation of an additional C++ file in the form
+ \cb{name-pdriver.cxx}."
+ };
+
+ bool --force-overwrite
+ {
+ "Force overwriting of the existing implementation and test driver
+ files. Use this option only if you do not mind loosing the changes
+ you have made in the sample implementation or test driver files."
+ };
+
+ // Root element.
+ //
+ bool --root-element-first
+ {
+ "Indicate that the first global element is the document root. This
+ information is used to generate the test driver for the sample
+ implementation."
+ };
+
+ bool --root-element-last
+ {
+ "Indicate that the last global element is the document root. This
+ information is used to generate the test driver for the sample
+ implementation."
+ };
+
+ Cult::Types::NarrowString --root-element
+ {
+ "<element>",
+ "Indicate that <element> is the document root. This information is
+ used to generate the test driver for the sample implementation."
+ };
+
+ // Suffixes.
+ //
+ Cult::Types::NarrowString --skel-type-suffix = "_pskel"
+ {
+ "<suffix>",
+ "Use the provided <suffix> instead of the default \cb{_pskel} to
+ construct the names of generated parser skeletons."
+ };
+
+ Cult::Types::NarrowString --skel-file-suffix = "-pskel"
+ {
+ "<suffix>",
+ "Use the provided <suffix> instead of the default \cb{-pskel} to
+ construct the names of generated parser skeleton files."
+ };
+
+ Cult::Types::NarrowString --impl-type-suffix = "_pimpl"
+ {
+ "<suffix>",
+ "Use the provided <suffix> instead of the default \cb{_pimpl} to
+ construct the names of parser implementations for the built-in
+ XML Schema types and sample parser implementations."
+ };
+
+ Cult::Types::NarrowString --impl-file-suffix = "-pimpl"
+ {
+ "<suffix>",
+ "Use the provided <suffix> instead of the default \cb{-pimpl} to
+ construct the names of generated sample parser implementation
+ files."
+ };
+ };
+ }
+}
diff --git a/xsde/cxx/serializer/generator.cxx b/xsde/cxx/serializer/generator.cxx
index 167dae5..98e1cae 100644
--- a/xsde/cxx/serializer/generator.cxx
+++ b/xsde/cxx/serializer/generator.cxx
@@ -16,8 +16,6 @@
#include <cutl/compiler/cxx-indenter.hxx>
#include <cutl/compiler/sloc-counter.hxx>
-#include <backend-elements/indentation/clip.hxx>
-
#include <xsd-frontend/semantic-graph.hxx>
#include <type-map/lexer.hxx>
@@ -42,7 +40,7 @@
#include <cxx/serializer/element-validation-source.hxx>
#include <cxx/serializer/attribute-validation-source.hxx>
-#include <usage.hxx>
+#include <cxx/serializer/options.hxx>
#include "../../../libxsde/xsde/cxx/version.hxx"
@@ -181,342 +179,8 @@ namespace CXX
Void Serializer::Generator::
usage ()
{
- std::wostream& o (wcout);
- ::CLI::Indent::Clip< ::CLI::OptionsUsage, WideChar> clip (o);
-
- o << "--type-map <mapfile>" << endl
- << " Read XML Schema to C++ type mapping information\n"
- << " from <mapfile>. Repeat this option to specify\n"
- << " several type maps. Type maps are considered in\n"
- << " order of appearance and the first match is used."
- << endl;
-
- o << "--char-encoding <enc>" << endl
- << " Specify the character encoding that is used in\n"
- << " the text data being serialized. Valid values are\n"
- << " 'utf8' (default) and 'iso8859-1'."
- << endl;
-
- o << "--no-stl" << endl
- << " Generate code that does not use STL."
- << endl;
-
- o << "--no-iostream" << endl
- << " Generate code that does not use the iostream\n"
- << " library."
- << endl;
-
- o << "--no-exceptions" << endl
- << " Generate code that does not use C++ exceptions."
- << endl;
-
- o << "--no-long-long" << endl
- << " Generate code that does not use the long long\n"
- << " and unsigned long long types."
- << endl;
-
- o << "--reuse-style-mixin" << endl
- << " Generate code that supports the mixin base\n"
- << " serializer implementation reuse style."
- << endl;
-
- o << "--reuse-style-none" << endl
- << " Do not generate any support for base serializer\n"
- << " implementation reuse."
- << endl;
-
- o << "--generate-inline" << endl
- << " Generate certain functions inline."
- << endl;
-
- o << "--suppress-validation" << endl
- << " Suppress the generation of validation code."
- << endl;
-
- o << "--generate-polymorphic" << endl
- << " Generate polymorphism-aware code. Specify this\n"
- << " option if you use substitution groups or xsi:type."
- << endl;
-
- o << "--runtime-polymorphic" << endl
- << " Generate non-polymorphic code that uses the\n"
- << " runtime library configured with polymorphism\n"
- << " support."
- << endl;
-
- o << "--suppress-reset" << endl
- << " Suppress the generation of serializer reset code."
- << endl;
-
- o << "--custom-allocator" << endl
- << " Generate code that uses custom allocator functions\n"
- << " instead of operator new/delete."
- << endl;
-
- o << "--generate-empty-impl" << endl
- << " Generate a sample serializer implementation with\n"
- << " empty function bodies."
- << endl;
-
- o << "--generate-test-driver" << endl
- << " Generate a test driver for the sample serializer\n"
- << " implementation."
- << endl;
-
- o << "--force-overwrite" << endl
- << " Force overwriting of the existing implementation\n"
- << " and test driver files."
- << endl;
-
- o << "--root-element-first" << endl
- << " Indicate that the first global element is the\n"
- << " document root."
- << endl;
-
- o << "--root-element-last" << endl
- << " Indicate that the last global element is the\n"
- << " document root."
- << endl;
-
- o << "--root-element <element>" << endl
- << " Indicate that <element> is the document root."
- << endl;
-
- o << "--generate-xml-schema" << endl
- << " Generate a C++ header file as if the schema being\n"
- << " compiled defines the XML Schema namespace."
- << endl;
-
- o << "--extern-xml-schema <file>" << endl
- << " Generate code as if the XML Schema namespace was\n"
- << " defined in <file> and xsd:included in the schema\n"
- << " being compiled."
- << endl;
-
- o << "--output-dir <dir>" << endl
- << " Write generated files to <dir> instead of the\n"
- << " current directory."
- << endl;
-
- o << "--skel-type-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '_sskel' to\n"
- << " construct the names of generated serializer\n"
- << " skeletons."
- << endl;
-
- o << "--skel-file-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '-sskel' to\n"
- << " construct the names of generated serializer\n"
- << " skeleton files."
- << endl;
-
- o << "--impl-type-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '_simpl' to\n"
- << " construct the names of serializer implementations\n"
- << " for the built-in XML Schema types and sample\n"
- << " serializer implementations."
- << endl;
-
- o << "--impl-file-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '-simpl' to\n"
- << " construct the names of generated sample\n"
- << " serializer implementation files."
- << endl;
-
- o << "--namespace-map <xns>=<cns>" << endl
- << " Map XML Schema namespace <xns> to C++ namespace\n"
- << " <cns>. Repeat this option to specify mapping for\n"
- << " more than one XML Schema namespace."
- << endl;
-
- o << "--namespace-regex <regex>" << endl
- << " Add <regex> to the list of regular expressions\n"
- << " used to translate XML Schema namespace names to\n"
- << " C++ namespace names."
- << endl;
-
- o << "--namespace-regex-trace" << endl
- << " Trace the process of applying regular expressions\n"
- << " specified with the --namespace-regex option."
- << endl;
-
- o << "--reserved-name <name>" << endl
- << " Add <name> to the list of names that should not\n"
- << " be used as identifiers. The name can optionally\n"
- << " be followed by '=' and the replacement name that\n"
- << " should be used instead."
- << endl;
-
- o << "--include-with-brackets" << endl
- << " Use angle brackets (<>) instead of quotes (\"\") in\n"
- << " generated #include directives."
- << endl;
-
- o << "--include-prefix <prefix>" << endl
- << " Add <prefix> to generated #include directive\n"
- << " paths."
- << endl;
-
- o << "--include-regex <regex>" << endl
- << " Add <regex> to the list of regular expressions\n"
- << " used to transform #include directive paths."
- << endl;
-
- o << "--include-regex-trace" << endl
- << " Trace the process of applying regular expressions\n"
- << " specified with the --include-regex option."
- << endl;
-
- o << "--guard-prefix <prefix>" << endl
- << " Add <prefix> to generated header inclusion guards."
- << endl;
-
- o << "--hxx-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '.hxx' to\n"
- << " construct the name of the header file."
- << endl;
-
- o << "--ixx-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '.ixx' to\n"
- << " construct the name of the inline file."
- << endl;
-
- o << "--cxx-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '.cxx' to\n"
- << " construct the name of the source file."
- << endl;
-
- o << "--hxx-regex <regex>" << endl
- << " Use <regex> to construct the name of the header\n"
- << " file."
- << endl;
-
- o << "--ixx-regex <regex>" << endl
- << " Use <regex> to construct the name of the inline\n"
- << " file."
- << endl;
-
- o << "--cxx-regex <regex>" << endl
- << " Use <regex> to construct the name of the source\n"
- << " file."
- << endl;
-
-
- // Prologues.
- //
- o << "--hxx-prologue <text>" << endl
- << " Insert <text> at the beginning of the header file."
- << endl;
-
- o << "--ixx-prologue <text>" << endl
- << " Insert <text> at the beginning of the inline file."
- << endl;
-
- o << "--cxx-prologue <text>" << endl
- << " Insert <text> at the beginning of the source file."
- << endl;
-
- o << "--prologue <text>" << endl
- << " Insert <text> at the beginning of each generated\n"
- << " file for which there is no file-specific prologue."
- << endl;
-
-
- // Epilogues.
- //
- o << "--hxx-epilogue <text>" << endl
- << " Insert <text> at the end of the header file."
- << endl;
-
- o << "--ixx-epilogue <text>" << endl
- << " Insert <text> at the end of the inline file."
- << endl;
-
- o << "--cxx-epilogue <text>" << endl
- << " Insert <text> at the end of the source file."
- << endl;
-
- o << "--epilogue <text>" << endl
- << " Insert <text> at the end of each generated file\n"
- << " for which there is no file-specific epilogue."
- << endl;
-
-
- // Prologue files.
- //
- o << "--hxx-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the header file."
- << endl;
-
- o << "--ixx-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the inline file."
- << endl;
-
- o << "--cxx-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the source file."
- << endl;
-
- o << "--prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of each generated file for which there is no file-\n"
- << " specific prologue file."
- << endl;
-
-
- // Epilogue files.
- //
- o << "--hxx-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the header file."
- << endl;
-
- o << "--ixx-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the inline file."
- << endl;
-
- o << "--cxx-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the source file."
- << endl;
-
- o << "--epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " each generated file for which there is no file-\n"
- << " specific epilogue file."
- << endl;
-
-
- // Misc.
- //
- o << "--show-anonymous" << endl
- << " Show elements and attributes that are of anonymous\n"
- << " types."
- << endl;
-
- o << "--show-sloc" << endl
- << " Show the number of generated physical source lines\n"
- << " of code (SLOC)."
- << endl;
-
- o << "--sloc-limit <num>" << endl
- << " Check that the number of generated physical source\n"
- << " lines of code (SLOC) does not exceed <num>."
- << endl;
-
- o << "--options-file <file>" << endl
- << " Read additional options from <file>. Each option\n"
- << " should appear on a separate line optionally\n"
- << " followed by space and an argument."
- << endl;
-
- o << "--proprietary-license" << endl
- << " Indicate that the generated code is licensed under\n"
- << " a proprietary license instead of the GPL."
- << endl;
+ CXX::Serializer::options::print_usage (wcout);
+ CXX::options::print_usage (wcout);
}
Serializer::CLI::OptionsSpec Serializer::Generator::
@@ -624,7 +288,6 @@ namespace CXX
AutoUnlinks& unlinks)
{
using std::ios_base;
- namespace Indentation = BackendElements::Indentation;
typedef cutl::re::regexsub Regex;
diff --git a/xsde/cxx/serializer/options.cli b/xsde/cxx/serializer/options.cli
new file mode 100644
index 0000000..ddb6c60
--- /dev/null
+++ b/xsde/cxx/serializer/options.cli
@@ -0,0 +1,148 @@
+// file : xsde/cxx/serializer/options.cli
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+include <vector>;
+include <string>;
+include <cstddef>; // std::size_t
+
+include <cult/types.hxx>; // NarrowString
+
+include <cxx/options.cli>;
+
+namespace CXX
+{
+ namespace Serializer
+ {
+ class options: CXX::options
+ {
+ std::vector<Cult::Types::NarrowString> --type-map
+ {
+ "<mapfile>",
+ "Read XML Schema to C++ type mapping information from <mapfile>.
+ Repeat this option to specify several type maps. Type maps are
+ considered in order of appearance and the first match is used.
+ By default all user-defined types are mapped to \cb{void}. See
+ the TYPE MAP section below for more information."
+ };
+
+ bool --suppress-validation
+ {
+ "Suppress the generation of validation code."
+ };
+
+ // Reuse style.
+ //
+ bool --reuse-style-mixin
+ {
+ "Generate code that supports the mixin base serializer implementation
+ reuse style. Note that this reuse style relies on virtual inheritance
+ and may result in a substantial object code size increase for large
+ vocabularies. By default support for the tiein style is generated."
+ };
+
+ bool --reuse-style-none
+ {
+ "Do not generate any support for base serializer implementation
+ reuse. By default support for the tiein style is generated."
+ };
+
+ // Polymorphism.
+ //
+ bool --generate-polymorphic
+ {
+ "Generate polymorphism-aware code. Specify this option if you use
+ substitution groups or \cb{xsi:type}."
+ };
+
+ bool --runtime-polymorphic
+ {
+ "Generate non-polymorphic code that uses the runtime library
+ configured with polymorphism support."
+ };
+
+ // Implementation/driver.
+ //
+ bool --generate-empty-impl
+ {
+ "Generate a sample serializer implementation with empty function
+ bodies which can then be filled with the application-specific code.
+ For an input file in the form \cb{name.xsd} this option triggers
+ the generation of the two additional C++ files in the form:
+ \cb{name-simpl.hxx} (serializer implementation header file) and
+ \cb{name-simpl.cxx} (serializer implementation source file)."
+ };
+
+ bool --generate-test-driver
+ {
+ "Generate a test driver for the sample serializer implementation.
+ For an input file in the form \cb{name.xsd} this option triggers
+ the generation of an additional C++ file in the form
+ \cb{name-sdriver.cxx}."
+ };
+
+ bool --force-overwrite
+ {
+ "Force overwriting of the existing implementation and test driver
+ files. Use this option only if you do not mind loosing the changes
+ you have made in the sample implementation or test driver files."
+ };
+
+ // Root element.
+ //
+ bool --root-element-first
+ {
+ "Indicate that the first global element is the document root. This
+ information is used to generate the test driver for the sample
+ implementation."
+ };
+
+ bool --root-element-last
+ {
+ "Indicate that the last global element is the document root. This
+ information is used to generate the test driver for the sample
+ implementation."
+ };
+
+ Cult::Types::NarrowString --root-element
+ {
+ "<element>",
+ "Indicate that <element> is the document root. This information is
+ used to generate the test driver for the sample implementation."
+ };
+
+ // Suffixes.
+ //
+ Cult::Types::NarrowString --skel-type-suffix = "_sskel"
+ {
+ "<suffix>",
+ "Use the provided <suffix> instead of the default \cb{_sskel} to
+ construct the names of generated serializer skeletons."
+ };
+
+ Cult::Types::NarrowString --skel-file-suffix = "-sskel"
+ {
+ "<suffix>",
+ "Use the provided <suffix> instead of the default \cb{-sskel} to
+ construct the names of generated serializer skeleton files."
+ };
+
+ Cult::Types::NarrowString --impl-type-suffix = "_simpl"
+ {
+ "<suffix>",
+ "Use the provided <suffix> instead of the default \cb{_simpl} to
+ construct the names of serializer implementations for the built-in
+ XML Schema types and sample serializer implementations."
+ };
+
+ Cult::Types::NarrowString --impl-file-suffix = "-simpl"
+ {
+ "<suffix>",
+ "Use the provided <suffix> instead of the default \cb{-simpl} to
+ construct the names of generated sample serializer implementation
+ files."
+ };
+ };
+ }
+}
diff --git a/xsde/makefile b/xsde/makefile
index e4ab12b..9df2438 100644
--- a/xsde/makefile
+++ b/xsde/makefile
@@ -7,12 +7,11 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make
cxx_tun := xsde.cxx
-
-# C++
+# C++.
#
cxx_tun += cxx/elements.cxx
-# C++/Parser
+# C++/Parser.
#
cxx_tun += cxx/parser/elements.cxx \
cxx/parser/validator.cxx \
@@ -31,7 +30,7 @@ cxx_tun += cxx/parser/elements.cxx \
cxx/parser/attribute-validation-source.cxx \
cxx/parser/characters-validation-source.cxx
-# C++/Serializer
+# C++/Serializer.
#
cxx_tun += cxx/serializer/elements.cxx \
cxx/serializer/validator.cxx \
@@ -48,7 +47,7 @@ cxx_tun += cxx/serializer/elements.cxx \
cxx/serializer/element-validation-source.cxx \
cxx/serializer/attribute-validation-source.cxx
-# C++/Hybrid
+# C++/Hybrid.
#
cxx_tun += cxx/hybrid/elements.cxx \
cxx/hybrid/validator.cxx \
@@ -76,19 +75,26 @@ cxx_tun += cxx/hybrid/elements.cxx \
cxx/hybrid/serializer-aggregate-header.cxx \
cxx/hybrid/serializer-aggregate-source.cxx
-# Type map
+# Type map.
#
cxx_tun += type-map/lexer.cxx \
type-map/parser.cxx
-# Processing
+# Processing.
#
cxx_tun += processing/inheritance/processor.cxx
+# Options file.
+#
+cli_tun := options.cli \
+ cxx/options.cli \
+ cxx/hybrid/options.cli \
+ cxx/parser/options.cli \
+ cxx/serializer/options.cli
#
#
-cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o))
+cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(cli_tun:.cli=.o))
cxx_od := $(cxx_obj:.o=.o.d)
xsde := $(out_base)/xsde
@@ -100,6 +106,10 @@ install := $(out_base)/.install
# Import.
#
$(call import,\
+ $(scf_root)/import/cli/stub.make,\
+ cli: cli,cli-rules: cli_rules)
+
+$(call import,\
$(scf_root)/import/libcutl/stub.make,\
l: cutl.l,cpp-options: cutl.l.cpp-options)
@@ -108,10 +118,6 @@ $(call import,\
l: cult.l,cpp-options: cult.l.cpp-options)
$(call import,\
- $(scf_root)/import/libbackend-elements/stub.make,\
- l: be.l,cpp-options: be.l.cpp-options)
-
-$(call import,\
$(scf_root)/import/libboost/filesystem/stub.make,\
l: fs.l,cpp-options: fs.l.cpp-options)
@@ -121,17 +127,52 @@ $(call import,\
# Build.
#
-$(xsde): $(cxx_obj) $(xsd_fe.l) $(be.l) $(cult.l) $(cutl.l) $(fs.l)
+$(xsde): $(cxx_obj) $(xsd_fe.l) $(cult.l) $(cutl.l) $(fs.l)
$(cxx_obj) $(cxx_od): cpp_options := -I$(src_base)
$(cxx_obj) $(cxx_od): \
$(xsd_fe.l.cpp-options) \
- $(be.l.cpp-options) \
$(cult.l.cpp-options) \
$(cutl.l.cpp-options) \
$(fs.l.cpp-options)
-$(call include-dep,$(cxx_od))
+genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx)
+gen := $(addprefix $(out_base)/,$(genf))
+
+$(gen): $(cli)
+$(gen): cli := $(cli)
+$(gen): cli_options += \
+-I $(src_base) \
+--ostream-type ::std::wostream \
+--exclude-base \
+--suppress-undocumented \
+--generate-file-scanner \
+--include-with-brackets \
+--option-length 28
+
+#--include-prefix xsde
+#--guard-prefix XSDE
+
+$(addprefix $(out_base)/cxx/options,.hxx .ixx .cxx): $(src_base)/options.cli
+$(addprefix $(out_base)/cxx/options,.hxx .ixx .cxx): cli_options += \
+--include-prefix cxx --guard-prefix CXX
+
+$(addprefix $(out_base)/cxx/hybrid/options,.hxx .ixx .cxx): \
+$(src_base)/options.cli $(src_base)/cxx/options.cli
+$(addprefix $(out_base)/cxx/hybrid/options,.hxx .ixx .cxx): cli_options += \
+--include-prefix cxx/hybrid --guard-prefix CXX_HYBRID
+
+$(addprefix $(out_base)/cxx/parser/options,.hxx .ixx .cxx): \
+$(src_base)/options.cli $(src_base)/cxx/options.cli
+$(addprefix $(out_base)/cxx/parser/options,.hxx .ixx .cxx): cli_options += \
+--include-prefix cxx/parser --guard-prefix CXX_PARSER
+
+$(addprefix $(out_base)/cxx/serializer/options,.hxx .ixx .cxx): \
+$(src_base)/options.cli $(src_base)/cxx/options.cli
+$(addprefix $(out_base)/cxx/serializer/options,.hxx .ixx .cxx): cli_options += \
+--include-prefix cxx/serializer --guard-prefix CXX_SERIALIZER
+
+$(call include-dep,$(cxx_od),$(cxx_obj),$(gen))
# Alias for default target.
#
@@ -155,7 +196,8 @@ $(install): $(xsde)
$(clean): \
$(xsde).o.clean \
$(addsuffix .cxx.clean,$(cxx_obj)) \
- $(addsuffix .cxx.clean,$(cxx_od))
+ $(addsuffix .cxx.clean,$(cxx_od)) \
+ $(addprefix $(out_base)/,$(cli_tun:.cli=.cxx.cli.clean))
# Generated .gitignore.
@@ -163,15 +205,15 @@ $(clean): \
ifeq ($(out_base),$(src_base))
$(xsde): | $(out_base)/.gitignore
-$(out_base)/.gitignore: files := xsde
+$(out_base)/.gitignore: files := xsde $(genf)
$(clean): $(out_base)/.gitignore.clean
$(call include,$(bld_root)/git/gitignore.make)
endif
-
-# how to
+# How to.
#
+$(call include,$(cli_rules))
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
diff --git a/xsde/options.cli b/xsde/options.cli
new file mode 100644
index 0000000..976ddee
--- /dev/null
+++ b/xsde/options.cli
@@ -0,0 +1,302 @@
+// file : xsde/options.cli
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+include <vector>;
+include <string>;
+include <cstddef>; // std::size_t
+
+include <cult/types.hxx>; // NarrowString
+
+class help_options
+{
+ // These are all documented elsewhere.
+ //
+ bool --help;
+ bool --version;
+ bool --proprietary-license;
+};
+
+class options = 0
+{
+ std::vector<Cult::Types::NarrowString> --disable-warning
+ {
+ "<warn>",
+ "Disable printing warning with id <warn>. If \cb{all} is specified for
+ the warning id then all warnings are disabled."
+ };
+
+ // The following option is "fake" in that it is actually handled by
+ // argv_file_scanner. We have it here to get the documentation.
+ //
+ std::string --options-file
+ {
+ "<file>",
+ "Read additional options from <file>. Each option should appearing on a
+ separate line optionally followed by space and an option value. Empty
+ lines and lines starting with \cb{#} are ignored. Option values can
+ be enclosed in double (\cb{\"}) or single (\cb{'}) quotes to preserve
+ leading and trailing whitespaces as well as to specify empty values.
+ If the value itself contains trailing or leading quotes, enclose it
+ with an extra pair of quotes, for example \cb{'\"x\"'}. Non-leading
+ and non-trailing quotes are interpreted as being part of the option
+ value.
+
+ The semantics of providing options in a file is equivalent to providing
+ the same set of options in the same order on the command line at the
+ point where the \cb{--options-file} option is specified except that
+ the shell escaping and quoting is not required. You can repeat this
+ option to specify more than one options file."
+ };
+
+ // SLOC/license options.
+ //
+ bool --show-sloc
+ {
+ "Show the number of generated physical source lines of code (SLOC)."
+ };
+
+ std::size_t --sloc-limit
+ {
+ "<num>",
+ "Check that the number of generated physical source lines of code (SLOC)
+ does not exceed <num>."
+ };
+
+ bool --proprietary-license
+ {
+ "Indicate that the generated code is licensed under a proprietary
+ license instead of the GPL."
+ };
+
+ // Anonymous type morphing.
+ //
+ bool --preserve-anonymous
+ {
+ "Preserve anonymous types. By default anonymous types are automatically
+ named with names derived from the enclosing elements/attributes. Because
+ mappings implemented by this compiler require all types to be named,
+ this option is only useful if you want to make sure your schemas don't
+ have anonymous types."
+ };
+
+ bool --show-anonymous
+ {
+ "Show elements and attributes that are of anonymous types. This option
+ only makes sense together with the \cb{--preserve-anonymous} option."
+ };
+
+ std::vector<Cult::Types::NarrowString> --anonymous-regex
+ {
+ "<regex>",
+ "Add <regex> to the list of regular expressions used to derive names for
+ anonymous types from the enclosing attributes/elements. <regex> is a
+ Perl-like regular expression in the form
+ \c{\b{/}\i{pattern}\b{/}\i{replacement}\b{/}}.
+ Any character can be used as a delimiter instead of \cb{/}. Escaping of
+ the delimiter character in \ci{pattern} or \ci{replacement} is not
+ supported.
+
+ All the regular expressions are pushed into a stack with the last
+ specified expression considered first. The first match that succeeds is
+ used. Regular expressions are applied to a string in the form
+
+ \c{\i{filename} \i{namespace} \i{xpath}}
+
+ For instance:
+
+ \cb{hello.xsd http://example.com/hello element}
+
+ \cb{hello.xsd http://example.com/hello type/element}
+
+ As an example, the following expression makes all the derived names
+ start with capital letters. This could be useful when your naming
+ convention requires type names to start with capital letters:
+
+ \cb{%.* .* (.+/)*(.+)%\\u$2%}
+
+ See also the REGEX AND SHELL QUOTING section below."
+ };
+
+ bool --anonymous-regex-trace
+ {
+ "Trace the process of applying regular expressions specified with the
+ \cb{--anonymous-regex} option. Use this option to find out why your
+ regular expressions don't do what you expected them to do."
+ };
+
+ bool --morph-anonymous; // Deprecated and therefore undocumented.
+
+ // Location options.
+ //
+ std::vector<Cult::Types::NarrowString> --location-map
+ {
+ "<ol>=<nl>",
+ "Map the original schema location <ol> that is specified in the XML
+ Schema include or import elements to new schema location <nl>. Repeat
+ this option to map more than one schema location. For example, the
+ following option maps the \cb{http://example.com/foo.xsd} URL to the
+ \cb{foo.xsd} local file.
+
+ \cb{--location-map http://example.com/foo.xsd=foo.xsd}"
+ };
+
+ std::vector<Cult::Types::NarrowString> --location-regex
+ {
+ "<regex>",
+ "Add <regex> to the list of regular expressions used to map schema
+ locations that are specified in the XML Schema include or import
+ elements. <regex> is a Perl-like regular expression in the form
+ \c{\b{/}\i{pattern}\b{/}\i{replacement}\b{/}}. Any character can
+ be used as a delimiter instead of \cb{/}. Escaping of the delimiter
+ character in \ci{pattern} or \ci{replacement} is not supported. All
+ the regular expressions are pushed into a stack with the last specified
+ expression considered first. The first match that succeeds is used.
+
+ For example, the following expression maps URL locations in the form
+ \cb{http://example.com/foo/bar.xsd} to local files in the form
+ \cb{bar.xsd}:
+
+ \cb{%http://.+/(.+)%$1%}
+
+ See also the REGEX AND SHELL QUOTING section below."
+ };
+
+ bool --location-regex-trace
+ {
+ "Trace the process of applying regular expressions specified with the
+ \cb{--location-regex} option. Use this option to find out why your
+ regular expressions don't do what you expected them to do."
+ };
+
+ // File-per-type option.
+ //
+ bool --file-per-type
+ {
+ "Generate a separate set of C++ files for each type defined in XML
+ Schema. Note that in this mode you only need to compile the root
+ schema(s) and the code will be generated for all included and
+ imported schemas. This compilation mode is primarily useful when
+ some of your schemas cannot be compiled separately or have cyclic
+ dependencies which involve type inheritance. Other options related
+ to this mode are: \cb{--type-file-regex}, \cb{--schema-file-regex},
+ \cb{--fat-type-file}, and \cb{--file-list}."
+ };
+
+ std::vector<Cult::Types::NarrowString> --type-file-regex
+ {
+ "<regex>",
+ "Add <regex> to the list of regular expressions used to translate type
+ names to file names when the \cb{--file-per-type} option is specified.
+ <regex> is a Perl-like regular expression in the form
+ \c{\b{/}\i{pattern}\b{/}\i{replacement}\b{/}}. Any character can be
+ used as a delimiter instead of \cb{/}. Escaping of the delimiter
+ character in \ci{pattern} or \ci{replacement} is not supported. All
+ the regular expressions are pushed into a stack with the last specified
+ expression considered first. The first match that succeeds is used.
+ Regular expressions are applied to a string in the form
+
+ \c{\i{namespace} \i{type-name}}
+
+ For example, the following expression maps type \cb{foo} that is
+ defined in the \cb{http://example.com/bar} namespace to file name
+ \cb{bar-foo}:
+
+ \cb{%http://example.com/(.+) (.+)%$1-$2%}
+
+ See also the REGEX AND SHELL QUOTING section below."
+ };
+
+ bool --type-file-regex-trace
+ {
+ "Trace the process of applying regular expressions specified with the
+ \cb{--type-file-regex} option. Use this option to find out why your
+ regular expressions don't do what you expected them to do."
+ };
+ std::vector<Cult::Types::NarrowString> --schema-file-regex
+ {
+ "<regex>",
+ "Add <regex> to the list of regular expressions used to translate schema
+ file names when the \cb{--file-per-type} option is specified. <regex> is
+ a Perl-like regular expression in the form
+ \c{\b{/}\i{pattern}\b{/}\i{replacement}\b{/}}. Any character can be used
+ as a delimiter instead of \cb{/}. Escaping of the delimiter character in
+ \ci{pattern} or \ci{replacement} is not supported. All the regular
+ expressions are pushed into a stack with the last specified expression
+ considered first. The first match that succeeds is used. Regular
+ Expressions are applied to the absolute filesystem path of a schema file
+ and the result, including the directory part, if any, is used to derive
+ the \cb{#include} directive paths as well as the generated C++ file
+ paths. This option, along with \cb{--type-file-regex} are primarily
+ useful to place the generated files into subdirectories or to resolve
+ file name conflicts.
+
+ For example, the following expression maps schema files in the
+ \cb{foo/1.0.0/} subdirectory to the files in the \cb{foo/} subdirectory.
+ As a result, the \cb{#include} directive paths for such schemas will be
+ in the \cb{foo/schema.hxx} form and the generated C++ files will be
+ placed into the \cb{foo/} subdirectory:
+
+ \cb{%.*/foo/1.0.0/(.+)%foo/$1%}
+
+ See also the REGEX AND SHELL QUOTING section below."
+ };
+
+ bool --schema-file-regex-trace
+ {
+ "Trace the process of applying regular expressions specified with the
+ \cb{--schema-file-regex} option. Use this option to find out why your
+ regular expressions don't do what you expected them to do."
+ };
+
+ bool --fat-type-file
+ {
+ "Generate code corresponding to global elements into type files instead
+ of schema files when the \cb{--type-file-regex} option is specified.
+ This option is primarily useful when trying to minimize the amount of
+ object code that is linked to an executable by packaging compiled
+ generated code into a static (archive) library."
+ };
+
+ // File list options.
+ //
+ Cult::Types::NarrowString --file-list
+ {
+ "<file>",
+ "Write a list of generated C++ files to <file>. This option is primarily
+ useful in the file-per-type compilation mode (\cb{--file-per-type}) to
+ create a list of generated C++ files, for example, as a makefile
+ fragment."
+ };
+
+ Cult::Types::NarrowString --file-list-prologue
+ {
+ "<text>",
+ "Insert <text> at the beginning of the file list. As a convenience, all
+ occurrences of the \cb{\\n} character sequence in <text> are replaced
+ with new lines. This option can, for example, be used to assign the
+ generated file list to a makefile variable."
+ };
+
+ Cult::Types::NarrowString --file-list-epilogue
+ {
+ "<text>",
+ "Insert <text> at the end of the file list. As a convenience, all
+ occurrences of the \cb{\\n} character sequence in <text> are replaced
+ with new lines."
+ };
+
+ Cult::Types::NarrowString --file-list-delim = "\n"
+ {
+ "<text>",
+ "Delimit file names written to the file list with <text> instead of new
+ lines. As a convenience, all occurrences of the \cb{\\n} character
+ sequence in <text> are replaced with new lines."
+ };
+
+ // Undocumented.
+ //
+ bool --disable-multi-import;
+ bool --disable-full-check;
+};
diff --git a/xsde/xsde.cxx b/xsde/xsde.cxx
index a14eb94..eb3f9f3 100644
--- a/xsde/xsde.cxx
+++ b/xsde/xsde.cxx
@@ -31,11 +31,10 @@
#include <xsd-frontend/transformations/schema-per-type.hxx>
#include <xsd-frontend/transformations/simplifier.hxx>
-#include <xsde.hxx>
-#include <usage.hxx>
#include <type-map/type-map.hxx>
-#include <backend-elements/indentation/clip.hxx>
+#include <xsde.hxx>
+#include <options.hxx>
#include <cxx/parser/generator.hxx>
#include <cxx/serializer/generator.hxx>
@@ -311,117 +310,9 @@ main (Int argc, Char* argv[])
return 1;
}
- ::CLI::Indent::Clip< ::CLI::OptionsUsage, WideChar> clip (o);
-
- // Disable warning option.
- //
- o << "--disable-warning <warn>" << endl
- << " Disable printing warning with id <warn>. If 'all'\n"
- << " is specified for the warning id then all warnings\n"
- << " are disabled."
- << endl;
-
- // Anonymous morphing options.
- //
- o << "--preserve-anonymous" << endl
- << " Preserve anonymous types. By default anonymous\n"
- << " types are automatically named with names derived\n"
- << " from the enclosing elements/attributes."
- << endl;
-
- o << "--anonymous-regex <regex>" << endl
- << " Add the provided regular expression to the list of\n"
- << " regular expressions used to derive names for\n"
- << " anonymous types from the names of the enclosing\n"
- << " attributes/elements."
- << endl;
-
- o << "--anonymous-regex-trace" << endl
- << " Trace the process of applying regular expressions\n"
- << " specified with the --anonymous-regex option."
- << endl;
-
- // Location mapping options.
- //
- o << "--location-map <ol>=<nl>" << endl
- << " Map the original schema location <ol> that is\n"
- << " specified in the XML Schema include or import\n"
- << " elements to new schema location <nl>. Repeat\n"
- << " this option to map more than one schema location."
- << endl;
-
- o << "--location-regex <regex>" << endl
- << " Add <regex> to the list of regular expressions\n"
- << " used to map schema locations that are specified\n"
- << " in the XML Schema include or import elements."
- << endl;
-
- o << "--location-regex-trace" << endl
- << " Trace the process of applying regular expressions\n"
- << " specified with the --location-regex option."
- << endl;
-
- // File-per-type compilation mode options.
+ // Add frontend options at the end.
//
- o << "--file-per-type" << endl
- << " Generate a separate set of C++ files for each\n"
- << " type defined in XML Schema."
- << endl;
-
- o << "--type-file-regex <regex>" << endl
- << " Add the provided regular expression to the list of\n"
- << " regular expressions used to translate type names\n"
- << " to file names when the --file-per-type option is\n"
- << " specified."
- << endl;
-
- o << "--type-file-regex-trace" << endl
- << " Trace the process of applying regular expressions\n"
- << " specified with the --type-file-regex option."
- << endl;
-
- o << "--schema-file-regex <regex>" << endl
- << " Add the provided regular expression to the list\n"
- << " of regular expressions used to translate schema\n"
- << " file names when the --file-per-type option is\n"
- << " specified."
- << endl;
-
- o << "--schema-file-regex-trace" << endl
- << " Trace the process of applying regular expressions\n"
- << " specified with the --schema-file-regex option."
- << endl;
-
- o << "--fat-type-file" << endl
- << " Generate code corresponding to global elements\n"
- << " into type files instead of schema files when the\n"
- << " --file-per-type option is specified."
- << endl;
-
- // File list options.
- //
- o << "--file-list <file>" << endl
- << " Write a list of generated C++ files to <file>."
- << endl;
-
- o << "--file-list-prologue <p>" << endl
- << " Insert <p> at the beginning of the file list. All\n"
- << " occurrences of the \\n character sequence in <p>\n"
- << " are replaced with new lines."
- << endl;
-
- o << "--file-list-prologue <e>" << endl
- << " Insert <e> at the end of the file list. All\n"
- << " occurrences of the \\n character sequence in <e>\n"
- << " are replaced with new lines."
- << endl;
-
- o << "--file-list-delim <d>" << endl
- << " Delimit file names written to the file list with\n"
- << " <d> instead of new lines. All occurrences of the\n"
- << " \\n character sequence in <d> are replaced with\n"
- << " new lines."
- << endl;
+ options::print_usage (o);
}
else
{