using System; namespace MathInterpreter.Core; /// /// Provides utility methods for scanning character streams for certain parts of a maths expression /// public static class ExpressionScanner { /// /// Scans the given expression for an operator (+, -, *, /) /// /// Expression to process /// A scan result containing the operator found and the remaining part of the expression /// Thrown if none or an unknown operator is found public static ScanResult ScanOperator(ReadOnlySpan expression) { // TODO throw new NotImplementedException(); } /// /// Scans the given expression for an operand which is a number which have to have an integral /// part and may have a fractional part. It may also have a sign (+, -) in front of it. /// /// Expression to process /// A scan result containing the parsed number and the remaining part expression /// Thrown if a problem with the format of the number is found public static ScanResult ScanOperand(ReadOnlySpan expression) { // TODO throw new NotImplementedException(); } /// /// Scans the given expression for a whole number which may have a sign (+, -) in front of it /// /// Expression to process /// Flag indicating if a pre-fix sign (+, -) is allowed or not /// A scan result containing the parsed number and the remaining part expression /// Thrown if no or an invalid number is found public static ScanResult ScanNumber(ReadOnlySpan expression, bool allowSign) { // TODO throw new NotImplementedException(); } }