Skip to content

Commit

Permalink
Merge remote-tracking branch 'luca-saggese/2.x' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Jul 15, 2024
2 parents 8e13540 + 7ee7bbd commit 41ba4db
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions d2j-jasmin/src/main/antlr3/com/googlecode/d2j/jasmin/Jasmin.g
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ OP0 : 'nop'|'monitorenter'|'monitorexit'|'pop2'|'pop'
|'aconst_null'
|('a'|'d'|'f'|'i'|'l')? 'return'
|('a'|'d'|'f'|'i'|'l') ('store'|'load') '_' ('0'..'3')
|('a'|'b'|'c'|'d'|'f'|'i'|'l') ('astore'|'aload')
|('a'|'b'|'c'|'d'|'f'|'i'|'l'|'s') ('astore'|'aload')
|'dcmpg'|'dcmpl' | 'lcmp' |'fcmpg'|'fcmpl'
|'athrow'
|('i'|'f'|'d'|'l')('add'|'div'|'sub'|'mul'|'rem'|'shl'|'shr'|'ushr'|'and'|'or'|'xor'|'neg')
Expand Down Expand Up @@ -968,12 +968,31 @@ sHead : '.bytecode' ( a=INT { int v=parseInt($a.text); cn.version=JAVA_VERSIO
| '.interface' i=sAccList {cn.access|=ACC_INTERFACE|$i.acc;} a1=sInternalNameOrDesc { cn.name=Type.getType($a1.desc).getInternalName(); }
| '.super' a1=sInternalNameOrDescACC { cn.superName=Type.getType($a1.desc).getInternalName(); }
| '.implements' a1=sInternalNameOrDescACC { if(cn.interfaces==null){cn.interfaces=new ArrayList<>();} cn.interfaces.add(Type.getType($a1.desc).getInternalName()); }
| '.enclosing method' ownerAndName=sOwnerAndName {tmp=null;} (b=sMethodDesc{tmp=$b.text;})? {cn.visitOuterClass($ownerAndName.ownerInternalName,$ownerAndName.memberName,tmp);}
| '.enclosing method' ownerAndName=sOwnerAndName {tmp="";} (b=sMethodDesc{tmp=$b.text;})? {cn.visitOuterClass($ownerAndName.ownerInternalName,$ownerAndName.memberName,tmp);}
| sDeprecateAttr { cn.access|=ACC_DEPRECATED; }
| '.debug' a=STRING { cn.sourceDebug=unEscapeString($a.text); }
| '.attribute' sId STRING { System.err.println("ignore .attribute"); }
| '.inner class' (i=sAccList sId{tmpInt=$i.acc;})? {tmp=null;tmp2=null;} ('inner' a3=sId{tmp=$a3.text;})? ('outer' a4=sId{tmp2=$a4.text;})? { cn.visitInnerClass(null,tmp2,tmp,tmpInt); }
| '.no_super' {cn.superName=null;}
| '.inner class'
{String name = null; String outerName = null; String innerName = null; int access = 0;}
// Access and internal class name specification (optional)
(i=sAccList { access = $i.acc; })
(id1=sId { innerName = $id1.text; })?
{tmp=null; tmp2=null;}
// Inner class name with 'inner' (optional)
('inner' id2=sId { tmp = $id2.text; name = $id2.text; })?
// Outer class name with 'outer' (optional)
('outer' id3=sId { tmp2 = $id3.text; outerName = $id3.text; })?
{
if (name == null) {
name = outerName + "$" + innerName;
}
if (innerName == null) {
innerName = "";
}
cn.visitInnerClass(name, outerName, innerName, access);
}

| '.no_super' {cn.superName=null;}
| '.class_attribute' sId STRING { System.err.println("ignore .class_attribute"); }
| '.enclosing_method_attr' a=STRING b1=STRING c=STRING {cn.visitOuterClass($a.text,$b1.text,$c.text);}
| '.inner_class_attr' ('.inner_class_spec_attr' a=STRING b2=STRING i=sAccList '.end' '.inner_class_spec_attr' { cn.visitInnerClass(null,unEscape($a.text),unEscape($b2.text),i); } )* '.end' '.inner_class_attr'
Expand Down

0 comments on commit 41ba4db

Please sign in to comment.