/*
 * UUID: a61871da-f300-11dc-bb01-00502c05c241
 * Author: Brian M. Ames, bames@apk.net
 * Copyright: Copyright (C) 2008 by Brian M. Ames
 */

/*
 * DEF_CHARACTER(string, bison_token, type)
 * 1 = BCS, 2 = ECS, 4 = white space, 8 = punctuation
 */

DEF_CHARACTER("nul", "\\000",ECS_NULL,2)
DEF_CHARACTER("soh", "\\001",ASC_SOH,0)
DEF_CHARACTER("stx", "\\002",ASC_STX,0)
DEF_CHARACTER("etx", "\\003",ASC_ETX,0)
DEF_CHARACTER("eot", "\\004",ASC_EOT,0)
DEF_CHARACTER("enq", "\\005",ASC_ENQ,0)
DEF_CHARACTER("ack", "\\006",ASC_ACK,0)
DEF_CHARACTER("bel", "\\007",ECS_ALERT,2)
DEF_CHARACTER("bs", "\\010",ECS_BACKSPACE,2)
DEF_CHARACTER("tab", "\\011",BCS_WHTSP_TAB,5)
DEF_CHARACTER("lf", "\\012",BCS_WHTSP_NEWLINE,5)
DEF_CHARACTER("vt", "\\013",BCS_WHTSP_VERTICAL_TAB,5)
DEF_CHARACTER("ff", "\\014",BCS_WHTSP_FORMFEED,5)
DEF_CHARACTER("cr", "\\015",ECS_CARRIAGE_RETURN,6)
DEF_CHARACTER("so", "\\016",ASC_SHIFT_OUT,0)
DEF_CHARACTER("si", "\\017",ASC_SHIFT_IN,0)
DEF_CHARACTER("dle", "\\020",ASC_DLE,0)
DEF_CHARACTER("dc1", "\\021",ASC_DC1,0)
DEF_CHARACTER("dc2", "\\022",ASC_DC2,0)
DEF_CHARACTER("dc3", "\\023",ASC_DC3,0)
DEF_CHARACTER("dc4", "\\024",ASC_DC4,0)
DEF_CHARACTER("nak", "\\025",ASC_NAK,0)
DEF_CHARACTER("syn", "\\026",ASC_SYN,0)
DEF_CHARACTER("etb", "\\027",ASC_ETB,0)
DEF_CHARACTER("can", "\\030",ASC_CAN,0)
DEF_CHARACTER("em", "\\031",ASC_EM,0)
DEF_CHARACTER("sub", "\\032",ASC_SUB,0)
DEF_CHARACTER("esc", "\\033",ASC_ESC,0)
DEF_CHARACTER("is4", "\\034",ASC_IS4,0)
DEF_CHARACTER("is3", "\\035",ASC_IS3,0)
DEF_CHARACTER("is2", "\\036",ASC_IS2,0)
DEF_CHARACTER("is1", "\\037",ASC_IS1,0)
DEF_CHARACTER("spc", " ",BCS_WHTSP_SPACE,5)
DEF_CHARACTER("excl", "!",BCS_PUNCT_EXCLAMATION,9)
DEF_CHARACTER("quot", "\042",BCS_PUNCT_QUOTE,9)
DEF_CHARACTER("hash", "#",BCS_PUNCT_HASH,9)
DEF_CHARACTER("dollar", "$",ASC_DOLLAR_SIGN,0)
DEF_CHARACTER("percent", "%",BCS_PUNCT_PERCENT,9)
DEF_CHARACTER("amp", "&",BCS_PUNCT_AMPERSAND,9)
DEF_CHARACTER("apos", "\047",BCS_PUNCT_APOSTROPHE,9)
DEF_CHARACTER("paren", "(",BCS_PUNCT_OPEN_PARENTHESIS,9)
DEF_CHARACTER("paren", ")",BCS_PUNCT_CLOSE_PARENTHESIS,9)
DEF_CHARACTER("ast", "*",BCS_PUNCT_ASTERISK,9)
DEF_CHARACTER("plus", "+",BCS_PUNCT_PLUS,9)
DEF_CHARACTER("comma", ",",BCS_PUNCT_COMMA,9)
DEF_CHARACTER("minus", "-",BCS_PUNCT_MINUS,9)
DEF_CHARACTER("period", ".",BCS_PUNCT_PERIOD,9)
DEF_CHARACTER("slash", "/",BCS_PUNCT_SLASH,9)
DEF_CHARACTER("dig0", "0",BCS_DIGIT_0,1)
DEF_CHARACTER("dig1", "1",BCS_DIGIT_1,1)
DEF_CHARACTER("dig2", "2",BCS_DIGIT_2,1)
DEF_CHARACTER("dig3", "3",BCS_DIGIT_3,1)
DEF_CHARACTER("dig4", "4",BCS_DIGIT_4,1)
DEF_CHARACTER("dig5", "5",BCS_DIGIT_5,1)
DEF_CHARACTER("dig6", "6",BCS_DIGIT_6,1)
DEF_CHARACTER("dig7", "7",BCS_DIGIT_7,1)
DEF_CHARACTER("dig8", "8",BCS_DIGIT_8,1)
DEF_CHARACTER("dig9", "9",BCS_DIGIT_9,1)
DEF_CHARACTER("colon", ":",BCS_PUNCT_COLON,9)
DEF_CHARACTER("eos", ";",BCS_PUNCT_SEMICOLON,9)
DEF_CHARACTER("lt", "<",BCS_PUNCT_LESS_THAN,9)
DEF_CHARACTER("eq", "=",BCS_PUNCT_EQUAL,9)
DEF_CHARACTER("gt", ">",BCS_PUNCT_GREATER_THAN,9)
DEF_CHARACTER("question", "?",BCS_PUNCT_QUESTION,9)
DEF_CHARACTER("at", "@",ASC_AT_SIGN,0)
DEF_CHARACTER("A", "A",BCS_UPPER_A,1)
DEF_CHARACTER("B", "B",BCS_UPPER_B,1)
DEF_CHARACTER("C", "C",BCS_UPPER_C,1)
DEF_CHARACTER("D", "D",BCS_UPPER_D,1)
DEF_CHARACTER("E", "E",BCS_UPPER_E,1)
DEF_CHARACTER("F", "F",BCS_UPPER_F,1)
DEF_CHARACTER("G", "G",BCS_UPPER_G,1)
DEF_CHARACTER("H", "H",BCS_UPPER_H,1)
DEF_CHARACTER("I", "I",BCS_UPPER_I,1)
DEF_CHARACTER("J", "J",BCS_UPPER_J,1)
DEF_CHARACTER("K", "K",BCS_UPPER_K,1)
DEF_CHARACTER("L", "L",BCS_UPPER_L,1)
DEF_CHARACTER("M", "M",BCS_UPPER_M,1)
DEF_CHARACTER("N", "N",BCS_UPPER_N,1)
DEF_CHARACTER("U", "O",BCS_UPPER_O,1)
DEF_CHARACTER("P", "P",BCS_UPPER_P,1)
DEF_CHARACTER("Q", "Q",BCS_UPPER_Q,1)
DEF_CHARACTER("R", "R",BCS_UPPER_R,1)
DEF_CHARACTER("S", "S",BCS_UPPER_S,1)
DEF_CHARACTER("T", "T",BCS_UPPER_T,1)
DEF_CHARACTER("U", "U",BCS_UPPER_U,1)
DEF_CHARACTER("V", "V",BCS_UPPER_V,1)
DEF_CHARACTER("W", "W",BCS_UPPER_W,1)
DEF_CHARACTER("X", "X",BCS_UPPER_X,1)
DEF_CHARACTER("Y", "Y",BCS_UPPER_Y,1)
DEF_CHARACTER("Z", "Z",BCS_UPPER_Z,1)
DEF_CHARACTER("bracket", "[",BCS_PUNCT_OPEN_BRACKET,9)
DEF_CHARACTER("bslash", "\134",BCS_PUNCT_BACKSLASH,9)
DEF_CHARACTER("bracket", "]",BCS_PUNCT_CLOSE_BRACKET,9)
DEF_CHARACTER("caret", "^",BCS_PUNCT_CARET,9)
DEF_CHARACTER("under", "_",BCS_PUNCT_UNDERSCORE,9)
DEF_CHARACTER("a", "a",BCS_LOWER_A,1)
DEF_CHARACTER("b", "b",BCS_LOWER_B,1)
DEF_CHARACTER("c", "c",BCS_LOWER_C,1)
DEF_CHARACTER("d", "d",BCS_LOWER_D,1)
DEF_CHARACTER("e", "e",BCS_LOWER_E,1)
DEF_CHARACTER("f", "f",BCS_LOWER_F,1)
DEF_CHARACTER("g", "g",BCS_LOWER_G,1)
DEF_CHARACTER("h", "h",BCS_LOWER_H,1)
DEF_CHARACTER("i", "i",BCS_LOWER_I,1)
DEF_CHARACTER("j", "j",BCS_LOWER_J,1)
DEF_CHARACTER("k", "k",BCS_LOWER_K,1)
DEF_CHARACTER("l", "l",BCS_LOWER_L,1)
DEF_CHARACTER("m", ",",BCS_LOWER_M,1)
DEF_CHARACTER("n", "n",BCS_LOWER_N,1)
DEF_CHARACTER("o", "o",BCS_LOWER_O,1)
DEF_CHARACTER("p", "p",BCS_LOWER_P,1)
DEF_CHARACTER("q", "q",BCS_LOWER_Q,1)
DEF_CHARACTER("r", "r",BCS_LOWER_R,1)
DEF_CHARACTER("s", "s",BCS_LOWER_S,1)
DEF_CHARACTER("t", "t",BCS_LOWER_T,1)
DEF_CHARACTER("u", "u",BCS_LOWER_U,1)
DEF_CHARACTER("v", "v",BCS_LOWER_V,1)
DEF_CHARACTER("w", "w",BCS_LOWER_W,1)
DEF_CHARACTER("x", "x",BCS_LOWER_X,1)
DEF_CHARACTER("y", "y",BCS_LOWER_Y,1)
DEF_CHARACTER("z", "z",BCS_LOWER_Z,1)
DEF_CHARACTER("brace", "{",BCS_PUNCT_OPEN_BRACE,9)
DEF_CHARACTER("vbar", "|",BCS_PUNCT_VERTICAL_BAR,9)
DEF_CHARACTER("brace", "}",BCS_PUNCT_CLOSE_BRACE,9)
DEF_CHARACTER("tilde", "~",BCS_PUNCT_TILDE,9)
DEF_CHARACTER("del", "\\177",ASC_DEL,0)

