Mercurial > lasercutter
view src/clojure/asm/commons/package.html @ 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 source
1 <html>2 <!--3 * ASM: a very small and fast Java bytecode manipulation framework4 * Copyright (c) 2000-2005 INRIA, France Telecom5 * All rights reserved.6 *7 * Redistribution and use in source and binary forms, with or without8 * modification, are permitted provided that the following conditions9 * are met:10 * 1. Redistributions of source code must retain the above copyright11 * notice, this list of conditions and the following disclaimer.12 * 2. Redistributions in binary form must reproduce the above copyright13 * notice, this list of conditions and the following disclaimer in the14 * documentation and/or other materials provided with the distribution.15 * 3. Neither the name of the copyright holders nor the names of its16 * contributors may be used to endorse or promote products derived from17 * this software without specific prior written permission.18 *19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF29 * THE POSSIBILITY OF SUCH DAMAGE.30 -->31 <body>32 Provides some useful class and method adapters. <i>The preferred way of using33 these adapters is by chaining them together and to custom adapters (instead of34 inheriting from them)</i>. Indeed this approach provides more combination35 possibilities than inheritance. For instance, suppose you want to implement an36 adapter MyAdapter than needs sorted local variables and intermediate stack map37 frame values taking into account the local variables sort. By using inheritance,38 this would require MyAdapter to extend AnalyzerAdapter, itself extending39 LocalVariablesSorter. But AnalyzerAdapter is not a subclass of40 LocalVariablesSorter, so this is not possible. On the contrary, by using41 delegation, you can make LocalVariablesSorter delegate to AnalyzerAdapter,42 itself delegating to MyAdapter. In this case AnalyzerAdapter computes43 intermediate frames based on the output of LocalVariablesSorter, and MyAdapter44 can add new locals by calling the newLocal method on LocalVariablesSorter, and45 can get the stack map frame state before each instruction by reading the locals46 and stack fields in AnalyzerAdapter (this requires references from MyAdapter47 back to LocalVariablesSorter and AnalyzerAdapter).48 </body>