2
0
Эх сурвалжийг харах

Initial support for Extern Types.
Added String char pointer to String conversion.
Added extern to header class instance.
Fixed generation of interface ModuleInfo lines, to properly encode escape characters.

woollybah 11 жил өмнө
parent
commit
a0220999a9
4 өөрчлөгдсөн 318 нэмэгдсэн , 204 устгасан
  1. 99 197
      ctranslator.bmx
  2. 5 0
      expr.bmx
  3. 13 7
      iparser.bmx
  4. 201 0
      type.bmx

+ 99 - 197
ctranslator.bmx

@@ -116,6 +116,9 @@ Type TCTranslator Extends TTranslator
 		If TDoubleVarPtrPtrType( ty ) Return "BBDOUBLE **"
 		If TLongVarPtrPtrType( ty ) Return "BBLONG **"
 
+		If TExternObjectType( ty ) Return "struct " + TExternObjectType( ty ).classDecl.munged
+		If TExternObjectPtrType( ty ) Return "struct " + TExternObjectPtrType( ty ).classDecl.munged + " *"
+		
 		InternalErr
 	End Method
 
@@ -159,6 +162,8 @@ Type TCTranslator Extends TTranslator
 		If TStringCharPtrType( ty ) Return "$z"
 		If TStringShortPtrType( ty ) Return "$w"
 		If TObjectVarPtrType( ty ) Return ":" + TObjectVarPtrType(ty).classDecl.ident + " Var"
+		If TExternObjectType( ty ) Return ":" + TExternObjectType(ty).classDecl.ident
+		If TExternObjectPtrType( ty ) Return ":" + TExternObjectPtrType(ty).classDecl.ident + "*"
 		InternalErr
 	End Method
 
@@ -800,6 +805,7 @@ Type TCTranslator Extends TTranslator
 			If TDoubleType( src ) Return "bbStringFromDouble"+Bra( t )
 			If TStringType( src ) Return t
 			If TStringVarPtrType( src ) Return "*" + t
+			If TStringCharPtrType( src ) Return "bbStringFromCString"+Bra( t )
 			If TVarPtrType( src ) Then
 				If TByteVarPtrType( src ) Return "bbStringFromInt"+Bra( "*" + t )
 				If TShortVarPtrType( src ) Return "bbStringFromInt"+Bra( "*" + t )
@@ -1533,204 +1539,97 @@ End Rem
 		Local classid$=classDecl.munged
 		Local superid$=classDecl.superClass.actual.munged
 
+		If Not classDecl.IsExtern() Then
+			If opt_issuperstrict Then
+				Emit "void _" + classid + "_New(BBOBJECT o);"
+				Emit "void _" + classid + "_Delete(BBOBJECT o);"
+			Else
+				Emit "int _" + classid + "_New(BBOBJECT o);"
+				Emit "int _" + classid + "_Delete(BBOBJECT o);"
+			End If
 
-		If opt_issuperstrict Then
-			Emit "void _" + classid + "_New(BBOBJECT o);"
-			Emit "void _" + classid + "_Delete(BBOBJECT o);"
-		Else
-			Emit "int _" + classid + "_New(BBOBJECT o);"
-			Emit "int _" + classid + "_Delete(BBOBJECT o);"
-		End If
-
-		If classHasFunction(classDecl, "ToString") Then
-			Emit "BBSTRING _" + classid + "_ToString(BBOBJECT o);"
-		End If
-		
-		If classHasFunction(classDecl, "Compare") Then
-			Emit "BBINT _" + classid + "_ObjectCompare(BBOBJECT o, BBOBJECT otherObject);"
-		End If
+			If classHasFunction(classDecl, "ToString") Then
+				Emit "BBSTRING _" + classid + "_ToString(BBOBJECT o);"
+			End If
 
-		If classHasFunction(classDecl, "SendMessage") Then
-			Emit "void _" + classid + "_SendMessage(BBOBJECT o, BBOBJECT message, BBOBJECT source);"
-		End If
+			If classHasFunction(classDecl, "Compare") Then
+				Emit "BBINT _" + classid + "_ObjectCompare(BBOBJECT o, BBOBJECT otherObject);"
+			End If
 
