function GetStr(Index: Integer): string;
procedure SetExtra(Index: Integer; const Value: string);
function GetItem(Index: Integer): TSsMarkUp;
+ procedure Clear;
+ procedure Add(Pos: Integer; MarkUpType: TSsMarkUpType; Str: string;
+ Extra: string = '');
protected
property Item[Index: Integer]: TSsMarkUp read GetItem;
public
constructor Create(const InputString: string);
destructor Destroy; override;
- procedure Clear;
- procedure Add(Pos: Integer; MarkUpType: TSsMarkUpType; Str: string;
- Extra: string = '');
function MarkUpAt(const Pos: Integer): Integer;
property Count: Integer read GetCount;
property MarkUpType[Index: Integer]: TSsMarkUpType read GetMarkUpType;
property InputString: string read FInputString; // Cannot Write
end;
- TSsParser = class(TComponent)
+ // Notes to user:
+ // This class has been modified so that it can handle multiple parsing
+ // results, but this class is NOT thread-safe.
+ // If you want to parse scripts within more than one thread,
+ // separate parser instance should be prepared for each thread.
+ TSsParser = class(TComponent)
private
FTagPattern: TStrings; //SakuraScript tag pattern string
FMetaPattern: TStrings; //SakuraScript meta expression pattern string
function EscapeParam(const Param: string): string;
function MarkUpAt(const Pos: integer): integer;
+ function Parse(const Script: string): TSsParseResult;
+
{ These properties are deprecated. }
property Count: integer read GetCount;
property MarkUpType[Index: integer]: TSsMarkUpType read GetMarkUpType;
if not Matched then Result := 0;
end;
+function TSsParser.Parse(const Script: string): TSsParseResult;
+begin
+ Result := TSsParseResult.Create(Script);
+ BeginParse(Result);
+end;
+
procedure TSsParser.SetExtra(Index: integer; const Value: string);
begin
FBuffList.Extra[Index] := Value;