Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
10 KiB

  1. /*
  2. * TOKENS - This file contains the initialized tables of text, token pairs for
  3. * all the C language symbols and keywords, and the mapped value for YACC
  4. * and inline assembler.
  5. *
  6. * IMPORTANT : this MUST be in the same order as the %token list in grammar.y
  7. *
  8. */
  9. /* token TEXT MAPPED TO IL OPCODE ASM TOKEN */
  10. DAT(L_NOTOKEN, L"newline", L_NOTOKEN, MAX_OPCODE, ML_NL)
  11. DAT(L_IDENT, L"identifier", L_IDENT, OPname, ML_IDENT)
  12. DAT(L_STRING, L"string", L_STRING, OPconstant, ML_NOTOKEN)
  13. DAT(L_CFLOAT, L"float constant", L_CONSTANT, OPconstant, ML_NOTOKEN)
  14. DAT(L_CDOUBLE, L"double constant", L_CONSTANT, OPconstant, ML_NOTOKEN)
  15. DAT(L_CLDOUBLE, L"long double constant",L_CONSTANT, OPconstant, ML_NOTOKEN)
  16. DAT(L_CINTEGER, L"int constant", L_CONSTANT, OPconstant, ML_CONSTANT)
  17. DAT(L_LONGINT, L"long constant", L_CONSTANT, OPconstant, ML_CONSTANT)
  18. DAT(L_CUNSIGNED,L"unsigned int constant",L_CONSTANT,OPconstant, ML_CONSTANT)
  19. DAT(L_LONGUNSIGNED,L"unsigned long constant",L_CONSTANT,OPconstant,ML_CONSTANT)
  20. DAT(L_AUTO, L"auto", L_CLASS, MAX_OPCODE, ML_IDENT)
  21. DAT(L_STATIC, L"static", L_CLASS, MAX_OPCODE, ML_IDENT)
  22. DAT(L_EXTERN, L"extern", L_CLASS, MAX_OPCODE, ML_IDENT)
  23. DAT(L_REGISTER, L"register", L_CLASS, MAX_OPCODE, ML_IDENT)
  24. DAT(L_TYPEDEF, L"typedef", L_CLASS, MAX_OPCODE, ML_IDENT)
  25. DAT(L_FORTRAN, Fortran_str, L_MODIFIER, MAX_OPCODE, ML_IDENT)
  26. DAT(L_PASCAL, Pascal_str, L_MODIFIER, MAX_OPCODE, ML_IDENT)
  27. DAT(L_C, Cdecl_str, L_MODIFIER, MAX_OPCODE, ML_IDENT)
  28. DAT(L_INTERRUPT,L"interrupt", L_MODIFIER, MAX_OPCODE, ML_IDENT)
  29. DAT(L_SAVEREGS, L"saveregs", L_MODIFIER, MAX_OPCODE, ML_IDENT)
  30. DAT(L_LOADDS, L"loadds", L_MODIFIER, MAX_OPCODE, ML_IDENT)
  31. DAT(L_EXPORT, L"export", L_MODIFIER, MAX_OPCODE, ML_IDENT)
  32. DAT(L_ASM, L"_asm", L_ASM, MAX_OPCODE, ML_NL)
  33. DAT(L_NEAR, L"near", L_MODIFIER, MAX_OPCODE, ML_IDENT)
  34. DAT(L_FAR, L"far", L_MODIFIER, MAX_OPCODE, ML_IDENT)
  35. DAT(L_HUGE, L"huge", L_MODIFIER, MAX_OPCODE, ML_IDENT)
  36. DAT(L_CONST, L"const", L_MODIFIER, MAX_OPCODE, ML_CDATATYPE)
  37. DAT(L_VOLATILE, L"volatile", L_MODIFIER, MAX_OPCODE, ML_CDATATYPE)
  38. DAT(L_CHAR, L"char", L_TYPE, MAX_OPCODE, ML_CDATATYPE)
  39. DAT(L_INT, L"int", L_TYPE, MAX_OPCODE, ML_CDATATYPE)
  40. DAT(L_FLOAT, L"float", L_TYPE, MAX_OPCODE, ML_CDATATYPE)
  41. DAT(L_DOUBLE, L"double", L_TYPE, MAX_OPCODE, ML_CDATATYPE)
  42. DAT(L_SHORT, L"short", L_TYPE, MAX_OPCODE, ML_CDATATYPE)
  43. DAT(L_LONG, L"long", L_TYPE, MAX_OPCODE, ML_CDATATYPE)
  44. DAT(L_VOID, L"void", L_TYPE, MAX_OPCODE, ML_IDENT)
  45. DAT(L_SIGNED, L"signed", L_TYPE, MAX_OPCODE, ML_CDATATYPE)
  46. DAT(L_UNSIGNED, L"unsigned", L_TYPE, MAX_OPCODE, ML_CDATATYPE)
  47. DAT(L_ENUM, L"enum", L_ENUM, MAX_OPCODE, ML_IDENT)
  48. DAT(L_ENUM_TAG, L"enum tag", L_ENUM_TAG, MAX_OPCODE, ML_NOTOKEN)
  49. DAT(L_STRUCT, L"struct", L_STRUCT, MAX_OPCODE, ML_IDENT)
  50. DAT(L_STRUCT_TAG,L"struct tag", L_STRUCT_TAG, MAX_OPCODE, ML_NOTOKEN)
  51. DAT(L_UNION, L"union", L_UNION, MAX_OPCODE, ML_IDENT)
  52. DAT(L_UNION_TAG,L"union tag", L_UNION_TAG, MAX_OPCODE, ML_NOTOKEN)
  53. DAT(L_AND, L"&", L_AND, OPband, ML_AND)
  54. DAT(L_ANDAND, L"&&", L_ANDAND, OPandif, ML_NOTOKEN)
  55. DAT(L_ANDEQ, L"&=", L_ASOP, OPandeq, ML_NOTOKEN)
  56. DAT(L_ASSIGN, L"=", L_ASSIGN, OPassign, ML_NOTOKEN)
  57. DAT(L_BIT, L"bit field", L_BIT, OPbit, ML_NOTOKEN)
  58. DAT(L_COLON, L":", L_COLON, OPcolon, ML_COLON)
  59. DAT(L_COMMA, L",", L_COMMA, OPcomma, ML_COMMA)
  60. DAT(L_DECR, L"--", L_INCOP, OPpostdecr, ML_NOTOKEN)
  61. DAT(L_DIV, L"/", L_DIVOP, OPdiv, ML_DIV)
  62. DAT(L_DIVEQ, L"/=", L_ASOP, OPdiveq, ML_NOTOKEN)
  63. DAT(L_EQUALS, L"==", L_EQUOP, OPeq, ML_EQ)
  64. DAT(L_EXCLAIM, L"!", L_EXCLAIM, OPnot, ML_NOTOKEN)
  65. DAT(L_EXTRACT, L"*", L_EXTRACT, OPextract, ML_NOTOKEN)
  66. DAT(L_GT, L">", L_RELOP, OPgt, ML_GT)
  67. DAT(L_GTEQ, L">=", L_RELOP, OPge, ML_GE)
  68. DAT(L_INCR, L"++", L_INCOP, OPpostincr, ML_NOTOKEN)
  69. DAT(L_LBRACK, L"[", L_LBRACK, OPindex, ML_LBRACK)
  70. DAT(L_LSHFTEQ, L"<<=", L_ASOP, OPlsheq, ML_NOTOKEN)
  71. DAT(L_LSHIFT, L"<<", L_SHIFTOP, OPlshift, ML_SHL)
  72. DAT(L_LT, L"<", L_RELOP, OPlt, ML_LT)
  73. DAT(L_LTEQ, L"<=", L_RELOP, OPle, ML_LE)
  74. DAT(L_MINUS, L"-", L_MINUS, OPminus, ML_SUB)
  75. DAT(L_MINUSEQ, L"-=", L_ASOP, OPminuseq, ML_NOTOKEN)
  76. DAT(L_MOD, L"%", L_DIVOP, OPrem, ML_MOD)
  77. DAT(L_MODEQ, L"%=", L_ASOP, OPremeq, ML_NOTOKEN)
  78. DAT(L_MULT, L"*", L_MULT, OPmult, ML_MUL)
  79. DAT(L_MULTEQ, L"*=", L_ASOP, OPmulteq, ML_NOTOKEN)
  80. DAT(L_NOTEQ, L"!=", L_EQUOP, OPne, ML_NE)
  81. DAT(L_OR, L"|", L_OR, OPbor, ML_OR)
  82. DAT(L_OREQ, L"|=", L_ASOP, OPoreq, ML_NOTOKEN)
  83. DAT(L_OROR, L"||", L_OROR, OPorelse, ML_NOTOKEN)
  84. DAT(L_PERIOD, L".", L_STUNOP, OPfield, ML_PERIOD)
  85. DAT(L_PLUS, L"+", L_PLUS, OPplus, ML_ADD)
  86. DAT(L_PLUSEQ, L"+=", L_ASOP, OPpluseq, ML_NOTOKEN)
  87. DAT(L_POINTSTO, L"->", L_STUNOP, OPfield, ML_NOTOKEN)
  88. DAT(L_PREDECR, L"--", L_INCOP, OPminuseq, ML_NOTOKEN)
  89. DAT(L_PREINCR, L"++", L_INCOP, OPpluseq, ML_NOTOKEN)
  90. DAT(L_QUEST, L"?", L_QUEST, OPquestion, ML_NOTOKEN)
  91. DAT(L_RSHFTEQ, L">>=", L_ASOP, OPrsheq, ML_NOTOKEN)
  92. DAT(L_RSHIFT, L">>", L_SHIFTOP, OPrshift, ML_SHR)
  93. DAT(L_TILDE, L"~", L_TILDE, OPcompl, ML_NOT)
  94. DAT(L_UMINUS, L"unary minus", L_UMINUS, OPneg, ML_NOTOKEN)
  95. DAT(L_XOR, L"^", L_XOR, OPxor, ML_XOR)
  96. DAT(L_XOREQ, L"^=", L_ASOP, OPxoreq, ML_NOTOKEN)
  97. DAT(L_ARG, L"argument", L_ARG, OPargument, ML_NOTOKEN)
  98. DAT(L_ASOP, L"assign op", L_ASOP, MAX_OPCODE, ML_NOTOKEN)
  99. DAT(L_BREAK, L"break", L_BREAK, MAX_OPCODE, ML_IDENT)
  100. DAT(L_CASE, L"case", L_CASE, OPcase, ML_IDENT)
  101. DAT(L_CAST, L"cast", L_CAST, OPcast, ML_NOTOKEN)
  102. DAT(L_CLASS, L"storage class",L_CLASS, MAX_OPCODE, ML_IDENT)
  103. DAT(L_CONSTANT, L"constant", L_CONSTANT, MAX_OPCODE, ML_MAPPED)
  104. DAT(L_CONTINUE, L"continue", L_CONTINUE, MAX_OPCODE, ML_IDENT)
  105. DAT(L_DEFAULT, L"default", L_DEFAULT, MAX_OPCODE, ML_IDENT)
  106. DAT(L_DIVOP, L"div op", L_DIVOP, MAX_OPCODE, ML_MAPPED)
  107. DAT(L_DO, L"do", L_DO, MAX_OPCODE, ML_IDENT)
  108. DAT(L_ELLIPSIS, L"...", L_ELLIPSIS, MAX_OPCODE, ML_NOTOKEN)
  109. DAT(L_ELSE, L"else", L_ELSE, MAX_OPCODE, ML_IDENT)
  110. DAT(L_ENTRY, L"entry", L_ENTRY, OPentry, ML_NOTOKEN)
  111. DAT(L_EOF, L"end of file", 0, MAX_OPCODE, ML_EOF)
  112. DAT(L_EQUOP, L"equ op", L_EQUOP, MAX_OPCODE, ML_NOTOKEN)
  113. DAT(L_FILE, 0, L_FILE, MAX_OPCODE, ML_NOTOKEN)
  114. DAT(L_FOR, L"for", L_FOR, MAX_OPCODE, ML_IDENT)
  115. DAT(L_FUNCTION, L"argument", L_FUNCTION, MAX_OPCODE, ML_NOTOKEN)
  116. DAT(L_GOTO, L"goto", L_GOTO, MAX_OPCODE, ML_IDENT)
  117. DAT(L_IF, L"if", L_IF, MAX_OPCODE, ML_IDENT)
  118. DAT(L_INCOP, L"incr op", L_INCOP, MAX_OPCODE, ML_NOTOKEN)
  119. DAT(L_INIT, L"initializing", L_INIT, MAX_OPCODE, ML_NOTOKEN)
  120. DAT(L_LCURLY, L"{", L_LCURLY, MAX_OPCODE, ML_LCURLY)
  121. DAT(L_LINE, L"line", L_LINE, MAX_OPCODE, ML_NOTOKEN)
  122. DAT(L_LPAREN, L"(", L_LPAREN, OPfunction, ML_LPAREN)
  123. DAT(L_INTRINSIC,L"intrinsic", L_INTRINSIC, OPintrinsic, ML_NOTOKEN)
  124. DAT(L_MODIFIER, L"modifier", L_MODIFIER, MAX_OPCODE, ML_MAPPED)
  125. DAT(L_MODULE, L"module", L_MODULE, MAX_OPCODE, ML_NOTOKEN)
  126. DAT(L_RBRACK, L"]", L_RBRACK, MAX_OPCODE, ML_RBRACK)
  127. DAT(L_RCURLY, L"}", L_RCURLY, MAX_OPCODE, ML_NL)
  128. DAT(L_RELOP, L"rel op", L_RELOP, MAX_OPCODE, ML_MAPPED)
  129. DAT(L_RETURN, L"return", L_RETURN, MAX_OPCODE, ML_IDENT)
  130. DAT(L_RPAREN, L")", L_RPAREN, MAX_OPCODE, ML_RPAREN)
  131. DAT(L_SELF, L"_self", L_SELF, OPself, ML_IDENT)
  132. DAT(L_SEMI, L";", L_SEMI, MAX_OPCODE, ML_SEMI)
  133. DAT(L_SHIFTOP, L"shift op", L_SHIFTOP, MAX_OPCODE, ML_MAPPED)
  134. DAT(L_SIZEOF, L"sizeof", L_SIZEOF, MAX_OPCODE, ML_IDENT)
  135. DAT(L_STUNOP, L"struct op", L_STUNOP, MAX_OPCODE, ML_MAPPED)
  136. DAT(L_SW, L"switch", L_SW, OPswitch, ML_IDENT)
  137. DAT(L_SWEXP, 0, L_SWEXP, OPswexp, ML_NOTOKEN)
  138. DAT(L_TYPE, L"type", L_TYPE, MAX_OPCODE, ML_MAPPED)
  139. DAT(L_TYPENAME, L"typedef name", L_TYPENAME, MAX_OPCODE, ML_CTYPENAME)
  140. DAT(L_UPLUS, L"unary plus", L_UPLUS, OPparen, ML_NOTOKEN)
  141. DAT(L_WHILE, L"while", L_WHILE, MAX_OPCODE, ML_IDENT)
  142. DAT(0, 0, 0, MAX_OPCODE, ML_NOTOKEN)
  143.