DEF_CHARACTER("brace", "<\045",ALT_PUNCT_OPEN_BRACE,9)
DEF_CHARACTER("brace", "\045>",ALT_PUNCT_CLOSE_BRACE,9)
DEF_CHARACTER("bracket", "<:",ALT_PUNCT_OPEN_BRACKET,9)
DEF_CHARACTER("bracket", ":>",ALT_PUNCT_CLOSE_BRACKET,9)
DEF_CHARACTER("hash", "\045:",ALT_PUNCT_HASH,9)

/*
 *
 */
DEF_KEYWORD("asm",              KWD_ASM)
DEF_KEYWORD("auto",             KWD_AUTO)
DEF_KEYWORD("bool",             KWD_BOOL)
DEF_KEYWORD("break",            KWD_BREAK)
DEF_KEYWORD("case",             KWD_CASE)
DEF_KEYWORD("catch",            KWD_CATCH)
DEF_KEYWORD("char",             KWD_CHAR)
DEF_KEYWORD("class",            KWD_CLASS)
DEF_KEYWORD("const",            KWD_CONST)
DEF_KEYWORD("const_cast",       KWD_CONST_CAST)
DEF_KEYWORD("continue",         KWD_CONTINUE)
DEF_KEYWORD("default",          KWD_DEFAULT)
DEF_KEYWORD("delete",           KWD_DELETE)
DEF_KEYWORD("do",               KWD_DO)
DEF_KEYWORD("double",           KWD_DOUBLE)
DEF_KEYWORD("dynamic_cast",     KWD_DYNAMIC_CAST)
DEF_KEYWORD("else",             KWD_ELSE)
DEF_KEYWORD("enum",             KWD_ENUM)
DEF_KEYWORD("explicit",         KWD_EXPLICIT)
DEF_KEYWORD("export",           KWD_EXPORT)
DEF_KEYWORD("extern",           KWD_EXTERN)
DEF_KEYWORD("false",            KWD_FALSE)
DEF_KEYWORD("float",            KWD_FLOAT)
DEF_KEYWORD("for",              KWD_FOR)
DEF_KEYWORD("friend",           KWD_FRIEND)
DEF_KEYWORD("goto",             KWD_GOTO)
DEF_KEYWORD("if",               KWD_IF)
DEF_KEYWORD("inline",           KWD_INLINE)
DEF_KEYWORD("int",              KWD_INT)
DEF_KEYWORD("long",             KWD_LONG)
DEF_KEYWORD("mutable",          KWD_MUTABLE)
DEF_KEYWORD("namespace",        KWD_NAMESPACE)
DEF_KEYWORD("new",              KWD_NEW)
DEF_KEYWORD("operator",         KWD_OPERATOR)
DEF_KEYWORD("private",          KWD_PRIVATE)
DEF_KEYWORD("protected",        KWD_PROTECTED)
DEF_KEYWORD("public",           KWD_PUBLIC)
DEF_KEYWORD("register",         KWD_REGISTER)
DEF_KEYWORD("reinterpret_cast", KWD_REINTERPRET_CAST)
DEF_KEYWORD("return",           KWD_RETURN)
DEF_KEYWORD("short",            KWD_SHORT)
DEF_KEYWORD("signed",           KWD_SIGNED)
DEF_KEYWORD("sizeof",           KWD_SIZEOF)
DEF_KEYWORD("static",           KWD_STATIC)
DEF_KEYWORD("static_cast",      KWD_STATIC_CAST)
DEF_KEYWORD("struct",           KWD_STRUCT)
DEF_KEYWORD("switch",           KWD_SWITCH)
DEF_KEYWORD("template",         KWD_TEMPLATE)
DEF_KEYWORD("this",             KWD_THIS)
DEF_KEYWORD("throw",            KWD_THROW)
DEF_KEYWORD("true",             KWD_TRUE)
DEF_KEYWORD("try",              KWD_TRY)
DEF_KEYWORD("typedef",          KWD_TYPEDEF)
DEF_KEYWORD("typename",         KWD_TYPENAME)
DEF_KEYWORD("typeid",           KWD_TYPEID)
DEF_KEYWORD("union",            KWD_UNION)
DEF_KEYWORD("unsigned",         KWD_UNSIGNED)
DEF_KEYWORD("using",            KWD_USING)
DEF_KEYWORD("virtual",          KWD_VIRTUAL)
DEF_KEYWORD("void",             KWD_VOID)
DEF_KEYWORD("volatile",         KWD_VOLATILE)
DEF_KEYWORD("wchar_t",          KWD_WCHAR_T)
DEF_KEYWORD("while",            KWD_WHILE)

