948 Commits

Author SHA1 Message Date
JesusFreke@JesusFreke.com
52ff693c8f Check for lexer errors
git-svn-id: https://smali.googlecode.com/svn/trunk@753 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:34:09 +00:00
JesusFreke@JesusFreke.com
1fd0276b78 Fix an issue parsing arrays of primitive types when parsing param lists
git-svn-id: https://smali.googlecode.com/svn/trunk@752 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:34:00 +00:00
JesusFreke@JesusFreke.com
f65966da4f Add a (somewhat) real smali file as a lexer test
git-svn-id: https://smali.googlecode.com/svn/trunk@751 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:33:52 +00:00
JesusFreke@JesusFreke.com
22532f9dd9 Don't print the expected/actual tokens during the lexer tests
git-svn-id: https://smali.googlecode.com/svn/trunk@750 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:33:47 +00:00
JesusFreke@JesusFreke.com
2c69ece4a5 Add the remaining lexer tests
git-svn-id: https://smali.googlecode.com/svn/trunk@749 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:33:35 +00:00
JesusFreke@JesusFreke.com
b873c047f0 Simply the line comment rule, so that it doesn't include the newline at the end of the line
git-svn-id: https://smali.googlecode.com/svn/trunk@748 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:33:28 +00:00
JesusFreke@JesusFreke.com
35bfbe82f0 Don't allow strings or chars to span newlines
git-svn-id: https://smali.googlecode.com/svn/trunk@747 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:33:23 +00:00
JesusFreke@JesusFreke.com
b9f0c569ea Add better support for invalid strings and chars
git-svn-id: https://smali.googlecode.com/svn/trunk@746 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:33:16 +00:00
JesusFreke@JesusFreke.com
8136408a58 Add support for numbers in the token names, for the lexer/parser for the token specification grammar for the lexer tests
git-svn-id: https://smali.googlecode.com/svn/trunk@745 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:33:11 +00:00
JesusFreke@JesusFreke.com
9f2671f5ff Add a framework for lexer tests, plus a preliminary (incomplete) set of tests
git-svn-id: https://smali.googlecode.com/svn/trunk@744 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:33:00 +00:00
JesusFreke@JesusFreke.com
4c872e9a7c Add new jflex based lexer, that uses significantly less static memory (the ANTLR lexer used around 30mb in static data)
git-svn-id: https://smali.googlecode.com/svn/trunk@743 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:32:50 +00:00
JesusFreke@JesusFreke.com
04c02b038b Fix-up some test in LongLiteralTest
git-svn-id: https://smali.googlecode.com/svn/trunk@742 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:32:43 +00:00
JesusFreke@JesusFreke.com
be6afd1812 Add tests for a negitave hex numbers with an alpha (a-f) digit
git-svn-id: https://smali.googlecode.com/svn/trunk@741 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:32:36 +00:00
JesusFreke@JesusFreke.com
4ccbb4e8bd Rename the ENUM token to ENUM_DIRECTIVE
git-svn-id: https://smali.googlecode.com/svn/trunk@740 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:32:30 +00:00
JesusFreke@JesusFreke.com
58b9ba9e08 Whitespace changes
git-svn-id: https://smali.googlecode.com/svn/trunk@739 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-13 20:32:24 +00:00
JesusFreke@JesusFreke.com
e01409c11f Change the way unresolvable odex instructions are handled, so that it doesn't cause problems with try/catch blocks
git-svn-id: https://smali.googlecode.com/svn/trunk@737 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-12 15:55:44 +00:00
JesusFreke@JesusFreke.com
f7344d33d0 Split the logic for generating the instruction method items depending on whether we need to use the MethodAnalyzer or not
git-svn-id: https://smali.googlecode.com/svn/trunk@736 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-12 15:55:36 +00:00
JesusFreke@JesusFreke.com
41265daa5a Fix a NPE when looking up a non-existant method
git-svn-id: https://smali.googlecode.com/svn/trunk@732 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-10 01:49:26 +00:00
JesusFreke@JesusFreke.com
76f566a55b Use the /range instructions when deodexing an execute-inline/range instruction
git-svn-id: https://smali.googlecode.com/svn/trunk@731 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-10 01:43:18 +00:00
JesusFreke@JesusFreke.com
2880e1c625 Add the inline method table for froyo's dalvik
git-svn-id: https://smali.googlecode.com/svn/trunk@726 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-09 01:45:27 +00:00
JesusFreke@JesusFreke.com
14348d570e Add support for the new dey36 odex header
git-svn-id: https://smali.googlecode.com/svn/trunk@725 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-06-09 01:45:14 +00:00
JesusFreke@JesusFreke.com
48a8e040a1 Get rid of the unneeded getNumberOfLexerErrors() method in the lexer
git-svn-id: https://smali.googlecode.com/svn/trunk@724 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-18 19:33:16 +00:00
JesusFreke@JesusFreke.com
86df593d85 Don't generate verbose parser errors by default, but add a smali parameter to enable them
git-svn-id: https://smali.googlecode.com/svn/trunk@723 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-18 19:33:12 +00:00
JesusFreke@JesusFreke.com
9f69ec12ea Fix an NPE when generating the error message for the case of multiple .locals or .registers directives in a method
git-svn-id: https://smali.googlecode.com/svn/trunk@722 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-18 19:33:07 +00:00
JesusFreke@JesusFreke.com
af7330e5d5 Minor tweak to BASE_FLOAT_OR_ID
git-svn-id: https://smali.googlecode.com/svn/trunk@721 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-18 19:33:03 +00:00
JesusFreke@JesusFreke.com
cafef597c9 Move the totalMethodRegisters calculation back up to when the rule is matched, because the value is needed for subsequent rules
git-svn-id: https://smali.googlecode.com/svn/trunk@720 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-18 19:32:59 +00:00
JesusFreke@JesusFreke.com
4d9801a89d Various tweaks to improve error handling
git-svn-id: https://smali.googlecode.com/svn/trunk@719 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-18 05:04:03 +00:00
JesusFreke@JesusFreke.com
4c114f0918 Refactor the parameter directive rule, so that it doesn't use a syntactic predicate
git-svn-id: https://smali.googlecode.com/svn/trunk@718 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-18 05:03:58 +00:00
JesusFreke@JesusFreke.com
fd997c84b6 Refactor the registers directive related rules
git-svn-id: https://smali.googlecode.com/svn/trunk@717 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-18 05:03:38 +00:00
JesusFreke@JesusFreke.com
4fb7679be9 Refactor the rules related to the .parameter directive, so that it doesn't use syntactic predicates
git-svn-id: https://smali.googlecode.com/svn/trunk@716 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:56 +00:00
JesusFreke@JesusFreke.com
368a8faed9 Call a method to throw the OdexedInstructionException, instead of throwing the exception itself
This prevents java from complaining about unreachable code after the throw statement

