Mercurial > lasercutter
diff src/clojure/asm/MethodAdapter.java @ 10:ef7dbbd6452c
added clojure source goodness
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 21 Aug 2010 06:25:44 -0400 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/clojure/asm/MethodAdapter.java Sat Aug 21 06:25:44 2010 -0400 1.3 @@ -0,0 +1,186 @@ 1.4 +/*** 1.5 + * ASM: a very small and fast Java bytecode manipulation framework 1.6 + * Copyright (c) 2000-2005 INRIA, France Telecom 1.7 + * All rights reserved. 1.8 + * 1.9 + * Redistribution and use in source and binary forms, with or without 1.10 + * modification, are permitted provided that the following conditions 1.11 + * are met: 1.12 + * 1. Redistributions of source code must retain the above copyright 1.13 + * notice, this list of conditions and the following disclaimer. 1.14 + * 2. Redistributions in binary form must reproduce the above copyright 1.15 + * notice, this list of conditions and the following disclaimer in the 1.16 + * documentation and/or other materials provided with the distribution. 1.17 + * 3. Neither the name of the copyright holders nor the names of its 1.18 + * contributors may be used to endorse or promote products derived from 1.19 + * this software without specific prior written permission. 1.20 + * 1.21 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 1.22 + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1.23 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1.24 + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 1.25 + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 1.26 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 1.27 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 1.28 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 1.29 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 1.30 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 1.31 + * THE POSSIBILITY OF SUCH DAMAGE. 1.32 + */ 1.33 +package clojure.asm; 1.34 + 1.35 +/** 1.36 + * An empty {@link MethodVisitor} that delegates to another 1.37 + * {@link MethodVisitor}. This class can be used as a super class to quickly 1.38 + * implement usefull method adapter classes, just by overriding the necessary 1.39 + * methods. 1.40 + * 1.41 + * @author Eric Bruneton 1.42 + */ 1.43 +public class MethodAdapter implements MethodVisitor{ 1.44 + 1.45 +/** 1.46 + * The {@link MethodVisitor} to which this adapter delegates calls. 1.47 + */ 1.48 +protected MethodVisitor mv; 1.49 + 1.50 +/** 1.51 + * Constructs a new {@link MethodAdapter} object. 1.52 + * 1.53 + * @param mv the code visitor to which this adapter must delegate calls. 1.54 + */ 1.55 +public MethodAdapter(final MethodVisitor mv){ 1.56 + this.mv = mv; 1.57 +} 1.58 + 1.59 +public AnnotationVisitor visitAnnotationDefault(){ 1.60 + return mv.visitAnnotationDefault(); 1.61 +} 1.62 + 1.63 +public AnnotationVisitor visitAnnotation( 1.64 + final String desc, 1.65 + final boolean visible){ 1.66 + return mv.visitAnnotation(desc, visible); 1.67 +} 1.68 + 1.69 +public AnnotationVisitor visitParameterAnnotation( 1.70 + final int parameter, 1.71 + final String desc, 1.72 + final boolean visible){ 1.73 + return mv.visitParameterAnnotation(parameter, desc, visible); 1.74 +} 1.75 + 1.76 +public void visitAttribute(final Attribute attr){ 1.77 + mv.visitAttribute(attr); 1.78 +} 1.79 + 1.80 +public void visitCode(){ 1.81 + mv.visitCode(); 1.82 +} 1.83 + 1.84 +public void visitFrame( 1.85 + final int type, 1.86 + final int nLocal, 1.87 + final Object[] local, 1.88 + final int nStack, 1.89 + final Object[] stack){ 1.90 + mv.visitFrame(type, nLocal, local, nStack, stack); 1.91 +} 1.92 + 1.93 +public void visitInsn(final int opcode){ 1.94 + mv.visitInsn(opcode); 1.95 +} 1.96 + 1.97 +public void visitIntInsn(final int opcode, final int operand){ 1.98 + mv.visitIntInsn(opcode, operand); 1.99 +} 1.100 + 1.101 +public void visitVarInsn(final int opcode, final int var){ 1.102 + mv.visitVarInsn(opcode, var); 1.103 +} 1.104 + 1.105 +public void visitTypeInsn(final int opcode, final String desc){ 1.106 + mv.visitTypeInsn(opcode, desc); 1.107 +} 1.108 + 1.109 +public void visitFieldInsn( 1.110 + final int opcode, 1.111 + final String owner, 1.112 + final String name, 1.113 + final String desc){ 1.114 + mv.visitFieldInsn(opcode, owner, name, desc); 1.115 +} 1.116 + 1.117 +public void visitMethodInsn( 1.118 + final int opcode, 1.119 + final String owner, 1.120 + final String name, 1.121 + final String desc){ 1.122 + mv.visitMethodInsn(opcode, owner, name, desc); 1.123 +} 1.124 + 1.125 +public void visitJumpInsn(final int opcode, final Label label){ 1.126 + mv.visitJumpInsn(opcode, label); 1.127 +} 1.128 + 1.129 +public void visitLabel(final Label label){ 1.130 + mv.visitLabel(label); 1.131 +} 1.132 + 1.133 +public void visitLdcInsn(final Object cst){ 1.134 + mv.visitLdcInsn(cst); 1.135 +} 1.136 + 1.137 +public void visitIincInsn(final int var, final int increment){ 1.138 + mv.visitIincInsn(var, increment); 1.139 +} 1.140 + 1.141 +public void visitTableSwitchInsn( 1.142 + final int min, 1.143 + final int max, 1.144 + final Label dflt, 1.145 + final Label labels[]){ 1.146 + mv.visitTableSwitchInsn(min, max, dflt, labels); 1.147 +} 1.148 + 1.149 +public void visitLookupSwitchInsn( 1.150 + final Label dflt, 1.151 + final int keys[], 1.152 + final Label labels[]){ 1.153 + mv.visitLookupSwitchInsn(dflt, keys, labels); 1.154 +} 1.155 + 1.156 +public void visitMultiANewArrayInsn(final String desc, final int dims){ 1.157 + mv.visitMultiANewArrayInsn(desc, dims); 1.158 +} 1.159 + 1.160 +public void visitTryCatchBlock( 1.161 + final Label start, 1.162 + final Label end, 1.163 + final Label handler, 1.164 + final String type){ 1.165 + mv.visitTryCatchBlock(start, end, handler, type); 1.166 +} 1.167 + 1.168 +public void visitLocalVariable( 1.169 + final String name, 1.170 + final String desc, 1.171 + final String signature, 1.172 + final Label start, 1.173 + final Label end, 1.174 + final int index){ 1.175 + mv.visitLocalVariable(name, desc, signature, start, end, index); 1.176 +} 1.177 + 1.178 +public void visitLineNumber(final int line, final Label start){ 1.179 + mv.visitLineNumber(line, start); 1.180 +} 1.181 + 1.182 +public void visitMaxs(final int maxStack, final int maxLocals){ 1.183 + mv.visitMaxs(maxStack, maxLocals); 1.184 +} 1.185 + 1.186 +public void visitEnd(){ 1.187 + mv.visitEnd(); 1.188 +} 1.189 +}