Leaked source code of windows server 2003
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.

280 lines
12 KiB

  1. /*** scanasl.h - Definitions for scanasl.c
  2. *
  3. * Copyright (c) 1996,1997 Microsoft Corporation
  4. * Author: Michael Tsang (MikeTs)
  5. * Created: 09/05/96
  6. *
  7. * This file contains the implementation constants,
  8. * imported/exported data types, exported function
  9. * prototypes of the scan.c module.
  10. *
  11. * MODIFICATIONS
  12. */
  13. /*** Constants
  14. */
  15. // Return values of Token functions
  16. // return value is the token type if it is positive
  17. // return value is the error number if it is negative
  18. // Error values (negative)
  19. #define TOKERR_TOKEN_TOO_LONG (TOKERR_LANG - 1)
  20. #define TOKERR_UNCLOSED_STRING (TOKERR_LANG - 2)
  21. #define TOKERR_UNCLOSED_CHAR (TOKERR_LANG - 3)
  22. #define TOKERR_UNCLOSED_COMMENT (TOKERR_LANG - 4)
  23. #define TOKERR_SYNTAX (TOKERR_LANG - 5)
  24. // Token types (positive)
  25. #define TOKTYPE_ID (TOKTYPE_LANG + 1)
  26. #define TOKTYPE_STRING (TOKTYPE_LANG + 2)
  27. #define TOKTYPE_CHAR (TOKTYPE_LANG + 3)
  28. #define TOKTYPE_NUMBER (TOKTYPE_LANG + 4)
  29. #define TOKTYPE_SYMBOL (TOKTYPE_LANG + 5)
  30. #define TOKTYPE_SPACE (TOKTYPE_LANG + 6)
  31. #define TOKID(i) TermTable[i].lID
  32. // Identifier token values
  33. #define ID_DEFBLK (ID_LANG + 0)
  34. #define ID_INCLUDE (ID_LANG + 1)
  35. #define ID_EXTERNAL (ID_LANG + 2)
  36. #define ID_ZERO (ID_LANG + 100)
  37. #define ID_ONE (ID_LANG + 101)
  38. #define ID_ONES (ID_LANG + 102)
  39. #define ID_REVISION (ID_LANG + 103)
  40. #define ID_ARG0 (ID_LANG + 104)
  41. #define ID_ARG1 (ID_LANG + 105)
  42. #define ID_ARG2 (ID_LANG + 106)
  43. #define ID_ARG3 (ID_LANG + 107)
  44. #define ID_ARG4 (ID_LANG + 108)
  45. #define ID_ARG5 (ID_LANG + 109)
  46. #define ID_ARG6 (ID_LANG + 110)
  47. #define ID_LOCAL0 (ID_LANG + 111)
  48. #define ID_LOCAL1 (ID_LANG + 112)
  49. #define ID_LOCAL2 (ID_LANG + 113)
  50. #define ID_LOCAL3 (ID_LANG + 114)
  51. #define ID_LOCAL4 (ID_LANG + 115)
  52. #define ID_LOCAL5 (ID_LANG + 116)
  53. #define ID_LOCAL6 (ID_LANG + 117)
  54. #define ID_LOCAL7 (ID_LANG + 118)
  55. #define ID_DEBUG (ID_LANG + 119)
  56. #define ID_ALIAS (ID_LANG + 200)
  57. #define ID_NAME (ID_LANG + 201)
  58. #define ID_SCOPE (ID_LANG + 202)
  59. #define ID_BUFFER (ID_LANG + 300)
  60. #define ID_PACKAGE (ID_LANG + 301)
  61. #define ID_EISAID (ID_LANG + 302)
  62. #define ID_ANYACC (ID_LANG + 400)
  63. #define ID_BYTEACC (ID_LANG + 401)
  64. #define ID_WORDACC (ID_LANG + 402)
  65. #define ID_DWORDACC (ID_LANG + 403)
  66. #define ID_QWORDACC (ID_LANG + 404)
  67. #define ID_BUFFERACC (ID_LANG + 405)
  68. #define ID_LOCK (ID_LANG + 407)
  69. #define ID_NOLOCK (ID_LANG + 408)
  70. #define ID_PRESERVE (ID_LANG + 409)
  71. #define ID_WRONES (ID_LANG + 410)
  72. #define ID_WRZEROS (ID_LANG + 411)
  73. #define ID_SYSMEM (ID_LANG + 412)
  74. #define ID_SYSIO (ID_LANG + 413)
  75. #define ID_PCICFG (ID_LANG + 414)
  76. #define ID_EMBCTRL (ID_LANG + 415)
  77. #define ID_SMBUS (ID_LANG + 416)
  78. #define ID_SERIALIZED (ID_LANG + 417)
  79. #define ID_NOTSERIALIZED (ID_LANG + 418)
  80. #define ID_MTR (ID_LANG + 419)
  81. #define ID_MEQ (ID_LANG + 420)
  82. #define ID_MLE (ID_LANG + 421)
  83. #define ID_MLT (ID_LANG + 422)
  84. #define ID_MGE (ID_LANG + 423)
  85. #define ID_MGT (ID_LANG + 424)
  86. #define ID_EDGE (ID_LANG + 425)
  87. #define ID_LEVEL (ID_LANG + 426)
  88. #define ID_ACTIVEHI (ID_LANG + 427)
  89. #define ID_ACTIVELO (ID_LANG + 428)
  90. #define ID_SHARED (ID_LANG + 429)
  91. #define ID_EXCLUSIVE (ID_LANG + 430)
  92. #define ID_COMPAT (ID_LANG + 431)
  93. #define ID_TYPEA (ID_LANG + 432)
  94. #define ID_TYPEB (ID_LANG + 433)
  95. #define ID_TYPEF (ID_LANG + 434)
  96. #define ID_BUSMASTER (ID_LANG + 435)
  97. #define ID_NOTBUSMASTER (ID_LANG + 436)
  98. #define ID_TRANSFER8 (ID_LANG + 437)
  99. #define ID_TRANSFER8_16 (ID_LANG + 438)
  100. #define ID_TRANSFER16 (ID_LANG + 439)
  101. #define ID_DECODE16 (ID_LANG + 440)
  102. #define ID_DECODE10 (ID_LANG + 441)
  103. #define ID_READWRITE (ID_LANG + 442)
  104. #define ID_READONLY (ID_LANG + 443)
  105. #define ID_RESCONSUMER (ID_LANG + 444)
  106. #define ID_RESPRODUCER (ID_LANG + 445)
  107. #define ID_SUBDECODE (ID_LANG + 446)
  108. #define ID_POSDECODE (ID_LANG + 447)
  109. #define ID_MINFIXED (ID_LANG + 448)
  110. #define ID_MINNOTFIXED (ID_LANG + 449)
  111. #define ID_MAXFIXED (ID_LANG + 450)
  112. #define ID_MAXNOTFIXED (ID_LANG + 451)
  113. #define ID_CACHEABLE (ID_LANG + 452)
  114. #define ID_WRCOMBINING (ID_LANG + 453)
  115. #define ID_PREFETCHABLE (ID_LANG + 454)
  116. #define ID_NONCACHEABLE (ID_LANG + 455)
  117. #define ID_ISAONLYRNG (ID_LANG + 456)
  118. #define ID_NONISAONLYRNG (ID_LANG + 457)
  119. #define ID_ENTIRERNG (ID_LANG + 458)
  120. #define ID_EXT_EDGE (ID_LANG + 459)
  121. #define ID_EXT_LEVEL (ID_LANG + 460)
  122. #define ID_EXT_ACTIVEHI (ID_LANG + 461)
  123. #define ID_EXT_ACTIVELO (ID_LANG + 462)
  124. #define ID_EXT_SHARED (ID_LANG + 463)
  125. #define ID_EXT_EXCLUSIVE (ID_LANG + 464)
  126. #define ID_UNKNOWN_OBJ (ID_LANG + 465)
  127. #define ID_INT_OBJ (ID_LANG + 466)
  128. #define ID_STR_OBJ (ID_LANG + 467)
  129. #define ID_BUFF_OBJ (ID_LANG + 468)
  130. #define ID_PKG_OBJ (ID_LANG + 469)
  131. #define ID_FIELDUNIT_OBJ (ID_LANG + 470)
  132. #define ID_DEV_OBJ (ID_LANG + 471)
  133. #define ID_EVENT_OBJ (ID_LANG + 472)
  134. #define ID_METHOD_OBJ (ID_LANG + 473)
  135. #define ID_MUTEX_OBJ (ID_LANG + 474)
  136. #define ID_OPREGION_OBJ (ID_LANG + 475)
  137. #define ID_POWERRES_OBJ (ID_LANG + 476)
  138. #define ID_THERMAL_OBJ (ID_LANG + 477)
  139. #define ID_BUFFFIELD_OBJ (ID_LANG + 478)
  140. #define ID_DDBHANDLE_OBJ (ID_LANG + 479)
  141. #define ID_CMOSCFG (ID_LANG + 480)
  142. #define ID_SMBQUICK (ID_LANG + 481)
  143. #define ID_SMBSENDRECEIVE (ID_LANG + 482)
  144. #define ID_SMBBYTE (ID_LANG + 483)
  145. #define ID_SMBWORD (ID_LANG + 484)
  146. #define ID_SMBBLOCK (ID_LANG + 485)
  147. #define ID_SMBPROCESSCALL (ID_LANG + 486)
  148. #define ID_SMBBLOCKPROCESSCALL (ID_LANG + 487)
  149. #define ID_OFFSET (ID_LANG + 500)
  150. #define ID_ACCESSAS (ID_LANG + 501)
  151. #define ID_BANKFIELD (ID_LANG + 600)
  152. #define ID_DEVICE (ID_LANG + 601)
  153. #define ID_EVENT (ID_LANG + 602)
  154. #define ID_FIELD (ID_LANG + 603)
  155. #define ID_IDXFIELD (ID_LANG + 604)
  156. #define ID_METHOD (ID_LANG + 605)
  157. #define ID_MUTEX (ID_LANG + 606)
  158. #define ID_OPREGION (ID_LANG + 607)
  159. #define ID_POWERRES (ID_LANG + 608)
  160. #define ID_PROCESSOR (ID_LANG + 609)
  161. #define ID_THERMALZONE (ID_LANG + 610)
  162. #define ID_BREAK (ID_LANG + 700)
  163. #define ID_BREAKPOINT (ID_LANG + 701)
  164. #define ID_BITFIELD (ID_LANG + 702)
  165. #define ID_BYTEFIELD (ID_LANG + 703)
  166. #define ID_DWORDFIELD (ID_LANG + 704)
  167. #define ID_CREATEFIELD (ID_LANG + 705)
  168. #define ID_WORDFIELD (ID_LANG + 706)
  169. #define ID_ELSE (ID_LANG + 707)
  170. #define ID_FATAL (ID_LANG + 708)
  171. #define ID_IF (ID_LANG + 709)
  172. #define ID_LOAD (ID_LANG + 710)
  173. #define ID_NOP (ID_LANG + 711)
  174. #define ID_NOTIFY (ID_LANG + 712)
  175. #define ID_RELEASE (ID_LANG + 713)
  176. #define ID_RESET (ID_LANG + 714)
  177. #define ID_RETURN (ID_LANG + 715)
  178. #define ID_SIGNAL (ID_LANG + 716)
  179. #define ID_SLEEP (ID_LANG + 717)
  180. #define ID_STALL (ID_LANG + 718)
  181. #define ID_UNLOAD (ID_LANG + 719)
  182. #define ID_WHILE (ID_LANG + 720)
  183. #define ID_ACQUIRE (ID_LANG + 800)
  184. #define ID_ADD (ID_LANG + 801)
  185. #define ID_AND (ID_LANG + 802)
  186. #define ID_CONCAT (ID_LANG + 803)
  187. #define ID_CONDREFOF (ID_LANG + 804)
  188. #define ID_DECREMENT (ID_LANG + 805)
  189. #define ID_DEREFOF (ID_LANG + 806)
  190. #define ID_DIVIDE (ID_LANG + 807)
  191. #define ID_FINDSETLBIT (ID_LANG + 808)
  192. #define ID_FINDSETRBIT (ID_LANG + 809)
  193. #define ID_FROMBCD (ID_LANG + 810)
  194. #define ID_INCREMENT (ID_LANG + 811)
  195. #define ID_INDEX (ID_LANG + 812)
  196. #define ID_LAND (ID_LANG + 813)
  197. #define ID_LEQ (ID_LANG + 814)
  198. #define ID_LG (ID_LANG + 815)
  199. #define ID_LGEQ (ID_LANG + 816)
  200. #define ID_LL (ID_LANG + 817)
  201. #define ID_LLEQ (ID_LANG + 818)
  202. #define ID_LNOT (ID_LANG + 819)
  203. #define ID_LNOTEQ (ID_LANG + 820)
  204. #define ID_LOR (ID_LANG + 821)
  205. #define ID_MATCH (ID_LANG + 822)
  206. #define ID_MULTIPLY (ID_LANG + 823)
  207. #define ID_NAND (ID_LANG + 824)
  208. #define ID_NOR (ID_LANG + 825)
  209. #define ID_NOT (ID_LANG + 826)
  210. #define ID_OBJTYPE (ID_LANG + 827)
  211. #define ID_OR (ID_LANG + 828)
  212. #define ID_REFOF (ID_LANG + 829)
  213. #define ID_SHIFTL (ID_LANG + 830)
  214. #define ID_SHIFTR (ID_LANG + 831)
  215. #define ID_SIZEOF (ID_LANG + 832)
  216. #define ID_STORE (ID_LANG + 833)
  217. #define ID_SUBTRACT (ID_LANG + 834)
  218. #define ID_TOBCD (ID_LANG + 835)
  219. #define ID_WAIT (ID_LANG + 836)
  220. #define ID_XOR (ID_LANG + 837)
  221. #define ID_RESTEMP (ID_LANG + 1000)
  222. #define ID_STARTDEPFNNOPRI (ID_LANG + 1001)
  223. #define ID_STARTDEPFN (ID_LANG + 1002)
  224. #define ID_ENDDEPFN (ID_LANG + 1003)
  225. #define ID_IRQNOFLAGS (ID_LANG + 1004)
  226. #define ID_IRQ (ID_LANG + 1005)
  227. #define ID_DMA (ID_LANG + 1006)
  228. #define ID_IO (ID_LANG + 1007)
  229. #define ID_FIXEDIO (ID_LANG + 1008)
  230. #define ID_VENDORSHORT (ID_LANG + 1009)
  231. #define ID_MEMORY24 (ID_LANG + 1010)
  232. #define ID_VENDORLONG (ID_LANG + 1011)
  233. #define ID_MEMORY32 (ID_LANG + 1012)
  234. #define ID_MEMORY32FIXED (ID_LANG + 1013)
  235. #define ID_DWORDMEMORY (ID_LANG + 1014)
  236. #define ID_DWORDIO (ID_LANG + 1015)
  237. #define ID_WORDIO (ID_LANG + 1016)
  238. #define ID_WORDBUSNUMBER (ID_LANG + 1017)
  239. #define ID_INTERRUPT (ID_LANG + 1018)
  240. #define ID_QWORDMEMORY (ID_LANG + 1019)
  241. #define ID_QWORDIO (ID_LANG + 1020)
  242. // Symbol token values
  243. #define SYM_ANY 0
  244. #define SYM_LBRACE 1 // {
  245. #define SYM_RBRACE 2 // }
  246. #define SYM_LPARAN 3 // (
  247. #define SYM_RPARAN 4 // )
  248. #define SYM_COMMA 5 // ,
  249. #define SYM_SLASH 6 // /
  250. #define SYM_ASTERISK 7 // *
  251. #define SYM_INLINECOMMENT 8 // //
  252. #define SYM_OPENCOMMENT 9 // SLASH-STAR
  253. #define SYM_CLOSECOMMENT 10 // STAR-SLASH
  254. #define CH_ROOT_PREFIX '\\'
  255. #define CH_PARENT_PREFIX '^'
  256. #define CH_NAMESEG_SEP '.'
  257. /*** Exported function prototypes
  258. */
  259. PTOKEN EXPORT OpenScan(FILE *pfileSrc);
  260. VOID EXPORT CloseScan(PTOKEN ptoken);
  261. VOID EXPORT PrintScanErr(PTOKEN ptoken, int rcErr);