20 lines
509 B
C#
20 lines
509 B
C#
namespace Bts.ArithmeticExpressions;
|
|
|
|
using System.Text;
|
|
|
|
partial class ArithmeticExpressionParserImpl {
|
|
public ArithmeticExpressionParserImpl() : base(null) { }
|
|
|
|
public ValueType Parse(Stream stream) {
|
|
Scanner = new ArithmeticExpressionScanner(stream);
|
|
Parse();
|
|
return CurrentSemanticValue;
|
|
}
|
|
|
|
public ValueType Parse(string str) {
|
|
var inputBuffer = Encoding.Default.GetBytes(str);
|
|
using var stream = new MemoryStream(inputBuffer);
|
|
return Parse(stream);
|
|
}
|
|
}
|