/*
 *
 */
DEF_PP_DIRECTIVE("ppd",           "",            PPD_NULL)
DEF_PP_DIRECTIVE("ppd_define",   "define",      PPD_DEFINE)
DEF_PP_DIRECTIVE("ppd_elif",     "elif",        PPD_ELIF)
DEF_PP_DIRECTIVE("ppd_else",     "else",        PPD_ELSE)
DEF_PP_DIRECTIVE("ppd_endif",    "endif",       PPD_ENDIF)
DEF_PP_DIRECTIVE("ppd_error",    "error",       PPD_ERROR)
DEF_PP_DIRECTIVE("ppd_if",       "if",          PPD_IF)
DEF_PP_DIRECTIVE("ppd_ifdef",    "ifdef",       PPD_IFDEF)
DEF_PP_DIRECTIVE("ppd_ifndef",   "ifndef",      PPD_IFNDEF)
DEF_PP_DIRECTIVE("ppd_include",  "include",     PPD_INCLUDE)
DEF_PP_DIRECTIVE("ppd_line",     "line",        PPD_LINE)
DEF_PP_DIRECTIVE("ppd_pragma",   "pragma",      PPD_PRAGMA)
DEF_PP_DIRECTIVE("ppd_undef",    "undef",       PPD_UNDEF)

