*** empty log message ***

This commit is contained in:
Antonio Linares
1999-10-03 07:57:19 +00:00
parent 791ea33621
commit 69a0954279
2 changed files with 53 additions and 5 deletions

View File

@@ -46,15 +46,33 @@
[ ; #translate Super : => ::<SuperClass>: ] ;
[ ; extern <SuperClass> ]
#xcommand DATA <DataName1> [,<DataNameN>] => ;
oClass:AddData( <(DataName1)> ) [; oClass:AddData( <(DataNameN)> ) ]
#xcommand DATA <DataName1> [,<DataNameN>] [ AS <type> ] [ INIT <uValue> ] => ;
[ oClass:SetType( <(type)> ) ; ][ oClass:SetInit( <uValue> ) ; ] ;
oClass:AddData( <(DataName1)> ) ;
[; oClass:AddData( <(DataNameN)> ) ] ;
[; oClass:SetInit(,<uValue>) ] [ ; oClass:SetType(,<(type)>) ]
// Note the use of commas ',' on the above two rules to avoid their call
// if there are no AS ... or INIT clauses specified. As we just use
// those methods first parameter, the second one supplied acts as a dummy one
#xcommand CLASSDATA <DataName1> [,<DataNameN>] => ;
oClass:AddClassData( <(DataName1)> ) [; oClass:AddClassData( <(DataNameN)> ) ]
#xcommand CLASSDATA <DataName1> [,<DataNameN>] [ AS <type> ] [ INIT <uValue> ] => ;
[ oClass:SetType( <(type)> ) ; ][ oClass:SetInit( <uValue> ) ; ] ;
oClass:AddClassData( <(DataName1)> ) ;
[; oClass:AddClassData( <(DataNameN)> ) ] ;
[; oClass:SetInit(,<uValue>) ] [ ; oClass:SetType(,<(type)>) ]
// Note the use of commas ',' on the above two rules to avoid their call
// if there are no AS ... or INIT clauses specified. As we just use
// those methods first parameter, the second one supplied acts as a dummy one
#xcommand METHOD <MethodName>( [<params,...>] ) [ CONSTRUCTOR ] => ;
oClass:AddMethod( <(MethodName)>, CLSMETH _CLASS_NAME_ <MethodName>() )
#xcommand METHOD <MethodName>( [<params,...>] ) BLOCK <CodeBlock> => ;
oClass:AddInline( <(MethodName)>, <CodeBlock> )
#xcommand METHOD <MethodName>( [<params,...>] ) EXTERN <FuncName>( [<params,...>] ) => ;
oClass:AddMethod( <(MethodName)>, @<FuncName>() )
#xcommand METHOD <MethodName>( [<params,...>] ) INLINE <Code,...> => ;
oClass:AddInline( <(MethodName)>, {|Self [,<params>] | <Code> } )

View File

@@ -57,7 +57,7 @@ function TClass()
static hClass := 0
if hClass == 0
hClass = __clsNew( "TCLASS", 8 )
hClass = __clsNew( "TCLASS", 10 )
__clsAddMsg( hClass, "New", @New(), MET_METHOD )
__clsAddMsg( hClass, "Create", @Create(), MET_METHOD )
@@ -67,6 +67,8 @@ function TClass()
__clsAddMsg( hClass, "AddMethod", @AddMethod(), MET_METHOD )
__clsAddMsg( hClass, "AddVirtual", @AddVirtual(), MET_METHOD )
__clsAddMsg( hClass, "Instance", @Instance(), MET_METHOD )
__clsAddMsg( hClass, "SetInit", @SetInit(), MET_METHOD )
__clsAddMsg( hClass, "SetType", @SetType(), MET_METHOD )
__clsAddMsg( hClass, "hClass", 1, MET_DATA )
__clsAddMsg( hClass, "_hClass", 1, MET_DATA )
@@ -84,6 +86,10 @@ function TClass()
__clsAddMsg( hClass, "_aVirtuals", 7, MET_DATA )
__clsAddMsg( hClass, "cSuper", 8, MET_DATA )
__clsAddMsg( hClass, "_cSuper", 8, MET_DATA )
__clsAddMsg( hClass, "uInit", 9, MET_DATA )
__clsAddMsg( hClass, "_uInit", 9, MET_DATA )
__clsAddMsg( hClass, "cType", 10, MET_DATA )
__clsAddMsg( hClass, "_cType", 10, MET_DATA )
endif
return __clsInst( hClass )
@@ -181,6 +187,10 @@ static function AddData( cData, xInit ) /* xInit is initializer */
local Self := QSelf()
if ::uInit != nil
xInit = ::uInit
endif
AAdd( ::aDatas, { cData, xInit } )
return nil
@@ -226,3 +236,23 @@ static function AddVirtual( cMethod )
return nil
//----------------------------------------------------------------------------//
static function SetInit( uValue )
local Self := QSelf()
::uInit = uValue
return nil
//----------------------------------------------------------------------------//
static function SetType( cType )
local Self := QSelf()
::cType = cType
return nil
//----------------------------------------------------------------------------//