public static bool IsAddOperation(Token token) { if (token == null || token.Type != TokenType.Delimiter) return false; return new List<string> { "+", "-" }.Contains(token.Value); }
public static bool IsRelationGlOperation(Token token) { if (token == null || token.Type != TokenType.Delimiter) return false; return new List<string> { "<", ">", "<=", ">=" }.Contains(token.Value); }
public static bool IsLogicalAndOrOperation(Token token) { if (token == null || token.Type != TokenType.Delimiter) return false; return new List<string> { "&&", "||" }.Contains(token.Value); }
public static bool IsBitwiseXorOrOperation(Token token) { if (token == null || token.Type != TokenType.Delimiter) return false; return new List<string> { "^", "|" }.Contains(token.Value); }
public static bool IsAssignOperation(Token token) { if (token == null || token.Type != TokenType.Delimiter) return false; return new List<string> { "=", "+=", "-=", "*=", "/=", "%=", "|=", "^=", "&=", "<<=", ">>=" }.Contains(token.Value); }
public static bool IsTypeCastOperation(Token token) { if (token == null || token.Type != TokenType.Word) return false; // TODO Support object casts // TODO Should support array casts? return new List<string> { "int", "double", "string" }.Contains(token.Value); }