So we can create ViewStreams that depend on other services, config, etc. Previously, the PrimitiveManager relied purely on static construction of types through reflection.
31 lines
791 B
C#
31 lines
791 B
C#
namespace Bts.DataStreamExpressions;
|
|
|
|
using BCG;
|
|
|
|
using Bts.DataStreamCore;
|
|
|
|
public abstract class StatementExpression {
|
|
ViewStream? view;
|
|
|
|
protected StatementExpression() { }
|
|
|
|
public virtual string? print(int startCol, IList<string> activeBindings) =>
|
|
null;
|
|
|
|
public virtual string? printView(int startCol) =>
|
|
null;
|
|
|
|
public ViewStream? getView(IDictionary<string, StatementExpression> env, IDataStreamFactory streamFactory) =>
|
|
view ??= myGetView(env, streamFactory);
|
|
|
|
public virtual ViewStream? myGetView(IDictionary<string, StatementExpression> env, IDataStreamFactory streamFactory) =>
|
|
null;
|
|
|
|
public static string makeCSString(string s) {
|
|
if (s == null)
|
|
return "(string) null";
|
|
else
|
|
return "\"" + s + "\"";
|
|
}
|
|
}
|