public bool IsIdentifier() { if (_builder.IsEmpty) { return(false); } var body = _builder.Body; if (!VariableFactory.CheckSymbol(body[0])) { return(false); } for (var i = 1; i < body.Length; i++) { if (!VariableFactory.CheckSymbol(body[i]) && (!NumberFactory.CheckSymbol(body[i]) || body[i].Equals(NumberFactory.DecimalSeparator))) { return(false); } } return(true); }
private static SymbolType GetSymbolType(char value) { if (NumberFactory.CheckSymbol(value)) { return(SymbolType.Number); } if (OperatorFactory.CheckSymbol(value)) { return(SymbolType.Operator); } if (VariableFactory.CheckSymbol(value)) { return(SymbolType.Identifier); } return(SymbolType.Undefined); }