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.

586 lines
30 KiB

  1. /*****************************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1987-1999 **/
  4. /*****************************************************************************/
  5. /*****************************************************************************
  6. File : pass1.cxx
  7. Title : pass1 controller
  8. History :
  9. 05-Aug-1991 VibhasC Created
  10. *****************************************************************************/
  11. #if 0
  12. Notes
  13. -----
  14. This file provides the entry point for the MIDL compiler front end.
  15. It initializes the data structures for the front end , and makes the parsing
  16. pass over the idl file. Does the semantics and second semantics passes if
  17. needed.
  18. #endif // 0
  19. #pragma warning ( disable : 4514 )
  20. /****************************************************************************
  21. includes
  22. ****************************************************************************/
  23. #include "nulldefs.h"
  24. extern "C" {
  25. #include <stdio.h>
  26. #include <stdlib.h>
  27. #include <malloc.h>
  28. extern int yyparse();
  29. }
  30. #include "allnodes.hxx"
  31. #include "control.hxx"
  32. #include "gramutil.hxx"
  33. #include "cmdana.hxx"
  34. #include "filehndl.hxx"
  35. #include "idict.hxx"
  36. #include "treg.hxx"
  37. /****************************************************************************
  38. extern procedures
  39. ****************************************************************************/
  40. extern void SetUpAttributeMasks( void );
  41. extern void SetPredefinedTypes();
  42. extern void initlex();
  43. /****************************************************************************
  44. extern data
  45. ****************************************************************************/
  46. extern unsigned short CurrentZp;
  47. extern ATTR_SUMMARY DisallowedAttrs[INTERNAL_NODE_END];
  48. extern ATTR_SUMMARY FieldAttrs;
  49. extern TREGISTRY * pCallAsTable;
  50. extern class ccontrol * pCompiler;
  51. extern nsa * pSymTblMgr;
  52. extern SymTable * pBaseSymTbl;
  53. extern SymTable * pCurSymTbl;
  54. extern node_error * pErrorTypeNode;
  55. extern IDICT * pFileDict;
  56. extern IDICT * pInterfaceInfo;
  57. extern node_pragma_pack * pPackStack;
  58. extern pre_type_db * pPreAllocTypes;
  59. extern node_source * pSourceNode;
  60. extern NFA_INFO * pImportCntrl;
  61. extern CMD_ARG * pCommand;
  62. extern node_e_attr * pErrorAttrNode;
  63. extern IINFODICT * pInterfaceInfoDict;
  64. extern IDICT * pInterfaceDict;
  65. extern SymTable * pUUIDTable;
  66. extern ISTACK * pZpStack;
  67. extern ATTR_SUMMARY RedundantsOk;
  68. /****************************************************************************
  69. local data
  70. ****************************************************************************/
  71. /****************************************************************************/
  72. /****************************************************************************
  73. _pass1:
  74. The constructor.
  75. ****************************************************************************/
  76. _pass1::_pass1()
  77. {
  78. pSymTblMgr = new nsa;
  79. pBaseSymTbl = pCurSymTbl = pSymTblMgr->GetCurrentSymbolTable();
  80. pUUIDTable = new SymTable;
  81. pCallAsTable = new TREGISTRY;
  82. pCompiler->SetPassNumber( IDL_PASS );
  83. }
  84. /****************************************************************************
  85. Go:
  86. The execution of pass1
  87. ****************************************************************************/
  88. STATUS_T
  89. _pass1::Go()
  90. {
  91. STATUS_T Status;
  92. /**
  93. ** set up the input file for each pass
  94. **/
  95. pImportCntrl = pCompiler->SetImportController( new NFA_INFO );
  96. pImportCntrl->Init();
  97. pFileDict = new IDICT( 8, 8 );
  98. AddFileToDB( "Dummy" ); // to get index to be non-zero
  99. Status = pImportCntrl->SetNewInputFile( pCommand->GetInputFileName() );
  100. AddFileToDB( pCommand->GetInputFileName() );
  101. if( Status == STATUS_OK )
  102. {
  103. /**
  104. ** set up for the 1st pass, allocate the semantics context manager
  105. ** and the pre-allocated types data base
  106. **/
  107. pPreAllocTypes = new pre_type_db;
  108. pErrorTypeNode = new node_error;
  109. pErrorAttrNode = new node_e_attr;
  110. pInterfaceInfoDict = new IINFODICT;
  111. pInterfaceInfoDict->StartNewInterface();
  112. pInterfaceDict = new IDICT(8,8);
  113. pInterfaceDict->AddElement( NULL ); // so that 0 is a reserved value
  114. pPackStack = new node_pragma_pack( NULL,
  115. pCommand->GetZeePee(),
  116. PRAGMA_PACK_GARBAGE );
  117. CurrentZp = pCommand->GetZeePee();
  118. pZpStack = new ISTACK( 10 );
  119. /**
  120. ** Set up the predefined types and bit attributes.
  121. **/
  122. #ifdef gajdebug4
  123. printf("about to do predefined types...\n");
  124. #endif
  125. SetPredefinedTypes();
  126. #ifdef gajdebug4
  127. printf("\t\t\t...done\n");
  128. #endif
  129. /**
  130. ** set up attribute masks, to indicate which node takes what attribute.
  131. ** also set up acf conflicts.
  132. **/
  133. SetUpAttributeMasks();
  134. /**
  135. ** go parse.
  136. **/
  137. initlex();
  138. if( yyparse() )
  139. Status = SYNTAX_ERROR;
  140. pInterfaceInfoDict->EndNewInterface();
  141. }
  142. delete pImportCntrl;
  143. return Status;
  144. }
  145. /****************************************************************************
  146. SetUpAttributeMasks:
  147. This function exists to initialize the attribute masks. Attribute masks
  148. are nothing but summary attribute bit vectors, which have bits set up
  149. in them to indicate which attributes are acceptable at a node. The way
  150. the attribute distribution occurs, we need to indicate the attributes
  151. collected on the way down the chain and up the chain. That is why we need
  152. two attribute summary vectors. We init them up front so that we need not
  153. do this at run-time. This whole operation really is too large to my liking
  154. but for the time being, it stays
  155. NOTE: A pointer node handles its own attribute mask setting, it varies
  156. with the type graph underneath a pointer
  157. ****************************************************************************/
  158. void
  159. SetUpAttributeMasks( void )
  160. {
  161. MIDL_ASSERT(MAX_ATTR_SUMMARY_ELEMENTS == ((ACF_ATTR_END / 32) + 1));
  162. int i = 0;
  163. // RedundantsOk is the set of attributes we silently allow duplicates of
  164. // All other duplicates are redundant and need complaining about
  165. CLEAR_ATTR( RedundantsOk );
  166. SET_ATTR( RedundantsOk, ATTR_FIRST );
  167. SET_ATTR( RedundantsOk, ATTR_LAST );
  168. SET_ATTR( RedundantsOk, ATTR_LENGTH );
  169. SET_ATTR( RedundantsOk, ATTR_MIN );
  170. SET_ATTR( RedundantsOk, ATTR_MAX );
  171. SET_ATTR( RedundantsOk, ATTR_SIZE );
  172. SET_ATTR( RedundantsOk, ATTR_RANGE );
  173. SET_ATTR( RedundantsOk, ATTR_CASE );
  174. SET_ATTR( RedundantsOk, ATTR_FUNCDESCATTR );
  175. SET_ATTR( RedundantsOk, ATTR_IDLDESCATTR );
  176. SET_ATTR( RedundantsOk, ATTR_TYPEDESCATTR );
  177. SET_ATTR( RedundantsOk, ATTR_VARDESCATTR );
  178. SET_ATTR( RedundantsOk, ATTR_TYPE );
  179. SET_ATTR( RedundantsOk, ATTR_MEMBER );
  180. // FieldAttrs is the set of all field attributes
  181. CLEAR_ATTR( FieldAttrs );
  182. SET_ATTR( FieldAttrs, ATTR_FIRST );
  183. SET_ATTR( FieldAttrs, ATTR_LAST );
  184. SET_ATTR( FieldAttrs, ATTR_LENGTH );
  185. SET_ATTR( FieldAttrs, ATTR_MIN );
  186. SET_ATTR( FieldAttrs, ATTR_MAX );
  187. SET_ATTR( FieldAttrs, ATTR_SIZE );
  188. SET_ATTR( FieldAttrs, ATTR_STRING );
  189. SET_ATTR( FieldAttrs, ATTR_BSTRING );
  190. SET_ATTR( FieldAttrs, ATTR_IID_IS );
  191. // initialize the array of valid attributes to globally allow everything
  192. for ( i = 0; i < INTERNAL_NODE_END; i++ )
  193. CLEAR_ATTR( DisallowedAttrs[i] );
  194. // turn off bits for attributes allowed on arrays
  195. SET_ALL_ATTR( DisallowedAttrs[ NODE_ARRAY ] );
  196. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_FIRST );
  197. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_LAST );
  198. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_LENGTH );
  199. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_MIN );
  200. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_MAX );
  201. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_SIZE );
  202. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_PTR_KIND );
  203. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_STRING );
  204. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_CONTEXT );
  205. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_NOSERIALIZE);
  206. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_SERIALIZE);
  207. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_SWITCH_IS );
  208. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_IID_IS );
  209. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_SWITCH_TYPE );
  210. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_BYTE_COUNT );
  211. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_V1_ENUM );
  212. RESET_ATTR( DisallowedAttrs[ NODE_ARRAY ], ATTR_ID );
  213. // turn off bits for attributes allowed on pointers
  214. SET_ALL_ATTR( DisallowedAttrs[ NODE_POINTER ] );
  215. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_FIRST );
  216. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_LAST );
  217. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_LENGTH );
  218. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_MIN );
  219. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_MAX );
  220. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_SIZE );
  221. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_PTR_KIND );
  222. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_STRING );
  223. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_BSTRING );
  224. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_CONTEXT );
  225. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_NOSERIALIZE);
  226. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_SERIALIZE);
  227. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_ALLOCATE );
  228. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_IGNORE );
  229. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_BYTE_COUNT );
  230. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_SWITCH_IS );
  231. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_IID_IS );
  232. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_COMMSTAT );
  233. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_FAULTSTAT );
  234. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_SWITCH_TYPE );
  235. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_BYTE_COUNT );
  236. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_V1_ENUM );
  237. RESET_ATTR( DisallowedAttrs[ NODE_POINTER ], ATTR_ID );
  238. // turn off bits for attributes allowed on interface
  239. SET_ALL_ATTR( DisallowedAttrs[ NODE_INTERFACE ] );
  240. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_PTR_KIND );
  241. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_GUID );
  242. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_VERSION );
  243. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_ENDPOINT );
  244. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_LOCAL );
  245. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_OBJECT );
  246. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_AUTO );
  247. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_IMPLICIT );
  248. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_EXPLICIT );
  249. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_CODE );
  250. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_NOCODE );
  251. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_PTRSIZE );
  252. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_OPTIMIZE );
  253. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_MS_UNION );
  254. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_MS_CONF_STRUCT );
  255. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_ENABLE_ALLOCATE );
  256. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_ENCODE );
  257. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_DECODE );
  258. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_HELPCONTEXT );
  259. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_HELPSTRINGCONTEXT );
  260. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_HELPSTRING );
  261. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_TYPE);
  262. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_MEMBER);
  263. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_HIDDEN );
  264. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_TYPEDESCATTR);
  265. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_DEFAULT );
  266. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_CUSTOM );
  267. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_ASYNC );
  268. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_ASYNCUUID );
  269. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_MESSAGE );
  270. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_STRICT_CONTEXT_HANDLE );
  271. RESET_ATTR( DisallowedAttrs[ NODE_INTERFACE ], ATTR_CSTAGRTN );
  272. // turn off bits for attributes allowed on an object pipe interface
  273. SET_ALL_ATTR( DisallowedAttrs[ NODE_PIPE_INTERFACE ] );
  274. RESET_ATTR( DisallowedAttrs[ NODE_PIPE_INTERFACE ], ATTR_GUID );
  275. RESET_ATTR( DisallowedAttrs[ NODE_PIPE_INTERFACE ], ATTR_VERSION );
  276. RESET_ATTR( DisallowedAttrs[ NODE_PIPE_INTERFACE ], ATTR_OBJECT );
  277. RESET_ATTR( DisallowedAttrs[ NODE_PIPE_INTERFACE ], ATTR_IMPLICIT );
  278. RESET_ATTR( DisallowedAttrs[ NODE_PIPE_INTERFACE ], ATTR_EXPLICIT );
  279. RESET_ATTR( DisallowedAttrs[ NODE_PIPE_INTERFACE ], ATTR_CODE );
  280. RESET_ATTR( DisallowedAttrs[ NODE_PIPE_INTERFACE ], ATTR_NOCODE );
  281. RESET_ATTR( DisallowedAttrs[ NODE_PIPE_INTERFACE ], ATTR_OPTIMIZE );
  282. RESET_ATTR( DisallowedAttrs[ NODE_PIPE_INTERFACE ], ATTR_RANGE );
  283. // turn off bits for attributes allowed on library
  284. SET_ALL_ATTR( DisallowedAttrs[ NODE_LIBRARY ] );
  285. RESET_ATTR( DisallowedAttrs[ NODE_LIBRARY ], ATTR_GUID );
  286. RESET_ATTR( DisallowedAttrs[ NODE_LIBRARY ], ATTR_VERSION );
  287. RESET_ATTR( DisallowedAttrs[ NODE_LIBRARY ], ATTR_HELPCONTEXT );
  288. RESET_ATTR( DisallowedAttrs[ NODE_LIBRARY ], ATTR_HELPSTRINGCONTEXT );
  289. RESET_ATTR( DisallowedAttrs[ NODE_LIBRARY ], ATTR_HELPSTRING );
  290. RESET_ATTR( DisallowedAttrs[ NODE_LIBRARY ], ATTR_HELPFILE );
  291. RESET_ATTR( DisallowedAttrs[ NODE_LIBRARY ], ATTR_HELPSTRINGDLL );
  292. // MATTR_RESTRICTED is grouped under ATTR_MEMBER so allow ATTR_MEMBER
  293. RESET_ATTR( DisallowedAttrs[ NODE_LIBRARY ], ATTR_MEMBER );
  294. // TATTR_CONTROL is grouped under ATTR_TYPE so allow ATTR_TYPE
  295. RESET_ATTR( DisallowedAttrs[ NODE_LIBRARY ], ATTR_TYPE );
  296. RESET_ATTR( DisallowedAttrs[ NODE_LIBRARY ], ATTR_LCID);
  297. RESET_ATTR( DisallowedAttrs[ NODE_LIBRARY ], ATTR_HIDDEN );
  298. RESET_ATTR( DisallowedAttrs[ NODE_LIBRARY ], ATTR_CUSTOM );
  299. // turn off bits for attributes allowed on module
  300. SET_ALL_ATTR( DisallowedAttrs[ NODE_MODULE ] );
  301. RESET_ATTR( DisallowedAttrs[ NODE_MODULE ], ATTR_GUID );
  302. RESET_ATTR( DisallowedAttrs[ NODE_MODULE ], ATTR_VERSION );
  303. RESET_ATTR( DisallowedAttrs[ NODE_MODULE ], ATTR_HELPCONTEXT );
  304. RESET_ATTR( DisallowedAttrs[ NODE_MODULE ], ATTR_HELPSTRINGCONTEXT );
  305. RESET_ATTR( DisallowedAttrs[ NODE_MODULE ], ATTR_HELPSTRING );
  306. RESET_ATTR( DisallowedAttrs[ NODE_MODULE ], ATTR_TYPE );
  307. RESET_ATTR( DisallowedAttrs[ NODE_MODULE ], ATTR_MEMBER );
  308. RESET_ATTR( DisallowedAttrs[ NODE_MODULE ], ATTR_DLLNAME );
  309. RESET_ATTR( DisallowedAttrs[ NODE_MODULE ], ATTR_HIDDEN );
  310. RESET_ATTR( DisallowedAttrs[ NODE_MODULE ], ATTR_CUSTOM );
  311. // turn off bits for attributes allowed on dispinterface
  312. SET_ALL_ATTR( DisallowedAttrs[ NODE_DISPINTERFACE ] );
  313. RESET_ATTR( DisallowedAttrs[ NODE_DISPINTERFACE ], ATTR_GUID );
  314. RESET_ATTR( DisallowedAttrs[ NODE_DISPINTERFACE ], ATTR_VERSION );
  315. RESET_ATTR( DisallowedAttrs[ NODE_DISPINTERFACE ], ATTR_HELPCONTEXT );
  316. RESET_ATTR( DisallowedAttrs[ NODE_DISPINTERFACE ], ATTR_HELPSTRINGCONTEXT );
  317. RESET_ATTR( DisallowedAttrs[ NODE_DISPINTERFACE ], ATTR_HELPSTRING );
  318. RESET_ATTR( DisallowedAttrs[ NODE_DISPINTERFACE ], ATTR_TYPE );
  319. RESET_ATTR( DisallowedAttrs[ NODE_DISPINTERFACE ], ATTR_MEMBER );
  320. RESET_ATTR( DisallowedAttrs[ NODE_DISPINTERFACE ], ATTR_HIDDEN );
  321. RESET_ATTR( DisallowedAttrs[ NODE_DISPINTERFACE ], ATTR_CUSTOM );
  322. // turn off bits for attributes allowed on coclass
  323. SET_ALL_ATTR( DisallowedAttrs[ NODE_COCLASS ] );
  324. RESET_ATTR( DisallowedAttrs[ NODE_COCLASS ], ATTR_GUID );
  325. RESET_ATTR( DisallowedAttrs[ NODE_COCLASS ], ATTR_VERSION );
  326. RESET_ATTR( DisallowedAttrs[ NODE_COCLASS ], ATTR_HELPCONTEXT );
  327. RESET_ATTR( DisallowedAttrs[ NODE_COCLASS ], ATTR_HELPSTRINGCONTEXT );
  328. RESET_ATTR( DisallowedAttrs[ NODE_COCLASS ], ATTR_HELPSTRING );
  329. RESET_ATTR( DisallowedAttrs[ NODE_COCLASS ], ATTR_TYPE );
  330. RESET_ATTR( DisallowedAttrs[ NODE_COCLASS ], ATTR_MEMBER );
  331. RESET_ATTR( DisallowedAttrs[ NODE_COCLASS ], ATTR_HIDDEN );
  332. RESET_ATTR( DisallowedAttrs[ NODE_COCLASS ], ATTR_CUSTOM );
  333. // turn off bits for attributes allowed on enumeration labels
  334. SET_ALL_ATTR( DisallowedAttrs[ NODE_LABEL ] );
  335. RESET_ATTR( DisallowedAttrs[ NODE_LABEL ], ATTR_VERSION );
  336. RESET_ATTR( DisallowedAttrs[ NODE_LABEL ], ATTR_HELPCONTEXT );
  337. RESET_ATTR( DisallowedAttrs[ NODE_LABEL ], ATTR_HELPSTRINGCONTEXT );
  338. RESET_ATTR( DisallowedAttrs[ NODE_LABEL ], ATTR_HELPSTRING );
  339. RESET_ATTR( DisallowedAttrs[ NODE_LABEL ], ATTR_MEMBER );
  340. RESET_ATTR( DisallowedAttrs[ NODE_LABEL ], ATTR_IDLDESCATTR );
  341. RESET_ATTR( DisallowedAttrs[ NODE_LABEL ], ATTR_VARDESCATTR );
  342. RESET_ATTR( DisallowedAttrs[ NODE_LABEL ], ATTR_ID );
  343. RESET_ATTR( DisallowedAttrs[ NODE_LABEL ], ATTR_HIDDEN );
  344. RESET_ATTR( DisallowedAttrs[ NODE_LABEL ], ATTR_CUSTOM );
  345. // turn off bits for attributes allowed on proc (and return)
  346. SET_ALL_ATTR( DisallowedAttrs[ NODE_PROC ] );
  347. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_PTR_KIND );
  348. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_LOCAL );
  349. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_CODE );
  350. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_NOCODE );
  351. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_PTRSIZE );
  352. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_OPTIMIZE );
  353. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_MS_UNION );
  354. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_HANDLE );
  355. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_CONTEXT );
  356. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_NOSERIALIZE);
  357. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_SERIALIZE);
  358. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_IDEMPOTENT );
  359. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_BROADCAST );
  360. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_MAYBE );
  361. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_ASYNC );
  362. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_MESSAGE );
  363. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_INPUTSYNC );
  364. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_CALLBACK );
  365. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_COMMSTAT );
  366. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_FAULTSTAT );
  367. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_NOTIFY );
  368. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_NOTIFY_FLAG );
  369. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_ENABLE_ALLOCATE );
  370. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_EXPLICIT );
  371. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_STRING );
  372. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_SWITCH_TYPE );
  373. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_BYTE_COUNT );
  374. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_V1_ENUM );
  375. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_ENCODE );
  376. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_DECODE );
  377. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_CALL_AS );
  378. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_ID );
  379. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_HELPCONTEXT );
  380. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_HELPSTRINGCONTEXT );
  381. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_HELPSTRING );
  382. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_HIDDEN );
  383. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_MEMBER );
  384. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_ENTRY );
  385. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_VARDESCATTR );
  386. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_FUNCDESCATTR );
  387. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_IDLDESCATTR );
  388. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_CUSTOM );
  389. RESET_ATTR( DisallowedAttrs[ NODE_PROC ], ATTR_CSTAGRTN );
  390. // turn off bits for attributes allowed on typedef
  391. SET_ALL_ATTR( DisallowedAttrs[ NODE_DEF ] );
  392. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_PTR_KIND );
  393. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_TRANSMIT );
  394. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_WIRE_MARSHAL );
  395. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_HANDLE );
  396. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_REPRESENT_AS );
  397. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_USER_MARSHAL );
  398. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_CONTEXT );
  399. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_ALLOCATE );
  400. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_HEAP );
  401. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_STRING );
  402. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_BSTRING );
  403. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_FIRST );
  404. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_LAST );
  405. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_LENGTH );
  406. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_MIN );
  407. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_MAX );
  408. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_SIZE );
  409. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_RANGE );
  410. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_SWITCH_TYPE );
  411. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_MS_UNION );
  412. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_COMMSTAT );
  413. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_FAULTSTAT );
  414. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_BYTE_COUNT );
  415. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_SWITCH_IS );
  416. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_V1_ENUM );
  417. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_IID_IS );
  418. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_ENCODE );
  419. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_DECODE );
  420. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_ID );
  421. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_HELPCONTEXT );
  422. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_HELPSTRINGCONTEXT );
  423. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_HELPSTRING );
  424. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_HIDDEN );
  425. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_TYPE );
  426. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_MEMBER );
  427. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_TYPEDESCATTR );
  428. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_GUID );
  429. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_VERSION );
  430. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_CUSTOM );
  431. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_NOSERIALIZE );
  432. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_SERIALIZE );
  433. RESET_ATTR( DisallowedAttrs[ NODE_DEF ], ATTR_CSCHAR );
  434. // turn off bits for attributes allowed on param
  435. SET_ALL_ATTR( DisallowedAttrs[ NODE_PARAM ] );
  436. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_PTR_KIND );
  437. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_IN );
  438. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_OUT );
  439. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_PARTIAL_IGNORE );
  440. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_COMMSTAT );
  441. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_FAULTSTAT );
  442. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_HEAP );
  443. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_CONTEXT );
  444. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_NOSERIALIZE);
  445. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_SERIALIZE);
  446. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_HANDLE );
  447. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_BYTE_COUNT );
  448. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_SWITCH_IS );
  449. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_IID_IS );
  450. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_CASE );
  451. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_FIRST );
  452. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_LAST );
  453. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_LENGTH );
  454. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_MIN );
  455. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_MAX );
  456. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_SIZE );
  457. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_RANGE );
  458. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_STRING );
  459. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_ALLOCATE );
  460. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_BYTE_COUNT );
  461. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_SWITCH_TYPE );
  462. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_V1_ENUM );
  463. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_HIDDEN );
  464. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_MEMBER );
  465. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_IDLDESCATTR );
  466. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_VARDESCATTR );
  467. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_FLCID );
  468. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_DEFAULTVALUE );
  469. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_CUSTOM );
  470. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_DRTAG );
  471. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_RTAG );
  472. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_STAG );
  473. RESET_ATTR( DisallowedAttrs[ NODE_PARAM ], ATTR_FORCEALLOCATE );
  474. // turn off bits for attributes allowed on field
  475. SET_ALL_ATTR( DisallowedAttrs[ NODE_FIELD ] );
  476. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_PTR_KIND );
  477. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_SWITCH_IS );
  478. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_IID_IS );
  479. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_CASE );
  480. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_DEFAULT );
  481. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_FIRST );
  482. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_LAST );
  483. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_LENGTH );
  484. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_MIN );
  485. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_MAX );
  486. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_SIZE );
  487. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_RANGE );
  488. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_STRING );
  489. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_CONTEXT );
  490. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_NOSERIALIZE);
  491. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_SERIALIZE);
  492. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_ALLOCATE );
  493. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_IGNORE );
  494. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_BYTE_COUNT );
  495. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_SWITCH_TYPE );
  496. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_V1_ENUM );
  497. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_ID );
  498. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_HELPCONTEXT );
  499. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_HELPSTRINGCONTEXT );
  500. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_HELPSTRING );
  501. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_HIDDEN );
  502. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_MEMBER );
  503. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_IDLDESCATTR);
  504. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_VARDESCATTR);
  505. RESET_ATTR( DisallowedAttrs[ NODE_FIELD ], ATTR_CUSTOM);
  506. // turn off bits for attributes allowed on structs
  507. SET_ALL_ATTR( DisallowedAttrs[ NODE_STRUCT ] );
  508. RESET_ATTR( DisallowedAttrs[ NODE_STRUCT ], ATTR_GUID );
  509. RESET_ATTR( DisallowedAttrs[ NODE_STRUCT ], ATTR_CONTEXT );
  510. RESET_ATTR( DisallowedAttrs[ NODE_STRUCT ], ATTR_NOSERIALIZE);
  511. RESET_ATTR( DisallowedAttrs[ NODE_STRUCT ], ATTR_SERIALIZE);
  512. RESET_ATTR( DisallowedAttrs[ NODE_STRUCT ], ATTR_HIDDEN );
  513. RESET_ATTR( DisallowedAttrs[ NODE_STRUCT ], ATTR_TYPE );
  514. RESET_ATTR( DisallowedAttrs[ NODE_STRUCT ], ATTR_TYPEDESCATTR );
  515. RESET_ATTR( DisallowedAttrs[ NODE_STRUCT ], ATTR_CUSTOM );
  516. RESET_ATTR( DisallowedAttrs[ NODE_STRUCT ], ATTR_MEMBER );
  517. // turn off bits for attributes allowed on unions
  518. SET_ALL_ATTR( DisallowedAttrs[ NODE_UNION ] );
  519. RESET_ATTR( DisallowedAttrs[ NODE_UNION ], ATTR_GUID );
  520. RESET_ATTR( DisallowedAttrs[ NODE_UNION ], ATTR_CONTEXT );
  521. RESET_ATTR( DisallowedAttrs[ NODE_UNION ], ATTR_NOSERIALIZE);
  522. RESET_ATTR( DisallowedAttrs[ NODE_UNION ], ATTR_SERIALIZE);
  523. RESET_ATTR( DisallowedAttrs[ NODE_UNION ], ATTR_SWITCH_TYPE );
  524. RESET_ATTR( DisallowedAttrs[ NODE_UNION ], ATTR_SWITCH_IS );
  525. RESET_ATTR( DisallowedAttrs[ NODE_UNION ], ATTR_MS_UNION );
  526. RESET_ATTR( DisallowedAttrs[ NODE_UNION ], ATTR_HIDDEN );
  527. RESET_ATTR( DisallowedAttrs[ NODE_UNION ], ATTR_TYPE );
  528. RESET_ATTR( DisallowedAttrs[ NODE_UNION ], ATTR_TYPEDESCATTR );
  529. RESET_ATTR( DisallowedAttrs[ NODE_UNION ], ATTR_CUSTOM );
  530. }