git-svn-id: https://smali.googlecode.com/svn/trunk@715 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:52 +00:00
JesusFreke@JesusFreke.com
cda416b795 Sort the annotations in an AnnotationSetItem based on the TypeIdItem index
git-svn-id: https://smali.googlecode.com/svn/trunk@714 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:48 +00:00
JesusFreke@JesusFreke.com
f2370e3a2e Add tests for the various types of annotations
git-svn-id: https://smali.googlecode.com/svn/trunk@713 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:43 +00:00
JesusFreke@JesusFreke.com
ec643e6520 Use the SIMPLE_NAME token for label names, instead of creating a new LABEL token
git-svn-id: https://smali.googlecode.com/svn/trunk@712 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:39 +00:00
JesusFreke@JesusFreke.com
28a614553b Use the simple_name rule instead of matching SIMPLE_NAME in the local_directive rule
git-svn-id: https://smali.googlecode.com/svn/trunk@711 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:35 +00:00
JesusFreke@JesusFreke.com
10b9349716 Use method_name instead of simple_name for the method branch of the type_field_method_literal rule
git-svn-id: https://smali.googlecode.com/svn/trunk@710 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:30 +00:00
JesusFreke@JesusFreke.com
fbea4e751f Cleaned up imports
git-svn-id: https://smali.googlecode.com/svn/trunk@709 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:26:08 +00:00
JesusFreke@JesusFreke.com
6b3647e984 Cleaned up imports
git-svn-id: https://smali.googlecode.com/svn/trunk@708 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:26:01 +00:00
JesusFreke@JesusFreke.com
2feb05f645 Rewrite smali's lexer, and modify the parser and tree walker accordingly
The lexer is now much more like a normal lexer, instead of having the long multi-token rules

git-svn-id: https://smali.googlecode.com/svn/trunk@707 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:25:57 +00:00
JesusFreke@JesusFreke.com
3e4c1193cf Update dump option to use -D instead of -d
git-svn-id: https://smali.googlecode.com/svn/trunk@706 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:25:54 +00:00
JesusFreke@JesusFreke.com
6a7f2e2d24 Move to ANTLR v3.2
git-svn-id: https://smali.googlecode.com/svn/trunk@705 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:25:47 +00:00
JesusFreke@JesusFreke.com
b3abca4c90 cleaned up imports
git-svn-id: https://smali.googlecode.com/svn/trunk@704 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:25:29 +00:00
JesusFreke@JesusFreke.com
cf01189c7f Update version to 1.2.3
git-svn-id: https://smali.googlecode.com/svn/trunk@703 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:25:24 +00:00
JesusFreke@JesusFreke.com
2371e35aae Exit on the first error by default, but add the -I option for ignoring errors and continuing with disassembly
git-svn-id: https://smali.googlecode.com/svn/trunk@701 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:03:25 +00:00
JesusFreke@JesusFreke.com
0808ee81c6 use Array.clone instead of Arrays.copyOf, to be compliant with java 5
git-svn-id: https://smali.googlecode.com/svn/trunk@700 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:03:17 +00:00
JesusFreke@JesusFreke.com
bde73b303c minor changes to option usage info
git-svn-id: https://smali.googlecode.com/svn/trunk@699 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:03:13 +00:00
JesusFreke@JesusFreke.com
db806b1261 minor reformatting - reorder the options
git-svn-id: https://smali.googlecode.com/svn/trunk@698 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:03:09 +00:00
JesusFreke@JesusFreke.com
c6734e8a60 Fix a typo in the commented out format for a packed-switch structure
git-svn-id: https://smali.googlecode.com/svn/trunk@697 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:03:06 +00:00
JesusFreke@JesusFreke.com
d293bc1eb3 Always read and write files using UTF8
git-svn-id: https://smali.googlecode.com/svn/trunk@696 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:03:01 +00:00
JesusFreke@JesusFreke.com
51cf2f54d5 Add support in smali for the invoke-direct-quick opcode
git-svn-id: https://smali.googlecode.com/svn/trunk@695 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:02:56 +00:00