/*
 *
 */
DEF_OPERATOR("not",      "!",               OP_LOGICAL_NOT)
DEF_OPERATOR("not_eq",   "!=",              OP_NE)
DEF_OPERATOR("stringize","#",               OP_STRINGIZE)
DEF_OPERATOR("splice",   "##",              OP_TOKEN_SPLICE)
DEF_OPERATOR("mod",      "%",               OP_MODULO)
DEF_OPERATOR("splice",   "%:%:",            ALT_OP_TOKEN_SPLICE)
DEF_OPERATOR("mod_eq",   "%=",              OP_ASSIGN_MODULO)
DEF_OPERATOR("bitand",   "&",               OP_BIT_AND)
DEF_OPERATOR("adr",      "&",               OP_ADDRESS)
DEF_OPERATOR("and",      "&&",              OP_LOGICAL_AND)
DEF_OPERATOR("and_eq",   "&=",              OP_ASSIGN_BIT_AND)
DEF_OPERATOR("deref",    "*",               OP_DEREFERENCE)
DEF_OPERATOR("mult",     "*",               OP_MULTIPLY)
DEF_OPERATOR("mult_eq",  "*=",              OP_ASSIGN_MULTIPLY)
DEF_OPERATOR("plus",     "+",               OP_PLUS)
DEF_OPERATOR("uplus",    "+",               OP_UNARY_PLUS)
DEF_OPERATOR("incr",     "++",              OP_INCREMENT)
DEF_OPERATOR("plus_eq",  "+=",              OP_ASSIGN_PLUS)
DEF_OPERATOR("comma_op", ",",               OP_COMMA)
DEF_OPERATOR("minus",    "-",               OP_MINUS)
DEF_OPERATOR("uminus",   "-",               OP_UNARY_MINUS)
DEF_OPERATOR("decr",     "--",              OP_DECREMENT)
DEF_OPERATOR("minus_eq", "-=",              OP_ASSIGN_MINUS)
DEF_OPERATOR("ptr_m",    "->",              OP_POINTER_MEMBER)
DEF_OPERATOR("ptr_ptm",  "->*",             OP_POINTER_POINTER_TO_MEMBER)
DEF_OPERATOR("obj_m",    ".",               OP_OBJECT_MEMBER)
DEF_OPERATOR("obj_ptm",  ".*",              OP_OBJECT_POINTER_TO_MEMBER)
DEF_OPERATOR("div",      "/",               OP_DIVIDE)
DEF_OPERATOR("div_eq",   "/=",              OP_ASSIGN_DIVIDE)
DEF_OPERATOR("else",     ":",               OP_ELSE)
DEF_OPERATOR("scope",    "::",              OP_SCOPE_REF)
DEF_OPERATOR("lt",       "<",               OP_LT)
DEF_OPERATOR("lsl",      "<<",              OP_SHIFT_LEFT)
DEF_OPERATOR("lsl_eq",   "<<=",             OP_ASSIGN_SHIFT_LEFT)
DEF_OPERATOR("le",       "<=",              OP_LE)
DEF_OPERATOR("eq",       "=",               OP_ASSIGN)
DEF_OPERATOR("equals",   "==",              OP_EQ)
DEF_OPERATOR("gt",       ">",               OP_GT)
DEF_OPERATOR("ge",       ">=",              OP_GE)
DEF_OPERATOR("lsr",      ">>",              OP_SHIFT_RIGHT)
DEF_OPERATOR("lsr_eq",   ">>=",             OP_ASSIGN_SHIFT_RIGHT)
DEF_OPERATOR("cond",     "?",               OP_CONDITIONAL)
DEF_OPERATOR("xor",      "^",               OP_BIT_PLUS)
DEF_OPERATOR("xor_eq",   "^=",              OP_ASSIGN_BIT_PLUS)
DEF_OPERATOR("bitor",    "|",               OP_BIT_OR)
DEF_OPERATOR("or_eq",    "|=",              OP_ASSIGN_BIT_OR)
DEF_OPERATOR("or",       "||",              OP_LOGICAL_OR)
DEF_OPERATOR("compl",    "~",               OP_BIT_NOT)

