/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2001-2011 Hartmut Kaiser Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #if !defined(BOOST_SPIRIT_CONJURE_IDS_HPP) #define BOOST_SPIRIT_CONJURE_IDS_HPP namespace client { struct op_type { enum type { binary = 0x20000, unary = 0x40000, assign = 0x80000 }; }; struct op { enum type { // binary comma, assign, plus_assign, minus_assign, times_assign, divide_assign, mod_assign, bit_and_assign, bit_xor_assign, bit_or_assign, shift_left_assign, shift_right_assign, logical_or, logical_and, bit_or, bit_xor, bit_and, equal, not_equal, less, less_equal, greater, greater_equal, shift_left, shift_right, plus, minus, times, divide, mod, // unary plus_plus, minus_minus, compl_, not_, }; }; template struct make_op { static int const value = type + op; }; template struct unary_op : make_op {}; template struct binary_op : make_op {}; template struct assign_op : make_op {}; template struct binary_or_unary_op : make_op {}; struct token_ids { enum type { // pseudo tags invalid = -1, op_binary = op_type::binary, op_unary = op_type::unary, op_assign = op_type::assign, // binary / unary operators with common tokens // '+' and '-' can be binary or unary // (the lexer cannot distinguish which) plus = binary_or_unary_op::value, minus = binary_or_unary_op::value, // binary operators comma = binary_op::value, assign = assign_op::value, plus_assign = assign_op::value, minus_assign = assign_op::value, times_assign = assign_op::value, divide_assign = assign_op::value, mod_assign = assign_op::value, bit_and_assign = assign_op::value, bit_xor_assign = assign_op::value, bit_or_assign = assign_op::value, shift_left_assign = assign_op::value, shift_right_assign = assign_op::value, logical_or = binary_op::value, logical_and = binary_op::value, bit_or = binary_op::value, bit_xor = binary_op::value, bit_and = binary_op::value, equal = binary_op::value, not_equal = binary_op::value, less = binary_op::value, less_equal = binary_op::value, greater = binary_op::value, greater_equal = binary_op::value, shift_left = binary_op::value, shift_right = binary_op::value, times = binary_op::value, divide = binary_op::value, mod = binary_op::value, // unary operators with overlaps // '++' and '--' can be prefix or postfix // (the lexer cannot distinguish which) plus_plus = unary_op::value, minus_minus = unary_op::value, // unary operators compl_ = unary_op::value, not_ = unary_op::value, // misc tags identifier = op::not_ + 1, comment, whitespace, lit_uint, true_or_false }; }; } #endif