Permalink
Browse files

subset of the ASM framework, re-namespaced as scala.tools.asm

  • Loading branch information...
magarciaEPFL committed May 8, 2012
1 parent 07546bd commit df4df0ada2918e9d5a3df5917765810239acdf4b
Showing with 27,954 additions and 0 deletions.
  1. +157 −0 src/compiler/scala/tools/asm/AnnotationVisitor.java
  2. +322 −0 src/compiler/scala/tools/asm/AnnotationWriter.java
  3. +254 −0 src/compiler/scala/tools/asm/Attribute.java
  4. +293 −0 src/compiler/scala/tools/asm/ByteVector.java
  5. +2,216 −0 src/compiler/scala/tools/asm/ClassReader.java
  6. +277 −0 src/compiler/scala/tools/asm/ClassVisitor.java
  7. +1,672 −0 src/compiler/scala/tools/asm/ClassWriter.java
  8. +75 −0 src/compiler/scala/tools/asm/Edge.java
  9. +115 −0 src/compiler/scala/tools/asm/FieldVisitor.java
  10. +271 −0 src/compiler/scala/tools/asm/FieldWriter.java
  11. +1,435 −0 src/compiler/scala/tools/asm/Frame.java
  12. +159 −0 src/compiler/scala/tools/asm/Handle.java
  13. +118 −0 src/compiler/scala/tools/asm/Handler.java
  14. +297 −0 src/compiler/scala/tools/asm/Item.java
  15. +555 −0 src/compiler/scala/tools/asm/Label.java
  16. +588 −0 src/compiler/scala/tools/asm/MethodVisitor.java
  17. +2,666 −0 src/compiler/scala/tools/asm/MethodWriter.java
  18. +358 −0 src/compiler/scala/tools/asm/Opcodes.java
  19. +865 −0 src/compiler/scala/tools/asm/Type.java
  20. +229 −0 src/compiler/scala/tools/asm/signature/SignatureReader.java
  21. +228 −0 src/compiler/scala/tools/asm/signature/SignatureVisitor.java
  22. +227 −0 src/compiler/scala/tools/asm/signature/SignatureWriter.java
  23. +238 −0 src/compiler/scala/tools/asm/tree/AbstractInsnNode.java
  24. +224 −0 src/compiler/scala/tools/asm/tree/AnnotationNode.java
  25. +371 −0 src/compiler/scala/tools/asm/tree/ClassNode.java
  26. +106 −0 src/compiler/scala/tools/asm/tree/FieldInsnNode.java
  27. +243 −0 src/compiler/scala/tools/asm/tree/FieldNode.java
  28. +211 −0 src/compiler/scala/tools/asm/tree/FrameNode.java
  29. +80 −0 src/compiler/scala/tools/asm/tree/IincInsnNode.java
  30. +101 −0 src/compiler/scala/tools/asm/tree/InnerClassNode.java
  31. +578 −0 src/compiler/scala/tools/asm/tree/InsnList.java
  32. +84 −0 src/compiler/scala/tools/asm/tree/InsnNode.java
  33. +84 −0 src/compiler/scala/tools/asm/tree/IntInsnNode.java
  34. +100 −0 src/compiler/scala/tools/asm/tree/InvokeDynamicInsnNode.java
  35. +92 −0 src/compiler/scala/tools/asm/tree/JumpInsnNode.java
  36. +78 −0 src/compiler/scala/tools/asm/tree/LabelNode.java
  37. +77 −0 src/compiler/scala/tools/asm/tree/LdcInsnNode.java
  38. +82 −0 src/compiler/scala/tools/asm/tree/LineNumberNode.java
  39. +115 −0 src/compiler/scala/tools/asm/tree/LocalVariableNode.java
  40. +116 −0 src/compiler/scala/tools/asm/tree/LookupSwitchInsnNode.java
  41. +107 −0 src/compiler/scala/tools/asm/tree/MethodInsnNode.java
  42. +645 −0 src/compiler/scala/tools/asm/tree/MethodNode.java
  43. +81 −0 src/compiler/scala/tools/asm/tree/MultiANewArrayInsnNode.java
  44. +115 −0 src/compiler/scala/tools/asm/tree/TableSwitchInsnNode.java
  45. +94 −0 src/compiler/scala/tools/asm/tree/TryCatchBlockNode.java
  46. +87 −0 src/compiler/scala/tools/asm/tree/TypeInsnNode.java
  47. +90 −0 src/compiler/scala/tools/asm/tree/VarInsnNode.java
  48. +549 −0 src/compiler/scala/tools/asm/tree/analysis/Analyzer.java
  49. +64 −0 src/compiler/scala/tools/asm/tree/analysis/AnalyzerException.java
  50. +365 −0 src/compiler/scala/tools/asm/tree/analysis/BasicInterpreter.java
  51. +108 −0 src/compiler/scala/tools/asm/tree/analysis/BasicValue.java
  52. +459 −0 src/compiler/scala/tools/asm/tree/analysis/BasicVerifier.java
  53. +709 −0 src/compiler/scala/tools/asm/tree/analysis/Frame.java
  54. +204 −0 src/compiler/scala/tools/asm/tree/analysis/Interpreter.java
  55. +329 −0 src/compiler/scala/tools/asm/tree/analysis/SimpleVerifier.java
  56. +134 −0 src/compiler/scala/tools/asm/tree/analysis/SmallSet.java
  57. +206 −0 src/compiler/scala/tools/asm/tree/analysis/SourceInterpreter.java
  58. +97 −0 src/compiler/scala/tools/asm/tree/analysis/SourceValue.java
  59. +93 −0 src/compiler/scala/tools/asm/tree/analysis/Subroutine.java
  60. +45 −0 src/compiler/scala/tools/asm/tree/analysis/Value.java
  61. +53 −0 src/compiler/scala/tools/asm/util/ASMifiable.java
  62. +1,238 −0 src/compiler/scala/tools/asm/util/ASMifier.java
  63. +142 −0 src/compiler/scala/tools/asm/util/CheckAnnotationAdapter.java
  64. +603 −0 src/compiler/scala/tools/asm/util/CheckClassAdapter.java
  65. +97 −0 src/compiler/scala/tools/asm/util/CheckFieldAdapter.java
  66. +1,668 −0 src/compiler/scala/tools/asm/util/CheckMethodAdapter.java
  67. +329 −0 src/compiler/scala/tools/asm/util/CheckSignatureAdapter.java
  68. +558 −0 src/compiler/scala/tools/asm/util/Printer.java
  69. +54 −0 src/compiler/scala/tools/asm/util/Textifiable.java
  70. +1,286 −0 src/compiler/scala/tools/asm/util/Textifier.java
  71. +96 −0 src/compiler/scala/tools/asm/util/TraceAnnotationVisitor.java
  72. +232 −0 src/compiler/scala/tools/asm/util/TraceClassVisitor.java
  73. +78 −0 src/compiler/scala/tools/asm/util/TraceFieldVisitor.java
  74. +264 −0 src/compiler/scala/tools/asm/util/TraceMethodVisitor.java
  75. +318 −0 src/compiler/scala/tools/asm/util/TraceSignatureVisitor.java
