|
@@ -63,19 +63,30 @@ resourcestring
|
|
SPasTreeDestructorImpl = 'destructor implementation';
|
|
SPasTreeDestructorImpl = 'destructor implementation';
|
|
|
|
|
|
type
|
|
type
|
|
|
|
+ // Visitor pattern.
|
|
|
|
+ TPassTreeVisitor = class;
|
|
|
|
+
|
|
|
|
+ TPasElementBase = class
|
|
|
|
+ procedure Accept(Visitor: TPassTreeVisitor); virtual; abstract;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
|
|
TPasModule = class;
|
|
TPasModule = class;
|
|
|
|
|
|
TPasMemberVisibility = (visDefault, visPrivate, visProtected, visPublic,
|
|
TPasMemberVisibility = (visDefault, visPrivate, visProtected, visPublic,
|
|
visPublished, visAutomated);
|
|
visPublished, visAutomated);
|
|
|
|
|
|
|
|
+ TCallingConvention = (ccDefault,ccRegister,ccPascal,ccCDecl,ccStdCall,ccOldFPCCall,ccSafeCall);
|
|
|
|
+
|
|
TPasMemberVisibilities = set of TPasMemberVisibility;
|
|
TPasMemberVisibilities = set of TPasMemberVisibility;
|
|
TPasMemberHint = (hDeprecated,hLibrary,hPlatform);
|
|
TPasMemberHint = (hDeprecated,hLibrary,hPlatform);
|
|
TPasMemberHints = set of TPasMemberHint;
|
|
TPasMemberHints = set of TPasMemberHint;
|
|
|
|
|
|
TPTreeElement = class of TPasElement;
|
|
TPTreeElement = class of TPasElement;
|
|
|
|
|
|
- TPasElement = class
|
|
|
|
|
|
+ { TPasElement }
|
|
|
|
+
|
|
|
|
+ TPasElement = class(TPasElementBase)
|
|
private
|
|
private
|
|
FRefCount: LongWord;
|
|
FRefCount: LongWord;
|
|
FName: string;
|
|
FName: string;
|
|
@@ -94,12 +105,15 @@ type
|
|
function GetModule: TPasModule;
|
|
function GetModule: TPasModule;
|
|
function ElementTypeName: string; virtual;
|
|
function ElementTypeName: string; virtual;
|
|
function GetDeclaration(full : Boolean) : string; virtual;
|
|
function GetDeclaration(full : Boolean) : string; virtual;
|
|
|
|
+ procedure Accept(Visitor: TPassTreeVisitor); override;
|
|
property RefCount: LongWord read FRefCount;
|
|
property RefCount: LongWord read FRefCount;
|
|
property Name: string read FName write FName;
|
|
property Name: string read FName write FName;
|
|
property Parent: TPasElement read FParent;
|
|
property Parent: TPasElement read FParent;
|
|
Property Hints : TPasMemberHints Read FHints Write FHints;
|
|
Property Hints : TPasMemberHints Read FHints Write FHints;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasSection }
|
|
|
|
+
|
|
TPasSection = class(TPasElement)
|
|
TPasSection = class(TPasElement)
|
|
public
|
|
public
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
@@ -112,6 +126,8 @@ type
|
|
Functions, Variables, Properties: TList;
|
|
Functions, Variables, Properties: TList;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasModule }
|
|
|
|
+
|
|
TPasModule = class(TPasElement)
|
|
TPasModule = class(TPasElement)
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
@@ -122,6 +138,8 @@ type
|
|
PackageName: string;
|
|
PackageName: string;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasPackage }
|
|
|
|
+
|
|
TPasPackage = class(TPasElement)
|
|
TPasPackage = class(TPasElement)
|
|
public
|
|
public
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
@@ -131,6 +149,8 @@ type
|
|
Modules: TList; // List of TPasModule objects
|
|
Modules: TList; // List of TPasModule objects
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasResString }
|
|
|
|
+
|
|
TPasResString = class(TPasElement)
|
|
TPasResString = class(TPasElement)
|
|
public
|
|
public
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
@@ -139,11 +159,15 @@ type
|
|
Value: string;
|
|
Value: string;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasType }
|
|
|
|
+
|
|
TPasType = class(TPasElement)
|
|
TPasType = class(TPasElement)
|
|
public
|
|
public
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasPointerType }
|
|
|
|
+
|
|
TPasPointerType = class(TPasType)
|
|
TPasPointerType = class(TPasType)
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
@@ -153,6 +177,8 @@ type
|
|
DestType: TPasType;
|
|
DestType: TPasType;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasAliasType }
|
|
|
|
+
|
|
TPasAliasType = class(TPasType)
|
|
TPasAliasType = class(TPasType)
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
@@ -162,11 +188,15 @@ type
|
|
DestType: TPasType;
|
|
DestType: TPasType;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasTypeAliasType }
|
|
|
|
+
|
|
TPasTypeAliasType = class(TPasAliasType)
|
|
TPasTypeAliasType = class(TPasAliasType)
|
|
public
|
|
public
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasClassOfType }
|
|
|
|
+
|
|
TPasClassOfType = class(TPasAliasType)
|
|
TPasClassOfType = class(TPasAliasType)
|
|
public
|
|
public
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
@@ -174,6 +204,8 @@ type
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
+ { TPasRangeType }
|
|
|
|
+
|
|
TPasRangeType = class(TPasType)
|
|
TPasRangeType = class(TPasType)
|
|
public
|
|
public
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
@@ -182,6 +214,8 @@ type
|
|
RangeStart, RangeEnd: string;
|
|
RangeStart, RangeEnd: string;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasArrayType }
|
|
|
|
+
|
|
TPasArrayType = class(TPasType)
|
|
TPasArrayType = class(TPasType)
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
@@ -193,6 +227,8 @@ type
|
|
ElType: TPasType;
|
|
ElType: TPasType;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasFileType }
|
|
|
|
+
|
|
TPasFileType = class(TPasType)
|
|
TPasFileType = class(TPasType)
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
@@ -202,6 +238,8 @@ type
|
|
ElType: TPasType;
|
|
ElType: TPasType;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasEnumValue }
|
|
|
|
+
|
|
TPasEnumValue = class(TPasElement)
|
|
TPasEnumValue = class(TPasElement)
|
|
public
|
|
public
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
@@ -211,6 +249,8 @@ type
|
|
AssignedValue : string;
|
|
AssignedValue : string;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasEnumType }
|
|
|
|
+
|
|
TPasEnumType = class(TPasType)
|
|
TPasEnumType = class(TPasType)
|
|
public
|
|
public
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
@@ -222,6 +262,8 @@ type
|
|
Values: TList; // List of TPasEnumValue objects
|
|
Values: TList; // List of TPasEnumValue objects
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasSetType }
|
|
|
|
+
|
|
TPasSetType = class(TPasType)
|
|
TPasSetType = class(TPasType)
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
@@ -233,6 +275,8 @@ type
|
|
|
|
|
|
TPasRecordType = class;
|
|
TPasRecordType = class;
|
|
|
|
|
|
|
|
+ { TPasVariant }
|
|
|
|
+
|
|
TPasVariant = class(TPasElement)
|
|
TPasVariant = class(TPasElement)
|
|
public
|
|
public
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
@@ -242,6 +286,8 @@ type
|
|
Members: TPasRecordType;
|
|
Members: TPasRecordType;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasRecordType }
|
|
|
|
+
|
|
TPasRecordType = class(TPasType)
|
|
TPasRecordType = class(TPasType)
|
|
public
|
|
public
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
@@ -260,6 +306,8 @@ type
|
|
|
|
|
|
TPasObjKind = (okObject, okClass, okInterface);
|
|
TPasObjKind = (okObject, okClass, okInterface);
|
|
|
|
|
|
|
|
+ { TPasClassType }
|
|
|
|
+
|
|
TPasClassType = class(TPasType)
|
|
TPasClassType = class(TPasType)
|
|
public
|
|
public
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
@@ -276,6 +324,8 @@ type
|
|
|
|
|
|
TArgumentAccess = (argDefault, argConst, argVar, argOut);
|
|
TArgumentAccess = (argDefault, argConst, argVar, argOut);
|
|
|
|
|
|
|
|
+ { TPasArgument }
|
|
|
|
+
|
|
TPasArgument = class(TPasElement)
|
|
TPasArgument = class(TPasElement)
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
@@ -287,6 +337,8 @@ type
|
|
Value: string;
|
|
Value: string;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasProcedureType }
|
|
|
|
+
|
|
TPasProcedureType = class(TPasType)
|
|
TPasProcedureType = class(TPasType)
|
|
public
|
|
public
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
@@ -301,6 +353,8 @@ type
|
|
Args: TList; // List of TPasArgument objects
|
|
Args: TList; // List of TPasArgument objects
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasResultElement }
|
|
|
|
+
|
|
TPasResultElement = class(TPasElement)
|
|
TPasResultElement = class(TPasElement)
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
@@ -309,6 +363,8 @@ type
|
|
ResultType: TPasType;
|
|
ResultType: TPasType;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasFunctionType }
|
|
|
|
+
|
|
TPasFunctionType = class(TPasProcedureType)
|
|
TPasFunctionType = class(TPasProcedureType)
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
@@ -326,12 +382,17 @@ type
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasTypeRef }
|
|
|
|
+
|
|
TPasTypeRef = class(TPasUnresolvedTypeRef)
|
|
TPasTypeRef = class(TPasUnresolvedTypeRef)
|
|
|
|
+ public
|
|
public
|
|
public
|
|
// function GetDeclaration(full : Boolean): string; override;
|
|
// function GetDeclaration(full : Boolean): string; override;
|
|
RefType: TPasType;
|
|
RefType: TPasType;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasVariable }
|
|
|
|
+
|
|
TPasVariable = class(TPasElement)
|
|
TPasVariable = class(TPasElement)
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
@@ -344,11 +405,16 @@ type
|
|
AbsoluteLocation : String;
|
|
AbsoluteLocation : String;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasConst }
|
|
|
|
+
|
|
TPasConst = class(TPasVariable)
|
|
TPasConst = class(TPasVariable)
|
|
|
|
+ public
|
|
public
|
|
public
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasProperty }
|
|
|
|
+
|
|
TPasProperty = class(TPasVariable)
|
|
TPasProperty = class(TPasVariable)
|
|
public
|
|
public
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
@@ -362,11 +428,15 @@ type
|
|
IsDefault, IsNodefault: Boolean;
|
|
IsDefault, IsNodefault: Boolean;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasProcedureBase }
|
|
|
|
+
|
|
TPasProcedureBase = class(TPasElement)
|
|
TPasProcedureBase = class(TPasElement)
|
|
public
|
|
public
|
|
function TypeName: string; virtual; abstract;
|
|
function TypeName: string; virtual; abstract;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasOverloadedProc }
|
|
|
|
+
|
|
TPasOverloadedProc = class(TPasProcedureBase)
|
|
TPasOverloadedProc = class(TPasProcedureBase)
|
|
public
|
|
public
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
@@ -377,7 +447,19 @@ type
|
|
Overloads: TList; // List of TPasProcedure nodes
|
|
Overloads: TList; // List of TPasProcedure nodes
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ TProcedureModifier = (pmVirtual, pmDynamic, pmAbstract, pmOverride,
|
|
|
|
+ pmExported, pmOverload, pmMessage, pmReintroduce,
|
|
|
|
+ pmStatic,pmInline,pmAssembler,pmVarargs,
|
|
|
|
+ pmCompilerProc,pmExternal,pmExtdecl);
|
|
|
|
+ TProcedureModifiers = Set of TProcedureModifier;
|
|
|
|
+ TProcedureMessageType = (pmtInteger,pmtString);
|
|
|
|
+
|
|
TPasProcedure = class(TPasProcedureBase)
|
|
TPasProcedure = class(TPasProcedureBase)
|
|
|
|
+ Private
|
|
|
|
+ FCallingConvention : TCallingConvention;
|
|
|
|
+ FModifiers : TProcedureModifiers;
|
|
|
|
+ FMessageName : String;
|
|
|
|
+ FMessageType : TProcedureMessageType;
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
@@ -385,9 +467,21 @@ type
|
|
function GetDeclaration(full: Boolean): string; override;
|
|
function GetDeclaration(full: Boolean): string; override;
|
|
procedure GetModifiers(List: TStrings);
|
|
procedure GetModifiers(List: TStrings);
|
|
public
|
|
public
|
|
- ProcType: TPasProcedureType;
|
|
|
|
- IsVirtual, IsDynamic, IsAbstract, IsOverride,
|
|
|
|
- IsOverload, IsMessage, isReintroduced, isStatic: Boolean;
|
|
|
|
|
|
+ ProcType : TPasProcedureType;
|
|
|
|
+ Procedure AddModifier(AModifier : TProcedureModifier);
|
|
|
|
+ Function IsVirtual : Boolean;
|
|
|
|
+ Function IsDynamic : Boolean;
|
|
|
|
+ Function IsAbstract : Boolean;
|
|
|
|
+ Function IsOverride : Boolean;
|
|
|
|
+ Function IsExported : Boolean;
|
|
|
|
+ Function IsOverload : Boolean;
|
|
|
|
+ Function IsMessage: Boolean;
|
|
|
|
+ Function IsReintroduced : Boolean;
|
|
|
|
+ Function IsStatic : Boolean;
|
|
|
|
+ Property Modifiers : TProcedureModifiers Read FModifiers Write FModifiers;
|
|
|
|
+ Property CallingConvention : TCallingConvention Read FCallingConvention Write FCallingConvention;
|
|
|
|
+ Property MessageName : String Read FMessageName Write FMessageName;
|
|
|
|
+ property MessageType : TProcedureMessageType Read FMessageType Write FMessageType;
|
|
end;
|
|
end;
|
|
|
|
|
|
TPasFunction = class(TPasProcedure)
|
|
TPasFunction = class(TPasProcedure)
|
|
@@ -396,18 +490,24 @@ type
|
|
function GetDeclaration (full : boolean) : string; override;
|
|
function GetDeclaration (full : boolean) : string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasOperator }
|
|
|
|
+
|
|
TPasOperator = class(TPasProcedure)
|
|
TPasOperator = class(TPasProcedure)
|
|
public
|
|
public
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
function GetDeclaration (full : boolean) : string; override;
|
|
function GetDeclaration (full : boolean) : string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasConstructor }
|
|
|
|
+
|
|
TPasConstructor = class(TPasProcedure)
|
|
TPasConstructor = class(TPasProcedure)
|
|
public
|
|
public
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
function TypeName: string; override;
|
|
function TypeName: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasDestructor }
|
|
|
|
+
|
|
TPasDestructor = class(TPasProcedure)
|
|
TPasDestructor = class(TPasProcedure)
|
|
public
|
|
public
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
@@ -417,6 +517,8 @@ type
|
|
|
|
|
|
TPasImplBlock = class;
|
|
TPasImplBlock = class;
|
|
|
|
|
|
|
|
+ { TPasProcedureImpl }
|
|
|
|
+
|
|
TPasProcedureImpl = class(TPasElement)
|
|
TPasProcedureImpl = class(TPasElement)
|
|
public
|
|
public
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
@@ -429,12 +531,16 @@ type
|
|
Body: TPasImplBlock;
|
|
Body: TPasImplBlock;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasConstructorImpl }
|
|
|
|
+
|
|
TPasConstructorImpl = class(TPasProcedureImpl)
|
|
TPasConstructorImpl = class(TPasProcedureImpl)
|
|
public
|
|
public
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
function TypeName: string; override;
|
|
function TypeName: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasDestructorImpl }
|
|
|
|
+
|
|
TPasDestructorImpl = class(TPasProcedureImpl)
|
|
TPasDestructorImpl = class(TPasProcedureImpl)
|
|
public
|
|
public
|
|
function ElementTypeName: string; override;
|
|
function ElementTypeName: string; override;
|
|
@@ -444,11 +550,15 @@ type
|
|
TPasImplElement = class(TPasElement)
|
|
TPasImplElement = class(TPasElement)
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasImplCommand }
|
|
|
|
+
|
|
TPasImplCommand = class(TPasImplElement)
|
|
TPasImplCommand = class(TPasImplElement)
|
|
public
|
|
public
|
|
Command: string;
|
|
Command: string;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasImplCommands }
|
|
|
|
+
|
|
TPasImplCommands = class(TPasImplElement)
|
|
TPasImplCommands = class(TPasImplElement)
|
|
public
|
|
public
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
@@ -457,6 +567,8 @@ type
|
|
Commands: TStrings;
|
|
Commands: TStrings;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasImplIfElse }
|
|
|
|
+
|
|
TPasImplIfElse = class(TPasImplElement)
|
|
TPasImplIfElse = class(TPasImplElement)
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
@@ -465,6 +577,8 @@ type
|
|
IfBranch, ElseBranch: TPasImplElement;
|
|
IfBranch, ElseBranch: TPasImplElement;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasImplForLoop }
|
|
|
|
+
|
|
TPasImplForLoop = class(TPasImplElement)
|
|
TPasImplForLoop = class(TPasImplElement)
|
|
public
|
|
public
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
@@ -474,6 +588,8 @@ type
|
|
Body: TPasImplElement;
|
|
Body: TPasImplElement;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPasImplBlock }
|
|
|
|
+
|
|
TPasImplBlock = class(TPasImplElement)
|
|
TPasImplBlock = class(TPasImplElement)
|
|
public
|
|
public
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
|
@@ -487,6 +603,11 @@ type
|
|
Elements: TList; // TPasImplElement objects
|
|
Elements: TList; // TPasImplElement objects
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPassTreeVisitor }
|
|
|
|
+
|
|
|
|
+ TPassTreeVisitor = class
|
|
|
|
+ procedure Visit(obj: TPasElement); virtual;
|
|
|
|
+ end;
|
|
|
|
|
|
const
|
|
const
|
|
AccessNames: array[TArgumentAccess] of string[6] = ('', 'const ', 'var ', 'out ');
|
|
AccessNames: array[TArgumentAccess] of string[6] = ('', 'const ', 'var ', 'out ');
|
|
@@ -635,6 +756,11 @@ begin
|
|
Result := '';
|
|
Result := '';
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TPasElement.Accept(Visitor: TPassTreeVisitor);
|
|
|
|
+begin
|
|
|
|
+ Visitor.Visit(Self);
|
|
|
|
+end;
|
|
|
|
+
|
|
constructor TPasSection.Create(const AName: string; AParent: TPasElement);
|
|
constructor TPasSection.Create(const AName: string; AParent: TPasElement);
|
|
begin
|
|
begin
|
|
inherited Create(AName, AParent);
|
|
inherited Create(AName, AParent);
|
|
@@ -1457,6 +1583,58 @@ begin
|
|
DoAdd(IsMessage,' Message');
|
|
DoAdd(IsMessage,' Message');
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+Procedure TPasProcedure.AddModifier(AModifier : TProcedureModifier);
|
|
|
|
+
|
|
|
|
+begin
|
|
|
|
+ Include(FModifiers,AModifier);
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+Function TPasProcedure.IsVirtual : Boolean;
|
|
|
|
+begin
|
|
|
|
+ Result:=pmVirtual in FModifiers;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+Function TPasProcedure.IsDynamic : Boolean;
|
|
|
|
+begin
|
|
|
|
+ Result:=pmDynamic in FModifiers;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+Function TPasProcedure.IsAbstract : Boolean;
|
|
|
|
+begin
|
|
|
|
+ Result:=pmAbstract in FModifiers;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+Function TPasProcedure.IsOverride : Boolean;
|
|
|
|
+begin
|
|
|
|
+ Result:=pmOverride in FModifiers;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+Function TPasProcedure.IsExported : Boolean;
|
|
|
|
+begin
|
|
|
|
+ Result:=pmExported in FModifiers;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+Function TPasProcedure.IsOverload : Boolean;
|
|
|
|
+begin
|
|
|
|
+ Result:=pmOverload in FModifiers;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+Function TPasProcedure.IsMessage: Boolean;
|
|
|
|
+begin
|
|
|
|
+ Result:=pmMessage in FModifiers;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+Function TPasProcedure.IsReintroduced : Boolean;
|
|
|
|
+begin
|
|
|
|
+ Result:=pmReintroduce in FModifiers;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+Function TPasProcedure.IsStatic : Boolean;
|
|
|
|
+
|
|
|
|
+begin
|
|
|
|
+ Result:=pmStatic in FModifiers;
|
|
|
|
+end;
|
|
|
|
+
|
|
function TPasProcedure.GetDeclaration (full : boolean) : string;
|
|
function TPasProcedure.GetDeclaration (full : boolean) : string;
|
|
|
|
|
|
Var
|
|
Var
|
|
@@ -1550,4 +1728,13 @@ begin
|
|
Result:='';
|
|
Result:='';
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+{ TPassTreeVisitor }
|
|
|
|
+
|
|
|
|
+procedure TPassTreeVisitor.Visit(obj: TPasElement);
|
|
|
|
+begin
|
|
|
|
+ // Needs to be implemented by descendents.
|
|
|
|
+end;
|
|
|
|
+
|
|
end.
|
|
end.
|