-		Local reserved:String = ",New,Delete,ToString,Compare,SendMessage,_reserved1_,_reserved2_,_reserved3_,".ToLower()
-		
-		'Local fdecls:TFuncDecl[] = classDecl.GetAllFuncDecls(Null, False)
-		For Local decl:TDecl=EachIn classDecl.Decls()
-		'For Local fdecl:TFuncDecl = EachIn fdecls
-		
-			Local fdecl:TFuncDecl =TFuncDecl( decl )
-			If fdecl
-				If reserved.Find("," + fdecl.ident.ToLower() + ",") = -1 Then
-					EmitClassFuncProto( fdecl )
-					Continue
-				End If
-			EndIf
-			
-			'Local gdecl:TGlobalDecl =TGlobalDecl( decl )
-			'If gdecl
-			'	Emit "static "+TransRefType( gdecl.ty )+" "+gdecl.munged+";"
-			'	Continue
-			'EndIf
-		Next
+			If classHasFunction(classDecl, "SendMessage") Then
+				Emit "void _" + classid + "_SendMessage(BBOBJECT o, BBOBJECT message, BBOBJECT source);"
+			End If
 
-		Emit ""
+			Local reserved:String = ",New,Delete,ToString,Compare,SendMessage,_reserved1_,_reserved2_,_reserved3_,".ToLower()
 
-		' emit the class structure
-		Emit "struct BBClass_" + classid + " {"
-		If classDecl.superClass.ident = "Object" Then
-			Emit "BBClass*  super;"
-		Else
-			Emit "struct BBClass_" + classDecl.superClass.munged + "*  super;"
-		End If
-		Emit "void      (*free)( BBObject *o );"
-		Emit "BBDebugScope* debug_scope;"
-		Emit "int       instance_size;"
-		Emit "void      (*ctor)( BBOBJECT o );"
-		Emit "void      (*dtor)( BBOBJECT o );"
-		Emit "BBSTRING (*ToString)( BBOBJECT x );"
-		Emit "int       (*Compare)( BBOBJECT x,BBOBJECT y );"
-		Emit "BBOBJECT (*SendMessage)( BBOBJECT m,BBOBJECT s );"
-		Emit "void      (*_reserved1_)();"
-		Emit "void      (*_reserved2_)();"
-		Emit "void      (*_reserved3_)();"
-		
-		EmitBBClassClassFuncProto(classDecl)
-		
-'		' user defined functions and methods
-'		For Local decl:TDecl=EachIn classDecl.Decls()
-'			Local fdecl:TFuncDecl =TFuncDecl( decl )
-'			If fdecl
-'				If reserved.Find(fdecl.ident.ToLower()) = -1 Then
-'					EmitBBClassFuncProto( fdecl )
-'					Continue
-'				End If
-'			EndIf
-'		Next
-		
-		
-		Emit "};~n"
-		
-		
-		
-		
-		'Emit "typedef struct " + classid + "_obj {"
-		Emit "struct " + classid + "_obj {"
-		Emit "struct BBClass_" + classid + "* clas;"
-		'Emit "int refs;"
+			'Local fdecls:TFuncDecl[] = classDecl.GetAllFuncDecls(Null, False)
+			For Local decl:TDecl=EachIn classDecl.Decls()
+			'For Local fdecl:TFuncDecl = EachIn fdecls
 
-		BeginLocalScope
-		EmitClassFieldsProto(classDecl)		
-		EndLocalScope
-'		For Local decl:TFieldDecl = EachIn classDecl.Decls()
-'			Emit "~t" + TransType(decl.declTy) + " _" + decl.ident.ToLower() + ";"
-'		Next
-		
-		'Emit "} " + classid + "_obj;"
-		Emit "};"
+				Local fdecl:TFuncDecl =TFuncDecl( decl )
+				If fdecl
+					If reserved.Find("," + fdecl.ident.ToLower() + ",") = -1 Then
+						EmitClassFuncProto( fdecl )
+						Continue
+					End If
+				EndIf
 
+				'Local gdecl:TGlobalDecl =TGlobalDecl( decl )
+				'If gdecl
+				'	Emit "static "+TransRefType( gdecl.ty )+" "+gdecl.munged+";"
+				'	Continue
+				'EndIf
+			Next
 
+			Emit ""
 
