Book a Demo

Author Topic: C++ codegen error for ptr paramter of method  (Read 4142 times)

Kenny

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
C++ codegen error for ptr paramter of method
« 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





g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: C++ codegen error for ptr paramter of method
« Reply #1 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
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

Kenny

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: C++ codegen error for ptr paramter of method
« Reply #2 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