ROPS (Rem Object Pascal Script) - встраиваемый интерпретатор языка Pascal. Плагин PSImport_Classes
Плагин добавляет в среду интерпретатора следующие данные:
Типы (список TPSPascalCompiler.FTypes):
- TComponentStateE = Enum;
- TComponentState = Set;
- TRect = record
Left: LongInt;
Top: LongInt;
Right: LongInt;
Bottom: LongInt;
end; - TAlignment = Enum;
- THelpEvent = ProcPtr;
- TGetStrProc = ProcPtr;
- TDuplicates = Enum;
- TOperation = Enum;
- THandle = LongInt;
- TNotifyEvent = ProcPtr;
- TStream = Class;
- TStrings = Class;
- TStringList = Class;
- TBits = Class;
- THandleStream = Class;
- TFileStream = Class;
- TStringStream = Class;
- TCustomMemoryStream = Class;
- TMemoryStream = Class;
- TResourceStream = Class;
- TParser = Class;
- TCollection = Class;
- TCollectionItem = Class;
- TOwnedCollection = Class;
Константы (список TPSPascalCompiler.FConstants):
- csLoading: TComponentStateE = 0;
- csReading: TComponentStateE = 1;
- csWriting: TComponentStateE = 2;
- csDestroying: TComponentStateE = 3;
- csDesigning: TComponentStateE = 4;
- csAncestor: TComponentStateE = 5;
- csUpdating: TComponentStateE = 6;
- csFixups: TComponentStateE = 7;
- csFreeNotification: TComponentStateE = 8;
- csInline: TComponentStateE = 9;
- csDesignInstance: TComponentStateE = 10;
- soFromBeginning: LongInt = 0 (0x0);
- soFromCurrent: LongInt = 1 (0x1);
- soFromEnd: LongInt = 2 (0x2);
- toEOF: Char = #00;
- toSymbol: Char = #01;
- toString: Char = #02;
- ToInteger: Char = #03;
- toFloat: Char = #04;
- fmCreate: LongInt = 65535 (0xFFFF);
- fmOpenRead: LongInt = 0 (0x0);
- fmOpenWrite: LongInt = 1 (0x1);
- fmOpenReadWrite: LongInt = 2 (0x2);
- fmShareCompat: LongInt = 0 (0x0);
- fmShareExclusive: LongInt = 16 (0x10);
- fmShareDenyWrite: LongInt = 32 (0x20);
- fmShareDenyRead: LongInt = 48 (0x30);
- fmShareDenyNone: LongInt = 64 (0x40);
- SecsPerDay: LongInt = 86400 (0x15180);
- MSecPerDay: LongInt = 86400000 (0x5265C00);
- DateDelta: LongInt = 693594 (0xA955A);
- taLeftJustify: TAlignment = 0;
- taRightJustify: TAlignment = 1;
- taCenter: TAlignment = 2;
- dupIgnore: TDuplicates = 0;
- dupAccept: TDuplicates = 1;
- dupError: TDuplicates = 2;
- opInsert: TOperation = 0;
- opRemove: TOperation = 1;
Классы (список TPSPascalCompiler.FClasses):
- TObject = class()
constructor Create: TObject;
procedure Free;
end; - TPersistent = class(TObject)
procedure Assign(Source: TPersistent);
end; - TComponent = class(TPersistent)
function FindComponent(AName: string): TComponent;
constructor Create(AOwner: TComponent): TComponent;
property Owner: TComponent read Get write Set;
procedure DestroyComponents;
procedure Destroying;
procedure FreeNotification(AComponent: TComponent);
procedure InsertComponent(AComponent: TComponent);
procedure RemoveComponent(AComponent: TComponent);
property Components(param1: LongInt): TComponent read Get;
property ComponentCount: LongInt read Get;
property ComponentIndex: LongInt read Get write Set;
property ComponentState: Byte read Get;
property DesignInfo: LongInt read Get write Set;
property Name: string read Get write Set;
property Tag: LongInt read Get write Set;
end; - TStream = class(TObject)
function Read(Buffer: string; Count: LongInt): LongInt;
function Write(Buffer: string; Count: LongInt): LongInt;
function Seek(Offset: LongInt; Origin: Word): LongInt;
procedure ReadBuffer(Buffer: string; Count: LongInt);
procedure WriteBuffer(Buffer: string; Count: LongInt);
function CopyFrom(Source: TStream; Count: Int64): Int64;
property Position: LongInt read Get write Set;
property Size: LongInt read Get write Set;
end; - TStrings = class(TPersistent)
function Add(S: string): LongInt;
procedure Append(S: string);
procedure AddStrings(Strings: TStrings);
procedure Clear;
procedure Delete(Index: LongInt);
function IndexOf(S: string): LongInt;
procedure Insert(Index: LongInt; S: string);
property Capacity: LongInt read Get write Set;
property Delimiter: Char read Get write Set;
property DelimitedText: string read Get write Set;
property NameValueSeparator: Char read Get write Set;
property QuoteChar: Char read Get write Set;
property Count: LongInt read Get;
property Text: string read Get write Set;
property CommaText: string read Get write Set;
procedure LoadFromFile(FileName: string);
procedure SaveToFile(FileName: string);
property Strings(param1: LongInt): string read Get write Set;
property Objects(param1: LongInt): TObject read Get write Set;
procedure BeginUpdate;
procedure EndUpdate;
function Equals(Strings: TStrings): Boolean;
procedure Exchange(Index1: LongInt; Index2: LongInt);
function IndexOfName(Name: string): LongInt;
procedure LoadFromStream(Stream: TStream);
procedure Move(CurIndex: LongInt; NewIndex: LongInt);
procedure SaveToStream(Stream: TStream);
procedure SetText(Text: PChar);
property Names(param1: LongInt): string read Get;
property Values(param1: string): string read Get write Set;
property ValueFromIndex(param1: LongInt): string read Get write Set;
function AddObject(S: string; AObject: TObject): LongInt;
function GetText: PChar;
function IndexOfObject(AObject: TObject): LongInt;
procedure InsertObject(Index: LongInt; S: string; AObject: TObject);
end;
TStringList = class(TStrings)
function Find(S: string; var Index: LongInt): Boolean;
procedure Sort;
property CaseSensitive: Boolean read Get write Set;
property Duplicates: TDuplicates read Get write Set;
property Sorted: Boolean read Get write Set;
property OnChange: TNotifyEvent read Get write Set;
property OnChanging: TNotifyEvent read Get write Set;
end;
TBits = class(TObject)
function OpenBit: LongInt;
property Bits(param1: LongInt): Boolean read Get write Set;
property Size: LongInt read Get write Set;
end;
THandleStream = class(TStream)
constructor Create(AHandle: LongInt): THandleStream;
property Handle: LongInt read Get;
end;
TFileStream = class(THandleStream)
constructor Create(FileName: string; Mode: Word): TFileStream;
end;
TStringStream = class(TStream)
constructor Create(AString: string): TStringStream;
end;
TCustomMemoryStream = class(TStream)
procedure SaveToStream(Stream: TStream);
procedure SaveToFile(FileName: string);
end;
TMemoryStream = class(TCustomMemoryStream)
procedure Clear;
procedure LoadFromStream(Stream: TStream);
procedure LoadFromFile(FileName: string);
procedure SetSize(NewSize: LongInt);
end;
TResourceStream = class(TCustomMemoryStream)
constructor Create(Instance: LongInt; ResName: string; ResType: PChar): TResourceStream;
constructor CreateFromID(Instance: LongInt; ResID: LongInt; ResType: PChar): TResourceStream;
end;
TParser = class(TObject)
constructor Create(Stream: TStream): TParser;
procedure CheckToken(T: Char);
procedure CheckTokenSymbol(S: string);
procedure Error(Ident: LongInt);
procedure ErrorStr(Message: string);
procedure HexToBinary(Stream: TStream);
function NextToken: Char;
function SourcePos: LongInt;
function TokenComponentIdent: string;
function TokenFloat: Extended;
function TokenInt: LongInt;
function TokenString: string;
function TokenSymbolIs(S: string): Boolean;
property SourceLine: LongInt read Get;
property Token: Char read Get;
end;
TCollection = class(TPersistent)
function Owner: TPersistent;
function Add: TCollectionItem;
procedure BeginUpdate;
procedure Clear;
procedure Delete(Index: LongInt);
procedure EndUpdate;
function FindItemID(ID: LongInt): TCollectionItem;
function Insert(Index: LongInt): TCollectionItem;
property Count: LongInt read Get;
property Items(param1: LongInt): TCollectionItem read Get write Set;
end;
TCollectionItem = class(TPersistent)
constructor Create(Collection: TCollection): TCollectionItem;
property Collection: TCollection read Get write Set;
property ID: LongInt read Get;
property Index: LongInt read Get write Set;
property DisplayName: string read Get write Set;
end;
TOwnedCollection = class(TCollection)
end;
Зависимости
Плагин самодостаточен, и для своей работы ему достаточно только включения в список Plugins компонента PSScript.- +3
- 07 октября 2022, 20:45
- anakost
Тебе больше делать нечего кроме как дампить сюда документацию ропса, да еще и самую неинтересную ее часть?
Я привел только недокументированные особенности. Основная статья на сайте не появилась — "ROPS (Rem Object Pascal Script) — встраиваемый интерпретатор языка Pascal. Введение, состав дистрибутива, компонент PSScript".
Комментарии (3)
RSS свернуть / развернуть