From 34a4a30e34bb156304b79af1cd649cf377d0ac81 Mon Sep 17 00:00:00 2001 From: "JesusFreke@JesusFreke.com" Date: Mon, 8 Jun 2009 01:24:40 +0000 Subject: [PATCH] misc TODO review/cleanup git-svn-id: https://smali.googlecode.com/svn/trunk@130 55b6fa8a-2a1e-11de-a435-ffa8d773f76a --- src/main/antlr3/org/JesusFreke/smali/smaliLexer.g | 4 +--- src/main/antlr3/org/JesusFreke/smali/smaliParser.g | 6 ++---- src/main/antlr3/org/JesusFreke/smali/smaliTreeWalker.g | 1 - 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/antlr3/org/JesusFreke/smali/smaliLexer.g b/src/main/antlr3/org/JesusFreke/smali/smaliLexer.g index b311db2d..1fea9304 100644 --- a/src/main/antlr3/org/JesusFreke/smali/smaliLexer.g +++ b/src/main/antlr3/org/JesusFreke/smali/smaliLexer.g @@ -923,9 +923,7 @@ fragment TYPE_FIELD_METHOD_LITERAL_EMITCHILDREN MEMBER_NAME_EMIT ( METHOD_PROTOTYPE_EMITCHILDREN | COLON_EMIT NONVOID_TYPE_DESCRIPTOR_EMITCHILD))? - //TODO: allow void and primitive type here? - | PRIMITIVE_TYPE_EMIT - | VOID_TYPE_EMIT; + | PRIMITIVE_TYPE_EMIT; fragment ENUM_EMIT : ENUM {emit($ENUM, ENUM);}; diff --git a/src/main/antlr3/org/JesusFreke/smali/smaliParser.g b/src/main/antlr3/org/JesusFreke/smali/smaliParser.g index 62e84914..74af65b7 100644 --- a/src/main/antlr3/org/JesusFreke/smali/smaliParser.g +++ b/src/main/antlr3/org/JesusFreke/smali/smaliParser.g @@ -176,13 +176,11 @@ smali_file EOF { if (!$smali_file::hasClassSpec) { - //TODO: throw correct exception type - throw new RuntimeException("The file must contain a .class directive"); + throw new SemanticException(input, "The file must contain a .class directive"); } if (!$smali_file::hasSuperSpec) { - //TODO: throw correct exception type - throw new RuntimeException("The file must contain a .super directive"); + throw new SemanticException(input, "The file must contain a .super directive"); } } -> ^(I_CLASS_DEF diff --git a/src/main/antlr3/org/JesusFreke/smali/smaliTreeWalker.g b/src/main/antlr3/org/JesusFreke/smali/smaliTreeWalker.g index 853cb53e..654f9d90 100644 --- a/src/main/antlr3/org/JesusFreke/smali/smaliTreeWalker.g +++ b/src/main/antlr3/org/JesusFreke/smali/smaliTreeWalker.g @@ -1061,7 +1061,6 @@ register_list[int totalMethodRegisters, int methodParameterRegisters] returns[by : ^(I_REGISTER_LIST (REGISTER { - //TODO: shouldn't this be == 6? if ($registerCount == 5) { throw new SemanticException(input, "A list of registers can only have a maximum of 5 registers. Use the /range alternate opcode instead."); }