// Copyright (C) 2005-2006 Code Synthesis Tools CC
//
// This program was generated by XML Schema Definition Compiler (XSD)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// 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
//
// In addition, as a special exception, Code Synthesis Tools CC gives
// permission to link this program with the Xerces-C++ library (or with
// modified versions of Xerces-C++ that use the same license as Xerces-C++),
// and distribute linked combinations including the two. You must obey
// the GNU General Public License version 2 in all respects for all of
// the code used other than Xerces-C++. If you modify this copy of the
// program, you may extend this exception to your version of the program,
// but you are not obligated to do so. If you do not wish to do so, delete
// this exception statement from your version.
//
// In addition, Code Synthesis Tools CC makes a special exception for
// the Free/Libre and Open Source Software (FLOSS) which is described
// in the accompanying FLOSSE file.
//

// Begin prologue.
//
//
// End prologue.

// hello_type
//

namespace _xsd_hello_type
{
  // hello_type::greeting
  //

  template < typename _xsd_greeting_, typename _xsd_name_ >
  void hello_type< _xsd_greeting_, _xsd_name_ >::
  greeting_parser (::xsd::cxx::parser::parser< _xsd_greeting_, char >& greeting)
  {
    this->_xsd_greeting__ = &greeting;
  }


  // hello_type::name
  //

  template < typename _xsd_greeting_, typename _xsd_name_ >
  void hello_type< _xsd_greeting_, _xsd_name_ >::
  name_parser (::xsd::cxx::parser::parser< _xsd_name_, char >& name)
  {
    this->_xsd_name__ = &name;
  }


  template < typename _xsd_greeting_, typename _xsd_name_ >
  void hello_type< _xsd_greeting_, _xsd_name_ >::
  parsers (::xsd::cxx::parser::parser< _xsd_greeting_, char >& greeting,
           ::xsd::cxx::parser::parser< _xsd_name_, char >& name)
  {
    this->_xsd_greeting__ = &greeting;
    this->_xsd_name__ = &name;
  }

  template < typename _xsd_greeting_, typename _xsd_name_ >
  hello_type< _xsd_greeting_, _xsd_name_ >::
  hello_type ()
  : _xsd_greeting__ (0),
  _xsd_name__ (0)
  {
  }
}


// hello_type
//

namespace _xsd_hello_type
{
  template < typename x >
  _xsd_greeting< x >::
  ~_xsd_greeting () 
  {
  }

  template < typename x >
  void _xsd_greeting< x >::
  greeting (const x&) 
  {
  }

  template < typename x >
  void _xsd_greeting< x >::
  _xsd_call_glue_greeting (::xsd::cxx::parser::parser< x, char >* p)
  {
    this->greeting (p->post ());
  }

  template <>
  struct _xsd_greeting<void>
  {
    virtual ~_xsd_greeting () 
    {
    }

    virtual void greeting () 
    {
    }

    void _xsd_call_glue_greeting (::xsd::cxx::parser::parser< void, char >*p)
    {
      p->post ();
      this->greeting ();
    }
  };

  template < typename x >
  _xsd_name< x >::
  ~_xsd_name () 
  {
  }

  template < typename x >
  void _xsd_name< x >::
  name (const x&) 
  {
  }

  template < typename x >
  void _xsd_name< x >::
  _xsd_call_glue_name (::xsd::cxx::parser::parser< x, char >* p)
  {
    this->name (p->post ());
  }

  template <>
  struct _xsd_name<void>
  {
    virtual ~_xsd_name () 
    {
    }

    virtual void name () 
    {
    }

    void _xsd_call_glue_name (::xsd::cxx::parser::parser< void, char >*p)
    {
      p->post ();
      this->name ();
    }
  };

  template < typename _xsd_greeting_, typename _xsd_name_ >
  bool hello_type< _xsd_greeting_, _xsd_name_ >::
  _start_element_impl (const ::std::basic_string< char >& ns,
                       const ::std::basic_string< char >& n)
  {
    if (::xsd::cxx::parser::non_validating::complex_content< char >::_start_element_impl (ns, n))
    {
      return true;
    }

    if (n == "greeting" && ns.empty ())
    {
      this->::xsd::cxx::parser::non_validating::complex_content< char >::context_.back ().parser_ = this->_xsd_greeting__;

      if (this->_xsd_greeting__)
        this->_xsd_greeting__->pre ();

      return true;
    }

    if (n == "name" && ns.empty ())
    {
      this->::xsd::cxx::parser::non_validating::complex_content< char >::context_.back ().parser_ = this->_xsd_name__;

      if (this->_xsd_name__)
        this->_xsd_name__->pre ();

      return true;
    }

    return false;
  }

  template < typename _xsd_greeting_, typename _xsd_name_ >
  bool hello_type< _xsd_greeting_, _xsd_name_ >::
  _end_element_impl (const ::std::basic_string< char >& ns,
                     const ::std::basic_string< char >& n)
  {
    if (::xsd::cxx::parser::non_validating::complex_content< char >::_end_element_impl (ns, n))
    {
      return true;
    }

    if (n == "greeting" && ns.empty ())
    {
      if (this->_xsd_greeting__)
        this->_xsd_call_glue_greeting (this->_xsd_greeting__);

      return true;
    }

    if (n == "name" && ns.empty ())
    {
      if (this->_xsd_name__)
        this->_xsd_call_glue_name (this->_xsd_name__);

      return true;
    }

    return false;
  }
}


// Begin epilogue.
//
//
// End epilogue.

