JavaClassReader.st
changeset 52 1dc41619b6f8
parent 50 458467ce0e15
child 54 f37bcefb7091
equal deleted inserted replaced
51:d5a1e2873469 52:1dc41619b6f8
    76      - The classes stringConstants are not fixed to be JavaStrings 
    76      - The classes stringConstants are not fixed to be JavaStrings 
    77        (i.e they are still ST-Strings).
    77        (i.e they are still ST-Strings).
    78      - The class is not initialized."
    78      - The class is not initialized."
    79 
    79 
    80     |rslt clsName|
    80     |rslt clsName|
       
    81 
       
    82     (aClassName endsWith:';') ifTrue:[
       
    83         ('oops - loading of ' , aClassName , ' attempted') printNL.
       
    84 self halt.
       
    85         ^ nil
       
    86     ].
    81 
    87 
    82     clsName := aClassName.
    88     clsName := aClassName.
    83     (clsName includes:$.) ifTrue:[
    89     (clsName includes:$.) ifTrue:[
    84         clsName := clsName copy replaceAll:$. by:$/
    90         clsName := clsName copy replaceAll:$. by:$/
    85     ].
    91     ].
   330     this_class setAccessFlags:access_flags.
   336     this_class setAccessFlags:access_flags.
   331     this_class setSuperclass:super_class.
   337     this_class setSuperclass:super_class.
   332     this_class setConstantPool:constants.
   338     this_class setConstantPool:constants.
   333 
   339 
   334     JavaClass setInstanceVariableStringFromFields:fields in:this_class.
   340     JavaClass setInstanceVariableStringFromFields:fields in:this_class.
       
   341     this_class setFields:fields.
   335 
   342 
   336     "/
   343     "/
   337     "/ get methods
   344     "/ get methods
   338     "/
   345     "/
   339     self readMethodsFor:this_class.
   346     self readMethodsFor:this_class.
   535             constSlot := constSlot + 1.
   542             constSlot := constSlot + 1.
   536         ].
   543         ].
   537         constSlot := constSlot + 1.
   544         constSlot := constSlot + 1.
   538     ].
   545     ].
   539 
   546 
       
   547     constSlot := -1.
       
   548 
   540     1 to:constantPoolCount-1 do:[:i |
   549     1 to:constantPoolCount-1 do:[:i |
   541         |const|
   550         |const|
   542 
   551 
   543         const := constants at:i.
   552         const := constants at:i.
   544         const notNil ifTrue:[   "/ kludge for 2-slot constants (which only take 1 slot in ST/X)
   553         const notNil ifTrue:[   "/ kludge for 2-slot constants (which only take 1 slot in ST/X)
   574     "Created: 15.4.1996 / 15:15:35 / cg"
   583     "Created: 15.4.1996 / 15:15:35 / cg"
   575     "Modified: 15.4.1996 / 16:33:45 / cg"
   584     "Modified: 15.4.1996 / 16:33:45 / cg"
   576 !
   585 !
   577 
   586 
   578 readConstant_Class
   587 readConstant_Class
   579     |name_index|
   588     |name_index name|
   580 
   589 
   581     name_index := self nextU2.
   590     name_index := self nextU2.
   582 
   591 
   583     Verbose ifTrue:[Transcript show:'class; index= '; showCr:name_index].
   592     Verbose ifTrue:[Transcript show:'class; index= '; showCr:name_index].
       
   593 
       
   594     name := constants at:name_index.
       
   595     name notNil ifTrue:[
       
   596         self halt
       
   597     ].
   584 
   598 
   585     ^ JavaUnresolvedClassConstant 
   599     ^ JavaUnresolvedClassConstant 
   586         nameIndex:name_index
   600         nameIndex:name_index
   587         pool:constants
   601         pool:constants
   588         slotIndex:constSlot
   602         slotIndex:constSlot
  1135 ! !
  1149 ! !
  1136 
  1150 
  1137 !JavaClassReader class methodsFor:'documentation'!
  1151 !JavaClassReader class methodsFor:'documentation'!
  1138 
  1152 
  1139 version
  1153 version
  1140     ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaClassReader.st,v 1.16 1996/05/06 10:06:15 cg Exp $'
  1154     ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaClassReader.st,v 1.17 1996/05/06 14:21:28 cg Exp $'
  1141 ! !
  1155 ! !
  1142 JavaClassReader initialize!
  1156 JavaClassReader initialize!