[aspectc-user] Parse errors

Olaf Spinczyk olaf at ivs.cs.uni-magdeburg.de
Wed Feb 6 15:06:24 CET 2002


(Colin, sorry for receiving this answer twice!)

Hi,

On Wednesday,  6. February 2002 14:13, you wrote:
> Thanks for the help with the linux problems, I am now up and running.  I
> have found a couple of cases where parse errors are generated, which you
> may or may not already know about.  The code
>
> typedef enum x {a,b,c} x;
>
> generates errors.  This was in some existing code I am working with, I am
> not sure why it was coded like this, or even whether it is valid c++, but
> it does compile with the Microsoft compiler.  I have worked around it.

Thank you for this hint. I am also not sure if this is valid c++, but it
compiles with GNU C++. At the moment we are working on a new parser for the
PUMA codetransformation system, which is the core of AspectC++. Matthias, who
is doing this work, will check if this problem will be solved with the new
parser.

> The second may just be that I am pressing the limits of the compiler, I
> have the following:
>
> class CSimpleList
> {
> public:
> 	CSimpleList(int nNextOffset = 0);
> 	void AddHead(void* p);
> };
>
> template<class TYPE>
> class CTypedSimpleList : public CSimpleList
> {
> public:
> 	CTypedSimpleList(int nNextOffset = 0)
>
> 		: CSimpleList(nNextOffset) { }
>
> 	void AddHead(TYPE p)
> 		{ CSimpleList::AddHead(p); }
> };
>
> This generates an error
> SEMERR: Adding Empty tree node to TemplateDecl
>
> then a Parse error near token `(' on the line declaring AddHead in the
> template class;
>
> This one is giving me more problems and a workaround would be appreciated
> if at all possible.

Last week-end we added minimal support for templates to the PUMA parser. In
my local version of AspectC++ your code fragment is no problem. The next
release, which will probably come today, will contain these improvements :-)

But you should remember that the support for templates is only minimal until
we have our new parser. Templates may only contain a single template argument
and that argument must be a type (not a constant expression). Template
specialization does not work. AspectC++ will no be able to find join points
in methods of template classes.

I hope that these restrictions are no problem for you/your code.

Regards,

Olaf



More information about the aspectc-user mailing list