summaryrefslogtreecommitdiff
path: root/xsd/xsd/cxx/parser/elements.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/xsd/cxx/parser/elements.hxx')
-rw-r--r--xsd/xsd/cxx/parser/elements.hxx74
1 files changed, 38 insertions, 36 deletions
diff --git a/xsd/xsd/cxx/parser/elements.hxx b/xsd/xsd/cxx/parser/elements.hxx
index ee5ca86..31f5d87 100644
--- a/xsd/xsd/cxx/parser/elements.hxx
+++ b/xsd/xsd/cxx/parser/elements.hxx
@@ -1,6 +1,5 @@
// file : xsd/cxx/parser/elements.hxx
-// author : Boris Kolpackov <boris@codesynthesis.com>
-// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC
+// copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
#ifndef CXX_PARSER_ELEMENTS_HXX
@@ -8,11 +7,13 @@
#include <sstream>
-#include <backend-elements/regex.hxx>
+#include <cutl/re.hxx>
+
+#include <types.hxx>
#include <cxx/elements.hxx>
-#include <cxx/parser/cli.hxx>
+#include <cxx/parser/options.hxx>
namespace CXX
{
@@ -33,13 +34,15 @@ namespace CXX
class Context: public CXX::Context
{
public:
- typedef BackendElements::Regex::Expression<Char> Regex;
+ typedef cutl::re::regexsub Regex;
+
+ typedef Parser::options options_type;
public:
Context (std::wostream&,
SemanticGraph::Schema&,
SemanticGraph::Path const& path,
- CLI::Options const&,
+ options_type const&,
StringLiteralMap const*,
Regex const* hxx_expr,
Regex const* ixx_expr,
@@ -50,7 +53,7 @@ namespace CXX
Context (Context& c, std::wostream& o);
public:
- Boolean
+ bool
restriction_p (SemanticGraph::Complex& c) const
{
if (c.inherits_p () &&
@@ -69,7 +72,7 @@ namespace CXX
content (SemanticGraph::Complex&);
public:
- static Boolean
+ static bool
anonymous (SemanticGraph::Type&);
public:
@@ -90,9 +93,6 @@ namespace CXX
emember (SemanticGraph::Member&);
static String const&
- emember_cache (SemanticGraph::Member&);
-
- static String const&
emember_map (SemanticGraph::Member&);
public:
@@ -100,7 +100,7 @@ namespace CXX
eimpl (SemanticGraph::Type&);
public:
- CLI::Options const& options;
+ options_type const& options;
String& xml_parser;
String& simple_base;
String& complex_base;
@@ -109,8 +109,8 @@ namespace CXX
String& cerr_inst;
String& parser_map;
String& std_string_type;
- Boolean& validation;
- Boolean& polymorphic;
+ bool& validation;
+ bool& polymorphic;
Regex const* hxx_expr;
Regex const* ixx_expr;
@@ -125,20 +125,20 @@ namespace CXX
String cerr_inst_;
String parser_map_;
String std_string_type_;
- Boolean validation_;
- Boolean polymorphic_;
+ bool validation_;
+ bool polymorphic_;
};
//
//
struct RequiredAttributeTest: Traversal::Attribute
{
- RequiredAttributeTest (Boolean& result)
+ RequiredAttributeTest (bool& result)
: result_ (result)
{
}
- virtual Void
+ virtual void
traverse (Type& a)
{
if (!result_ && !a.optional_p ())
@@ -146,7 +146,7 @@ namespace CXX
}
private:
- Boolean& result_;
+ bool& result_;
};
//
@@ -156,14 +156,14 @@ namespace CXX
Traversal::Member,
Context
{
- ParserParamDecl (Context& c, Boolean name_arg)
+ ParserParamDecl (Context& c, bool name_arg)
: Context (c), first_ (true), name_arg_ (name_arg)
{
inherits_ >> *this;
names_ >> *this;
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Complex& c)
{
inherits (c, inherits_);
@@ -172,7 +172,7 @@ namespace CXX
names (c, names_);
}
- virtual Void
+ virtual void
traverse (SemanticGraph::List& l)
{
if (!first_)
@@ -188,7 +188,7 @@ namespace CXX
os << " /* " << comment (l.name ()) << " item */";
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Member& m)
{
if (skip (m)) return;
@@ -210,8 +210,8 @@ namespace CXX
Traversal::Inherits inherits_;
Traversal::Names names_;
- Boolean first_;
- Boolean name_arg_;
+ bool first_;
+ bool name_arg_;
};
@@ -219,16 +219,16 @@ namespace CXX
//
struct TypeForward: Traversal::Type, Context
{
- TypeForward (Context& c, Char const* name_key)
+ TypeForward (Context& c, char const* name_key)
: Context (c), name_key_ (name_key)
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Type& t);
private:
- Char const* name_key_;
+ char const* name_key_;
};
struct Includes: Traversal::Imports,
@@ -250,20 +250,20 @@ namespace CXX
schema_ >> schema_names_ >> namespace_ >> names_ >> type_forward_;
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Imports& i)
{
traverse_ (i);
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Includes& i)
{
traverse_ (i);
}
private:
- Void
+ void
traverse_ (SemanticGraph::Uses&);
private:
@@ -281,21 +281,23 @@ namespace CXX
//
struct RootElement: Traversal::Element
{
- RootElement (CLI::Options const& options,
+ typedef Parser::options options_type;
+
+ RootElement (options_type const& options,
SemanticGraph::Element*& element)
: options_ (options), element_ (element)
{
}
- virtual Void
+ virtual void
traverse (Type& e)
{
- if (options_.value<CLI::root_element_first> ())
+ if (options_.root_element_first ())
{
if (element_ == 0)
element_ = &e;
}
- else if (String name = options_.value<CLI::root_element> ())
+ else if (String name = options_.root_element ())
{
if (e.name () == name)
element_ = &e;
@@ -305,7 +307,7 @@ namespace CXX
}
private:
- CLI::Options const& options_;
+ options_type const& options_;
SemanticGraph::Element*& element_;
};
}