darkguy2008 / smali2java

Direct smali to Java converter
20 stars 4 forks source link

Use regular expressions instead of substring & indexOf ? #4

Open darkguy2008 opened 10 years ago

darkguy2008 commented 10 years ago

Hey all.

I found this repo referenced in someone else's starred repos: https://github.com/tslater2006/Smali2JSkeleton and it has very interesting stuff, specifically SmaliClass.cs -> https://github.com/tslater2006/Smali2JSkeleton/blob/master/Smali2JSkeleton/Smali/SmaliClass.cs which contains (to my understanding) better parsing methods.

Could it be possible to take (with permission) some stuff from it? or ask him to help us? I assume regular expressions are easier to read in code than what we're using right now.

Any comments are welcome :P

FennyFatal commented 10 years ago

http://www.antlr.org/ <- this? It does have both a c# and Java target. This might greatly simplify our parsing code, while at the same time, the actual parsing code in ANTLR would be pretty portable if we ever wanted to start doing multi platform.

darkguy2008 commented 10 years ago

Nah, not like that. Look at the sample code I linked to. It uses a bit of C# regular expressions to do the job which aren't very hard IMHO.

Though the project you linked to looks pretty good I'd rather avoid using external libraries unless it is very, very needed. I think we can do it with normal C# regexps for now.