Registeres set type, enumeration type, subrange type or shortstring type by its declaration.function RegisterTypeDeclaration(LevelId: Integer; const Declaration: String): integer;Arguments
LevelIdId of namespace.DeclarationDeclaration of type.
Example
RegisterTypeDeclaration(0, 'TString5 = String[5];');
Registeres an interface type.function RegisterInterfaceType(LevelId: Integer; const TypeName: String; const GUID: TGUID): Integer;Arguments
LevelIdId of namespace.TypeNameName of interface type.GUIDGUID of interface type.
Registeres supported interface type.procedure RegisterSupportedInterface(TypeId: Integer; const GUID: TGUID);Arguments
TypeIdId of an interface type.GUIDGUID of supported interface type.
Registeres class type for paxCompiler.function RegisterClassType(LevelId: Integer; const TypeName: String; AncestorId: Integer): Integer; overload; function RegisterClassType(LevelId: Integer; C: TClass): Integer; overload;
Example
H_HostClass := RegisterClassType(0, THostClass);
Registeres class reference type for paxCompiler.function RegisterClassReferenceType(LevelId: Integer; const TypeName: String; OriginClassId: Integer): Integer;
Example
H := RegisterNamespace(0, 'Classes'); G := RegisterClassType(H, TPersistent); RegisterClassReferenceType(H, 'TPersistentClass', G);
Registers field of class type for paxCompiler.function RegisterClassTypeField(TypeId: Integer; const FieldName: String; FieldTypeID: Integer; FieldShift: Integer = -1): Integer;
Example
type THostClass = class(TComponent) Z: Integer; end; ............................. H_HostClass := RegisterClassType(0, THostClass); RegisterHeader(H_HostClass, 'constructor Create(AOwner: TComponent);', @THostClass.Create); H_Z := RegisterClassTypeField(H_HostClass, 'Z', typeINTEGER, Integer(@THostClass(nil).Z));
Registeres public property for paxCompiler.function RegisterProperty(LevelId: Integer; const PropName: String; PropTypeID, ReadId, WriteId: Integer;IsDefault: Boolean): Integer; overload; function RegisterProperty(LevelId: Integer; const Header: String): Integer; overload;
Example
H_HostClass := RegisterClassType(0, THostClass); RegisterHeader(H_HostClass, 'constructor Create(AOwner: TComponent);', @THostClass.Create); H_GetItem := RegisterHeader(H_HostClass, 'function GetItem(I, J: Integer): Integer;', @THostClass.GetItem); H_SetItem := RegisterHeader(H_HostClass, 'procedure SetItem(I, J: Integer; Value: Integer);', @THostClass.SetItem); RegisterProperty(H_HostClass, 'property Items[I, J: Integer]: Integer read GetItem write SetItem; default;');
Registeres enumeration type for paxCompiler.function RegisterEnumType(LevelId: Integer; const TypeName: String; TypeBaseId: Integer = _typeINTEGER): Integer;
Example
H_TMyEnum := RegisterEnumType(0, 'TMyEnum'); RegisterEnumValue(H_TMyEnum, 'Green', 0); RegisterEnumValue(H_TMyEnum, 'Red', 1);
Registeres a value of enumeration type.function RegisterEnumValue(EnumTypeId: Integer; const FieldName: String; const Value: Integer): Integer;
Example
H_TMyEnum := RegisterEnumType(0, 'TMyEnum'); RegisterEnumValue(H_TMyEnum, 'Green', 0); RegisterEnumValue(H_TMyEnum, 'Red', 1);
Registeres a Delphi type that has RTTI (Run time type information) for paxCompiler.function RegisterRTTIType(LevelId: Integer; pti: PTypeInfo): Integer;
Example
RegisterRTTIType(TypeInfo(TMyEnum));
Registeres type alias for paxCompiler.function RegisterTypeAlias(LevelId:Integer; const TypeName: String; OriginTypeId: Integer): Integer;
Example
RegisterTypeAlias(H, 'Longint', _typeINTEGER);
Registeres array type for paxCompiler.function RegisterArrayType(LevelId: Integer; const TypeName: String; RangeTypeId, ElemTypeId: Integer): Integer;Arguments
LevelIdId of namespace.TypeNameName of array type.RangeTypeIdId of ordinal type that specifies range of array.ElemTypeId of type that specifies type of array element.
Example
H_Range := RegisterSubrangeType(0, 'MySubrangeType', _typeCHAR, ord('A'), ord('Z')); H_TMyPoint := RegisterRecordType(0, 'TMyPoint'); RegisterRecordTypeField(H_TMyPoint, 'X', _typeINTEGER); RegisterRecordTypeField(H_TMyPoint, 'Y', _typeINTEGER); H_Array := RegisterArrayType(0, 'MyArray', H_Range, H_TMyPoint);
Registeres dynamic array type for paxCompiler. Returns id of type.function RegisterDynamicArrayType(LevelId: Integer; const TypeName: String; ElemTypeId: Integer): Integer;Arguments
LevelIdId of namespace.TypeNameName of type.ElemTypeIdId of type of array element.
Registeres a namespace for the paxCompiler.function RegisterNamespace(LevelId: Integer; const NamespaceName: String): Integer;Arguments
LevelIdId of owner namespace.NamespaceNameName of namespace.
Example
id := RegisterNamespace(0, 'MyNamespace'); // 0 represents noname namespace RegisterVariable(id, 'MyVar', _typeINTEGER, @MyVar);
Registeres a record type.function RegisterRecordType(LevelId: Integer; const TypeName: String): Integer;Arguments
LevelIdId of owner record type or id of namespace.TypeNameName of record type.
Example
H_TMyPoint := RegisterRecordType(0, 'TMyPoint'); RegisterRecordTypeField(H_TMyPoint, 'X', _typeINTEGER); RegisterRecordTypeField(H_TMyPoint, 'Y', _typeINTEGER);
Registeres header of function or procedure for paxCompiler.function RegisterRoutine(LevelId: Integer; const Name: String; ResultTypeID: Integer; CallConvention: Integer): Integer;Arguments
LevelIdId of owner namespace.NameName of procedure or function.ResultTypeIDId of result type.CallConvention_ccSTDCALL = 1 _ccREGISTER = 2
Example
H_IntToStr := RegisterRoutine(0, 'IntToStr', _typeSTRING, _ccREGISTER); RegisterParameter(H_IntToStr, _typeINTEGER, _Unassigned);
Registeres method of Delphi class.function RegisterMethod(LevelId: Integer; const MethodName: String; ResultTypeID: Integer; CallConvention: Integer; Address: Pointer = nil; IsShared: Boolean = false): Integer;Arguments
LevelIdId of class.MethodNameName of method.ResultTypeIDId of type of result.CallConventionCall convention.IsSharedTrue, if it is static (shared) method.
Example
RegisterMethod(H_HostClass, 'MyMethod', _typeINTEGER, ccREGISTER, @THostClass.MyMethod, false);
Registeres construcor of a Delphi class for paxCompiler.function RegisterConstructor(LevelId: Integer; const SubName: String; Address: Pointer = nil): Integer;
Example
H := RegisterConstructor(H_HostClass, 'Create', @THostClass.Create);
Registeres parameter of a host-defined procedure of function.function RegisterParameter(HSub: Integer; ParamTypeID: Integer; const DefaultValue: Variant; ByRef: Boolean = false): Integer;Arguments
HSubId of routine.ParamTypeIdId of type of parameter.DefaultValueDefault value of parameter.ByRefIf 'true', this is the variable parameter, otherwise this is the value parameter.
Example
H_IntToStr := RegisterRoutine(0, 'IntToStr', _typeSTRING, _ccREGISTER); RegisterParameter(H_IntToStr, _typeINTEGER, _Unassigned);
Registeres a pointer type for paxCompiler.function RegisterPointerType(LevelId: Integer; const TypeName: String; OriginTypeId: Integer): Integer;Arguments
LevelIdId of namespace.TypeNameName of pointer type.OriginTypeIdId of origin type.
Example
H_TMyPoint := RegisterRecordType(0, 'TMyPoint'); RegisterRecordTypeField(H_TMyPoint, 'X', _typeINTEGER); RegisterRecordTypeField(H_TMyPoint, 'Y', _typeINTEGER); H_PMyPoint := RegisterPointerType(0, 'PMyPoint', H_TMyPoint);
Registeres a procedural type for paxCompiler.function RegisterProceduralType(LevelId: Integer; const TypeName: String; SubId: Integer): Integer;Arguments
LevelIdId of namespace.TypeNameName of type.SubIdId of header of a subroutine.
Example
H_IntToStr := RegisterRoutine(0, 'IntToStr', _typeSTRING, _ccREGISTER); RegisterParameter(H_IntToStr, _typeINTEGER, _Unassigned); H_FuncType := RegisterProceduralType(0, 'TFuncType', H_IntToStr);
Registeres a set type for paxCompiler.function RegisterSetType(LevelId: Integer; const TypeName: String; OriginTypeId: Integer): Integer;Arguments
LevelIdId of namespace.TypeNameName of set type.OriginTypeIdId of origin type.
Example
RegisterSetType(0, 'TMySet', _typeCHAR);
Registeres a subrange type for the paxCompiler.function RegisterSubrangeType(LevelId: Integer; const TypeName: String; TypeBaseId: Integer; const B1, B2: Integer): Integer;Arguments
LevelIdId of namespace.TypeNameName of subrange type.TypeBaseIdId of base type.B1Low bound.B2High bound.
Example
RegisterSubrangeType(0, 'MySubrangeType', _typeCHAR, ord('A'), ord('Z'));
Registeres a constant for paxCompiler.function RegisterConstant(LevelId: Integer; const ConstName: String; typeID: Integer; const Value: Variant): Integer; overload; function RegisterConstant(LevelId: Integer; const ConstName: String; const Value: Variant): Integer; overload;
Example
RegisterConstant(H, 'fmOpenRead', fmOpenRead);
Registeres a host-defined variable for paxCompiler.function RegisterVariable(LevelId: Integer; const Name: String; TypeId: Integer; Address: Pointer = nil): Integer;Arguments
LevelIdId of namespaceNameName of variable.TypeIdId of variables's type.AddressOptional. Address of variable.
Example
H_MyVar := RegisterVariable(0, 'MyVar', _typeSINGLE);
Registeres header of host-defined procedure, function, constructor or method for paxCompiler.function RegisterHeader(LevelId: Integer; const Header: String; Address: Pointer = nil; MethodIndex: Integer = 0): Integer;
Example 1
RegisterHeader(H, 'function UpperCase(const S: string): string;', @UpperCase);
Example 2
RegisterHeader(H_TList, 'function Add(Item: Pointer): Integer;', @TList.Add);
Example 3
RegisterHeader(H_TList, 'constructor Create;', @TList.Create);
The ForbidPublishedProperty does not allow to use a published property of a host-defined type in scripts.procedure ForbidPublishedProperty(C: TClass; const PropName: String);
The ForbidAllPublishedProperties does not allow to use published properties of a host-defined type in scripts.procedure ForbidAllPublishedProperties(C: TClass);
Returns Id of type.function LookupTypeId(const TypeName: String): Integer;Arguments
TypeNameName of type.
Returns Id of namespace.function LookupNamespace(LevelId: Integer; const NamespaceName: String; CaseSensitive: Boolean): Integer;
Includes namespace into scope of type lookup.procedure RegisterUsingNameSpace(const aNameSpaceName: String); overload;
Removes namespace from the scope of type lookup.procedure UnregisterUsingNameSpace(const aNameSpaceName: String); overload;
Removes all namespaces from the scope of type lookup. (These namespaces could be included by RegisterUsingNamespace routine).procedure UnregisterUsingNameSpaces;
Registeres default alignment.procedure RegisterAlignment(value: Integer);Arguments
value1, 2, 4 or 8.
Sets up visibility of the host-defined class member.procedure SetVisibility(C: TClass; const MemberName: String; value: Integer);Arguments
value0 - public, 1 - protected, 2 - private.
Saves host-defined namespace (unit) to a stream.procedure SaveNamespaceToStream(const NamespaceName: String; S: TStream);Arguments
NamespaceNameName of namespace.See ..\Demos\DemoLoadNamespace in a trial package for Delphi.
Example
SaveNamespaceToStream('SysUtils', Stream);
Saves a precompiled host-defined namespace (unit) to file.procedure SaveNamespaceToFile(const NamespaceName: String; const FileName: String);See ..\Demos\DemoLoadNamespace in a trial package for Delphi.
Example
SaveNamespaceToFile('SysUtils', 'SysUtils.bin');
Loads a precompiled host-defined namespace (unit) from stream.procedure LoadNamespaceFromStream(S: TStream);See ..\Demos\DemoLoadNamespace in a trial package for Delphi.
Example
LoadNamespaceFromStream('SysUtils', Stream);
Loads a precompiled host-defined namespace from file.procedure LoadNamespaceFromFile(const FileName: String);See ..\Demos\DemoLoadNamespace in a trial package for Delphi.
Example
LoadNamespaceFromFile('SysUtils', 'SysUtils.bin');
Notifies paxCompiler that process of registration host-defined types has been finished.procedure EndOfRegistration;The routine forces paxCompiler to perform type checking in all imported members.