Exemplo n.º 1
0
Arquivo: Parser.cs Projeto: DatZach/Xi
        public static bool IsAddOperation(Token token)
        {
            if (token == null || token.Type != TokenType.Delimiter)
                return false;

            return new List<string> { "+", "-" }.Contains(token.Value);
        }
Exemplo n.º 2
0
Arquivo: Parser.cs Projeto: DatZach/Xi
        public static bool IsRelationGlOperation(Token token)
        {
            if (token == null || token.Type != TokenType.Delimiter)
                return false;

            return new List<string> { "<", ">", "<=", ">=" }.Contains(token.Value);
        }
Exemplo n.º 3
0
Arquivo: Parser.cs Projeto: DatZach/Xi
        public static bool IsLogicalAndOrOperation(Token token)
        {
            if (token == null || token.Type != TokenType.Delimiter)
                return false;

            return new List<string> { "&&", "||" }.Contains(token.Value);
        }
Exemplo n.º 4
0
Arquivo: Parser.cs Projeto: DatZach/Xi
        public static bool IsBitwiseXorOrOperation(Token token)
        {
            if (token == null || token.Type != TokenType.Delimiter)
                return false;

            return new List<string> { "^", "|" }.Contains(token.Value);
        }
Exemplo n.º 5
0
Arquivo: Parser.cs Projeto: DatZach/Xi
        public static bool IsAssignOperation(Token token)
        {
            if (token == null || token.Type != TokenType.Delimiter)
                return false;

            return new List<string> { "=", "+=", "-=", "*=", "/=", "%=", "|=", "^=", "&=", "<<=", ">>=" }.Contains(token.Value);
        }
Exemplo n.º 6
0
Arquivo: Parser.cs Projeto: DatZach/Xi
        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);
        }