Re: [abc-users] Does abc support Java 5 syntax completely

From: Pavel Avgustinov <pavel_at_comlab.ox.ac.uk>
Date: Sun, 18 Jan 2009 00:48:01 +0000

I'd recommend looking at the abc.ja.eaj package, which is a port of eaj
to the new JastAdd frontend. As well as extending that instead of
abc.ja, you should be able to see how to add new compiler passes in there.

Cheers,
-P

Meisam Fathi wrote:
> Hi there,
>
> abc.ja works properly with Java5 code, but the problem something else.
> I have developed my own extension based on abc.eaj.I have created a
> new AbcExtension class extending abc.eaj.AbcExtension, and added my
> desired passes to it. Runs these passes properly, but it doesn't
> support Java5. So I decied to swith to abc.ja extension. There is a
> CompileSequence class defined in abc.ja extension which overrides some
> methods deined in its superclass.When I extend abc.ja extension,
> passes that I have defined are ignored. It seems that it is because of
> the methods defined in class abc.ja.CompileSequence.
> I need to add my own passes to my extension, and I need to make my
> extension capable of dealing with Java5 code. When I extend abc.ja I
> can deal with Java 5 code style, but I loose the ability to add my own
> passes. When I extend abc.eaj I can add my own passes, but I can't
> compile Java 5 code. Is there anybody that can help me?
>
> Thanks in advance
> Meisam
>
>
> On Sat, Jan 10, 2009 at 6:14 AM, Pavel Avgustinov
> <pavel_at_comlab.ox.ac.uk <mailto:pavel_at_comlab.ox.ac.uk>> wrote:
>
> Hi,
>
> abc should support all of Java5, but only when you use the new
> JastAdd-based
> frontend. You can do this by giving the command-line flags "-ext
> abc.ja".
>
> HTH,
> - Pavel
>
> On Saturday 10 January 2009 13:44:06 Meisam Fathi wrote:
> > Hi
> > I'm wondering if abc supports Java 5 syntax completely. I've
> tried to
> > compile a piece of code that contains a method overriding a the
> > "toString()" method. This method is annotated with an @Override tag.
> >
> >
> ========================================================================v
> > public class UserManager{
> >
> > //...
> >
> > @Override
> > public String toString() {
> > return "the relevent string";
> >
> > //...
> >
> > }
> >
> ========================================================================^
> >
> >
> > what I get when I compile the code using a -source 1.5 option is an
> > error message as follow:
> >
> >
> ========================================================================v
> > UserManager.java:46:
> > Illegal character "@"
> > @Override
> > ^
> >
> > UserManager.java:47:
> > Syntax error: unexpected public.
> > public String toString() {
> > ^----^
> >
> > 2 errors.
> >
> ========================================================================^
> >
> >
> > Is there anything special that I should do?
> >
> > Thanks in advance
> > Meisam
>
>
>
>
Received on Sun Jan 18 2009 - 00:48:25 GMT

This archive was generated by hypermail 2.2.0 : Sun Jan 18 2009 - 06:30:13 GMT