+			' emit the class structure
+			Emit "struct BBClass_" + classid + " {"
+			If classDecl.superClass.ident = "Object" Then
+				Emit "BBClass*  super;"
+			Else
+				Emit "struct BBClass_" + classDecl.superClass.munged + "*  super;"
+			End If
+			Emit "void      (*free)( BBObject *o );"
+			Emit "BBDebugScope* debug_scope;"
+			Emit "int       instance_size;"
+			Emit "void      (*ctor)( BBOBJECT o );"
+			Emit "void      (*dtor)( BBOBJECT o );"
+			Emit "BBSTRING (*ToString)( BBOBJECT x );"
+			Emit "int       (*Compare)( BBOBJECT x,BBOBJECT y );"
+			Emit "BBOBJECT (*SendMessage)( BBOBJECT m,BBOBJECT s );"
+			Emit "void      (*_reserved1_)();"
+			Emit "void      (*_reserved2_)();"
+			Emit "void      (*_reserved3_)();"
 
-		Emit "struct BBClass_" + classid + " " + classid + ";"
+			EmitBBClassClassFuncProto(classDecl)
 
-		EmitClassGlobalsProto(classDecl);
+			Emit "};~n"
 
-Rem	
-		' super class
-'		If Not classDecl.superClass Then
-'			Emit "~t&bbObjectClass,"
-'		Else
-'		If classDecl.superClass.ident = "Object" Then
-			Emit "&" + classDecl.superClass.munged + ","
-'		Else
-'			Emit "&_" + classDecl.superClass.munged + ","
-'		End If
-'		End If
-		
-		Emit "bbObjectFree,"
-		
-		Emit "0,"
-		'Emit "~t" + (OBJECT_BASE_OFFSET + classDecl.lastOffset) + ","
-		Emit "sizeof" + Bra("struct " + classid + "_obj") + ","
-		
-		
-		Emit "_" + classid + "_New,"
-		Emit "_" + classid + "_Delete,"
-		
-		If classHasFunction(classDecl, "ToString") Then
-			Emit "_" + classid + "_ToString,"
-		Else
-			Emit "bbObjectToString,"
 		End If
 		
-		If classHasFunction(classDecl, "ObjectCompare") Then
-			Emit "_" + classid + "_ObjectCompare,"
-		Else
-			Emit "bbObjectCompare,"
-		End If
-
-		If classHasFunction(classDecl, "SendMessage") Then
-			Emit "_" + classid + "_SendMessage,"
+		
+		'Emit "typedef struct " + classid + "_obj {"
+		If classDecl.IsExtern() Then
+			Emit "struct " + classid + " {"
 		Else
-			Emit "bbObjectSendMessage,"
+			Emit "struct " + classid + "_obj {"
+			Emit "struct BBClass_" + classid + "* clas;"
 		End If
-		
-		'Emit "public:"
 
-		'fields
-		'For Local decl:TDecl=EachIn classDecl.Semanted()
-		'	Local fdecl:TFieldDecl =TFieldDecl( decl )
-		'	If fdecl
-		'		Emit TransRefType( fdecl.ty )+" "+fdecl.munged+";"
-		'		Continue
-		'	EndIf
-		'Next
-
-		'fields ctor
-		'Emit classid+"();"
-
-		'methods		
-		'For Local decl:TDecl=EachIn classDecl.Semanted()
-		'
-		'	Local fdecl:TFuncDecl =TFuncDecl( decl )
-		'	If fdecl
-		'		EmitFuncProto fdecl
-		'		Continue
-		'	EndIf
-		'	
-		'	Local gdecl:TGlobalDecl =TGlobalDecl( decl )
-		'	If gdecl
-		'		Emit "static "+TransRefType( gdecl.ty )+" "+gdecl.munged+";"
-		'		Continue
-		'	EndIf
-		'Next
-
-		'gc mark
-		'Emit "void mark();"
+		BeginLocalScope
+		EmitClassFieldsProto(classDecl)		
+		EndLocalScope
 
-		Emit "bbObjectReserved,"
-		Emit "bbObjectReserved,"
-		Emit "bbObjectReserved"
+		Emit "};"
 
-		' methods/funcs
-		'reserved = "New,Delete,ToString,ObjectCompare,SendMessage".ToLower()
 
-		Local fdecls:TFuncDecl[] = classDecl.GetAllFuncDecls()
-		'For Local decl:TFuncDecl = EachIn classDecl.Decls()
-		For Local decl:TFuncDecl = EachIn fdecls
-			If reserved.Find(decl.ident.ToLower()) = -1 Then
-			
-				MungDecl decl
 
