Author Topic: Parsing error when synchronizing with code  (Read 3351 times)

OT

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Parsing error when synchronizing with code
« 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?

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Parsing error when synchronizing with code
« Reply #1 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()
{
}
Best Regards, Roy

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Parsing error when synchronizing with code
« Reply #2 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.