Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Fwd: [aspectj-dev] Fwd: metacomments and aspectj - need suggestion

Hi Sergev/Andrew and others.

I think what you are trying to do would be possible with abc (the
AspectBench Compiler), however, it may be overkill. A simple parser
should do, actually. Both ajc and abc are designed to implement
joinpoints that are dynamic, i.e. execute at runtime of the program.
What Sergev is trying to do is matching purely static entities
(comments) and actually printing them *at compile time*. This does not
have much to do with AOP. I would suggest to use a simple SableCC or
JavaCC parser. You could use a simple visitor to print the comments.

Another alternative could even be to use awk, grep and/or sed.

Eric

--
Eric Bodden
Software Technology Group, Technische Universität Darmstadt, Germany
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt



2009/10/22 Andrew Eisenberg <andrew@xxxxxxxxxxxx>:
> Hi there,
>
> The ajc compiler was not designed to be extensible by end users.  Its
> focus has is efficiency and stability.  However, the AspectBench
> compiler is designed for extensibility and for testing out new ideas.
> This might be more suitable to your purposes.
>
> http://abc.comlab.ox.ac.uk/introduction
>
> 2009/10/22 Sergey Staroletov <sergey.staroletov@xxxxxxxxx>:
>> Hello. I'm doing my first step research in AspectJ because I am thinking
>> that one feature in it will help me in my big research project. I want to
>> try to extend aspectj language to process my  special  comments (non-java
>> doc, just single-line or multi-line user comments) in java files with
>> aspectj weaving. In my idea It will be as:
>>
>> in aj file (added new word 'comment')
>>
>> pointcut point(String s) : comment(s);
>>
>> long before(String s) : point(s) {
>>
>> System.out.println(s) ;
>>
>> }
>>
>>
>>
>> in java file
>>
>> System.out.println("start") ;
>>
>> //comment here
>>
>> System.out.println("stop") ;
>>
>>
>>
>> and sample result
>>
>>
>>
>> start
>>
>> comment here
>>
>> stop
>>
>> I am thinking that instruction to process comment will be inserting between
>> code line before comment and code line after comment
>>
>> It is possible to realize by myself and where can i find the develper
>> documentation? (And what shall I do to patch existing code (I've downloaded
>> AJT source to my Eclipse, built and tried to debug this - but I'm lost my
>> way) ?
>>
>>
>> --
>> С уважением, Старолетов Сергей
>>
>> _______________________________________________
>> aspectj-dev mailing list
>> aspectj-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>>
>>
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>


Back to the top