-				Emit ",_" + decl.munged
-			End If
-		Next
-		
-		Emit "};~n"
-End Rem
+		If Not classDecl.IsExtern() Then
+			Emit "extern struct BBClass_" + classid + " " + classid + ";"
 
+			EmitClassGlobalsProto(classDecl);
+		End If
 
 		' fields
 		For Local decl:TFieldDecl = EachIn classDecl.Decls()
@@ -1780,7 +1679,7 @@ End Rem
 		'	Return
 		'EndIf
 		
-		If classDecl.IsInterface()
+		If classDecl.IsInterface() Or classDecl.IsExtern()
 			Return
 		EndIf
 
@@ -2261,25 +2160,28 @@ End Rem
 		
 		
 		' functions
-		Emit "-New%()=" + Enquote("_" + classDecl.munged + "_New")
-		Emit "-Delete%()=" + Enquote("_" + classDecl.munged + "_Delete")
-		
-		Local reserved:String = ",New,Delete,ToString,Compare,SendMessage,_reserved1_,_reserved2_,_reserved3_,".ToLower()
+		If Not classDecl.IsExtern() Then
+			Emit "-New%()=" + Enquote("_" + classDecl.munged + "_New")
+			Emit "-Delete%()=" + Enquote("_" + classDecl.munged + "_Delete")
 
-		For Local decl:TDecl=EachIn classDecl.Decls()
-		
-			Local fdecl:TFuncDecl=TFuncDecl( decl )
-			If fdecl
-				If reserved.Find("," + fdecl.ident.ToLower() + ",") = -1 Then
-					EmitIfcClassFuncDecl fdecl
-				End If
-				Continue
-			EndIf
+			Local reserved:String = ",New,Delete,ToString,Compare,SendMessage,_reserved1_,_reserved2_,_reserved3_,".ToLower()
 
-		Next
-	
-		
-		Emit "}=" + Enquote(classDecl.munged), False
+			For Local decl:TDecl=EachIn classDecl.Decls()
+
+				Local fdecl:TFuncDecl=TFuncDecl( decl )
+				If fdecl
+					If reserved.Find("," + fdecl.ident.ToLower() + ",") = -1 Then
+						EmitIfcClassFuncDecl fdecl
+					End If
+					Continue
+				EndIf
+
+			Next
+
+			Emit "}=" + Enquote(classDecl.munged), False
+		Else
+			Emit "}E=0", False
+		End If
 
 		'PopMungScope
 		EndLocalScope
@@ -2553,14 +2455,14 @@ End Rem
 		' initialise stuff
 		Emit "if (!" + app.munged + "_inited) {"
 		Emit app.munged + "_inited = 1;"
-		
+
 		' register types
 		For Local decl:TDecl=EachIn app.Semanted()
 		
 			If decl.declImported Continue
 		
 			Local cdecl:TClassDecl=TClassDecl( decl )
-			If cdecl
+			If cdecl And Not cdecl.IsExtern()
 				Emit "bbObjectRegisterType(&" + cdecl.munged + ");"
 			EndIf
 		Next
@@ -2720,7 +2622,7 @@ End Rem
 
 		' module info
 		For Local info:String = EachIn app.mainModule.modInfo
-			Emit "ModuleInfo ~q" + info + "~q"
+			Emit "ModuleInfo " + BmxEnquote(info)
 		Next
 		
 		Local processed:TMap = New TMap

+ 5 - 0
expr.bmx

@@ -842,6 +842,11 @@ Type TCastExpr Extends TExpr
 				Return Self
 			End If
 		End If
+		
+		If TStringCharPtrType(src) And TStringType(ty) Then
+			exprType = ty
+			Return Self
+		End If
 
 		If Not exprType
 			Err "Cannot convert from "+src.ToString()+" to "+ty.ToString()+"."

+ 13 - 7
iparser.bmx

@@ -251,17 +251,23 @@ DebugLog "FILE NOT FOUND : " + ipath
 							class.attrs :| DECL_ABSTRACT
 						Else If CParse("AF")
 							class.attrs :| DECL_ABSTRACT | DECL_FINAL
