Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: OT on June 11, 2014, 06:23:41 pm

Title: Parsing error when synchronizing with code
Post by: OT on June 11, 2014, 06:23:41 pm
I have a strange problem with the
-> Code Engineering -> Synchronize Package with code...
function in EA.

Say, I have a simple class A:

class A
{
public:
      A();
      virtual ~A();
};
A::A()
{
}
A::~A()
{
}

Everything goes fine when I use the "Synchronize Package with code..."
function. Next I add an additional constructor which passes a reference
to a C array of size 2:

class A
{
public:
      A();
      A(BYTE (&bInfo)[2]);
      virtual ~A();
private:
      BYTE (&m_bInfo)[2];
};
A::A()
{
}
A::A(BYTE (&bInfo)[2])
 : m_bInfo(bInfo)
{
}
A::~A()
{
}

The compiler is totally happy with this construct.
EA however generates a parsing error: "Unexpected Symbol: ;"

How can I fix this?
Title: Re: Parsing error when synchronizing with code
Post by: RoyC on June 12, 2014, 08:25:36 am
There seems to be a semi-colon outside a closing bracket, although it is there in both snippets of code. Does that make a difference?

class A
{
public:
     A();
     A(BYTE (&bInfo)[2]);
     virtual ~A();
private:
     BYTE (&m_bInfo)[2];
[highlight]};[/highlight]
A::A()
{
}
Title: Re: Parsing error when synchronizing with code
Post by: Eve on June 12, 2014, 10:46:52 am
References to arrays are a little tricky. (How to model in part)

We recommend using a typedef to allow EA to accept this.