#include <location.h>
#include <parser_base.h>
#include <logger.h>
-#include <ant_elements.h>
-#include <ant_elements_parser.h>
-#include <ant_element_factory.h>
+#include "reqif/reqif_element.h"
+#include "reqif/reqif_elements_parser.h"
+#include "xml/element_factory.h"
-#include <project.h>
-#include <projectComponent.h>
+//#include <project.h>
+//#include <projectComponent.h>
-namespace antcc {
+namespace reqif {
namespace parser {
* Implement RootElement parsing function
*/
-RootElement::RootElement(antcc::antElement *_elt )
+RootElement::RootElement(reqif::Element *_elt )
: EmptyElement(_elt)
{
ANTCC_PARSER_DEBUG("Cplx(%0x)::Cplx ctor m_CurElt=%0x"
}
RootElement::RootElement(const RootElement &c)
- : antcc::parser::EmptyElement(c.m_CurrentElement)
+ : reqif::parser::EmptyElement(c.m_CurrentElement)
{
ANTCC_PARSER_DEBUG("Cplx(%0x)::Cplx copy c.m_CurElt=%0x"
,this
{
State &s(m_context.back());
std::string space;
- ANTCC_PARSER_DEBUG("%sCplxE(%0x)::_startElement Enter name=%s s.depth=%d context.size=%d"
+ ANTCC_PARSER_DEBUG("%sRootE(%0x)::_startElement Enter name=%s s.depth=%d context.size=%d"
,space.insert(0,s.m_depth,' ').c_str()
,this
,name.c_str()
//Should check if it's any first
if (s.m_parser)
{
- ANTCC_PARSER_DEBUG("CplxE::_startElement call s.m_parser->_startElement : %s",name.c_str());
+ ANTCC_PARSER_DEBUG("RootE::_startElement call s.m_parser->_startElement : %s",name.c_str());
s.m_parser->_startElement(ns,name,type);
} else {
- ANTCC_PARSER_ERROR("CplxE::_startElement no parser stacked (s.m_parser==NULL) : %s",name.c_str());
+ ANTCC_PARSER_ERROR("RootE::_startElement no parser stacked (s.m_parser==NULL) : %s",name.c_str());
}
} else {
- ANTCC_PARSER_DEBUG("CplxE::_startElement %s call startElementImpl",name.c_str());
+ ANTCC_PARSER_DEBUG("RootE::_startElement %s call startElementImpl",name.c_str());
if (!startElementImpl(ns,name,type))
{
- ANTCC_PARSER_ERROR("CplxE::_startElement %s call startElementImpl returned false",name.c_str());
+ ANTCC_PARSER_ERROR("RootE::_startElement %s call startElementImpl returned false",name.c_str());
#ifdef PARSER_DEBUG
- std::cout<<"\tcplx _start call Any : unknown "<<name<<std::endl;
+ std::cout<<"\tRootElement _start call Any : unknown "<<name<<std::endl;
#endif
// Unexpectect element
//this->startAnyElement(ns,name);
/* Element not recogized by us*/
} else
{
- ANTCC_PARSER_DEBUG("CplxE::_startElement %s called startElementImpl returned true ",name.c_str());
+ ANTCC_PARSER_DEBUG("RootE::_startElement %s called startElementImpl returned true ",name.c_str());
if (s.m_parser != 0)
{
s.m_parser->preImpl();
/* Need to call pre */
#ifdef PARSER_DEBUG
- std::cout<<"\tcplx _start Need to call pre- : "<<name<<std::endl;
+ std::cout<<"\tRootElt _start Need to call pre- : "<<name<<std::endl;
#endif
}
}
{
State &s(m_context.back());
std::string space;
- ANTCC_PARSER_DEBUG("%sCplx(%0x)::_endElement Enter name=%s s.depth=%d context.size=%d"
+ ANTCC_PARSER_DEBUG("%sRootE(%0x)::_endElement Enter name=%s s.depth=%d context.size=%d"
,space.insert(0,s.m_depth,' ').c_str()
,this
,name.c_str()
if (--ss.m_depth > 0)
{
// Indirect
- ANTCC_PARSER_DEBUG("CplxE::_endElement 1 name=%s ss.m_depth=%d m_context.size=%d"
+ ANTCC_PARSER_DEBUG("RootE::_endElement 1 name=%s ss.m_depth=%d m_context.size=%d"
,name.c_str()
,ss.m_depth
,m_context.size());
} else
{
// Direct recursion
- ANTCC_PARSER_DEBUG( "CplxE::_endElement %s 2 WARNING I pass by here Direct recursion: "
+ ANTCC_PARSER_DEBUG( "RootE::_endElement %s 2 WARNING I pass by here Direct recursion: "
,name.c_str());
if (this == ss.m_parser.get())
{
- ANTCC_PARSER_DEBUG( "CplxE::_endElement %s good this==ss.m_parser",name.c_str());
+ ANTCC_PARSER_DEBUG( "RootE::_endElement %s good this==ss.m_parser",name.c_str());
this->postImpl();
if (!endElementImpl(ns,name))
{
- ANTCC_PARSER_ERROR( "CplxE::_endElement %s endElementImpl call failed",name.c_str());
+ ANTCC_PARSER_ERROR( "RootE::_endElement %s endElementImpl call failed",name.c_str());
}
} else
{
- ANTCC_PARSER_ERROR( "CplxE::_endElement %s Must NOT HAPPEN!!!",name.c_str());
+ ANTCC_PARSER_ERROR( "RootE::_endElement %s Must NOT HAPPEN!!!",name.c_str());
}
}
}
if (--s.m_depth > 0)
{
space = "";
- ANTCC_PARSER_DEBUG("%sCplx(%0x)::_endElement 3 name=%s s.depth=%d context.size=%d"
+ ANTCC_PARSER_DEBUG("%sRoot(%0x)::_endElement 3 name=%s s.depth=%d context.size=%d"
,space.insert(0,s.m_depth,' ').c_str()
,this
,name.c_str()
std::cout<<"No parser here\n";
} else {
- ANTCC_PARSER_DEBUG("CplxE(%0x)::_endElement %s 4 %s same parser "
+ ANTCC_PARSER_DEBUG("RootE(%0x)::_endElement %s 4 %s same parser "
, this
, name.c_str()
, (this==s.m_parser.get())?"yes":"no");
if (s.m_parser )
{
- ANTCC_PARSER_DEBUG("CplxE(%0x)::_endElement call postImpl %s"
+ ANTCC_PARSER_DEBUG("RootE(%0x)::_endElement call postImpl %s"
,this
,name.c_str());
s.m_parser->postImpl();
if (!endElementImpl(ns,name))
{
- ANTCC_PARSER_ERROR("CplxE::_endElement failed call endElementImpl %s"
+ ANTCC_PARSER_ERROR("RootE::_endElement failed call endElementImpl %s"
,name.c_str());
// Wrong
//this->endAnyElement(ns,name);
}
}
}
- ANTCC_PARSER_DEBUG("CplxE::_endElement LEAVE this=%0x name=%s,s.m_depth=%d m_context.size=%d"
+ ANTCC_PARSER_DEBUG("RootE::_endElement LEAVE this=%0x name=%s,s.m_depth=%d m_context.size=%d"
, this
,name.c_str()
,s.m_depth
State &s(m_context.back());
if (s.m_any)
{
- ANTCC_PARSER_DEBUG_CPLX_ATTR("Cplx::_Attributre any name=%s",name.c_str());
+ ANTCC_PARSER_DEBUG_CPLX_ATTR("RootElt::_Attributre any name=%s",name.c_str());
anyAttribute(ns,name,val);
} else if (s.m_parser)
{
- ANTCC_PARSER_DEBUG_CPLX_ATTR("Cplx::_Attributre with parser name=%s",name.c_str());
+ ANTCC_PARSER_DEBUG_CPLX_ATTR("RootElt::_Attributre with parser name=%s",name.c_str());
s.m_parser->_Attribute(ns,name,val);
}
} else
{
- ANTCC_PARSER_DEBUG_CPLX_ATTR("Cplx::_Attributre call this->AttributeImpl name=%s",name.c_str());
+ ANTCC_PARSER_DEBUG_CPLX_ATTR("RootElt::_Attributre call this->AttributeImpl name=%s",name.c_str());
if ( ! this->AttributeImpl(ns,name,val) )
{
- ANTCC_PARSER_ERROR("Cplx::_AttributeImpl name=%s unsupported"
+ ANTCC_PARSER_ERROR("RootElt::_AttributeImpl name=%s unsupported"
,name.c_str());
}
}
{
if (s.m_parser) {
#ifdef PARSER_DEBUG_CHARACTER
- std::cout<<"CplxE::_characters"<<val<<" sz="<<m_context.size()<<"call parser@ "<<s.m_parser<<"\n";
+ std::cout<<"RootE::_characters"<<val<<" sz="<<m_context.size()<<"call parser@ "<<s.m_parser<<"\n";
#endif
if (s.m_parser.get() == this)
{
- std::cerr<<"CplxE::_Characters ERROR: I have serious trouble treating -("<<val<<")"<<s.m_depth<<"\n";
+ std::cerr<<"RootE::_Characters ERROR: I have serious trouble treating -("<<val<<")"<<s.m_depth<<"\n";
if (!_CharactersImpl(val))
{
// Call any characters
#ifdef PARSER_DEBUG_CHARATER
- std::cout<<"CplxE::_Characters what to do? call any_characters :"<<val<<" depth="<<s.m_depth<<std::endl;
+ std::cout<<"RootE::_Characters what to do? call any_characters :"<<val<<" depth="<<s.m_depth<<std::endl;
#endif
}
} else
s.m_parser->_Characters(val);
} else {
- std::cout<<"CplxE::_characters... what to do with char ("<<val<<") "<<m_context.size()<<" parser@="<<s.m_parser<<"\n";
+ std::cout<<"RootE::_characters... what to do with char ("<<val<<") "<<m_context.size()<<" parser@="<<s.m_parser<<"\n";
}
} else {
{
// Call any characters
#ifdef PARSER_DEBUG_CHARATER
- std::cout<<"CplxE::_Characters what to do? call any_characters :"<<val<<" depth="<<s.m_depth<<std::endl;
+ std::cout<<"RootE::_Characters what to do? call any_characters :"<<val<<" depth="<<s.m_depth<<std::endl;
#endif
}
}