+						Else If CParse("E")
+							class.attrs :| DECL_EXTERN
 						End If
 'DebugStop
 						If CParse( "=" )
 'DebugStop
-							class.munged=ParseStringLit()
-
-							If class.ident <> "String" Then
-								For Local fdecl:TFieldDecl = EachIn class._decls
-									fdecl.munged = "_" + class.munged + "_" + fdecl.ident
-									fdecl.munged = fdecl.munged.ToLower()
-								Next
+							If Not class.IsExtern() Then
+								class.munged=ParseStringLit()
+
+								If class.ident <> "String" Then
+									For Local fdecl:TFieldDecl = EachIn class._decls
+										fdecl.munged = "_" + class.munged + "_" + fdecl.ident
+										fdecl.munged = fdecl.munged.ToLower()
+									Next
+								End If
+							Else
+								Parse "0"
 							End If
 						EndIf
 

+ 201 - 0
type.bmx

@@ -129,6 +129,8 @@ Type TType
 
 		If TStringType(ty) Return stringPointerType
 		
+		If TIdentType(ty) Return TIdentType(ty).CopyToPointer(New TIdentPtrType)
+		
 		' pointer pointer
 		If TBytePtrType(ty) Return bytePointerPtrType
 		If TIntPtrType(ty) Return intPointerPtrType
@@ -528,6 +530,12 @@ Type TIdentType Extends TType
 		dst.args = args
 		Return dst
 	End Method
+
+	Method CopyToPointer:TIdentPtrType(dst:TIdentPtrType)
+		dst.ident = ident
+		dst.args = args
+		Return dst
+	End Method
 	
 	Method ActualType:TType()
 		InternalErr
@@ -591,9 +599,104 @@ Type TIdentType Extends TType
 		
 		Return ty
 	End Method
+
+	Method SemantClass:TClassDecl()
+		Local ty:TObjectType=TObjectType( Semant() )
+		If Not ty Err "Type is not a class"
+		Return ty.classDecl
+	End Method
+
+	Method ToString$()
+		Local t$
+		For Local arg:TIdentType=EachIn args
+			If t t:+","
+			t:+arg.ToString()
+		Next
+		If t Return "$"+ident+"<"+t.Replace("$","")+">"
+		Return "$"+ident
+	End Method
+End Type
+
+
+Type TIdentPtrType Extends TPointerType
+	Field ident$
+	Field args:TType[]
+	
+	Method Create:TIdentPtrType( ident$,args:TType[] = Null )
+		Self.ident=ident
+		If args = Null Then
+			Self.args = New TType[0]
+		Else
+			Self.args=args
+		End If
+		Return Self
+	End Method
+	
+	Method ActualType:TType()
+		InternalErr
+	End Method
+	
+	Method EqualsType:Int( ty:TType )
+		InternalErr
+	End Method
+	
+	Method ExtendsType:Int( ty:TType )
+		InternalErr
+	End Method
 	
+	'Method Semant:TType()
+	'	If ident Return New TObjectType.Create( FindClass() )
+	'	Return New TObjectType.Create( TClassDecl.nullObjectClass )
+	'End Method
 	
 	
+	Method Semant:TType()
+		If Not ident Return TClassDecl.nullObjectClass.objectType
+
+		Local targs:TType[args.Length]
+		For Local i:Int=0 Until args.Length
+			targs[i]=args[i].Semant()
+		Next
+		
+		Local tyid$,ty:TType
+		Local i:Int=ident.FindLast( "." )
+		
+		If i=-1
+			tyid=ident
+			ty=_env.FindType( tyid,targs )
+
+			' finally scan all modules for it
+			If Not ty Then
+				For Local mdecl:TModuleDecl = EachIn _appInstance.globalImports.Values()
+					ty=mdecl.FindType( tyid,targs )
+					If ty Exit
+				Next
+			End If
+		Else
+			' try scope search first
+			tyid=ident[..i]
+			ty=_env.FindType( tyid,targs )
+
+			If Not ty Then
+				' no? now try module search
+				Local modid$=ident[..i]
+				Local mdecl:TModuleDecl=_env.FindModuleDecl( modid )
+				If Not mdecl Err "Module '"+modid+"' not found"
+				tyid=ident[i+1..]
+				ty=mdecl.FindType( tyid,targs )
+			End If
+		EndIf
+		If Not ty Err "Type '"+tyid+"' not found"
+		
+		If TIdentPtrType(Self) And TObjectType(ty) Then
+
+			If Not (TObjectType(ty).classDecl.attrs & DECL_EXTERN) Err "Only Extern Types can be used in this way."
+
+			ty = New TExternObjectPtrType.Create(TObjectType(ty).classDecl)
+		End If
+		
+		Return ty
+	End Method
 Rem
 	Method FindClass:TClassDecl()
 	
