/src/main/scala/de/tud/cs/st/bat/canonical/reader/Constant_PoolBinding.scala
Scala | 129 lines | 57 code | 34 blank | 38 comment | 0 complexity | 014ec8a4c5677c6313e6391049eb216b MD5 | raw file
Possible License(s): Apache-2.0
1/* License (BSD Style License): 2* Copyright (c) 2009, 2011 3* Software Technology Group 4* Department of Computer Science 5* Technische Universit?t Darmstadt 6* All rights reserved. 7* 8* Redistribution and use in source and binary forms, with or without 9* modification, are permitted provided that the following conditions are met: 10* 11* - Redistributions of source code must retain the above copyright notice, 12* this list of conditions and the following disclaimer. 13* - Redistributions in binary form must reproduce the above copyright notice, 14* this list of conditions and the following disclaimer in the documentation 15* and/or other materials provided with the distribution. 16* - Neither the name of the Software Technology Group or Technische 17* Universit?t Darmstadt nor the names of its contributors may be used to 18* endorse or promote products derived from this software without specific 19* prior written permission. 20* 21* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31* POSSIBILITY OF SUCH DAMAGE. 32*/ 33package de.tud.cs.st.bat 34package canonical 35package reader 36 37import de.tud.cs.st.bat.reader.Constant_PoolReader 38 39/** 40 * Representation of the constant pool as specified by the JVM Specification. 41 * (This representation does not provide any abstraction.) 42 * 43 * @author Michael Eichberg 44 */ 45trait Constant_PoolBinding extends Constant_PoolReader { 46 47 type Constant_Pool_Entry = ConstantPoolEntries.Constant_Pool_Entry 48 val Constant_Pool_EntryManifest: ClassManifest[Constant_Pool_Entry] = implicitly 49 50 type CONSTANT_Class_info = ConstantPoolEntries.CONSTANT_Class_info 51 52 type CONSTANT_Fieldref_info = ConstantPoolEntries.CONSTANT_Fieldref_info 53 54 type CONSTANT_Methodref_info = ConstantPoolEntries.CONSTANT_Methodref_info 55 56 type CONSTANT_InterfaceMethodref_info = ConstantPoolEntries.CONSTANT_InterfaceMethodref_info 57 58 type CONSTANT_String_info = ConstantPoolEntries.CONSTANT_String_info 59 60 type CONSTANT_Integer_info = ConstantPoolEntries.CONSTANT_Integer_info 61 62 type CONSTANT_Float_info = ConstantPoolEntries.CONSTANT_Float_info 63 64 type CONSTANT_Long_info = ConstantPoolEntries.CONSTANT_Long_info 65 66 type CONSTANT_Double_info = ConstantPoolEntries.CONSTANT_Double_info 67 68 type CONSTANT_NameAndType_info = ConstantPoolEntries.CONSTANT_NameAndType_info 69 70 type CONSTANT_Utf8_info = ConstantPoolEntries.CONSTANT_Utf8_info 71 72 type CONSTANT_MethodHandle_info = ConstantPoolEntries.CONSTANT_MethodHandle_info 73 74 type CONSTANT_MethodType_info = ConstantPoolEntries.CONSTANT_MethodType_info 75 76 type CONSTANT_InvokeDynamic_info = ConstantPoolEntries.CONSTANT_InvokeDynamic_info 77 78 import ConstantPoolEntries._ 79 80 def CONSTANT_Class_info(i: Int): CONSTANT_Class_info = 81 new CONSTANT_Class_info(i) 82 83 def CONSTANT_Double_info(d: Double): CONSTANT_Double_info = 84 new CONSTANT_Double_info(d) 85 86 def CONSTANT_Float_info(f: Float): CONSTANT_Float_info = 87 new CONSTANT_Float_info(f) 88 89 def CONSTANT_Integer_info(i: Int): CONSTANT_Integer_info = 90 new CONSTANT_Integer_info(i) 91 92 def CONSTANT_Long_info(l: Long): CONSTANT_Long_info = 93 new CONSTANT_Long_info(l) 94 95 def CONSTANT_Utf8_info(s: String): CONSTANT_Utf8_info = 96 new CONSTANT_Utf8_info(s) 97 98 def CONSTANT_String_info(i: Int): CONSTANT_String_info = 99 new CONSTANT_String_info(i) 100 101 def CONSTANT_Fieldref_info(class_index: Int, 102 name_and_type_index: Int): CONSTANT_Fieldref_info = 103 new CONSTANT_Fieldref_info(class_index, name_and_type_index) 104 105 def CONSTANT_Methodref_info(class_index: Int, 106 name_and_type_index: Int): CONSTANT_Methodref_info = 107 new CONSTANT_Methodref_info(class_index, name_and_type_index) 108 109 def CONSTANT_InterfaceMethodref_info(class_index: Int, 110 name_and_type_index: Int): CONSTANT_InterfaceMethodref_info = 111 new CONSTANT_InterfaceMethodref_info(class_index, name_and_type_index) 112 113 def CONSTANT_NameAndType_info(name_index: Int, 114 descriptor_index: Int): CONSTANT_NameAndType_info = 115 new CONSTANT_NameAndType_info(name_index, descriptor_index) 116 117 def CONSTANT_MethodHandle_info(reference_kind: Int, 118 reference_index: Int): CONSTANT_MethodHandle_info = 119 new CONSTANT_MethodHandle_info(ReferenceKind(reference_kind), reference_index) 120 121 def CONSTANT_MethodType_info(descriptor_index: Int): CONSTANT_MethodType_info = 122 new CONSTANT_MethodType_info(descriptor_index) 123 124 def CONSTANT_InvokeDynamic_info(bootstrap_method_attr_index: Int, 125 name_and_type_index: Int): CONSTANT_InvokeDynamic_info = 126 new CONSTANT_InvokeDynamic_info(bootstrap_method_attr_index, name_and_type_index) 127} 128 129