Sparx Systems Forum

Enterprise Architect => Bugs and Issues => Topic started by: Kenny on September 08, 2013, 09:55:10 pm

Title: C++ codegen error for ptr paramter of method
Post by: Kenny on September 08, 2013, 09:55:10 pm
Hi,
I want to generate c++ code from a class diagram. But when I tried to set the type of a parameter of a method to pointer, the code generation enginee reported an error:

Unexpected symbol: *
Code generation failed.

I tried the following variants in the parameter field:
a: unsigned int* (error)
a*: unsigned int (good, but the generated code is not what I expected.)
*a: unsigned int (error)

Thanks in advance.

/Kai




Title: Re: C++ codegen error for ptr paramter of method
Post by: g.makulik on September 09, 2013, 04:54:59 am
Did you try using the parameter editor for this? I've noticed that parsing plain UML op parameter syntax might fail, while specifiying types with the parametr editor works.

HTH
Günther
Title: Re: C++ codegen error for ptr paramter of method
Post by: Kenny on September 09, 2013, 05:57:34 pm
Quote
Did you try using the parameter editor for this? I've noticed that parsing plain UML op parameter syntax might fail, while specifiying types with the parametr editor works.

HTH
Günther

yes, I did try to use the parameter editor to enter the parameters. The problem occurred when I tried to generate to c++ code. To my suprise, I tried to use the reverse engineering to import a piece of c++ code that contains also the pointer paramter in the method and then generate the c++ code. It worked very well. By looking at the operation field, the parameter has type "bool*". My original model looks the same as it. It is really strange that EA cannot handle my code, but it can handle the imported code. I must have missed some points.

Thanks.
/Kai