@@ -1231,6 +1334,104 @@ Type TObjectVarPtrType Extends TVarPtrType
 	End Method
 End Type
 
+Type TExternObjectType Extends TType
+	Field classDecl:TClassDecl
+	
+	Method Create:TExternObjectType( classDecl:TClassDecl )
+		Self.classDecl=classDecl
+		Return Self
+	End Method
+	
+	Method ActualType:TType()
+		If classDecl.actual=classDecl Return Self
+		Return New TExternObjectType.Create( TClassDecl(classDecl.actual) )
+	End Method
+	
+	Method EqualsType:Int( ty:TType )
+		Local objty:TObjectType=TObjectType( ty )
+		Return TNullDecl(classDecl) <> Null Or (objty And (classDecl=objty.classDecl Or classDecl.ExtendsClass( objty.classDecl ))) Or TObjectType(ty)
+	End Method
+	
+	Method ExtendsType:Int( ty:TType )
+		Local objty:TObjectType=TObjectType( ty )
+		If objty Return classDecl.ExtendsClass( objty.classDecl )
+		If TBytePtrType( ty ) Return True
+		Local op$
+		If TBoolType( ty )
+			op="ToBool"
+		Else If TIntType( ty ) 
+			op="ToInt"
+		Else If TFloatType( ty )
+			op="ToFloat"
+		Else If TStringType( ty )
+			op="ToString"
+		Else If TLongType( ty ) ' BaH Long
+			op="ToLong"
+		Else
+			Return False
+		EndIf
+		Local fdecl:TFuncDecl=GetClass().FindFuncDecl( op,Null,True )
+		Return fdecl And fdecl.IsMethod() And fdecl.retType.EqualsType( ty )
+	End Method
+	
+	Method GetClass:TClassDecl()
+		Return classDecl
+	End Method
+	
+	Method ToString$()
+		Return classDecl.ToString()
+	End Method
+End Type
+
+Type TExternObjectPtrType Extends TPointerType
+	Field classDecl:TClassDecl
+	
+	Method Create:TExternObjectPtrType( classDecl:TClassDecl )
+		Self.classDecl=classDecl
+		Return Self
+	End Method
+	
+	Method ActualType:TType()
+		If classDecl.actual=classDecl Return Self
+		Return New TExternObjectPtrType.Create( TClassDecl(classDecl.actual) )
+	End Method
+	
+	Method EqualsType:Int( ty:TType )
+		Local objty:TObjectType=TObjectType( ty )
+		Return TNullDecl(classDecl) <> Null Or (objty And (classDecl=objty.classDecl Or classDecl.ExtendsClass( objty.classDecl ))) Or TPointerType( ty )<>Null Or TObjectType(ty)
+	End Method
+	
+	Method ExtendsType:Int( ty:TType )
+		Local objty:TObjectType=TObjectType( ty )
+		If objty Return classDecl.ExtendsClass( objty.classDecl )
+		If TBytePtrType( ty ) Return True
+		Local op$
+		If TBoolType( ty )
+			op="ToBool"
+		Else If TIntType( ty ) 
+			op="ToInt"
+		Else If TFloatType( ty )
+			op="ToFloat"
+		Else If TStringType( ty )
+			op="ToString"
+		Else If TLongType( ty ) ' BaH Long
+			op="ToLong"
+		Else
+			Return False
+		EndIf
+		Local fdecl:TFuncDecl=GetClass().FindFuncDecl( op,Null,True )
+		Return fdecl And fdecl.IsMethod() And fdecl.retType.EqualsType( ty )
+	End Method
+	
+	Method GetClass:TClassDecl()
+		Return classDecl
+	End Method
+	
+	Method ToString$()
+		Return classDecl.ToString()
+	End Method
+End Type
+
 Type TFunctionPtrType Extends TPointerType
 
 	Field func:TFuncDecl