All lex/yacc scanners/parsers are now generated with a proper dotnet nuget pkg, YaccLexTools. * Implements BooleanExpressionFilter with the new Parser.
11 lines
267 B
C#
11 lines
267 B
C#
namespace Bts.ExpressionCore;
|
|
|
|
using System.Text;
|
|
|
|
public static class ParserExtensions {
|
|
public static T Parse<T>(this IParser<T> parser, string text) {
|
|
using var ms = new MemoryStream(Encoding.Default.GetBytes(text));
|
|
return parser.Parse(ms);
|
|
}
|
|
}
|