* Patch from Inoussa OUEDRAOGO to make it compilable with Delphi (WST has support for Delphi)

git-svn-id: trunk@8346 -
This commit is contained in:
michael 2007-08-31 23:18:34 +00:00
parent a5ff6ec116
commit 2d8d8b1cac
4 changed files with 51 additions and 19 deletions

View File

@ -82,6 +82,8 @@ type
public
SourceFilename: string;
SourceLinenumber: Integer;
Visibility: TPasMemberVisibility;
public
constructor Create(const AName: string; AParent: TPasElement); virtual;
procedure AddRef;
procedure Release;
@ -90,7 +92,6 @@ type
function GetModule: TPasModule;
function ElementTypeName: string; virtual;
function GetDeclaration(full : Boolean) : string; virtual;
Visibility: TPasMemberVisibility;
property RefCount: LongWord read FRefCount;
property Name: string read FName write FName;
property Parent: TPasElement read FParent;
@ -103,6 +104,7 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
procedure AddUnitToUsesList(const AUnitName: string);
public
UsesList: TList; // TPasUnresolvedTypeRef or TPasModule elements
Declarations, ResStrings, Types, Consts, Classes,
Functions, Variables: TList;
@ -113,6 +115,7 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function GetDeclaration(full : boolean) : string; override;
public
InterfaceSection, ImplementationSection: TPasSection;
PackageName: string;
end;
@ -122,6 +125,7 @@ type
constructor Create(const AName: string; AParent: TPasElement); override;
destructor Destroy; override;
function ElementTypeName: string; override;
public
Modules: TList; // List of TPasModule objects
end;
@ -129,6 +133,7 @@ type
public
function ElementTypeName: string; override;
function GetDeclaration(full : Boolean) : string; Override;
public
Value: string;
end;
@ -142,6 +147,7 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function GetDeclaration(full : Boolean): string; override;
public
DestType: TPasType;
end;
@ -150,6 +156,7 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function GetDeclaration(full : Boolean): string; override;
public
DestType: TPasType;
end;
@ -169,6 +176,7 @@ type
public
function ElementTypeName: string; override;
function GetDeclaration(full : boolean) : string; override;
public
RangeStart, RangeEnd: string;
end;
@ -177,6 +185,7 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function GetDeclaration(full : boolean) : string; override;
public
IndexRange : string;
IsPacked : Boolean; // 12/04/04 - Dave - Added
ElType: TPasType;
@ -187,12 +196,14 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function GetDeclaration(full : boolean) : string; override;
public
ElType: TPasType;
end;
TPasEnumValue = class(TPasElement)
public
function ElementTypeName: string; override;
public
IsValueUsed: Boolean;
Value: Integer;
AssignedValue : string;
@ -205,6 +216,7 @@ type
function ElementTypeName: string; override;
function GetDeclaration(full : boolean) : string; override;
Procedure GetEnumNames(Names : TStrings);
public
Values: TList; // List of TPasEnumValue objects
end;
@ -213,6 +225,7 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function GetDeclaration(full : boolean) : string; override;
public
EnumType: TPasType;
end;
@ -222,6 +235,7 @@ type
public
constructor Create(const AName: string; AParent: TPasElement); override;
destructor Destroy; override;
public
Values: TStringList;
Members: TPasRecordType;
end;
@ -232,6 +246,7 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function GetDeclaration(full : boolean) : string; override;
public
IsPacked: Boolean;
Members: TList; // array of TPasVariable elements
VariantName: string;
@ -247,6 +262,7 @@ type
constructor Create(const AName: string; AParent: TPasElement); override;
destructor Destroy; override;
function ElementTypeName: string; override;
public
ObjKind: TPasObjKind;
AncestorType: TPasType; // TPasClassType or TPasUnresolvedTypeRef
IsPacked: Boolean; // 12/04/04 - Dave - Added
@ -261,6 +277,7 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function GetDeclaration(full : boolean) : string; override;
public
Access: TArgumentAccess;
ArgType: TPasType;
Value: string;
@ -272,11 +289,11 @@ type
destructor Destroy; override;
class function TypeName: string; virtual;
function ElementTypeName: string; override;
IsOfObject: Boolean;
function GetDeclaration(full : boolean) : string; override;
procedure GetArguments(List : TStrings);
function CreateArgument(const AName, AUnresolvedTypeName: string):
TPasArgument;
function CreateArgument(const AName, AUnresolvedTypeName: string):TPasArgument;
public
IsOfObject: Boolean;
Args: TList; // List of TPasArgument objects
end;
@ -284,6 +301,7 @@ type
public
destructor Destroy; override;
function ElementTypeName : string; override;
public
ResultType: TPasType;
end;
@ -293,6 +311,7 @@ type
class function TypeName: string; override;
function ElementTypeName: string; override;
function GetDeclaration(Full : boolean) : string; override;
public
ResultEl: TPasResultElement;
end;
@ -314,6 +333,7 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function GetDeclaration(full : boolean) : string; override;
public
VarType: TPasType;
Value: string;
Modifiers : string;
@ -331,6 +351,7 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function GetDeclaration(full : boolean) : string; override;
public
Args: TList; // List of TPasArgument objects
IndexValue, ReadAccessorName, WriteAccessorName,
StoredAccessorName, DefaultValue: string;
@ -348,6 +369,7 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function TypeName: string; override;
public
Overloads: TList; // List of TPasProcedure nodes
end;
@ -356,9 +378,10 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function TypeName: string; override;
ProcType: TPasProcedureType;
function GetDeclaration(full: Boolean): string; override;
procedure GetModifiers(List: TStrings);
public
ProcType: TPasProcedureType;
IsVirtual, IsDynamic, IsAbstract, IsOverride,
IsOverload, IsMessage, isReintroduced, isStatic: Boolean;
end;
@ -396,6 +419,7 @@ type
destructor Destroy; override;
function ElementTypeName: string; override;
function TypeName: string; virtual;
public
ProcType: TPasProcedureType;
Locals: TList;
Body: TPasImplBlock;
@ -425,12 +449,14 @@ type
public
constructor Create(const AName: string; AParent: TPasElement); override;
destructor Destroy; override;
public
Commands: TStrings;
end;
TPasImplIfElse = class(TPasImplElement)
public
destructor Destroy; override;
public
Condition: string;
IfBranch, ElseBranch: TPasImplElement;
end;
@ -438,6 +464,7 @@ type
TPasImplForLoop = class(TPasImplElement)
public
destructor Destroy; override;
public
Variable: TPasVariable;
StartValue, EndValue: string;
Body: TPasImplElement;
@ -452,6 +479,7 @@ type
function AddIfElse(const ACondition: string): TPasImplIfElse;
function AddForLoop(AVar: TPasVariable;
const AStartValue, AEndValue: string): TPasImplForLoop;
public
Elements: TList; // TPasImplElement objects
end;
@ -473,6 +501,10 @@ implementation
uses SysUtils;
{$IFNDEF FPC}
const
LineEnding = sLineBreak;
{$ENDIF}
{ Parse tree element type name functions }

