Permalink
Browse files

Remove custom parser. It doesn't work correctly anymore.

  • Loading branch information...
1 parent 2a9af42 commit 9935d5c6326b2d9869a14f848bdd35f55bc9a05d @cornelius committed Jul 17, 2010
@@ -28,8 +28,7 @@ set( kxml_compiler_SRCS
creator.cpp
kxml_compiler.cpp
parsercreatordom.cpp
- parsercreatorcustom.cpp )
-
+)
kde4_add_executable( kxml_compiler NOGUI RUN_UNINSTALLED ${kxml_compiler_SRCS} )
View
@@ -1,6 +1,5 @@
- Default values for int attributes.
- Code generation hints (e.g. names of classes and functions)
-- Remove custom parser
- Use Qt stream parser
- Add support for setting project
- Add tests for XML example schema parser.
View
@@ -24,7 +24,6 @@
#include "namer.h"
#include "parsercreatordom.h"
-#include "parsercreatorcustom.h"
#include "writercreator.h"
#include <libkode/code.h>
@@ -67,9 +66,8 @@ bool Creator::ClassFlags::hasId() const
}
-Creator::Creator( const Schema::Document &document, XmlParserType p,
- XmlWriterType w )
- : mDocument( document ), mXmlParserType( p ), mXmlWriterType( w ),
+Creator::Creator( const Schema::Document &document, XmlParserType p )
+ : mDocument( document ), mXmlParserType( p ),
mVerbose( false ), mUseKde( false )
{
setExternalClassNames();
@@ -181,10 +179,6 @@ void Creator::createElementFunctions( KODE::Class &c, const Schema::Element &e,
} else {
createProperty( c, "QString", className );
c.addHeaderInclude( "QString" );
- if ( mXmlParserType == XmlParserCustomExternal ) {
- ParserCreatorCustom parserCreatorCustom( this );
- parserCreatorCustom.createTextElementParser( c, targetElement );
- }
}
if ( mCreateCrudFunctions && targetElement.name() == "id" ) {
@@ -363,9 +357,6 @@ void Creator::createElementParser( KODE::Class &c, const Schema::Element &e )
case XmlParserDomExternal:
parserCreator = new ParserCreatorDom( this );
break;
- case XmlParserCustomExternal:
- parserCreator = new ParserCreatorCustom( this );
- break;
}
parserCreator->createElementParser( c, e );
@@ -410,9 +401,6 @@ void Creator::createFileParser( const Schema::Element &element )
case XmlParserDomExternal:
parserCreator = new ParserCreatorDom( this );
break;
- case XmlParserCustomExternal:
- parserCreator = new ParserCreatorCustom( this );
- break;
}
parserCreator->createFileParser( element );
@@ -457,13 +445,12 @@ void Creator::printFiles( KODE::Printer &printer )
bool Creator::externalParser() const
{
- return mXmlParserType == XmlParserDomExternal ||
- mXmlParserType == XmlParserCustomExternal;
+ return mXmlParserType == XmlParserDomExternal;
}
bool Creator::externalWriter() const
{
- return mXmlWriterType == XmlWriterCustomExternal;
+ return false;
}
const Schema::Document &Creator::document() const
View
@@ -60,12 +60,10 @@ class Creator
bool m_hasId;
};
- enum XmlParserType { XmlParserDom, XmlParserDomExternal,
- XmlParserCustomExternal };
- enum XmlWriterType { XmlWriterCustom, XmlWriterCustomExternal };
+ enum XmlParserType { XmlParserDom, XmlParserDomExternal };
+
+ Creator( const Schema::Document &document, XmlParserType p = XmlParserDom );
- Creator( const Schema::Document &document, XmlParserType p = XmlParserDom,
- XmlWriterType w = XmlWriterCustom );
void setVerbose( bool verbose );
void setUseKde( bool useKde );
@@ -125,7 +123,6 @@ class Creator
Schema::Document mDocument;
XmlParserType mXmlParserType;
- XmlWriterType mXmlWriterType;
QString mExternalClassPrefix;
KODE::File mFile;
@@ -67,7 +67,6 @@ int main( int argc, char **argv )
options.add("verbose", ki18n("Generate debug output"));
options.add("+schema", ki18n("Schema of XML file"));
options.add("external-parser", ki18n("Generate parser in separate source file"));
- options.add("custom-parser", ki18n("Generate parser customized for schema"));
options.add("xsd", ki18n("Schema is XML Schema"));
options.add("rng", ki18n("Schema is RelaxNG"));
options.add("xml", ki18n("Schema is example XML"));
@@ -175,9 +174,7 @@ int main( int argc, char **argv )
}
Creator::XmlParserType pt;
- if ( args->isSet( "custom-parser" ) ) {
- pt = Creator::XmlParserCustomExternal;
- } else if ( args->isSet( "external-parser" ) ) {
+ if ( args->isSet( "external-parser" ) ) {
pt = Creator::XmlParserDomExternal;
} else {
pt = Creator::XmlParserDom;
Oops, something went wrong.

0 comments on commit 9935d5c

Please sign in to comment.