From Chris.Jones at helvar.com Fri Jan 8 05:37:55 2016 From: Chris.Jones at helvar.com (Jones Chris) Date: Fri Jan 8 05:37:59 2016 Subject: [xsde-users] Prolog items Message-ID: <8C88D4BF58EFE4488D13924F71A00D06CE88DC@servex10.Service.asp> Hi Boris, I'm having trouble getting prologs to appear in the right place, When using something along the following xsde.exe cxx-hybrid --generate-parser --generate-serializer --generate-aggregate --generate-polymorphic --hxx-prologue pskel="FRED" --hxx-prologue sskel="FRED" Then the generated -pskel prolog looks like this :- // Begin prologue. // #include #include #include namespace XMLEntities { using ::xsde::cxx::hybrid::any_type; using ::xsde::cxx::hybrid::any_type_pskel; using ::xsde::cxx::hybrid::any_type_pimpl; } FRED // // End prologue. And the -sskel file suffers a similar problem... This causes us problems as our prolog is not at the top of the file ALSO the prologue and epilogue for the generated -sskel.hxx & -sskel.cxx files seem to be using the prologue and epilogue of the pskel versions Thanks for you continued support Chris Jones From Chris.Jones at helvar.com Fri Jan 8 11:53:41 2016 From: Chris.Jones at helvar.com (Jones Chris) Date: Mon Jan 11 08:44:27 2016 Subject: [xsde-users] Problem with large enumerators Message-ID: <8C88D4BF58EFE4488D13924F71A00D06CE8912@servex10.Service.asp> Taking a enumerator ... .... Generates the code ::Entity::SubFamily SubFamily_pimpl:: post_SubFamily () { ::Entity::SubFamily::value_type v = static_cast< ::Entity::SubFamily::value_type > (0); const char* s = this->SubFamily_pimpl_state_.str_.c_str (); if (strcmp (s, "Workgroup") == 0) v = ::Entity::SubFamily::Workgroup; else if (strcmp (s, "Cluster") == 0) v = ::Entity::SubFamily::Cluster; else if (strcmp (s, "Root") == 0) ... However on certain compilers - well the Microsoft one - there is a compiler limit on 128 nesting level. No honestly. Generates the error fatal error C1061: compiler limit : blocks nested too deeply https://msdn.microsoft.com/en-us/library/dcda4f64.aspx So as the enumerator grows over that 128 item limit suddenly generated code no longer compiles. I know this really isn't your problem, and its trivial to fix by altering the code after its generated, however that's exactly what we don't want to do (Alter the generated code). Would it be possible to change this to a new form? some form of looped lookup perhaps seeing as you already have an array of the string form in the .cpp and the associated enumerator in the .h In fact wouldn't that even remove some memory requirement? Just a suggestion, I'll understand if you ignore it, but it would make life a little easier for some of us. Thanks for taking the time. Chris J From boris at codesynthesis.com Mon Jan 11 09:35:45 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jan 11 09:35:20 2016 Subject: [xsde-users] Prolog items In-Reply-To: <8C88D4BF58EFE4488D13924F71A00D06CE88DC@servex10.Service.asp> References: <8C88D4BF58EFE4488D13924F71A00D06CE88DC@servex10.Service.asp> Message-ID: Hi Chris, Jones Chris writes: > // Begin prologue. > // > > [...] > > > FRED > > // > // End prologue. Yes, this one we have already fixed for the upcoming release. > the prologue and epilogue for the generated -sskel.hxx & -sskel.cxx > files seem to be using the prologue and epilogue of the pskel versions And this one is new, but is now also fixed. Can you give it a try and let me know if there are still any issues: http://codesynthesis.com/~boris/tmp/xsde/xsde-3.3.0.a9-i686-windows.zip Thanks, Boris From Chris.Jones at helvar.com Tue Jan 12 04:00:06 2016 From: Chris.Jones at helvar.com (Jones Chris) Date: Tue Jan 12 04:00:11 2016 Subject: [xsde-users] Prolog items In-Reply-To: References: <8C88D4BF58EFE4488D13924F71A00D06CE88DC@servex10.Service.asp> Message-ID: <8C88D4BF58EFE4488D13924F71A00D06CE8947@servex10.Service.asp> I'm sorry Borris but the prologs of both the -pskel.h and the -sskel.h still do not have correct prologs They read: // Begin prologue. // #include #include #include namespace XMLEntities { using ::xsde::cxx::hybrid::any_type; using ::xsde::cxx::hybrid::any_type_sskel; using ::xsde::cxx::hybrid::any_type_simpl; } FRED // // End prologue. The other issue seems to be fixed in this build though... Yours Chris Jones -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: 11 January 2016 14:36 To: Jones Chris Cc: xsde-users@codesynthesis.com Subject: Re: [xsde-users] Prolog items Hi Chris, Jones Chris writes: > // Begin prologue. > // > > [...] > > > FRED > > // > // End prologue. Yes, this one we have already fixed for the upcoming release. > the prologue and epilogue for the generated -sskel.hxx & -sskel.cxx > files seem to be using the prologue and epilogue of the pskel versions And this one is new, but is now also fixed. Can you give it a try and let me know if there are still any issues: http://codesynthesis.com/~boris/tmp/xsde/xsde-3.3.0.a9-i686-windows.zip Thanks, Boris From boris at codesynthesis.com Tue Jan 12 11:02:14 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jan 12 11:02:20 2016 Subject: [xsde-users] Prolog items In-Reply-To: <8C88D4BF58EFE4488D13924F71A00D06CE8947@servex10.Service.asp> References: <8C88D4BF58EFE4488D13924F71A00D06CE88DC@servex10.Service.asp> <8C88D4BF58EFE4488D13924F71A00D06CE8947@servex10.Service.asp> Message-ID: Hi Chris, Jones Chris writes: > I'm sorry Borris but the prologs of both the -pskel.h and the -sskel.h > still do not have correct prologs This is strange. I tried it myself (albiet on Linux) and it works as expected. I've also studied the code, and I don't see how it can end up after. Can you delete all the generated files to make sure they get regenerated. Also, can you try: xsde cxx-parser --hxx-prologue FRED1 --hxx-prologue FRED2 hello.xsd As well as: xsde cxx-hybrid --generate-parser --generate-serializer --generate-aggregate \ --hxx-prologue pskel="FRED1" --hxx-prologue pskel="FRED2" hello.xsd Thanks, Boris From Chris.Jones at helvar.com Tue Jan 12 11:39:31 2016 From: Chris.Jones at helvar.com (Jones Chris) Date: Tue Jan 12 11:39:36 2016 Subject: [xsde-users] Prolog items In-Reply-To: References: <8C88D4BF58EFE4488D13924F71A00D06CE88DC@servex10.Service.asp> <8C88D4BF58EFE4488D13924F71A00D06CE8947@servex10.Service.asp> Message-ID: <8C88D4BF58EFE4488D13924F71A00D06CE89A4@servex10.Service.asp> Hi Boris, Well after a little more playing, yes it looks like a line like (Your first suggestion) xsde.exe cxx-parser --output-dir "out" --hxx-prologue FRED1 --hxx-prologue FRED2 --namespace-map http://www.w3.org/2001/XMLSchema=XMLEntities "Test1.xsd" "Test2.xsd" does indeed produce the expected prolog. And if you modify that to be: xsde.exe cxx-parser --output-dir "out" --hxx-prologue FRED1 --hxx-prologue FRED2 --namespace-map http://www.w3.org/2001/XMLSchema=XMLEntities "Test1.xsd" "Test2.xsd" Your still Ok This however xsde.exe cxx-hybrid --output-dir "out" --generate-parser --namespace-map http://www.w3.org/2001/XMLSchema=XMLEntities "Test1.xsd" Defiantly gets it wrong... (Note there's not even a prologue definition) I'm using a polymorphic XSD, could that be the problem? Actually I'm using the same test cases we corresponded about before - but for my simple wrong case above just uses the XSD :- (Attached) And it generates test1-pskel.hxx : (some whitespace removed for clarity) #ifndef TEST1_PSKEL_HXX #define TEST1_PSKEL_HXX // Begin prologue. // #include #include #include namespace XMLEntities { using ::xsde::cxx::hybrid::any_type; using ::xsde::cxx::hybrid::any_type_pskel; using ::xsde::cxx::hybrid::any_type_pimpl; } // // End prologue. Hope this helps Chris Jones -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: 12 January 2016 16:02 To: Jones Chris Cc: xsde-users@codesynthesis.com Subject: Re: [xsde-users] Prolog items Hi Chris, Jones Chris writes: > I'm sorry Borris but the prologs of both the -pskel.h and the -sskel.h > still do not have correct prologs This is strange. I tried it myself (albiet on Linux) and it works as expected. I've also studied the code, and I don't see how it can end up after. Can you delete all the generated files to make sure they get regenerated. Also, can you try: xsde cxx-parser --hxx-prologue FRED1 --hxx-prologue FRED2 hello.xsd As well as: xsde cxx-hybrid --generate-parser --generate-serializer --generate-aggregate \ --hxx-prologue pskel="FRED1" --hxx-prologue pskel="FRED2" hello.xsd Thanks, Boris -------------- next part -------------- A non-text attachment was scrubbed... Name: Test1.xsd Type: text/xml Size: 1307 bytes Desc: Test1.xsd Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20160112/0e9c0802/Test1.bin From boris at codesynthesis.com Thu Jan 14 12:02:37 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jan 14 12:02:43 2016 Subject: [xsde-users] Prolog items In-Reply-To: <8C88D4BF58EFE4488D13924F71A00D06CE89A4@servex10.Service.asp> References: <8C88D4BF58EFE4488D13924F71A00D06CE88DC@servex10.Service.asp> <8C88D4BF58EFE4488D13924F71A00D06CE8947@servex10.Service.asp> <8C88D4BF58EFE4488D13924F71A00D06CE89A4@servex10.Service.asp> Message-ID: Hi Chris, Jones Chris writes: > #ifndef TEST1_PSKEL_HXX > #define TEST1_PSKEL_HXX > // Begin prologue. > // > #include > #include > #include > namespace XMLEntities > { > using ::xsde::cxx::hybrid::any_type; > using ::xsde::cxx::hybrid::any_type_pskel; > using ::xsde::cxx::hybrid::any_type_pimpl; > } > // > // End prologue. Now I am confused. There is nothing wrong with this code. The C++/Hybrid mapping, underneath, calls C++/Parser to generate parser skeletons and it uses prologue/type-map machinery to tailor them to its own needs. Specifically, if I run: xsde cxx-hybrid --generate-parser --hxx-prologue pskel=FRED1 \ --hxx-prologue pskel=FRED2 hello.xsd I get, in hello-pskel.hxx: #ifndef CXX__HELLO_PSKEL_HXX #define CXX__HELLO_PSKEL_HXX // Begin prologue. // FRED1 FRED2 #include #include #include namespace xml_schema { using ::xsde::cxx::hybrid::any_type; using ::xsde::cxx::hybrid::any_type_pskel; using ::xsde::cxx::hybrid::any_type_pimpl; } // // End prologue. Which is exactly what's expected. Boris From boris at codesynthesis.com Sun Jan 17 10:48:37 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Jan 17 10:48:38 2016 Subject: [xsde-users] Problem with large enumerators In-Reply-To: <8C88D4BF58EFE4488D13924F71A00D06CE8912@servex10.Service.asp> References: <8C88D4BF58EFE4488D13924F71A00D06CE8912@servex10.Service.asp> Message-ID: Hi Chris, Jones Chris writes: > Would it be possible to change this to a new form? some form of looped > lookup perhaps seeing as you already have an array of the string form > in the .cpp and the associated enumerator in the .h The enum thing is pretty complicated. In particular, the string literal array you refer to will not work for a derived (restricted) enum (yes, we have to support these). In this case, the array is only generated for the base class and will contain literals that the derived class has "restricted away". In any case, I fixed it by using the (admittedly ugly) do/break approach for very long enums. Can you give it a try and let me know if there are any problems: http://codesynthesis.com/~boris/tmp/xsde/xsde-3.3.0.a10-i686-windows.zip Thanks, Boris From Oliver.Jones at helvar.com Fri Jan 29 13:01:57 2016 From: Oliver.Jones at helvar.com (Jones Oliver) Date: Fri Jan 29 13:02:02 2016 Subject: [xsde-users] non-default constructors Message-ID: <5DF07A4A01564042B4D8AD16AB55D03F9BB5480B@servex10.Service.asp> Hi Boris, Can you tell me if there is a way to generate the non-default constructors, i.e. ones that set the members of the class. I can see in the documentation that you might have provision for this, but I can't see how to do it using the existing command set. Regards, Ollie This is an example of a class, in the documentation, that has a non-default constructor that sets its members. 5.1 Mapping for QName namespace xml_schema { class qname { public: enum error { error_none, error_no_memory }; // The default constructor creates an uninitialized object. // Use modifiers to initialize it. // qname (); explicit qname (char* name); qname (char* prefix, char* name);