Is there any grammar specification available for smali code ? I am trying to play around with the smali code and one of the things that is missing me is the fact that some methods in smali have the .prologue section and some don't. Unfortunately the wiki doesn't seem to have information about smali grammar. Has anyone found yourself in this situation before ? Any suggestions/solutions would be much appreciated.
EDIT1: My objective is to add log messages to the beginning of onResume method of all activities of an app.
EDIT2: I am using ANTLRv4.1 parser to parse my smali files and I get a CommonTree (the parse tree) and a TokenStream from the smaliLexer. Now is creating the Token for the log instruction and altering the parse tree and thereafter generating the classes.dex file the right way to go ? So far I havent found a way to alter the TokenStream and I am not able to generate dex files from the altered ParseTree.