Reverting Ast Stream
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
unit Myc.Ast.DataStream;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Myc.Data.Pipeline,
|
||||
Myc.Data.Scalar;
|
||||
|
||||
type
|
||||
// 1. IStreamProducer (Source)
|
||||
// Provides data. Corresponds to IProducer<T>.
|
||||
IStreamProducer = IProducer<IScalarRecordSeries>;
|
||||
|
||||
// 2. IStreamConsumer (Sink)
|
||||
// Consumes data. Corresponds to IConsumer<T>.
|
||||
IStreamConsumer = IConsumer<IScalarRecordSeries>;
|
||||
|
||||
// 3. IStreamConverter (Transform/Pipe)
|
||||
// Consumes AND provides data.
|
||||
// IMPORTANT: Inherits from IProducer, allowing safe hard-casts to IStreamProducer.
|
||||
IStreamConverter = IConverter<IScalarRecordSeries, IScalarRecordSeries>;
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
@@ -25,11 +25,7 @@ type
|
||||
stSeries,
|
||||
stRecord,
|
||||
stRecordSeries,
|
||||
stGenericRecord,
|
||||
// --- Pipeline Types ---
|
||||
stStreamProducer, // Source
|
||||
stStreamConverter, // Pipe (Source + Sink)
|
||||
stStreamConsumer // Sink
|
||||
stGenericRecord
|
||||
);
|
||||
|
||||
TStaticTypeKindHelper = record helper for TStaticTypeKind
|
||||
@@ -101,14 +97,6 @@ type
|
||||
class var
|
||||
FKeyword: IStaticType;
|
||||
|
||||
// Stream Types
|
||||
class var
|
||||
FStreamProducer: IStaticType;
|
||||
class var
|
||||
FStreamConverter: IStaticType;
|
||||
class var
|
||||
FStreamConsumer: IStaticType;
|
||||
|
||||
class constructor Create;
|
||||
public
|
||||
// Flyweight accessors
|
||||
@@ -121,11 +109,6 @@ type
|
||||
class property Text: IStaticType read FText;
|
||||
class property Keyword: IStaticType read FKeyword;
|
||||
|
||||
// Stream Accessors
|
||||
class property StreamProducer: IStaticType read FStreamProducer;
|
||||
class property StreamConverter: IStaticType read FStreamConverter;
|
||||
class property StreamConsumer: IStaticType read FStreamConsumer;
|
||||
|
||||
// Factory functions
|
||||
class function CreateSeries(const AElementType: IStaticType): IStaticType; static;
|
||||
class function CreateMethod(const AParamTypes: TArray<IStaticType>; const AReturnType: IStaticType): IStaticType; static;
|
||||
@@ -188,10 +171,6 @@ begin
|
||||
stRecord: Result := 'Record';
|
||||
stRecordSeries: Result := 'RecordSeries';
|
||||
stGenericRecord: Result := 'GenericRecord';
|
||||
// New types
|
||||
stStreamProducer: Result := 'StreamProducer';
|
||||
stStreamConverter: Result := 'StreamConverter';
|
||||
stStreamConsumer: Result := 'StreamConsumer';
|
||||
else
|
||||
Result := 'ErrorType';
|
||||
end;
|
||||
@@ -682,11 +661,6 @@ begin
|
||||
FDateTime := TSimpleStaticType.Create(stDateTime);
|
||||
FText := TSimpleStaticType.Create(stText);
|
||||
FKeyword := TSimpleStaticType.Create(stKeyword);
|
||||
|
||||
// Initialize stream types
|
||||
FStreamProducer := TSimpleStaticType.Create(stStreamProducer);
|
||||
FStreamConverter := TSimpleStaticType.Create(stStreamConverter);
|
||||
FStreamConsumer := TSimpleStaticType.Create(stStreamConsumer);
|
||||
end;
|
||||
|
||||
class function TTypes.CreateMethod(const AParamTypes: TArray<IStaticType>; const AReturnType: IStaticType): IStaticType;
|
||||
@@ -767,11 +741,6 @@ begin
|
||||
if (Target.Kind = stOrdinal) and (Source.Kind = stKeyword) then
|
||||
exit(True);
|
||||
|
||||
// Stream rules:
|
||||
// A Converter IS a Producer.
|
||||
if (Target.Kind = stStreamProducer) and (Source.Kind = stStreamConverter) then
|
||||
exit(True);
|
||||
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user