[Soot-list] Jasmin grammar

Eric Bodden eric.bodden at mail.mcgill.ca
Wed Apr 30 11:56:30 EDT 2008


Hi all.

I am confused about the current status of the Jasmin version we are
using. First of all, am I right that the Jasmin version that Soot uses
is a *customized* version of what's offered at
http://jasmin.sourceforge.net/? Looking at the SVN repository it looks
like Jennifer made some additions to incorporate annotations into
Jasmin, but to me it seems that either the grammar is incorrect or
that we are generating Jasmin code in the wrong format.

Currently, when I compile the following code with Soot, this gives a
Jasmin parser error:

@Retention(RetentionPolicy.RUNTIME)
@interface BlahBlah {}

@Retention(RetentionPolicy.CLASS)
@interface AnotherAnnotation {}

@BlahBlah
@AnotherAnnotation
public class Annotated extends Object {
	public void foo() { }
}

This is because the parser cannot cope with both, runtime visible and
invisible annotations on a class declaration:

.source Annotated.java
.class public Annotated
.super java/lang/Object

.runtime_visible_annotation
.annotation "LBlahBlah;"
.end .annotation
.end .annotation_attr

.runtime_invisible_annotation  <------ ERROR HERE
.annotation "LAnotherAnnotation;"
.end .annotation
.end .annotation_attr

.method public foo()V
...

In cases where such annotations exists on *methods*, only the last one
seems to be preserved. So I wonder what we are doing wrong? Is the
parser wrong or whether we are generating invalid Jasmin in the first
place. Is the "customized" jasmin format defined anywhere?

Eric

-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list