Showing the changes to java/pkg2/java/lang (121 of 18352 files). Show all
Unified · Split
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
| @@ -0,0 +1,63 @@ | ||
| 1 | +implement Character_L; | |
| 2 | + | |
| 3 | +# javal v1.3 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JThread, | |
| 23 | + JObject : import jni; | |
| 24 | + | |
| 25 | +#>> extra pre includes here | |
| 26 | + | |
| 27 | +#<< | |
| 28 | + | |
| 29 | +include "Character_L.m"; | |
| 30 | + | |
| 31 | +#>> extra post includes here | |
| 32 | + | |
| 33 | +include "unicode_table.m"; | |
| 34 | + | |
| 35 | +unicode_table : UnicodeTable; | |
| 36 | + A, | |
| 37 | + Y, | |
| 38 | + X : import unicode_table; | |
| 39 | + | |
| 40 | +#<< | |
| 41 | + | |
| 42 | +init( jni_p : JNI ) | |
| 43 | +{ | |
| 44 | + # save java native inteface mod instance | |
| 45 | + jni = jni_p; | |
| 46 | + #>>extra initialization here | |
| 47 | + #<< | |
| 48 | +} | |
| 49 | + | |
| 50 | +lookup_C_I( p0 : int) : int | |
| 51 | +{#>> | |
| 52 | + if ( unicode_table == nil ) | |
| 53 | + loadtable(); | |
| 54 | + | |
| 55 | + return( A[Y[(X[p0>>6]<<6)|(p0& 16r3F)]] ); | |
| 56 | +}#<< | |
| 57 | + | |
| 58 | +loadtable() | |
| 59 | +{ | |
| 60 | + unicode_table = load UnicodeTable UnicodeTable->PATH; | |
| 61 | + if ( unicode_table == nil ) | |
| 62 | + jni->InitError( jni->sys->sprint( "java.lang.Character: could not load %s: %r", UnicodeTable->PATH ) ); | |
| 63 | +} | |
| @@ -0,0 +1,14 @@ | ||
| 1 | +# javal v1.3 generated file: edit with care | |
| 2 | + | |
| 3 | +Character_L : module | |
| 4 | +{ | |
| 5 | + Character_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + value : int; | |
| 9 | + }; | |
| 10 | + | |
| 11 | + init : fn( jni_p : JNI ); | |
| 12 | + lookup_C_I : fn( p0 : int) : int; | |
| 13 | + | |
| 14 | +}; | |
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
| @@ -0,0 +1,82 @@ | ||
| 1 | +implement ClassLoader_L; | |
| 2 | + | |
| 3 | +# javal v1.2 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JObject : import jni; | |
| 23 | + | |
| 24 | +#>> extra pre includes here | |
| 25 | + | |
| 26 | +#<< | |
| 27 | + | |
| 28 | +include "ClassLoader_L.m"; | |
| 29 | + | |
| 30 | +#>> extra post includes here | |
| 31 | + | |
| 32 | +#<< | |
| 33 | + | |
| 34 | +init( jni_p : JNI ) | |
| 35 | +{ | |
| 36 | + # save java native inteface mod instance | |
| 37 | + jni = jni_p; | |
| 38 | + #>>extra initialization here | |
| 39 | + #<< | |
| 40 | +} | |
| 41 | + | |
| 42 | +init_V( this : ref ClassLoader_obj) | |
| 43 | +{#>> | |
| 44 | + junk := this; | |
| 45 | +}#<< | |
| 46 | + | |
| 47 | +defineClass0_rString_aB_I_I_rClass( this : ref ClassLoader_obj, p0 : JString,p1 : JArrayB,p2 : int,p3 : int) : JClass | |
| 48 | +{#>> | |
| 49 | + junk := (this,p0,p1,p2,p3); | |
| 50 | + jni->ThrowException( "java.lang.ClassNotFoundException", "not implemented" ); | |
| 51 | + return( nil ); | |
| 52 | +}#<< | |
| 53 | + | |
| 54 | +resolveClass0_rClass_V( this : ref ClassLoader_obj, p0 : JClass) | |
| 55 | +{#>> | |
| 56 | + junk := (this,p0); | |
| 57 | + jni->FatalError( "resolveClass() not implemented" ); | |
| 58 | +}#<< | |
| 59 | + | |
| 60 | +findSystemClass0_rString_rClass( this : ref ClassLoader_obj, p0 : JString) : JClass | |
| 61 | +{#>> | |
| 62 | + junk := (this,p0); | |
| 63 | + jni->FatalError( "findSystemClass() not implemented" ); | |
| 64 | + return( nil ); | |
| 65 | +}#<< | |
| 66 | + | |
| 67 | +getSystemResourceAsStream0_rString_rInputStream( p0 : JString) : JObject | |
| 68 | +{#>> | |
| 69 | + junk := p0; | |
| 70 | + jni->FatalError( "getSystemResourceAsStream() not implemented" ); | |
| 71 | + return( nil ); | |
| 72 | +}#<< | |
| 73 | + | |
| 74 | +getSystemResourceAsName0_rString_rString( p0 : JString) : JString | |
| 75 | +{#>> | |
| 76 | + junk := p0; | |
| 77 | + jni->FatalError( "getSystemResourceAsName() not implemented" ); | |
| 78 | + return( nil ); | |
| 79 | +}#<< | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| @@ -0,0 +1,20 @@ | ||
| 1 | +# javal v1.2 generated file: edit with care | |
| 2 | + | |
| 3 | +ClassLoader_L : module | |
| 4 | +{ | |
| 5 | + ClassLoader_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + initialized : int; | |
| 9 | + classes : JObject; | |
| 10 | + }; | |
| 11 | + | |
| 12 | + init : fn( jni_p : JNI ); | |
| 13 | + init_V : fn( this : ref ClassLoader_obj); | |
| 14 | + defineClass0_rString_aB_I_I_rClass : fn( this : ref ClassLoader_obj, p0 : JString,p1 : JArrayB,p2 : int,p3 : int) : JClass; | |
| 15 | + resolveClass0_rClass_V : fn( this : ref ClassLoader_obj, p0 : JClass); | |
| 16 | + findSystemClass0_rString_rClass : fn( this : ref ClassLoader_obj, p0 : JString) : JClass; | |
| 17 | + getSystemResourceAsStream0_rString_rInputStream : fn( p0 : JString) : JObject; | |
| 18 | + getSystemResourceAsName0_rString_rString : fn( p0 : JString) : JString; | |
| 19 | + | |
| 20 | +}; | |
Empty file added.
| @@ -0,0 +1,778 @@ | ||
| 1 | +implement Class_L; | |
| 2 | + | |
| 3 | +# javal v1.2 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JObject : import jni; | |
| 23 | + | |
| 24 | +#>> extra pre includes here | |
| 25 | + | |
| 26 | + jldr : JavaClassLoader; | |
| 27 | + cast : Cast; | |
| 28 | + | |
| 29 | +#<< | |
| 30 | + | |
| 31 | +include "Class_L.m"; | |
| 32 | + | |
| 33 | +#>> extra post includes here | |
| 34 | + | |
| 35 | + ClassData, | |
| 36 | + Value : import jni; | |
| 37 | + | |
| 38 | +include "reflect/reflect.m"; | |
| 39 | + refl : Reflect; | |
| 40 | + | |
| 41 | +#<< | |
| 42 | + | |
| 43 | +init( jni_p : JNI ) | |
| 44 | +{ | |
| 45 | + # save java native inteface mod instance | |
| 46 | + jni = jni_p; | |
| 47 | + #>>extra initialization here | |
| 48 | + jldr = jni->jldr; | |
| 49 | + cast = jni->CastMod(); | |
| 50 | + #<< | |
| 51 | +} | |
| 52 | + | |
| 53 | +forName_rString_rClass( p0 : JString) : JClass | |
| 54 | +{#>> | |
| 55 | + e := ref Sys->Exception; | |
| 56 | + if (jni->sys->rescue("JLD:e0*", e) == Sys->HANDLER) | |
| 57 | + { | |
| 58 | + if ( p0.str != nil && p0.str[0] == '[' ) | |
| 59 | + return( jni->LookupArrayClass(p0.str) ); | |
| 60 | + else | |
| 61 | + return( jni->GetClassObject( jni->FindClass(p0.str) ) ); | |
| 62 | + } | |
| 63 | + | |
| 64 | + jni->sys->rescued(Sys->ONCE, nil); | |
| 65 | + # turn into a ClassNotFoundException | |
| 66 | + jni->ThrowException( "java.lang.ClassNotFoundException", p0.str ); | |
| 67 | + return(nil); | |
| 68 | +}#<< | |
| 69 | + | |
| 70 | +newInstance_rObject( this : JClass) : JObject | |
| 71 | +{#>> | |
| 72 | + if ( this.class.flags & (JNI->ACC_INTERFACE | JNI->ACC_ABSTRACT) ) { | |
| 73 | + s : string; | |
| 74 | + if ( isPrimitive_Z(this) == JNI->TRUE ) | |
| 75 | + s = this.class.name[len "inferno/vm/":len this.class.name - 2]; | |
| 76 | + else if ( this.aryname != nil ) | |
| 77 | + s = this.aryname; | |
| 78 | + else | |
| 79 | + s = this.class.name; | |
| 80 | + jni->ThrowException( "java.lang.InstantiationException", s ); | |
| 81 | + } | |
| 82 | + # create new object for the given class | |
| 83 | + return( jni->NewObject(this.class) ); | |
| 84 | +}#<< | |
| 85 | + | |
| 86 | +isInstance_rObject_Z( this : JClass, p0 : JObject) : int | |
| 87 | +{#>> | |
| 88 | + return( jni->IsInstanceOf( p0, this.class ) ); | |
| 89 | +}#<< | |
| 90 | + | |
| 91 | +isAssignableFrom_rClass_Z( this : JClass, p0 : JClass) : int | |
| 92 | +{#>> | |
| 93 | + return( jni->IsAssignable( p0, this ) ); | |
| 94 | +}#<< | |
| 95 | + | |
| 96 | +isInterface_Z( this : JClass) : int | |
| 97 | +{#>> | |
| 98 | + return( this.class.flags & JNI->ACC_INTERFACE ); | |
| 99 | +}#<< | |
| 100 | + | |
| 101 | +isArray_Z( this : JClass) : int | |
| 102 | +{#>> | |
| 103 | + return( this.class.name == "inferno/vm/Array" ); | |
| 104 | +}#<< | |
| 105 | + | |
| 106 | +isPrimitive_Z( this : JClass) : int | |
| 107 | +{#>> | |
| 108 | + ret : int; | |
| 109 | + if ( jni->PrimitiveIndex(this, 0) > 0 ) | |
| 110 | + ret = JNI->TRUE; | |
| 111 | + else | |
| 112 | + ret = JNI->FALSE; | |
| 113 | + return ret; | |
| 114 | +}#<< | |
| 115 | + | |
| 116 | +getName_rString( this : JClass) : JString | |
| 117 | +{#>> | |
| 118 | + name : string; | |
| 119 | + if ( isPrimitive_Z(this) == JNI->TRUE ) | |
| 120 | + { | |
| 121 | + # mk primitive name from a slice | |
| 122 | + name = this.class.name[len "inferno/vm/":len this.class.name - 2]; | |
| 123 | + } | |
| 124 | + else | |
| 125 | + { | |
| 126 | + if ( this.aryname != nil ) | |
| 127 | + { | |
| 128 | + name = this.aryname; | |
| 129 | + } | |
| 130 | + else | |
| 131 | + { | |
| 132 | + name = this.class.name; | |
| 133 | + } | |
| 134 | + # change slashes to dots | |
| 135 | + for ( i := 0; i < len name; i++ ) | |
| 136 | + if ( name[i] == '/' ) | |
| 137 | + name[i] = '.'; | |
| 138 | + } | |
| 139 | + return( jni->NewString( name ) ); | |
| 140 | +}#<< | |
| 141 | + | |
| 142 | +getClassLoader_rClassLoader( this : JClass) : JObject | |
| 143 | +{#>> | |
| 144 | + junk := (this); | |
| 145 | + jni->FatalError( "getClassLoader() not implemented" ); | |
| 146 | + return(nil); | |
| 147 | +}#<< | |
| 148 | + | |
| 149 | +getSuperclass_rClass( this : JClass) : JClass | |
| 150 | +{#>> | |
| 151 | + if ( isPrimitive_Z(this) == JNI->TRUE | |
| 152 | + || this.class.flags & JNI->ACC_INTERFACE ) | |
| 153 | + return nil; | |
| 154 | + if ( (superclass := jni->GetSuperclass(this.class)) == nil ) | |
| 155 | + return nil; | |
| 156 | + return( jni->GetClassObject( superclass ) ); | |
| 157 | +}#<< | |
| 158 | + | |
| 159 | +getInterfaces_aClass( this : JClass) : JArrayJClass | |
| 160 | +{#>> | |
| 161 | + n : int; | |
| 162 | + # kludge for arrays to be consistent with JavaSoft's VM | |
| 163 | + if ( isArray_Z(this) ) | |
| 164 | + n = 0; | |
| 165 | + else | |
| 166 | + n = len this.class.interdirect; | |
| 167 | + interface := array [n] of JObject; | |
| 168 | + il := this.class.interdirect; | |
| 169 | + for (i := n-1; i >= 0; i--) { | |
| 170 | + interface[i] = cast->FromJClass(jni->GetClassObject(hd il)); | |
| 171 | + il = tl il; | |
| 172 | + } | |
| 173 | + classarray := cast->JArrayToClass(cast->ObjectToJArray(jni->MkAObject(interface))); | |
| 174 | + classarray.class = jni->FindClass("java/lang/Class"); | |
| 175 | + return classarray; | |
| 176 | +}#<< | |
| 177 | + | |
| 178 | +getComponentType_rClass(this : JClass) : JClass | |
| 179 | +{#>> | |
| 180 | + if(this == nil || this.aryname == nil) | |
| 181 | + return nil; | |
| 182 | + | |
| 183 | + name : string; | |
| 184 | + c := this.aryname[1]; | |
| 185 | + if(c == '[') { | |
| 186 | + return jni->LookupArrayClass(this.aryname[1:]); | |
| 187 | + } else { | |
| 188 | + if(c == 'L') { | |
| 189 | + name = this.aryname[2:len this.aryname - 1]; | |
| 190 | + } else { | |
| 191 | + getReflect(); | |
| 192 | + name = "inferno/vm/" + refl->TypeCharToName(c) + "_p"; | |
| 193 | + } | |
| 194 | + return jni->GetClassObject(jni->FindClass(name)); | |
| 195 | + } | |
| 196 | +}#<< | |
| 197 | + | |
| 198 | +getModifiers_I( this : JClass) : int | |
| 199 | +{#>> | |
| 200 | + return( this.class.flags & (~ JNI->ACC_SYNCHRONIZED)); | |
| 201 | +}#<< | |
| 202 | + | |
| 203 | +getSigners_aObject( this : JClass) : JArrayJObject | |
| 204 | +{#>> | |
| 205 | + junk := (this); | |
| 206 | + jni->FatalError( "getSigners() not implemented" ); | |
| 207 | + return(nil); | |
| 208 | +}#<< | |
| 209 | + | |
| 210 | +setSigners_aObject_V( this : JClass, p0 : JArrayJObject) | |
| 211 | +{#>> | |
| 212 | + junk := (this,p0); | |
| 213 | + jni->FatalError( "setSigners() not implemented" ); | |
| 214 | +}#<< | |
| 215 | + | |
| 216 | +getPrimitiveClass_rString_rClass( p0 : JString) : JClass | |
| 217 | +{#>> | |
| 218 | + e := ref Sys->Exception; | |
| 219 | + if (jni->sys->rescue("JLD:e0*", e) == Sys->HANDLER) | |
| 220 | + { | |
| 221 | + return( jni->GetClassObject(jni->FindClass("inferno/vm/"+ p0.str +"_p")) ); | |
| 222 | + } | |
| 223 | + return(nil); | |
| 224 | +}#<< | |
| 225 | + | |
| 226 | +getFields0_I_aField( this : JClass, p0 : int) : JArrayJObject | |
| 227 | +{#>> | |
| 228 | +# 'this' represents the class whose fields are wanted. | |
| 229 | +# p0 == 0 for PUBLIC members (includes inherited members) | |
| 230 | +# p0 == 1 for DECLARED members (All members but not inherited members) | |
| 231 | + | |
| 232 | + objs : list of JObject; | |
| 233 | + if ( !isArray_Z(this) ) | |
| 234 | + objs = getFields(this, p0); | |
| 235 | + | |
| 236 | + obj_array := array[len objs] of JObject; | |
| 237 | + for ( i := 0; objs != nil ; i++ ) { | |
| 238 | + obj_array[i] = hd objs; | |
| 239 | + objs = tl objs; | |
| 240 | + } | |
| 241 | + | |
| 242 | + fieldarray := jni->MkAObject(obj_array); | |
| 243 | + fieldarray.class = jni->FindClass("java/lang/reflect/Field"); | |
| 244 | + return fieldarray; | |
| 245 | +}#<< | |
| 246 | + | |
| 247 | +getMethods0_I_aMethod( this : JClass, p0 : int) : JArrayJObject | |
| 248 | +{#>> | |
| 249 | +# 'this' represents the class whose methods are wanted. | |
| 250 | +# p0 == 0 for PUBLIC members (includes inherited members) | |
| 251 | +# p0 == 1 for DECLARED members (All members but not inherited members) | |
| 252 | + | |
| 253 | + objs : list of JObject; | |
| 254 | + | |
| 255 | + # if primitive or interface, filter out java.lang.Object methods | |
| 256 | + if ( isPrimitive_Z(this) == JNI->TRUE | |
| 257 | + || this.class.flags & JNI->ACC_INTERFACE ) | |
| 258 | + p0 = 1; | |
| 259 | + objs = getMethods(this, p0); | |
| 260 | + | |
| 261 | + obj_array := array[len objs] of JObject; | |
| 262 | + for ( i := 0; objs != nil ; i++ ) { | |
| 263 | + obj_array[i] = hd objs; | |
| 264 | + objs = tl objs; | |
| 265 | + } | |
| 266 | + | |
| 267 | + methodarray := jni->MkAObject(obj_array); | |
| 268 | + methodarray.class = jni->FindClass("java/lang/reflect/Method"); | |
| 269 | + return methodarray; | |
| 270 | +}#<< | |
| 271 | + | |
| 272 | +getConstructors0_I_aConstructor( this : JClass, p0 : int) : JArrayJObject | |
| 273 | +{#>> | |
| 274 | +# 'this' represents the class whose constructors are wanted. | |
| 275 | +# p0 == 0 for PUBLIC members (includes inherited members) | |
| 276 | +# p0 == 1 for DECLARED members (All members but not inherited members) | |
| 277 | + | |
| 278 | + objs : list of JObject; | |
| 279 | + if ( isPrimitive_Z(this) == JNI->FALSE && !isArray_Z(this) ) | |
| 280 | + objs = getConstructors(this, p0); | |
| 281 | + | |
| 282 | + obj_array := array[len objs] of JObject; | |
| 283 | + for ( i := 0; objs != nil ; i++ ) { | |
| 284 | + obj_array[i] = hd objs; | |
| 285 | + objs = tl objs; | |
| 286 | + } | |
| 287 | + | |
| 288 | + constructorarray := jni->MkAObject(obj_array); | |
| 289 | + constructorarray.class = jni->FindClass("java/lang/reflect/Constructor"); | |
| 290 | + return constructorarray; | |
| 291 | +}#<< | |
| 292 | + | |
| 293 | +getField0_rString_I_rField( this : JClass, p0 : JString,p1 : int) : JObject | |
| 294 | +{#>> | |
| 295 | +# 'this' represents the class for which a Field is desired. | |
| 296 | +# p0 is the name of the field. | |
| 297 | +# p1 == 0 for PUBLIC members (includes inherited members) | |
| 298 | +# p1 == 1 for DECLARED members (All members but not inherited members) | |
| 299 | + | |
| 300 | + staticfields := this.class.staticdata; | |
| 301 | + flg : int; | |
| 302 | + fld : ref jldr->Field; | |
| 303 | + for ( i := 0; i < len staticfields; i++ ) { | |
| 304 | + fld = staticfields[i]; | |
| 305 | + flg = fld.flags; | |
| 306 | + if ( fld.field == p0.str && | |
| 307 | + (p1 != 0 || (flg & JNI->ACC_PUBLIC) != 0) ) | |
| 308 | + break; | |
| 309 | + } | |
| 310 | + if ( i >= len staticfields ) { # Not a public static field | |
| 311 | + super : list of ref jldr->Field = nil; | |
| 312 | + if ( (superclass := jni->GetSuperclass(this.class)) != nil && | |
| 313 | + superclass != this.class ) | |
| 314 | + super = superclass.objectdata; | |
| 315 | + objfields := this.class.objectdata; | |
| 316 | + for ( i = 0; objfields != nil; i++ ) { | |
| 317 | + if ( p1 == 1 && objfields == super ) # exclude inherited | |
| 318 | + break; | |
| 319 | + fld = hd objfields; | |
| 320 | + flg = fld.flags; | |
| 321 | + if ( fld.field == p0.str && | |
| 322 | + (p1 != 0 || (flg & JNI->ACC_PUBLIC) != 0) ) | |
| 323 | + break; | |
| 324 | + objfields = tl objfields; | |
| 325 | + } | |
| 326 | + if ( objfields == super || objfields == nil ) | |
| 327 | + i = len staticfields + len this.class.objectdata; | |
| 328 | + } | |
| 329 | + if ( i >= len staticfields + len this.class.objectdata ) { | |
| 330 | + jni->ThrowException("java/lang/NoSuchFieldException", ""); | |
| 331 | + return nil; | |
| 332 | + } | |
| 333 | + return makeField(this, fld, i); | |
| 334 | +}#<< | |
| 335 | + | |
| 336 | +getMethod0_rString_aClass_I_rMethod( this : JClass, p0 : JString,p1 : JArrayJClass,p2 : int) : JObject | |
| 337 | +{#>> | |
| 338 | +# 'this' represents the class for which a Method is desired. | |
| 339 | +# p0 is the name of the method. | |
| 340 | +# p1 is a Java array of Class objects, corresponding to the formal parameters | |
| 341 | +# of the method for which a Method object is desired. The array | |
| 342 | +# is used to construct a signature string which can be matched against | |
| 343 | +# data compiled by the classloader. | |
| 344 | +# p2 == 0 for PUBLIC members (includes inherited members) | |
| 345 | +# p2 == 1 for DECLARED members (All members but not inherited members) | |
| 346 | + | |
| 347 | + signatur := "(" + MakeSignature(p1) + ")"; | |
| 348 | + | |
| 349 | + methods := this.class.staticmethods; | |
| 350 | + for ( i := 0; i < len methods; i++ ) { | |
| 351 | + fld := methods[i]; | |
| 352 | + if ( fld.field == p0.str && jni->str->prefix(signatur, fld.signature) && | |
| 353 | + (p2 != 0 || (fld.flags & JNI->ACC_PUBLIC) != 0) ) | |
| 354 | + return makeMethod(this, fld, i, p1, fld.signature[len signatur:]); | |
| 355 | + } | |
| 356 | + methods = this.class.privatemethods; | |
| 357 | + for ( i = 0; i < len methods; i++ ) { | |
| 358 | + fld := methods[i]; | |
| 359 | + if ( fld.field == p0.str && jni->str->prefix(signatur, fld.signature) && | |
| 360 | + (p2 != 0 || (fld.flags & JNI->ACC_PUBLIC) != 0) ) | |
| 361 | + return makeMethod(this, fld, i, p1, fld.signature[len signatur:]); | |
| 362 | + } | |
| 363 | + vmethods := this.class.virtualmethods; | |
| 364 | + for ( i = 0; i < len vmethods; i++ ) { | |
| 365 | + fld := vmethods[i].field; | |
| 366 | + if ( fld.field == p0.str && jni->str->prefix(signatur, fld.signature) && | |
| 367 | + ((p2 != 0 && this.class == vmethods[i].class) | |
| 368 | + || (fld.flags & JNI->ACC_PUBLIC) != 0) ) { | |
| 369 | + if ( vmethods[i].class != this.class ) | |
| 370 | + this = jni->GetClassObject(vmethods[i].class); | |
| 371 | + return makeMethod(this, fld, i, p1, fld.signature[len signatur:]); | |
| 372 | + } | |
| 373 | + } | |
| 374 | + jni->ThrowException("java/lang/NoSuchMethodException", ""); | |
| 375 | + return nil; | |
| 376 | +}#<< | |
| 377 | + | |
| 378 | +getConstructor0_aClass_I_rConstructor( this : JClass, p0 : JArrayJClass,p1 : int) : JObject | |
| 379 | +{#>> | |
| 380 | +# 'this' represents the class for which a Constructor is desired. | |
| 381 | +# p0 is a Java array of Class objects, corresponding to the formal parameters | |
| 382 | +# of the constructor for which a Constructor object is desired. The array | |
| 383 | +# is used to construct a signature string which can be matched against | |
| 384 | +# data compiled by the classloader. | |
| 385 | +# p1 == 0 for PUBLIC members (includes inherited members) | |
| 386 | +# p1 == 1 for DECLARED members (All members but not inherited members) | |
| 387 | + | |
| 388 | + signatur := "(" + MakeSignature(p0) + ")"; | |
| 389 | + | |
| 390 | + initmethods := this.class.initmethods; | |
| 391 | + flg : int; | |
| 392 | + fld : ref jldr->Field; | |
| 393 | + for ( i := 0; i < len initmethods; i++ ) { | |
| 394 | + fld = initmethods[i]; | |
| 395 | + flg = fld.flags; | |
| 396 | + if ( jni->str->prefix(signatur, fld.signature) && | |
| 397 | + (p1 != 0 || (flg & JNI->ACC_PUBLIC) != 0) ) | |
| 398 | + break; | |
| 399 | + } | |
| 400 | + if ( i >= len initmethods ) { | |
| 401 | + jni->ThrowException("java/lang/NoSuchMethodException", ""); | |
| 402 | + return nil; | |
| 403 | + } | |
| 404 | + return makeMethod(this, fld, i, p0, nil); | |
| 405 | +}#<< | |
| 406 | + | |
| 407 | +# | |
| 408 | +# getPublicStaticFields() and doInterfaces() are helper | |
| 409 | +# functions for getFields(). | |
| 410 | +# | |
| 411 | + | |
| 412 | +# | |
| 413 | +# Return list of public static fields of this class. | |
| 414 | +# | |
| 415 | + | |
| 416 | +getPublicStaticFields(this : JClass, objs : list of JObject) : list of JObject | |
| 417 | +{ | |
| 418 | + flds := this.class.staticdata; | |
| 419 | + for ( i := len flds - 1; i >= 0; i-- ) | |
| 420 | + if ( (flds[i].flags & JNI->ACC_PUBLIC) != 0 ) | |
| 421 | + objs = makeField(this, flds[i], i) :: objs; | |
| 422 | + return objs; | |
| 423 | +} | |
| 424 | + | |
| 425 | +# | |
| 426 | +# Recursively (for superinterfaces) call getPublicStaticFields() | |
| 427 | +# on interfaces of this class. | |
| 428 | +# | |
| 429 | + | |
| 430 | +ifacelist: list of JClass; | |
| 431 | + | |
| 432 | +doInterfaces(this : JClass, objs : list of JObject) : list of JObject | |
| 433 | +{ | |
| 434 | + ifaces := this.class.interfaces; | |
| 435 | +outer: for ( i := 0; i < len ifaces; i++ ) { | |
| 436 | + iface := jni->GetClassObject(ifaces[i].class); | |
| 437 | + for ( l := ifacelist; l != nil; l = tl l ) | |
| 438 | + if ( hd l == iface ) | |
| 439 | + continue outer; | |
| 440 | + ifacelist = iface :: ifacelist; | |
| 441 | + objs = getPublicStaticFields(iface, objs); | |
| 442 | + objs = doInterfaces(iface, objs); | |
| 443 | + } | |
| 444 | + return objs; | |
| 445 | +} | |
| 446 | + | |
| 447 | +# | |
| 448 | +# A helper function that gets fields for the class represented | |
| 449 | +# by this. p0 == 0 => PUBLIC fields, p0 == 1 => DECLARED fields. | |
| 450 | +# Candidate fields are found in the loader array staticdata (for | |
| 451 | +# static fields) and list objectdata (for instance fields). | |
| 452 | +# | |
| 453 | + | |
| 454 | +getFields(this : JClass, p0 : int) : list of JObject | |
| 455 | +{ | |
| 456 | + objs : list of JObject; | |
| 457 | + | |
| 458 | + # get instance fields | |
| 459 | + objdata := this.class.objectdata; | |
| 460 | + flds := array[len objdata] of ref jldr->Field; | |
| 461 | + super : list of ref jldr->Field = nil; | |
| 462 | + if ( (superclass := jni->GetSuperclass(this.class)) != nil ) | |
| 463 | + super = superclass.objectdata; | |
| 464 | + for ( i := 0; objdata != nil; i++ ) { | |
| 465 | + if ( p0 == 1 && objdata == super ) | |
| 466 | + break; | |
| 467 | + flds[i] = hd objdata; | |
| 468 | + objdata = tl objdata; | |
| 469 | + } | |
| 470 | + # need to associate declaring class with each instance field ??? | |
| 471 | + for ( i--; i >= 0; i-- ) | |
| 472 | + if ( p0 != 0 || (flds[i].flags & JNI->ACC_PUBLIC) != 0 ) | |
| 473 | + objs = makeField(this, flds[i], i) :: objs; | |
| 474 | + | |
| 475 | + # get class fields of this class | |
| 476 | + flds = this.class.staticdata; | |
| 477 | + for ( i = len flds - 1; i >= 0; i-- ) | |
| 478 | + if ( p0 != 0 || (flds[i].flags & JNI->ACC_PUBLIC) != 0 ) | |
| 479 | + objs = makeField(this, flds[i], i) :: objs; | |
| 480 | + | |
| 481 | + # get class fields of super classes and interfaces | |
| 482 | + if ( p0 == 0 ) { | |
| 483 | + ifacelist = nil; | |
| 484 | + objs = doInterfaces(this, objs); | |
| 485 | + curclass := this; | |
| 486 | + while ( ( curclass = getSuperclass_rClass(curclass) ) != nil ) { | |
| 487 | + objs = getPublicStaticFields(curclass, objs); | |
| 488 | + objs = doInterfaces(curclass, objs); | |
| 489 | + } | |
| 490 | + } | |
| 491 | + | |
| 492 | + return objs; | |
| 493 | +} | |
| 494 | +# | |
| 495 | +# A helper function that gets methods for the class represented | |
| 496 | +# by this. p0 == 0 => PUBLIC methods, p0 == 1 => DECLARED methods. | |
| 497 | +# Candidate methods are found in the loader arrays staticmethods (for | |
| 498 | +# class methods), privatemethods (for methods private to this | |
| 499 | +# particular class), and virtualmethods (public instance methods of | |
| 500 | +# this class and all its superclasses). | |
| 501 | +# | |
| 502 | +getMethods(this : JClass, p0 : int) : list of JObject | |
| 503 | +{ | |
| 504 | + objs : list of JObject; | |
| 505 | + | |
| 506 | + getReflect(); | |
| 507 | + | |
| 508 | + flds := this.class.staticmethods; | |
| 509 | + for ( i := 0; i < len flds; i++ ) | |
| 510 | + if ( p0 != 0 || (flds[i].flags & JNI->ACC_PUBLIC) != 0 ) | |
| 511 | + objs = makeAMethod(this, flds[i], i) :: objs; | |
| 512 | + | |
| 513 | + if ( p0 != 0 ) { | |
| 514 | + flds = this.class.privatemethods; | |
| 515 | + for ( i = len flds - 1; i >= 0; i-- ) | |
| 516 | + objs = makeAMethod(this, flds[i], i) :: objs; | |
| 517 | + } | |
| 518 | + | |
| 519 | + vflds := this.class.virtualmethods; | |
| 520 | + for ( i = len vflds - 1; i >= 0; i-- ) | |
| 521 | + if ( (p0 == 1 && vflds[i].class == this.class) # declared, this class | |
| 522 | + || ( p0 == 0 && (vflds[i].field.flags & JNI->ACC_PUBLIC) != 0 ) ) { | |
| 523 | + if ( vflds[i].class != this.class ) | |
| 524 | + this = jni->GetClassObject(vflds[i].class); | |
| 525 | + objs = makeAMethod(this, vflds[i].field, i) :: objs; | |
| 526 | + } | |
| 527 | + | |
| 528 | + return objs; | |
| 529 | +} | |
| 530 | +# | |
| 531 | +# A helper function that gets constructors for the class represented | |
| 532 | +# by this. p0 == 0 => PUBLIC constructors, p0 == 1 => DECLARED | |
| 533 | +# constructors. Candidate constructors are found in the loader | |
| 534 | +# array initmethods. | |
| 535 | +# | |
| 536 | +getConstructors(this : JClass, p0 : int) : list of JObject | |
| 537 | +{ | |
| 538 | + objs : list of JObject; | |
| 539 | + | |
| 540 | + getReflect(); | |
| 541 | + | |
| 542 | + flds := this.class.initmethods; | |
| 543 | + for ( i := len flds - 1; i >= 0; i-- ) | |
| 544 | + if ( p0 != 0 || (flds[i].flags & JNI->ACC_PUBLIC) != 0 ) | |
| 545 | + objs = makeAMethod(this, flds[i], i) :: objs; | |
| 546 | + | |
| 547 | + return objs; | |
| 548 | +} | |
| 549 | +# | |
| 550 | +# Make sure Reflect module is loaded. | |
| 551 | +# | |
| 552 | +getReflect() | |
| 553 | +{ | |
| 554 | + if ( refl == nil ) { | |
| 555 | + refl = load Reflect Reflect->PATH; | |
| 556 | + if ( refl == nil ) | |
| 557 | + jni->InitError( jni->sys->sprint( "java.lang.Class: could not load %s: %r", Reflect->PATH ) ); | |
| 558 | + else | |
| 559 | + refl->init(jni); | |
| 560 | + } | |
| 561 | +} | |
| 562 | +# | |
| 563 | +# Construct a Field Object. The field is a member of the class | |
| 564 | +# represented by this, and the loader data for the field is in fld, | |
| 565 | +# which is at offset ix in the appropriate array or list. The 'slot' | |
| 566 | +# elements of a Field_obj adt is used only by native methods, and has | |
| 567 | +# the fields modifier flags in the low-order 16 bits, and the index | |
| 568 | +# into the array/list in the upper 16 bits. (The index into what | |
| 569 | +# depends on the modifier flags.) | |
| 570 | +# | |
| 571 | +makeField(this : JClass, fld : ref jldr->Field, ix : int) : JObject | |
| 572 | +{ | |
| 573 | + getReflect(); | |
| 574 | + fldobj := jni->AllocObject(jni->FindClass("java/lang/reflect/Field")); | |
| 575 | + | |
| 576 | + clazz := ref Value.TObject(cast->FromJClass(this)); | |
| 577 | + jni->SetObjField(fldobj, "clazz", clazz); | |
| 578 | + | |
| 579 | + name := ref Value.TObject(cast->FromJString(jni->NewString(fld.field))); | |
| 580 | + jni->SetObjField(fldobj, "name", name); | |
| 581 | + | |
| 582 | + class : ref Value; | |
| 583 | + if ( (typ := refl->SigToType(fld.signature)) > 0 ) | |
| 584 | + class = refl->GetPrimitiveClass(typ); | |
| 585 | + else { | |
| 586 | + classname := fld.signature[1:len fld.signature - 1]; | |
| 587 | + class = ref Value.TObject(cast->FromJClass( | |
| 588 | + jni->GetClassObject(jni->FindClass(classname)))); | |
| 589 | + } | |
| 590 | + jni->SetObjField(fldobj, "type", class); | |
| 591 | + | |
| 592 | + slot := ref Value.TInt((fld.flags & 16rffff) | (ix << 16)); | |
| 593 | + jni->SetObjField(fldobj, "slot", slot); | |
| 594 | + | |
| 595 | + return fldobj; | |
| 596 | +} | |
| 597 | +# | |
| 598 | +# Make a new Method/Constructor object for a method or constructor in | |
| 599 | +# the class this. The loader information for the method/constructor is | |
| 600 | +# found in the loader Field adt fld, which is at offset ix in its | |
| 601 | +# array or list. The signature for the arguments is converted into | |
| 602 | +# a corresponding array of Class objects by makeParamClassArray, then | |
| 603 | +# makeMethod is called to generate the new object. | |
| 604 | +# | |
| 605 | +makeAMethod(this: JClass, fld : ref jldr->Field, ix : int) : JObject | |
| 606 | +{ | |
| 607 | + (sig, retsig) := jni->str->splitr(fld.signature, ")"); | |
| 608 | + objectarray := makeParamClassArray(sig); | |
| 609 | + | |
| 610 | + classarray := cast->JArrayToClass(cast->ObjectToJArray(objectarray)); | |
| 611 | + return makeMethod(this, fld, ix, classarray, retsig); | |
| 612 | +} | |
| 613 | +# | |
| 614 | +# Construct a Method Object. Also used to make Constructor Objects, | |
| 615 | +# share several elements with Methods. The two can be distinguished | |
| 616 | +# because constructors have the name "<init>" (however, Constructor | |
| 617 | +# Objects do not have a 'name' field, nor do they have a 'returnType' | |
| 618 | +# field. The 'slot' field, which is only used by native methods, | |
| 619 | +# is filled with modifier flags in the lower 16 bits and an index (ix) | |
| 620 | +# into an appropriate loader array/list in the upper 16 bits (which | |
| 621 | +# array can be determined by the modifier flags. ). The arguments | |
| 622 | +# types required by the method are specified by the cl array of | |
| 623 | +# Class ofjects. The return value, if any, is specified by the | |
| 624 | +# signature given in retsig. | |
| 625 | +# | |
| 626 | +makeMethod(this: JClass, fld : ref jldr->Field, ix : int, cl : JArrayJClass, | |
| 627 | + retsig : string) : JObject | |
| 628 | +{ | |
| 629 | + mcl : ClassData; | |
| 630 | + isConstructor := 0; | |
| 631 | + if ( fld.field == "<init>" ) | |
| 632 | + isConstructor = 1; | |
| 633 | + if ( isConstructor ) | |
| 634 | + mcl = jni->FindClass("java/lang/reflect/Constructor"); | |
| 635 | + else | |
| 636 | + mcl = jni->FindClass("java/lang/reflect/Method"); | |
| 637 | + methobj := jni->AllocObject(mcl); | |
| 638 | + | |
| 639 | + clazz := ref Value.TObject(cast->FromJClass(this)); | |
| 640 | + jni->SetObjField(methobj, "clazz", clazz); | |
| 641 | + | |
| 642 | + if ( ! isConstructor ) { | |
| 643 | + name := ref Value.TObject(cast->FromJString(jni->NewString(fld.field))); | |
| 644 | + jni->SetObjField(methobj, "name", name); | |
| 645 | + } | |
| 646 | + | |
| 647 | + slot := ref Value.TInt((fld.flags & 16rffff) | (ix << 16)); | |
| 648 | + jni->SetObjField(methobj, "slot", slot); | |
| 649 | + | |
| 650 | + if ( ! isConstructor ) { | |
| 651 | + getReflect(); | |
| 652 | + ret : ref Value; | |
| 653 | + if ( (typ := refl->SigToType(retsig)) > 0 ) | |
| 654 | + ret = refl->GetPrimitiveClass(typ); | |
| 655 | + else { | |
| 656 | + rclass: JClass; | |
| 657 | + case retsig[0] { | |
| 658 | + 'L' => | |
| 659 | + rcdata := jni->FindClass(retsig[1:len retsig -1]); | |
| 660 | + rclass = jni->GetClassObject(rcdata); | |
| 661 | + '[' => | |
| 662 | + rclass = jni->LookupArrayClass(retsig); | |
| 663 | + 'V' => | |
| 664 | + rcdata := jni->FindClass("inferno/vm/void_p"); | |
| 665 | + rclass = jni->GetClassObject(rcdata); | |
| 666 | + } | |
| 667 | + ret = ref Value.TObject(cast->FromJClass(rclass)); | |
| 668 | + } | |
| 669 | + jni->SetObjField(methobj, "returnType", ret); | |
| 670 | + } | |
| 671 | + | |
| 672 | + args := ref Value.TObject(cast->FromJArray(cast->ClassToJArray(cl))); | |
| 673 | + jni->SetObjField(methobj, "parameterTypes", args); | |
| 674 | + | |
| 675 | + # Don't know how to get the list of exceptions thrown. | |
| 676 | + # jni->SetObjField(methobj, "exceptionTypes", excs); | |
| 677 | + # Set to a sensible default for now. | |
| 678 | + foo := cast->JArrayToClass(cast->ObjectToJArray(makeParamClassArray("()"))); | |
| 679 | + excs := ref Value.TObject(cast->FromJArray(cast->ClassToJArray(foo))); | |
| 680 | + jni->SetObjField(methobj, "exceptionTypes", excs); | |
| 681 | + return methobj; | |
| 682 | +} | |
| 683 | +# | |
| 684 | +# Turn a signature into an array of Class Objects. | |
| 685 | +# | |
| 686 | +makeParamClassArray(sig : string) : JArrayJObject | |
| 687 | +{ | |
| 688 | + if ( sig[0] != '(' || sig[len sig -1] != ')' ) | |
| 689 | + return nil; | |
| 690 | + clist := makeParamClass(sig[1:len sig -1]); | |
| 691 | + jajcl := array[len clist] of JObject; | |
| 692 | + for ( i := 0; i < len jajcl; i++ ) { | |
| 693 | + jajcl[i] = hd clist; | |
| 694 | + clist = tl clist; | |
| 695 | + } | |
| 696 | + paramclassarray := jni->MkAObject(jajcl); | |
| 697 | + paramclassarray.class = jni->FindClass("java/lang/Class"); | |
| 698 | + return paramclassarray; | |
| 699 | +} | |
| 700 | +# | |
| 701 | +# Recursively turn a signature into a list of JClass | |
| 702 | +# | |
| 703 | +makeParamClass(sig : string) : list of JObject | |
| 704 | +{ | |
| 705 | + if ( sig == "" ) | |
| 706 | + return nil; | |
| 707 | + | |
| 708 | + (first, rest) := splitSignature(sig); | |
| 709 | + jobj: JObject; | |
| 710 | + case first[0] { | |
| 711 | + 'L' => | |
| 712 | + first = first[1:len first - 1]; | |
| 713 | + newcl := jni->GetClassObject(jni->FindClass(first)); | |
| 714 | + jobj = cast->FromJClass(newcl); | |
| 715 | + '[' => | |
| 716 | + newcl := jni->LookupArrayClass(first); | |
| 717 | + jobj = cast->FromJClass(newcl); | |
| 718 | + 'Z' or 'B' or 'S' or 'C' or 'I' or 'J' or 'F' or 'D' => | |
| 719 | + typ := refl->SigToType(first); | |
| 720 | + jobj = refl->GetPrimitiveClass(typ).Object(); | |
| 721 | + * => | |
| 722 | + return nil; | |
| 723 | + } | |
| 724 | + | |
| 725 | + return jobj :: makeParamClass(rest); | |
| 726 | +} | |
| 727 | +# | |
| 728 | +# Convert an array of JClass to the corresponding signature string. | |
| 729 | +# | |
| 730 | +MakeSignature(jcl : JArrayJClass) : string | |
| 731 | +{ | |
| 732 | + clarray: array of JClass; | |
| 733 | + if ( jcl != nil ) | |
| 734 | + clarray = jcl.ary; | |
| 735 | + sig := ""; | |
| 736 | + for ( i := 0; i < len clarray; i++) | |
| 737 | + sig += MakeSingleSignature(clarray[i]); | |
| 738 | + return sig; | |
| 739 | +} | |
| 740 | +# | |
| 741 | +# Convert a Jclass to the corresponding signature. | |
| 742 | +# | |
| 743 | +MakeSingleSignature(this : JClass) : string | |
| 744 | +{ | |
| 745 | + if ( (typ := jni->PrimitiveIndex(this, 1)) > 0 ) { | |
| 746 | + getReflect(); | |
| 747 | + return refl->TypeToSig(typ); | |
| 748 | + } | |
| 749 | + | |
| 750 | + if ( this.aryname != nil ) | |
| 751 | + return this.aryname; | |
| 752 | + | |
| 753 | + # | |
| 754 | + # Must be a class type | |
| 755 | + # | |
| 756 | + return "L" + this.class.name + ";"; | |
| 757 | +} | |
| 758 | +# | |
| 759 | +# Break a signature into an initial type plus the remainder. | |
| 760 | +# | |
| 761 | +splitSignature(sig : string) : (string, string) | |
| 762 | +{ | |
| 763 | + case sig[0] { | |
| 764 | + 'L' => | |
| 765 | + for ( i := 1; sig[i] != ';'; i++ ) ; | |
| 766 | + i++; | |
| 767 | + return (sig[0:i], sig[i:]); | |
| 768 | + | |
| 769 | + '[' => # recurse to get element type | |
| 770 | + (first, rest) := splitSignature(sig[1:]); | |
| 771 | + return ("[" + first, rest); | |
| 772 | + | |
| 773 | + 'Z' or 'B' or 'S' or 'C' or 'I' or 'J' or 'F' or 'D' => | |
| 774 | + return (sig[0:1], sig[1:]); | |
| 775 | + } | |
| 776 | + return (nil, nil); | |
| 777 | +} | |
| 778 | + | |
| @@ -0,0 +1,30 @@ | ||
| 1 | +# javal v1.2 generated file: edit with care | |
| 2 | + | |
| 3 | +Class_L : module | |
| 4 | +{ | |
| 5 | + | |
| 6 | + init : fn( jni_p : JNI ); | |
| 7 | + forName_rString_rClass : fn( p0 : JString) : JClass; | |
| 8 | + newInstance_rObject : fn( this : JClass) : JObject; | |
| 9 | + isInstance_rObject_Z : fn( this : JClass, p0 : JObject) : int; | |
| 10 | + isAssignableFrom_rClass_Z : fn( this : JClass, p0 : JClass) : int; | |
| 11 | + isInterface_Z : fn( this : JClass) : int; | |
| 12 | + isArray_Z : fn( this : JClass) : int; | |
| 13 | + isPrimitive_Z : fn( this : JClass) : int; | |
| 14 | + getName_rString : fn( this : JClass) : JString; | |
| 15 | + getClassLoader_rClassLoader : fn( this : JClass) : JObject; | |
| 16 | + getSuperclass_rClass : fn( this : JClass) : JClass; | |
| 17 | + getInterfaces_aClass : fn( this : JClass) : JArrayJClass; | |
| 18 | + getComponentType_rClass : fn( this : JClass) : JClass; | |
| 19 | + getModifiers_I : fn( this : JClass) : int; | |
| 20 | + getSigners_aObject : fn( this : JClass) : JArrayJObject; | |
| 21 | + setSigners_aObject_V : fn( this : JClass, p0 : JArrayJObject); | |
| 22 | + getPrimitiveClass_rString_rClass : fn( p0 : JString) : JClass; | |
| 23 | + getFields0_I_aField : fn( this : JClass, p0 : int) : JArrayJObject; | |
| 24 | + getMethods0_I_aMethod : fn( this : JClass, p0 : int) : JArrayJObject; | |
| 25 | + getConstructors0_I_aConstructor : fn( this : JClass, p0 : int) : JArrayJObject; | |
| 26 | + getField0_rString_I_rField : fn( this : JClass, p0 : JString,p1 : int) : JObject; | |
| 27 | + getMethod0_rString_aClass_I_rMethod : fn( this : JClass, p0 : JString,p1 : JArrayJClass,p2 : int) : JObject; | |
| 28 | + getConstructor0_aClass_I_rConstructor : fn( this : JClass, p0 : JArrayJClass,p1 : int) : JObject; | |
| 29 | + | |
| 30 | +}; | |
Empty file added.
Empty file added.
Empty file added.
Empty file added.
| @@ -0,0 +1,66 @@ | ||
| 1 | +implement Double_L; | |
| 2 | + | |
| 3 | +# javal v1.3 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JThread, | |
| 23 | + JObject : import jni; | |
| 24 | + | |
| 25 | +#>> extra pre includes here | |
| 26 | + | |
| 27 | +#<< | |
| 28 | + | |
| 29 | +include "Double_L.m"; | |
| 30 | + | |
| 31 | +#>> extra post includes here | |
| 32 | +math : Math; | |
| 33 | +#<< | |
| 34 | + | |
| 35 | +init( jni_p : JNI ) | |
| 36 | +{ | |
| 37 | + # save java native inteface mod instance | |
| 38 | + jni = jni_p; | |
| 39 | + #>>extra initialization here | |
| 40 | + math = jni->math; | |
| 41 | + #<< | |
| 42 | +} | |
| 43 | + | |
| 44 | +doubleToLongBits_D_J( p0 : real) : big | |
| 45 | +{#>> | |
| 46 | + return( math->realbits64(p0) ); | |
| 47 | +}#<< | |
| 48 | + | |
| 49 | +longBitsToDouble_J_D( p0 : big) : real | |
| 50 | +{#>> | |
| 51 | + return( math->bits64real( p0 ) ); | |
| 52 | +}#<< | |
| 53 | + | |
| 54 | +valueOf0_rString_D( p0 : JString) : real | |
| 55 | +{#>> | |
| 56 | + return( real p0.str ); | |
| 57 | +}#<< | |
| 58 | + | |
| 59 | +mkstring_D_rString( p0 : real) : JString | |
| 60 | +{#>> | |
| 61 | + s := string p0; | |
| 62 | + if(p0 == 0.0) | |
| 63 | + s += ".0"; | |
| 64 | + return( jni->NewString( s ) ); | |
| 65 | +}#<< | |
| 66 | + | |
| @@ -0,0 +1,17 @@ | ||
| 1 | +# javal v1.3 generated file: edit with care | |
| 2 | + | |
| 3 | +Double_L : module | |
| 4 | +{ | |
| 5 | + Double_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + value : real; | |
| 9 | + }; | |
| 10 | + | |
| 11 | + init : fn( jni_p : JNI ); | |
| 12 | + doubleToLongBits_D_J : fn( p0 : real) : big; | |
| 13 | + longBitsToDouble_J_D : fn( p0 : big) : real; | |
| 14 | + valueOf0_rString_D : fn( p0 : JString) : real; | |
| 15 | + mkstring_D_rString : fn( p0 : real) : JString; | |
| 16 | + | |
| 17 | +}; | |
Empty file added.
Empty file added.
| @@ -0,0 +1,73 @@ | ||
| 1 | +/* | |
| 2 | + * @(#)ExceptionInInitializerError.java 1.2 97/01/20 | |
| 3 | + * | |
| 4 | + * Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved. | |
| 5 | + * | |
| 6 | + * Permission to use, copy, modify, and distribute this software | |
| 7 | + * and its documentation for NON-COMMERCIAL purposes and without | |
| 8 | + * fee is hereby granted provided that this copyright notice | |
| 9 | + * appears in all copies. Please refer to the file "copyright.html" | |
| 10 | + * for further important copyright and licensing information. | |
| 11 | + * | |
| 12 | + * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF | |
| 13 | + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED | |
| 14 | + * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | |
| 15 | + * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR | |
| 16 | + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR | |
| 17 | + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. | |
| 18 | + */ | |
| 19 | + | |
| 20 | +package java.lang; | |
| 21 | + | |
| 22 | +/** | |
| 23 | + * Signals that an unexpected exception has occurred in a static initializer. | |
| 24 | + * | |
| 25 | + * @author Frank Yellin | |
| 26 | + * @version 1.2, 01/20/97 | |
| 27 | + * | |
| 28 | + * @since JDK1.1 | |
| 29 | + */ | |
| 30 | +public | |
| 31 | +class ExceptionInInitializerError extends LinkageError { | |
| 32 | + private Throwable exception; | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * Constructs an ExceptionInInitializerError with no detail message. | |
| 36 | + * A detail message is a String that describes this particular exception. | |
| 37 | + * | |
| 38 | + * @since JDK1.1 | |
| 39 | + */ | |
| 40 | + public ExceptionInInitializerError() { | |
| 41 | + super(); | |
| 42 | + } | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * Constructs a new ExceptionInInitializerError class initialized to | |
| 46 | + * the specific throwable | |
| 47 | + * | |
| 48 | + * @param thrown The exception thrown | |
| 49 | + * @since JDK1.1 | |
| 50 | + */ | |
| 51 | + public ExceptionInInitializerError(Throwable thrown) { | |
| 52 | + this.exception = thrown; | |
| 53 | + } | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * Constructs a ExceptionInInitializerError with the specified detail message. | |
| 57 | + * A detail message is a String that describes this particular exception. | |
| 58 | + * | |
| 59 | + * @param s the detail message | |
| 60 | + * @since JDK1.1 | |
| 61 | + */ | |
| 62 | + public ExceptionInInitializerError(String s) { | |
| 63 | + super(s); | |
| 64 | + } | |
| 65 | + | |
| 66 | + /** | |
| 67 | + * Returns the exception that occurred during a static initialization that | |
| 68 | + * caused this Error to be created. | |
| 69 | + */ | |
| 70 | + public Throwable getException() { | |
| 71 | + return exception; | |
| 72 | + } | |
| 73 | +} | |
Empty file added.
| @@ -0,0 +1,60 @@ | ||
| 1 | +implement Float_L; | |
| 2 | + | |
| 3 | +# javal v1.3 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JThread, | |
| 23 | + JObject : import jni; | |
| 24 | + | |
| 25 | +#>> extra pre includes here | |
| 26 | + | |
| 27 | +#<< | |
| 28 | + | |
| 29 | +include "Float_L.m"; | |
| 30 | + | |
| 31 | +#>> extra post includes here | |
| 32 | +math : Math; | |
| 33 | +#<< | |
| 34 | + | |
| 35 | +init( jni_p : JNI ) | |
| 36 | +{ | |
| 37 | + # save java native inteface mod instance | |
| 38 | + jni = jni_p; | |
| 39 | + #>>extra initialization here | |
| 40 | + math = jni->math; | |
| 41 | + #<< | |
| 42 | +} | |
| 43 | + | |
| 44 | +floatToIntBits_F_I( p0 : real) : int | |
| 45 | +{#>> | |
| 46 | + return( math->realbits32(p0) ); | |
| 47 | +}#<< | |
| 48 | + | |
| 49 | +intBitsToFloat_I_F( p0 : int) : real | |
| 50 | +{#>> | |
| 51 | + return( math->bits32real(p0) ); | |
| 52 | +}#<< | |
| 53 | + | |
| 54 | +mkstring_F_rString( p0 : real) : JString | |
| 55 | +{#>> | |
| 56 | + s := string p0; | |
| 57 | + if(p0 == 0.0) | |
| 58 | + s += ".0"; | |
| 59 | + return( jni->NewString( s ) ); | |
| 60 | +}#<< | |
| @@ -0,0 +1,16 @@ | ||
| 1 | +# javal v1.3 generated file: edit with care | |
| 2 | + | |
| 3 | +Float_L : module | |
| 4 | +{ | |
| 5 | + Float_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + value : real; | |
| 9 | + }; | |
| 10 | + | |
| 11 | + init : fn( jni_p : JNI ); | |
| 12 | + floatToIntBits_F_I : fn( p0 : real) : int; | |
| 13 | + intBitsToFloat_I_F : fn( p0 : int) : real; | |
| 14 | + mkstring_F_rString : fn( p0 : real) : JString; | |
| 15 | + | |
| 16 | +}; | |
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
| @@ -0,0 +1,207 @@ | ||
| 1 | +implement InfernoProcess_L; | |
| 2 | + | |
| 3 | +# javal v1.3 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JThread, | |
| 23 | + JObject : import jni; | |
| 24 | + | |
| 25 | +#>> extra pre includes here | |
| 26 | + | |
| 27 | +include "java/io/FileDescriptor_L.m"; | |
| 28 | + FileDescriptor_obj : import FileDescriptor_L; | |
| 29 | + | |
| 30 | +#<< | |
| 31 | + | |
| 32 | +include "InfernoProcess_L.m"; | |
| 33 | + | |
| 34 | +#>> extra post includes here | |
| 35 | + | |
| 36 | +include "sh.m"; | |
| 37 | + | |
| 38 | +ioexception := ""; | |
| 39 | + | |
| 40 | +#<< | |
| 41 | + | |
| 42 | +init( jni_p : JNI ) | |
| 43 | +{ | |
| 44 | + # save java native inteface mod instance | |
| 45 | + jni = jni_p; | |
| 46 | + #>>extra initialization here | |
| 47 | + #<< | |
| 48 | +} | |
| 49 | + | |
| 50 | +initProc_aString_aString_V( this : ref InfernoProcess_obj, p0 : JArrayJString,p1 : JArrayJString) | |
| 51 | +{#>> | |
| 52 | + # | |
| 53 | + # p0 : command and arguments | |
| 54 | + # p1 : environment in for var=value; does not apply in Inferno | |
| 55 | + # | |
| 56 | + dummy := this; | |
| 57 | + jstrs := p0.ary; | |
| 58 | + args : list of string; | |
| 59 | + l := len jstrs; | |
| 60 | + for ( i := l-1; i >= 0; i--) | |
| 61 | + args = jstrs[i].str :: args; | |
| 62 | + | |
| 63 | + sync := chan of int; | |
| 64 | + spawn exec(this, args, sync); | |
| 65 | + pid := <- sync; | |
| 66 | + if ( pid == 0 ) | |
| 67 | + jni->ThrowException("java.io.IOException", ioexception); | |
| 68 | +}#<< | |
| 69 | + | |
| 70 | +waitFor_I( this : ref InfernoProcess_obj) : int | |
| 71 | +{#>> | |
| 72 | + if ( this.waitfd.fd == nil ) | |
| 73 | + this.terminated = JNI->TRUE; | |
| 74 | + while ( this.terminated == JNI->FALSE ) { | |
| 75 | + (ok, nil) := jni->sys->fstat(this.waitfd.fd); | |
| 76 | + if ( ok < 0 ) | |
| 77 | + this.terminated = JNI->TRUE; | |
| 78 | + else | |
| 79 | + jni->sys->sleep(1000); | |
| 80 | + } | |
| 81 | + this.waitfd.fd = nil; | |
| 82 | + return 0; | |
| 83 | +}#<< | |
| 84 | + | |
| 85 | +destroy_V( this : ref InfernoProcess_obj) | |
| 86 | +{#>> | |
| 87 | + if ( this.pid == 0 || isTerminated_Z(this) == JNI->TRUE ) | |
| 88 | + return; | |
| 89 | + | |
| 90 | + fd := jni->sys->open("/prog/"+string this.pid+"/ctl", jni->sys->OWRITE); | |
| 91 | + if ( fd != nil ) | |
| 92 | + jni->sys->fprint(fd, "killgrp"); | |
| 93 | + this.pid = 0; | |
| 94 | + this.terminated = JNI->TRUE; | |
| 95 | +}#<< | |
| 96 | + | |
| 97 | +isTerminated_Z( this : ref InfernoProcess_obj) : int | |
| 98 | +{#>> | |
| 99 | + # If the file descriptor being used to wait for the process to terminate | |
| 100 | + # is still good, the process hasn't terminated yet. | |
| 101 | + # | |
| 102 | + if ( this.waitfd.fd == nil ) | |
| 103 | + return this.terminated = JNI->TRUE; | |
| 104 | + (ok, nil) := jni->sys->fstat(this.waitfd.fd); | |
| 105 | + if ( ok < 0 ) | |
| 106 | + this.terminated = JNI->TRUE; | |
| 107 | + return this.terminated; | |
| 108 | +}#<< | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | +exec(this : ref InfernoProcess_obj, args : list of string, | |
| 113 | + waitpid : chan of int) | |
| 114 | +{ | |
| 115 | + # find and load module corresponding to hd args. | |
| 116 | + cmd := hd args; | |
| 117 | + file := cmd; | |
| 118 | + if ( len file < 4 || file[len file - 4:] != ".dis" ) | |
| 119 | + file += ".dis"; | |
| 120 | + | |
| 121 | + c := load Command file; | |
| 122 | + if ( c == nil ) { | |
| 123 | + err := jni->sys->sprint("%r"); | |
| 124 | + if ( err == "file does not exist" && file[0] != '/' && | |
| 125 | + file[0:2] != "./" ) { | |
| 126 | + c = load Command "/dis/" + file; | |
| 127 | + if ( c == nil ) | |
| 128 | + err = jni->sys->sprint("%r"); | |
| 129 | + } | |
| 130 | + if ( c == nil ) { | |
| 131 | + ioexception = jni->sys->sprint("%s: %r", cmd); | |
| 132 | + waitpid <- = 0; | |
| 133 | + return; | |
| 134 | + } | |
| 135 | + } | |
| 136 | + # | |
| 137 | + # Get pid (via pctl) and save; We save the pid of the PARENT of the | |
| 138 | + # thread that will actually execute the command. Then if someone | |
| 139 | + # calls destroy, the whole group is killed. | |
| 140 | + # | |
| 141 | + this.pid = jni->sys->pctl(Sys->FORKNS | Sys->NEWPGRP, nil); | |
| 142 | + # | |
| 143 | + # Note: have to open the /prog/n/wait file of parent before doing the spawn. | |
| 144 | + # | |
| 145 | + waitfd : ref Sys->FD;; | |
| 146 | + if ( this.pid > 0 ) | |
| 147 | + waitfd = jni->sys->open("#p/" + string this.pid + "/wait", Sys->OREAD); | |
| 148 | + this.waitfd.fd = waitfd; | |
| 149 | + | |
| 150 | + # arrange for new input/output to the command. Save in stdin & stdout. | |
| 151 | + si := array[2] of ref Sys->FD; | |
| 152 | + so := array[2] of ref Sys->FD; | |
| 153 | + se := array[2] of ref Sys->FD; | |
| 154 | + if ( jni->sys->pipe(si) < 0 ) { | |
| 155 | + ioexception = "pipe failure"; | |
| 156 | + waitpid <- = 0; | |
| 157 | + return; | |
| 158 | + } | |
| 159 | + if ( jni->sys->pipe(so) < 0 ) { | |
| 160 | + ioexception = "pipe failure"; | |
| 161 | + waitpid <- = 0; | |
| 162 | + return; | |
| 163 | + } | |
| 164 | + if ( jni->sys->pipe(se) < 0 ) { | |
| 165 | + ioexception = "pipe failure"; | |
| 166 | + waitpid <- = 0; | |
| 167 | + return; | |
| 168 | + } | |
| 169 | + this.stdin.fd = si[1]; | |
| 170 | + this.stdout.fd = so[0]; | |
| 171 | + this.stderr.fd = se[0]; | |
| 172 | + spawn exec1(c, si[0], so[1], se[1], args, waitpid); | |
| 173 | + si[0] = si[1] = so[0] = so[1] = se[0] = se[1] = nil; | |
| 174 | + # | |
| 175 | + # We can't just exit this thread, or we could never detect completion | |
| 176 | + # of the child. So we wait here for the wait notification. | |
| 177 | + # Note that we nil the 'this' reference, so that it will be | |
| 178 | + # possible for it to be garbage collected when not referenced elsewhere. | |
| 179 | + # That means we can't set the terminated flag, so that anyone who | |
| 180 | + # really needs to know whether the process has terminated has to check | |
| 181 | + # to see if this.waitfd.fd is still a valid FD. | |
| 182 | + # | |
| 183 | + this = nil; | |
| 184 | + buf := array[64] of byte; | |
| 185 | + if ( waitfd != nil && jni->sys->read(waitfd, buf, len buf) < 0 ) | |
| 186 | + jni->sys->print("read error on wait file: %r\n") | |
| 187 | + ; # even if this is an error, how do we report it? | |
| 188 | +} | |
| 189 | + | |
| 190 | +exec1(cmd : Command, in, out, err : ref Sys->FD, args : list of string, | |
| 191 | + c : chan of int) | |
| 192 | +{ | |
| 193 | + newfds := in.fd :: out.fd :: err.fd :: nil; | |
| 194 | + pid := jni->sys->pctl(Sys->NEWFD, newfds); | |
| 195 | + jni->sys->dup(in.fd, 0); | |
| 196 | + jni->sys->dup(out.fd, 1); | |
| 197 | + jni->sys->dup(err.fd, 2); | |
| 198 | + in = out = err = nil; | |
| 199 | + pid = jni->sys->pctl(Sys->NEWFD, 0 :: 1 :: 2 :: nil); | |
| 200 | + # | |
| 201 | + # Eventually there has to be a way to get the Draw->Context. | |
| 202 | + # | |
| 203 | + # ctxt := jni->GetContext(); | |
| 204 | + c <- = pid; | |
| 205 | + cmd->init(nil, args); | |
| 206 | +} | |
| 207 | + | |
| @@ -0,0 +1,22 @@ | ||
| 1 | +# javal v1.3 generated file: edit with care | |
| 2 | + | |
| 3 | +InfernoProcess_L : module | |
| 4 | +{ | |
| 5 | + InfernoProcess_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + stdin : ref FileDescriptor_obj; | |
| 9 | + stdout : ref FileDescriptor_obj; | |
| 10 | + stderr : ref FileDescriptor_obj; | |
| 11 | + pid : int; | |
| 12 | + waitfd : ref FileDescriptor_obj; | |
| 13 | + terminated : int; | |
| 14 | + }; | |
| 15 | + | |
| 16 | + init : fn( jni_p : JNI ); | |
| 17 | + initProc_aString_aString_V : fn( this : ref InfernoProcess_obj, p0 : JArrayJString,p1 : JArrayJString); | |
| 18 | + waitFor_I : fn( this : ref InfernoProcess_obj) : int; | |
| 19 | + destroy_V : fn( this : ref InfernoProcess_obj); | |
| 20 | + isTerminated_Z : fn( this : ref InfernoProcess_obj) : int; | |
| 21 | + | |
| 22 | +}; | |
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
| @@ -0,0 +1,119 @@ | ||
| 1 | +implement Math_L; | |
| 2 | + | |
| 3 | +# javal v1.2 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JObject : import jni; | |
| 23 | + | |
| 24 | +#>> extra pre includes here | |
| 25 | + | |
| 26 | +#<< | |
| 27 | + | |
| 28 | +include "Math_L.m"; | |
| 29 | + | |
| 30 | +#>> extra post includes here | |
| 31 | +math : Math; | |
| 32 | +#<< | |
| 33 | + | |
| 34 | +init( jni_p : JNI ) | |
| 35 | +{ | |
| 36 | + # save java native inteface mod instance | |
| 37 | + jni = jni_p; | |
| 38 | + #>>extra initialization here | |
| 39 | + math = jni->math; | |
| 40 | + #<< | |
| 41 | +} | |
| 42 | + | |
| 43 | +sin_D_D( p0 : real) : real | |
| 44 | +{#>> | |
| 45 | + return( math->sin(p0) ); | |
| 46 | +}#<< | |
| 47 | + | |
| 48 | +cos_D_D( p0 : real) : real | |
| 49 | +{#>> | |
| 50 | + return( math->cos(p0) ); | |
| 51 | +}#<< | |
| 52 | + | |
| 53 | +tan_D_D( p0 : real) : real | |
| 54 | +{#>> | |
| 55 | + return( math->tan(p0) ); | |
| 56 | +}#<< | |
| 57 | + | |
| 58 | +asin_D_D( p0 : real) : real | |
| 59 | +{#>> | |
| 60 | + return( math->asin(p0) ); | |
| 61 | +}#<< | |
| 62 | + | |
| 63 | +acos_D_D( p0 : real) : real | |
| 64 | +{#>> | |
| 65 | + return( math->acos(p0) ); | |
| 66 | +}#<< | |
| 67 | + | |
| 68 | +atan_D_D( p0 : real) : real | |
| 69 | +{#>> | |
| 70 | + return( math->atan(p0) ); | |
| 71 | +}#<< | |
| 72 | + | |
| 73 | +exp_D_D( p0 : real) : real | |
| 74 | +{#>> | |
| 75 | + return( math->exp(p0) ); | |
| 76 | +}#<< | |
| 77 | + | |
| 78 | +log_D_D( p0 : real) : real | |
| 79 | +{#>> | |
| 80 | + return( math->log(p0) ); | |
| 81 | +}#<< | |
| 82 | + | |
| 83 | +sqrt_D_D( p0 : real) : real | |
| 84 | +{#>> | |
| 85 | + return( math->sqrt(p0) ); | |
| 86 | +}#<< | |
| 87 | + | |
| 88 | +IEEEremainder_D_D_D( p0 : real,p1 : real) : real | |
| 89 | +{#>> | |
| 90 | + return( math->remainder(p0,p1) ); | |
| 91 | +}#<< | |
| 92 | + | |
| 93 | +ceil_D_D( p0 : real) : real | |
| 94 | +{#>> | |
| 95 | + return( math->ceil(p0) ); | |
| 96 | +}#<< | |
| 97 | + | |
| 98 | +floor_D_D( p0 : real) : real | |
| 99 | +{#>> | |
| 100 | + return( math->floor(p0) ); | |
| 101 | +}#<< | |
| 102 | + | |
| 103 | +rint_D_D( p0 : real) : real | |
| 104 | +{#>> | |
| 105 | + return( math->rint(p0) ); | |
| 106 | +}#<< | |
| 107 | + | |
| 108 | +atan2_D_D_D( p0 : real,p1 : real) : real | |
| 109 | +{#>> | |
| 110 | + return( math->atan2(p0,p1) ); | |
| 111 | +}#<< | |
| 112 | + | |
| 113 | +pow_D_D_D( p0 : real,p1 : real) : real | |
| 114 | +{#>> | |
| 115 | + return( math->pow(p0,p1) ); | |
| 116 | +}#<< | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| @@ -0,0 +1,27 @@ | ||
| 1 | +# javal v1.2 generated file: edit with care | |
| 2 | + | |
| 3 | +Math_L : module | |
| 4 | +{ | |
| 5 | + Math_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + }; | |
| 9 | + | |
| 10 | + init : fn( jni_p : JNI ); | |
| 11 | + sin_D_D : fn( p0 : real) : real; | |
| 12 | + cos_D_D : fn( p0 : real) : real; | |
| 13 | + tan_D_D : fn( p0 : real) : real; | |
| 14 | + asin_D_D : fn( p0 : real) : real; | |
| 15 | + acos_D_D : fn( p0 : real) : real; | |
| 16 | + atan_D_D : fn( p0 : real) : real; | |
| 17 | + exp_D_D : fn( p0 : real) : real; | |
| 18 | + log_D_D : fn( p0 : real) : real; | |
| 19 | + sqrt_D_D : fn( p0 : real) : real; | |
| 20 | + IEEEremainder_D_D_D : fn( p0 : real,p1 : real) : real; | |
| 21 | + ceil_D_D : fn( p0 : real) : real; | |
| 22 | + floor_D_D : fn( p0 : real) : real; | |
| 23 | + rint_D_D : fn( p0 : real) : real; | |
| 24 | + atan2_D_D_D : fn( p0 : real,p1 : real) : real; | |
| 25 | + pow_D_D_D : fn( p0 : real,p1 : real) : real; | |
| 26 | + | |
| 27 | +}; | |
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
| @@ -0,0 +1,71 @@ | ||
| 1 | +implement Object_L; | |
| 2 | + | |
| 3 | +include "jni.m"; | |
| 4 | + jni : JNI; | |
| 5 | + ClassModule, | |
| 6 | + JString, | |
| 7 | + JArray, | |
| 8 | + JArrayI, | |
| 9 | + JArrayC, | |
| 10 | + JArrayB, | |
| 11 | + JArrayS, | |
| 12 | + JArrayJ, | |
| 13 | + JArrayF, | |
| 14 | + JArrayD, | |
| 15 | + JArrayZ, | |
| 16 | + JArrayJObject, | |
| 17 | + JArrayJString, | |
| 18 | + JClass, | |
| 19 | + JObject : import jni; | |
| 20 | + | |
| 21 | +#>> extra pre includes here | |
| 22 | + | |
| 23 | +#<< | |
| 24 | + | |
| 25 | +include "Object_L.m"; | |
| 26 | + | |
| 27 | +#>> extra post includes here | |
| 28 | + | |
| 29 | +#<< | |
| 30 | + | |
| 31 | +init( jni_p : JNI ) | |
| 32 | +{ | |
| 33 | + # save java native inteface mod instance | |
| 34 | + jni = jni_p; | |
| 35 | + #>>extra initialization here | |
| 36 | + #<< | |
| 37 | +} | |
| 38 | + | |
| 39 | +getClass_rClass( this : JObject) : JClass | |
| 40 | +{#>> | |
| 41 | + return( jni->GetObjectClass(this) ); | |
| 42 | +}#<< | |
| 43 | + | |
| 44 | +hashCode_I( this : JObject ) : int | |
| 45 | +{#>> | |
| 46 | + return( jni->IdentityHash( this ) ); | |
| 47 | +}#<< | |
| 48 | + | |
| 49 | +clone_rObject( this : JObject ) : JObject | |
| 50 | +{#>> | |
| 51 | + return( jni->DupObject( this ) ); | |
| 52 | +}#<< | |
| 53 | + | |
| 54 | +notify_V( this : JObject ) | |
| 55 | +{#>> | |
| 56 | + jni->jldr->monitornotify( this, 0 ); | |
| 57 | +}#<< | |
| 58 | + | |
| 59 | +notifyAll_V( this : JObject ) | |
| 60 | +{#>> | |
| 61 | + jni->jldr->monitornotify( this, 1 ); | |
| 62 | +}#<< | |
| 63 | + | |
| 64 | +wait_J_V( this : JObject, p0 : big) | |
| 65 | +{#>> | |
| 66 | + if ( p0 < big 0 ) | |
| 67 | + jni->ThrowException( "java.lang.IllegalArgumentException", "negative timeout value" ); | |
| 68 | + # limit to 30 bits of millisecond time. | |
| 69 | + duration := (int p0) & 16r3FFFFFFF; | |
| 70 | + jni->jldr->monitorwait( this, duration ); | |
| 71 | +}#<< | |
| @@ -0,0 +1,14 @@ | ||
| 1 | +# generated file edit with care | |
| 2 | + | |
| 3 | +Object_L : module | |
| 4 | +{ | |
| 5 | + init : fn( jni_p : JNI ); | |
| 6 | + getClass_rClass : fn( this : JObject ) : JClass; | |
| 7 | + hashCode_I : fn( this : JObject ) : int; | |
| 8 | + clone_rObject : fn( this : JObject ) : JObject; | |
| 9 | + notify_V : fn( this : JObject ); | |
| 10 | + notifyAll_V : fn( this : JObject ); | |
| 11 | + wait_J_V : fn( this : JObject, p0 : big); | |
| 12 | + registerNatives_V : fn( this : JObject ); | |
| 13 | + | |
| 14 | +}; | |
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
| @@ -0,0 +1,161 @@ | ||
| 1 | +implement Runtime_L; | |
| 2 | + | |
| 3 | +# javal v1.2 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JObject : import jni; | |
| 23 | + | |
| 24 | +#>> extra pre includes here | |
| 25 | + | |
| 26 | +#<< | |
| 27 | + | |
| 28 | +include "Runtime_L.m"; | |
| 29 | + | |
| 30 | +#>> extra post includes here | |
| 31 | + | |
| 32 | +#<< | |
| 33 | + | |
| 34 | +init( jni_p : JNI ) | |
| 35 | +{ | |
| 36 | + # save java native inteface mod instance | |
| 37 | + jni = jni_p; | |
| 38 | + #>>extra initialization here | |
| 39 | + #<< | |
| 40 | +} | |
| 41 | + | |
| 42 | +killgrp() | |
| 43 | +{ | |
| 44 | + # kill this process group | |
| 45 | + msg := array of byte "killgrp"; | |
| 46 | + pid := string jni->sys->pctl(0,nil); #my pid | |
| 47 | + | |
| 48 | + fd := jni->sys->open("#p/"+pid+"/ctl", Sys->OWRITE); | |
| 49 | + if(fd != nil) | |
| 50 | + jni->sys->write(fd, msg, len msg); | |
| 51 | + | |
| 52 | + #note: we silently fail if we could not open | |
| 53 | + #'#p' (i.e. because of NODEVS) or if the | |
| 54 | + #write fails | |
| 55 | +} | |
| 56 | + | |
| 57 | +exitInternal_I_V( this : ref Runtime_obj, p0 : int) | |
| 58 | +{#>> | |
| 59 | + # can't kill self, so spawn thread to kill group | |
| 60 | + spawn killgrp(); | |
| 61 | + # send nowhere until killed | |
| 62 | + chan of int <-= 666; | |
| 63 | + junk := (this,p0); #inferno does not have an exit code | |
| 64 | +}#<< | |
| 65 | + | |
| 66 | +runFinalizersOnExit0_Z_V( p0 : int) | |
| 67 | +{#>> | |
| 68 | + junk := (p0); | |
| 69 | +}#<< | |
| 70 | + | |
| 71 | +freeMemory_J( this : ref Runtime_obj) : big | |
| 72 | +{#>> | |
| 73 | + # open; read; parase; memory device | |
| 74 | + mfd := jni->sys->open("#c/memory", Sys->OREAD); | |
| 75 | + if ( mfd == nil ) | |
| 76 | + return(big 0); | |
| 77 | + buf := array[300] of byte; | |
| 78 | + n := jni->sys->read(mfd, buf, len buf); | |
| 79 | + if(n <= 0) | |
| 80 | + return(big 0); | |
| 81 | + (nil, arena) := jni->sys->tokenize(string buf[0:n], "\n"); | |
| 82 | + (used,limit) := (0,0); | |
| 83 | + # walk list of arena's looking for "heap" | |
| 84 | + while(arena != nil) | |
| 85 | + { | |
| 86 | + # break line into tokens | |
| 87 | + (nil,tok) := jni->sys->tokenize( hd arena, " " ); | |
| 88 | + used = int (hd tok); #first tok is amount used | |
| 89 | + tok = tl tok; | |
| 90 | + limit = int (hd tok); #second tok is total | |
| 91 | + name : string; | |
| 92 | + for(tok= tl tok; tok != nil; tok = tl tok) | |
| 93 | + name = hd tok; | |
| 94 | + | |
| 95 | + if ( name == "heap" ) | |
| 96 | + break; | |
| 97 | + arena = tl arena; | |
| 98 | + } | |
| 99 | + | |
| 100 | + # return the amount free | |
| 101 | + return( big (limit-used) ); | |
| 102 | + junk := (this); | |
| 103 | +}#<< | |
| 104 | + | |
| 105 | +totalMemory_J( this : ref Runtime_obj) : big | |
| 106 | +{#>> | |
| 107 | + # open; read; parase; memory device | |
| 108 | + mfd := jni->sys->open("#c/memory", Sys->OREAD); | |
| 109 | + if ( mfd == nil ) | |
| 110 | + return( big 0 ); | |
| 111 | + buf := array[300] of byte; | |
| 112 | + n := jni->sys->read(mfd, buf, len buf); | |
| 113 | + if(n <= 0) | |
| 114 | + return(big 0); | |
| 115 | + (nil, arena) := jni->sys->tokenize(string buf[0:n], "\n"); | |
| 116 | + limit := 0; | |
| 117 | + while(arena != nil) | |
| 118 | + { | |
| 119 | + # break line into tokens | |
| 120 | + (nil,tok) := jni->sys->tokenize( hd arena, " " ); | |
| 121 | + tok = tl tok; | |
| 122 | + limit = int (hd tok); #second tok is total | |
| 123 | + name : string; | |
| 124 | + for(tok= tl tok; tok != nil; tok = tl tok) | |
| 125 | + name = hd tok; | |
| 126 | + | |
| 127 | + if ( name == "heap" ) | |
| 128 | + break; | |
| 129 | + arena = tl arena; | |
| 130 | + } | |
| 131 | + | |
| 132 | + # return the total amount | |
| 133 | + return( big limit ); | |
| 134 | + junk := (this); | |
| 135 | +}#<< | |
| 136 | + | |
| 137 | +gc_V( this : ref Runtime_obj) | |
| 138 | +{#>> | |
| 139 | + # do nothing | |
| 140 | + junk := this; | |
| 141 | +}#<< | |
| 142 | + | |
| 143 | +runFinalization_V( this : ref Runtime_obj) | |
| 144 | +{#>> | |
| 145 | + # do nothing | |
| 146 | + junk := this; | |
| 147 | +}#<< | |
| 148 | + | |
| 149 | +traceInstructions_Z_V( this : ref Runtime_obj, p0 : int) | |
| 150 | +{#>> | |
| 151 | + # do nothing | |
| 152 | + return; | |
| 153 | + junk := (this,p0); | |
| 154 | +}#<< | |
| 155 | + | |
| 156 | +traceMethodCalls_Z_V( this : ref Runtime_obj, p0 : int) | |
| 157 | +{#>> | |
| 158 | + # doing nothing is a valid implementation | |
| 159 | + return; | |
| 160 | + junk := (this,p0); | |
| 161 | +}#<< | |
| @@ -0,0 +1,20 @@ | ||
| 1 | +# javal v1.2 generated file: edit with care | |
| 2 | + | |
| 3 | +Runtime_L : module | |
| 4 | +{ | |
| 5 | + Runtime_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + }; | |
| 9 | + | |
| 10 | + init : fn( jni_p : JNI ); | |
| 11 | + exitInternal_I_V : fn( this : ref Runtime_obj, p0 : int); | |
| 12 | + runFinalizersOnExit0_Z_V : fn( p0 : int); | |
| 13 | + freeMemory_J : fn( this : ref Runtime_obj) : big; | |
| 14 | + totalMemory_J : fn( this : ref Runtime_obj) : big; | |
| 15 | + gc_V : fn( this : ref Runtime_obj); | |
| 16 | + runFinalization_V : fn( this : ref Runtime_obj); | |
| 17 | + traceInstructions_Z_V : fn( this : ref Runtime_obj, p0 : int); | |
| 18 | + traceMethodCalls_Z_V : fn( this : ref Runtime_obj, p0 : int); | |
| 19 | + | |
| 20 | +}; | |
Empty file added.
Empty file added.
| @@ -0,0 +1,175 @@ | ||
| 1 | +implement SecurityManager_L; | |
| 2 | + | |
| 3 | +# javal v1.2 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JObject : import jni; | |
| 23 | + | |
| 24 | +#>> extra pre includes here | |
| 25 | + | |
| 26 | +#<< | |
| 27 | + | |
| 28 | +include "SecurityManager_L.m"; | |
| 29 | + | |
| 30 | +#>> extra post includes here | |
| 31 | + | |
| 32 | +#<< | |
| 33 | + | |
| 34 | +init( jni_p : JNI ) | |
| 35 | +{ | |
| 36 | + # save java native inteface mod instance | |
| 37 | + jni = jni_p; | |
| 38 | + #>>extra initialization here | |
| 39 | + #<< | |
| 40 | +} | |
| 41 | + | |
| 42 | +getClassContext_aClass( this : ref SecurityManager_obj) : JArrayJClass | |
| 43 | +{#>> | |
| 44 | + # | |
| 45 | + # return an array of classes that represent the classes of | |
| 46 | + # each method on the current call stack (presumably ignoring | |
| 47 | + # any native funtions). | |
| 48 | + # | |
| 49 | + jni->FatalError( "getClassContext() not implemented" ); | |
| 50 | + junk := this; | |
| 51 | + return(nil); | |
| 52 | +}#<< | |
| 53 | + | |
| 54 | +currentClassLoader_rClassLoader( this : ref SecurityManager_obj) : JObject | |
| 55 | +{#>> | |
| 56 | + # | |
| 57 | + # this returns the most recent class loader on the current call | |
| 58 | + # stack. Traditionally the call stack is walked and the class of | |
| 59 | + # each "active" method is checked to obtain its class loader (if | |
| 60 | + # any; null==root loader). The first such class loader we find | |
| 61 | + # is returned. | |
| 62 | + # | |
| 63 | + return(nil); #for now we don't walk back | |
| 64 | + junk := this; | |
| 65 | +}#<< | |
| 66 | + | |
| 67 | +classDepth_rString_I( this : ref SecurityManager_obj, p0 : JString) : int | |
| 68 | +{#>> | |
| 69 | + # | |
| 70 | + # walk the call stack looking for a method that resides in | |
| 71 | + # the class specified. | |
| 72 | + # | |
| 73 | + if ( p0 != nil ) | |
| 74 | + { | |
| 75 | + clname := p0.str; | |
| 76 | + # change any '.' to '/' | |
| 77 | + l := len clname; | |
| 78 | + for(x:=0;x<l; x++) | |
| 79 | + if ( clname[x] == '.' ) clname[x] = '/'; | |
| 80 | + | |
| 81 | + # attempt to open the local "prog" device (i.e. '#p') | |
| 82 | + # and read the call stack into an array of bytes | |
| 83 | + pid := jni->sys->pctl(0,nil); | |
| 84 | + progfile := "#p/"+ (string pid) +"/stack"; | |
| 85 | + fd := jni->sys->open( progfile, Sys->OREAD ); | |
| 86 | + if ( fd != nil ) | |
| 87 | + { | |
| 88 | + # must spin a thread to read my own call-stack | |
| 89 | + result := chan of array of byte; # channel for thd results | |
| 90 | + spawn ReadCallStack( fd, result ); | |
| 91 | + callstack := <- result; # wait for results | |
| 92 | + | |
| 93 | + (cnt,frame) := jni->sys->tokenize( string callstack, "\n" ); | |
| 94 | + if ( cnt > 0 ) | |
| 95 | + { | |
| 96 | + # walk frames looking for module-name/class-name match | |
| 97 | + depth := 0; | |
| 98 | + for( ; frame!=nil; frame=tl frame ) | |
| 99 | + { | |
| 100 | + # parse each line | |
| 101 | + (a,tok) := jni->sys->tokenize(hd frame, " "); | |
| 102 | + if ( a > 0 ) | |
| 103 | + { | |
| 104 | + #module name is last token | |
| 105 | + for( b:=0; b<a-1; b-- ) | |
| 106 | + tok = tl tok; | |
| 107 | + if ( (hd tok) == clname ) | |
| 108 | + return( depth ); | |
| 109 | + } | |
| 110 | + depth++; | |
| 111 | + } | |
| 112 | + } | |
| 113 | + } | |
| 114 | + | |
| 115 | + } | |
| 116 | + | |
| 117 | + return(-1); #if we are here we can't find the class | |
| 118 | + junk := (this); | |
| 119 | +}#<< | |
| 120 | + | |
| 121 | +classLoaderDepth_I( this : ref SecurityManager_obj) : int | |
| 122 | +{#>> | |
| 123 | + # | |
| 124 | + # return the number of frames back to the first class | |
| 125 | + # loader on the call stack. Return -1 if no classloaders. | |
| 126 | + # | |
| 127 | + return(-1); #for now we don't walk back | |
| 128 | + junk := this; | |
| 129 | +}#<< | |
| 130 | + | |
| 131 | +currentLoadedClass0_rClass( this : ref SecurityManager_obj) : JClass | |
| 132 | +{#>> | |
| 133 | + # | |
| 134 | + # return the first class on the call stack that was loaded | |
| 135 | + # with a class loader. | |
| 136 | + # | |
| 137 | + return( nil ); | |
| 138 | + junk := this; | |
| 139 | +}#<< | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | +ReadCallStack( fd : ref Sys->FD, result : chan of array of byte ) | |
| 145 | +{ | |
| 146 | + # read until eof | |
| 147 | + buf := array[8000] of byte; #about 10 frames | |
| 148 | + (n,ptr) := (0,0); | |
| 149 | + do | |
| 150 | + { | |
| 151 | + cur := len buf-ptr; | |
| 152 | + n = jni->sys->read(fd, buf[ptr:], cur); | |
| 153 | + ptr += n; | |
| 154 | + if ( n == cur ) | |
| 155 | + { | |
| 156 | + # need to read more | |
| 157 | + buf = ExtendBuf(buf); | |
| 158 | + } | |
| 159 | + | |
| 160 | + } while ( n != 0 ); | |
| 161 | + | |
| 162 | + result <- = buf[:ptr]; | |
| 163 | +} | |
| 164 | + | |
| 165 | +ExtendBuf( buf : array of byte ) : array of byte | |
| 166 | +{ | |
| 167 | + curlen := len buf; | |
| 168 | + newbuf := array[curlen + 8000] of byte; | |
| 169 | + | |
| 170 | + # copy old contents | |
| 171 | + for(x:=0; x<curlen; x++ ) | |
| 172 | + newbuf[x] = buf[x]; | |
| 173 | + | |
| 174 | + return( newbuf ); | |
| 175 | +} | |
| @@ -0,0 +1,19 @@ | ||
| 1 | +# javal v1.2 generated file: edit with care | |
| 2 | + | |
| 3 | +SecurityManager_L : module | |
| 4 | +{ | |
| 5 | + SecurityManager_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + inCheck : int; | |
| 9 | + initialized : int; | |
| 10 | + }; | |
| 11 | + | |
| 12 | + init : fn( jni_p : JNI ); | |
| 13 | + getClassContext_aClass : fn( this : ref SecurityManager_obj) : JArrayJClass; | |
| 14 | + currentClassLoader_rClassLoader : fn( this : ref SecurityManager_obj) : JObject; | |
| 15 | + classDepth_rString_I : fn( this : ref SecurityManager_obj, p0 : JString) : int; | |
| 16 | + classLoaderDepth_I : fn( this : ref SecurityManager_obj) : int; | |
| 17 | + currentLoadedClass0_rClass : fn( this : ref SecurityManager_obj) : JClass; | |
| 18 | + | |
| 19 | +}; | |
Empty file added.
Empty file added.
Empty file added.
Empty file added.
| @@ -0,0 +1,359 @@ | ||
| 1 | +implement StringBuffer_L; | |
| 2 | + | |
| 3 | +# javal v1.4 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JThread, | |
| 23 | + JObject : import jni; | |
| 24 | + | |
| 25 | +#>> extra pre includes here | |
| 26 | + | |
| 27 | +# this module implements the class java.lang.StringBuffer | |
| 28 | +# the buffer is really a Limbo string type. In the original | |
| 29 | +# Java implementation an array of char was used and the array | |
| 30 | +# size was always >= to the buffer contents. In this version | |
| 31 | +# The limbo string represents only the buffer contents and | |
| 32 | +# contains no extra "padding". This is done because the | |
| 33 | +# Inferno implementation of string is optimized for string | |
| 34 | +# operations. Thus, the actual buffer contents is simply the | |
| 35 | +# length of the Limbo string; the original Java version | |
| 36 | +# maintained the buffer content size in the field 'count'. | |
| 37 | +# For conveience of the Java code, and to negate a call into | |
| 38 | +# the native Limbo, the 'count' field is maintained to always | |
| 39 | +# be the length of the Limbo string: e.g. "count=len Ivalue". | |
| 40 | +# | |
| 41 | +# In the Java version the character array can be shared with | |
| 42 | +# an instance of the Java String class, hence a flag for being | |
| 43 | +# shared. This is not the case for the Inferno implementation. | |
| 44 | +# whenever data is passed out it must be a copy of the 'Ivalue' | |
| 45 | +# string. | |
| 46 | +# | |
| 47 | +# When this was implemented synchronizatio of native methods | |
| 48 | +# was not complete, so this module assumes if a method should | |
| 49 | +# be synchronized it is done before entering the native method | |
| 50 | +# so each native method should be a private method and wrapped | |
| 51 | +# in Java code by a synchronized method (or block). | |
| 52 | +# | |
| 53 | +# The java.lang.StringBuffer class is serialzable. For Inferno | |
| 54 | +# since the internal structure has changed serialization must | |
| 55 | +# be explitily handled by this class. This is done by adding | |
| 56 | +# writeObject()/readObject() methods in the Java side to write | |
| 57 | +# and read in the expected format, so outside VM's do not know | |
| 58 | +# we have a differen implementation. | |
| 59 | +# | |
| 60 | + | |
| 61 | +#<< | |
| 62 | + | |
| 63 | +include "StringBuffer_L.m"; | |
| 64 | + | |
| 65 | +#>> extra post includes here | |
| 66 | +Value : import jni; | |
| 67 | +cast : Cast; | |
| 68 | + | |
| 69 | +#<< | |
| 70 | + | |
| 71 | +init( jni_p : JNI ) | |
| 72 | +{ | |
| 73 | + # save java native inteface mod instance | |
| 74 | + jni = jni_p; | |
| 75 | + #>>extra initialization here | |
| 76 | + cast = jni->CastMod(); | |
| 77 | + #<< | |
| 78 | +} | |
| 79 | + | |
| 80 | +setLength0_I_V( this : ref StringBuffer_obj, p0 : int) | |
| 81 | +{#>> | |
| 82 | + # p0 => length to set buf to; assume >=0 | |
| 83 | + | |
| 84 | + l := len this.Ivalue; | |
| 85 | + | |
| 86 | + if ( p0 < l ) # truncate | |
| 87 | + this.Ivalue = this.Ivalue[:p0]; | |
| 88 | + else { # pad with null characters | |
| 89 | + for( i := l; i < p0; i++ ) | |
| 90 | + this.Ivalue[i] = '\0'; | |
| 91 | + } | |
| 92 | + this.count = len this.Ivalue; | |
| 93 | +}#<< | |
| 94 | + | |
| 95 | +charAt0_I_C( this : ref StringBuffer_obj, p0 : int) : int | |
| 96 | +{#>> | |
| 97 | + # assume p0 is within the range 0..len this.Ivalue | |
| 98 | + return( this.Ivalue[p0] ); | |
| 99 | +}#<< | |
| 100 | + | |
| 101 | +getChars0_I_I_aC_I_V( this : ref StringBuffer_obj, p0 : int,p1 : int,p2 : JArrayC,p3 : int) | |
| 102 | +{#>> | |
| 103 | + # assume the index ranges are already checked | |
| 104 | + copy_count := (p1-p0); | |
| 105 | + dst_end := p3 + copy_count; | |
| 106 | + if ( dst_end > len p2.ary ) | |
| 107 | + jni->ThrowException( "java.lang.ArrayIndexOutOfBoundsException", "destination array not large enough" ); | |
| 108 | + | |
| 109 | + # copy one char at a time | |
| 110 | + for( (x,y) := (p3,p0); x < copy_count; junk:=(x++,y++) ) | |
| 111 | + p2.ary[x] = this.Ivalue[y]; | |
| 112 | + | |
| 113 | +}#<< | |
| 114 | + | |
| 115 | +setCharAt0_I_C_V( this : ref StringBuffer_obj, p0 : int,p1 : int) | |
| 116 | +{#>> | |
| 117 | + # assume index has been checked | |
| 118 | + this.Ivalue[p0] = p1; | |
| 119 | +}#<< | |
| 120 | + | |
| 121 | +reverse0_V( this : ref StringBuffer_obj) | |
| 122 | +{#>> | |
| 123 | + # reverse the string buffer contents | |
| 124 | + str := this.Ivalue[:]; # slice a copy | |
| 125 | + for( (x,y):=(0,(len str)-1); x<len str; junk:=(x++,y--) ) | |
| 126 | + this.Ivalue[x] = str[y]; | |
| 127 | + | |
| 128 | +}#<< | |
| 129 | + | |
| 130 | +append_int_I_V( this : ref StringBuffer_obj, p0 : int) | |
| 131 | +{#>> | |
| 132 | + # append the Ivalue to the string | |
| 133 | + this.Ivalue += string p0; | |
| 134 | + this.count = len this.Ivalue; | |
| 135 | +}#<< | |
| 136 | + | |
| 137 | +append_long_J_V( this : ref StringBuffer_obj, p0 : big) | |
| 138 | +{#>> | |
| 139 | + # append the Ivalue to the string | |
| 140 | + this.Ivalue += string p0; | |
| 141 | + this.count = len this.Ivalue; | |
| 142 | +}#<< | |
| 143 | + | |
| 144 | +append_str_rString_V( this : ref StringBuffer_obj, p0 : JString) | |
| 145 | +{#>> | |
| 146 | + # append the Ivalue to the string | |
| 147 | + val : string; | |
| 148 | + if ( p0 == nil ) | |
| 149 | + val = "null"; #this is what Java wants | |
| 150 | + else | |
| 151 | + val = p0.str; | |
| 152 | + | |
| 153 | + this.Ivalue += val; | |
| 154 | + this.count = len this.Ivalue; | |
| 155 | +}#<< | |
| 156 | + | |
| 157 | +append_chars_aC_I_I_V( this : ref StringBuffer_obj, p0 : JArrayC,p1 : int,p2 : int) | |
| 158 | +{#>> | |
| 159 | + # append the Ivalue to the string | |
| 160 | + if ( p0 == nil ) return; | |
| 161 | + | |
| 162 | + val := p0.ary[p1:p1+p2]; | |
| 163 | + l := len this.Ivalue; | |
| 164 | + for( x:=0; x < len val; x++ ) | |
| 165 | + this.Ivalue[l++] = val[x]; | |
| 166 | + this.count = len this.Ivalue; | |
| 167 | +}#<< | |
| 168 | + | |
| 169 | +append_ch_C_V( this : ref StringBuffer_obj, p0 : int) | |
| 170 | +{#>> | |
| 171 | + # append the Ivalue to the string | |
| 172 | + this.Ivalue[this.count] = p0; | |
| 173 | + this.count++; | |
| 174 | +}#<< | |
| 175 | + | |
| 176 | +append_float_F_V( this : ref StringBuffer_obj, p0 : real) | |
| 177 | +{#>> | |
| 178 | + # append the Ivalue to the string | |
| 179 | + s := string p0; | |
| 180 | + if(p0 == 0.0) | |
| 181 | + s += ".0"; | |
| 182 | + this.Ivalue += s; | |
| 183 | + this.count = len this.Ivalue; | |
| 184 | +}#<< | |
| 185 | + | |
| 186 | +append_double_D_V( this : ref StringBuffer_obj, p0 : real) | |
| 187 | +{#>> | |
| 188 | + # append the Ivalue to the string | |
| 189 | + s := string p0; | |
| 190 | + if(p0 == 0.0) | |
| 191 | + s += ".0"; | |
| 192 | + this.Ivalue += s; | |
| 193 | + this.count = len this.Ivalue; | |
| 194 | +}#<< | |
| 195 | + | |
| 196 | +insert_int_I_I_V( this : ref StringBuffer_obj, p0 : int,p1 : int) | |
| 197 | +{#>> | |
| 198 | + # insert 'p1' into the string the new string is | |
| 199 | + # left + p1 + right; where left is Ivalue[:p0] | |
| 200 | + # and right is Ivalue[p0:]. newright is | |
| 201 | + # p1+right | |
| 202 | + # assume args have been checked | |
| 203 | + # | |
| 204 | + newright := (string p1) + this.Ivalue[p0:]; | |
| 205 | + this.Ivalue = this.Ivalue[:p0] + newright; | |
| 206 | + this.count = len this.Ivalue; | |
| 207 | +}#<< | |
| 208 | + | |
| 209 | +insert_long_I_J_V( this : ref StringBuffer_obj, p0 : int,p1 : big) | |
| 210 | +{#>> | |
| 211 | + # insert 'p1' into the string the new string is | |
| 212 | + # left + p1 + right; where left is Ivalue[0:p0] | |
| 213 | + # and right is Ivalue[p0:count]. newright is | |
| 214 | + # p1+right | |
| 215 | + # | |
| 216 | + newright := (string p1) + this.Ivalue[p0:]; | |
| 217 | + this.Ivalue = this.Ivalue[:p0] + newright; | |
| 218 | + this.count = len this.Ivalue; | |
| 219 | +}#<< | |
| 220 | + | |
| 221 | +insert_str_I_rString_V( this : ref StringBuffer_obj, p0 : int,p1 : JString) | |
| 222 | +{#>> | |
| 223 | + # insert 'p1' into the string the new string is | |
| 224 | + # left + p1 + right; where left is Ivalue[0:p0] | |
| 225 | + # and right is Ivalue[p0:count]. newright is | |
| 226 | + # p1+right | |
| 227 | + # | |
| 228 | + val : string; | |
| 229 | + if ( p1 == nil ) | |
| 230 | + val = "null"; | |
| 231 | + else | |
| 232 | + val = p1.str; | |
| 233 | + newright := val + this.Ivalue[p0:]; | |
| 234 | + left := this.Ivalue[:p0]; | |
| 235 | + this.Ivalue = left + newright; | |
| 236 | + this.count = len this.Ivalue; | |
| 237 | +}#<< | |
| 238 | + | |
| 239 | +insert_chars_I_aC_V( this : ref StringBuffer_obj, p0 : int,p1 : JArrayC) | |
| 240 | +{#>> | |
| 241 | + # insert 'p1' into the string the new string is | |
| 242 | + # left + p1 + right; where left is Ivalue[:p0] | |
| 243 | + # and right is Ivalue[p0:]. newright is | |
| 244 | + # p1+right | |
| 245 | + # | |
| 246 | + if ( p1 == nil ) return; | |
| 247 | + | |
| 248 | + # get copy of old right part and lop it off | |
| 249 | + oldright := this.Ivalue[p0:]; | |
| 250 | + this.Ivalue = this.Ivalue[:p0]; | |
| 251 | + | |
| 252 | + # insert char array first | |
| 253 | + for( x:=0; x<len p1.ary; x++ ) | |
| 254 | + this.Ivalue[p0 + x] = p1.ary[x]; | |
| 255 | + | |
| 256 | + # now add the old right back | |
| 257 | + this.Ivalue += oldright; | |
| 258 | + this.count = len this.Ivalue; | |
| 259 | +}#<< | |
| 260 | + | |
| 261 | +insert_ch_I_C_V( this : ref StringBuffer_obj, p0 : int,p1 : int) | |
| 262 | +{#>> | |
| 263 | + # insert 'p1' into the string the new string is | |
| 264 | + # left + p1 + right; where left is Ivalue[:p0] | |
| 265 | + # and right is Ivalue[p0:]. newright is | |
| 266 | + # p1+right | |
| 267 | + # | |
| 268 | + newright: string; | |
| 269 | + newright[0] = p1; | |
| 270 | + newright += this.Ivalue[p0:]; | |
| 271 | + this.Ivalue = this.Ivalue[:p0] + newright; | |
| 272 | + this.count = len this.Ivalue; | |
| 273 | +}#<< | |
| 274 | + | |
| 275 | +insert_float_I_F_V( this : ref StringBuffer_obj, p0 : int,p1 : real) | |
| 276 | +{#>> | |
| 277 | + # insert 'p1' into the string the new string is | |
| 278 | + # left + p1 + right; where left is Ivalue[0:p0] | |
| 279 | + # and right is Ivalue[p0:count]. newright is | |
| 280 | + # p1+right | |
| 281 | + # | |
| 282 | + s := string p1; | |
| 283 | + if(p1 == 0.0) | |
| 284 | + s += ".0"; | |
| 285 | + newright := s + this.Ivalue[p0:]; | |
| 286 | + this.Ivalue = this.Ivalue[:p0] + newright; | |
| 287 | + this.count = len this.Ivalue; | |
| 288 | +}#<< | |
| 289 | + | |
| 290 | +insert_double_I_D_V( this : ref StringBuffer_obj, p0 : int,p1 : real) | |
| 291 | +{#>> | |
| 292 | + # insert 'p1' into the string the new string is | |
| 293 | + # left + p1 + right; where left is Ivalue[0:p0] | |
| 294 | + # and right is Ivalue[p0:count]. newright is | |
| 295 | + # p1+right | |
| 296 | + # | |
| 297 | + s := string p1; | |
| 298 | + if(p1 == 0.0) | |
| 299 | + s += ".0"; | |
| 300 | + newright := s + this.Ivalue[p0:]; | |
| 301 | + this.Ivalue = this.Ivalue[:p0] + newright; | |
| 302 | + this.count = len this.Ivalue; | |
| 303 | +}#<< | |
| 304 | + | |
| 305 | +get_string_rString( this : ref StringBuffer_obj) : JString | |
| 306 | +{#>> | |
| 307 | + return( jni->NewString( this.Ivalue[:] ) ); #return a copy | |
| 308 | +}#<< | |
| 309 | + | |
| 310 | +get_chars_aC( this : ref StringBuffer_obj) : JArrayC | |
| 311 | +{#>> | |
| 312 | + # return a char array | |
| 313 | + l := len this.Ivalue; | |
| 314 | + chars := array[l] of int; | |
| 315 | + for( x:=0; x<l; x++ ) | |
| 316 | + chars[x] = this.Ivalue[x]; | |
| 317 | + | |
| 318 | + return( jni->MkAChar( chars ) ); | |
| 319 | +}#<< | |
| 320 | + | |
| 321 | +# | |
| 322 | +# the next two functions are for serialization | |
| 323 | +# | |
| 324 | + | |
| 325 | +# | |
| 326 | +# write this.Ivalue (a Dis string) to an ObjectOutputStream as a char[] | |
| 327 | +# | |
| 328 | + | |
| 329 | +writeObject0_rObjectOutputStream_V(this : ref StringBuffer_obj, p0 : JObject) | |
| 330 | +{#>> | |
| 331 | + jaryc := jni->StringToAChar(this.Ivalue); | |
| 332 | + args := array[] of { | |
| 333 | + ref Value.TObject(cast->FromJArray(cast->IntToJArray(jaryc))) | |
| 334 | + }; | |
| 335 | + jni->CallMethod(p0, "writeObject", "(Ljava/lang/Object;)V", args); | |
| 336 | +}#<< | |
| 337 | + | |
| 338 | +# | |
| 339 | +# read a char[] from an ObjectInputStream and convert it to a Dis string | |
| 340 | +# | |
| 341 | + | |
| 342 | +readObject0_rObjectInputStream_V(this : ref StringBuffer_obj, p0 : JObject) | |
| 343 | +{#>> | |
| 344 | + jaryc : JArrayC; | |
| 345 | + | |
| 346 | + (val, ok) := jni->CallMethod(p0, "readObject", "()Ljava/lang/Object;", nil); | |
| 347 | + if(ok == JNI->OK) { | |
| 348 | + pick v := val { | |
| 349 | + TObject => | |
| 350 | + jaryc = cast->ToJArrayC(v.jobj); | |
| 351 | + } | |
| 352 | + } | |
| 353 | + if(jaryc == nil || len jaryc.ary < this.count) | |
| 354 | + jni->ThrowException("java.io.IOException", "bad StringBuffer object serialized"); | |
| 355 | + | |
| 356 | + # JavaSoft JVM serializes trailing null characters; we can ignore | |
| 357 | + for(i := 0; i < this.count; i++) | |
| 358 | + this.Ivalue[i] = jaryc.ary[i]; | |
| 359 | +}#<< | |
| @@ -0,0 +1,42 @@ | ||
| 1 | +# javal v1.4 generated file: edit with care | |
| 2 | + | |
| 3 | +##EDITED | |
| 4 | + | |
| 5 | +StringBuffer_L : module | |
| 6 | +{ | |
| 7 | + StringBuffer_obj : adt | |
| 8 | + { | |
| 9 | + cl_mod : ClassModule; | |
| 10 | + Ivalue : string; | |
| 11 | + buf_capacity : int; | |
| 12 | + value : array of int; | |
| 13 | + count : int; | |
| 14 | + shared : byte; | |
| 15 | + }; | |
| 16 | + | |
| 17 | + init : fn( jni_p : JNI ); | |
| 18 | + setLength0_I_V : fn( this : ref StringBuffer_obj, p0 : int); | |
| 19 | + charAt0_I_C : fn( this : ref StringBuffer_obj, p0 : int) : int; | |
| 20 | + getChars0_I_I_aC_I_V : fn( this : ref StringBuffer_obj, p0 : int,p1 : int,p2 : JArrayC,p3 : int); | |
| 21 | + setCharAt0_I_C_V : fn( this : ref StringBuffer_obj, p0 : int,p1 : int); | |
| 22 | + reverse0_V : fn( this : ref StringBuffer_obj); | |
| 23 | + append_int_I_V : fn( this : ref StringBuffer_obj, p0 : int); | |
| 24 | + append_long_J_V : fn( this : ref StringBuffer_obj, p0 : big); | |
| 25 | + append_str_rString_V : fn( this : ref StringBuffer_obj, p0 : JString); | |
| 26 | + append_chars_aC_I_I_V : fn( this : ref StringBuffer_obj, p0 : JArrayC,p1 : int,p2 : int); | |
| 27 | + append_ch_C_V : fn( this : ref StringBuffer_obj, p0 : int); | |
| 28 | + append_float_F_V : fn( this : ref StringBuffer_obj, p0 : real); | |
| 29 | + append_double_D_V : fn( this : ref StringBuffer_obj, p0 : real); | |
| 30 | + insert_int_I_I_V : fn( this : ref StringBuffer_obj, p0 : int,p1 : int); | |
| 31 | + insert_long_I_J_V : fn( this : ref StringBuffer_obj, p0 : int,p1 : big); | |
| 32 | + insert_str_I_rString_V : fn( this : ref StringBuffer_obj, p0 : int,p1 : JString); | |
| 33 | + insert_chars_I_aC_V : fn( this : ref StringBuffer_obj, p0 : int,p1 : JArrayC); | |
| 34 | + insert_ch_I_C_V : fn( this : ref StringBuffer_obj, p0 : int,p1 : int); | |
| 35 | + insert_float_I_F_V : fn( this : ref StringBuffer_obj, p0 : int,p1 : real); | |
| 36 | + insert_double_I_D_V : fn( this : ref StringBuffer_obj, p0 : int,p1 : real); | |
| 37 | + get_string_rString : fn( this : ref StringBuffer_obj) : JString; | |
| 38 | + get_chars_aC : fn( this : ref StringBuffer_obj) : JArrayC; | |
| 39 | + | |
| 40 | + writeObject0_rObjectOutputStream_V : fn(this : ref StringBuffer_obj, p0 : JObject); | |
| 41 | + readObject0_rObjectInputStream_V : fn(this : ref StringBuffer_obj, p0 : JObject); | |
| 42 | +}; | |
Empty file added.
| @@ -0,0 +1,517 @@ | ||
| 1 | +implement String_L; | |
| 2 | + | |
| 3 | +# javal v1.6 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JThread, | |
| 23 | + JObject : import jni; | |
| 24 | + | |
| 25 | +#>> extra pre includes here | |
| 26 | + | |
| 27 | +#<< | |
| 28 | + | |
| 29 | +include "String_L.m"; | |
| 30 | + | |
| 31 | +#>> extra post includes here | |
| 32 | +include "hash.m"; | |
| 33 | + | |
| 34 | +str : String; | |
| 35 | +hash : Hash; | |
| 36 | + | |
| 37 | +# | |
| 38 | +# the following are for the intern() method | |
| 39 | +# a pool of all Java String classes is maintained | |
| 40 | +# hashed on the actual string contents. For any | |
| 41 | +# given actual string the same Java String object | |
| 42 | +# should be returned. We maingain a hash table | |
| 43 | +# of String objects, hashed on the string value. | |
| 44 | +# | |
| 45 | +PSZ : con 31; | |
| 46 | +pool := array[PSZ] of list of JString; | |
| 47 | + | |
| 48 | +PoolAdd( jstr : JString ) | |
| 49 | +{ | |
| 50 | + idx := hash->fun1(jstr.str,PSZ); | |
| 51 | + pool[idx] = jstr :: pool[idx]; | |
| 52 | +} | |
| 53 | + | |
| 54 | +PoolGet( val : JString ) : JString | |
| 55 | +{ | |
| 56 | + # search for an existing object with same value | |
| 57 | + for( l := pool[hash->fun1(val.str,PSZ)]; l != nil; l = tl l ) | |
| 58 | + { | |
| 59 | + jstr := hd l; | |
| 60 | + if (jstr.str == val.str) | |
| 61 | + return( jstr ); | |
| 62 | + } | |
| 63 | + | |
| 64 | + # could not find so add this class | |
| 65 | + PoolAdd( val ); | |
| 66 | + return( val ); | |
| 67 | +} | |
| 68 | + | |
| 69 | +#<< | |
| 70 | + | |
| 71 | +init( jni_p : JNI ) | |
| 72 | +{ | |
| 73 | + # save java native inteface mod instance | |
| 74 | + jni = jni_p; | |
| 75 | + #>>extra initialization here | |
| 76 | + str = jni->str; | |
| 77 | + hash = load Hash Hash->PATH; | |
| 78 | + if ( hash == nil ) | |
| 79 | + jni->InitError( jni->sys->sprint( "java.lang.String: could not load %s: %r", Hash->PATH ) ); | |
| 80 | + #<< | |
| 81 | +} | |
| 82 | + | |
| 83 | +length_I( this : JString) : int | |
| 84 | +{#>> | |
| 85 | + return( len this.str ); | |
| 86 | +}#<< | |
| 87 | + | |
| 88 | +charAt_I_C( this : JString, p0 : int) : int | |
| 89 | +{#>> | |
| 90 | + if ((this.str == nil) || (p0 > (len this.str -1)) || (p0 < 0)) | |
| 91 | + jni->ThrowException( "java.lang.StringIndexOutOfBoundsException", string p0 ); | |
| 92 | + return( this.str[p0] ); | |
| 93 | +}#<< | |
| 94 | + | |
| 95 | +getChars_I_I_aC_I_V( this : JString, p0 : int,p1 : int,p2 : JArrayC,p3 : int) | |
| 96 | +{#>> | |
| 97 | + # fill the char array with each char from the string | |
| 98 | + | |
| 99 | + # do some checking first | |
| 100 | + if ( p0 < 0 ) | |
| 101 | + jni->ThrowException( "java.lang.StringIndexOutOfBoundsException", string p0 ); | |
| 102 | + if ( p1 > len this.str ) | |
| 103 | + jni->ThrowException( "java.lang.StringIndexOutOfBoundsException", string p1 ); | |
| 104 | + if ( p0 > p1 ) | |
| 105 | + jni->ThrowException( "java.lang.StringIndexOutOfBoundsException", string (p1-p0) ); | |
| 106 | + | |
| 107 | + # now check array and copy chars into | |
| 108 | + copy_count := p1-p0; # number of chars to copy | |
| 109 | + | |
| 110 | + #STD?? I will just throw an exception here if I know | |
| 111 | + # I will overwrite the array bounds. To really be | |
| 112 | + # legit I may need to copy upto the end and then throw | |
| 113 | + if ( (copy_count + p3) > (len p2.ary) ) | |
| 114 | + jni->ThrowException( "java.lang.ArrayIndexOutOfBoundsException", string (len p2.ary) ); | |
| 115 | + | |
| 116 | + # now copy chars from this string into | |
| 117 | + # the char array, starting at the indicated | |
| 118 | + # position (p3) of the char array. | |
| 119 | + for( x:=0; x<copy_count; x++ ) | |
| 120 | + p2.ary[p3+x] = this.str[p0+x]; | |
| 121 | + | |
| 122 | +}#<< | |
| 123 | + | |
| 124 | +equality_rString_Z_Z( this : JString, p0 : JString,p1 : int) : int | |
| 125 | +{#>> | |
| 126 | + if ( p0 == nil ) | |
| 127 | + return( JNI->FALSE ); | |
| 128 | + | |
| 129 | + if ( this.str == p0.str ) | |
| 130 | + return( JNI->TRUE ); | |
| 131 | + | |
| 132 | + # check if we should ignore case | |
| 133 | + if ( p1 ) | |
| 134 | + return( str->toupper(this.str) == str->toupper(p0.str) ); | |
| 135 | + | |
| 136 | + # strings not equal | |
| 137 | + return( JNI->FALSE ); | |
| 138 | + | |
| 139 | +}#<< | |
| 140 | + | |
| 141 | +compareTo_rString_I( this : JString, p0 : JString) : int | |
| 142 | +{#>> | |
| 143 | + # compare 'p0' to this. | |
| 144 | + # return: 0 => equal | |
| 145 | + # <0 => this < p0 | |
| 146 | + # >0 => this > p0 | |
| 147 | + | |
| 148 | + this_str := this.str; | |
| 149 | + other := p0.str; | |
| 150 | + | |
| 151 | + # simple equlity check | |
| 152 | + if ( this_str == other ) | |
| 153 | + return( 0 ); | |
| 154 | + | |
| 155 | + # otherwise, determine if "this" is | |
| 156 | + # lexicographically smaller than "other" | |
| 157 | + | |
| 158 | + this_len := len this_str; | |
| 159 | + other_len := len other; | |
| 160 | + min := 0; | |
| 161 | + if ( this_len < other_len ) | |
| 162 | + min = this_len; | |
| 163 | + else | |
| 164 | + min = other_len; | |
| 165 | + | |
| 166 | + # find char where strings differ | |
| 167 | + x:=0; | |
| 168 | + while( (x<min) && (this_str[x]==other[x]) ) x++; | |
| 169 | + | |
| 170 | + # is one string a proper prefix of the other? | |
| 171 | + if(x == min) | |
| 172 | + return this_len - other_len; | |
| 173 | + | |
| 174 | + # if some chars were common then "this" is | |
| 175 | + # smaller if the character where they differ | |
| 176 | + # has a smaller value than "other" | |
| 177 | + return( this_str[x] - other[x] ); | |
| 178 | +}#<< | |
| 179 | + | |
| 180 | +regionMatches_Z_I_rString_I_I_Z( this : JString, p0 : int,p1 : int,p2 : JString,p3 : int,p4 : int) : int | |
| 181 | +{#>> | |
| 182 | + # p0 => ignore case==1 | |
| 183 | + # p1 => this start index | |
| 184 | + # p2 => other string | |
| 185 | + # p3 => other start index | |
| 186 | + # p4 => length to compare | |
| 187 | + | |
| 188 | + # check params | |
| 189 | + if ( (p1<0) || (p1 > (len this.str - p4)) || | |
| 190 | + (p3<0) || (p3 > (len p2.str - p4)) ) | |
| 191 | + return( jni->FALSE ); | |
| 192 | + | |
| 193 | + this_str, other : string; | |
| 194 | + | |
| 195 | + this_last := (p1+p4); | |
| 196 | + other_last := (p3+p4); | |
| 197 | + | |
| 198 | + if ( int p0 == 1 ) | |
| 199 | + { | |
| 200 | + # ignore case | |
| 201 | + this_str = str->toupper(this.str[p1:this_last]); | |
| 202 | + other = str->toupper(p2.str[p3:other_last]); | |
| 203 | + } | |
| 204 | + else | |
| 205 | + { | |
| 206 | + # case sensitive | |
| 207 | + this_str = this.str[p1:this_last]; | |
| 208 | + other = p2.str[p3:other_last]; | |
| 209 | + } | |
| 210 | + | |
| 211 | + # now compare the two substrings | |
| 212 | + return( this_str == other ); | |
| 213 | +}#<< | |
| 214 | + | |
| 215 | +hashCode_I( this : JString) : int | |
| 216 | +{#>> | |
| 217 | + # hashcode of string as defined in JLS | |
| 218 | + strhash := 0; | |
| 219 | + this_str := this.str; | |
| 220 | + this_len := len this_str; | |
| 221 | + | |
| 222 | + if ( this_len <= 15 ) | |
| 223 | + { | |
| 224 | + for(x:=0; x<this_len; x++) | |
| 225 | + strhash = (strhash*37) + this_str[x]; | |
| 226 | + } | |
| 227 | + else | |
| 228 | + { | |
| 229 | + k := int (this_len/8); | |
| 230 | + for(x:=0; x < this_len; x+=k) | |
| 231 | + strhash = (strhash*39) + this_str[x]; | |
| 232 | + } | |
| 233 | + | |
| 234 | + return( strhash ); | |
| 235 | +}#<< | |
| 236 | + | |
| 237 | +substring_I_I_rString( this : JString, p0 : int,p1 : int) : JString | |
| 238 | +{#>> | |
| 239 | + # return string composed of chars p0..p1-1 both | |
| 240 | + # java and limbo allow the p1 to be (len this.str) | |
| 241 | + this_len := len this.str; | |
| 242 | + if ( (p0 < 0) || (p1 > this_len) || (p0 > p1) ) | |
| 243 | + jni->ThrowException( "java.lang.StringIndexOutOfBoundsException", | |
| 244 | + jni->sys->sprint( "len=%d begin=%d end=%d", this_len, p0, p1 ) ); | |
| 245 | + | |
| 246 | + return( jni->NewString( this.str[p0:p1] ) ); | |
| 247 | +}#<< | |
| 248 | + | |
| 249 | +concat_rString_rString( this : JString, p0 : JString) : JString | |
| 250 | +{#>> | |
| 251 | + if ( p0 == nil ) | |
| 252 | + jni->ThrowException( "java.lang.NullPointerException", "concat arg is null" ); | |
| 253 | + | |
| 254 | + # as defined in JLS: if p0 is 0 len return ref to this | |
| 255 | + if ( (len p0.str) == 0 ) | |
| 256 | + return( this ); | |
| 257 | + | |
| 258 | + # return a new string composed of this+p0 | |
| 259 | + return( jni->NewString( this.str + p0.str ) ); | |
| 260 | +}#<< | |
| 261 | + | |
| 262 | +replace_C_C_rString( this : JString, p0 : int,p1 : int) : JString | |
| 263 | +{#>> | |
| 264 | + # p0 => old char, p1 => new char | |
| 265 | + # if p0 does not exist in this then | |
| 266 | + # return reference to this | |
| 267 | + # otherwise return a new string which | |
| 268 | + # is composed of the 'this' with all | |
| 269 | + # old char's (p0) replaced with new chars (p1) | |
| 270 | + | |
| 271 | + newstr := this.str[:]; | |
| 272 | + found := 0; | |
| 273 | + for(x:=0; x<(len newstr); x++) | |
| 274 | + { | |
| 275 | + if ( newstr[x] == p0 ) | |
| 276 | + { | |
| 277 | + found = 1; | |
| 278 | + newstr[x] = p1; | |
| 279 | + } | |
| 280 | + } | |
| 281 | + | |
| 282 | + if ( ! found ) | |
| 283 | + return( this ); | |
| 284 | + | |
| 285 | + return( jni->NewString( newstr ) ); | |
| 286 | +}#<< | |
| 287 | + | |
| 288 | +trim_rString( this : JString) : JString | |
| 289 | +{#>> | |
| 290 | + # as defined in JLS | |
| 291 | + if ( this.str == "" ) | |
| 292 | + return( this ); | |
| 293 | + | |
| 294 | + this_str := this.str; | |
| 295 | + if ( (this_str[0] > '\u0020') && (this_str[len this_str-1] > '\u0020') ) | |
| 296 | + return( this ); | |
| 297 | + | |
| 298 | + # look for first char > \u0020 | |
| 299 | + for( x:=0; x<(len this_str); x++ ) | |
| 300 | + if ( this_str[x] > '\u0020' ) break; | |
| 301 | + | |
| 302 | + # if no chars < \u0020 found return a new "empty string" | |
| 303 | + if ( x == len this_str ) | |
| 304 | + return( jni->NewString( "" ) ); | |
| 305 | + | |
| 306 | + first := x; | |
| 307 | + | |
| 308 | + # look for last char > \u0020 | |
| 309 | + for( x=(len this_str -1); x >= 0; x-- ) | |
| 310 | + if ( this_str[x] > '\u0020' ) break; | |
| 311 | + | |
| 312 | + last := x; # this has to be at least ==first | |
| 313 | + | |
| 314 | + return( jni->NewString( this_str[first:last+1] ) ); | |
| 315 | + | |
| 316 | +}#<< | |
| 317 | + | |
| 318 | +intern_rString( this : JString) : JString | |
| 319 | +{#>> | |
| 320 | + # as defined in JLS | |
| 321 | + # need to maintain a private pool of String | |
| 322 | + # objects and return the same object for a | |
| 323 | + # given string | |
| 324 | + return( PoolGet( this ) ); | |
| 325 | +}#<< | |
| 326 | + | |
| 327 | +utfLength_I( this : JString) : int | |
| 328 | +{#>> | |
| 329 | + b : array of byte; | |
| 330 | + b = array of byte this.str; | |
| 331 | + return( len b ); | |
| 332 | +}#<< | |
| 333 | + | |
| 334 | +fill_aC_I_I_V( this : JString, p0 : JArrayC,p1 : int,p2 : int) | |
| 335 | +{#>> | |
| 336 | + # | |
| 337 | + # create a newstring from the array of int | |
| 338 | + # | |
| 339 | + | |
| 340 | + # check array length | |
| 341 | + if ( (p1+p2) > len p0.ary ) | |
| 342 | + jni->ThrowException( "java.lang.ArrayIndexOutOfBoundsException", string (len p0.ary) ); | |
| 343 | + | |
| 344 | + this.str = nil; # get rid of what is there | |
| 345 | + | |
| 346 | + # now append each char to the string value | |
| 347 | + # Lecuona correction: for( x:=0; x<(p2-p1); x++ ) | |
| 348 | + for( x:=0; x<p2; x++ ) | |
| 349 | + this.str[x] = p0.ary[x+p1]; | |
| 350 | +}#<< | |
| 351 | + | |
| 352 | +isPrefix_rString_I_Z( this : JString, p0 : JString,p1 : int) : int | |
| 353 | +{#>> | |
| 354 | + # p0 => string to compare | |
| 355 | + # p1 => start index | |
| 356 | + | |
| 357 | + # do some checking | |
| 358 | + if ( p0 == nil ) | |
| 359 | + jni->ThrowException( "java.lang.NullPointerException", "String.isPrefix()" ); | |
| 360 | + other_len := len p0.str; | |
| 361 | + endix := other_len + p1; # can overflow | |
| 362 | + if ( p1 < 0 || endix > len this.str || endix < 0 ) | |
| 363 | + return( jni->FALSE ); | |
| 364 | + if ( other_len == 0 ) | |
| 365 | + return( jni->TRUE ); # JLS defined | |
| 366 | + return( p0.str == this.str[p1:p1+other_len] ); | |
| 367 | +}#<< | |
| 368 | + | |
| 369 | +isSuffix_rString_Z( this : JString, p0 : JString) : int | |
| 370 | +{#>> | |
| 371 | + start := (len this.str) - (len p0.str); | |
| 372 | + if ( start < 0 ) | |
| 373 | + return( jni->FALSE ); | |
| 374 | + | |
| 375 | + return( p0.str == this.str[start:] ); | |
| 376 | +}#<< | |
| 377 | + | |
| 378 | +uppercase_rString( this : JString) : JString | |
| 379 | +{#>> | |
| 380 | + return( jni->NewString( str->toupper(this.str) ) ); | |
| 381 | +}#<< | |
| 382 | + | |
| 383 | +lowercase_rString( this : JString) : JString | |
| 384 | +{#>> | |
| 385 | + return( jni->NewString( str->tolower(this.str) ) ); | |
| 386 | +}#<< | |
| 387 | + | |
| 388 | +index_rString_I_I( this : JString, p0 : JString,p1 : int) : int | |
| 389 | +{#>> | |
| 390 | + # p0 => string to match | |
| 391 | + # p1 => index to start search from | |
| 392 | + # p2 => searche left-right=1 right-left=0 | |
| 393 | + this_str := this.str; | |
| 394 | + this_len := len this_str; | |
| 395 | + other := p0.str; | |
| 396 | + other_len := len other; | |
| 397 | + | |
| 398 | + # if other > this then it can't be a substring | |
| 399 | + if ( other_len > this_len ) | |
| 400 | + return( -1 ); | |
| 401 | + | |
| 402 | + # if start index <0 make it 0, if > len return -1 | |
| 403 | + from := 0; | |
| 404 | + if ( p1 > 0 ) | |
| 405 | + { | |
| 406 | + from = p1; | |
| 407 | + # this also handles p1 > this_len | |
| 408 | + # which will return -1 below, we | |
| 409 | + } | |
| 410 | + | |
| 411 | + # null string always matches | |
| 412 | + if ( other_len == 0 ) | |
| 413 | + return from; | |
| 414 | + | |
| 415 | + # determine char of this to stop searching on | |
| 416 | + stop_char := this_len - other_len; | |
| 417 | + | |
| 418 | + # look for first-char match then | |
| 419 | + # match the substring. | |
| 420 | + for( i:=from; i <= stop_char; i++ ) | |
| 421 | + if ( (this_str[i] == other[0]) && | |
| 422 | + (this_str[i:i+other_len] == other) ) | |
| 423 | + return( i ); | |
| 424 | + | |
| 425 | + # match failed | |
| 426 | + return( -1 ); | |
| 427 | +}#<< | |
| 428 | + | |
| 429 | +index_I_I_I( this : JString, p0 : int,p1 : int) : int | |
| 430 | +{#>> | |
| 431 | + # p0 => char to match | |
| 432 | + # p1 => start index | |
| 433 | + | |
| 434 | + this_str := this.str; | |
| 435 | + this_len := len this_str; | |
| 436 | + | |
| 437 | + # if start index <0 make it 0, if > len return -1 | |
| 438 | + from := 0; | |
| 439 | + if ( p1 > 0 ) | |
| 440 | + from = p1; | |
| 441 | + | |
| 442 | + # start from left, | |
| 443 | + # look for first match | |
| 444 | + for( i:=from; i < this_len; i++ ) | |
| 445 | + if ( this_str[i] == p0 ) | |
| 446 | + return( i ); | |
| 447 | + | |
| 448 | + # match failed | |
| 449 | + return( -1 ); | |
| 450 | +}#<< | |
| 451 | + | |
| 452 | +rindex_rString_I_Z_I( this : JString, p0 : JString,p1 : int,p2 : int) : int | |
| 453 | +{#>> | |
| 454 | + # p0 => string to match | |
| 455 | + # p1 => index to start search from | |
| 456 | + # p2 => 1 == search from end (ignore p1) | |
| 457 | + this_str := this.str; | |
| 458 | + this_len := len this_str; | |
| 459 | + other := p0.str; | |
| 460 | + other_len := len other; | |
| 461 | + | |
| 462 | + # if other > this then it can't be a substring | |
| 463 | + if ( other_len > this_len ) | |
| 464 | + return( -1 ); | |
| 465 | + | |
| 466 | + # if start index > this_len-other_len make it this_len-other_len | |
| 467 | + # if < 0 return -1 | |
| 468 | + from := this_len - other_len; | |
| 469 | + if ( (p2 != 1) && (p1 < from) ) | |
| 470 | + { | |
| 471 | + from = p1; | |
| 472 | + # this also handles the defined case | |
| 473 | + # of p1 < 0 is the same as p1==-1 and | |
| 474 | + # will return -1 below | |
| 475 | + } | |
| 476 | + | |
| 477 | + # start from end | |
| 478 | + if ( other_len == 0 ) | |
| 479 | + return( from ); # empty string always matches | |
| 480 | + | |
| 481 | + # look for first char match starting from right | |
| 482 | + # then match the substring | |
| 483 | + for( i:=from; i >= 0; i-- ) | |
| 484 | + if ( (this_str[i] == other[0]) && | |
| 485 | + (this_str[i:i+other_len] == other) ) | |
| 486 | + return(i); | |
| 487 | + | |
| 488 | + return(-1); #no match | |
| 489 | +}#<< | |
| 490 | + | |
| 491 | +rindex_I_I_Z_I( this : JString, p0 : int,p1 : int,p2 : int) : int | |
| 492 | +{#>> | |
| 493 | + # p0 => char to match | |
| 494 | + # p1 => start index | |
| 495 | + # p2 => 1 == scan from (len this.str -1) | |
| 496 | + | |
| 497 | + this_str := this.str; | |
| 498 | + | |
| 499 | + # if start index < 0 return -1, if > len this.str make it the length | |
| 500 | + from := len this_str - 1; | |
| 501 | + if ( (p2 != 1) && (p1 < from) ) | |
| 502 | + { | |
| 503 | + from = p1; | |
| 504 | + } | |
| 505 | + | |
| 506 | + # start from right | |
| 507 | + # look for first match | |
| 508 | + for( i:=from; i >= 0; i-- ) | |
| 509 | + if ( this_str[i] == p0 ) | |
| 510 | + return(i); | |
| 511 | + | |
| 512 | + # match failed | |
| 513 | + return( -1 ); | |
| 514 | +}#<< | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| @@ -0,0 +1,30 @@ | ||
| 1 | +# javal v1.6 generated file: edit with care | |
| 2 | + | |
| 3 | +String_L : module | |
| 4 | +{ | |
| 5 | + | |
| 6 | + init : fn( jni_p : JNI ); | |
| 7 | + length_I : fn( this : JString) : int; | |
| 8 | + charAt_I_C : fn( this : JString, p0 : int) : int; | |
| 9 | + getChars_I_I_aC_I_V : fn( this : JString, p0 : int,p1 : int,p2 : JArrayC,p3 : int); | |
| 10 | + equality_rString_Z_Z : fn( this : JString, p0 : JString,p1 : int) : int; | |
| 11 | + compareTo_rString_I : fn( this : JString, p0 : JString) : int; | |
| 12 | + regionMatches_Z_I_rString_I_I_Z : fn( this : JString, p0 : int,p1 : int,p2 : JString,p3 : int,p4 : int) : int; | |
| 13 | + hashCode_I : fn( this : JString) : int; | |
| 14 | + substring_I_I_rString : fn( this : JString, p0 : int,p1 : int) : JString; | |
| 15 | + concat_rString_rString : fn( this : JString, p0 : JString) : JString; | |
| 16 | + replace_C_C_rString : fn( this : JString, p0 : int,p1 : int) : JString; | |
| 17 | + trim_rString : fn( this : JString) : JString; | |
| 18 | + intern_rString : fn( this : JString) : JString; | |
| 19 | + utfLength_I : fn( this : JString) : int; | |
| 20 | + fill_aC_I_I_V : fn( this : JString, p0 : JArrayC,p1 : int,p2 : int); | |
| 21 | + isPrefix_rString_I_Z : fn( this : JString, p0 : JString,p1 : int) : int; | |
| 22 | + isSuffix_rString_Z : fn( this : JString, p0 : JString) : int; | |
| 23 | + uppercase_rString : fn( this : JString) : JString; | |
| 24 | + lowercase_rString : fn( this : JString) : JString; | |
| 25 | + index_rString_I_I : fn( this : JString, p0 : JString,p1 : int) : int; | |
| 26 | + index_I_I_I : fn( this : JString, p0 : int,p1 : int) : int; | |
| 27 | + rindex_rString_I_Z_I : fn( this : JString, p0 : JString,p1 : int,p2 : int) : int; | |
| 28 | + rindex_I_I_Z_I : fn( this : JString, p0 : int,p1 : int,p2 : int) : int; | |
| 29 | + | |
| 30 | +}; | |
Empty file added.
| @@ -0,0 +1,133 @@ | ||
| 1 | +implement System_L; | |
| 2 | + | |
| 3 | +# javal v1.2 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JObject : import jni; | |
| 23 | + | |
| 24 | +#>> extra pre includes here | |
| 25 | + | |
| 26 | +#<< | |
| 27 | + | |
| 28 | +include "System_L.m"; | |
| 29 | + | |
| 30 | +#>> extra post includes here | |
| 31 | +include "workdir.m"; | |
| 32 | + | |
| 33 | +cast : Cast; | |
| 34 | +system_class : JNI->ClassData; # java.lang.System class data | |
| 35 | + | |
| 36 | +#<< | |
| 37 | + | |
| 38 | +init( jni_p : JNI ) | |
| 39 | +{ | |
| 40 | + # save java native inteface mod instance | |
| 41 | + jni = jni_p; | |
| 42 | + #>>extra initialization here | |
| 43 | + system_class = jni->FindClass( "java/lang/System" ); | |
| 44 | + if ( system_class == nil ) | |
| 45 | + jni->InitError( "System_L.init(): failed to find System class" ); | |
| 46 | + | |
| 47 | + # we Cast in this module | |
| 48 | + cast = jni->CastMod(); | |
| 49 | + #<< | |
| 50 | +} | |
| 51 | + | |
| 52 | +setIn0_rInputStream_V( p0 : JObject) | |
| 53 | +{#>> | |
| 54 | + Value : import JNI; | |
| 55 | + val := ref Value.TObject(p0); | |
| 56 | + jni->SetStaticField( system_class, "in", val ); | |
| 57 | +}#<< | |
| 58 | + | |
| 59 | +setOut0_rPrintStream_V( p0 : JObject) | |
| 60 | +{#>> | |
| 61 | + Value : import JNI; | |
| 62 | + val := ref Value.TObject(p0); | |
| 63 | + jni->SetStaticField( system_class, "out", val ); | |
| 64 | +}#<< | |
| 65 | + | |
| 66 | +setErr0_rPrintStream_V( p0 : JObject) | |
| 67 | +{#>> | |
| 68 | + Value : import JNI; | |
| 69 | + val := ref Value.TObject(p0); | |
| 70 | + jni->SetStaticField( system_class, "err", val ); | |
| 71 | +}#<< | |
| 72 | + | |
| 73 | +currentTimeMillis_J( ) : big | |
| 74 | +{#>> | |
| 75 | + fd := jni->sys->open("#c/time", jni->sys->OREAD); | |
| 76 | + if(fd == nil) | |
| 77 | + return big 0; | |
| 78 | + buf := array[128] of byte; | |
| 79 | + n := jni->sys->read(fd, buf, len buf); | |
| 80 | + if(n < 0) | |
| 81 | + return big 0; | |
| 82 | + | |
| 83 | + return ( (big string buf[:n]) / big 1000 ); | |
| 84 | +}#<< | |
| 85 | + | |
| 86 | +arraycopy_rObject_I_rObject_I_I_V( p0 : JObject,p1 : int,p2 : JObject,p3 : int,p4 : int) | |
| 87 | +{#>> | |
| 88 | + jni->jldr->arraycopy( cast->ToJArray(p0), p1, cast->ToJArray(p2), p3, p4 ); | |
| 89 | +}#<< | |
| 90 | + | |
| 91 | +identityHashCode_rObject_I( p0 : JObject) : int | |
| 92 | +{#>> | |
| 93 | + return( jni->IdentityHash(p0) ); | |
| 94 | +}#<< | |
| 95 | + | |
| 96 | +GetUserName_rString( ) : JString | |
| 97 | +{#>> | |
| 98 | + # return the current inferno user | |
| 99 | + # name as a Java String | |
| 100 | + # | |
| 101 | + user_name : string; | |
| 102 | + | |
| 103 | + fd := jni->sys->open("#c/user", jni->sys->OREAD); | |
| 104 | + if(fd == nil) | |
| 105 | + user_name = "unknown"; | |
| 106 | + else { | |
| 107 | + buf := array[128] of byte; | |
| 108 | + n := jni->sys->read(fd, buf, len buf); | |
| 109 | + if(n < 0) | |
| 110 | + user_name = "unknown"; | |
| 111 | + else | |
| 112 | + user_name = string buf[:n]; | |
| 113 | + } | |
| 114 | + | |
| 115 | + # make java string from user name | |
| 116 | + return( jni->NewString( user_name ) ); | |
| 117 | +}#<< | |
| 118 | + | |
| 119 | +GetCWD_rString( ) : JString | |
| 120 | +{#>> | |
| 121 | + # return the current working directory | |
| 122 | + # as a Java String | |
| 123 | + # | |
| 124 | + # this fct is really only called once so | |
| 125 | + # just load Workdir right here | |
| 126 | + wdir := load Workdir Workdir->PATH; | |
| 127 | + if ( wdir == nil ) | |
| 128 | + jni->InitError( jni->sys->sprint( "java.lang.System: could not load %s: %r", Workdir->PATH ) ); | |
| 129 | + | |
| 130 | + return( jni->NewString( wdir->init() ) ); | |
| 131 | +}#<< | |
| 132 | + | |
| 133 | + | |
| @@ -0,0 +1,20 @@ | ||
| 1 | +# javal v1.2 generated file: edit with care | |
| 2 | + | |
| 3 | +System_L : module | |
| 4 | +{ | |
| 5 | + System_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + }; | |
| 9 | + | |
| 10 | + init : fn( jni_p : JNI ); | |
| 11 | + setIn0_rInputStream_V : fn( p0 : JObject); | |
| 12 | + setOut0_rPrintStream_V : fn( p0 : JObject); | |
| 13 | + setErr0_rPrintStream_V : fn( p0 : JObject); | |
| 14 | + currentTimeMillis_J : fn( ) : big; | |
| 15 | + arraycopy_rObject_I_rObject_I_I_V : fn( p0 : JObject,p1 : int,p2 : JObject,p3 : int,p4 : int); | |
| 16 | + identityHashCode_rObject_I : fn( p0 : JObject) : int; | |
| 17 | + GetUserName_rString : fn( ) : JString; | |
| 18 | + GetCWD_rString : fn( ) : JString; | |
| 19 | + | |
| 20 | +}; | |
Empty file added.
Empty file added.
Empty file added.
| @@ -0,0 +1,455 @@ | ||
| 1 | +implement Thread_L; | |
| 2 | + | |
| 3 | +# javal v1.3 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JThread, | |
| 23 | + JObject : import jni; | |
| 24 | + | |
| 25 | +#>> extra pre includes here | |
| 26 | + | |
| 27 | +#<< | |
| 28 | + | |
| 29 | +include "Thread_L.m"; | |
| 30 | + | |
| 31 | +#>> extra post includes here | |
| 32 | + | |
| 33 | +sys : Sys; | |
| 34 | +jldr : JavaClassLoader; | |
| 35 | +cast : Cast; | |
| 36 | + | |
| 37 | +# following used for calling Thread.run() | |
| 38 | +threadclass : JNI->ClassData; #class data for java.lang.Thread | |
| 39 | +thread_run_idx : int; #method index for Thread.run() | |
| 40 | +thread_exit_idx : int; #method index for Thread.exit() | |
| 41 | + | |
| 42 | +# some imports | |
| 43 | +ThreadData : import jldr; | |
| 44 | + | |
| 45 | +#<< | |
| 46 | + | |
| 47 | +init( jni_p : JNI ) | |
| 48 | +{ | |
| 49 | + # save java native inteface mod instance | |
| 50 | + jni = jni_p; | |
| 51 | + #>>extra initialization here | |
| 52 | + | |
| 53 | + sys = jni->sys; | |
| 54 | + jldr = jni->jldr; | |
| 55 | + cast = jni->CastMod(); | |
| 56 | + | |
| 57 | + threadclass = jni->FindClass( "java.lang.Thread" ); | |
| 58 | + if ( threadclass == nil ) | |
| 59 | + jni->InitError( "Thread_L.init(): could not get thread class" ); | |
| 60 | + | |
| 61 | + Class : import jldr; | |
| 62 | + thread_run_idx = threadclass.findvmethod( "run", "()V" ); | |
| 63 | + if ( thread_run_idx == -1 ) | |
| 64 | + jni->InitError( "Thread_L.init(): could not locate Thread.run()" ); | |
| 65 | + | |
| 66 | + #thread_exit_idx = threadclass.findvmethod( "exit", "()V" ); | |
| 67 | + #if ( exit_idx == -1 ) | |
| 68 | + # jni->InitError( "Thread_L.init(): could not locate Thread.exit()" ); | |
| 69 | + #<< | |
| 70 | +} | |
| 71 | + | |
| 72 | +currentThread_rThread( ) : JThread | |
| 73 | +{#>> | |
| 74 | + e := ref Sys->Exception; | |
| 75 | + if ( sys->rescue("*",e) == Sys->HANDLER ) | |
| 76 | + { | |
| 77 | + # get the java thread object assocciated | |
| 78 | + # with this thread. it is stored in the | |
| 79 | + # class loader's thread structure. | |
| 80 | + thd_obj := jldr->getthreaddata().this; | |
| 81 | + if ( thd_obj != nil ) | |
| 82 | + return( cast->JObjToJThd(thd_obj) ); | |
| 83 | + sys->unrescue(); | |
| 84 | + } | |
| 85 | + else | |
| 86 | + sys->rescued(Sys->ONCE, nil); | |
| 87 | + | |
| 88 | + | |
| 89 | + # either we could not find the thread data | |
| 90 | + # or no "Thread" object was stored in it | |
| 91 | + # either way we are in bad shape | |
| 92 | + jni->FatalError( "could not get thread object" ); | |
| 93 | + | |
| 94 | + return(nil); | |
| 95 | +}#<< | |
| 96 | + | |
| 97 | +yield_V( ) | |
| 98 | +{#>> | |
| 99 | + jni->sys->sleep(0); | |
| 100 | +}#<< | |
| 101 | + | |
| 102 | +sleep_J_V( p0 : big) | |
| 103 | +{#>> | |
| 104 | + millis := int p0; | |
| 105 | + | |
| 106 | + if ( millis < 1 ) | |
| 107 | + { | |
| 108 | + if ( millis == 0 ) | |
| 109 | + { | |
| 110 | + # just yield thread | |
| 111 | + jni->sys->sleep(0); | |
| 112 | + return; | |
| 113 | + } | |
| 114 | + | |
| 115 | + # bad sleep value | |
| 116 | + jni->ThrowException( "java.lang.IllegalArgumentException", "timeout value is negative" ); | |
| 117 | + } | |
| 118 | + jldr->sleep( millis ); | |
| 119 | +}#<< | |
| 120 | + | |
| 121 | +start_V( this : JThread) | |
| 122 | +{#>> | |
| 123 | + thdobj := cast->JThdToJObj(this); | |
| 124 | + | |
| 125 | + # grab the lock on the thread object to ensure | |
| 126 | + # no state is changed while we are starting the | |
| 127 | + # thread. | |
| 128 | +# jni->MonitorEnter( thdobj ); | |
| 129 | + | |
| 130 | + if ( (this.stillborn == byte 0) && (this.PrivateInfo == nil) ) | |
| 131 | + { | |
| 132 | + # spawn a limbo fct as the java | |
| 133 | + # thread's starting point. | |
| 134 | + ok := chan of int; | |
| 135 | + spawn javathreadinit( this, ok ); | |
| 136 | + | |
| 137 | + # wait for thread to init then we can | |
| 138 | + # continue. Note we hold a lock and | |
| 139 | + # the thread will change some state | |
| 140 | + # and notify us before the java run() | |
| 141 | + # method is invoked. The purpose is to | |
| 142 | + # allow for state information to be updated | |
| 143 | + # while we have the lock. | |
| 144 | + status := <- ok; | |
| 145 | + | |
| 146 | + #status == 0 is an err | |
| 147 | + # == 1 is ok | |
| 148 | + | |
| 149 | + if ( status == 0 ) | |
| 150 | + { | |
| 151 | + this.stillborn = byte 1; | |
| 152 | + this.PrivateInfo = nil; | |
| 153 | + } | |
| 154 | + | |
| 155 | + } | |
| 156 | +# jni->MonitorExit( thdobj ); | |
| 157 | +}#<< | |
| 158 | + | |
| 159 | +isInterrupted_Z_Z( this : JThread, p0 : int) : int | |
| 160 | +{#>> | |
| 161 | + old_flag := int this.was_interrupted; | |
| 162 | + | |
| 163 | + if ( old_flag ) | |
| 164 | + this.was_interrupted = byte p0; | |
| 165 | + return( old_flag ); | |
| 166 | +}#<< | |
| 167 | + | |
| 168 | +isAlive_Z( this : JThread) : int | |
| 169 | +{#>> | |
| 170 | + thd := this.PrivateInfo; | |
| 171 | + if ( (this.stillborn == byte 0) && (thd != nil) ) | |
| 172 | + { | |
| 173 | + # JLS does not require that we actually determine | |
| 174 | + # the "os" thread is alive, just that the object | |
| 175 | + # state indicates it is | |
| 176 | + return( JNI->TRUE ); | |
| 177 | + } | |
| 178 | + | |
| 179 | + # looks like thread is not alive | |
| 180 | + return( jni->FALSE ); | |
| 181 | +}#<< | |
| 182 | + | |
| 183 | +countStackFrames_I( this : JThread) : int | |
| 184 | +{#>> | |
| 185 | + junk := this; | |
| 186 | + # need to do some /prog work | |
| 187 | + return( 0 ); | |
| 188 | +}#<< | |
| 189 | + | |
| 190 | +setPriority0_I_V( this : JThread, p0 : int) | |
| 191 | +{#>> | |
| 192 | + # just save the priority, a dis thread | |
| 193 | + # has no priority | |
| 194 | + this.priority = p0; | |
| 195 | +}#<< | |
| 196 | + | |
| 197 | +stop0_rObject_V( this : JThread, p0 : JObject) | |
| 198 | +{#>> | |
| 199 | + # the calling thread is attempting to throw an | |
| 200 | + # exception at "this" thread (i.e. the one represented | |
| 201 | + # by this thread object. make sure that thread at least | |
| 202 | + # appears to be running and throw the exceptio at it | |
| 203 | + | |
| 204 | + thd := this.PrivateInfo; | |
| 205 | + stillborn := this.stillborn; | |
| 206 | + | |
| 207 | + # prevent a start or re-start | |
| 208 | + this.stillborn = byte 1; | |
| 209 | + | |
| 210 | + if ( (stillborn == byte 0) && (thd != nil) ) | |
| 211 | + { | |
| 212 | + # throw the exception (p0) at the thread | |
| 213 | + jldr->stop( thd, p0 ); | |
| 214 | + } | |
| 215 | + | |
| 216 | +}#<< | |
| 217 | + | |
| 218 | +suspend0_V( this : JThread) | |
| 219 | +{#>> | |
| 220 | + # the calling thread wants to suspend | |
| 221 | + # the "this" thread. | |
| 222 | + thd := this.PrivateInfo; | |
| 223 | + if ( (this.stillborn == byte 0) && (thd != nil) ) | |
| 224 | + jldr->suspend( thd ); | |
| 225 | + | |
| 226 | +}#<< | |
| 227 | + | |
| 228 | +resume0_V( this : JThread) | |
| 229 | +{#>> | |
| 230 | + # the calling thread wants to resume | |
| 231 | + # the "this" thread. | |
| 232 | + thd := this.PrivateInfo; | |
| 233 | + if ( (this.stillborn == byte 0) && (thd != nil) ) | |
| 234 | + jldr->resume( thd ); | |
| 235 | +}#<< | |
| 236 | + | |
| 237 | +interrupt0_V( this : JThread) | |
| 238 | +{#>> | |
| 239 | + # the calling thread wants to interrupt | |
| 240 | + # the "this" thread. | |
| 241 | + thd := this.PrivateInfo; | |
| 242 | + if ( (this.stillborn == byte 0) && (thd != nil) ) | |
| 243 | + jldr->interrupt( thd ); | |
| 244 | +}#<< | |
| 245 | + | |
| 246 | +lowinit_rThread_V( p0 : JThread) | |
| 247 | +{#>> | |
| 248 | + # this fct is called once during the static init of the | |
| 249 | + # java.lang.Thread object. 'p0' is the "root thread" object | |
| 250 | + # which must be associated witht the Dis thread which is | |
| 251 | + # calling this fuction -- i.e. associate the 'p0' java thread | |
| 252 | + # object with the current Dis thread. 'p1' is the same thread | |
| 253 | + # object, just with the type JObject which allows us to store | |
| 254 | + # it off in the JavaClassLoader->ThreadData structure associated | |
| 255 | + # with the calling Dis thread. | |
| 256 | + | |
| 257 | + # since this is the root thread make a root thread group by | |
| 258 | + # creating an instance of ThreadGroup and calling its private | |
| 259 | + # default constructor. | |
| 260 | + thd_grp_cl := jni->FindClass( "java.lang.ThreadGroup" ); | |
| 261 | + if ( thd_grp_cl == nil ) | |
| 262 | + jni->FatalError( "could not obtain ThreadGroup class" ); | |
| 263 | + | |
| 264 | + thd_grp := jni->NewObject( thd_grp_cl ); | |
| 265 | + if ( thd_grp == nil ) | |
| 266 | + jni->FatalError( "could not created root threadgroup" ); | |
| 267 | + p0.group = thd_grp; | |
| 268 | + | |
| 269 | + # get the ThreadData structure for the calling thread | |
| 270 | + thd := jldr->getthreaddata(); | |
| 271 | + thd.this = cast->JThdToJObj(p0); # save java object in thread data | |
| 272 | + p0.PrivateInfo = thd; # save thread data in java object | |
| 273 | + | |
| 274 | +}#<< | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | +##### private functions used by the Thread_L module | |
| 281 | + | |
| 282 | +# | |
| 283 | +# this function is the first function of all java | |
| 284 | +# threads, except for the first thread which is | |
| 285 | +# controlled by the JavaClassLoader module. | |
| 286 | +# | |
| 287 | +# jthd : the Java thread object associated with this | |
| 288 | +# Dis thread. | |
| 289 | +# | |
| 290 | +# ok : use this channel to notify "spawner" that | |
| 291 | +# we are under-way. send 0==fail; 1==ok | |
| 292 | +# | |
| 293 | +javathreadinit( jthd : JNI->JThread, ok : chan of int ) | |
| 294 | +{ | |
| 295 | + # create a JavaClassLoader->ThreadData structure | |
| 296 | + # and "register" it with the class loader. | |
| 297 | + | |
| 298 | + thd := jldr->getthreaddata(); | |
| 299 | + | |
| 300 | + if ( thd.this != nil ) | |
| 301 | + { | |
| 302 | + # this should be nil, else the java thread | |
| 303 | + # already is set for this Dis thread and we | |
| 304 | + # are in some screwed-up state. | |
| 305 | + ok <-= 0; | |
| 306 | + return; | |
| 307 | + } | |
| 308 | + | |
| 309 | + # now fill in the java thread obj (after | |
| 310 | + # the putthreaddata so any init is not affected | |
| 311 | + thdobj := cast->JThdToJObj( jthd ); | |
| 312 | + thd.this = thdobj; | |
| 313 | + | |
| 314 | + # now save the ThreadData in the java object in order | |
| 315 | + # to allow a lookup from the other diretion | |
| 316 | + jthd.PrivateInfo = thd; | |
| 317 | + | |
| 318 | + # set our daemon thread status | |
| 319 | + if ( jthd.daemon == JNI->BTRUE ) | |
| 320 | + jldr->daemonize(); | |
| 321 | + | |
| 322 | + # notify spawner we are under-way | |
| 323 | + ok <- = 1; | |
| 324 | + | |
| 325 | + # we need to catch any exceptions in order | |
| 326 | + # to clean up the thread object's state | |
| 327 | + ee := ref Sys->Exception; | |
| 328 | + if ( sys->rescue( "*", ee ) == Sys->HANDLER ) | |
| 329 | + { | |
| 330 | + | |
| 331 | + # call Thread.run() or Runnable.run() | |
| 332 | + Run( jthd, thdobj ); | |
| 333 | + | |
| 334 | + # call Thread.exit() | |
| 335 | + (mod,idx) := jni->FindMethod( threadclass, "exit", "()V", JNI->METH_PRIVATE ); | |
| 336 | + jni->jassist->mcall1( mod, idx, thdobj ); | |
| 337 | + sys->unrescue(); | |
| 338 | + } | |
| 339 | + else | |
| 340 | + { | |
| 341 | + # clear exception | |
| 342 | + sys->rescued( Sys->ONCE, nil ); | |
| 343 | + | |
| 344 | + # thread threw an unhandled exception so | |
| 345 | + # call the ThreadGroup.uncaughtException() | |
| 346 | + # method. | |
| 347 | + UncaughtException( jthd, thdobj, ee ); | |
| 348 | + } | |
| 349 | + | |
| 350 | + # java thread clean up | |
| 351 | + | |
| 352 | + jni->jldr->monitorenter( thdobj ); ##LOCK thread object | |
| 353 | + { | |
| 354 | + | |
| 355 | + jthd.stillborn = byte 1; # prevent re-run | |
| 356 | + | |
| 357 | + # notify ALL "waiters" (which includes any Thread.join()'s) | |
| 358 | + jni->jldr->monitornotify( thdobj, 1 ); | |
| 359 | + } | |
| 360 | + jni->jldr->monitorexit( thdobj ); ##UNLOCK thread object | |
| 361 | + | |
| 362 | + # clean up thread structures | |
| 363 | + jldr->delthreaddata(); | |
| 364 | + thd.this = nil; | |
| 365 | + jthd.PrivateInfo = nil; | |
| 366 | +} | |
| 367 | + | |
| 368 | + | |
| 369 | +# | |
| 370 | +# if the thread object contains a "registered" Runnable | |
| 371 | +# object then execute that Runnable's run() method, else | |
| 372 | +# execute the Thread's run() method (which should be | |
| 373 | +# overridden. | |
| 374 | +# | |
| 375 | +Run( jthd : JNI->JThread, thdobj : JObject ) | |
| 376 | +{ | |
| 377 | + Class : import jldr; | |
| 378 | + class : JNI->ClassData; | |
| 379 | + run_idx := thread_run_idx; #default to Thread.run() | |
| 380 | + obj := thdobj; #this obj for run() call | |
| 381 | + | |
| 382 | + if ( jthd.target != nil ) | |
| 383 | + { | |
| 384 | + # the thread has a registered Runnable | |
| 385 | + # object, find its run() method | |
| 386 | + class = jni->GetObjectClassData( jthd.target ); | |
| 387 | + run_idx = class.findvmethod( "run", "()V" ); | |
| 388 | + if ( run_idx == -1 ) | |
| 389 | + return; | |
| 390 | + obj = jthd.target; #set 'this' to the runnable obj | |
| 391 | + } | |
| 392 | + else | |
| 393 | + { | |
| 394 | + # use the thread object's run() | |
| 395 | + class = jni->GetObjectClassData(thdobj); | |
| 396 | + } | |
| 397 | + | |
| 398 | + run_method := class.virtualmethods[run_idx]; | |
| 399 | + | |
| 400 | + # do the run() | |
| 401 | + jni->jassist->mcall1( run_method.class.mod, run_method.field.value, obj ); | |
| 402 | +} | |
| 403 | + | |
| 404 | +# | |
| 405 | +# If the thread's ThreadGroup is a subclass of java.lang.ThreadGroup | |
| 406 | +# then invoke that class'es "uncaughtException" method. This | |
| 407 | +# method is called whenever a thread does not handle an exception. | |
| 408 | +# The method is passed an instance of the Thread along with the | |
| 409 | +# "throwable" (i.e. exception). | |
| 410 | +# | |
| 411 | +UncaughtException( jthd : JThread, thdobj : JObject, ee : ref Sys->Exception ) | |
| 412 | +{ | |
| 413 | + tgrp_cl := jni->GetObjectClassData( jthd.group ); | |
| 414 | + | |
| 415 | + # | |
| 416 | + # if the thread group is the default thread group | |
| 417 | + # class, then we will handle the excepition here | |
| 418 | + # which is to simply do nothing. | |
| 419 | + # | |
| 420 | + if ( tgrp_cl.name != "java/lang/ThreadGroup" ) | |
| 421 | + { | |
| 422 | + # call method, protected against exceptions | |
| 423 | + # since we must still clean-up the thread | |
| 424 | + eee := ref Sys->Exception; | |
| 425 | + if ( sys->rescue( "*", eee ) == Sys->HANDLER ) | |
| 426 | + { | |
| 427 | + # find the uncaughtException method for the thd-grp | |
| 428 | + (mod,idx) := jni->FindMethod( tgrp_cl, "uncaughtException", | |
| 429 | + "(Ljava.lang.Thread;Ljava.lang.Throwable;)V", | |
| 430 | + JNI->METH_VIRTUAL ); | |
| 431 | + if ( mod != nil ) | |
| 432 | + { | |
| 433 | + # call the uncaughException handler | |
| 434 | + Value : import jni; | |
| 435 | + args := array[] of | |
| 436 | + { | |
| 437 | + ref Value.TObject(thdobj), #the thread | |
| 438 | + ref Value.TObject(jldr->culprit(ee)) #the exception | |
| 439 | + }; | |
| 440 | + | |
| 441 | + # do the call | |
| 442 | + ##LATER nil := jni->LowCall( mod, idx, jthd.group, args ); | |
| 443 | + } | |
| 444 | + sys->unrescue(); | |
| 445 | + } | |
| 446 | + else | |
| 447 | + { | |
| 448 | + # if we get an exception here just return | |
| 449 | + # and let the thread finish cleanup. | |
| 450 | + sys->rescued( Sys->ONCE, nil ); | |
| 451 | + } | |
| 452 | + } | |
| 453 | + | |
| 454 | +} | |
| 455 | + | |
| @@ -0,0 +1,21 @@ | ||
| 1 | +# javal v1.3 generated file: edit with care | |
| 2 | + | |
| 3 | +Thread_L : module | |
| 4 | +{ | |
| 5 | + | |
| 6 | + init : fn( jni_p : JNI ); | |
| 7 | + currentThread_rThread : fn( ) : JThread; | |
| 8 | + yield_V : fn( ); | |
| 9 | + sleep_J_V : fn( p0 : big); | |
| 10 | + start_V : fn( this : JThread); | |
| 11 | + isInterrupted_Z_Z : fn( this : JThread, p0 : int) : int; | |
| 12 | + isAlive_Z : fn( this : JThread) : int; | |
| 13 | + countStackFrames_I : fn( this : JThread) : int; | |
| 14 | + setPriority0_I_V : fn( this : JThread, p0 : int); | |
| 15 | + stop0_rObject_V : fn( this : JThread, p0 : JObject); | |
| 16 | + suspend0_V : fn( this : JThread); | |
| 17 | + resume0_V : fn( this : JThread); | |
| 18 | + interrupt0_V : fn( this : JThread); | |
| 19 | + lowinit_rThread_V : fn( p0 : JThread); | |
| 20 | + | |
| 21 | +}; | |
Empty file added.
| @@ -0,0 +1,96 @@ | ||
| 1 | +implement Throwable_L; | |
| 2 | + | |
| 3 | +# javal v1.2 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JObject : import jni; | |
| 23 | + | |
| 24 | +#>> extra pre includes here | |
| 25 | + | |
| 26 | +#<< | |
| 27 | + | |
| 28 | +include "Throwable_L.m"; | |
| 29 | + | |
| 30 | +#>> extra post includes here | |
| 31 | + | |
| 32 | +#<< | |
| 33 | + | |
| 34 | +init( jni_p : JNI ) | |
| 35 | +{ | |
| 36 | + # save java native inteface mod instance | |
| 37 | + jni = jni_p; | |
| 38 | + #>>extra initialization here | |
| 39 | + #<< | |
| 40 | +} | |
| 41 | + | |
| 42 | +printStackTrace0_rObject_V( this : ref Throwable_obj, p0 : JObject) | |
| 43 | +{#>> | |
| 44 | + Value : import jni; | |
| 45 | + jldr := jni->jldr; | |
| 46 | + Object : import jldr; | |
| 47 | + | |
| 48 | + if ( this.backtrace != nil ) | |
| 49 | + { | |
| 50 | + args := array[] of | |
| 51 | + { | |
| 52 | + ref Value.TObject( jni->NewStringObject( string this.backtrace ) ) | |
| 53 | + }; | |
| 54 | + (nil,nil):=jni->CallMethod( p0, "println", "(Ljava/lang/String;)V", args ); | |
| 55 | + # ignore any erros | |
| 56 | + } | |
| 57 | + | |
| 58 | +}#<< | |
| 59 | + | |
| 60 | +fillInStackTrace_rThrowable( this : ref Throwable_obj) : ref Throwable_obj | |
| 61 | +{#>> | |
| 62 | + # attempt to open the local "prog" device (i.e. '#p') | |
| 63 | + # and read the call stack into an array of bytes | |
| 64 | + pid := jni->sys->pctl(0,nil); | |
| 65 | + progfile := "#p/"+ (string pid) +"/stack"; | |
| 66 | + fd := jni->sys->open( progfile, Sys->OREAD ); | |
| 67 | + if ( fd != nil ) | |
| 68 | + { | |
| 69 | + # must spin a thread to read my own call-stack | |
| 70 | + result := chan of array of byte; # channel for thd results | |
| 71 | + spawn ReadCallStack( fd, result ); | |
| 72 | + this.backtrace = <- result; # wait for results | |
| 73 | + | |
| 74 | + } | |
| 75 | + else | |
| 76 | + this.backtrace = array of byte jni->sys->sprint("could not open %s:%r\n", progfile ); | |
| 77 | + | |
| 78 | + return( this ); | |
| 79 | +}#<< | |
| 80 | + | |
| 81 | +####### private functions | |
| 82 | + | |
| 83 | + | |
| 84 | +ReadCallStack( fd : ref Sys->FD, result : chan of array of byte ) | |
| 85 | +{ | |
| 86 | + buf := array[8000] of byte; #about 10 frames | |
| 87 | + n := jni->sys->read(fd, buf, len buf - 1); | |
| 88 | + fd = nil; | |
| 89 | + if(n < 0) | |
| 90 | + buf = array of byte jni->sys->sprint("could not read call-stack:%r\n"); | |
| 91 | + else | |
| 92 | + buf[n] = byte 0; | |
| 93 | + | |
| 94 | + result <- = buf[:n+1]; | |
| 95 | +} | |
| 96 | + | |
| @@ -0,0 +1,16 @@ | ||
| 1 | +# javal v1.2 generated file: edit with care | |
| 2 | + | |
| 3 | +Throwable_L : module | |
| 4 | +{ | |
| 5 | + Throwable_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + backtrace : array of byte; | |
| 9 | + detailMessage : JString; | |
| 10 | + }; | |
| 11 | + | |
| 12 | + init : fn( jni_p : JNI ); | |
| 13 | + printStackTrace0_rObject_V : fn( this : ref Throwable_obj, p0 : JObject); | |
| 14 | + fillInStackTrace_rThrowable : fn( this : ref Throwable_obj) : ref Throwable_obj; | |
| 15 | + | |
| 16 | +}; | |
Empty file added.
Empty file added.
Empty file added.
Empty file added.
Empty file added.
| @@ -0,0 +1,152 @@ | ||
| 1 | +<../../../../mkconfig | |
| 2 | + | |
| 3 | +DIRS=\ | |
| 4 | + reflect\ | |
| 5 | + | |
| 6 | +TARG=\ | |
| 7 | + AbstractMethodError.dis\ | |
| 8 | + ArithmeticException.dis\ | |
| 9 | +# for ArrayIndexOutOfBoundsException.dis\ | |
| 10 | + ++5KkA5LRlUzD1nsDM8Mj.dis\ | |
| 11 | + ArrayStoreException.dis\ | |
| 12 | + Boolean.dis\ | |
| 13 | + Byte.dis\ | |
| 14 | + Character.dis\ | |
| 15 | + Class.dis\ | |
| 16 | + ClassCastException.dis\ | |
| 17 | + ClassCircularityError.dis\ | |
| 18 | + ClassFormatError.dis\ | |
| 19 | + ClassLoader.dis\ | |
| 20 | +# for ClassNotFoundException.dis\ | |
| 21 | + S1vm8N5TePhsu3h1FO7yj.dis\ | |
| 22 | +# for CloneNotSupportedException.dis\ | |
| 23 | + wmF21yXDq7VxPRRLc7v5t.dis\ | |
| 24 | + Cloneable.dis\ | |
| 25 | + Compiler.dis\ | |
| 26 | + Double.dis\ | |
| 27 | + Error.dis\ | |
| 28 | + Exception.dis\ | |
| 29 | +# for ExceptionInInitializerError.dis\ | |
| 30 | + Ub2BD3PjJRDSI4wyZi7ID.dis\ | |
| 31 | + Float.dis\ | |
| 32 | + IllegalAccessError.dis\ | |
| 33 | +# for IllegalAccessException.dis\ | |
| 34 | + ClJ4BmIE1TECvv1qdqbQN.dis\ | |
| 35 | +# for IllegalArgumentException.dis\ | |
| 36 | + Z07h8c1IAX5LIjYbhqgGl.dis\ | |
| 37 | +# for IllegalMonitorStateException.dis\ | |
| 38 | + 375fcBxmum6K8ZSGn7W2N.dis\ | |
| 39 | + IllegalStateException.dis\ | |
| 40 | +# for IllegalThreadStateException.dis\ | |
| 41 | + 1PLXdCFiGoZkxBoL8Bo0P.dis\ | |
| 42 | +# for IncompatibleClassChangeError.dis\ | |
| 43 | + FiACrRolKM+iZTikdgUFa.dis\ | |
| 44 | +# for IndexOutOfBoundsException.dis\ | |
| 45 | + IKsPHNdWGHpuZGqgvYD4e.dis\ | |
| 46 | + InfernoProcess.dis\ | |
| 47 | + InstantiationError.dis\ | |
| 48 | +# for InstantiationException.dis\ | |
| 49 | + jhj+E2mCFNmQ2VUL0zYp8.dis\ | |
| 50 | + Integer.dis\ | |
| 51 | + InternalError.dis\ | |
| 52 | + InterruptedException.dis\ | |
| 53 | + LinkageError.dis\ | |
| 54 | + Long.dis\ | |
| 55 | + Math.dis\ | |
| 56 | +# for NegativeArraySizeException.dis\ | |
| 57 | + iu6-cux1hLK1GoPKq9m1l.dis\ | |
| 58 | + NoClassDefFoundError.dis\ | |
| 59 | + NoSuchFieldError.dis\ | |
| 60 | + NoSuchFieldException.dis\ | |
| 61 | + NoSuchMethodError.dis\ | |
| 62 | + NoSuchMethodException.dis\ | |
| 63 | + NullPointerException.dis\ | |
| 64 | + NullSecurityManager.dis\ | |
| 65 | + Number.dis\ | |
| 66 | + NumberFormatException.dis\ | |
| 67 | + Object.dis\ | |
| 68 | + OutOfMemoryError.dis\ | |
| 69 | + Process.dis\ | |
| 70 | + Runnable.dis\ | |
| 71 | + Runtime.dis\ | |
| 72 | + RuntimeException.dis\ | |
| 73 | + SecurityException.dis\ | |
| 74 | + SecurityManager.dis\ | |
| 75 | + Short.dis\ | |
| 76 | + StackOverflowError.dis\ | |
| 77 | + String.dis\ | |
| 78 | + StringBuffer.dis\ | |
| 79 | +# for StringIndexOutOfBoundsException.dis\ | |
| 80 | + 5ZD+zz0io892VFWeXUN1a.dis\ | |
| 81 | + System.dis\ | |
| 82 | + Thread.dis\ | |
| 83 | + ThreadDeath.dis\ | |
| 84 | + ThreadGroup.dis\ | |
| 85 | + Throwable.dis\ | |
| 86 | + UnknownError.dis\ | |
| 87 | + UnsatisfiedLinkError.dis\ | |
| 88 | + VerifyError.dis\ | |
| 89 | + VirtualMachineError.dis\ | |
| 90 | + Void.dis\ | |
| 91 | +# Limbo code\ | |
| 92 | + Character_L.dis\ | |
| 93 | + ClassLoader_L.dis\ | |
| 94 | + Class_L.dis\ | |
| 95 | + Double_L.dis\ | |
| 96 | + Float_L.dis\ | |
| 97 | + InfernoProcess_L.dis\ | |
| 98 | + Math_L.dis\ | |
| 99 | + Object_L.dis\ | |
| 100 | + Runtime_L.dis\ | |
| 101 | + SecurityManager_L.dis\ | |
| 102 | + StringBuffer_L.dis\ | |
| 103 | + String_L.dis\ | |
| 104 | + System_L.dis\ | |
| 105 | + Thread_L.dis\ | |
| 106 | + Throwable_L.dis\ | |
| 107 | + unicode_table.dis\ | |
| 108 | + | |
| 109 | +MODULES=\ | |
| 110 | + $ROOT/java/module/classloader.m\ | |
| 111 | + $ROOT/java/module/jni.m\ | |
| 112 | + $ROOT/java/module/cast.m\ | |
| 113 | + Character_L.m\ | |
| 114 | + ClassLoader_L.m\ | |
| 115 | + Class_L.m\ | |
| 116 | + Double_L.m\ | |
| 117 | + Float_L.m\ | |
| 118 | + InfernoProcess_L.m\ | |
| 119 | + Math_L.m\ | |
| 120 | + Object_L.m\ | |
| 121 | + Runtime_L.m\ | |
| 122 | + SecurityManager_L.m\ | |
| 123 | + StringBuffer_L.m\ | |
| 124 | + String_L.m\ | |
| 125 | + System_L.m\ | |
| 126 | + Thread_L.m\ | |
| 127 | + Throwable_L.m\ | |
| 128 | + unicode_table.m\ | |
| 129 | + | |
| 130 | +SYSMODULES=\ | |
| 131 | + draw.m\ | |
| 132 | + hash.m\ | |
| 133 | + keyring.m\ | |
| 134 | + loader.m\ | |
| 135 | + math.m\ | |
| 136 | + string.m\ | |
| 137 | + sys.m\ | |
| 138 | + | |
| 139 | +DISBIN=$ROOT/java/dis/java/java/lang | |
| 140 | + | |
| 141 | +<$ROOT/mkfiles/mkjava | |
| 142 | +<$ROOT/mkfiles/mksubdirs | |
| 143 | + | |
| 144 | +LIMBOINCL=\ | |
| 145 | + $LIMBOINCL\ | |
| 146 | + -I$ROOT/java/pkg\ | |
| 147 | + | |
| 148 | +unicode_table.dis: unicode_table.b | |
| 149 | + limbo $LIMBOINCL -gw unicode_table.b | |
| 150 | + | |
| 151 | +NullSecurityManager.dis: SecurityManager.class | |
| 152 | + j2d NullSecurityManager.class | |
Empty file added.
| @@ -0,0 +1,417 @@ | ||
| 1 | +implement Array_L; | |
| 2 | + | |
| 3 | +# javal v1.5 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JThread, | |
| 23 | + JObject : import jni; | |
| 24 | + | |
| 25 | +#>> extra pre includes here | |
| 26 | + | |
| 27 | + ClassData, | |
| 28 | + Value : import jni; | |
| 29 | + | |
| 30 | + jldr : JavaClassLoader; | |
| 31 | + | |
| 32 | +#<< | |
| 33 | + | |
| 34 | +include "Array_L.m"; | |
| 35 | + | |
| 36 | +#>> extra post includes here | |
| 37 | + | |
| 38 | +include "reflect.m"; | |
| 39 | + refl : Reflect; | |
| 40 | + widen : import refl; | |
| 41 | + | |
| 42 | +array_class : ClassData; | |
| 43 | + | |
| 44 | +badindex := "java.lang.ArrayIndexOutOfBoundsException"; | |
| 45 | +illegalarg := "java.lang.IllegalArgumentException"; | |
| 46 | +nullptr := "java.lang.NullPointerException"; | |
| 47 | + | |
| 48 | + cast : Cast; | |
| 49 | + | |
| 50 | +#<< | |
| 51 | + | |
| 52 | +init( jni_p : JNI ) | |
| 53 | +{ | |
| 54 | + # save java native inteface mod instance | |
| 55 | + jni = jni_p; | |
| 56 | + #>>extra initialization here | |
| 57 | + array_class = jni->FindClass("inferno/vm/Array"); | |
| 58 | + | |
| 59 | + jldr = jni->jldr; | |
| 60 | + cast = jni->CastMod(); | |
| 61 | + refl = load Reflect Reflect->PATH; | |
| 62 | + if ( refl == nil ) | |
| 63 | + jni->InitError( jni->sys->sprint( "java.lang.reflect.Array: could not load %s: %r", Reflect->PATH ) ); | |
| 64 | + else | |
| 65 | + refl->init(jni); | |
| 66 | + | |
| 67 | + #<< | |
| 68 | +} | |
| 69 | + | |
| 70 | +getLength_rObject_I( p0 : JObject) : int | |
| 71 | +{#>> | |
| 72 | + # p0 - must be a Java array; if not, exceptions are thrown | |
| 73 | + # Returns the integer length of the array. | |
| 74 | + | |
| 75 | + if ( p0 == nil ) | |
| 76 | + jni->ThrowException(nullptr, ""); | |
| 77 | + if ( jni->IsArray(p0) == JNI->FALSE) | |
| 78 | + jni->ThrowException(illegalarg, "Not an array"); | |
| 79 | + return jni->GetArrayLength(cast->ToJArray(p0)); | |
| 80 | +}#<< | |
| 81 | + | |
| 82 | +get_rObject_I_rObject( p0 : JObject,p1 : int) : JObject | |
| 83 | +{#>> | |
| 84 | + # p0 - a Java object, which must be an array, else exception occurs. | |
| 85 | + # p1 - an index into the array, >= 0 and < length of array | |
| 86 | + # Returns the element at that index. If the array is of a primitive | |
| 87 | + # type, it is put in an appropriate wrapper class instance. | |
| 88 | + | |
| 89 | + checksOK(p0, p1); | |
| 90 | + | |
| 91 | + # | |
| 92 | + # Need to figure out what kind of an array this is, then get the | |
| 93 | + # requested element and convert it to an appropriate JObject. | |
| 94 | + # | |
| 95 | + (typ, elem) := GetArrayElement(p0, p1); | |
| 96 | + #(typ, elem) := jni->GetArrayElement(p0, p1); | |
| 97 | + | |
| 98 | + if ( typ == 0 ) # array of Objects. good. | |
| 99 | + return elem.Object(); | |
| 100 | + | |
| 101 | + if ( typ >= JNI->T_BOOLEAN && typ <= JNI->T_LONG ) | |
| 102 | + return refl->ValueToObject(elem); | |
| 103 | + | |
| 104 | + return nil; | |
| 105 | +}#<< | |
| 106 | + | |
| 107 | +getBoolean_rObject_I_Z( p0 : JObject,p1 : int) : int | |
| 108 | +{#>> | |
| 109 | + # p0 - a Java object, which must be an array, else exception occurs. | |
| 110 | + # p1 - an index into the array, >= 0 and < length of array | |
| 111 | + # Returns the element at that index as a boolean value. If the array | |
| 112 | + # is not an array of something that can be converted to a boolean by | |
| 113 | + # widening (and for boolean that's nothing), then getprim will throw | |
| 114 | + # an exception. | |
| 115 | + | |
| 116 | + return getprim(p0, p1, JNI->T_BOOLEAN, "boolean").Boolean(); | |
| 117 | +}#<< | |
| 118 | + | |
| 119 | +getByte_rObject_I_B( p0 : JObject,p1 : int) : int | |
| 120 | +{#>> | |
| 121 | + # See comments in getBoolean_rObject_I_Z, above | |
| 122 | + | |
| 123 | + return getprim(p0, p1, JNI->T_BYTE, "byte").Byte(); | |
| 124 | +}#<< | |
| 125 | + | |
| 126 | +getChar_rObject_I_C( p0 : JObject,p1 : int) : int | |
| 127 | +{#>> | |
| 128 | + # See comments in getBoolean_rObject_I_Z, above | |
| 129 | + | |
| 130 | + return getprim(p0, p1, JNI->T_CHAR, "char").Char(); | |
| 131 | +}#<< | |
| 132 | + | |
| 133 | +getShort_rObject_I_S( p0 : JObject,p1 : int) : int | |
| 134 | +{#>> | |
| 135 | + # See comments in getBoolean_rObject_I_Z, above | |
| 136 | + | |
| 137 | + return getprim(p0, p1, JNI->T_SHORT, "short").Short(); | |
| 138 | +}#<< | |
| 139 | + | |
| 140 | +getInt_rObject_I_I( p0 : JObject,p1 : int) : int | |
| 141 | +{#>> | |
| 142 | + # See comments in getBoolean_rObject_I_Z, above | |
| 143 | + | |
| 144 | + return getprim(p0, p1, JNI->T_INT, "int").Int(); | |
| 145 | +}#<< | |
| 146 | + | |
| 147 | +getLong_rObject_I_J( p0 : JObject,p1 : int) : big | |
| 148 | +{#>> | |
| 149 | + # See comments in getBoolean_rObject_I_Z, above | |
| 150 | + | |
| 151 | + return getprim(p0, p1, JNI->T_LONG, "long").Long(); | |
| 152 | +}#<< | |
| 153 | + | |
| 154 | +getFloat_rObject_I_F( p0 : JObject,p1 : int) : real | |
| 155 | +{#>> | |
| 156 | + # See comments in getBoolean_rObject_I_Z, above | |
| 157 | + | |
| 158 | + return getprim(p0, p1, JNI->T_FLOAT, "float").Float(); | |
| 159 | +}#<< | |
| 160 | + | |
| 161 | +getDouble_rObject_I_D( p0 : JObject,p1 : int) : real | |
| 162 | +{#>> | |
| 163 | + # See comments in getBoolean_rObject_I_Z, above | |
| 164 | + | |
| 165 | + return getprim(p0, p1, JNI->T_DOUBLE, "double").Double(); | |
| 166 | +}#<< | |
| 167 | + | |
| 168 | +set_rObject_I_rObject_V( p0 : JObject,p1 : int,p2 : JObject) | |
| 169 | +{#>> | |
| 170 | + # p0 - a Java array. If null or not an array, exception. | |
| 171 | + # p1 - index into the array. If < 0 or >= length of array, exception. | |
| 172 | + # p2 - a value to put into the array at the specified index. If p0 is | |
| 173 | + # an array of JObject, p2 must be an instance of the appropriate | |
| 174 | + # class. If p0 is an array of a primitive Java type, then p2 must | |
| 175 | + # be a wrapper of a primitive type that can be converted to the | |
| 176 | + # the array's type by widening. | |
| 177 | + | |
| 178 | + checksOK(p0, p1); | |
| 179 | + | |
| 180 | + objarray := cast->ToJArray(p0); | |
| 181 | + typ := objarray.primitive; | |
| 182 | + if ( typ == 0 ) { # an Object array | |
| 183 | + if ( jni->IsInstanceOf(p2, objarray.class) == JNI->TRUE ) { | |
| 184 | + cast->JArrayToObject(objarray).ary[p1] = p2; | |
| 185 | + return; | |
| 186 | + } | |
| 187 | + } | |
| 188 | + else if ( typ >= JNI->T_BOOLEAN && typ <= JNI->T_LONG ) { | |
| 189 | + (stype, val) := refl->GetVal(p2); | |
| 190 | + if ( stype != 0 && (val = widen(stype, typ, val)) != nil ) { | |
| 191 | + SetArrayElement(p0, p1, val); | |
| 192 | + return; | |
| 193 | + } | |
| 194 | + } | |
| 195 | + jni->ThrowException(illegalarg, "Argument can't be cast to array element"); | |
| 196 | +}#<< | |
| 197 | + | |
| 198 | +setBoolean_rObject_I_Z_V( p0 : JObject,p1 : int,p2 : int) | |
| 199 | +{#>> | |
| 200 | + # p0[p1] = p2 | |
| 201 | + # where p2 is a boolean value, and it must be possible to convert it by | |
| 202 | + # widening to the type array p0. | |
| 203 | + | |
| 204 | + putprim(p0, p1, JNI->T_BOOLEAN, "boolean", ref Value.TBoolean(p2)); | |
| 205 | +}#<< | |
| 206 | + | |
| 207 | +setByte_rObject_I_B_V( p0 : JObject,p1 : int,p2 : int) | |
| 208 | +{#>> | |
| 209 | + # see comments for setBoolean_rObject_I_Z_V, above. | |
| 210 | + | |
| 211 | + putprim(p0, p1, JNI->T_BYTE, "byte", ref Value.TByte(p2)); | |
| 212 | +}#<< | |
| 213 | + | |
| 214 | +setChar_rObject_I_C_V( p0 : JObject,p1 : int,p2 : int) | |
| 215 | +{#>> | |
| 216 | + # see comments for setBoolean_rObject_I_Z_V, above. | |
| 217 | + | |
| 218 | + putprim(p0, p1, JNI->T_CHAR, "char", ref Value.TChar(p2)); | |
| 219 | +}#<< | |
| 220 | + | |
| 221 | +setShort_rObject_I_S_V( p0 : JObject,p1 : int,p2 : int) | |
| 222 | +{#>> | |
| 223 | + # see comments for setBoolean_rObject_I_Z_V, above. | |
| 224 | + | |
| 225 | + putprim(p0, p1, JNI->T_SHORT, "short", ref Value.TShort(p2)); | |
| 226 | +}#<< | |
| 227 | + | |
| 228 | +setInt_rObject_I_I_V( p0 : JObject,p1 : int,p2 : int) | |
| 229 | +{#>> | |
| 230 | + # see comments for setBoolean_rObject_I_Z_V, above. | |
| 231 | + | |
| 232 | + putprim(p0, p1, JNI->T_INT, "int", ref Value.TInt(p2)); | |
| 233 | +}#<< | |
| 234 | + | |
| 235 | +setLong_rObject_I_J_V( p0 : JObject,p1 : int,p2 : big) | |
| 236 | +{#>> | |
| 237 | + # see comments for setBoolean_rObject_I_Z_V, above. | |
| 238 | + | |
| 239 | + putprim(p0, p1, JNI->T_LONG, "long", ref Value.TLong(p2)); | |
| 240 | +}#<< | |
| 241 | + | |
| 242 | +setFloat_rObject_I_F_V( p0 : JObject,p1 : int,p2 : real) | |
| 243 | +{#>> | |
| 244 | + # see comments for setBoolean_rObject_I_Z_V, above. | |
| 245 | + | |
| 246 | + putprim(p0, p1, JNI->T_FLOAT, "float", ref Value.TFloat(p2)); | |
| 247 | +}#<< | |
| 248 | + | |
| 249 | +setDouble_rObject_I_D_V( p0 : JObject,p1 : int,p2 : real) | |
| 250 | +{#>> | |
| 251 | + # see comments for setBoolean_rObject_I_Z_V, above. | |
| 252 | + | |
| 253 | + putprim(p0, p1, JNI->T_DOUBLE, "double", ref Value.TDouble(p2)); | |
| 254 | +}#<< | |
| 255 | + | |
| 256 | +newArray(jclass: JClass, bounds: array of int): JObject | |
| 257 | +{ | |
| 258 | + # Create a Java array whose components belong to class jclass. | |
| 259 | + # jclass may be a class object representing a primitive type. | |
| 260 | + # bounds gives the length of each dimension. | |
| 261 | + | |
| 262 | + dims := len bounds; | |
| 263 | + cldata: ClassData; | |
| 264 | + | |
| 265 | + # See if the class represents a primitive type. | |
| 266 | + typ := jni->PrimitiveIndex(jclass, 1); | |
| 267 | + | |
| 268 | + # If jclass represents an array, then component type of array | |
| 269 | + # being created is component type of jclass. | |
| 270 | + s := jclass.aryname; | |
| 271 | + if(s != nil) { | |
| 272 | + # count [s in aryname | |
| 273 | + n := 1; | |
| 274 | + while(s[n] == '[') | |
| 275 | + n++; | |
| 276 | + dims += n; | |
| 277 | + typ = refl->SigToType(s[n:]); | |
| 278 | + if(typ == 0) | |
| 279 | + cldata = jni->FindClass(s[n+1:len s - 1]); | |
| 280 | + } else if(typ == 0) { # jclass is not array and not primitive | |
| 281 | + cldata = jclass.class; | |
| 282 | + } | |
| 283 | + | |
| 284 | + return cast->FromJArray(jldr->multianewarray(dims, cldata, typ, bounds)); | |
| 285 | +} | |
| 286 | + | |
| 287 | +newArray_rClass_I_rObject( p0 : JClass,p1 : int) : JObject | |
| 288 | +{#>> | |
| 289 | + if ( p0 == nil ) | |
| 290 | + jni->ThrowException(nullptr, ""); | |
| 291 | + | |
| 292 | + return newArray(p0, array [1] of { p1 }); | |
| 293 | +}#<< | |
| 294 | + | |
| 295 | +multiNewArray_rClass_aI_rObject( p0 : JClass,p1 : JArrayI) : JObject | |
| 296 | +{#>> | |
| 297 | + if ( p0 == nil || p1 == nil ) | |
| 298 | + jni->ThrowException(nullptr, ""); | |
| 299 | + | |
| 300 | + ln := len p1.ary; | |
| 301 | + | |
| 302 | + if ( ln < 1 || ln > 255 ) | |
| 303 | + jni->ThrowException(illegalarg, "dimensions out of range [1,255]"); | |
| 304 | + | |
| 305 | + return newArray(p0, p1.ary); | |
| 306 | +}#<< | |
| 307 | + | |
| 308 | +# An argument verification routine for use by native methods. The | |
| 309 | +# first argument must be non-null, and a Java array. (These conditions | |
| 310 | +# are actually check by calling getLength_rObject.) The second | |
| 311 | +# argument must be a valid index into that array. There is no return | |
| 312 | +# value: if the conditions above are not met, an exception is thrown; | |
| 313 | +# hence the routine does not return in this case. A successful return | |
| 314 | +# indicates the arguments are O.K. | |
| 315 | +# | |
| 316 | +checksOK(o : JObject, ix : int) | |
| 317 | +{ | |
| 318 | + if ( ix >= getLength_rObject_I(o) || ix < 0 ) | |
| 319 | + jni->ThrowException(badindex, "Illegal index"); | |
| 320 | + return; | |
| 321 | +} | |
| 322 | +# | |
| 323 | +# Gets element 'index' of Java array 'o' and returns it as a ref Value | |
| 324 | +# of the type corresponding to Java type index 'want'. String 's' | |
| 325 | +# is used only in creating the exception message, and should correspond | |
| 326 | +# to 'want'. o must be non-null and refer to a Java array, index must | |
| 327 | +# within range, and the array must be of a primitive type that can | |
| 328 | +# be made into the requested type by a widening conversion. If any of | |
| 329 | +# these conditions are not met, an exception is thrown. | |
| 330 | +# | |
| 331 | +getprim( o : JObject, index : int, want : int, s : string) : ref Value | |
| 332 | +{ | |
| 333 | + checksOK(o, index); | |
| 334 | + | |
| 335 | + (typ, elem) := GetArrayElement(o, index); | |
| 336 | + if ( (wider := widen(typ, want, elem)) == nil ) { | |
| 337 | + if ( s != nil ) | |
| 338 | + jni->ThrowException(illegalarg, "Can't cast array element to " + s); | |
| 339 | + else | |
| 340 | + jni->ThrowException(illegalarg, "Can't cast array element"); | |
| 341 | + } | |
| 342 | + return wider; | |
| 343 | +} | |
| 344 | +# | |
| 345 | +# Sets element 'index' of Java array 'o' to the ref Value 'val' | |
| 346 | +# of the type corresponding to Java type index 'have'. String 's' | |
| 347 | +# is used only in creating the exception message, and should correspond | |
| 348 | +# to 'have'. o must be non-null and refer to a Java array, index must | |
| 349 | +# within range, and the array must be of a primitive type that can | |
| 350 | +# be made from the provided type by a widening conversion. If any of | |
| 351 | +# these conditions are not met, an exception is thrown. | |
| 352 | +# | |
| 353 | +putprim( o : JObject, index : int, have : int, s : string, val : ref Value) | |
| 354 | +{ | |
| 355 | + checksOK(o, index); | |
| 356 | + | |
| 357 | + typ := cast->ToJArray(o).primitive; | |
| 358 | + if ( (val = widen(have, typ, val)) == nil ) { | |
| 359 | + if ( s != nil ) | |
| 360 | + jni->ThrowException(illegalarg, | |
| 361 | + "Can't put input value into " + s + " array"); | |
| 362 | + else | |
| 363 | + jni->ThrowException(illegalarg, | |
| 364 | + "Can't put input value into array"); | |
| 365 | + } | |
| 366 | + SetArrayElement(o, index, val); | |
| 367 | + #jni->SetArrayElement(o, index, val); | |
| 368 | +} | |
| 369 | +# | |
| 370 | +# Get the element at index from the Java array o and return it in | |
| 371 | +# in an appropriate member of the Value union. | |
| 372 | +# The arguments should have been verified before calling this function. | |
| 373 | +# | |
| 374 | +GetArrayElement( o : JObject, index : int ) : (int, ref Value) | |
| 375 | +{ | |
| 376 | + a := cast->ToJArray(o); | |
| 377 | + val : ref Value; | |
| 378 | + case a.primitive { | |
| 379 | + 0 => | |
| 380 | + val = ref Value.TObject(cast->JArrayToObject(a).ary[index]); | |
| 381 | + JNI->T_BOOLEAN => | |
| 382 | + val = ref Value.TBoolean(int cast->JArrayToByte(a).ary[index]); | |
| 383 | + JNI->T_BYTE => | |
| 384 | + val = ref Value.TByte(int cast->JArrayToByte(a).ary[index]); | |
| 385 | + JNI->T_CHAR => | |
| 386 | + val = ref Value.TChar(cast->JArrayToInt(a).ary[index]); | |
| 387 | + JNI->T_SHORT => | |
| 388 | + val = ref Value.TShort(cast->JArrayToInt(a).ary[index]); | |
| 389 | + JNI->T_INT => | |
| 390 | + val = ref Value.TInt(cast->JArrayToInt(a).ary[index]); | |
| 391 | + JNI->T_LONG => | |
| 392 | + val = ref Value.TLong(cast->JArrayToBig(a).ary[index]); | |
| 393 | + JNI->T_FLOAT => | |
| 394 | + val = ref Value.TFloat(cast->JArrayToReal(a).ary[index]); | |
| 395 | + JNI->T_DOUBLE => | |
| 396 | + val = ref Value.TDouble(cast->JArrayToReal(a).ary[index]); | |
| 397 | + } | |
| 398 | + return (a.primitive, val); | |
| 399 | +} | |
| 400 | +# | |
| 401 | +# Set the element at index from the Java array o to 'val', | |
| 402 | +# The arguments should have been verified before calling this function. | |
| 403 | +# | |
| 404 | +SetArrayElement( o : JObject, index : int, val : ref Value) | |
| 405 | +{ | |
| 406 | + a := cast->ToJArray(o); | |
| 407 | + pick sw := val { | |
| 408 | + TBoolean => cast->JArrayToByte(a).ary[index] = byte sw.jboolean; | |
| 409 | + TByte => cast->JArrayToByte(a).ary[index] = byte sw.jbyte; | |
| 410 | + TChar => cast->JArrayToInt(a).ary[index] = sw.jchar; | |
| 411 | + TShort => cast->JArrayToInt(a).ary[index] = sw.jshort; | |
| 412 | + TInt => cast->JArrayToInt(a).ary[index] = sw.jint; | |
| 413 | + TLong => cast->JArrayToBig(a).ary[index] = sw.jlong; | |
| 414 | + TFloat => cast->JArrayToReal(a).ary[index] = sw.jfloat; | |
| 415 | + TDouble => cast->JArrayToReal(a).ary[index] = sw.jdouble; | |
| 416 | + } | |
| 417 | +} | |
| @@ -0,0 +1,33 @@ | ||
| 1 | +# javal v1.5 generated file: edit with care | |
| 2 | + | |
| 3 | +Array_L : module | |
| 4 | +{ | |
| 5 | + Array_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + }; | |
| 9 | + | |
| 10 | + init : fn( jni_p : JNI ); | |
| 11 | + getLength_rObject_I : fn( p0 : JObject) : int; | |
| 12 | + get_rObject_I_rObject : fn( p0 : JObject,p1 : int) : JObject; | |
| 13 | + getBoolean_rObject_I_Z : fn( p0 : JObject,p1 : int) : int; | |
| 14 | + getByte_rObject_I_B : fn( p0 : JObject,p1 : int) : int; | |
| 15 | + getChar_rObject_I_C : fn( p0 : JObject,p1 : int) : int; | |
| 16 | + getShort_rObject_I_S : fn( p0 : JObject,p1 : int) : int; | |
| 17 | + getInt_rObject_I_I : fn( p0 : JObject,p1 : int) : int; | |
| 18 | + getLong_rObject_I_J : fn( p0 : JObject,p1 : int) : big; | |
| 19 | + getFloat_rObject_I_F : fn( p0 : JObject,p1 : int) : real; | |
| 20 | + getDouble_rObject_I_D : fn( p0 : JObject,p1 : int) : real; | |
| 21 | + set_rObject_I_rObject_V : fn( p0 : JObject,p1 : int,p2 : JObject); | |
| 22 | + setBoolean_rObject_I_Z_V : fn( p0 : JObject,p1 : int,p2 : int); | |
| 23 | + setByte_rObject_I_B_V : fn( p0 : JObject,p1 : int,p2 : int); | |
| 24 | + setChar_rObject_I_C_V : fn( p0 : JObject,p1 : int,p2 : int); | |
| 25 | + setShort_rObject_I_S_V : fn( p0 : JObject,p1 : int,p2 : int); | |
| 26 | + setInt_rObject_I_I_V : fn( p0 : JObject,p1 : int,p2 : int); | |
| 27 | + setLong_rObject_I_J_V : fn( p0 : JObject,p1 : int,p2 : big); | |
| 28 | + setFloat_rObject_I_F_V : fn( p0 : JObject,p1 : int,p2 : real); | |
| 29 | + setDouble_rObject_I_D_V : fn( p0 : JObject,p1 : int,p2 : real); | |
| 30 | + newArray_rClass_I_rObject : fn( p0 : JClass,p1 : int) : JObject; | |
| 31 | + multiNewArray_rClass_aI_rObject : fn( p0 : JClass,p1 : JArrayI) : JObject; | |
| 32 | + | |
| 33 | +}; | |
Empty file added.
| @@ -0,0 +1,90 @@ | ||
| 1 | +implement Constructor_L; | |
| 2 | + | |
| 3 | +include "jni.m"; | |
| 4 | + jni : JNI; | |
| 5 | + ClassModule, | |
| 6 | + JString, | |
| 7 | + JArray, | |
| 8 | + JArrayI, | |
| 9 | + JArrayC, | |
| 10 | + JArrayB, | |
| 11 | + JArrayS, | |
| 12 | + JArrayJ, | |
| 13 | + JArrayF, | |
| 14 | + JArrayD, | |
| 15 | + JArrayZ, | |
| 16 | + JArrayJObject, | |
| 17 | + JArrayJClass, | |
| 18 | + JArrayJString, | |
| 19 | + JClass, | |
| 20 | + JObject : import jni; | |
| 21 | + | |
| 22 | +#>> extra pre includes here | |
| 23 | + | |
| 24 | + Value, | |
| 25 | + ClassData, | |
| 26 | + jldr : import jni; | |
| 27 | + | |
| 28 | + Object : import jldr; | |
| 29 | + | |
| 30 | +#<< | |
| 31 | + | |
| 32 | +include "Constructor_L.m"; | |
| 33 | + | |
| 34 | +#>> extra post includes here | |
| 35 | + | |
| 36 | +illegalarg := "java.lang.IllegalArgumentException"; | |
| 37 | +nullptr := "java.lang.NullPointerException"; | |
| 38 | + | |
| 39 | +include "reflect.m"; | |
| 40 | + refl : Reflect; | |
| 41 | + widen : import refl; | |
| 42 | + | |
| 43 | +#<< | |
| 44 | + | |
| 45 | +init( jni_p : JNI ) | |
| 46 | +{ | |
| 47 | + # save java native inteface mod instance | |
| 48 | + jni = jni_p; | |
| 49 | + #>>extra initialization here | |
| 50 | + refl = load Reflect Reflect->PATH; | |
| 51 | + if ( refl == nil ) | |
| 52 | + jni->InitError( jni->sys->sprint( "java.lang.reflect.Constructor: could not load %s: %r", Reflect->PATH ) ); | |
| 53 | + else | |
| 54 | + refl->init(jni); | |
| 55 | + #<< | |
| 56 | +} | |
| 57 | + | |
| 58 | +getModifiers_I( this : ref Constructor_obj) : int | |
| 59 | +{#>> | |
| 60 | + # | |
| 61 | + # Assume that lower part of slot has modifier bits. | |
| 62 | + # | |
| 63 | + return this.slot & 16rffff; | |
| 64 | +}#<< | |
| 65 | + | |
| 66 | +newInstance_aObject_rObject( this : ref Constructor_obj, p0 : JArrayJObject) : JObject | |
| 67 | +{#>> | |
| 68 | + # this - a Constructor object representing a constructor of some class | |
| 69 | + # p0 - a Java array of Objects, containing argument values for the | |
| 70 | + # the constructor | |
| 71 | + # Returns a new instance, constructed by the 'this' constructor. | |
| 72 | + # | |
| 73 | + # Check inputs and build the argument list. | |
| 74 | + # | |
| 75 | + args := refl->BuildArgList(this.parameterTypes, p0); | |
| 76 | + # | |
| 77 | + # Allocate a new object, then do the call. | |
| 78 | + # | |
| 79 | + newobj := jni->AllocObject(this.clazz.class); | |
| 80 | + | |
| 81 | + # Eventually may be able to do something like | |
| 82 | + # (result, ok) = jni->CallConstruct(newobj, this.slot, args); | |
| 83 | + | |
| 84 | + fld := this.clazz.class.initmethods[this.slot >> 16]; | |
| 85 | + (nil, ok) := jni->CallMethod(newobj, fld.field, fld.signature, args); | |
| 86 | + | |
| 87 | + if ( ok == JNI->OK ) | |
| 88 | + return newobj; | |
| 89 | + return nil; | |
| 90 | +}#<< | |
| @@ -0,0 +1,18 @@ | ||
| 1 | +# generated file edit with care | |
| 2 | + | |
| 3 | +Constructor_L : module | |
| 4 | +{ | |
| 5 | + Constructor_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + clazz : JClass; | |
| 9 | + slot : int; | |
| 10 | + parameterTypes : JArrayJClass; | |
| 11 | + exceptionTypes : JArrayJClass; | |
| 12 | + }; | |
| 13 | + | |
| 14 | + init : fn( jni_p : JNI ); | |
| 15 | + getModifiers_I : fn( this : ref Constructor_obj) : int; | |
| 16 | + newInstance_aObject_rObject : fn( this : ref Constructor_obj, p0 : JArrayJObject) : JObject; | |
| 17 | + | |
| 18 | +}; | |
Empty file added.
| @@ -0,0 +1,469 @@ | ||
| 1 | +implement Field_L; | |
| 2 | + | |
| 3 | +# javal v1.5 generated file: edit with care | |
| 4 | + | |
| 5 | +include "jni.m"; | |
| 6 | + jni : JNI; | |
| 7 | + ClassModule, | |
| 8 | + JString, | |
| 9 | + JArray, | |
| 10 | + JArrayI, | |
| 11 | + JArrayC, | |
| 12 | + JArrayB, | |
| 13 | + JArrayS, | |
| 14 | + JArrayJ, | |
| 15 | + JArrayF, | |
| 16 | + JArrayD, | |
| 17 | + JArrayZ, | |
| 18 | + JArrayJObject, | |
| 19 | + JArrayJClass, | |
| 20 | + JArrayJString, | |
| 21 | + JClass, | |
| 22 | + JThread, | |
| 23 | + JObject : import jni; | |
| 24 | + | |
| 25 | +#>> extra pre includes here | |
| 26 | + | |
| 27 | + Value, | |
| 28 | + ClassData : import jni; | |
| 29 | + jldr : JavaClassLoader; | |
| 30 | + Object, | |
| 31 | + Class : import jldr; | |
| 32 | + | |
| 33 | +#<< | |
| 34 | + | |
| 35 | +include "Field_L.m"; | |
| 36 | + | |
| 37 | +#>> extra post includes here | |
| 38 | + | |
| 39 | +include "reflect.m"; | |
| 40 | + refl : Reflect; | |
| 41 | + | |
| 42 | +STATIC, NONSTATIC : con iota; | |
| 43 | + | |
| 44 | +illegalacc, | |
| 45 | +illegalarg, | |
| 46 | +nullptr : string; | |
| 47 | + | |
| 48 | +#<< | |
| 49 | + | |
| 50 | +init( jni_p : JNI ) | |
| 51 | +{ | |
| 52 | + # save java native inteface mod instance | |
| 53 | + jni = jni_p; | |
| 54 | + #>>extra initialization here | |
| 55 | + jldr = jni->jldr; | |
| 56 | + | |
| 57 | + illegalacc = "java.lang.IllegalAccessException"; | |
| 58 | + illegalarg = "java.lang.IllegalArgumentException"; | |
| 59 | + nullptr = "java.lang.NullPointerException"; | |
| 60 | + | |
| 61 | + refl = load Reflect Reflect->PATH; | |
| 62 | + if ( refl == nil ) | |
| 63 | + jni->InitError( jni->sys->sprint( "java.lang.reflect.Field: could not load %s: %r", Reflect->PATH ) ); | |
| 64 | + else | |
| 65 | + refl->init(jni); | |
| 66 | + | |
| 67 | + #<< | |
| 68 | +} | |
| 69 | + | |
| 70 | +getModifiers_I( this : ref Field_obj) : int | |
| 71 | +{#>> | |
| 72 | + # | |
| 73 | + # Assume that lower part of slot points has modifier bits. | |
| 74 | + # | |
| 75 | + return this.slot & 16rffff; | |
| 76 | +}#<< | |
| 77 | + | |
| 78 | +get_rObject_rObject( this : ref Field_obj, p0 : JObject) : JObject | |
| 79 | +{#>> | |
| 80 | + val := getChecks(this, p0); | |
| 81 | + | |
| 82 | + typ := refl->ValType(val); | |
| 83 | + | |
| 84 | + if ( typ == 0 ) # array of Objects. good. | |
| 85 | + return val.Object(); | |
| 86 | + | |
| 87 | + if ( typ >= JNI->T_BOOLEAN && typ <= JNI->T_LONG ) | |
| 88 | + return refl->ValueToObject(val); | |
| 89 | + return nil; | |
| 90 | +}#<< | |
| 91 | + | |
| 92 | +getBoolean_rObject_Z( this : ref Field_obj, p0 : JObject) : int | |
| 93 | +{#>> | |
| 94 | + val := getChecks(this, p0); | |
| 95 | + | |
| 96 | + pick sw := val { | |
| 97 | + TBoolean => return sw.jboolean; | |
| 98 | + } | |
| 99 | + jni->ThrowException(illegalarg, "Can't convert to boolean"); | |
| 100 | + return JNI->FALSE; | |
| 101 | +}#<< | |
| 102 | + | |
| 103 | +getByte_rObject_B( this : ref Field_obj, p0 : JObject) : int | |
| 104 | +{#>> | |
| 105 | + val := getChecks(this, p0); | |
| 106 | + | |
| 107 | + pick sw := val { | |
| 108 | + TByte => return sw.jbyte; | |
| 109 | + } | |
| 110 | + jni->ThrowException(illegalarg, "Can't convert to byte"); | |
| 111 | + return JNI->FALSE; | |
| 112 | +}#<< | |
| 113 | + | |
| 114 | +getChar_rObject_C( this : ref Field_obj, p0 : JObject) : int | |
| 115 | +{#>> | |
| 116 | + val := getChecks(this, p0); | |
| 117 | + | |
| 118 | + pick sw := val { | |
| 119 | + TChar => return sw.jchar; | |
| 120 | + } | |
| 121 | + jni->ThrowException(illegalarg, "Can't convert to char"); | |
| 122 | + return 0; | |
| 123 | +}#<< | |
| 124 | + | |
| 125 | +getShort_rObject_S( this : ref Field_obj, p0 : JObject) : int | |
| 126 | +{#>> | |
| 127 | + val := getChecks(this, p0); | |
| 128 | + | |
| 129 | + pick sw := val { | |
| 130 | + TByte => return int sw.jbyte; | |
| 131 | + TShort => return sw.jshort; | |
| 132 | + } | |
| 133 | + jni->ThrowException(illegalarg, "Can't convert to short"); | |
| 134 | + return 0; | |
| 135 | +}#<< | |
| 136 | + | |
| 137 | +getInt_rObject_I( this : ref Field_obj, p0 : JObject) : int | |
| 138 | +{#>> | |
| 139 | + val := getChecks(this, p0); | |
| 140 | + | |
| 141 | + pick sw := val { | |
| 142 | + TByte => return int sw.jbyte; | |
| 143 | + TChar => return sw.jchar; | |
| 144 | + TShort => return sw.jshort; | |
| 145 | + TInt => return sw.jint; | |
| 146 | + } | |
| 147 | + jni->ThrowException(illegalarg, "Can't convert to int"); | |
| 148 | + return 0; | |
| 149 | +}#<< | |
| 150 | + | |
| 151 | +getLong_rObject_J( this : ref Field_obj, p0 : JObject) : big | |
| 152 | +{#>> | |
| 153 | + val := getChecks(this, p0); | |
| 154 | + | |
| 155 | + pick sw := val { | |
| 156 | + TByte => return big sw.jbyte; | |
| 157 | + TChar => return big sw.jchar; | |
| 158 | + TShort => return big sw.jshort; | |
| 159 | + TInt => return big sw.jint; | |
| 160 | + TLong => return sw.jlong; | |
| 161 | + } | |
| 162 | + jni->ThrowException(illegalarg, "Can't convert to long"); | |
| 163 | + return big 0; | |
| 164 | +}#<< | |
| 165 | + | |
| 166 | +getFloat_rObject_F( this : ref Field_obj, p0 : JObject) : real | |
| 167 | +{#>> | |
| 168 | + val := getChecks(this, p0); | |
| 169 | + | |
| 170 | + pick sw := val { | |
| 171 | + TByte => return real sw.jbyte; | |
| 172 | + TChar => return real sw.jchar; | |
| 173 | + TShort => return real sw.jshort; | |
| 174 | + TInt => return real sw.jint; | |
| 175 | + TLong => return real sw.jlong; | |
| 176 | + TFloat => return sw.jfloat; | |
| 177 | + } | |
| 178 | + jni->ThrowException(illegalarg, "Can't convert to float"); | |
| 179 | + return 0.0; | |
| 180 | +}#<< | |
| 181 | + | |
| 182 | +getDouble_rObject_D( this : ref Field_obj, p0 : JObject) : real | |
| 183 | +{#>> | |
| 184 | + val := getChecks(this, p0); | |
| 185 | + | |
| 186 | + pick sw := val { | |
| 187 | + TByte => return real sw.jbyte; | |
| 188 | + TChar => return real sw.jchar; | |
| 189 | + TShort => return real sw.jshort; | |
| 190 | + TInt => return real sw.jint; | |
| 191 | + TLong => return real sw.jlong; | |
| 192 | + TFloat => return sw.jfloat; | |
| 193 | + TDouble => return sw.jdouble; | |
| 194 | + } | |
| 195 | + jni->ThrowException(illegalarg, "Can't convert to double"); | |
| 196 | + return 0.0; | |
| 197 | +}#<< | |
| 198 | + | |
| 199 | +set_rObject_rObject_V( this : ref Field_obj, p0 : JObject,p1 : JObject) | |
| 200 | +{#>> | |
| 201 | + want := putChecks(this, p0); | |
| 202 | + clazz := jni->GetObjectClass(p1); | |
| 203 | + | |
| 204 | + if ( want == 0 ) { # field value is Object | |
| 205 | + p := ref Value.TObject; | |
| 206 | + if ( jni->IsAssignable(clazz, this.clazz) == JNI->TRUE ) { | |
| 207 | + p.jobj = p1; | |
| 208 | + SetField(this, p0, p); | |
| 209 | + return; | |
| 210 | + } | |
| 211 | + else { | |
| 212 | + jni->ThrowException(illegalarg, "Can't safely cast"); | |
| 213 | + return; | |
| 214 | + } | |
| 215 | + } | |
| 216 | + # The field is a primitive type. Then p1 better be a wrapper for that | |
| 217 | + # type. (Or is it okay if it's a wrapper for something that can be | |
| 218 | + # safely cast to the target type?) | |
| 219 | + # | |
| 220 | + # is p1 a Boolean object, or sub-classed from a Boolean object, | |
| 221 | + # or a String with value "true" or "false" ? | |
| 222 | + # | |
| 223 | + (typ, val) := refl->GetVal(p1); | |
| 224 | + if ( typ == 0 || (val = refl->widen(typ, want, val)) == nil ) { | |
| 225 | + jni->ThrowException(illegalarg, "Object can't be cast to needed type"); | |
| 226 | + return; | |
| 227 | + } | |
| 228 | + SetField(this, p0, val); | |
| 229 | + return; | |
| 230 | +}#<< | |
| 231 | + | |
| 232 | +setBoolean_rObject_Z_V( this : ref Field_obj, p0 : JObject,p1 : int) | |
| 233 | +{#>> | |
| 234 | + want := putChecks(this, p0); | |
| 235 | + | |
| 236 | +# | |
| 237 | +# Note that if the field's signature is "Ljava.lang.Boolean;", | |
| 238 | +# we could create an appropriate Object and assign it. | |
| 239 | +# But it isn't clear if that is what's wanted. | |
| 240 | +# A similar argument applies for the other set<Type> functions. | |
| 241 | +# | |
| 242 | + p : ref Value; | |
| 243 | + case want { | |
| 244 | + JNI->T_BOOLEAN => p = ref Value.TBoolean(p1); | |
| 245 | + * => | |
| 246 | + jni->ThrowException(illegalarg, "Can't convert from boolean"); | |
| 247 | + return; | |
| 248 | + } | |
| 249 | + SetField(this, p0, p); | |
| 250 | +}#<< | |
| 251 | + | |
| 252 | +setByte_rObject_B_V( this : ref Field_obj, p0 : JObject,p1 : int) | |
| 253 | +{#>> | |
| 254 | + want := putChecks(this, p0); | |
| 255 | + | |
| 256 | + p : ref Value; | |
| 257 | + case want { | |
| 258 | + JNI->T_BYTE => p = ref Value.TByte(p1); | |
| 259 | + JNI->T_SHORT => p = ref Value.TShort(int p1); | |
| 260 | + JNI->T_INT => p = ref Value.TInt(int p1); | |
| 261 | + JNI->T_LONG => p = ref Value.TLong(big p1); | |
| 262 | + JNI->T_FLOAT => p = ref Value.TFloat(real p1); | |
| 263 | + JNI->T_DOUBLE => p = ref Value.TDouble(real p1); | |
| 264 | + * => | |
| 265 | + jni->ThrowException(illegalarg, "Can't convert from byte"); | |
| 266 | + return; | |
| 267 | + } | |
| 268 | + SetField(this, p0, p); | |
| 269 | +}#<< | |
| 270 | + | |
| 271 | +setChar_rObject_C_V( this : ref Field_obj, p0 : JObject,p1 : int) | |
| 272 | +{#>> | |
| 273 | + want := putChecks(this, p0); | |
| 274 | + | |
| 275 | + p : ref Value; | |
| 276 | + case want { | |
| 277 | + JNI->T_CHAR => p = ref Value.TChar(p1); | |
| 278 | + * => | |
| 279 | + jni->ThrowException(illegalarg, "Can't convert from char"); | |
| 280 | + return; | |
| 281 | + } | |
| 282 | + SetField(this, p0, p); | |
| 283 | +}#<< | |
| 284 | + | |
| 285 | +setShort_rObject_S_V( this : ref Field_obj, p0 : JObject,p1 : int) | |
| 286 | +{#>> | |
| 287 | + want := putChecks(this, p0); | |
| 288 | + | |
| 289 | + p : ref Value; | |
| 290 | + case want { | |
| 291 | + JNI->T_SHORT => p = ref Value.TShort(p1); | |
| 292 | + JNI->T_INT => p = ref Value.TInt(p1); | |
| 293 | + JNI->T_LONG => p = ref Value.TLong(big p1); | |
| 294 | + JNI->T_FLOAT => p = ref Value.TFloat(real p1); | |
| 295 | + JNI->T_DOUBLE => p = ref Value.TDouble(real p1); | |
| 296 | + * => | |
| 297 | + jni->ThrowException(illegalarg, "Can't convert from short"); | |
| 298 | + return; | |
| 299 | + } | |
| 300 | + SetField(this, p0, p); | |
| 301 | +}#<< | |
| 302 | + | |
| 303 | +setInt_rObject_I_V( this : ref Field_obj, p0 : JObject,p1 : int) | |
| 304 | +{#>> | |
| 305 | + want := putChecks(this, p0); | |
| 306 | + | |
| 307 | + p : ref Value; | |
| 308 | + case want { | |
| 309 | + JNI->T_INT => p = ref Value.TInt(p1); | |
| 310 | + JNI->T_LONG => p = ref Value.TLong(big p1); | |
| 311 | + JNI->T_FLOAT => p = ref Value.TFloat(real p1); | |
| 312 | + JNI->T_DOUBLE => p = ref Value.TDouble(real p1); | |
| 313 | + * => | |
| 314 | + jni->ThrowException(illegalarg, "Can't convert from int"); | |
| 315 | + return; | |
| 316 | + } | |
| 317 | + SetField(this, p0, p); | |
| 318 | +}#<< | |
| 319 | + | |
| 320 | +setLong_rObject_J_V( this : ref Field_obj, p0 : JObject,p1 : big) | |
| 321 | +{#>> | |
| 322 | + want := putChecks(this, p0); | |
| 323 | + | |
| 324 | + p : ref Value; | |
| 325 | + case want { | |
| 326 | + JNI->T_LONG => p = ref Value.TLong(p1); | |
| 327 | + JNI->T_FLOAT => p = ref Value.TFloat(real p1); | |
| 328 | + JNI->T_DOUBLE => p = ref Value.TDouble(real p1); | |
| 329 | + * => | |
| 330 | + jni->ThrowException(illegalarg, "Can't convert from long"); | |
| 331 | + return; | |
| 332 | + } | |
| 333 | + SetField(this, p0, p); | |
| 334 | +}#<< | |
| 335 | + | |
| 336 | +setFloat_rObject_F_V( this : ref Field_obj, p0 : JObject,p1 : real) | |
| 337 | +{#>> | |
| 338 | + want := putChecks(this, p0); | |
| 339 | + | |
| 340 | + p : ref Value; | |
| 341 | + case want { | |
| 342 | + JNI->T_FLOAT => p = ref Value.TFloat(p1); | |
| 343 | + JNI->T_DOUBLE => p = ref Value.TDouble(p1); | |
| 344 | + * => | |
| 345 | + jni->ThrowException(illegalarg, "Can't convert from float"); | |
| 346 | + return; | |
| 347 | + } | |
| 348 | + SetField(this, p0, p); | |
| 349 | +}#<< | |
| 350 | + | |
| 351 | +setDouble_rObject_D_V( this : ref Field_obj, p0 : JObject,p1 : real) | |
| 352 | +{#>> | |
| 353 | + want := putChecks(this, p0); | |
| 354 | + | |
| 355 | + p : ref Value; | |
| 356 | + case want { | |
| 357 | + JNI->T_DOUBLE => p = ref Value.TDouble(p1); | |
| 358 | + * => | |
| 359 | + jni->ThrowException(illegalarg, "Can't convert from double"); | |
| 360 | + return; | |
| 361 | + } | |
| 362 | + SetField(this, p0, p); | |
| 363 | +}#<< | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | +getChecks( this : ref Field_obj, p0 : JObject) : ref Value | |
| 368 | +{ | |
| 369 | + if ( (this.slot & jldr->ACC_STATIC) == 0 && p0 == nil ) | |
| 370 | + jni->ThrowException(nullptr, "reading field of null Object"); | |
| 371 | + | |
| 372 | + # See if the target object is the same as the one declaring the field. | |
| 373 | + # this.clazz.class_data is ref to a classloader.Class adt | |
| 374 | + | |
| 375 | + cldata := this.clazz.class; | |
| 376 | + if ( (this.slot & jldr->ACC_STATIC) == 0 && jni->IsInstanceOf(p0, cldata) != JNI->TRUE ) { | |
| 377 | + jni->ThrowException(illegalarg, | |
| 378 | + "Object is not an instance of this class"); | |
| 379 | + return nil; | |
| 380 | + } | |
| 381 | + | |
| 382 | + if ( (this.slot & jldr->ACC_PUBLIC) == 0 ) | |
| 383 | + jni->ThrowException(illegalacc, "reading non-public field"); | |
| 384 | + | |
| 385 | + if ( this.slot & jldr->ACC_STATIC ) | |
| 386 | + return GetStat(cldata, this.slot); | |
| 387 | + else | |
| 388 | + return GetField(p0, this.slot); | |
| 389 | +} | |
| 390 | + | |
| 391 | +putChecks( this : ref Field_obj, p0 : JObject) : int | |
| 392 | +{ | |
| 393 | + if ( (this.slot & jldr->ACC_STATIC) == 0 && p0 == nil ) | |
| 394 | + jni->ThrowException(nullptr, "writing field of null Object"); | |
| 395 | + | |
| 396 | + # See if the target object is the same as the one declaring the field. | |
| 397 | + # this.clazz.class_data is ref to a classloader.Class adt | |
| 398 | + | |
| 399 | + cldata := this.clazz.class; | |
| 400 | + if ( (this.slot & jldr->ACC_STATIC) == 0 && jni->IsInstanceOf(p0, cldata) != JNI->TRUE ) { | |
| 401 | + jni->ThrowException(illegalarg, | |
| 402 | + "Object is not an instance of this class"); | |
| 403 | + return 0; | |
| 404 | + } | |
| 405 | + | |
| 406 | + if ( (this.slot & jldr->ACC_PUBLIC) == 0 || (this.slot & jldr->ACC_FINAL) != 0 ) | |
| 407 | + jni->ThrowException(illegalacc, "writing non-public or final field"); | |
| 408 | + | |
| 409 | + if ( this.slot & jldr->ACC_STATIC ) | |
| 410 | + return refl->SigToType(cldata.staticdata[this.slot >> 16].signature); | |
| 411 | + else { | |
| 412 | + flds := cldata.objectdata; | |
| 413 | + for ( i := (this.slot >> 16); i > 0; i--) | |
| 414 | + flds = tl flds; | |
| 415 | + return refl->SigToType((hd flds).signature); | |
| 416 | + } | |
| 417 | + return 0; | |
| 418 | +} | |
| 419 | + | |
| 420 | +checkMemberAccess(which : int) | |
| 421 | +{ | |
| 422 | + return; | |
| 423 | +} | |
| 424 | + | |
| 425 | +SetField(this : ref Field_obj, o : JObject, v : ref Value) | |
| 426 | +{ | |
| 427 | + cldata := this.clazz.class; | |
| 428 | + if ( (this.slot & jldr->ACC_STATIC) != 0 ) { | |
| 429 | + fld := cldata.staticdata[this.slot >> 16]; | |
| 430 | + jni->SetStaticField(cldata, fld.field, v); | |
| 431 | + } | |
| 432 | + else { | |
| 433 | + flds := cldata.objectdata; | |
| 434 | + for ( i := (this.slot >> 16); i > 0; i-- ) | |
| 435 | + flds = tl flds; | |
| 436 | + fld := hd flds; | |
| 437 | + jni->SetObjField(o, fld.field, v); | |
| 438 | + } | |
| 439 | +} | |
| 440 | + | |
| 441 | +widen(have, want : string, val : ref Value) : ref Value | |
| 442 | +{ | |
| 443 | + if ( have == want ) | |
| 444 | + return val; | |
| 445 | + havetype := refl->SigToType(have); | |
| 446 | + wanttype := refl->SigToType(want); | |
| 447 | + return refl->widen(havetype, wanttype, val); | |
| 448 | +} | |
| 449 | +# | |
| 450 | +# Eventually JNI may provide a funtions to do this more directly. | |
| 451 | +# | |
| 452 | +GetStat(cldata : ClassData, slot : int) : ref Value | |
| 453 | +{ | |
| 454 | + fld := cldata.staticdata[slot >> 16]; | |
| 455 | + return jni->GetStaticField(cldata, fld.field, fld.signature); | |
| 456 | +} | |
| 457 | +# | |
| 458 | +# Eventually JNI may provide a funtions to do this more directly. | |
| 459 | +# It would probably know what to do about privatemethods, if anything. | |
| 460 | +# | |
| 461 | +GetField(obj : JObject, slot : int) : ref Value | |
| 462 | +{ | |
| 463 | + flds := obj.class().objectdata; | |
| 464 | + for ( i := (slot >> 16); i > 0; i-- ) | |
| 465 | + flds = tl flds; | |
| 466 | + fld := hd flds; | |
| 467 | + return jni->GetObjField(obj, fld.field, fld.signature); | |
| 468 | +} | |
| 469 | + | |
| @@ -0,0 +1,35 @@ | ||
| 1 | +# javal v1.5 generated file: edit with care | |
| 2 | + | |
| 3 | +Field_L : module | |
| 4 | +{ | |
| 5 | + Field_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + clazz : JClass; | |
| 9 | + slot : int; | |
| 10 | + name : JString; | |
| 11 | + type_j : JClass; | |
| 12 | + }; | |
| 13 | + | |
| 14 | + init : fn( jni_p : JNI ); | |
| 15 | + getModifiers_I : fn( this : ref Field_obj) : int; | |
| 16 | + get_rObject_rObject : fn( this : ref Field_obj, p0 : JObject) : JObject; | |
| 17 | + getBoolean_rObject_Z : fn( this : ref Field_obj, p0 : JObject) : int; | |
| 18 | + getByte_rObject_B : fn( this : ref Field_obj, p0 : JObject) : int; | |
| 19 | + getChar_rObject_C : fn( this : ref Field_obj, p0 : JObject) : int; | |
| 20 | + getShort_rObject_S : fn( this : ref Field_obj, p0 : JObject) : int; | |
| 21 | + getInt_rObject_I : fn( this : ref Field_obj, p0 : JObject) : int; | |
| 22 | + getLong_rObject_J : fn( this : ref Field_obj, p0 : JObject) : big; | |
| 23 | + getFloat_rObject_F : fn( this : ref Field_obj, p0 : JObject) : real; | |
| 24 | + getDouble_rObject_D : fn( this : ref Field_obj, p0 : JObject) : real; | |
| 25 | + set_rObject_rObject_V : fn( this : ref Field_obj, p0 : JObject,p1 : JObject); | |
| 26 | + setBoolean_rObject_Z_V : fn( this : ref Field_obj, p0 : JObject,p1 : int); | |
| 27 | + setByte_rObject_B_V : fn( this : ref Field_obj, p0 : JObject,p1 : int); | |
| 28 | + setChar_rObject_C_V : fn( this : ref Field_obj, p0 : JObject,p1 : int); | |
| 29 | + setShort_rObject_S_V : fn( this : ref Field_obj, p0 : JObject,p1 : int); | |
| 30 | + setInt_rObject_I_V : fn( this : ref Field_obj, p0 : JObject,p1 : int); | |
| 31 | + setLong_rObject_J_V : fn( this : ref Field_obj, p0 : JObject,p1 : big); | |
| 32 | + setFloat_rObject_F_V : fn( this : ref Field_obj, p0 : JObject,p1 : real); | |
| 33 | + setDouble_rObject_D_V : fn( this : ref Field_obj, p0 : JObject,p1 : real); | |
| 34 | + | |
| 35 | +}; | |
Empty file added.
Empty file added.
Empty file added.
| @@ -0,0 +1,117 @@ | ||
| 1 | +implement Method_L; | |
| 2 | + | |
| 3 | +include "jni.m"; | |
| 4 | + jni : JNI; | |
| 5 | + ClassModule, | |
| 6 | + JString, | |
| 7 | + JArray, | |
| 8 | + JArrayI, | |
| 9 | + JArrayC, | |
| 10 | + JArrayB, | |
| 11 | + JArrayS, | |
| 12 | + JArrayJ, | |
| 13 | + JArrayF, | |
| 14 | + JArrayD, | |
| 15 | + JArrayZ, | |
| 16 | + JArrayJObject, | |
| 17 | + JArrayJClass, | |
| 18 | + JArrayJString, | |
| 19 | + JClass, | |
| 20 | + JObject : import jni; | |
| 21 | + | |
| 22 | +#>> extra pre includes here | |
| 23 | + | |
| 24 | + Value, | |
| 25 | + ClassData, | |
| 26 | + jldr : import jni; | |
| 27 | + | |
| 28 | + Object : import jldr; | |
| 29 | + | |
| 30 | +#<< | |
| 31 | + | |
| 32 | +include "Method_L.m"; | |
| 33 | + | |
| 34 | +#>> extra post includes here | |
| 35 | + | |
| 36 | +illegalarg := "java.lang.IllegalArgumentException"; | |
| 37 | +nullptr := "java.lang.NullPointerException"; | |
| 38 | + | |
| 39 | +include "reflect.m"; | |
| 40 | + refl : Reflect; | |
| 41 | + widen : import refl; | |
| 42 | + | |
| 43 | +#<< | |
| 44 | + | |
| 45 | +init( jni_p : JNI ) | |
| 46 | +{ | |
| 47 | + # save java native inteface mod instance | |
| 48 | + jni = jni_p; | |
| 49 | + #>>extra initialization here | |
| 50 | + refl = load Reflect Reflect->PATH; | |
| 51 | + if ( refl == nil ) | |
| 52 | + jni->InitError( jni->sys->sprint( "java.lang.reflect.Method: could not load %s: %r", Reflect->PATH ) ); | |
| 53 | + else | |
| 54 | + refl->init(jni); | |
| 55 | + #<< | |
| 56 | +} | |
| 57 | + | |
| 58 | +getModifiers_I( this : ref Method_obj) : int | |
| 59 | +{#>> | |
| 60 | + # | |
| 61 | + # Assume that lower part of slot has modifier bits. | |
| 62 | + # | |
| 63 | + return this.slot & 16rffff; | |
| 64 | +}#<< | |
| 65 | + | |
| 66 | +invoke_rObject_aObject_rObject( this : ref Method_obj, p0 : JObject,p1 : JArrayJObject) : JObject | |
| 67 | +{#>> | |
| 68 | + # this - a Method object. The corresponding method should be invoked for | |
| 69 | + # p0 - an Object which should contain that method, with | |
| 70 | + # p1 - a Java array of Objects that are the arguments to the method. | |
| 71 | + # Can be null if the method has no arguments. | |
| 72 | + # Returns an object reflecting the value returned by the method call. | |
| 73 | + # | |
| 74 | + # First do some checking. If 'this' is a static method, p0 is ignored, | |
| 75 | + # otherwise it must an instance of the class in which the method is | |
| 76 | + # declared. | |
| 77 | + # | |
| 78 | + if ( (this.slot & JNI->ACC_STATIC) == 0 ) { # not static | |
| 79 | + if ( p0 == nil ) | |
| 80 | + jni->ThrowException(nullptr, "Must supply an instance"); | |
| 81 | + if ( jni->IsInstanceOf(p0, this.clazz.class) == JNI->FALSE ) | |
| 82 | + jni->ThrowException(illegalarg, "Method not in object"); | |
| 83 | + } | |
| 84 | + # | |
| 85 | + # Check inputs and build the argument list. | |
| 86 | + # | |
| 87 | + args := refl->BuildArgList(this.parameterTypes, p1); | |
| 88 | + # | |
| 89 | + # Do the call. | |
| 90 | + # | |
| 91 | + result : ref Value; | |
| 92 | + ok : int; | |
| 93 | + if ( this.slot & JNI->ACC_STATIC ) { | |
| 94 | + fld := this.clazz.class.staticmethods[this.slot >> 16]; | |
| 95 | + (result, ok) = jni->CallStatic(this.clazz.class, fld.field, | |
| 96 | + fld.signature, args); | |
| 97 | + } | |
| 98 | + else { | |
| 99 | + fld : ref JavaClassLoader->Field; | |
| 100 | + if ( (this.slot & JNI->ACC_PRIVATE) != 0 ) | |
| 101 | + fld = p0.class().privatemethods[this.slot >> 16]; | |
| 102 | + else | |
| 103 | + fld = p0.class().virtualmethods[this.slot >> 16].field; | |
| 104 | + (result, ok) = jni->CallMethod(p0, fld.field, fld.signature, args); | |
| 105 | + } | |
| 106 | + # | |
| 107 | + # If necessary, wrap the answer up as an Object. | |
| 108 | + # | |
| 109 | + if ( ok == JNI->OK && result != nil ) { | |
| 110 | + typ := refl->ValType(result); | |
| 111 | + if ( typ >= JNI->T_BOOLEAN && typ <= JNI->T_LONG ) | |
| 112 | + return refl->ValueToObject(result); | |
| 113 | + else | |
| 114 | + return result.Object(); | |
| 115 | + } | |
| 116 | + return nil; | |
| 117 | +}#<< | |
| @@ -0,0 +1,20 @@ | ||
| 1 | +# generated file edit with care | |
| 2 | + | |
| 3 | +Method_L : module | |
| 4 | +{ | |
| 5 | + Method_obj : adt | |
| 6 | + { | |
| 7 | + cl_mod : ClassModule; | |
| 8 | + clazz : JClass; | |
| 9 | + slot : int; | |
| 10 | + name : JString; | |
| 11 | + returnType : JClass; | |
| 12 | + parameterTypes : JArrayJClass; | |
| 13 | + exceptionTypes : JArrayJClass; | |
| 14 | + }; | |
| 15 | + | |
| 16 | + init : fn( jni_p : JNI ); | |
| 17 | + getModifiers_I : fn( this : ref Method_obj) : int; | |
| 18 | + invoke_rObject_aObject_rObject : fn( this : ref Method_obj, p0 : JObject,p1 : JArrayJObject) : JObject; | |
| 19 | + | |
| 20 | +}; | |
Empty file added.
| @@ -0,0 +1,46 @@ | ||
| 1 | +<../../../../../mkconfig | |
| 2 | + | |
| 3 | +TARG=\ | |
| 4 | + Array.dis\ | |
| 5 | + Constructor.dis\ | |
| 6 | + Field.dis\ | |
| 7 | +# for InvocationTargetException.dis\ | |
| 8 | + esaAWjdsByqq9cEPQZTRT.dis\ | |
| 9 | + Member.dis\ | |
| 10 | + Method.dis\ | |
| 11 | + Modifier.dis\ | |
| 12 | +# Limbo code\ | |
| 13 | + Array_L.dis\ | |
| 14 | + Constructor_L.dis\ | |
| 15 | + Field_L.dis\ | |
| 16 | + Method_L.dis\ | |
| 17 | + reflect.dis\ | |
| 18 | + | |
| 19 | +MODULES=\ | |
| 20 | + $ROOT/java/module/classloader.m\ | |
| 21 | + $ROOT/java/module/jni.m\ | |
| 22 | + $ROOT/java/module/cast.m\ | |
| 23 | + Array_L.m\ | |
| 24 | + Constructor_L.m\ | |
| 25 | + Field_L.m\ | |
| 26 | + Method_L.m\ | |
| 27 | + reflect.m\ | |
| 28 | + | |
| 29 | +SYSMODULES=\ | |
| 30 | + draw.m\ | |
| 31 | + hash.m\ | |
| 32 | + keyring.m\ | |
| 33 | + loader.m\ | |
| 34 | + math.m\ | |
| 35 | + string.m\ | |
| 36 | + sys.m\ | |
| 37 | + | |
| 38 | +DISBIN=$ROOT/java/dis/java/java/lang/reflect | |
| 39 | + | |
| 40 | +<$ROOT/mkfiles/mkjava | |
| 41 | + | |
| 42 | +reflect.dis: reflect.b | |
| 43 | + limbo $LIMBOINCL -gw reflect.b | |
| 44 | + | |
| 45 | +esaAWjdsByqq9cEPQZTRT.dis: InvocationTargetException.class | |
| 46 | + j2d InvocationTargetException.class | |
| @@ -0,0 +1,327 @@ | ||
| 1 | +implement Reflect; | |
| 2 | + | |
| 3 | +include "jni.m"; | |
| 4 | + jni : JNI; | |
| 5 | + cast : Cast; | |
| 6 | + | |
| 7 | + JObject, | |
| 8 | + JClass, | |
| 9 | + JArrayJClass, | |
| 10 | + JArrayJObject, | |
| 11 | + Value : import jni; | |
| 12 | + OK, | |
| 13 | + ERR, | |
| 14 | + TRUE, | |
| 15 | + FALSE, | |
| 16 | + #T_OBJECT, T_ARRAY, | |
| 17 | + T_BOOLEAN, | |
| 18 | + T_BYTE, | |
| 19 | + T_CHAR, | |
| 20 | + T_SHORT, | |
| 21 | + T_INT, | |
| 22 | + T_LONG, | |
| 23 | + T_FLOAT, | |
| 24 | + T_DOUBLE : import JNI; | |
| 25 | + | |
| 26 | + ClassData : import JNI; | |
| 27 | + | |
| 28 | +include "reflect.m"; | |
| 29 | + | |
| 30 | +wrapper_class := array[T_LONG-T_BOOLEAN+1] of ClassData; | |
| 31 | +wrapper_name := array[] of { "Boolean", | |
| 32 | + "Character", | |
| 33 | + "Float", | |
| 34 | + "Double", | |
| 35 | + "Byte", | |
| 36 | + "Short", | |
| 37 | + "Integer", | |
| 38 | + "Long" }; | |
| 39 | +type_string := "ZCFDBSIJ"; | |
| 40 | + | |
| 41 | +illegalarg := "java.lang.IllegalArgumentException"; | |
| 42 | +nullptr := "java.lang.NullPointerException"; | |
| 43 | + | |
| 44 | +init(jni_m : JNI) { | |
| 45 | + jni = jni_m; | |
| 46 | + for ( i := 0; i <= T_LONG - T_BOOLEAN; i++ ) | |
| 47 | + wrapper_class[i] = jni->FindClass("java/lang/" + wrapper_name[i]); | |
| 48 | + cast = jni->CastMod(); | |
| 49 | +} | |
| 50 | + | |
| 51 | +widen(have, want : int, val : ref Value) : ref Value | |
| 52 | +{ | |
| 53 | + if ( have == want ) | |
| 54 | + return val; | |
| 55 | + havetype := have; | |
| 56 | + wanttype := want; | |
| 57 | + valint : int; | |
| 58 | + valbig : big; | |
| 59 | + valreal : real; | |
| 60 | + if ( havetype == 0 || wanttype == 0 ) | |
| 61 | + return nil; | |
| 62 | + pick sw := val { | |
| 63 | + TByte => | |
| 64 | + valint = int sw.jbyte; | |
| 65 | + valbig = big valint; | |
| 66 | + valreal = real valint; | |
| 67 | + TShort => | |
| 68 | + valint = sw.jshort; | |
| 69 | + valbig = big valint; | |
| 70 | + valreal = real valint; | |
| 71 | + TChar => | |
| 72 | + valint = sw.jchar; | |
| 73 | + valbig = big valint; | |
| 74 | + valreal = real valint; | |
| 75 | + TInt => | |
| 76 | + valint = sw.jint; | |
| 77 | + valbig = big valint; | |
| 78 | + valreal = real valint; | |
| 79 | + TLong => | |
| 80 | + valbig = sw.jlong; | |
| 81 | + valreal = real valbig; | |
| 82 | + TFloat => | |
| 83 | + valreal = sw.jfloat; | |
| 84 | + } | |
| 85 | + case ( wanttype ) { | |
| 86 | + T_BOOLEAN or T_BYTE or T_CHAR => | |
| 87 | + return nil; | |
| 88 | + T_SHORT => | |
| 89 | + case ( havetype ) { | |
| 90 | + T_BYTE => | |
| 91 | + sw := ref Value.TShort; | |
| 92 | + sw.jshort = valint; | |
| 93 | + val = sw; | |
| 94 | + * => | |
| 95 | + return nil; | |
| 96 | + } | |
| 97 | + T_INT => | |
| 98 | + case ( havetype ) { | |
| 99 | + T_BYTE or T_SHORT or T_CHAR => | |
| 100 | + sw := ref Value.TInt; | |
| 101 | + sw.jint = valint; | |
| 102 | + val = sw; | |
| 103 | + * => | |
| 104 | + return nil; | |
| 105 | + } | |
| 106 | + T_LONG => | |
| 107 | + case ( havetype ) { | |
| 108 | + T_BYTE or T_SHORT or T_CHAR or T_INT => | |
| 109 | + sw := ref Value.TLong; | |
| 110 | + sw.jlong = valbig; | |
| 111 | + val = sw; | |
| 112 | + * => | |
| 113 | + return nil; | |
| 114 | + } | |
| 115 | + T_FLOAT => | |
| 116 | + case ( havetype ) { | |
| 117 | + T_BYTE or T_SHORT or T_CHAR or T_INT or T_LONG => | |
| 118 | + sw := ref Value.TFloat; | |
| 119 | + sw.jfloat = valreal; | |
| 120 | + val = sw; | |
| 121 | + * => | |
| 122 | + return nil; | |
| 123 | + } | |
| 124 | + T_DOUBLE => | |
| 125 | + case ( havetype ) { | |
| 126 | + T_BYTE or T_SHORT or T_CHAR or T_INT or T_LONG or T_FLOAT => | |
| 127 | + sw := ref Value.TDouble; | |
| 128 | + sw.jdouble = valreal; | |
| 129 | + val = sw; | |
| 130 | + * => | |
| 131 | + return nil; | |
| 132 | + } | |
| 133 | + } | |
| 134 | + return val; | |
| 135 | +} | |
| 136 | +BuildArgList(parms : JArrayJClass, arg : JArrayJObject) : array of ref Value | |
| 137 | +{ | |
| 138 | + # | |
| 139 | + # First do some checking. | |
| 140 | + # | |
| 141 | + l := 0; | |
| 142 | + formal: array of JClass; | |
| 143 | + actual: array of JObject; | |
| 144 | + args: array of ref Value; | |
| 145 | + if ( parms != nil ) { | |
| 146 | + if ( arg == nil ) | |
| 147 | + jni->ThrowException(nullptr, "constructor requires parameters"); | |
| 148 | + if ( len parms.ary != len arg.ary ) | |
| 149 | + jni->ThrowException(illegalarg, "Wrong number of args"); | |
| 150 | + l = len parms.ary; | |
| 151 | + formal = parms.ary; # array of JClass | |
| 152 | + actual = arg.ary; # array of JObject | |
| 153 | + args = array[l] of ref Value; | |
| 154 | + } | |
| 155 | + else # There are no formal parameters | |
| 156 | + if ( arg != nil && len arg.ary != 0 ) # But there are actual arguments | |
| 157 | + jni->ThrowException(illegalarg, "Wrong number of args"); | |
| 158 | + | |
| 159 | + # | |
| 160 | + # March through the arguments, checking for type as we go. | |
| 161 | + # | |
| 162 | + for ( i := 0; i < l; i++ ) { | |
| 163 | + # | |
| 164 | + # Is the formal parameter a primitive? | |
| 165 | + # | |
| 166 | + if ( (want := jni->PrimitiveIndex(formal[i], 1)) > 0 ) { | |
| 167 | + # | |
| 168 | + # Actual parameter should be (derived from) a wrapper, and | |
| 169 | + # be able to be widened to the formal parameter type. | |
| 170 | + # | |
| 171 | + (typ, parmval) := GetVal(actual[i]); | |
| 172 | + if ( (val := widen(want, typ, parmval)) != nil ) | |
| 173 | + args[i] = val; | |
| 174 | + else | |
| 175 | + jni->ThrowException(illegalarg, "Argument " + string (i+1) + | |
| 176 | + ", can't cast"); | |
| 177 | + } | |
| 178 | + else if ( jni->IsInstanceOf(actual[i], formal[i].class) == JNI->TRUE ) { | |
| 179 | + val := ref Value.TObject; | |
| 180 | + val.jobj = actual[i]; | |
| 181 | + args[i] = val; | |
| 182 | + } | |
| 183 | + else | |
| 184 | + jni->ThrowException(illegalarg, "Argument " + string (i+1) + | |
| 185 | + " wrong type"); | |
| 186 | + } | |
| 187 | + return args; | |
| 188 | +} | |
| 189 | +# | |
| 190 | +# Return a JClass corresponding to the Java type t. | |
| 191 | +# | |
| 192 | +Class(t : int) : JClass | |
| 193 | +{ | |
| 194 | + if ( t < T_BOOLEAN || t > T_LONG ) | |
| 195 | + return nil; | |
| 196 | + return jni->GetClassObject(wrapper_class[t - T_BOOLEAN]); | |
| 197 | +} | |
| 198 | +# | |
| 199 | +# Return a Class Object corresponding to the Java type t. | |
| 200 | +# | |
| 201 | +ClassObject(t : int) : JObject | |
| 202 | +{ | |
| 203 | + return cast->FromJClass(Class(t)); | |
| 204 | +} | |
| 205 | +# | |
| 206 | +# Given the java type, get the Class object representing this | |
| 207 | +# type, and return as a Value. | |
| 208 | +# | |
| 209 | +GetPrimitiveClass(typ : int) : ref Value | |
| 210 | +{ | |
| 211 | + return jni->GetStaticField(wrapper_class[typ - T_BOOLEAN], "TYPE", | |
| 212 | + "Ljava/lang/Class;"); | |
| 213 | +} | |
| 214 | +# | |
| 215 | +# If the Object o is a wrapper for a Java primitive type, return the | |
| 216 | +# primitive value (in a Value adt) and the type index. | |
| 217 | +# Otherwise, return 0 and a nil Value. | |
| 218 | +# | |
| 219 | +GetVal(o : JObject) : (int, ref Value) | |
| 220 | +{ | |
| 221 | + j := T_BOOLEAN; | |
| 222 | + for ( i := j; i <= T_LONG; i++ ) { | |
| 223 | + if ( jni->IsInstanceOf(o, wrapper_class[i-j]) == TRUE ) { | |
| 224 | + val := jni->GetObjField(o, "value", type_string[i-j:i-j+1]); | |
| 225 | + return (i, val); | |
| 226 | + } | |
| 227 | + } | |
| 228 | + return (0, nil); | |
| 229 | +} | |
| 230 | +# | |
| 231 | +# Convert a signature to a java type index. | |
| 232 | +# | |
| 233 | +SigToType(sig : string) : int | |
| 234 | +{ | |
| 235 | + index : int; | |
| 236 | + case sig[0] { | |
| 237 | + 'Z' => | |
| 238 | + index = T_BOOLEAN; | |
| 239 | + 'B' => | |
| 240 | + index = T_BYTE; | |
| 241 | + 'C' => | |
| 242 | + index = T_CHAR; | |
| 243 | + 'S' => | |
| 244 | + index = T_SHORT; | |
| 245 | + 'I' => | |
| 246 | + index = T_INT; | |
| 247 | + 'J' => | |
| 248 | + index = T_LONG; | |
| 249 | + 'F' => | |
| 250 | + index = T_FLOAT; | |
| 251 | + 'D' => | |
| 252 | + index = T_DOUBLE; | |
| 253 | + * => | |
| 254 | + index = 0; | |
| 255 | + } | |
| 256 | + return index; | |
| 257 | +} | |
| 258 | +# | |
| 259 | +# Convert a java type index to a signature. | |
| 260 | +# | |
| 261 | +TypeToSig(typ : int) : string | |
| 262 | +{ | |
| 263 | + if ( typ < T_BOOLEAN || typ > T_LONG ) | |
| 264 | + return nil; | |
| 265 | + return type_string[typ-T_BOOLEAN:typ-T_BOOLEAN+1]; | |
| 266 | +} | |
| 267 | +# | |
| 268 | +# Convert a Java type character to its corresponding type name. | |
| 269 | +# | |
| 270 | +TypeCharToName(c : int) : string | |
| 271 | +{ | |
| 272 | + tname : string; | |
| 273 | + case c { | |
| 274 | + 'Z' => | |
| 275 | + tname = "boolean"; | |
| 276 | + 'B' => | |
| 277 | + tname = "byte"; | |
| 278 | + 'C' => | |
| 279 | + tname = "char"; | |
| 280 | + 'S' => | |
| 281 | + tname = "short"; | |
| 282 | + 'I' => | |
| 283 | + tname = "int"; | |
| 284 | + 'J' => | |
| 285 | + tname = "long"; | |
| 286 | + 'F' => | |
| 287 | + tname = "float"; | |
| 288 | + 'D' => | |
| 289 | + tname = "double"; | |
| 290 | + * => | |
| 291 | + tname = "blah"; | |
| 292 | + } | |
| 293 | + return tname; | |
| 294 | +} | |
| 295 | +# | |
| 296 | +# Calculate the type index of the quantity in val. If it isn't a | |
| 297 | +# Java primitive type, return 0; | |
| 298 | +# | |
| 299 | +ValType(val : ref Value) : int | |
| 300 | +{ | |
| 301 | + pick sw := val { | |
| 302 | + TBoolean => return T_BOOLEAN; | |
| 303 | + TByte => return T_BYTE; | |
| 304 | + TChar => return T_CHAR; | |
| 305 | + TShort => return T_SHORT; | |
| 306 | + TInt => return T_INT; | |
| 307 | + TLong => return T_LONG; | |
| 308 | + TFloat => return T_FLOAT; | |
| 309 | + TDouble => return T_DOUBLE; | |
| 310 | + * => return 0; | |
| 311 | + } | |
| 312 | +} | |
| 313 | +# | |
| 314 | +# Create a wrapper Object for the primitive Java value corresponding | |
| 315 | +# to the argument. | |
| 316 | +# | |
| 317 | +ValueToObject(val : ref Value) : JObject | |
| 318 | +{ | |
| 319 | + typ := ValType(val); | |
| 320 | + j := T_BOOLEAN; | |
| 321 | + jobj := jni->AllocObject(wrapper_class[typ - j]); | |
| 322 | + sig := "(" + type_string[typ-j:typ-j+1] + ")V"; | |
| 323 | + (nil, ok) := jni->CallMethod(jobj, "<init>", sig, array[] of { val }); | |
| 324 | + if ( ok == OK ) | |
| 325 | + return jobj; | |
| 326 | + return nil; | |
| 327 | +} | |
| @@ -0,0 +1,19 @@ | ||
| 1 | +Reflect : module { | |
| 2 | + | |
| 3 | + PATH : con "/dis/java/java/lang/reflect/reflect.dis"; | |
| 4 | + | |
| 5 | + init : fn(jni_m : JNI); | |
| 6 | + widen : fn(havetype, wanttype : int, val : ref Value) : ref Value; | |
| 7 | + BuildArgList: fn(parms : JArrayJClass, arg : JArrayJObject) | |
| 8 | + : array of ref Value; | |
| 9 | + Class : fn(t : int) : JClass; | |
| 10 | + ClassObject : fn(t : int) : JObject; | |
| 11 | + GetPrimitiveClass : fn(typ : int) : ref Value; | |
| 12 | + GetVal : fn(o : JObject) : (int, ref Value); | |
| 13 | + SigToType : fn(sig : string) : int; | |
| 14 | + TypeToSig : fn(typ : int) : string; | |
| 15 | + TypeCharToName : fn(c : int) : string; | |
| 16 | + ValType : fn(val : ref Value) : int; | |
| 17 | + ValueToObject : fn(val : ref Value) : JObject; | |
| 18 | + | |
| 19 | +}; | |
| @@ -0,0 +1,1285 @@ | ||
| 1 | +implement UnicodeTable; | |
| 2 | + | |
| 3 | +include "unicode_table.m"; | |
| 4 | + | |
| 5 | +# | |
| 6 | +# the following is lifted from JavaSoft's java | |
| 7 | +# source for java.lang.Character. The Limbo | |
| 8 | +# compiler produces a more compact file then Java | |
| 9 | +# | |
| 10 | + | |
| 11 | +# The character properties are currently encoded into 32 bits in the following manner: | |
| 12 | +# 10 bits signed offset used for converting case | |
| 13 | +# 1 bit if 1, adding the signed offset converts the character to lowercase | |
| 14 | +# 1 bit if 1, subtracting the signed offset converts the character to uppercase | |
| 15 | +# 1 bit if 1, this character has a titlecase equivalent (possibly itself) | |
| 16 | +# 3 bits 0 may not be part of an identifier | |
| 17 | +# 1 ignorable control; may continue a Unicode identifier or Java identifier | |
| 18 | +# 2 may continue a Java identifier but not a Unicode identifier (unused) | |
| 19 | +# 3 may continue a Unicode identifier or Java identifier | |
| 20 | +# 4 is a Java whitespace character | |
| 21 | +# 5 may start or continue a Java identifier; | |
| 22 | +# may continue but not start a Unicode identifier (underscores) | |
| 23 | +# 6 may start or continue a Java identifier but not a Unicode identifier ($) | |
| 24 | +# 7 may start or continue a Unicode identifier or Java identifier | |
| 25 | +# Thus: | |
| 26 | +# 5, 6, 7 may start a Java identifier | |
| 27 | +# 1, 2, 3, 5, 6, 7 may continue a Java identifier | |
| 28 | +# 7 may start a Unicode identifier | |
| 29 | +# 1, 3, 5, 7 may continue a Unicode identifier | |
| 30 | +# 1 is ignorable within an identifier | |
| 31 | +# 4 is Java whitespace | |
| 32 | +# 2 bits 0 this character has no numeric property | |
| 33 | +# 1 adding the digit offset to the character code and then | |
| 34 | +# masking with 16r1F will produce the desired numeric value | |
| 35 | +# 2 this character has a "strange" numeric value | |
| 36 | +# 3 a Java supradecimal digit: adding the digit offset to the | |
| 37 | +# character code, then masking with 16r1F, then adding 10 | |
| 38 | +# will produce the desired numeric value | |
| 39 | +# 5 bits digit offset | |
| 40 | +# 4 bits reserved for future use | |
| 41 | +# 5 bits character type | |
| 42 | +# | |
| 43 | + | |
| 44 | +# The X table has 1024 entries for a total of 1024 bytes. | |
| 45 | + | |
| 46 | +X = array[] of { | |
| 47 | + 0, 1, 2, 3, 4, 5, 6, 7, # 16r0000 | |
| 48 | + 8, 9, 10, 11, 12, 13, 14, 15, # 16r0200 | |
| 49 | + 16, 17, 18, 19, 20, 21, 22, 23, # 16r0400 | |
| 50 | + 24, 25, 26, 27, 28, 28, 28, 28, # 16r0600 | |
| 51 | + 28, 28, 28, 28, 29, 30, 31, 32, # 16r0800 | |
| 52 | + 33, 34, 35, 36, 37, 38, 39, 40, # 16r0A00 | |
| 53 | + 41, 42, 43, 44, 45, 46, 28, 28, # 16r0C00 | |
| 54 | + 47, 48, 49, 50, 51, 52, 53, 28, # 16r0E00 | |
| 55 | + 28, 28, 54, 55, 56, 57, 58, 59, # 16r1000 | |
| 56 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r1200 | |
| 57 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r1400 | |
| 58 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r1600 | |
| 59 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r1800 | |
| 60 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r1A00 | |
| 61 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r1C00 | |
| 62 | + 60, 60, 61, 62, 63, 64, 65, 66, # 16r1E00 | |
| 63 | + 67, 68, 69, 70, 71, 72, 73, 74, # 16r2000 | |
| 64 | + 75, 75, 75, 76, 77, 78, 28, 28, # 16r2200 | |
| 65 | + 79, 80, 81, 82, 83, 83, 84, 85, # 16r2400 | |
| 66 | + 86, 85, 28, 28, 87, 88, 89, 28, # 16r2600 | |
| 67 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r2800 | |
| 68 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r2A00 | |
| 69 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r2C00 | |
| 70 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r2E00 | |
| 71 | + 90, 91, 92, 93, 94, 56, 95, 28, # 16r3000 | |
| 72 | + 96, 97, 98, 99, 83, 100, 83, 101, # 16r3200 | |
| 73 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r3400 | |
| 74 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r3600 | |
| 75 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r3800 | |
| 76 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r3A00 | |
| 77 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r3C00 | |
| 78 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r3E00 | |
| 79 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r4000 | |
| 80 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r4200 | |
| 81 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r4400 | |
| 82 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r4600 | |
| 83 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r4800 | |
| 84 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r4A00 | |
| 85 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16r4C00 | |
| 86 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r4E00 | |
| 87 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r5000 | |
| 88 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r5200 | |
| 89 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r5400 | |
| 90 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r5600 | |
| 91 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r5800 | |
| 92 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r5A00 | |
| 93 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r5C00 | |
| 94 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r5E00 | |
| 95 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r6000 | |
| 96 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r6200 | |
| 97 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r6400 | |
| 98 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r6600 | |
| 99 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r6800 | |
| 100 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r6A00 | |
| 101 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r6C00 | |
| 102 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r6E00 | |
| 103 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r7000 | |
| 104 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r7200 | |
| 105 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r7400 | |
| 106 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r7600 | |
| 107 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r7800 | |
| 108 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r7A00 | |
| 109 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r7C00 | |
| 110 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r7E00 | |
| 111 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r8000 | |
| 112 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r8200 | |
| 113 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r8400 | |
| 114 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r8600 | |
| 115 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r8800 | |
| 116 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r8A00 | |
| 117 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r8C00 | |
| 118 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r8E00 | |
| 119 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r9000 | |
| 120 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r9200 | |
| 121 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r9400 | |
| 122 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r9600 | |
| 123 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r9800 | |
| 124 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r9A00 | |
| 125 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16r9C00 | |
| 126 | + 56, 56, 56, 56, 56, 56, 102, 28, # 16r9E00 | |
| 127 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16rA000 | |
| 128 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16rA200 | |
| 129 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16rA400 | |
| 130 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16rA600 | |
| 131 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16rA800 | |
| 132 | + 28, 28, 28, 28, 28, 28, 28, 28, # 16rAA00 | |
| 133 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rAC00 | |
| 134 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rAE00 | |
| 135 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rB000 | |
| 136 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rB200 | |
| 137 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rB400 | |
| 138 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rB600 | |
| 139 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rB800 | |
| 140 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rBA00 | |
| 141 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rBC00 | |
| 142 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rBE00 | |
| 143 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rC000 | |
| 144 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rC200 | |
| 145 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rC400 | |
| 146 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rC600 | |
| 147 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rC800 | |
| 148 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rCA00 | |
| 149 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rCC00 | |
| 150 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rCE00 | |
| 151 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rD000 | |
| 152 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rD200 | |
| 153 | + 56, 56, 56, 56, 56, 56, 56, 56, # 16rD400 | |
| 154 | + 56, 56, 56, 56, 56, 56, 103, 28, # 16rD600 | |
| 155 | + 104, 104, 104, 104, 104, 104, 104, 104, # 16rD800 | |
| 156 | + 104, 104, 104, 104, 104, 104, 104, 104, # 16rDA00 | |
| 157 | + 104, 104, 104, 104, 104, 104, 104, 104, # 16rDC00 | |
| 158 | + 104, 104, 104, 104, 104, 104, 104, 104, # 16rDE00 | |
| 159 | + 105, 105, 105, 105, 105, 105, 105, 105, # 16rE000 | |
| 160 | + 105, 105, 105, 105, 105, 105, 105, 105, # 16rE200 | |
| 161 | + 105, 105, 105, 105, 105, 105, 105, 105, # 16rE400 | |
| 162 | + 105, 105, 105, 105, 105, 105, 105, 105, # 16rE600 | |
| 163 | + 105, 105, 105, 105, 105, 105, 105, 105, # 16rE800 | |
| 164 | + 105, 105, 105, 105, 105, 105, 105, 105, # 16rEA00 | |
| 165 | + 105, 105, 105, 105, 105, 105, 105, 105, # 16rEC00 | |
| 166 | + 105, 105, 105, 105, 105, 105, 105, 105, # 16rEE00 | |
| 167 | + 105, 105, 105, 105, 105, 105, 105, 105, # 16rF000 | |
| 168 | + 105, 105, 105, 105, 105, 105, 105, 105, # 16rF200 | |
| 169 | + 105, 105, 105, 105, 105, 105, 105, 105, # 16rF400 | |
| 170 | + 105, 105, 105, 105, 105, 105, 105, 105, # 16rF600 | |
| 171 | + 105, 105, 105, 105, 56, 56, 56, 56, # 16rF800 | |
| 172 | + 106, 28, 28, 28, 107, 108, 109, 110, # 16rFA00 | |
| 173 | + 56, 56, 56, 56, 111, 112, 113, 114, # 16rFC00 | |
| 174 | + 115, 116, 56, 117, 118, 119, 120, 121 # 16rFE00 | |
| 175 | + }; | |
| 176 | + | |
| 177 | +# The Y table has 7808 entries for a total of 7808 bytes. | |
| 178 | + | |
| 179 | +Y = array[] of { | |
| 180 | + 0, 0, 0, 0, 0, 0, 0, 0, # 0 | |
| 181 | + 0, 1, 1, 1, 1, 1, 0, 0, # 0 | |
| 182 | + 0, 0, 0, 0, 0, 0, 0, 0, # 0 | |
| 183 | + 0, 0, 0, 0, 1, 1, 1, 1, # 0 | |
| 184 | + 2, 3, 3, 3, 4, 3, 3, 3, # 0 | |
| 185 | + 5, 6, 3, 7, 3, 8, 3, 3, # 0 | |
| 186 | + 9, 9, 9, 9, 9, 9, 9, 9, # 0 | |
| 187 | + 9, 9, 3, 3, 7, 7, 7, 3, # 0 | |
| 188 | + 3, 10, 10, 10, 10, 10, 10, 10, # 1 | |
| 189 | + 10, 10, 10, 10, 10, 10, 10, 10, # 1 | |
| 190 | + 10, 10, 10, 10, 10, 10, 10, 10, # 1 | |
| 191 | + 10, 10, 10, 5, 3, 6, 11, 12, # 1 | |
| 192 | + 11, 13, 13, 13, 13, 13, 13, 13, # 1 | |
| 193 | + 13, 13, 13, 13, 13, 13, 13, 13, # 1 | |
| 194 | + 13, 13, 13, 13, 13, 13, 13, 13, # 1 | |
| 195 | + 13, 13, 13, 5, 7, 6, 7, 0, # 1 | |
| 196 | + 0, 0, 0, 0, 0, 0, 0, 0, # 2 | |
| 197 | + 0, 0, 0, 0, 0, 0, 0, 0, # 2 | |
| 198 | + 0, 0, 0, 0, 0, 0, 0, 0, # 2 | |
| 199 | + 0, 0, 0, 0, 0, 0, 0, 0, # 2 | |
| 200 | + 14, 3, 4, 4, 4, 4, 15, 15, # 2 | |
| 201 | + 11, 15, 16, 5, 7, 8, 15, 11, # 2 | |
| 202 | + 15, 7, 17, 17, 11, 16, 15, 3, # 2 | |
| 203 | + 11, 18, 16, 6, 19, 19, 19, 3, # 2 | |
| 204 | + 20, 20, 20, 20, 20, 20, 20, 20, # 3 | |
| 205 | + 20, 20, 20, 20, 20, 20, 20, 20, # 3 | |
| 206 | + 20, 20, 20, 20, 20, 20, 20, 7, # 3 | |
| 207 | + 20, 20, 20, 20, 20, 20, 20, 16, # 3 | |
| 208 | + 21, 21, 21, 21, 21, 21, 21, 21, # 3 | |
| 209 | + 21, 21, 21, 21, 21, 21, 21, 21, # 3 | |
| 210 | + 21, 21, 21, 21, 21, 21, 21, 7, # 3 | |
| 211 | + 21, 21, 21, 21, 21, 21, 21, 22, # 3 | |
| 212 | + 23, 24, 23, 24, 23, 24, 23, 24, # 4 | |
| 213 | + 23, 24, 23, 24, 23, 24, 23, 24, # 4 | |
| 214 | + 23, 24, 23, 24, 23, 24, 23, 24, # 4 | |
| 215 | + 23, 24, 23, 24, 23, 24, 23, 24, # 4 | |
| 216 | + 23, 24, 23, 24, 23, 24, 23, 24, # 4 | |
| 217 | + 23, 24, 23, 24, 23, 24, 23, 24, # 4 | |
| 218 | + 25, 26, 23, 24, 23, 24, 23, 24, # 4 | |
| 219 | + 16, 23, 24, 23, 24, 23, 24, 23, # 4 | |
| 220 | + 24, 23, 24, 23, 24, 23, 24, 23, # 5 | |
| 221 | + 24, 16, 23, 24, 23, 24, 23, 24, # 5 | |
| 222 | + 23, 24, 23, 24, 23, 24, 23, 24, # 5 | |
| 223 | + 23, 24, 23, 24, 23, 24, 23, 24, # 5 | |
| 224 | + 23, 24, 23, 24, 23, 24, 23, 24, # 5 | |
| 225 | + 23, 24, 23, 24, 23, 24, 23, 24, # 5 | |
| 226 | + 23, 24, 23, 24, 23, 24, 23, 24, # 5 | |
| 227 | + 27, 23, 24, 23, 24, 23, 24, 28, # 5 | |
| 228 | + 16, 29, 23, 24, 23, 24, 30, 23, # 6 | |
| 229 | + 24, 31, 31, 23, 24, 16, 32, 32, # 6 | |
| 230 | + 33, 23, 24, 31, 34, 16, 35, 36, # 6 | |
| 231 | + 23, 24, 16, 16, 35, 37, 16, 38, # 6 | |
| 232 | + 23, 24, 23, 24, 23, 24, 38, 23, # 6 | |
| 233 | + 24, 39, 40, 16, 23, 24, 39, 23, # 6 | |
| 234 | + 24, 41, 41, 23, 24, 23, 24, 42, # 6 | |
| 235 | + 23, 24, 16, 40, 23, 24, 40, 40, # 6 | |
| 236 | + 40, 40, 40, 40, 43, 44, 45, 43, # 7 | |
| 237 | + 44, 45, 43, 44, 45, 23, 24, 23, # 7 | |
| 238 | + 24, 23, 24, 23, 24, 23, 24, 23, # 7 | |
| 239 | + 24, 23, 24, 23, 24, 16, 23, 24, # 7 | |
| 240 | + 23, 24, 23, 24, 23, 24, 23, 24, # 7 | |
| 241 | + 23, 24, 23, 24, 23, 24, 23, 24, # 7 | |
| 242 | + 16, 43, 44, 45, 23, 24, 46, 46, # 7 | |
| 243 | + 46, 46, 23, 24, 23, 24, 23, 24, # 7 | |
| 244 | + 23, 24, 23, 24, 23, 24, 23, 24, # 8 | |
| 245 | + 23, 24, 23, 24, 23, 24, 23, 24, # 8 | |
| 246 | + 23, 24, 23, 24, 23, 24, 23, 24, # 8 | |
| 247 | + 46, 46, 46, 46, 46, 46, 46, 46, # 8 | |
| 248 | + 46, 46, 46, 46, 46, 46, 46, 46, # 8 | |
| 249 | + 46, 46, 46, 46, 46, 46, 46, 46, # 8 | |
| 250 | + 46, 46, 46, 46, 46, 46, 46, 46, # 8 | |
| 251 | + 46, 46, 46, 46, 46, 46, 46, 46, # 8 | |
| 252 | + 46, 46, 46, 46, 46, 46, 46, 46, # 9 | |
| 253 | + 46, 46, 46, 46, 46, 46, 46, 46, # 9 | |
| 254 | + 16, 16, 16, 47, 48, 16, 49, 49, # 9 | |
| 255 | + 50, 50, 16, 51, 16, 16, 16, 16, # 9 | |
| 256 | + 49, 16, 16, 52, 16, 16, 16, 16, # 9 | |
| 257 | + 53, 54, 16, 16, 16, 16, 16, 54, # 9 | |
| 258 | + 16, 16, 55, 16, 16, 16, 16, 16, # 9 | |
| 259 | + 16, 16, 16, 16, 16, 16, 16, 16, # 9 | |
| 260 | + 16, 16, 16, 56, 16, 16, 16, 16, # 10 | |
| 261 | + 56, 16, 57, 57, 16, 16, 16, 16, # 10 | |
| 262 | + 16, 16, 58, 16, 16, 16, 16, 16, # 10 | |
| 263 | + 16, 16, 16, 16, 16, 16, 16, 16, # 10 | |
| 264 | + 16, 16, 16, 16, 16, 16, 16, 16, # 10 | |
| 265 | + 16, 46, 46, 46, 46, 46, 46, 46, # 10 | |
| 266 | + 59, 59, 59, 59, 59, 59, 59, 59, # 10 | |
| 267 | + 59, 11, 11, 59, 59, 59, 59, 59, # 10 | |
| 268 | + 59, 59, 11, 11, 11, 11, 11, 11, # 11 | |
| 269 | + 11, 11, 11, 11, 11, 11, 11, 11, # 11 | |
| 270 | + 59, 59, 11, 11, 11, 11, 11, 11, # 11 | |
| 271 | + 11, 11, 11, 11, 11, 11, 11, 46, # 11 | |
| 272 | + 59, 59, 59, 59, 59, 11, 11, 11, # 11 | |
| 273 | + 11, 11, 46, 46, 46, 46, 46, 46, # 11 | |
| 274 | + 46, 46, 46, 46, 46, 46, 46, 46, # 11 | |
| 275 | + 46, 46, 46, 46, 46, 46, 46, 46, # 11 | |
| 276 | + 60, 60, 60, 60, 60, 60, 60, 60, # 12 | |
| 277 | + 60, 60, 60, 60, 60, 60, 60, 60, # 12 | |
| 278 | + 60, 60, 60, 60, 60, 60, 60, 60, # 12 | |
| 279 | + 60, 60, 60, 60, 60, 60, 60, 60, # 12 | |
| 280 | + 60, 60, 60, 60, 60, 60, 60, 60, # 12 | |
| 281 | + 60, 60, 60, 60, 60, 60, 60, 60, # 12 | |
| 282 | + 60, 60, 60, 60, 60, 60, 60, 60, # 12 | |
| 283 | + 60, 60, 60, 60, 60, 60, 60, 60, # 12 | |
| 284 | + 60, 60, 60, 60, 60, 60, 46, 46, # 13 | |
| 285 | + 46, 46, 46, 46, 46, 46, 46, 46, # 13 | |
| 286 | + 46, 46, 46, 46, 46, 46, 46, 46, # 13 | |
| 287 | + 46, 46, 46, 46, 46, 46, 46, 46, # 13 | |
| 288 | + 60, 60, 46, 46, 46, 46, 46, 46, # 13 | |
| 289 | + 46, 46, 46, 46, 46, 46, 46, 46, # 13 | |
| 290 | + 46, 46, 46, 46, 3, 3, 46, 46, # 13 | |
| 291 | + 46, 46, 59, 46, 46, 46, 3, 46, # 13 | |
| 292 | + 46, 46, 46, 46, 11, 11, 61, 3, # 14 | |
| 293 | + 62, 62, 62, 46, 63, 46, 64, 64, # 14 | |
| 294 | + 16, 20, 20, 20, 20, 20, 20, 20, # 14 | |
| 295 | + 20, 20, 20, 20, 20, 20, 20, 20, # 14 | |
| 296 | + 20, 20, 46, 20, 20, 20, 20, 20, # 14 | |
| 297 | + 20, 20, 20, 20, 65, 66, 66, 66, # 14 | |
| 298 | + 16, 21, 21, 21, 21, 21, 21, 21, # 14 | |
| 299 | + 21, 21, 21, 21, 21, 21, 21, 21, # 14 | |
| 300 | + 21, 21, 16, 21, 21, 21, 21, 21, # 15 | |
| 301 | + 21, 21, 21, 21, 67, 68, 68, 46, # 15 | |
| 302 | + 69, 70, 38, 38, 38, 71, 72, 46, # 15 | |
| 303 | + 46, 46, 38, 46, 38, 46, 38, 46, # 15 | |
| 304 | + 38, 46, 23, 24, 23, 24, 23, 24, # 15 | |
| 305 | + 23, 24, 23, 24, 23, 24, 23, 24, # 15 | |
| 306 | + 73, 74, 16, 40, 46, 46, 46, 46, # 15 | |
| 307 | + 46, 46, 46, 46, 46, 46, 46, 46, # 15 | |
| 308 | + 46, 75, 75, 75, 75, 75, 75, 75, # 16 | |
| 309 | + 75, 75, 75, 75, 75, 46, 75, 75, # 16 | |
| 310 | + 20, 20, 20, 20, 20, 20, 20, 20, # 16 | |
| 311 | + 20, 20, 20, 20, 20, 20, 20, 20, # 16 | |
| 312 | + 20, 20, 20, 20, 20, 20, 20, 20, # 16 | |
| 313 | + 20, 20, 20, 20, 20, 20, 20, 20, # 16 | |
| 314 | + 21, 21, 21, 21, 21, 21, 21, 21, # 16 | |
| 315 | + 21, 21, 21, 21, 21, 21, 21, 21, # 16 | |
| 316 | + 21, 21, 21, 21, 21, 21, 21, 21, # 17 | |
| 317 | + 21, 21, 21, 21, 21, 21, 21, 21, # 17 | |
| 318 | + 46, 74, 74, 74, 74, 74, 74, 74, # 17 | |
| 319 | + 74, 74, 74, 74, 74, 46, 74, 74, # 17 | |
| 320 | + 23, 24, 23, 24, 23, 24, 23, 24, # 17 | |
| 321 | + 23, 24, 23, 24, 23, 24, 23, 24, # 17 | |
| 322 | + 23, 24, 23, 24, 23, 24, 23, 24, # 17 | |
| 323 | + 23, 24, 23, 24, 23, 24, 23, 24, # 17 | |
| 324 | + 23, 24, 15, 60, 60, 60, 60, 46, # 18 | |
| 325 | + 46, 46, 46, 46, 46, 46, 46, 46, # 18 | |
| 326 | + 23, 24, 23, 24, 23, 24, 23, 24, # 18 | |
| 327 | + 23, 24, 23, 24, 23, 24, 23, 24, # 18 | |
| 328 | + 23, 24, 23, 24, 23, 24, 23, 24, # 18 | |
| 329 | + 23, 24, 23, 24, 23, 24, 23, 24, # 18 | |
| 330 | + 23, 24, 23, 24, 23, 24, 23, 24, # 18 | |
| 331 | + 23, 24, 23, 24, 23, 24, 23, 24, # 18 | |
| 332 | + 40, 23, 24, 23, 24, 46, 46, 23, # 19 | |
| 333 | + 24, 46, 46, 23, 24, 46, 46, 46, # 19 | |
| 334 | + 23, 24, 23, 24, 23, 24, 23, 24, # 19 | |
| 335 | + 23, 24, 23, 24, 23, 24, 23, 24, # 19 | |
| 336 | + 23, 24, 23, 24, 23, 24, 23, 24, # 19 | |
| 337 | + 23, 24, 23, 24, 46, 46, 23, 24, # 19 | |
| 338 | + 23, 24, 23, 24, 23, 24, 46, 46, # 19 | |
| 339 | + 23, 24, 46, 46, 46, 46, 46, 46, # 19 | |
| 340 | + 46, 46, 46, 46, 46, 46, 46, 46, # 20 | |
| 341 | + 46, 46, 46, 46, 46, 46, 46, 46, # 20 | |
| 342 | + 46, 46, 46, 46, 46, 46, 46, 46, # 20 | |
| 343 | + 46, 46, 46, 46, 46, 46, 46, 46, # 20 | |
| 344 | + 46, 46, 46, 46, 46, 46, 46, 46, # 20 | |
| 345 | + 46, 46, 46, 46, 46, 46, 46, 46, # 20 | |
| 346 | + 46, 76, 76, 76, 76, 76, 76, 76, # 20 | |
| 347 | + 76, 76, 76, 76, 76, 76, 76, 76, # 20 | |
| 348 | + 76, 76, 76, 76, 76, 76, 76, 76, # 21 | |
| 349 | + 76, 76, 76, 76, 76, 76, 76, 76, # 21 | |
| 350 | + 76, 76, 76, 76, 76, 76, 76, 46, # 21 | |
| 351 | + 46, 59, 3, 3, 3, 3, 3, 3, # 21 | |
| 352 | + 46, 77, 77, 77, 77, 77, 77, 77, # 21 | |
| 353 | + 77, 77, 77, 77, 77, 77, 77, 77, # 21 | |
| 354 | + 77, 77, 77, 77, 77, 77, 77, 77, # 21 | |
| 355 | + 77, 77, 77, 77, 77, 77, 77, 77, # 21 | |
| 356 | + 77, 77, 77, 77, 77, 77, 77, 16, # 22 | |
| 357 | + 46, 3, 46, 46, 46, 46, 46, 46, # 22 | |
| 358 | + 46, 60, 60, 60, 60, 60, 60, 60, # 22 | |
| 359 | + 60, 60, 60, 60, 60, 60, 60, 60, # 22 | |
| 360 | + 60, 60, 46, 60, 60, 60, 60, 60, # 22 | |
| 361 | + 60, 60, 60, 60, 60, 60, 60, 60, # 22 | |
| 362 | + 60, 60, 60, 60, 60, 60, 60, 60, # 22 | |
| 363 | + 60, 60, 46, 60, 60, 60, 3, 60, # 22 | |
| 364 | + 3, 60, 60, 3, 60, 46, 46, 46, # 23 | |
| 365 | + 46, 46, 46, 46, 46, 46, 46, 46, # 23 | |
| 366 | + 40, 40, 40, 40, 40, 40, 40, 40, # 23 | |
| 367 | + 40, 40, 40, 40, 40, 40, 40, 40, # 23 | |
| 368 | + 40, 40, 40, 40, 40, 40, 40, 40, # 23 | |
| 369 | + 40, 40, 40, 46, 46, 46, 46, 46, # 23 | |
| 370 | + 40, 40, 40, 3, 3, 46, 46, 46, # 23 | |
| 371 | + 46, 46, 46, 46, 46, 46, 46, 46, # 23 | |
| 372 | + 46, 46, 46, 46, 46, 46, 46, 46, # 24 | |
| 373 | + 46, 46, 46, 46, 3, 46, 46, 46, # 24 | |
| 374 | + 46, 46, 46, 46, 46, 46, 46, 46, # 24 | |
| 375 | + 46, 46, 46, 3, 46, 46, 46, 3, # 24 | |
| 376 | + 46, 40, 40, 40, 40, 40, 40, 40, # 24 | |
| 377 | + 40, 40, 40, 40, 40, 40, 40, 40, # 24 | |
| 378 | + 40, 40, 40, 40, 40, 40, 40, 40, # 24 | |
| 379 | + 40, 40, 40, 46, 46, 46, 46, 46, # 24 | |
| 380 | + 59, 40, 40, 40, 40, 40, 40, 40, # 25 | |
| 381 | + 40, 40, 40, 60, 60, 60, 60, 60, # 25 | |
| 382 | + 60, 60, 60, 46, 46, 46, 46, 46, # 25 | |
| 383 | + 46, 46, 46, 46, 46, 46, 46, 46, # 25 | |
| 384 | + 78, 78, 78, 78, 78, 78, 78, 78, # 25 | |
| 385 | + 78, 78, 3, 3, 3, 3, 46, 46, # 25 | |
| 386 | + 60, 40, 40, 40, 40, 40, 40, 40, # 25 | |
| 387 | + 40, 40, 40, 40, 40, 40, 40, 40, # 25 | |
| 388 | + 40, 40, 40, 40, 40, 40, 40, 40, # 26 | |
| 389 | + 40, 40, 40, 40, 40, 40, 40, 40, # 26 | |
| 390 | + 40, 40, 40, 40, 40, 40, 40, 40, # 26 | |
| 391 | + 40, 40, 40, 40, 40, 40, 40, 40, # 26 | |
| 392 | + 40, 40, 40, 40, 40, 40, 40, 40, # 26 | |
| 393 | + 40, 40, 40, 40, 40, 40, 40, 40, # 26 | |
| 394 | + 40, 40, 40, 40, 40, 40, 40, 40, # 26 | |
| 395 | + 46, 46, 40, 40, 40, 40, 40, 46, # 26 | |
| 396 | + 40, 40, 40, 40, 40, 40, 40, 40, # 27 | |
| 397 | + 40, 40, 40, 40, 40, 40, 40, 46, # 27 | |
| 398 | + 40, 40, 40, 40, 3, 40, 60, 60, # 27 | |
| 399 | + 60, 60, 60, 60, 60, 79, 79, 60, # 27 | |
| 400 | + 60, 60, 60, 60, 60, 59, 59, 60, # 27 | |
| 401 | + 60, 15, 60, 60, 60, 60, 46, 46, # 27 | |
| 402 | + 9, 9, 9, 9, 9, 9, 9, 9, # 27 | |
| 403 | + 9, 9, 46, 46, 46, 46, 46, 46, # 27 | |
| 404 | + 46, 46, 46, 46, 46, 46, 46, 46, # 28 | |
| 405 | + 46, 46, 46, 46, 46, 46, 46, 46, # 28 | |
| 406 | + 46, 46, 46, 46, 46, 46, 46, 46, # 28 | |
| 407 | + 46, 46, 46, 46, 46, 46, 46, 46, # 28 | |
| 408 | + 46, 46, 46, 46, 46, 46, 46, 46, # 28 | |
| 409 | + 46, 46, 46, 46, 46, 46, 46, 46, # 28 | |
| 410 | + 46, 46, 46, 46, 46, 46, 46, 46, # 28 | |
| 411 | + 46, 46, 46, 46, 46, 46, 46, 46, # 28 | |
| 412 | + 46, 60, 60, 80, 46, 40, 40, 40, # 29 | |
| 413 | + 40, 40, 40, 40, 40, 40, 40, 40, # 29 | |
| 414 | + 40, 40, 40, 40, 40, 40, 40, 40, # 29 | |
| 415 | + 40, 40, 40, 40, 40, 40, 40, 40, # 29 | |
| 416 | + 40, 40, 40, 40, 40, 40, 40, 40, # 29 | |
| 417 | + 40, 40, 40, 40, 40, 40, 40, 40, # 29 | |
| 418 | + 40, 40, 40, 40, 40, 40, 40, 40, # 29 | |
| 419 | + 40, 40, 46, 46, 60, 40, 80, 80, # 29 | |
| 420 | + 80, 60, 60, 60, 60, 60, 60, 60, # 30 | |
| 421 | + 60, 80, 80, 80, 80, 60, 46, 46, # 30 | |
| 422 | + 15, 60, 60, 60, 60, 46, 46, 46, # 30 | |
| 423 | + 40, 40, 40, 40, 40, 40, 40, 40, # 30 | |
| 424 | + 40, 40, 60, 60, 3, 3, 81, 81, # 30 | |
| 425 | + 81, 81, 81, 81, 81, 81, 81, 81, # 30 | |
| 426 | + 3, 46, 46, 46, 46, 46, 46, 46, # 30 | |
| 427 | + 46, 46, 46, 46, 46, 46, 46, 46, # 30 | |
| 428 | + 46, 60, 80, 80, 46, 40, 40, 40, # 31 | |
| 429 | + 40, 40, 40, 40, 40, 46, 46, 40, # 31 | |
| 430 | + 40, 46, 46, 40, 40, 40, 40, 40, # 31 | |
| 431 | + 40, 40, 40, 40, 40, 40, 40, 40, # 31 | |
| 432 | + 40, 40, 40, 40, 40, 40, 40, 40, # 31 | |
| 433 | + 40, 46, 40, 40, 40, 40, 40, 40, # 31 | |
| 434 | + 40, 46, 40, 46, 46, 46, 40, 40, # 31 | |
| 435 | + 40, 40, 46, 46, 60, 46, 80, 80, # 31 | |
| 436 | + 80, 60, 60, 60, 60, 46, 46, 80, # 32 | |
| 437 | + 80, 46, 46, 80, 80, 60, 46, 46, # 32 | |
| 438 | + 46, 46, 46, 46, 46, 46, 46, 80, # 32 | |
| 439 | + 46, 46, 46, 46, 40, 40, 46, 40, # 32 | |
| 440 | + 40, 40, 60, 60, 46, 46, 81, 81, # 32 | |
| 441 | + 81, 81, 81, 81, 81, 81, 81, 81, # 32 | |
| 442 | + 40, 40, 4, 4, 82, 82, 82, 82, # 32 | |
| 443 | + 19, 83, 15, 46, 46, 46, 46, 46, # 32 | |
| 444 | + 46, 46, 60, 46, 46, 40, 40, 40, # 33 | |
| 445 | + 40, 40, 40, 46, 46, 46, 46, 40, # 33 | |
| 446 | + 40, 46, 46, 40, 40, 40, 40, 40, # 33 | |
| 447 | + 40, 40, 40, 40, 40, 40, 40, 40, # 33 | |
| 448 | + 40, 40, 40, 40, 40, 40, 40, 40, # 33 | |
| 449 | + 40, 46, 40, 40, 40, 40, 40, 40, # 33 | |
| 450 | + 40, 46, 40, 40, 46, 40, 40, 46, # 33 | |
| 451 | + 40, 40, 46, 46, 60, 46, 80, 80, # 33 | |
| 452 | + 80, 60, 60, 46, 46, 46, 46, 60, # 34 | |
| 453 | + 60, 46, 46, 60, 60, 60, 46, 46, # 34 | |
| 454 | + 46, 46, 46, 46, 46, 46, 46, 46, # 34 | |
| 455 | + 46, 40, 40, 40, 40, 46, 40, 46, # 34 | |
| 456 | + 46, 46, 46, 46, 46, 46, 81, 81, # 34 | |
| 457 | + 81, 81, 81, 81, 81, 81, 81, 81, # 34 | |
| 458 | + 60, 60, 40, 40, 40, 46, 46, 46, # 34 | |
| 459 | + 46, 46, 46, 46, 46, 46, 46, 46, # 34 | |
| 460 | + 46, 60, 60, 80, 46, 40, 40, 40, # 35 | |
| 461 | + 40, 40, 40, 40, 46, 40, 46, 40, # 35 | |
| 462 | + 40, 40, 46, 40, 40, 40, 40, 40, # 35 | |
| 463 | + 40, 40, 40, 40, 40, 40, 40, 40, # 35 | |
| 464 | + 40, 40, 40, 40, 40, 40, 40, 40, # 35 | |
| 465 | + 40, 46, 40, 40, 40, 40, 40, 40, # 35 | |
| 466 | + 40, 46, 40, 40, 46, 40, 40, 40, # 35 | |
| 467 | + 40, 40, 46, 46, 60, 40, 80, 80, # 35 | |
| 468 | + 80, 60, 60, 60, 60, 60, 46, 60, # 36 | |
| 469 | + 60, 80, 46, 80, 80, 60, 46, 46, # 36 | |
| 470 | + 15, 46, 46, 46, 46, 46, 46, 46, # 36 | |
| 471 | + 46, 46, 46, 46, 46, 46, 46, 46, # 36 | |
| 472 | + 40, 46, 46, 46, 46, 46, 81, 81, # 36 | |
| 473 | + 81, 81, 81, 81, 81, 81, 81, 81, # 36 | |
| 474 | + 46, 46, 46, 46, 46, 46, 46, 46, # 36 | |
| 475 | + 46, 46, 46, 46, 46, 46, 46, 46, # 36 | |
| 476 | + 46, 60, 80, 80, 46, 40, 40, 40, # 37 | |
| 477 | + 40, 40, 40, 40, 40, 46, 46, 40, # 37 | |
| 478 | + 40, 46, 46, 40, 40, 40, 40, 40, # 37 | |
| 479 | + 40, 40, 40, 40, 40, 40, 40, 40, # 37 | |
| 480 | + 40, 40, 40, 40, 40, 40, 40, 40, # 37 | |
| 481 | + 40, 46, 40, 40, 40, 40, 40, 40, # 37 | |
| 482 | + 40, 46, 40, 40, 46, 46, 40, 40, # 37 | |
| 483 | + 40, 40, 46, 46, 60, 40, 80, 60, # 37 | |
| 484 | + 80, 60, 60, 60, 46, 46, 46, 80, # 38 | |
| 485 | + 80, 46, 46, 80, 80, 60, 46, 46, # 38 | |
| 486 | + 46, 46, 46, 46, 46, 46, 60, 80, # 38 | |
| 487 | + 46, 46, 46, 46, 40, 40, 46, 40, # 38 | |
| 488 | + 40, 40, 46, 46, 46, 46, 81, 81, # 38 | |
| 489 | + 81, 81, 81, 81, 81, 81, 81, 81, # 38 | |
| 490 | + 15, 46, 46, 46, 46, 46, 46, 46, # 38 | |
| 491 | + 46, 46, 46, 46, 46, 46, 46, 46, # 38 | |
| 492 | + 46, 46, 60, 80, 46, 40, 40, 40, # 39 | |
| 493 | + 40, 40, 40, 46, 46, 46, 40, 40, # 39 | |
| 494 | + 40, 46, 40, 40, 40, 40, 46, 46, # 39 | |
| 495 | + 46, 40, 40, 46, 40, 46, 40, 40, # 39 | |
| 496 | + 46, 46, 46, 40, 40, 46, 46, 46, # 39 | |
| 497 | + 40, 40, 40, 46, 46, 46, 40, 40, # 39 | |
| 498 | + 40, 40, 40, 40, 40, 40, 46, 40, # 39 | |
| 499 | + 40, 40, 46, 46, 46, 46, 80, 80, # 39 | |
| 500 | + 60, 80, 80, 46, 46, 46, 80, 80, # 40 | |
| 501 | + 80, 46, 80, 80, 80, 60, 46, 46, # 40 | |
| 502 | + 46, 46, 46, 46, 46, 46, 46, 80, # 40 | |
| 503 | + 46, 46, 46, 46, 46, 46, 46, 46, # 40 | |
| 504 | + 46, 46, 46, 46, 46, 46, 46, 81, # 40 | |
| 505 | + 81, 81, 81, 81, 81, 81, 81, 81, # 40 | |
| 506 | + 84, 19, 19, 46, 46, 46, 46, 46, # 40 | |
| 507 | + 46, 46, 46, 46, 46, 46, 46, 46, # 40 | |
| 508 | + 46, 80, 80, 80, 46, 40, 40, 40, # 41 | |
| 509 | + 40, 40, 40, 40, 40, 46, 40, 40, # 41 | |
| 510 | + 40, 46, 40, 40, 40, 40, 40, 40, # 41 | |
| 511 | + 40, 40, 40, 40, 40, 40, 40, 40, # 41 | |
| 512 | + 40, 40, 40, 40, 40, 40, 40, 40, # 41 | |
| 513 | + 40, 46, 40, 40, 40, 40, 40, 40, # 41 | |
| 514 | + 40, 40, 40, 40, 46, 40, 40, 40, # 41 | |
| 515 | + 40, 40, 46, 46, 46, 46, 60, 60, # 41 | |
| 516 | + 60, 80, 80, 80, 80, 46, 60, 60, # 42 | |
| 517 | + 60, 46, 60, 60, 60, 60, 46, 46, # 42 | |
| 518 | + 46, 46, 46, 46, 46, 60, 60, 46, # 42 | |
| 519 | + 46, 46, 46, 46, 46, 46, 46, 46, # 42 | |
| 520 | + 40, 40, 46, 46, 46, 46, 81, 81, # 42 | |
| 521 | + 81, 81, 81, 81, 81, 81, 81, 81, # 42 | |
| 522 | + 46, 46, 46, 46, 46, 46, 46, 46, # 42 | |
| 523 | + 46, 46, 46, 46, 46, 46, 46, 46, # 42 | |
| 524 | + 46, 46, 80, 80, 46, 40, 40, 40, # 43 | |
| 525 | + 40, 40, 40, 40, 40, 46, 40, 40, # 43 | |
| 526 | + 40, 46, 40, 40, 40, 40, 40, 40, # 43 | |
| 527 | + 40, 40, 40, 40, 40, 40, 40, 40, # 43 | |
| 528 | + 40, 40, 40, 40, 40, 40, 40, 40, # 43 | |
| 529 | + 40, 46, 40, 40, 40, 40, 40, 40, # 43 | |
| 530 | + 40, 40, 40, 40, 46, 40, 40, 40, # 43 | |
| 531 | + 40, 40, 46, 46, 46, 46, 80, 60, # 43 | |
| 532 | + 80, 80, 80, 80, 80, 46, 60, 80, # 44 | |
| 533 | + 80, 46, 80, 80, 60, 60, 46, 46, # 44 | |
| 534 | + 46, 46, 46, 46, 46, 80, 80, 46, # 44 | |
| 535 | + 46, 46, 46, 46, 46, 46, 40, 46, # 44 | |
| 536 | + 40, 40, 46, 46, 46, 46, 81, 81, # 44 | |
| 537 | + 81, 81, 81, 81, 81, 81, 81, 81, # 44 | |
| 538 | + 46, 46, 46, 46, 46, 46, 46, 46, # 44 | |
| 539 | + 46, 46, 46, 46, 46, 46, 46, 46, # 44 | |
| 540 | + 46, 46, 80, 80, 46, 40, 40, 40, # 45 | |
| 541 | + 40, 40, 40, 40, 40, 46, 40, 40, # 45 | |
| 542 | + 40, 46, 40, 40, 40, 40, 40, 40, # 45 | |
| 543 | + 40, 40, 40, 40, 40, 40, 40, 40, # 45 | |
| 544 | + 40, 40, 40, 40, 40, 40, 40, 40, # 45 | |
| 545 | + 40, 46, 40, 40, 40, 40, 40, 40, # 45 | |
| 546 | + 40, 40, 40, 40, 40, 40, 40, 40, # 45 | |
| 547 | + 40, 40, 46, 46, 46, 46, 80, 80, # 45 | |
| 548 | + 80, 60, 60, 60, 46, 46, 80, 80, # 46 | |
| 549 | + 80, 46, 80, 80, 80, 60, 46, 46, # 46 | |
| 550 | + 46, 46, 46, 46, 46, 46, 46, 80, # 46 | |
| 551 | + 46, 46, 46, 46, 46, 46, 46, 46, # 46 | |
| 552 | + 40, 40, 46, 46, 46, 46, 81, 81, # 46 | |
| 553 | + 81, 81, 81, 81, 81, 81, 81, 81, # 46 | |
| 554 | + 46, 46, 46, 46, 46, 46, 46, 46, # 46 | |
| 555 | + 46, 46, 46, 46, 46, 46, 46, 46, # 46 | |
| 556 | + 46, 40, 40, 40, 40, 40, 40, 40, # 47 | |
| 557 | + 40, 40, 40, 40, 40, 40, 40, 40, # 47 | |
| 558 | + 40, 40, 40, 40, 40, 40, 40, 40, # 47 | |
| 559 | + 40, 40, 40, 40, 40, 40, 40, 40, # 47 | |
| 560 | + 40, 40, 40, 40, 40, 40, 40, 40, # 47 | |
| 561 | + 40, 40, 40, 40, 40, 40, 40, 3, # 47 | |
| 562 | + 40, 60, 40, 40, 60, 60, 60, 60, # 47 | |
| 563 | + 60, 60, 60, 46, 46, 46, 46, 4, # 47 | |
| 564 | + 40, 40, 40, 40, 40, 40, 59, 60, # 48 | |
| 565 | + 60, 60, 60, 60, 60, 60, 60, 15, # 48 | |
| 566 | + 9, 9, 9, 9, 9, 9, 9, 9, # 48 | |
| 567 | + 9, 9, 3, 3, 46, 46, 46, 46, # 48 | |
| 568 | + 46, 46, 46, 46, 46, 46, 46, 46, # 48 | |
| 569 | + 46, 46, 46, 46, 46, 46, 46, 46, # 48 | |
| 570 | + 46, 46, 46, 46, 46, 46, 46, 46, # 48 | |
| 571 | + 46, 46, 46, 46, 46, 46, 46, 46, # 48 | |
| 572 | + 46, 40, 40, 46, 40, 46, 46, 40, # 49 | |
| 573 | + 40, 46, 40, 46, 46, 40, 46, 46, # 49 | |
| 574 | + 46, 46, 46, 46, 40, 40, 40, 40, # 49 | |
| 575 | + 46, 40, 40, 40, 40, 40, 40, 40, # 49 | |
| 576 | + 46, 40, 40, 40, 46, 40, 46, 40, # 49 | |
| 577 | + 46, 46, 40, 40, 46, 40, 40, 3, # 49 | |
| 578 | + 40, 60, 40, 40, 60, 60, 60, 60, # 49 | |
| 579 | + 60, 60, 46, 60, 60, 40, 46, 46, # 49 | |
| 580 | + 40, 40, 40, 40, 40, 46, 59, 46, # 50 | |
| 581 | + 60, 60, 60, 60, 60, 60, 46, 46, # 50 | |
| 582 | + 9, 9, 9, 9, 9, 9, 9, 9, # 50 | |
| 583 | + 9, 9, 46, 46, 40, 40, 46, 46, # 50 | |
| 584 | + 46, 46, 46, 46, 46, 46, 46, 46, # 50 | |
| 585 | + 46, 46, 46, 46, 46, 46, 46, 46, # 50 | |
| 586 | + 46, 46, 46, 46, 46, 46, 46, 46, # 50 | |
| 587 | + 46, 46, 46, 46, 46, 46, 46, 46, # 50 | |
| 588 | + 15, 15, 15, 15, 3, 3, 3, 3, # 51 | |
| 589 | + 3, 3, 3, 3, 3, 3, 3, 3, # 51 | |
| 590 | + 3, 3, 3, 15, 15, 15, 15, 15, # 51 | |
| 591 | + 60, 60, 15, 15, 15, 15, 15, 15, # 51 | |
| 592 | + 78, 78, 78, 78, 78, 78, 78, 78, # 51 | |
| 593 | + 78, 78, 85, 85, 85, 85, 85, 85, # 51 | |
| 594 | + 85, 85, 85, 85, 15, 60, 15, 60, # 51 | |
| 595 | + 15, 60, 5, 6, 5, 6, 80, 80, # 51 | |
| 596 | + 40, 40, 40, 40, 40, 40, 40, 40, # 52 | |
| 597 | + 46, 40, 40, 40, 40, 40, 40, 40, # 52 | |
| 598 | + 40, 40, 40, 40, 40, 40, 40, 40, # 52 | |
| 599 | + 40, 40, 40, 40, 40, 40, 40, 40, # 52 | |
| 600 | + 40, 40, 40, 40, 40, 40, 40, 40, # 52 | |
| 601 | + 40, 40, 46, 46, 46, 46, 46, 46, # 52 | |
| 602 | + 46, 60, 60, 60, 60, 60, 60, 60, # 52 | |
| 603 | + 60, 60, 60, 60, 60, 60, 60, 80, # 52 | |
| 604 | + 60, 60, 60, 60, 60, 3, 60, 60, # 53 | |
| 605 | + 60, 60, 60, 60, 46, 46, 46, 46, # 53 | |
| 606 | + 60, 60, 60, 60, 60, 60, 46, 60, # 53 | |
| 607 | + 46, 60, 60, 60, 60, 60, 60, 60, # 53 | |
| 608 | + 60, 60, 60, 60, 60, 60, 60, 60, # 53 | |
| 609 | + 60, 60, 60, 60, 60, 60, 46, 46, # 53 | |
| 610 | + 46, 60, 60, 60, 60, 60, 60, 60, # 53 | |
| 611 | + 46, 60, 46, 46, 46, 46, 46, 46, # 53 | |
| 612 | + 46, 46, 46, 46, 46, 46, 46, 46, # 54 | |
| 613 | + 46, 46, 46, 46, 46, 46, 46, 46, # 54 | |
| 614 | + 46, 46, 46, 46, 46, 46, 46, 46, # 54 | |
| 615 | + 46, 46, 46, 46, 46, 46, 46, 46, # 54 | |
| 616 | + 76, 76, 76, 76, 76, 76, 76, 76, # 54 | |
| 617 | + 76, 76, 76, 76, 76, 76, 76, 76, # 54 | |
| 618 | + 76, 76, 76, 76, 76, 76, 76, 76, # 54 | |
| 619 | + 76, 76, 76, 76, 76, 76, 76, 76, # 54 | |
| 620 | + 76, 76, 76, 76, 76, 76, 46, 46, # 55 | |
| 621 | + 46, 46, 46, 46, 46, 46, 46, 46, # 55 | |
| 622 | + 16, 16, 16, 16, 16, 16, 16, 16, # 55 | |
| 623 | + 16, 16, 16, 16, 16, 16, 16, 16, # 55 | |
| 624 | + 16, 16, 16, 16, 16, 16, 16, 16, # 55 | |
| 625 | + 16, 16, 16, 16, 16, 16, 16, 16, # 55 | |
| 626 | + 16, 16, 16, 16, 16, 16, 16, 46, # 55 | |
| 627 | + 46, 46, 46, 3, 46, 46, 46, 46, # 55 | |
| 628 | + 40, 40, 40, 40, 40, 40, 40, 40, # 56 | |
| 629 | + 40, 40, 40, 40, 40, 40, 40, 40, # 56 | |
| 630 | + 40, 40, 40, 40, 40, 40, 40, 40, # 56 | |
| 631 | + 40, 40, 40, 40, 40, 40, 40, 40, # 56 | |
| 632 | + 40, 40, 40, 40, 40, 40, 40, 40, # 56 | |
| 633 | + 40, 40, 40, 40, 40, 40, 40, 40, # 56 | |
| 634 | + 40, 40, 40, 40, 40, 40, 40, 40, # 56 | |
| 635 | + 40, 40, 40, 40, 40, 40, 40, 40, # 56 | |
| 636 | + 40, 40, 40, 40, 40, 40, 40, 40, # 57 | |
| 637 | + 40, 40, 40, 40, 40, 40, 40, 40, # 57 | |
| 638 | + 40, 40, 40, 40, 40, 40, 40, 40, # 57 | |
| 639 | + 40, 40, 46, 46, 46, 46, 46, 40, # 57 | |
| 640 | + 40, 40, 40, 40, 40, 40, 40, 40, # 57 | |
| 641 | + 40, 40, 40, 40, 40, 40, 40, 40, # 57 | |
| 642 | + 40, 40, 40, 40, 40, 40, 40, 40, # 57 | |
| 643 | + 40, 40, 40, 40, 40, 40, 40, 40, # 57 | |
| 644 | + 40, 40, 40, 40, 40, 40, 40, 40, # 58 | |
| 645 | + 40, 40, 40, 40, 40, 40, 40, 40, # 58 | |
| 646 | + 40, 40, 40, 40, 40, 40, 40, 40, # 58 | |
| 647 | + 40, 40, 40, 40, 40, 40, 40, 40, # 58 | |
| 648 | + 40, 40, 40, 46, 46, 46, 46, 46, # 58 | |
| 649 | + 40, 40, 40, 40, 40, 40, 40, 40, # 58 | |
| 650 | + 40, 40, 40, 40, 40, 40, 40, 40, # 58 | |
| 651 | + 40, 40, 40, 40, 40, 40, 40, 40, # 58 | |
| 652 | + 40, 40, 40, 40, 40, 40, 40, 40, # 59 | |
| 653 | + 40, 40, 40, 40, 40, 40, 40, 40, # 59 | |
| 654 | + 40, 40, 40, 40, 40, 40, 40, 40, # 59 | |
| 655 | + 40, 40, 40, 40, 40, 40, 40, 40, # 59 | |
| 656 | + 40, 40, 40, 40, 40, 40, 40, 40, # 59 | |
| 657 | + 40, 40, 40, 40, 40, 40, 40, 40, # 59 | |
| 658 | + 40, 40, 40, 40, 40, 40, 40, 40, # 59 | |
| 659 | + 40, 40, 46, 46, 46, 46, 46, 46, # 59 | |
| 660 | + 23, 24, 23, 24, 23, 24, 23, 24, # 60 | |
| 661 | + 23, 24, 23, 24, 23, 24, 23, 24, # 60 | |
| 662 | + 23, 24, 23, 24, 23, 24, 23, 24, # 60 | |
| 663 | + 23, 24, 23, 24, 23, 24, 23, 24, # 60 | |
| 664 | + 23, 24, 23, 24, 23, 24, 23, 24, # 60 | |
| 665 | + 23, 24, 23, 24, 23, 24, 23, 24, # 60 | |
| 666 | + 23, 24, 23, 24, 23, 24, 23, 24, # 60 | |
| 667 | + 23, 24, 23, 24, 23, 24, 23, 24, # 60 | |
| 668 | + 23, 24, 23, 24, 23, 24, 23, 24, # 61 | |
| 669 | + 23, 24, 23, 24, 23, 24, 23, 24, # 61 | |
| 670 | + 23, 24, 23, 24, 23, 24, 16, 16, # 61 | |
| 671 | + 16, 16, 16, 16, 46, 46, 46, 46, # 61 | |
| 672 | + 23, 24, 23, 24, 23, 24, 23, 24, # 61 | |
| 673 | + 23, 24, 23, 24, 23, 24, 23, 24, # 61 | |
| 674 | + 23, 24, 23, 24, 23, 24, 23, 24, # 61 | |
| 675 | + 23, 24, 23, 24, 23, 24, 23, 24, # 61 | |
| 676 | + 23, 24, 23, 24, 23, 24, 23, 24, # 62 | |
| 677 | + 23, 24, 23, 24, 23, 24, 23, 24, # 62 | |
| 678 | + 23, 24, 23, 24, 23, 24, 23, 24, # 62 | |
| 679 | + 23, 24, 23, 24, 23, 24, 23, 24, # 62 | |
| 680 | + 23, 24, 23, 24, 23, 24, 23, 24, # 62 | |
| 681 | + 23, 24, 23, 24, 23, 24, 23, 24, # 62 | |
| 682 | + 23, 24, 23, 24, 23, 24, 23, 24, # 62 | |
| 683 | + 23, 24, 46, 46, 46, 46, 46, 46, # 62 | |
| 684 | + 86, 86, 86, 86, 86, 86, 86, 86, # 63 | |
| 685 | + 87, 87, 87, 87, 87, 87, 87, 87, # 63 | |
| 686 | + 86, 86, 86, 86, 86, 86, 46, 46, # 63 | |
| 687 | + 87, 87, 87, 87, 87, 87, 46, 46, # 63 | |
| 688 | + 86, 86, 86, 86, 86, 86, 86, 86, # 63 | |
| 689 | + 87, 87, 87, 87, 87, 87, 87, 87, # 63 | |
| 690 | + 86, 86, 86, 86, 86, 86, 86, 86, # 63 | |
| 691 | + 87, 87, 87, 87, 87, 87, 87, 87, # 63 | |
| 692 | + 86, 86, 86, 86, 86, 86, 46, 46, # 64 | |
| 693 | + 87, 87, 87, 87, 87, 87, 46, 46, # 64 | |
| 694 | + 16, 86, 16, 86, 16, 86, 16, 86, # 64 | |
| 695 | + 46, 87, 46, 87, 46, 87, 46, 87, # 64 | |
| 696 | + 86, 86, 86, 86, 86, 86, 86, 86, # 64 | |
| 697 | + 87, 87, 87, 87, 87, 87, 87, 87, # 64 | |
| 698 | + 88, 88, 89, 89, 89, 89, 90, 90, # 64 | |
| 699 | + 91, 91, 92, 92, 93, 93, 46, 46, # 64 | |
| 700 | + 86, 86, 86, 86, 86, 86, 86, 86, # 65 | |
| 701 | + 87, 87, 87, 87, 87, 87, 87, 87, # 65 | |
| 702 | + 86, 86, 86, 86, 86, 86, 86, 86, # 65 | |
| 703 | + 87, 87, 87, 87, 87, 87, 87, 87, # 65 | |
| 704 | + 86, 86, 86, 86, 86, 86, 86, 86, # 65 | |
| 705 | + 87, 87, 87, 87, 87, 87, 87, 87, # 65 | |
| 706 | + 86, 86, 16, 94, 16, 46, 16, 16, # 65 | |
| 707 | + 87, 87, 95, 95, 96, 11, 38, 11, # 65 | |
| 708 | + 11, 11, 16, 94, 16, 46, 16, 16, # 66 | |
| 709 | + 97, 97, 97, 97, 96, 11, 11, 11, # 66 | |
| 710 | + 86, 86, 16, 16, 46, 46, 16, 16, # 66 | |
| 711 | + 87, 87, 98, 98, 46, 11, 11, 11, # 66 | |
| 712 | + 86, 86, 16, 16, 16, 99, 16, 16, # 66 | |
| 713 | + 87, 87, 100, 100, 101, 11, 11, 11, # 66 | |
| 714 | + 46, 46, 16, 94, 16, 46, 16, 16, # 66 | |
| 715 | + 102, 102, 103, 103, 96, 11, 11, 46, # 66 | |
| 716 | + 2, 2, 2, 2, 2, 2, 2, 2, # 67 | |
| 717 | + 2, 2, 2, 2, 104, 104, 104, 104, # 67 | |
| 718 | + 8, 8, 8, 8, 8, 8, 3, 3, # 67 | |
| 719 | + 5, 6, 5, 5, 5, 6, 5, 5, # 67 | |
| 720 | + 3, 3, 3, 3, 3, 3, 3, 3, # 67 | |
| 721 | + 105, 106, 104, 104, 104, 104, 104, 46, # 67 | |
| 722 | + 3, 3, 3, 3, 3, 3, 3, 3, # 67 | |
| 723 | + 3, 5, 6, 3, 3, 3, 3, 12, # 67 | |
| 724 | + 12, 3, 3, 3, 7, 5, 6, 46, # 68 | |
| 725 | + 46, 46, 46, 46, 46, 46, 46, 46, # 68 | |
| 726 | + 46, 46, 46, 46, 46, 46, 46, 46, # 68 | |
| 727 | + 46, 46, 46, 46, 46, 46, 46, 46, # 68 | |
| 728 | + 46, 46, 46, 46, 46, 46, 46, 46, # 68 | |
| 729 | + 46, 46, 104, 104, 104, 104, 104, 104, # 68 | |
| 730 | + 17, 46, 46, 46, 17, 17, 17, 17, # 68 | |
| 731 | + 17, 17, 7, 7, 7, 5, 6, 16, # 68 | |
| 732 | + 107, 107, 107, 107, 107, 107, 107, 107, # 69 | |
| 733 | + 107, 107, 7, 7, 7, 5, 6, 46, # 69 | |
| 734 | + 46, 46, 46, 46, 46, 46, 46, 46, # 69 | |
| 735 | + 46, 46, 46, 46, 46, 46, 46, 46, # 69 | |
| 736 | + 4, 4, 4, 4, 4, 4, 4, 4, # 69 | |
| 737 | + 4, 4, 4, 4, 46, 46, 46, 46, # 69 | |
| 738 | + 46, 46, 46, 46, 46, 46, 46, 46, # 69 | |
| 739 | + 46, 46, 46, 46, 46, 46, 46, 46, # 69 | |
| 740 | + 46, 46, 46, 46, 46, 46, 46, 46, # 70 | |
| 741 | + 46, 46, 46, 46, 46, 46, 46, 46, # 70 | |
| 742 | + 60, 60, 60, 60, 60, 60, 60, 60, # 70 | |
| 743 | + 60, 60, 60, 60, 60, 79, 79, 79, # 70 | |
| 744 | + 79, 60, 46, 46, 46, 46, 46, 46, # 70 | |
| 745 | + 46, 46, 46, 46, 46, 46, 46, 46, # 70 | |
| 746 | + 46, 46, 46, 46, 46, 46, 46, 46, # 70 | |
| 747 | + 46, 46, 46, 46, 46, 46, 46, 46, # 70 | |
| 748 | + 15, 15, 38, 15, 15, 15, 15, 38, # 71 | |
| 749 | + 15, 15, 16, 38, 38, 38, 16, 16, # 71 | |
| 750 | + 38, 38, 38, 16, 15, 38, 15, 15, # 71 | |
| 751 | + 38, 38, 38, 38, 38, 38, 15, 15, # 71 | |
| 752 | + 15, 15, 15, 15, 38, 15, 38, 15, # 71 | |
| 753 | + 38, 15, 38, 38, 38, 38, 16, 16, # 71 | |
| 754 | + 38, 38, 15, 38, 16, 40, 40, 40, # 71 | |
| 755 | + 40, 46, 46, 46, 46, 46, 46, 46, # 71 | |
| 756 | + 46, 46, 46, 46, 46, 46, 46, 46, # 72 | |
| 757 | + 46, 46, 46, 46, 46, 46, 46, 46, # 72 | |
| 758 | + 46, 46, 46, 19, 19, 19, 19, 19, # 72 | |
| 759 | + 19, 19, 19, 19, 19, 19, 19, 108, # 72 | |
| 760 | + 109, 109, 109, 109, 109, 109, 109, 109, # 72 | |
| 761 | + 109, 109, 109, 109, 110, 110, 110, 110, # 72 | |
| 762 | + 111, 111, 111, 111, 111, 111, 111, 111, # 72 | |
| 763 | + 111, 111, 111, 111, 112, 112, 112, 112, # 72 | |
| 764 | + 113, 113, 113, 46, 46, 46, 46, 46, # 73 | |
| 765 | + 46, 46, 46, 46, 46, 46, 46, 46, # 73 | |
| 766 | + 7, 7, 7, 7, 7, 15, 15, 15, # 73 | |
| 767 | + 15, 15, 15, 15, 15, 15, 15, 15, # 73 | |
| 768 | + 15, 15, 15, 15, 15, 15, 15, 15, # 73 | |
| 769 | + 15, 15, 15, 15, 15, 15, 15, 15, # 73 | |
| 770 | + 15, 15, 15, 15, 15, 15, 15, 15, # 73 | |
| 771 | + 15, 15, 15, 15, 15, 15, 15, 15, # 73 | |
| 772 | + 15, 15, 15, 15, 15, 15, 15, 15, # 74 | |
| 773 | + 15, 15, 15, 15, 15, 15, 15, 15, # 74 | |
| 774 | + 15, 15, 7, 15, 7, 15, 15, 15, # 74 | |
| 775 | + 15, 15, 15, 15, 15, 15, 15, 15, # 74 | |
| 776 | + 15, 15, 15, 15, 15, 15, 15, 15, # 74 | |
| 777 | + 15, 15, 15, 46, 46, 46, 46, 46, # 74 | |
| 778 | + 46, 46, 46, 46, 46, 46, 46, 46, # 74 | |
| 779 | + 46, 46, 46, 46, 46, 46, 46, 46, # 74 | |
| 780 | + 7, 7, 7, 7, 7, 7, 7, 7, # 75 | |
| 781 | + 7, 7, 7, 7, 7, 7, 7, 7, # 75 | |
| 782 | + 7, 7, 7, 7, 7, 7, 7, 7, # 75 | |
| 783 | + 7, 7, 7, 7, 7, 7, 7, 7, # 75 | |
| 784 | + 7, 7, 7, 7, 7, 7, 7, 7, # 75 | |
| 785 | + 7, 7, 7, 7, 7, 7, 7, 7, # 75 | |
| 786 | + 7, 7, 7, 7, 7, 7, 7, 7, # 75 | |
| 787 | + 7, 7, 7, 7, 7, 7, 7, 7, # 75 | |
| 788 | + 7, 7, 7, 7, 7, 7, 7, 7, # 76 | |
| 789 | + 7, 7, 7, 7, 7, 7, 7, 7, # 76 | |
| 790 | + 7, 7, 7, 7, 7, 7, 7, 7, # 76 | |
| 791 | + 7, 7, 7, 7, 7, 7, 7, 7, # 76 | |
| 792 | + 7, 7, 7, 7, 7, 7, 7, 7, # 76 | |
| 793 | + 7, 7, 7, 7, 7, 7, 7, 7, # 76 | |
| 794 | + 7, 7, 46, 46, 46, 46, 46, 46, # 76 | |
| 795 | + 46, 46, 46, 46, 46, 46, 46, 46, # 76 | |
| 796 | + 15, 46, 15, 15, 15, 15, 15, 15, # 77 | |
| 797 | + 7, 7, 7, 7, 15, 15, 15, 15, # 77 | |
| 798 | + 15, 15, 15, 15, 15, 15, 15, 15, # 77 | |
| 799 | + 15, 15, 15, 15, 15, 15, 15, 15, # 77 | |
| 800 | + 7, 7, 15, 15, 15, 15, 15, 15, # 77 | |
| 801 | + 15, 5, 6, 15, 15, 15, 15, 15, # 77 | |
| 802 | + 15, 15, 15, 15, 15, 15, 15, 15, # 77 | |
| 803 | + 15, 15, 15, 15, 15, 15, 15, 15, # 77 | |
| 804 | + 15, 15, 15, 15, 15, 15, 15, 15, # 78 | |
| 805 | + 15, 15, 15, 15, 15, 15, 15, 15, # 78 | |
| 806 | + 15, 15, 15, 15, 15, 15, 15, 15, # 78 | |
| 807 | + 15, 15, 15, 15, 15, 15, 15, 15, # 78 | |
| 808 | + 15, 15, 15, 15, 15, 15, 15, 15, # 78 | |
| 809 | + 15, 15, 15, 15, 15, 15, 15, 15, # 78 | |
| 810 | + 15, 15, 15, 15, 15, 15, 15, 15, # 78 | |
| 811 | + 15, 15, 15, 46, 46, 46, 46, 46, # 78 | |
| 812 | + 15, 15, 15, 15, 15, 15, 15, 15, # 79 | |
| 813 | + 15, 15, 15, 15, 15, 15, 15, 15, # 79 | |
| 814 | + 15, 15, 15, 15, 15, 15, 15, 15, # 79 | |
| 815 | + 15, 15, 15, 15, 15, 15, 15, 15, # 79 | |
| 816 | + 15, 15, 15, 15, 15, 46, 46, 46, # 79 | |
| 817 | + 46, 46, 46, 46, 46, 46, 46, 46, # 79 | |
| 818 | + 46, 46, 46, 46, 46, 46, 46, 46, # 79 | |
| 819 | + 46, 46, 46, 46, 46, 46, 46, 46, # 79 | |
| 820 | + 15, 15, 15, 15, 15, 15, 15, 15, # 80 | |
| 821 | + 15, 15, 15, 46, 46, 46, 46, 46, # 80 | |
| 822 | + 46, 46, 46, 46, 46, 46, 46, 46, # 80 | |
| 823 | + 46, 46, 46, 46, 46, 46, 46, 46, # 80 | |
| 824 | + 114, 114, 114, 114, 114, 114, 114, 114, # 80 | |
| 825 | + 114, 114, 114, 114, 114, 114, 114, 114, # 80 | |
| 826 | + 114, 114, 114, 114, 82, 82, 82, 82, # 80 | |
| 827 | + 82, 82, 82, 82, 82, 82, 82, 82, # 80 | |
| 828 | + 82, 82, 82, 82, 82, 82, 82, 82, # 81 | |
| 829 | + 115, 115, 115, 115, 115, 115, 115, 115, # 81 | |
| 830 | + 115, 115, 115, 115, 115, 115, 115, 115, # 81 | |
| 831 | + 115, 115, 115, 115, 15, 15, 15, 15, # 81 | |
| 832 | + 15, 15, 15, 15, 15, 15, 15, 15, # 81 | |
| 833 | + 15, 15, 15, 15, 15, 15, 15, 15, # 81 | |
| 834 | + 15, 15, 15, 15, 15, 15, 116, 116, # 81 | |
| 835 | + 116, 116, 116, 116, 116, 116, 116, 116, # 81 | |
| 836 | + 116, 116, 116, 116, 116, 116, 116, 116, # 82 | |
| 837 | + 116, 116, 116, 116, 116, 116, 116, 116, # 82 | |
| 838 | + 117, 117, 117, 117, 117, 117, 117, 117, # 82 | |
| 839 | + 117, 117, 117, 117, 117, 117, 117, 117, # 82 | |
| 840 | + 117, 117, 117, 117, 117, 117, 117, 117, # 82 | |
| 841 | + 117, 117, 118, 46, 46, 46, 46, 46, # 82 | |
| 842 | + 46, 46, 46, 46, 46, 46, 46, 46, # 82 | |
| 843 | + 46, 46, 46, 46, 46, 46, 46, 46, # 82 | |
| 844 | + 15, 15, 15, 15, 15, 15, 15, 15, # 83 | |
| 845 | + 15, 15, 15, 15, 15, 15, 15, 15, # 83 | |
| 846 | + 15, 15, 15, 15, 15, 15, 15, 15, # 83 | |
| 847 | + 15, 15, 15, 15, 15, 15, 15, 15, # 83 | |
| 848 | + 15, 15, 15, 15, 15, 15, 15, 15, # 83 | |
| 849 | + 15, 15, 15, 15, 15, 15, 15, 15, # 83 | |
| 850 | + 15, 15, 15, 15, 15, 15, 15, 15, # 83 | |
| 851 | + 15, 15, 15, 15, 15, 15, 15, 15, # 83 | |
| 852 | + 15, 15, 15, 15, 15, 15, 15, 15, # 84 | |
| 853 | + 15, 15, 15, 15, 15, 15, 15, 15, # 84 | |
| 854 | + 15, 15, 15, 15, 15, 15, 46, 46, # 84 | |
| 855 | + 46, 46, 46, 46, 46, 46, 46, 46, # 84 | |
| 856 | + 15, 15, 15, 15, 15, 15, 15, 15, # 84 | |
| 857 | + 15, 15, 15, 15, 15, 15, 15, 15, # 84 | |
| 858 | + 15, 15, 15, 15, 15, 15, 15, 15, # 84 | |
| 859 | + 15, 15, 15, 15, 15, 15, 15, 15, # 84 | |
| 860 | + 15, 15, 15, 15, 15, 15, 15, 15, # 85 | |
| 861 | + 15, 15, 15, 15, 15, 15, 15, 15, # 85 | |
| 862 | + 15, 15, 15, 15, 15, 15, 15, 15, # 85 | |
| 863 | + 15, 15, 15, 15, 15, 15, 15, 15, # 85 | |
| 864 | + 15, 15, 15, 15, 15, 15, 15, 15, # 85 | |
| 865 | + 15, 15, 15, 15, 15, 15, 15, 15, # 85 | |
| 866 | + 46, 46, 46, 46, 46, 46, 46, 46, # 85 | |
| 867 | + 46, 46, 46, 46, 46, 46, 46, 46, # 85 | |
| 868 | + 15, 15, 15, 15, 15, 15, 15, 15, # 86 | |
| 869 | + 15, 15, 15, 15, 15, 15, 15, 15, # 86 | |
| 870 | + 15, 15, 15, 15, 46, 46, 46, 46, # 86 | |
| 871 | + 46, 46, 15, 15, 15, 15, 15, 15, # 86 | |
| 872 | + 15, 15, 15, 15, 15, 15, 15, 15, # 86 | |
| 873 | + 15, 15, 15, 15, 15, 15, 15, 15, # 86 | |
| 874 | + 15, 15, 15, 15, 15, 15, 15, 15, # 86 | |
| 875 | + 15, 15, 15, 15, 15, 15, 15, 15, # 86 | |
| 876 | + 46, 15, 15, 15, 15, 46, 15, 15, # 87 | |
| 877 | + 15, 15, 46, 46, 15, 15, 15, 15, # 87 | |
| 878 | + 15, 15, 15, 15, 15, 15, 15, 15, # 87 | |
| 879 | + 15, 15, 15, 15, 15, 15, 15, 15, # 87 | |
| 880 | + 15, 15, 15, 15, 15, 15, 15, 15, # 87 | |
| 881 | + 46, 15, 15, 15, 15, 15, 15, 15, # 87 | |
| 882 | + 15, 15, 15, 15, 15, 15, 15, 15, # 87 | |
| 883 | + 15, 15, 15, 15, 15, 15, 15, 15, # 87 | |
| 884 | + 15, 15, 15, 15, 15, 15, 15, 15, # 88 | |
| 885 | + 15, 15, 15, 15, 46, 15, 46, 15, # 88 | |
| 886 | + 15, 15, 15, 46, 46, 46, 15, 46, # 88 | |
| 887 | + 15, 15, 15, 15, 15, 15, 15, 46, # 88 | |
| 888 | + 46, 15, 15, 15, 15, 15, 15, 15, # 88 | |
| 889 | + 46, 46, 46, 46, 46, 46, 46, 46, # 88 | |
| 890 | + 46, 46, 46, 46, 46, 46, 119, 119, # 88 | |
| 891 | + 119, 119, 119, 119, 119, 119, 119, 119, # 88 | |
| 892 | + 114, 114, 114, 114, 114, 114, 114, 114, # 89 | |
| 893 | + 114, 114, 83, 83, 83, 83, 83, 83, # 89 | |
| 894 | + 83, 83, 83, 83, 15, 46, 46, 46, # 89 | |
| 895 | + 15, 15, 15, 15, 15, 15, 15, 15, # 89 | |
| 896 | + 15, 15, 15, 15, 15, 15, 15, 15, # 89 | |
| 897 | + 15, 15, 15, 15, 15, 15, 15, 15, # 89 | |
| 898 | + 46, 15, 15, 15, 15, 15, 15, 15, # 89 | |
| 899 | + 15, 15, 15, 15, 15, 15, 15, 46, # 89 | |
| 900 | + 2, 3, 3, 3, 15, 59, 3, 120, # 90 | |
| 901 | + 5, 6, 5, 6, 5, 6, 5, 6, # 90 | |
| 902 | + 5, 6, 15, 15, 5, 6, 5, 6, # 90 | |
| 903 | + 5, 6, 5, 6, 8, 5, 6, 5, # 90 | |
| 904 | + 15, 121, 121, 121, 121, 121, 121, 121, # 90 | |
| 905 | + 121, 121, 60, 60, 60, 60, 60, 60, # 90 | |
| 906 | + 8, 59, 59, 59, 59, 59, 15, 15, # 90 | |
| 907 | + 46, 46, 46, 46, 46, 46, 46, 15, # 90 | |
| 908 | + 46, 40, 40, 40, 40, 40, 40, 40, # 91 | |
| 909 | + 40, 40, 40, 40, 40, 40, 40, 40, # 91 | |
| 910 | + 40, 40, 40, 40, 40, 40, 40, 40, # 91 | |
| 911 | + 40, 40, 40, 40, 40, 40, 40, 40, # 91 | |
| 912 | + 40, 40, 40, 40, 40, 40, 40, 40, # 91 | |
| 913 | + 40, 40, 40, 40, 40, 40, 40, 40, # 91 | |
| 914 | + 40, 40, 40, 40, 40, 40, 40, 40, # 91 | |
| 915 | + 40, 40, 40, 40, 40, 40, 40, 40, # 91 | |
| 916 | + 40, 40, 40, 40, 40, 40, 40, 40, # 92 | |
| 917 | + 40, 40, 40, 40, 40, 40, 40, 40, # 92 | |
| 918 | + 40, 40, 40, 40, 40, 46, 46, 46, # 92 | |
| 919 | + 46, 60, 60, 59, 59, 59, 59, 46, # 92 | |
| 920 | + 46, 40, 40, 40, 40, 40, 40, 40, # 92 | |
| 921 | + 40, 40, 40, 40, 40, 40, 40, 40, # 92 | |
| 922 | + 40, 40, 40, 40, 40, 40, 40, 40, # 92 | |
| 923 | + 40, 40, 40, 40, 40, 40, 40, 40, # 92 | |
| 924 | + 40, 40, 40, 40, 40, 40, 40, 40, # 93 | |
| 925 | + 40, 40, 40, 40, 40, 40, 40, 40, # 93 | |
| 926 | + 40, 40, 40, 40, 40, 40, 40, 40, # 93 | |
| 927 | + 40, 40, 40, 40, 40, 40, 40, 40, # 93 | |
| 928 | + 40, 40, 40, 40, 40, 40, 40, 40, # 93 | |
| 929 | + 40, 40, 40, 40, 40, 40, 40, 40, # 93 | |
| 930 | + 40, 40, 40, 40, 40, 40, 40, 40, # 93 | |
| 931 | + 40, 40, 40, 3, 59, 59, 59, 46, # 93 | |
| 932 | + 46, 46, 46, 46, 46, 40, 40, 40, # 94 | |
| 933 | + 40, 40, 40, 40, 40, 40, 40, 40, # 94 | |
| 934 | + 40, 40, 40, 40, 40, 40, 40, 40, # 94 | |
| 935 | + 40, 40, 40, 40, 40, 40, 40, 40, # 94 | |
| 936 | + 40, 40, 40, 40, 40, 40, 40, 40, # 94 | |
| 937 | + 40, 40, 40, 40, 40, 46, 46, 46, # 94 | |
| 938 | + 46, 40, 40, 40, 40, 40, 40, 40, # 94 | |
| 939 | + 40, 40, 40, 40, 40, 40, 40, 40, # 94 | |
| 940 | + 40, 40, 40, 40, 40, 40, 40, 40, # 95 | |
| 941 | + 40, 40, 40, 40, 40, 40, 40, 46, # 95 | |
| 942 | + 15, 15, 85, 85, 85, 85, 15, 15, # 95 | |
| 943 | + 15, 15, 15, 15, 15, 15, 15, 15, # 95 | |
| 944 | + 46, 46, 46, 46, 46, 46, 46, 46, # 95 | |
| 945 | + 46, 46, 46, 46, 46, 46, 46, 46, # 95 | |
| 946 | + 46, 46, 46, 46, 46, 46, 46, 46, # 95 | |
| 947 | + 46, 46, 46, 46, 46, 46, 46, 46, # 95 | |
| 948 | + 15, 15, 15, 15, 15, 15, 15, 15, # 96 | |
| 949 | + 15, 15, 15, 15, 15, 15, 15, 15, # 96 | |
| 950 | + 15, 15, 15, 15, 15, 15, 15, 15, # 96 | |
| 951 | + 15, 15, 15, 15, 15, 46, 46, 46, # 96 | |
| 952 | + 85, 85, 85, 85, 85, 85, 85, 85, # 96 | |
| 953 | + 85, 85, 15, 15, 15, 15, 15, 15, # 96 | |
| 954 | + 15, 15, 15, 15, 15, 15, 15, 15, # 96 | |
| 955 | + 15, 15, 15, 15, 15, 15, 15, 15, # 96 | |
| 956 | + 15, 15, 15, 15, 46, 46, 46, 46, # 97 | |
| 957 | + 46, 46, 46, 46, 46, 46, 46, 46, # 97 | |
| 958 | + 46, 46, 46, 46, 46, 46, 46, 46, # 97 | |
| 959 | + 46, 46, 46, 46, 46, 46, 46, 46, # 97 | |
| 960 | + 15, 15, 15, 15, 15, 15, 15, 15, # 97 | |
| 961 | + 15, 15, 15, 15, 15, 15, 15, 15, # 97 | |
| 962 | + 15, 15, 15, 15, 15, 15, 15, 15, # 97 | |
| 963 | + 15, 15, 15, 15, 46, 46, 46, 15, # 97 | |
| 964 | + 114, 114, 114, 114, 114, 114, 114, 114, # 98 | |
| 965 | + 114, 114, 15, 15, 15, 15, 15, 15, # 98 | |
| 966 | + 15, 15, 15, 15, 15, 15, 15, 15, # 98 | |
| 967 | + 15, 15, 15, 15, 15, 15, 15, 15, # 98 | |
| 968 | + 15, 15, 15, 15, 15, 15, 15, 15, # 98 | |
| 969 | + 15, 15, 15, 15, 15, 15, 15, 15, # 98 | |
| 970 | + 15, 46, 46, 46, 46, 46, 46, 46, # 98 | |
| 971 | + 46, 46, 46, 46, 46, 46, 46, 46, # 98 | |
| 972 | + 15, 15, 15, 15, 15, 15, 15, 15, # 99 | |
| 973 | + 15, 15, 15, 15, 46, 46, 46, 46, # 99 | |
| 974 | + 15, 15, 15, 15, 15, 15, 15, 15, # 99 | |
| 975 | + 15, 15, 15, 15, 15, 15, 15, 15, # 99 | |
| 976 | + 15, 15, 15, 15, 15, 15, 15, 15, # 99 | |
| 977 | + 15, 15, 15, 15, 15, 15, 15, 15, # 99 | |
| 978 | + 15, 15, 15, 15, 15, 15, 15, 15, # 99 | |
| 979 | + 15, 15, 15, 15, 15, 15, 15, 46, # 99 | |
| 980 | + 15, 15, 15, 15, 15, 15, 15, 15, # 100 | |
| 981 | + 15, 15, 15, 15, 15, 15, 15, 15, # 100 | |
| 982 | + 15, 15, 15, 15, 15, 15, 15, 15, # 100 | |
| 983 | + 15, 15, 15, 15, 15, 15, 15, 15, # 100 | |
| 984 | + 15, 15, 15, 15, 15, 15, 15, 15, # 100 | |
| 985 | + 15, 15, 15, 15, 15, 15, 15, 15, # 100 | |
| 986 | + 15, 15, 15, 15, 15, 15, 15, 46, # 100 | |
| 987 | + 46, 46, 46, 15, 15, 15, 15, 15, # 100 | |
| 988 | + 15, 15, 15, 15, 15, 15, 15, 15, # 101 | |
| 989 | + 15, 15, 15, 15, 15, 15, 15, 15, # 101 | |
| 990 | + 15, 15, 15, 15, 15, 15, 15, 15, # 101 | |
| 991 | + 15, 15, 15, 15, 15, 15, 46, 46, # 101 | |
| 992 | + 15, 15, 15, 15, 15, 15, 15, 15, # 101 | |
| 993 | + 15, 15, 15, 15, 15, 15, 15, 15, # 101 | |
| 994 | + 15, 15, 15, 15, 15, 15, 15, 15, # 101 | |
| 995 | + 15, 15, 15, 15, 15, 15, 15, 46, # 101 | |
| 996 | + 40, 40, 40, 40, 40, 40, 40, 40, # 102 | |
| 997 | + 40, 40, 40, 40, 40, 40, 40, 40, # 102 | |
| 998 | + 40, 40, 40, 40, 40, 40, 40, 40, # 102 | |
| 999 | + 40, 40, 40, 40, 40, 40, 40, 40, # 102 | |
| 1000 | + 40, 40, 40, 40, 40, 40, 46, 46, # 102 | |
| 1001 | + 46, 46, 46, 46, 46, 46, 46, 46, # 102 | |
| 1002 | + 46, 46, 46, 46, 46, 46, 46, 46, # 102 | |
| 1003 | + 46, 46, 46, 46, 46, 46, 46, 46, # 102 | |
| 1004 | + 40, 40, 40, 40, 40, 40, 40, 40, # 103 | |
| 1005 | + 40, 40, 40, 40, 40, 40, 40, 40, # 103 | |
| 1006 | + 40, 40, 40, 40, 40, 40, 40, 40, # 103 | |
| 1007 | + 40, 40, 40, 40, 40, 40, 40, 40, # 103 | |
| 1008 | + 40, 40, 40, 40, 46, 46, 46, 46, # 103 | |
| 1009 | + 46, 46, 46, 46, 46, 46, 46, 46, # 103 | |
| 1010 | + 46, 46, 46, 46, 46, 46, 46, 46, # 103 | |
| 1011 | + 46, 46, 46, 46, 46, 46, 46, 46, # 103 | |
| 1012 | + 122, 122, 122, 122, 122, 122, 122, 122, # 104 | |
| 1013 | + 122, 122, 122, 122, 122, 122, 122, 122, # 104 | |
| 1014 | + 122, 122, 122, 122, 122, 122, 122, 122, # 104 | |
| 1015 | + 122, 122, 122, 122, 122, 122, 122, 122, # 104 | |
| 1016 | + 122, 122, 122, 122, 122, 122, 122, 122, # 104 | |
| 1017 | + 122, 122, 122, 122, 122, 122, 122, 122, # 104 | |
| 1018 | + 122, 122, 122, 122, 122, 122, 122, 122, # 104 | |
| 1019 | + 122, 122, 122, 122, 122, 122, 122, 122, # 104 | |
| 1020 | + 123, 123, 123, 123, 123, 123, 123, 123, # 105 | |
| 1021 | + 123, 123, 123, 123, 123, 123, 123, 123, # 105 | |
| 1022 | + 123, 123, 123, 123, 123, 123, 123, 123, # 105 | |
| 1023 | + 123, 123, 123, 123, 123, 123, 123, 123, # 105 | |
| 1024 | + 123, 123, 123, 123, 123, 123, 123, 123, # 105 | |
| 1025 | + 123, 123, 123, 123, 123, 123, 123, 123, # 105 | |
| 1026 | + 123, 123, 123, 123, 123, 123, 123, 123, # 105 | |
| 1027 | + 123, 123, 123, 123, 123, 123, 123, 123, # 105 | |
| 1028 | + 40, 40, 40, 40, 40, 40, 40, 40, # 106 | |
| 1029 | + 40, 40, 40, 40, 40, 40, 40, 40, # 106 | |
| 1030 | + 40, 40, 40, 40, 40, 40, 40, 40, # 106 | |
| 1031 | + 40, 40, 40, 40, 40, 40, 40, 40, # 106 | |
| 1032 | + 40, 40, 40, 40, 40, 40, 40, 40, # 106 | |
| 1033 | + 40, 40, 40, 40, 40, 40, 46, 46, # 106 | |
| 1034 | + 46, 46, 46, 46, 46, 46, 46, 46, # 106 | |
| 1035 | + 46, 46, 46, 46, 46, 46, 46, 46, # 106 | |
| 1036 | + 16, 16, 16, 16, 16, 16, 16, 46, # 107 | |
| 1037 | + 46, 46, 46, 46, 46, 46, 46, 46, # 107 | |
| 1038 | + 46, 46, 46, 16, 16, 16, 16, 16, # 107 | |
| 1039 | + 46, 46, 46, 46, 46, 46, 60, 40, # 107 | |
| 1040 | + 40, 40, 40, 40, 40, 40, 40, 40, # 107 | |
| 1041 | + 40, 7, 40, 40, 40, 40, 40, 40, # 107 | |
| 1042 | + 40, 40, 40, 40, 40, 40, 40, 46, # 107 | |
| 1043 | + 40, 40, 40, 40, 40, 46, 40, 46, # 107 | |
| 1044 | + 40, 40, 46, 40, 40, 46, 40, 40, # 108 | |
| 1045 | + 40, 40, 40, 40, 40, 40, 40, 40, # 108 | |
| 1046 | + 40, 40, 40, 40, 40, 40, 40, 40, # 108 | |
| 1047 | + 40, 40, 40, 40, 40, 40, 40, 40, # 108 | |
| 1048 | + 40, 40, 40, 40, 40, 40, 40, 40, # 108 | |
| 1049 | + 40, 40, 40, 40, 40, 40, 40, 40, # 108 | |
| 1050 | + 40, 40, 40, 40, 40, 40, 40, 40, # 108 | |
| 1051 | + 40, 40, 40, 40, 40, 40, 40, 40, # 108 | |
| 1052 | + 40, 40, 40, 40, 40, 40, 40, 40, # 109 | |
| 1053 | + 40, 40, 40, 40, 40, 40, 40, 40, # 109 | |
| 1054 | + 40, 40, 40, 40, 40, 40, 40, 40, # 109 | |
| 1055 | + 40, 40, 40, 40, 40, 40, 40, 40, # 109 | |
| 1056 | + 40, 40, 40, 40, 40, 40, 40, 40, # 109 | |
| 1057 | + 40, 40, 40, 40, 40, 40, 40, 40, # 109 | |
| 1058 | + 40, 40, 46, 46, 46, 46, 46, 46, # 109 | |
| 1059 | + 46, 46, 46, 46, 46, 46, 46, 46, # 109 | |
| 1060 | + 46, 46, 46, 46, 46, 46, 46, 46, # 110 | |
| 1061 | + 46, 46, 46, 46, 46, 46, 46, 46, # 110 | |
| 1062 | + 46, 46, 46, 40, 40, 40, 40, 40, # 110 | |
| 1063 | + 40, 40, 40, 40, 40, 40, 40, 40, # 110 | |
| 1064 | + 40, 40, 40, 40, 40, 40, 40, 40, # 110 | |
| 1065 | + 40, 40, 40, 40, 40, 40, 40, 40, # 110 | |
| 1066 | + 40, 40, 40, 40, 40, 40, 40, 40, # 110 | |
| 1067 | + 40, 40, 40, 40, 40, 40, 40, 40, # 110 | |
| 1068 | + 40, 40, 40, 40, 40, 40, 40, 40, # 111 | |
| 1069 | + 40, 40, 40, 40, 40, 40, 40, 40, # 111 | |
| 1070 | + 40, 40, 40, 40, 40, 40, 40, 40, # 111 | |
| 1071 | + 40, 40, 40, 40, 40, 40, 40, 40, # 111 | |
| 1072 | + 40, 40, 40, 40, 40, 40, 40, 40, # 111 | |
| 1073 | + 40, 40, 40, 40, 40, 40, 40, 40, # 111 | |
| 1074 | + 40, 40, 40, 40, 40, 40, 40, 40, # 111 | |
| 1075 | + 40, 40, 40, 40, 40, 40, 5, 6, # 111 | |
| 1076 | + 46, 46, 46, 46, 46, 46, 46, 46, # 112 | |
| 1077 | + 46, 46, 46, 46, 46, 46, 46, 46, # 112 | |
| 1078 | + 40, 40, 40, 40, 40, 40, 40, 40, # 112 | |
| 1079 | + 40, 40, 40, 40, 40, 40, 40, 40, # 112 | |
| 1080 | + 40, 40, 40, 40, 40, 40, 40, 40, # 112 | |
| 1081 | + 40, 40, 40, 40, 40, 40, 40, 40, # 112 | |
| 1082 | + 40, 40, 40, 40, 40, 40, 40, 40, # 112 | |
| 1083 | + 40, 40, 40, 40, 40, 40, 40, 40, # 112 | |
| 1084 | + 40, 40, 40, 40, 40, 40, 40, 40, # 113 | |
| 1085 | + 40, 40, 40, 40, 40, 40, 40, 40, # 113 | |
| 1086 | + 46, 46, 40, 40, 40, 40, 40, 40, # 113 | |
| 1087 | + 40, 40, 40, 40, 40, 40, 40, 40, # 113 | |
| 1088 | + 40, 40, 40, 40, 40, 40, 40, 40, # 113 | |
| 1089 | + 40, 40, 40, 40, 40, 40, 40, 40, # 113 | |
| 1090 | + 40, 40, 40, 40, 40, 40, 40, 40, # 113 | |
| 1091 | + 40, 40, 40, 40, 40, 40, 40, 40, # 113 | |
| 1092 | + 40, 40, 40, 40, 40, 40, 40, 40, # 114 | |
| 1093 | + 46, 46, 46, 46, 46, 46, 46, 46, # 114 | |
| 1094 | + 46, 46, 46, 46, 46, 46, 46, 46, # 114 | |
| 1095 | + 46, 46, 46, 46, 46, 46, 46, 46, # 114 | |
| 1096 | + 46, 46, 46, 46, 46, 46, 46, 46, # 114 | |
| 1097 | + 46, 46, 46, 46, 46, 46, 46, 46, # 114 | |
| 1098 | + 40, 40, 40, 40, 40, 40, 40, 40, # 114 | |
| 1099 | + 40, 40, 40, 40, 46, 46, 46, 46, # 114 | |
| 1100 | + 46, 46, 46, 46, 46, 46, 46, 46, # 115 | |
| 1101 | + 46, 46, 46, 46, 46, 46, 46, 46, # 115 | |
| 1102 | + 46, 46, 46, 46, 46, 46, 46, 46, # 115 | |
| 1103 | + 46, 46, 46, 46, 46, 46, 46, 46, # 115 | |
| 1104 | + 60, 60, 60, 60, 46, 46, 46, 46, # 115 | |
| 1105 | + 46, 46, 46, 46, 46, 46, 46, 46, # 115 | |
| 1106 | + 3, 8, 8, 12, 12, 5, 6, 5, # 115 | |
| 1107 | + 6, 5, 6, 5, 6, 5, 6, 5, # 115 | |
| 1108 | + 6, 5, 6, 5, 6, 46, 46, 46, # 116 | |
| 1109 | + 46, 3, 3, 3, 3, 12, 12, 12, # 116 | |
| 1110 | + 3, 3, 3, 46, 3, 3, 3, 3, # 116 | |
| 1111 | + 8, 5, 6, 5, 6, 5, 6, 3, # 116 | |
| 1112 | + 3, 3, 7, 8, 7, 7, 7, 46, # 116 | |
| 1113 | + 3, 4, 3, 3, 46, 46, 46, 46, # 116 | |
| 1114 | + 40, 40, 40, 46, 40, 46, 40, 40, # 116 | |
| 1115 | + 40, 40, 40, 40, 40, 40, 40, 40, # 116 | |
| 1116 | + 40, 40, 40, 40, 40, 40, 40, 40, # 117 | |
| 1117 | + 40, 40, 40, 40, 40, 40, 40, 40, # 117 | |
| 1118 | + 40, 40, 40, 40, 40, 40, 40, 40, # 117 | |
| 1119 | + 40, 40, 40, 40, 40, 40, 40, 40, # 117 | |
| 1120 | + 40, 40, 40, 40, 40, 40, 40, 40, # 117 | |
| 1121 | + 40, 40, 40, 40, 40, 40, 40, 40, # 117 | |
| 1122 | + 40, 40, 40, 40, 40, 40, 40, 40, # 117 | |
| 1123 | + 40, 40, 40, 40, 40, 46, 46, 104, # 117 | |
| 1124 | + 46, 3, 3, 3, 4, 3, 3, 3, # 118 | |
| 1125 | + 5, 6, 3, 7, 3, 8, 3, 3, # 118 | |
| 1126 | + 9, 9, 9, 9, 9, 9, 9, 9, # 118 | |
| 1127 | + 9, 9, 3, 3, 7, 7, 7, 3, # 118 | |
| 1128 | + 3, 10, 10, 10, 10, 10, 10, 10, # 118 | |
| 1129 | + 10, 10, 10, 10, 10, 10, 10, 10, # 118 | |
| 1130 | + 10, 10, 10, 10, 10, 10, 10, 10, # 118 | |
| 1131 | + 10, 10, 10, 5, 3, 6, 11, 12, # 118 | |
| 1132 | + 11, 13, 13, 13, 13, 13, 13, 13, # 119 | |
| 1133 | + 13, 13, 13, 13, 13, 13, 13, 13, # 119 | |
| 1134 | + 13, 13, 13, 13, 13, 13, 13, 13, # 119 | |
| 1135 | + 13, 13, 13, 5, 7, 6, 7, 46, # 119 | |
| 1136 | + 46, 3, 5, 6, 3, 3, 40, 40, # 119 | |
| 1137 | + 40, 40, 40, 40, 40, 40, 40, 40, # 119 | |
| 1138 | + 59, 40, 40, 40, 40, 40, 40, 40, # 119 | |
| 1139 | + 40, 40, 40, 40, 40, 40, 40, 40, # 119 | |
| 1140 | + 40, 40, 40, 40, 40, 40, 40, 40, # 120 | |
| 1141 | + 40, 40, 40, 40, 40, 40, 40, 40, # 120 | |
| 1142 | + 40, 40, 40, 40, 40, 40, 40, 40, # 120 | |
| 1143 | + 40, 40, 40, 40, 40, 40, 59, 59, # 120 | |
| 1144 | + 40, 40, 40, 40, 40, 40, 40, 40, # 120 | |
| 1145 | + 40, 40, 40, 40, 40, 40, 40, 40, # 120 | |
| 1146 | + 40, 40, 40, 40, 40, 40, 40, 40, # 120 | |
| 1147 | + 40, 40, 40, 40, 40, 40, 40, 46, # 120 | |
| 1148 | + 46, 46, 40, 40, 40, 40, 40, 40, # 121 | |
| 1149 | + 46, 46, 40, 40, 40, 40, 40, 40, # 121 | |
| 1150 | + 46, 46, 40, 40, 40, 40, 40, 40, # 121 | |
| 1151 | + 46, 46, 40, 40, 40, 46, 46, 46, # 121 | |
| 1152 | + 4, 4, 7, 11, 15, 4, 4, 46, # 121 | |
| 1153 | + 7, 7, 7, 7, 7, 15, 15, 46, # 121 | |
| 1154 | + 46, 46, 46, 46, 46, 46, 46, 46, # 121 | |
| 1155 | + 46, 46, 46, 46, 46, 15, 46, 46 # 121 | |
| 1156 | + }; | |
| 1157 | + | |
| 1158 | +# The A table has 124 entries for a total of 496 bytes. | |
| 1159 | + | |
| 1160 | +A = array[] of { | |
| 1161 | + 16r0001000F, # 0 Cc, ignorable | |
| 1162 | + 16r0004000F, # 1 Cc, whitespace | |
| 1163 | + 16r0004000C, # 2 Zs, whitespace | |
| 1164 | + 16r00000018, # 3 Po | |
| 1165 | + 16r0006001A, # 4 Sc, currency | |
| 1166 | + 16r00000015, # 5 Ps | |
| 1167 | + 16r00000016, # 6 Pe | |
| 1168 | + 16r00000019, # 7 Sm | |
| 1169 | + 16r00000014, # 8 Pd | |
| 1170 | + 16r00036009, # 9 Nd, identifier part, decimal 16 | |
| 1171 | + 16r0827FE01, # 10 Lu, hasLower (add 32), identifier start, supradecimal 31 | |
| 1172 | + 16r0000001B, # 11 Sk | |
| 1173 | + 16r00050017, # 12 Pc, underscore | |
| 1174 | + 16r0817FE02, # 13 Ll, hasUpper (subtract 32), identifier start, supradecimal 31 | |
| 1175 | + 16r0000000C, # 14 Zs | |
| 1176 | + 16r0000001C, # 15 So | |
| 1177 | + 16r00070002, # 16 Ll, identifier start | |
| 1178 | + 16r0000600B, # 17 No, decimal 16 | |
| 1179 | + 16r0000500B, # 18 No, decimal 8 | |
| 1180 | + 16r0000800B, # 19 No, strange | |
| 1181 | + 16r08270001, # 20 Lu, hasLower (add 32), identifier start | |
| 1182 | + 16r08170002, # 21 Ll, hasUpper (subtract 32), identifier start | |
| 1183 | + int 16rE1D70002, # 22 Ll, hasUpper (subtract -121), identifier start | |
| 1184 | + 16r00670001, # 23 Lu, hasLower (add 1), identifier start | |
| 1185 | + 16r00570002, # 24 Ll, hasUpper (subtract 1), identifier start | |
| 1186 | + int 16rCE670001, # 25 Lu, hasLower (add -199), identifier start | |
| 1187 | + 16r3A170002, # 26 Ll, hasUpper (subtract 232), identifier start | |
| 1188 | + int 16rE1E70001, # 27 Lu, hasLower (add -121), identifier start | |
| 1189 | + 16r4B170002, # 28 Ll, hasUpper (subtract 300), identifier start | |
| 1190 | + 16r34A70001, # 29 Lu, hasLower (add 210), identifier start | |
| 1191 | + 16r33A70001, # 30 Lu, hasLower (add 206), identifier start | |
| 1192 | + 16r33670001, # 31 Lu, hasLower (add 205), identifier start | |
| 1193 | + 16r32A70001, # 32 Lu, hasLower (add 202), identifier start | |
| 1194 | + 16r32E70001, # 33 Lu, hasLower (add 203), identifier start | |
| 1195 | + 16r33E70001, # 34 Lu, hasLower (add 207), identifier start | |
| 1196 | + 16r34E70001, # 35 Lu, hasLower (add 211), identifier start | |
| 1197 | + 16r34670001, # 36 Lu, hasLower (add 209), identifier start | |
| 1198 | + 16r35670001, # 37 Lu, hasLower (add 213), identifier start | |
| 1199 | + 16r00070001, # 38 Lu, identifier start | |
| 1200 | + 16r36A70001, # 39 Lu, hasLower (add 218), identifier start | |
| 1201 | + 16r00070005, # 40 Lo, identifier start | |
| 1202 | + 16r36670001, # 41 Lu, hasLower (add 217), identifier start | |
| 1203 | + 16r36E70001, # 42 Lu, hasLower (add 219), identifier start | |
| 1204 | + 16r00AF0001, # 43 Lu, hasLower (add 2), hasTitle, identifier start | |
| 1205 | + 16r007F0003, # 44 Lt, hasUpper (subtract 1), hasLower (add 1), hasTitle, identifier start | |
| 1206 | + 16r009F0002, # 45 Ll, hasUpper (subtract 2), hasTitle, identifier start | |
| 1207 | + 16r00000000, # 46 unassigned | |
| 1208 | + 16r34970002, # 47 Ll, hasUpper (subtract 210), identifier start | |
| 1209 | + 16r33970002, # 48 Ll, hasUpper (subtract 206), identifier start | |
| 1210 | + 16r33570002, # 49 Ll, hasUpper (subtract 205), identifier start | |
| 1211 | + 16r32970002, # 50 Ll, hasUpper (subtract 202), identifier start | |
| 1212 | + 16r32D70002, # 51 Ll, hasUpper (subtract 203), identifier start | |
| 1213 | + 16r33D70002, # 52 Ll, hasUpper (subtract 207), identifier start | |
| 1214 | + 16r34570002, # 53 Ll, hasUpper (subtract 209), identifier start | |
| 1215 | + 16r34D70002, # 54 Ll, hasUpper (subtract 211), identifier start | |
| 1216 | + 16r35570002, # 55 Ll, hasUpper (subtract 213), identifier start | |
| 1217 | + 16r36970002, # 56 Ll, hasUpper (subtract 218), identifier start | |
| 1218 | + 16r36570002, # 57 Ll, hasUpper (subtract 217), identifier start | |
| 1219 | + 16r36D70002, # 58 Ll, hasUpper (subtract 219), identifier start | |
| 1220 | + 16r00070004, # 59 Lm, identifier start | |
| 1221 | + 16r00030006, # 60 Mn, identifier part | |
| 1222 | + 16r09A70001, # 61 Lu, hasLower (add 38), identifier start | |
| 1223 | + 16r09670001, # 62 Lu, hasLower (add 37), identifier start | |
| 1224 | + 16r10270001, # 63 Lu, hasLower (add 64), identifier start | |
| 1225 | + 16r0FE70001, # 64 Lu, hasLower (add 63), identifier start | |
| 1226 | + 16r09970002, # 65 Ll, hasUpper (subtract 38), identifier start | |
| 1227 | + 16r09570002, # 66 Ll, hasUpper (subtract 37), identifier start | |
| 1228 | + 16r10170002, # 67 Ll, hasUpper (subtract 64), identifier start | |
| 1229 | + 16r0FD70002, # 68 Ll, hasUpper (subtract 63), identifier start | |
| 1230 | + 16r0F970002, # 69 Ll, hasUpper (subtract 62), identifier start | |
| 1231 | + 16r0E570002, # 70 Ll, hasUpper (subtract 57), identifier start | |
| 1232 | + 16r0BD70002, # 71 Ll, hasUpper (subtract 47), identifier start | |
| 1233 | + 16r0D970002, # 72 Ll, hasUpper (subtract 54), identifier start | |
| 1234 | + 16r15970002, # 73 Ll, hasUpper (subtract 86), identifier start | |
| 1235 | + 16r14170002, # 74 Ll, hasUpper (subtract 80), identifier start | |
| 1236 | + 16r14270001, # 75 Lu, hasLower (add 80), identifier start | |
| 1237 | + 16r0C270001, # 76 Lu, hasLower (add 48), identifier start | |
| 1238 | + 16r0C170002, # 77 Ll, hasUpper (subtract 48), identifier start | |
| 1239 | + 16r00034009, # 78 Nd, identifier part, decimal 0 | |
| 1240 | + 16r00000007, # 79 Me | |
| 1241 | + 16r00030008, # 80 Mc, identifier part | |
| 1242 | + 16r00037409, # 81 Nd, identifier part, decimal 26 | |
| 1243 | + 16r00005A0B, # 82 No, decimal 13 | |
| 1244 | + 16r00006E0B, # 83 No, decimal 23 | |
| 1245 | + 16r0000740B, # 84 No, decimal 26 | |
| 1246 | + 16r0000000B, # 85 No | |
| 1247 | + int 16rFE170002, # 86 Ll, hasUpper (subtract -8), identifier start | |
| 1248 | + int 16rFE270001, # 87 Lu, hasLower (add -8), identifier start | |
| 1249 | + int 16rED970002, # 88 Ll, hasUpper (subtract -74), identifier start | |
| 1250 | + int 16rEA970002, # 89 Ll, hasUpper (subtract -86), identifier start | |
| 1251 | + int 16rE7170002, # 90 Ll, hasUpper (subtract -100), identifier start | |
| 1252 | + int 16rE0170002, # 91 Ll, hasUpper (subtract -128), identifier start | |
| 1253 | + int 16rE4170002, # 92 Ll, hasUpper (subtract -112), identifier start | |
| 1254 | + int 16rE0970002, # 93 Ll, hasUpper (subtract -126), identifier start | |
| 1255 | + int 16rFDD70002, # 94 Ll, hasUpper (subtract -9), identifier start | |
| 1256 | + int 16rEDA70001, # 95 Lu, hasLower (add -74), identifier start | |
| 1257 | + int 16rFDE70001, # 96 Lu, hasLower (add -9), identifier start | |
| 1258 | + int 16rEAA70001, # 97 Lu, hasLower (add -86), identifier start | |
| 1259 | + int 16rE7270001, # 98 Lu, hasLower (add -100), identifier start | |
| 1260 | + int 16rFE570002, # 99 Ll, hasUpper (subtract -7), identifier start | |
| 1261 | + int 16rE4270001, # 100 Lu, hasLower (add -112), identifier start | |
| 1262 | + int 16rFE670001, # 101 Lu, hasLower (add -7), identifier start | |
| 1263 | + int 16rE0270001, # 102 Lu, hasLower (add -128), identifier start | |
| 1264 | + int 16rE0A70001, # 103 Lu, hasLower (add -126), identifier start | |
| 1265 | + 16r00010010, # 104 Cf, ignorable | |
| 1266 | + 16r0004000D, # 105 Zl, whitespace | |
| 1267 | + 16r0004000E, # 106 Zp, whitespace | |
| 1268 | + 16r0000400B, # 107 No, decimal 0 | |
| 1269 | + 16r0000440B, # 108 No, decimal 2 | |
| 1270 | + 16r0427420A, # 109 Nl, hasLower (add 16), identifier start, decimal 1 | |
| 1271 | + 16r0427800A, # 110 Nl, hasLower (add 16), identifier start, strange | |
| 1272 | + 16r0417620A, # 111 Nl, hasUpper (subtract 16), identifier start, decimal 17 | |
| 1273 | + 16r0417800A, # 112 Nl, hasUpper (subtract 16), identifier start, strange | |
| 1274 | + 16r0007800A, # 113 Nl, identifier start, strange | |
| 1275 | + 16r0000420B, # 114 No, decimal 1 | |
| 1276 | + 16r0000720B, # 115 No, decimal 25 | |
| 1277 | + 16r06A0001C, # 116 So, hasLower (add 26) | |
| 1278 | + 16r0690001C, # 117 So, hasUpper (subtract 26) | |
| 1279 | + 16r00006C0B, # 118 No, decimal 22 | |
| 1280 | + 16r0000560B, # 119 No, decimal 11 | |
| 1281 | + 16r0007720A, # 120 Nl, identifier start, decimal 25 | |
| 1282 | + 16r0007400A, # 121 Nl, identifier start, decimal 0 | |
| 1283 | + 16r00000013, # 122 Cs | |
| 1284 | + 16r00000012 # 123 Co | |
| 1285 | + }; | |
| @@ -0,0 +1,8 @@ | ||
| 1 | +UnicodeTable : module | |
| 2 | +{ | |
| 3 | + PATH : con "/dis/java/java/lang/unicode_table.dis"; | |
| 4 | + | |
| 5 | + A : array of int; | |
| 6 | + X : array of int; | |
| 7 | + Y : array of int; | |
| 8 | +}; | |