diff options
author | Miguel Garcia <miguelalfredo.garcia@epfl.ch> | 2012-05-08 13:33:06 +0200 |
---|---|---|
committer | Miguel Garcia <miguelalfredo.garcia@epfl.ch> | 2012-05-08 13:33:06 +0200 |
commit | f9943432a6ce13c770927c4ffc184887daa101f2 (patch) | |
tree | b2ca0794daf6bccea57e3ba608eeb807aa02e2a0 | |
parent | df4df0ada2918e9d5a3df5917765810239acdf4b (diff) | |
download | scala-f9943432a6ce13c770927c4ffc184887daa101f2.tar.gz scala-f9943432a6ce13c770927c4ffc184887daa101f2.tar.bz2 scala-f9943432a6ce13c770927c4ffc184887daa101f2.zip |
glue ASM <-> GenASM, the only part of scala.tools.asm to maintain manually
-rw-r--r-- | src/compiler/scala/tools/asm/CustomAttr.java | 20 | ||||
-rw-r--r-- | src/compiler/scala/tools/asm/util/SignatureChecker.java | 47 |
2 files changed, 67 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/asm/CustomAttr.java b/src/compiler/scala/tools/asm/CustomAttr.java new file mode 100644 index 0000000000..5ecfd283d0 --- /dev/null +++ b/src/compiler/scala/tools/asm/CustomAttr.java @@ -0,0 +1,20 @@ +/* NSC -- new Scala compiler + * Copyright 2005-2012 LAMP/EPFL + */ + +package scala.tools.asm; + +import scala.tools.asm.Attribute; + +/** + * A subclass of ASM's Attribute for the sole purpose of accessing a protected field there. + * + */ +public class CustomAttr extends Attribute { + + public CustomAttr(final String type, final byte[] value) { + super(type); + super.value = value; + } + +} diff --git a/src/compiler/scala/tools/asm/util/SignatureChecker.java b/src/compiler/scala/tools/asm/util/SignatureChecker.java new file mode 100644 index 0000000000..7b7eea4383 --- /dev/null +++ b/src/compiler/scala/tools/asm/util/SignatureChecker.java @@ -0,0 +1,47 @@ +/* NSC -- new Scala compiler + * Copyright 2005-2012 LAMP/EPFL + */ + +package scala.tools.asm.util; + +import scala.tools.asm.util.CheckMethodAdapter; +import scala.tools.asm.MethodVisitor; + +/** + * A subclass of ASM's CheckMethodAdapter for the sole purpose of accessing some protected methods there. + * + */ +public class SignatureChecker extends CheckMethodAdapter { + + public SignatureChecker(final MethodVisitor mv) { + super(mv); + } + + /** + * Checks a class signature. + * + * @param signature a string containing the signature that must be checked. + */ + public static void checkClassSignature(final String signature) { + CheckMethodAdapter.checkClassSignature(signature); + } + + /** + * Checks a method signature. + * + * @param signature a string containing the signature that must be checked. + */ + public static void checkMethodSignature(final String signature) { + CheckMethodAdapter.checkMethodSignature(signature); + } + + /** + * Checks a field signature. + * + * @param signature a string containing the signature that must be checked. + */ + public static void checkFieldSignature(final String signature) { + CheckMethodAdapter.checkFieldSignature(signature); + } + +} |