smali2java icon indicating copy to clipboard operation
smali2java copied to clipboard

Use regular expressions instead of substring & indexOf ?

Open darkguy2008 opened this issue 11 years ago • 2 comments

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

darkguy2008 avatar Jan 04 '14 22:01 darkguy2008

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.

FennyFatal avatar Jan 06 '14 07:01 FennyFatal

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.

darkguy2008 avatar Jan 06 '14 12:01 darkguy2008