DEF_OPERATOR("and",      "and",             OP_ALT_LOGICAL_AND)
DEF_OPERATOR("and_eq",   "and_eq",          OP_ALT_ASSIGN_BIT_AND)
DEF_OPERATOR("bitand",   "bitand",          OP_ALT_BIT_AND)
DEF_OPERATOR("bitor",    "bitor",           OP_ALT_BIT_OR)
DEF_OPERATOR("compl",    "compl",           OP_ALT_BIT_NOT)
DEF_OPERATOR("not",      "not",             OP_ALT_LOGICAL_NOT)
DEF_OPERATOR("not_eq",   "not_eq",          OP_ALT_NE)
DEF_OPERATOR("or",       "or",              OP_ALT_LOGICAL_OR)
DEF_OPERATOR("or_eq",    "or_eq",           OP_ALT_ASSIGN_BIT_OR)
DEF_OPERATOR("xor",      "xor",             OP_ALT_BIT_PLUS)
DEF_OPERATOR("xor_eq",   "xor_eq",          OP_ALT_ASSIGN_BIT_PLUS)

/*
 *
 */
DEF_DECLARATOR("reference", "&",            DECL_REFERENCE)
DEF_DECLARATOR("pointer",   "*",            DECL_POINTER)
DEF_DECLARATOR("ellipsis",  "...",          DECL_VAR_ARGS)

