All lex/yacc scanners/parsers are now generated with a proper dotnet nuget pkg, YaccLexTools. * Implements BooleanExpressionFilter with the new Parser.
27 lines
796 B
C#
27 lines
796 B
C#
namespace Bts.ColumnMapExpressions;
|
|
|
|
using Bts.ExpressionCore;
|
|
|
|
using System.Collections.Immutable;
|
|
|
|
public class ColumnMapExpression {
|
|
public ColumnMapExpression(ImmutableDictionary<string, string> columns, bool isInclusive) {
|
|
Columns = columns;
|
|
IsInclusive = isInclusive;
|
|
}
|
|
|
|
public ImmutableDictionary<string, string> Columns { get; }
|
|
public bool IsInclusive { get; }
|
|
|
|
public static ColumnMapExpression? Parse(string expression) =>
|
|
new Parser().Parse(expression);
|
|
|
|
public static ColumnMapExpression? Parse(Stream expression) =>
|
|
new Parser().Parse(expression);
|
|
|
|
class Parser : IParser<ColumnMapExpression?> {
|
|
public ColumnMapExpression? Parse(Stream expression) =>
|
|
new ColumnMapExpressionParser().Parse(expression)?.Expression;
|
|
}
|
|
}
|