All lex/yacc scanners/parsers are now generated with a proper dotnet nuget pkg, YaccLexTools. * Implements BooleanExpressionFilter with the new Parser.
20 lines
596 B
C#
20 lines
596 B
C#
namespace Bts.DataStreamExpressions;
|
|
|
|
using BCG;
|
|
|
|
public class ViewNameExpression : StatementExpression {
|
|
readonly string id;
|
|
|
|
public ViewNameExpression(string id) =>
|
|
this.id = id;
|
|
|
|
public override string print(int startCol, IList<string> activeBindings) =>
|
|
activeBindings.IndexOf(id) != -1 ? id : "new TableStream(\"" + id + "\", db)";
|
|
|
|
public override string printView(int startCol) =>
|
|
id;
|
|
|
|
public override ViewStream? myGetView(IDictionary<string, StatementExpression> env) =>
|
|
env.TryGetValue(id, out var exp) ? exp.getView(env) : new TableStream(id);
|
|
}
|