diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-04-15 13:47:31 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-04-15 13:47:31 +0200 |
commit | 4c174428379af308926ec70bc5b58539a1863abf (patch) | |
tree | 0f2aeaa68b28e0c86925fd4ae0e2d893d020efdc /tests/dump/driver.cxx | |
parent | 8b5538ed49925aaf9fa22e961bd632bed8458184 (diff) |
Implement enum synthesis from union
A union which has enumerations with a common base as members can
be transformed to an equivalent enumeration.
Diffstat (limited to 'tests/dump/driver.cxx')
-rw-r--r-- | tests/dump/driver.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/dump/driver.cxx b/tests/dump/driver.cxx index 973a30a..2e55e97 100644 --- a/tests/dump/driver.cxx +++ b/tests/dump/driver.cxx @@ -7,6 +7,7 @@ #include <xsd-frontend/parser.hxx> #include <xsd-frontend/transformations/anonymous.hxx> +#include <xsd-frontend/transformations/enum-synthesis.hxx> #include <xsd-frontend/semantic-graph.hxx> #include <xsd-frontend/traversal.hxx> @@ -571,11 +572,14 @@ main (Int argc, Char* argv[]) // Int i (1); Boolean anon (false); + Boolean enum_synth (false); for (; i < argc; ++i) { if (argv[i] == NarrowString ("--anonymous")) anon = true; + else if (argv[i] == NarrowString ("--enum-synthesis")) + enum_synth = true; else break; } @@ -607,6 +611,14 @@ main (Int argc, Char* argv[]) // // + if (enum_synth) + { + Transformations::EnumSynthesis transf; + transf.transform (*tu, path); + } + + // + // Schema schema; Uses uses; |