[Soot-list] Problems with jimple parser

Eric Bodden eric.bodden at ec-spride.de
Mon Oct 1 18:20:35 EDT 2012


Hi Bernhard.

I wonder: What does javac do with package-info.java files? Does it
compile them to .class files at all? If not, then maybe Soot should
not even output those files in the first place. After all, those files
do not actually contain class definitions.

Eric

On 1 October 2012 10:22, Bernhard Berger <berber at tzi.de> wrote:
> Hi folks,
>
> I came across a problem in the Jimple parser when I loaded jimple files
> that were unparsed in a previous run of soot. In particular, there is a
> class called package-info in my code base that triggers the problem.
>
>> interface com.example.xml.package-info extends java.lang.Object
>> {
>> }
>
> The parser is not able to parse the file because of the - in the class
> name. The location of the parser error gives the hint that the - is not
> expected at this point.
>
>> Exception in thread "main" soot.jimple.parser.parser.ParserException:
>> [1,34] expecting: 'extends', 'implements', '{'
>> at soot.jimple.parser.parser.Parser.parse(Parser.java:1454)
>> at soot.jimple.parser.Parse.main(Parse.java:138)
>
> There are different solutions for this problem but I think the easiest
> one would be to surround the class name with quotes. Currently class
> names are just quoted if they are equally to one of jimple's keywords.
> Therefore, each class name is passed to Scene.quotedNameOf(). The
> easiest solution would be to quote every class name (this leads to
> larger jimple files). Does someone know a better solution? My first idea
> was to change the parser but I did not find an easy way to fix this
> problem.
>
> Bernhard
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list



-- 
Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list