[Soot-list] Jasmin grammar

Ondrej Lhotak olhotak at uwaterloo.ca
Wed Apr 30 14:07:44 EDT 2008


On Wed, Apr 30, 2008 at 11:56:30AM -0400, Eric Bodden wrote:
> 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/?

No.

My recollection of the history of Jasmin is as follows. When Soot
started, it used Jasmin and extended it to allow attributes to be
communicated to VMs (see the work on aray bounds check attributes). At
the time, Soot tracked Jasmin development. New versions of Jasmin were
imported into Soot and the extensions were reapplied to them. Around
2000 or 2001, Jasmin development was abandoned by its original authors.
Thus, for several years, the Soot version of Jasmin was the only version
of Jasmin being maintained, and the Sourceforge version was dead. When
development of Java 5 support for Soot began, the Soot version of Jasmin
with attributes was extended to support annotations (very similar to
attributes). Shortly thereafter, somebody picked up the previously
abandoned Jasmin codebase on Sourceforge, and started maintaining it and
extending it to support annotations. Thus, the annotation support in the
Soot Jasmin is unlikely to be compatible with the independently designed
annotation support in the revived Sourceforge Jasmin, because the
designers of the latter were not aware of the Soot version of Jasmin.

> 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
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> 


More information about the Soot-list mailing list