[Soot-list] "grammar" for generated Jimple?

Richard L. Halpert richardlhalpert at gmail.com
Mon Jun 19 01:14:59 EDT 2006


Dave,
I believe the parser grammar (soot-dev/src/jimple.scc) is in fact the only
official specification.  You might gain some insight by reading the attached
paper from the Sable website (Raja Vallee-Rai and Laurie J. Hendren, "Jimple:
Simplifying Java Bytecode for Analyses and Transformations."  July 1998).
Otherwise, you could look at the source for creating jimple, in
src/soot/javaToJimple/.

Note this bullet point from the paper:
 - Expressions are restricted to the least number of operands (2 in most
cases, such as for arithmetic expressions, but possibly more for some method
calls), and these operands must either be constants or locals.

Hence the lack of statements such as a.b = c.d, which must be instead
performed by first loading c.d into a local, then assigning it into a.b.

-Rich
Sable Lab, McGill University

On 6/18/06, David Glasser <glasser at mit.edu> wrote:
>
> Is there any sort of "grammar" for Jimple (or Shimple) that is
> generated by Soot? I don't mean for parsing files; I merely mean what
> sorts of Stmts and Exprs it will make. I am working on an analysis
> tool that operates on Shimple, and it would be nice to know what sorts
> of special cases I need to deal with. For example, I've never seen it
> generate
>
>   a.b = c.d
>
> but only
>
>   x = c.d
>   a.b = x
>
> Is there anywhere I can look that will let me conclude with confidence
> that my analysis won't need to deal with the former sort of Stmt?
>
> --dave
>
> --
> David Glasser | glasser at mit.edu | http://www.davidglasser.net/
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20060619/d49d5d2e/attachment.htm


More information about the Soot-list mailing list