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.

279 lines
4.4 KiB

  1. /* Copyright (C) Boris Nikolaus, Germany, 1996-1997. All rights reserved. */
  2. /* Copyright (C) Microsoft Corporation, 1997-1998. All rights reserved. */
  3. %type <XDirectives> LocalTypeDirectiveSeq
  4. %type <XDirectives> LocalTypeDirectiveESeq
  5. %type <XDirectives> LocalTypeDirective
  6. %type <XDirectives> LocalSizeDirectiveSeq
  7. %type <XDirectives> LocalSizeDirectiveESeq
  8. %type <XDirectives> LocalSizeDirective
  9. %type <XString> PrivateDir_Field
  10. %type <XString> PrivateDir_Type
  11. %type <XString> PrivateDir_Value
  12. %type <int> PrivateDir_Public
  13. %type <int> PrivateDir_Intx
  14. %type <int> PrivateDir_LenPtr
  15. %type <int> PrivateDir_Pointer
  16. %type <int> PrivateDir_Array
  17. %type <int> PrivateDir_NoCode
  18. %type <int> PrivateDir_NoMemCopy
  19. %type <int> PrivateDir_OidPacked
  20. %type <int> PrivateDir_OidArray
  21. %type <int> PrivateDir_SLinked
  22. %type <int> PrivateDir_DLinked
  23. %type <XPrivateDirectives> PrivateDirectives
  24. %%
  25. LocalTypeDirectiveSeq
  26. : LocalTypeDirective LocalTypeDirectiveESeq
  27. { if ($2) {
  28. $$ = DupDirective($1);
  29. $$->Next = $2;
  30. } else {
  31. $$ = $1;
  32. }
  33. }
  34. ;
  35. LocalTypeDirectiveESeq
  36. : LocalTypeDirective LocalTypeDirectiveESeq
  37. { if ($2) {
  38. $$ = DupDirective($1);
  39. $$->Next = $2;
  40. } else {
  41. $$ = $1;
  42. }
  43. }
  44. | /* empty */
  45. { $$ = NULL;
  46. }
  47. ;
  48. LocalTypeDirective
  49. : "--$zero-terminated--"
  50. { $$ = NewDirective(eDirective_ZeroTerminated);
  51. }
  52. | "--$pointer--"
  53. { $$ = NewDirective(eDirective_Pointer);
  54. }
  55. | "--$no-pointer--"
  56. { $$ = NewDirective(eDirective_NoPointer);
  57. }
  58. ;
  59. LocalSizeDirectiveSeq
  60. : LocalSizeDirective LocalSizeDirectiveESeq
  61. { if ($2) {
  62. $$ = DupDirective($1);
  63. $$->Next = $2;
  64. } else {
  65. $$ = $1;
  66. }
  67. }
  68. ;
  69. LocalSizeDirectiveESeq
  70. : LocalSizeDirective LocalSizeDirectiveESeq
  71. { if ($2) {
  72. $$ = DupDirective($1);
  73. $$->Next = $2;
  74. } else {
  75. $$ = $1;
  76. }
  77. }
  78. | /* empty */
  79. { $$ = NULL;
  80. }
  81. ;
  82. LocalSizeDirective
  83. : "--$fixed-array--"
  84. { $$ = NewDirective(eDirective_FixedArray);
  85. }
  86. | "--$doubly-linked-list--"
  87. { $$ = NewDirective(eDirective_DoublyLinkedList);
  88. }
  89. | "--$singly-linked-list--"
  90. { $$ = NewDirective(eDirective_SinglyLinkedList);
  91. }
  92. | "--$length-pointer--"
  93. { $$ = NewDirective(eDirective_LengthPointer);
  94. }
  95. ;
  96. PrivateDir_Type
  97. : "PrivateDir_TypeName" lcsymbol
  98. {
  99. $$ = $2;
  100. }
  101. | /* empty */
  102. {
  103. $$ = NULL;
  104. };
  105. PrivateDir_Field
  106. : "PrivateDir_FieldName" lcsymbol
  107. {
  108. $$ = $2;
  109. }
  110. | /* empty */
  111. {
  112. $$ = NULL;
  113. };
  114. PrivateDir_Value
  115. : "PrivateDir_ValueName" lcsymbol
  116. {
  117. $$ = $2;
  118. }
  119. | /* empty */
  120. {
  121. $$ = NULL;
  122. };
  123. PrivateDir_Public
  124. : "PrivateDir_Public"
  125. {
  126. $$ = 1;
  127. }
  128. | /* empty */
  129. {
  130. $$ = 0;
  131. };
  132. PrivateDir_Intx
  133. : "PrivateDir_Intx"
  134. {
  135. $$ = 1;
  136. }
  137. | /* empty */
  138. {
  139. $$ = 0;
  140. };
  141. PrivateDir_LenPtr
  142. : "PrivateDir_LenPtr"
  143. {
  144. $$ = 1;
  145. }
  146. | /* empty */
  147. {
  148. $$ = 0;
  149. };
  150. PrivateDir_Pointer
  151. : "PrivateDir_Pointer"
  152. {
  153. $$ = 1;
  154. }
  155. | /* empty */
  156. {
  157. $$ = 0;
  158. };
  159. PrivateDir_Array
  160. : "PrivateDir_Array"
  161. {
  162. $$ = 1;
  163. }
  164. | /* empty */
  165. {
  166. $$ = 0;
  167. };
  168. PrivateDir_NoCode
  169. : "PrivateDir_NoCode"
  170. {
  171. $$ = 1;
  172. }
  173. | /* empty */
  174. {
  175. $$ = 0;
  176. };
  177. PrivateDir_NoMemCopy
  178. : "PrivateDir_NoMemCopy"
  179. {
  180. $$ = 1;
  181. }
  182. | /* empty */
  183. {
  184. $$ = 0;
  185. };
  186. PrivateDir_OidPacked
  187. : "PrivateDir_OidPacked"
  188. {
  189. $$ = 1;
  190. }
  191. | /* empty */
  192. {
  193. $$ = 0;
  194. };
  195. PrivateDir_OidArray
  196. : "PrivateDir_OidArray"
  197. {
  198. $$ = 1;
  199. }
  200. | /* empty */
  201. {
  202. $$ = 0;
  203. };
  204. PrivateDir_SLinked
  205. : "PrivateDir_SLinked"
  206. {
  207. $$ = 1;
  208. }
  209. | /* empty */
  210. {
  211. $$ = 0;
  212. };
  213. PrivateDir_DLinked
  214. : "PrivateDir_DLinked"
  215. {
  216. $$ = 1;
  217. }
  218. | /* empty */
  219. {
  220. $$ = 0;
  221. };
  222. PrivateDirectives
  223. : PrivateDir_Intx PrivateDir_LenPtr PrivateDir_Pointer
  224. PrivateDir_Array PrivateDir_NoCode PrivateDir_NoMemCopy PrivateDir_Public
  225. PrivateDir_OidPacked PrivateDir_OidArray
  226. PrivateDir_Type PrivateDir_Field PrivateDir_Value
  227. PrivateDir_SLinked PrivateDir_DLinked
  228. {
  229. $$ = (PrivateDirectives_t *) malloc(sizeof(PrivateDirectives_t));
  230. if ($$)
  231. {
  232. memset($$, 0, sizeof(PrivateDirectives_t));
  233. $$->fIntx = $1;
  234. $$->fLenPtr = $2;
  235. $$->fPointer = $3;
  236. $$->fArray = $4;
  237. $$->fNoCode = $5;
  238. $$->fNoMemCopy = $6;
  239. $$->fPublic = $7;
  240. $$->fOidPacked = $8;
  241. $$->fOidArray = $9 | g_fOidArray;
  242. $$->pszTypeName = $10;
  243. $$->pszFieldName = $11;
  244. $$->pszValueName = $12;
  245. $$->fSLinked = $13;
  246. $$->fDLinked = $14;
  247. }
  248. }
  249. | /* empty */
  250. {
  251. $$ = NULL;
  252. };
  253. %%