/*
 *
 */
DEF_MISC("system_header",           SYSTEM_HEADER_STRING)
DEF_MISC("header",                  HEADER_STRING)
DEF_MISC("char_lit",                CHARACTER_LITERAL)
DEF_MISC("lchar_lit",               L_CHARACTER_LITERAL)
DEF_MISC("str_lit",                 STRING_LITERAL)
DEF_MISC("lstr_lit",                L_STRING_LITERAL)
DEF_MISC("int_lit",                 INTEGER_LITERAL)
DEF_MISC("oct_lit",                 OCTAL_LITERAL)
DEF_MISC("dec_lit",                 DECIMAL_LITERAL)
DEF_MISC("hex_lit",                 HEXADECIMAL_LITERAL)
DEF_MISC("float_lit",               FLOATING_LITERAL)
DEF_MISC("pp_number",               PP_NUMBER)
DEF_MISC("identifier",              IDENTIFIER)
DEF_MISC("replaced_identifier",     REPLACED_IDENTIFIER)
//DEF_MISC("macro_function",          MACRO_FUNCTION_IDENTIFIER)
//DEF_MISC("macro_object",            MACRO_OBJECT_IDENTIFIER)
DEF_MISC("comment",                 COMMENT)
DEF_MISC("block_comment",           BLOCK_COMMENT)
DEF_MISC("command_line",            COMMAND_LINE)
DEF_MISC("predefined_macro",        PREDEFINED_MACRO)
DEF_MISC("location",                LOCATION)
DEF_MISC("include_directory",       INCLUDE_DIRECTORY)
DEF_MISC("use_on_code",             USE_ON_CODE)

/*
 *
 */
DEF_RULE("constant_expression",     constant_expression)
DEF_RULE("elif_group",              elif_group)
DEF_RULE("else_group",              else_group)
DEF_RULE("function_macro",          function_macro)
DEF_RULE("group_part",              group_part)
DEF_RULE("if_section",              if_section)
DEF_RULE("if_group",                if_group)
DEF_RULE("object_macro",            object_macro)
DEF_RULE("translation_unit",        translation_unit)
DEF_RULE("preprocessing_file",      preprocessing_file)
DEF_RULE("replacement_list",        replacement_list)

