浏览代码

remove javalib

Simon Krajewski 2 年之前
父节点
当前提交
7f292702ff
共有 4 个文件被更改,包括 82 次插入85 次删除
  1. 79 0
      src/codegen/jClass.ml
  2. 1 83
      src/codegen/javaModern.ml
  3. 1 1
      src/context/nativeLibraries.ml
  4. 1 1
      src/dune

+ 79 - 0
src/codegen/jClass.ml

@@ -0,0 +1,79 @@
+open Globals
+
+type jwildcard =
+	| WExtends (* + *)
+	| WSuper (* -  *)
+	| WNone
+
+type jtype_argument =
+	| TType of jwildcard * jsignature
+	| TAny (* * *)
+
+and jsignature =
+	| TByte (* B *)
+	| TChar (* C *)
+	| TDouble (* D *)
+	| TFloat (* F *)
+	| TInt (* I *)
+	| TLong (* J *)
+	| TShort (* S *)
+	| TBool (* Z *)
+	| TObject of path * jtype_argument list (* L Classname *)
+	| TObjectInner of (string list) * (string * jtype_argument list) list (* L Classname ClassTypeSignatureSuffix *)
+	| TArray of jsignature * int option (* [ *)
+	| TMethod of jmethod_signature (* ( *)
+	| TTypeParameter of string (* T *)
+
+(* ( jsignature list ) ReturnDescriptor (| V | jsignature) *)
+and jmethod_signature = jsignature list * jsignature option
+
+type jtypes = (string * jsignature option * jsignature list) list
+
+type jannotation = {
+	ann_type : jsignature;
+	ann_elements : (string * jannotation_value) list;
+}
+
+and jannotation_value =
+	| ValConst of jsignature * int
+	| ValEnum of jsignature * string (* e *)
+	| ValClass of jsignature (* c *) (* V -> Void *)
+	| ValAnnotation of jannotation (* @ *)
+	| ValArray of jannotation_value list (* [ *)
+
+type jlocal = {
+	ld_start_pc : int;
+	ld_length : int;
+	ld_name : string;
+	ld_descriptor : string;
+	ld_index : int;
+}
+
+type jattribute =
+	| AttrCode of jattribute list
+	| AttrDeprecated
+	| AttrLocalVariableTable of jlocal list
+	| AttrMethodParameters of (string * int) list
+	| AttrSignature of string
+	| AttrVisibleAnnotations of jannotation list
+	| AttrOther
+
+type jfield = {
+	jf_name : string;
+	jf_flags : int;
+	jf_types : jtypes;
+	jf_descriptor : jsignature;
+	jf_attributes : jattribute list;
+	jf_code : jattribute list option;
+}
+
+type jclass = {
+	jc_path : path;
+	jc_flags : int;
+	jc_super : jsignature;
+	jc_interfaces : jsignature list;
+	jc_types : jtypes;
+	jc_fields : jfield list;
+	jc_methods : jfield list;
+	jc_attributes : jattribute list;
+}

+ 1 - 83
src/codegen/javaModern.ml

@@ -40,54 +40,9 @@ module AccessFlags = struct
 		b land (to_int flag) <> 0
 end
 
-module JDataHoldovers = struct
-	type jwildcard =
-		| WExtends (* + *)
-		| WSuper (* -  *)
-		| WNone
-
-	type jtype_argument =
-		| TType of jwildcard * jsignature
-		| TAny (* * *)
-
-	and jsignature =
-		| TByte (* B *)
-		| TChar (* C *)
-		| TDouble (* D *)
-		| TFloat (* F *)
-		| TInt (* I *)
-		| TLong (* J *)
-		| TShort (* S *)
-		| TBool (* Z *)
-		| TObject of path * jtype_argument list (* L Classname *)
-		| TObjectInner of (string list) * (string * jtype_argument list) list (* L Classname ClassTypeSignatureSuffix *)
-		| TArray of jsignature * int option (* [ *)
-		| TMethod of jmethod_signature (* ( *)
-		| TTypeParameter of string (* T *)
-
-	(* ( jsignature list ) ReturnDescriptor (| V | jsignature) *)
-	and jmethod_signature = jsignature list * jsignature option
-
-	type jtypes = (string * jsignature option * jsignature list) list
-
-	type jannotation = {
-		ann_type : jsignature;
-		ann_elements : (string * jannotation_value) list;
-	}
-
-	and jannotation_value =
-		| ValConst of jsignature * int
-		| ValEnum of jsignature * string (* e *)
-		| ValClass of jsignature (* c *) (* V -> Void *)
-		| ValAnnotation of jannotation (* @ *)
-		| ValArray of jannotation_value list (* [ *)
-end
-
-open JDataHoldovers
+open JClass
 
 module JReaderHoldovers = struct
-	open JDataHoldovers
-
 	let rec parse_type_parameter_part s = match s.[0] with
 		| '*' -> TAny, 1
 		| c ->
@@ -268,43 +223,6 @@ module JReaderModern = struct
 		name_and_types : (string * string) array;
 	}
 
-	type jlocal = {
-		ld_start_pc : int;
-		ld_length : int;
-		ld_name : string;
-		ld_descriptor : string;
-		ld_index : int;
-	}
-
-	type jattribute =
-		| AttrCode of jattribute list
-		| AttrDeprecated
-		| AttrLocalVariableTable of jlocal list
-  		| AttrMethodParameters of (string * int) list
-		| AttrSignature of string
-		| AttrVisibleAnnotations of jannotation list
-  		| AttrOther
-
-	type jfield = {
-		jf_name : string;
-		jf_flags : int;
-		jf_types : jtypes;
-		jf_descriptor : jsignature;
-		jf_attributes : jattribute list;
-		jf_code : jattribute list option;
-	}
-
-	type jclass = {
-		jc_path : path;
-		jc_flags : int;
-		jc_super : jsignature;
-		jc_interfaces : jsignature list;
-		jc_types : jtypes;
-		jc_fields : jfield list;
-		jc_methods : jfield list;
-		jc_attributes : jattribute list;
-	}
-
 	let read_constant_pool ch =
 		let count = read_ui16 ch in
 		let strings = Array.make count "" in

+ 1 - 1
src/context/nativeLibraries.ml

@@ -41,7 +41,7 @@ class virtual ['a,'data] native_library (name : string) (file_path : string) = o
 	method virtual get_data : 'data
 end
 
-type java_lib_type = (JData.jclass * string * string) option
+type java_lib_type = (JClass.jclass * string * string) option
 type swf_lib_type = As3hl.hl_class option
 
 type native_libraries = {

+ 1 - 1
src/dune

@@ -9,7 +9,7 @@
 (library
 	(name haxe)
 	(libraries
-		extc extproc extlib_leftovers javalib mbedtls neko objsize pcre2 swflib ttflib ziplib
+		extc extproc extlib_leftovers mbedtls neko objsize pcre2 swflib ttflib ziplib
 		json
 		unix str bigarray threads dynlink
 		xml-light extlib ptmap sha