All lex/yacc scanners/parsers are now generated with a proper dotnet nuget pkg, YaccLexTools. * Implements BooleanExpressionFilter with the new Parser.
19 lines
454 B
C#
19 lines
454 B
C#
namespace Bts.DataStreamExpressions;
|
|
|
|
using System.Text;
|
|
|
|
partial class DataStreamExpressionParser {
|
|
public DataStreamExpressionParser() : base(null) { }
|
|
|
|
public ValueType? Parse(string s) {
|
|
using var ms = new MemoryStream(Encoding.Default.GetBytes(s));
|
|
return Parse(ms);
|
|
}
|
|
|
|
public ValueType? Parse(Stream stream) {
|
|
Scanner = new DataStreamExpressionScanner(stream);
|
|
Parse();
|
|
return CurrentSemanticValue;
|
|
}
|
|
}
|