@@ -0,0 +1,157 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
* Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
package scala.tools.asm;
/**
* A visitor to visit a Java annotation. The methods of this class must be
* called in the following order: ( <tt>visit</tt> | <tt>visitEnum</tt> |
* <tt>visitAnnotation</tt> | <tt>visitArray</tt> )* <tt>visitEnd</tt>.
*
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
public abstract class AnnotationVisitor {
/**
* The ASM API version implemented by this visitor. The value of this field
* must be one of {@link Opcodes#ASM4}.
*/
protected final int api;
/**
* The annotation visitor to which this visitor must delegate method calls.
* May be null.
*/
protected AnnotationVisitor av;
/**
* Constructs a new {@link AnnotationVisitor}.
*
* @param api the ASM API version implemented by this visitor. Must be one
* of {@link Opcodes#ASM4}.
*/
public AnnotationVisitor(final int api) {
this(api, null);
}
/**
* Constructs a new {@link AnnotationVisitor}.
*
* @param api the ASM API version implemented by this visitor. Must be one
* of {@link Opcodes#ASM4}.
* @param av the annotation visitor to which this visitor must delegate
* method calls. May be null.
*/
public AnnotationVisitor(final int api, final AnnotationVisitor av) {
/*if (api != Opcodes.ASM4) {
throw new IllegalArgumentException();
}*/
this.api = api;
this.av = av;
}
/**
* Visits a primitive value of the annotation.
*
* @param name the value name.
* @param value the actual value, whose type must be {@link Byte},
* {@link Boolean}, {@link Character}, {@link Short}, {@link Integer}
* , {@link Long}, {@link Float}, {@link Double}, {@link String} or
* {@link Type} or OBJECT or ARRAY sort. This value can also be an
* array of byte, boolean, short, char, int, long, float or double
* values (this is equivalent to using {@link #visitArray visitArray}
* and visiting each array element in turn, but is more convenient).
*/
public void visit(String name, Object value) {
if (av != null) {
av.visit(name, value);
}
}
/**
* Visits an enumeration value of the annotation.
*
* @param name the value name.
* @param desc the class descriptor of the enumeration class.
* @param value the actual enumeration value.
*/
public void visitEnum(String name, String desc, String value) {
if (av != null) {
av.visitEnum(name, desc, value);
}
}
/**
* Visits a nested annotation value of the annotation.
*
* @param name the value name.
* @param desc the class descriptor of the nested annotation class.
* @return a visitor to visit the actual nested annotation value, or
* <tt>null</tt> if this visitor is not interested in visiting
* this nested annotation. <i>The nested annotation value must be
* fully visited before calling other methods on this annotation
* visitor</i>.
*/
public AnnotationVisitor visitAnnotation(String name, String desc) {
if (av != null) {
return av.visitAnnotation(name, desc);
}
return null;
}
/**
* Visits an array value of the annotation. Note that arrays of primitive
* types (such as byte, boolean, short, char, int, long, float or double)
* can be passed as value to {@link #visit visit}. This is what
* {@link ClassReader} does.
*
* @param name the value name.
* @return a visitor to visit the actual array value elements, or
* <tt>null</tt> if this visitor is not interested in visiting
* these values. The 'name' parameters passed to the methods of this
* visitor are ignored. <i>All the array values must be visited
* before calling other methods on this annotation visitor</i>.
*/
public AnnotationVisitor visitArray(String name) {
if (av != null) {
return av.visitArray(name);
}
return null;
}
/**
* Visits the end of the annotation.
*/
public void visitEnd() {
if (av != null) {
av.visitEnd();
}
}
}
Oops, something went wrong.

0 comments on commit df4df0a

Please sign in to comment.