diff --git a/smali/src/main/antlr3/org/jf/smali/smaliParser.g b/smali/src/main/antlr3/org/jf/smali/smaliParser.g index 1ce5a7bd..67d71658 100644 --- a/smali/src/main/antlr3/org/jf/smali/smaliParser.g +++ b/smali/src/main/antlr3/org/jf/smali/smaliParser.g @@ -489,10 +489,10 @@ fully_qualified_field -> reference_type_descriptor simple_name nonvoid_type_descriptor; label - : COLON SIMPLE_NAME -> ^(I_LABEL LABEL[$SIMPLE_NAME] I_ADDRESS[$start, Integer.toString($method::currentAddress)]); + : COLON simple_name -> ^(I_LABEL simple_name I_ADDRESS[$start, Integer.toString($method::currentAddress)]); label_ref_or_offset - : COLON SIMPLE_NAME -> LABEL[$SIMPLE_NAME] + : COLON simple_name -> simple_name | OFFSET | NEGATIVE_INTEGER_LITERAL -> OFFSET[$NEGATIVE_INTEGER_LITERAL]; diff --git a/smali/src/main/antlr3/org/jf/smali/smaliTreeWalker.g b/smali/src/main/antlr3/org/jf/smali/smaliTreeWalker.g index c1cdda5a..c013b822 100644 --- a/smali/src/main/antlr3/org/jf/smali/smaliTreeWalker.g +++ b/smali/src/main/antlr3/org/jf/smali/smaliTreeWalker.g @@ -625,14 +625,14 @@ labels : ^(I_LABELS label_def*); label_def - : ^(I_LABEL LABEL address) + : ^(I_LABEL SIMPLE_NAME address) { - if ($method::labels.containsKey($LABEL.text)) { - throw new SemanticException(input, "Label " + $LABEL.text + " has multiple defintions."); + if ($method::labels.containsKey($SIMPLE_NAME.text)) { + throw new SemanticException(input, "Label " + $SIMPLE_NAME.text + " has multiple defintions."); } - $method::labels.put($LABEL.text, $address.address); + $method::labels.put($SIMPLE_NAME.text, $address.address); }; packed_switch_declarations @@ -806,12 +806,12 @@ statements[int totalMethodRegisters, int methodParameterRegisters] returns[List< })*); label_ref returns[int labelAddress] - : LABEL + : SIMPLE_NAME { - Integer labelAdd = $method::labels.get($LABEL.text); + Integer labelAdd = $method::labels.get($SIMPLE_NAME.text); if (labelAdd == null) { - throw new SemanticException(input, "Label \"" + $LABEL.text + "\" is not defined."); + throw new SemanticException(input, "Label \"" + $SIMPLE_NAME.text + "\" is not defined."); } $labelAddress = labelAdd;