View File

@ -37,8 +37,8 @@ type
constructor Create(AStream: TStream);
destructor Destroy; override;
procedure wrt(const s: string);
procedure wrtln(const s: string);
procedure wrtln;
procedure wrtln(const s: string);overload;
procedure wrtln;overload;
procedure WriteElement(AElement: TPasElement);
procedure WriteType(AType: TPasType);
@ -60,8 +60,8 @@ type
end;
procedure WritePasFile(AElement: TPasElement; const AFilename: string);
procedure WritePasFile(AElement: TPasElement; AStream: TStream);
procedure WritePasFile(AElement: TPasElement; const AFilename: string);overload;
procedure WritePasFile(AElement: TPasElement; AStream: TStream);overload;

View File

@ -50,10 +50,10 @@ type
public
function CreateElement(AClass: TPTreeElement; const AName: String;
AParent: TPasElement; const ASourceFilename: String;
ASourceLinenumber: Integer): TPasElement;
ASourceLinenumber: Integer): TPasElement;overload;
function CreateElement(AClass: TPTreeElement; const AName: String;
AParent: TPasElement; AVisibility: TPasMemberVisibility;
const ASourceFilename: String; ASourceLinenumber: Integer): TPasElement;
const ASourceFilename: String; ASourceLinenumber: Integer): TPasElement;overload;
virtual; abstract;
function CreateFunctionType(const AName, AResultName: String; AParent: TPasElement;
UseParentAsResultParent: Boolean; const ASourceFilename: String;
@ -105,9 +105,9 @@ type
procedure ParseExc(const Msg: String);
protected
function CreateElement(AClass: TPTreeElement; const AName: String;
AParent: TPasElement): TPasElement;
AParent: TPasElement): TPasElement;overload;
function CreateElement(AClass: TPTreeElement; const AName: String;
AParent: TPasElement; AVisibility: TPasMemberVisibility): TPasElement;
AParent: TPasElement; AVisibility: TPasMemberVisibility): TPasElement;overload;
Function CheckHint(Element : TPasElement; ExpectSemiColon : Boolean) : TPasMemberHints;
public
Options : set of TPOptions;
@ -120,8 +120,8 @@ type
procedure ExpectToken(tk: TToken);
function ExpectIdentifier: String;
function ParseType(Parent: TPasElement; Prefix : String): TPasType;
function ParseType(Parent: TPasElement): TPasType;
function ParseType(Parent: TPasElement; Prefix : String): TPasType;overload;
function ParseType(Parent: TPasElement): TPasType;overload;
function ParseComplexType: TPasType;
procedure ParseArrayType(Element: TPasArrayType);
procedure ParseFileType(Element: TPasFileType);
@ -136,9 +136,9 @@ type
function ParseConstDecl(Parent: TPasElement): TPasConst;
function ParseResourcestringDecl(Parent: TPasElement): TPasResString;
function ParseTypeDecl(Parent: TPasElement): TPasType;
procedure ParseInlineVarDecl(Parent: TPasElement; VarList: TList);
procedure ParseInlineVarDecl(Parent: TPasElement; VarList: TList);overload;
procedure ParseInlineVarDecl(Parent: TPasElement; VarList: TList;
AVisibility : TPasMemberVisibility; ClosingBrace: Boolean);
AVisibility : TPasMemberVisibility; ClosingBrace: Boolean);overload;
procedure ParseVarDecl(Parent: TPasElement; List: TList);
procedure ParseArgList(Parent: TPasElement; Args: TList; EndToken: TToken);
procedure ParseProcedureOrFunctionHeader(Parent: TPasElement;

View File

@ -194,8 +194,8 @@ type
function GetCurColumn: Integer;
protected
procedure Error(const Msg: string);
procedure Error(const Msg: string; Args: array of Const);
procedure Error(const Msg: string);overload;
procedure Error(const Msg: string; Args: array of Const);overload;
function DoFetchToken: TToken;
public
Options : set of TPOptions;