[xsde-users] C1061: Blocks nested too deeply

Boris Kolpackov boris at codesynthesis.com
Mon Jun 30 05:55:01 EDT 2014


Hi Tony,

Holzer, Tony (AS) <anthony.holzer at ngc.com> writes:

> Since the enumeration is so large, it quickly hits the Visual Studio
> compiler limit of 128 nesting levels.

I assume you still want to have the C++ enum interface (rather than,
say, represent it as a string). In this case the easiest way forward
would be to provide custom parser implementation that avoids this
limitation. On how to provide a custom parser, see:

http://www.codesynthesis.com/projects/xsde/documentation/cxx/hybrid/guide/#6.1

The easiest way to actually implement it would be to copy the generated
version and tweak it. One way would be to initialize the enum value  ('v'
variable) to some invalid value, say -1, and then break the if-else chain
with a check and a return if 'v' is no longer -1.

The major drawback of this approach is that if the enumeration changes,
then you need to remember to update the custom parser code.

Boris



More information about the xsde-users mailing list