home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / asmparse.grammar < prev    next >
Encoding:
Text File  |  2000-06-23  |  36.6 KB  |  854 lines

  1. Lexical tokens
  2.     ID - C style alphaNumeric identifier (e.g. Hello_There2)
  3.     QSTRING  - C style quoted string (e.g.  "hi\n")
  4.     SQSTRING - C style singlely quoted string(e.g.  'hi')
  5.     INT32    - C style 32 bit integer (e.g.  235,  03423, 0x34FFF)
  6.     INT64    - C style 64 bit integer (e.g.  -2353453636235234,  0x34FFFFFFFFFF)
  7.     FLOAT64  - C style floating point number (e.g.  -0.2323, 354.3423, 3435.34E-5)
  8.     INSTR_*  - IL instructions of a particular class (see opcode.def).
  9. ----------------------------------------------------------------------------------
  10. START           : decls
  11.                 ;      
  12.  
  13. decls                   : /* EMPTY */
  14.                         | decls decl                                            
  15.                         ;
  16.  
  17. decl                    : classHead '{' classDecls '}' 
  18.                         | nameSpaceHead '{' decls '}' 
  19.                         | methodHead  methodDecls '}' 
  20.                         | fieldDecl
  21.                         | dataDecl
  22.                                                 | vtableDecl
  23.                         | vtfixupDecl
  24.                         | extSourceSpec
  25.                         | fileDecl
  26.                         | exelocDecl
  27.                         | assemblyHead '{' assemblyDecls '}' 
  28.                         | assemblyRefHead '{' assemblyRefDecls '}' 
  29.                         | comtypeHead '{' comtypeDecls '}' 
  30.                         | manifestResHead '{' manifestResDecls '}' 
  31.                         | moduleHead
  32.                         | secDecl
  33.                         | customAttrDecl
  34.                         ;
  35.  
  36. customAttrDecl                  : '.custom' customType 
  37.                         | '.custom' customType '=' QSTRING 
  38.                         | customHead bytes ')' 
  39.                         ;
  40.  
  41. moduleHead              : '.module' 
  42.                         | '.module' name1 
  43.                         | '.module' 'extern' name1    
  44.                         ;
  45.  
  46. vtfixupDecl             : '.vtfixup' '[' int32 ']' vtfixupAttr 'at' id 
  47.                         ;
  48.  
  49. vtfixupAttr             : /* EMPTY */ 
  50.                         | vtfixupAttr 'int32' 
  51.                         | vtfixupAttr 'int64' 
  52.                         | vtfixupAttr 'fromunmanaged' 
  53.                         | vtfixupAttr 'callmostderived' 
  54.                         ;
  55.  
  56. vtableDecl              : vtableHead bytes ')' 
  57.                         ;
  58.  
  59. vtableHead              : '.vtable' '=' '(' 
  60.                         ;
  61.  
  62. nameSpaceHead                   : '.namespace' name1 
  63.                         ;
  64.  
  65. classHead               : '.class' classAttr id extendsClause implClause 
  66.                         ;
  67.  
  68. classAttr                               : /* EMPTY */ 
  69.                                                 | classAttr 'public' 
  70.                                                 | classAttr 'value' 
  71.                                                 | classAttr 'unmanaged' 
  72.                                                 | classAttr 'not_in_gc_heap' 
  73.                                                 | classAttr 'interface' 
  74.                                                 | classAttr 'sealed' 
  75.                                                 | classAttr 'abstract' 
  76.                                                 | classAttr 'auto' 
  77.                                                 | classAttr 'sequential' 
  78.                                                 | classAttr 'explicit' 
  79.                                                 | classAttr 'ansi' 
  80.                                                 | classAttr 'unicode' 
  81.                                                 | classAttr 'autochar' 
  82.                                                 | classAttr 'import' 
  83.                                                 | classAttr 'serializable' 
  84.                                         /*      | classAttr 'enum'  */
  85.                                                 | classAttr 'nested' 'public' 
  86.                                                 | classAttr 'nested' 'private' 
  87.                                                 | classAttr 'nested' 'family' 
  88.                                                 | classAttr 'nested' 'assembly' 
  89.                                                 | classAttr 'nested' 'famandassem' 
  90.                                                 | classAttr 'nested' 'famorassem' 
  91.                                                 | classAttr 'lateinit' 
  92.                                                 | classAttr 'specialname' 
  93.                                                 | classAttr 'rtspecialname' 
  94.                                                 ;
  95.  
  96. extendsClause                   : /* EMPTY */                                           
  97.                         | 'extends' className 
  98.                         ;
  99.  
  100. implClause              : /* EMPTY */
  101.                         | 'implements' classNames
  102.                                                 ;
  103.  
  104. classNames              : classNames ',' className 
  105.                         | className 
  106.                         ;
  107.  
  108. classDecls                              : /* EMPTY */
  109.                                                 | classDecls classDecl
  110.                                                 ;
  111.  
  112. classDecl               : methodHead methodDecls '}' 
  113.                         | classHead '{' classDecls '}' 
  114.                         | eventHead '{' eventDecls '}' 
  115.                         | propHead '{' propDecls '}' 
  116.                         | fieldDecl
  117.                         | dataDecl
  118.                                                 | secDecl
  119.                                                 | extSourceSpec
  120.                                                 | customAttrDecl
  121.                                                 | '.size' int32 
  122.                                                 | '.pack' int32 
  123.                                                 | comtypeHead '{' comtypeDecls '}' 
  124.                                                 | exportHead '{' comtypeDecls '}' 
  125.                                                 | '.override' typeSpec '::' methodName 'with' callConv type typeSpec '::' methodName '(' sigArgs0 ')' 
  126.                                                 ;
  127.  
  128. fieldDecl               : '.field' fieldAttr type id atOpt 
  129.                         | '.field' fieldAttr type id '=' fieldInit 
  130.                         | '.field' '[' int32 ']' fieldAttr type id 
  131.                         | '.field' '[' int32 ']' fieldAttr type id '=' fieldInit 
  132.                         ;
  133.  
  134.  
  135. atOpt                                   : /* EMPTY */  
  136.                                                 | 'at' label 
  137.                                                 ;
  138.  
  139. customHead              : '.custom' customType '=' '(' 
  140.                         ;
  141.  
  142. customType              : typeSpec 
  143.                         | callConv type typeSpec '::' methodName '(' sigArgs0 ')' 
  144.                         | callConv type methodName '(' sigArgs0 ')' 
  145.                         ;
  146.  
  147. eventHead               : '.event' eventAttr typeSpec id 
  148.                         | '.event' eventAttr id 
  149.                         ;
  150.  
  151.  
  152. eventAttr                               : /* EMPTY */ 
  153.                                                 | eventAttr 'rtspecialname' /**/
  154.                                                 | eventAttr 'specialname' 
  155.                                                 ;
  156.  
  157. eventDecls                              : /* EMPTY */
  158.                                                 | eventDecls eventDecl
  159.                                                 ;
  160.  
  161. eventDecl               : '.addon' callConv type typeSpec '::' methodName '(' sigArgs0 ')' 
  162.                         | '.addon' callConv type methodName '(' sigArgs0 ')' 
  163.                         | '.removeon' callConv type typeSpec '::' methodName '(' sigArgs0 ')' 
  164.                         | '.removeon' callConv type methodName '(' sigArgs0 ')' 
  165.                         | '.fire' callConv type typeSpec '::' methodName '(' sigArgs0 ')' 
  166.                         | '.fire' callConv type methodName '(' sigArgs0 ')' 
  167.                         | '.other' callConv type typeSpec '::' methodName '(' sigArgs0 ')' 
  168.                         | '.other' callConv type methodName '(' sigArgs0 ')' 
  169.                                                 | extSourceSpec
  170.                         | customAttrDecl
  171.                         ;
  172.  
  173. propHead                : '.property' propAttr callConv type id '(' sigArgs0 ')' 
  174.                                                 ;
  175.  
  176. propAttr                                : /* EMPTY */ 
  177.                                                 | propAttr 'rtspecialname' /**/
  178.                                                 | propAttr 'specialname' 
  179.                                                 ;
  180.  
  181. propDecls                               : /* EMPTY */
  182.                                                 | propDecls propDecl
  183.                                                 ;
  184.  
  185.  
  186. propDecl                : '.set' callConv type typeSpec '::' methodName '(' sigArgs0 ')' 
  187.                         | '.set' callConv type methodName '(' sigArgs0 ')' 
  188.                         | '.get' callConv type typeSpec '::' methodName '(' sigArgs0 ')' 
  189.                         | '.get' callConv type methodName '(' sigArgs0 ')' 
  190.                         | '.other' callConv type typeSpec '::' methodName '(' sigArgs0 ')' 
  191.                         | '.other' callConv type methodName '(' sigArgs0 ')' 
  192.                         | '.backing' type id 
  193.                         | customAttrDecl
  194.                                                 | extSourceSpec
  195.                         ;
  196.  
  197.  
  198. methodHeadPart1                 : '.method' 
  199.                         ;
  200.  
  201. methodHead              : methodHeadPart1 methAttr callConv paramAttr type methodName '(' sigArgs0 ')' implAttr '{' 
  202.                         | methodHeadPart1 methAttr callConv paramAttr type 'marshal' '(' nativeType ')' methodName '(' sigArgs0 ')' implAttr '{' 
  203.                         ;
  204.  
  205.  
  206. methAttr                                : /* EMPTY */ 
  207.                                                 | methAttr 'static' 
  208.                                                 | methAttr 'public' 
  209.                                                 | methAttr 'private' 
  210.                                                 | methAttr 'family' 
  211.                                                 | methAttr 'final' 
  212.                                                 | methAttr 'specialname' 
  213.                                                 | methAttr 'virtual' 
  214.                                                 | methAttr 'abstract' 
  215.                                                 | methAttr 'assembly' 
  216.                                                 | methAttr 'famandassem' 
  217.                                                 | methAttr 'famorassem' 
  218.                                                 | methAttr 'privatescope' 
  219.                                                 | methAttr 'hidebysig' 
  220.                                                 | methAttr 'newslot' 
  221.                                                 | methAttr 'rtspecialname' /**/
  222.                                                 | methAttr 'unmanagedexp' 
  223.                                                 | methAttr 'pinvokeimpl' '(' QSTRING 'as' QSTRING pinvAttr ')' 
  224.                                                 | methAttr 'pinvokeimpl' '(' QSTRING  pinvAttr ')' 
  225.                                                 | methAttr 'pinvokeimpl' '(' pinvAttr ')' 
  226.                                                 ;
  227.  
  228. pinvAttr                : /* EMPTY */ 
  229.                         | pinvAttr 'nomangle' 
  230.                         | pinvAttr 'ansi' 
  231.                         | pinvAttr 'unicode' 
  232.                         | pinvAttr 'autochar' 
  233.                         | pinvAttr 'ole' 
  234.                         | pinvAttr 'lasterr' 
  235.                         | pinvAttr 'winapi' 
  236.                         | pinvAttr 'cdecl' 
  237.                         | pinvAttr 'stdcall' 
  238.                         | pinvAttr 'thiscall' 
  239.                         | pinvAttr 'fastcall' 
  240.                         ;
  241.  
  242. methodName              : '.ctor' 
  243.                         | '.cctor' 
  244.                         | name1 
  245.                         ;
  246.  
  247. paramAttr               : /* EMPTY */ 
  248.                         | paramAttr '[' 'in' ']' 
  249.                         | paramAttr '[' 'out' ']' 
  250.                         | paramAttr '[' 'opt' ']' 
  251.                         | paramAttr '[' 'lcid' ']' 
  252.                         | paramAttr '[' 'retval' ']' 
  253.                                                 | paramAttr '[' int32 ']'  
  254.                         ;
  255.         
  256. fieldAttr                               : /* EMPTY */ 
  257.                                                 | fieldAttr 'static' 
  258.                                                 | fieldAttr 'public' 
  259.                                                 | fieldAttr 'private' 
  260.                                                 | fieldAttr 'family' 
  261.                                                 | fieldAttr 'initonly' 
  262.                                                 | fieldAttr 'rtspecialname'  /**/
  263.                                                 | fieldAttr 'specialname' 
  264.                                                 | fieldAttr 'pinvokeimpl' '(' QSTRING 'as' QSTRING pinvAttr ')' 
  265.                                                 | fieldAttr 'pinvokeimpl' '(' QSTRING  pinvAttr ')' 
  266.                                                 | fieldAttr 'pinvokeimpl' '(' pinvAttr ')' 
  267.                                                 | fieldAttr 'marshal' '(' nativeType ')' 
  268.                                                 | fieldAttr 'assembly' 
  269.                                                 | fieldAttr 'famandassem' 
  270.                                                 | fieldAttr 'famorassem' 
  271.                                                 | fieldAttr 'privatescope' 
  272.                                                 | fieldAttr 'literal' 
  273.                                                 | fieldAttr 'notserialized' 
  274.                                                 ;
  275.  
  276. implAttr                : /* EMPTY */ 
  277.                         | implAttr 'native' 
  278.                         | implAttr 'il' 
  279.                         | implAttr 'optil' 
  280.                         | implAttr 'managed' 
  281.                         | implAttr 'unmanaged' 
  282.                         | implAttr 'forwardref' 
  283.                         | implAttr 'ole' 
  284.                         | implAttr 'runtime' 
  285.                         | implAttr 'internalcall' 
  286.                         | implAttr 'synchronized' 
  287.                         | implAttr 'noinlining' 
  288.                         ;
  289.  
  290. localsHead              : '.locals' 
  291.                         ;
  292.  
  293.  
  294. methodDecl                              : '.emitbyte' int32 
  295.                         | sehBlock 
  296.                         | '.maxstack' int32 
  297.                         | localsHead '(' sigArgs0 ')' 
  298.                         | localsHead 'init' '(' sigArgs0 ')' 
  299.                         | '.entrypoint' 
  300.                         | '.zeroinit' 
  301.                         | dataDecl
  302.                         | instr
  303.                         | label ':' 
  304.                                                 | secDecl
  305.                                                 | extSourceSpec
  306.                                                 | customAttrDecl
  307.                                                 | '.vtentry' int32 ':' int32 
  308.                                                 | '.override' typeSpec '::' methodName 
  309.                                                 | scopeBlock
  310.                                                 | '.param' '[' int32 ']' 
  311.                                                 | '.param' '[' int32 ']' '=' fieldInit 
  312.                                                 ;
  313.  
  314. scopeBlock                              : scopeOpen methodDecls '}' 
  315.                                                 ;
  316.  
  317. scopeOpen                               : '{' 
  318.                                                 ;
  319.  
  320. sehBlock                : tryBlock sehClauses
  321.                         ;
  322.  
  323. sehClauses              : sehClause sehClauses
  324.                         | sehClause
  325.                         ;
  326.  
  327. tryBlock                : tryHead scopeBlock 
  328.                         | tryHead label 'to' label 
  329.                         | tryHead int32 'to' int32 
  330.                         ;
  331.  
  332. tryHead                 : '.try' 
  333.                         ;
  334.  
  335.  
  336. sehClause               : catchClause handlerBlock 
  337.                         | filterClause handlerBlock 
  338.                         | finallyClause handlerBlock 
  339.                         | faultClause handlerBlock 
  340.                         ;
  341.  
  342.                                                                                                                                 
  343. filterClause                    : filterHead scopeBlock 
  344.                         | filterHead label 
  345.                         | filterHead int32 
  346.                         ;
  347.  
  348. filterHead              : 'filter'  
  349.                         ;
  350.  
  351. catchClause             : 'catch' className 
  352.                         ;
  353.  
  354. finallyClause                   : 'finally' 
  355.                         ;
  356.  
  357. faultClause             : 'fault' 
  358.                         ;
  359.  
  360. handlerBlock                    : scopeBlock                  
  361.                         | 'handler' label 'to' label 
  362.                         | 'handler' int32 'to' int32 
  363.                         ;
  364.  
  365.  
  366. methodDecls                             : /* EMPTY */
  367.                                                 | methodDecls methodDecl
  368.                                                 ;
  369.  
  370. dataDecl                : ddHead ddBody
  371.                         ;
  372.  
  373. ddHead                  : '.data' tls id '=' 
  374.                         | '.data' tls  
  375.                         ;
  376.  
  377. tls                     : /* EMPTY */ 
  378.                         | 'tls' 
  379.                         ;
  380.  
  381. ddBody                  : '{' ddItemList '}'
  382.                         | ddItem
  383.                         ;
  384.  
  385. ddItemList              : ddItem ',' ddItemList
  386.                         | ddItem
  387.                         ;
  388.  
  389. ddItemCount             : /* EMPTY */ 
  390.                         | '[' int32 ']' 
  391.                         ;
  392.  
  393. ddItem                  : 'char' '*' '(' QSTRING ')' 
  394.                         | 'wchar' '*' '(' QSTRING        ')' 
  395.                         | '&' '(' id ')' 
  396.                         | bytearrayhead bytes ')' 
  397.                         | 'float32' '(' float64 ')' ddItemCount 
  398.                         | 'float64' '(' float64 ')' ddItemCount 
  399.                         | 'int64' '(' int64 ')' ddItemCount  
  400.                         | 'int32' '(' int32 ')' ddItemCount  
  401.                         | 'int16' '(' int32 ')' ddItemCount 
  402.                         | 'int8' '(' int32 ')' ddItemCount 
  403.                         | 'float32' ddItemCount 
  404.                         | 'float64' ddItemCount 
  405.                         | 'int64' ddItemCount  
  406.                         | 'int32' ddItemCount  
  407.                         | 'int16' ddItemCount 
  408.                         | 'int8' ddItemCount 
  409.                         ;
  410.  
  411. fieldInit               : 'float32' '(' float64 ')' 
  412.                         | 'float64' '(' float64 ')' 
  413.                         | 'float32' '(' int64 ')' 
  414.                         | 'float64' '(' int64 ')' 
  415.                         | 'int64' '(' int64 ')'  
  416.                         | 'int32' '(' int64 ')' 
  417.                         | 'int16' '(' int64 ')' 
  418.                         | 'int8' '(' int64 ')' 
  419.                         | QSTRING 
  420.                         | 'wchar' '*' '(' QSTRING ')' 
  421.                         | bytearrayhead bytes ')' 
  422.                         ;
  423.  
  424. bytearrayhead                   : 'bytearray' '(' 
  425.                         ;
  426.  
  427. bytes                   : HEXBYTE 
  428.                         | bytes HEXBYTE 
  429.                         ;
  430.  
  431. instr_r_head                    : INSTR_R '(' 
  432.                         ;
  433.  
  434. methodSpec                              : 'method' 
  435.                                                 ;
  436.  
  437. instr                   : INSTR_NONE 
  438.                         | INSTR_VAR int32 
  439.                         | INSTR_VAR id 
  440.                         | INSTR_I int32 
  441.                         | INSTR_I8 int64 
  442.                         | INSTR_R float64 
  443.                         | INSTR_R int64 
  444.                         | instr_r_head bytes ')' 
  445.                         | INSTR_BRTARGET int32 
  446.                         | INSTR_BRTARGET label 
  447.                         | INSTR_METHOD callConv type typeSpec '::' methodName '(' sigArgs0 ')' 
  448.                         | INSTR_METHOD callConv type methodName '(' sigArgs0 ')' 
  449.                         | INSTR_FIELD type typeSpec '::' id 
  450.                         | INSTR_FIELD type id 
  451.                         | INSTR_TYPE typeSpec 
  452.                         | INSTR_STRING QSTRING 
  453.                         | INSTR_STRING bytearrayhead bytes ')' 
  454.                         | INSTR_SIG callConv type '(' sigArgs0 ')' 
  455.                         | INSTR_RVA label 
  456.                         | INSTR_RVA int32 
  457.                         | INSTR_TOK methodSpec callConv type typeSpec '::' methodName '(' sigArgs0 ')' 
  458.                         | INSTR_TOK methodSpec callConv type methodName '(' sigArgs0 ')' 
  459.                         | INSTR_TOK 'field' type typeSpec '::' id 
  460.                         | INSTR_TOK 'field' type id 
  461.                         | INSTR_TOK typeSpec 
  462.                         | INSTR_SWITCH '(' labels ')' 
  463.                         | INSTR_PHI int16s 
  464.                         ;
  465.  
  466. sigArgs0                : /* EMPTY */ 
  467.                         | sigArgs1 
  468.                         ;
  469.  
  470. sigArgs1                : sigArg 
  471.                         | sigArgs1 ',' sigArg 
  472.                         ;
  473.  
  474. sigArg                  : '...' 
  475.                         | paramAttr type 
  476.                         | paramAttr type id 
  477.                         | paramAttr type 'marshal' '(' nativeType ')' 
  478.                         | paramAttr type 'marshal' '(' nativeType ')' id 
  479.                         ;
  480.  
  481. name1                   : id 
  482.                         | name1 '.' id 
  483.                         ;
  484.  
  485. className                               : '[' name1 ']' slashedName 
  486.                                                 | '[' '.module' name1 ']' slashedName 
  487.                                                 | slashedName 
  488.                                                 ;
  489.  
  490. slashedName             : name1 
  491.                                                 | slashedName '/' name1 
  492.                         ;
  493.  
  494. typeSpec                : className 
  495.                                                 | '[' name1 ']' 
  496.                                                 | '[' '.module' name1 ']' 
  497.                         | type 
  498.                         ;
  499.  
  500. callConv                : 'instance' callConv 
  501.                         | 'explicit' callConv 
  502.                         | callKind 
  503.                         ;
  504.  
  505. callKind                : /* EMPTY */ 
  506.                         | 'default' 
  507.                         | 'vararg' 
  508.                         | 'unmanaged' 'cdecl' 
  509.                         | 'unmanaged' 'stdcall' 
  510.                         | 'unmanaged' 'thiscall' 
  511.                         | 'unmanaged' 'fastcall' 
  512.                         ;
  513.  
  514. nativeType              : /* EMPTY */  
  515.                                                 | 'custom' '(' QSTRING ',' QSTRING ',' QSTRING ',' QSTRING ')' 
  516.                         | 'fixed' 'sysstring' '[' int32 ']' 
  517.                         | 'fixed' 'array' '[' int32 ']' 
  518.                         | 'variant' 
  519.                         | 'currency' 
  520.                         | 'syschar' 
  521.                         | 'void' 
  522.                         | 'bool' 
  523.                         | 'int8' 
  524.                         | 'int16' 
  525.                         | 'int32' 
  526.                         | 'int64' 
  527.                         | 'float32' 
  528.                         | 'float64' 
  529.                         | 'unsigned' 'int8' 
  530.                         | 'unsigned' 'int16' 
  531.                         | 'unsigned' 'int32' 
  532.                         | 'unsigned' 'int64' 
  533.                         | nativeType '*' 
  534.                         | nativeType '[' ']' 
  535.                         | nativeType '[' int32 ']' 
  536.                         | nativeType '[' '.size' '.param' '=' int32 ']' 
  537.                         | nativeType '[' '.size' '.param' '=' int32 '*' int32 ']' 
  538.                         | 'decimal' 
  539.                         | 'date' 
  540.                         | 'bstr' 
  541.                         | 'lpstr' 
  542.                         | 'lpwstr' 
  543.                         | 'lptstr' 
  544.                         | 'objectref' 
  545.                         | 'iunknown' 
  546.                         | 'idispatch' 
  547.                         | 'struct' 
  548.                         | 'interface' 
  549.                         | 'safearray' variantType 
  550.                         | 'int' 
  551.                         | 'unsigned' 'int' 
  552.                         | 'nested' 'struct' 
  553.                         | 'byvalstr' 
  554.                         | 'ansi' 'bstr' 
  555.                         | 'tbstr' 
  556.                         | 'variant' 'bool' 
  557.                         | methodSpec 
  558.                         | 'lpvoid' 
  559.                         | 'as' 'any' 
  560.                         | 'float' 
  561.                         | 'lpstruct' 
  562.                         ;
  563.  
  564. variantType             : /* EMPTY */ 
  565.                                                 | 'null' 
  566.                         | 'variant' 
  567.                         | 'currency' 
  568.                         | 'void' 
  569.                         | 'bool' 
  570.                         | 'int8' 
  571.                         | 'int16' 
  572.                         | 'int32' 
  573.                         | 'int64' 
  574.                         | 'float32' 
  575.                         | 'float64' 
  576.                         | 'unsigned' 'int8' 
  577.                         | 'unsigned' 'int16' 
  578.                         | 'unsigned' 'int32' 
  579.                         | 'unsigned' 'int64' 
  580.                         | '*' 
  581.                         | variantType '[' ']' 
  582.                         | variantType 'vector' 
  583.                         | variantType '&' 
  584.                         | 'decimal' 
  585.                         | 'date' 
  586.                         | 'bstr' 
  587.                         | 'lpstr' 
  588.                         | 'lpwstr' 
  589.                         | 'iunknown' 
  590.                         | 'idispatch' 
  591.                         | 'safearray' 
  592.                         | 'int' 
  593.                         | 'unsigned' 'int' 
  594.                         | 'error' 
  595.                         | 'hresult' 
  596.                         | 'carray' 
  597.                         | 'userdefined' 
  598.                         | 'record' 
  599.                         | 'filetime' 
  600.                         | 'blob' 
  601.                         | 'stream' 
  602.                         | 'storage' 
  603.                         | 'streamed_object' 
  604.                         | 'stored_object' 
  605.                         | 'blob_object' 
  606.                         | 'cf' 
  607.                         | 'clsid' 
  608.                         ;
  609.  
  610. type                    : 'class' className  
  611.                         | 'value' 'class' className  
  612.                         | type '[' '?' ']'  
  613.                         | type '[' ']'  
  614.                         | type '[' bounds1 ']'  
  615.                         | type 'value' '[' int32 ']' 
  616.                         | type '&' 
  617.                         | type '*' 
  618.                         | type '%' 
  619.                         | type 'pinned' 
  620.                         | type 'modreq' '(' className ')' 
  621.                         | type 'modopt' '(' className ')' 
  622.                         | '!' int32 
  623.                         | methodSpec callConv type '*' '(' sigArgs0 ')' 
  624.                         | 'typedref' 
  625.                         | 'wchar' 
  626.                         | 'char' 
  627.                         | 'void' 
  628.                         | 'bool' 
  629.                         | 'int8' 
  630.                         | 'int16' 
  631.                         | 'int32' 
  632.                         | 'int64' 
  633.                         | 'float32' 
  634.                         | 'float64' 
  635.                         | 'unsigned' 'int8' 
  636.                         | 'unsigned' 'int16' 
  637.                         | 'unsigned' 'int32' 
  638.                         | 'unsigned' 'int64' 
  639.                         | 'native' 'int' 
  640.                         | 'native' 'unsigned' 'int' 
  641.                         | 'native' 'float' 
  642.                         ;
  643.  
  644. bounds1                 : bound 
  645.                         | bounds1 ',' bound 
  646.                         ;
  647.  
  648. bound                   : /* EMPTY */ 
  649.                                                 | '...' 
  650.                         | int32  
  651.                         | int32 '...' int32    
  652.                         | int32 '...'  
  653.                         ;
  654.  
  655. labels                  : /* empty */ 
  656.                         | label ',' labels 
  657.                         | int32 ',' labels 
  658.                         | label 
  659.                         | int32 
  660.                         ;
  661.  
  662. label                   : ID 
  663.                         ; 
  664.  
  665. id                                              : ID 
  666.                                                 | SQSTRING 
  667.                                                 ;
  668.  
  669. int16s                  : /* EMPTY */ 
  670.                         | int16s int32 
  671.                         ;
  672.                                 
  673. int32                   : INT64 
  674.                         ;
  675.  
  676. int64                   : INT64 
  677.                         ;
  678.  
  679. float64                 : FLOAT64 
  680.                                                 | 'float32' '(' int32 ')' 
  681.                                                 | 'float64' '(' int64 ')' 
  682.                         ;
  683.  
  684. secDecl                                 : '.permission' secAction className '(' nameValPairs ')' 
  685.                                                 | '.capability' secAction SQSTRING 
  686.                         | capHead bytes ')' 
  687.                                                 ;
  688.  
  689. capHead                 : '.capability' secAction '=' '(' 
  690.                         ;
  691.  
  692. nameValPairs                    : nameValPair 
  693.                                                 | nameValPair ',' nameValPairs 
  694.                                                 ;
  695.  
  696. nameValPair                             : SQSTRING '=' SQSTRING 
  697.                                                 ;
  698.  
  699. secAction                               : 'request' 
  700.                                                 | 'demand' 
  701.                                                 | 'assert' 
  702.                                                 | 'deny' 
  703.                                                 | 'permitonly' 
  704.                                                 | 'linkcheck' 
  705.                                                 | 'inheritcheck' 
  706.                                                 | 'reqmin' 
  707.                                                 | 'reqopt' 
  708.                                                 | 'reqrefuse' 
  709.                                                 | 'prejitgrant' 
  710.                                                 | 'prejitdeny' 
  711.                                                 | 'noncasdemand' 
  712.                                                 | 'noncaslinkdemand' 
  713.                                                 | 'noncasinheritance' 
  714.                         ;
  715.  
  716. extSourceSpec                   : '.line' int32 SQSTRING 
  717.                         | '.line' int32 
  718.                         | P_LINE int32 QSTRING 
  719.                         ;
  720.  
  721. fileDecl                : '.file' fileAttr name1 hashHead bytes ')' 
  722.                         | '.file' fileAttr name1 
  723.                         ;
  724.  
  725. fileAttr                : /* EMPTY */ 
  726.                         | fileAttr 'readonly' 
  727.                         | fileAttr 'nometadata' 
  728.                         ;
  729.  
  730. hashHead                : '.hash' '=' '(' 
  731.                         ;
  732.  
  733. exelocDecl              : '.exeloc' name1 '(' QSTRING ')' 'at' QSTRING 
  734.                         | '.exeloc' name1 'at' QSTRING 
  735.                         ;
  736.  
  737. assemblyHead                    : '.assembly' asmAttr name1 'as' QSTRING 
  738.                         | '.assembly' asmAttr name1 
  739.                         ;
  740.  
  741. asmAttr                 : /* EMPTY */ 
  742.                         | asmAttr 'implicitcom' 
  743.                         | asmAttr 'implicitres' 
  744.                         | asmAttr 'noappdomain' 
  745.                         | asmAttr 'noprocess' 
  746.                         | asmAttr 'nomachine' 
  747.                         ;
  748.  
  749. assemblyDecls                   : /* EMPTY */
  750.                         | assemblyDecls assemblyDecl
  751.                         ;
  752.  
  753. assemblyDecl                    : '.title' QSTRING '(' QSTRING ')' 
  754.                         | '.title' QSTRING 
  755.                         | '.hash' 'algorithm' int32 
  756.                         | secDecl
  757.                         | asmOrRefDecl
  758.                         ;
  759.  
  760. asmOrRefDecl                    : originatorHead bytes ')' 
  761.                         | '.ver' int32 ':' int32 ':' int32 ':' int32 
  762.                         | '.locale' QSTRING 
  763.                                                 | localeHead bytes ')' 
  764.                         | '.processor' int32 
  765.                         | '.os' int32 '.ver' int32 ':' int32 
  766.                         | '.config' QSTRING 
  767.                         | configHead bytes ')' 
  768.                         | customAttrDecl
  769.                         ;
  770.  
  771. originatorHead                  : '.originator' '=' '(' 
  772.                         ;
  773.  
  774. localeHead                              : '.locale' '=' '(' 
  775.                         ;
  776.  
  777. configHead              : '.config' '=' '(' 
  778.                         ;
  779.  
  780. assemblyRefHead                 : '.assembly' 'extern' asmRefAttr name1 'as' QSTRING 
  781.                         | '.assembly' 'extern' asmRefAttr name1 
  782.                         ;
  783.  
  784. asmRefAttr              : /* EMPTY */ 
  785.                         | asmRefAttr 'fullorigin' 
  786.                         ;
  787.  
  788. assemblyRefDecls                : /* EMPTY */
  789.                         | assemblyRefDecls assemblyRefDecl
  790.                         ;
  791.  
  792. assemblyRefDecl                 : hashHead bytes ')' 
  793.                         | '.exeloc' name1 
  794.                         | asmOrRefDecl
  795.                         ;
  796.  
  797. comtypeHead             : '.comtype' comtAttr name1 '(' QSTRING ')' 
  798.                         | '.comtype' comtAttr name1 
  799.                         ;
  800.  
  801. exportHead              : '.export' comtAttr name1 '(' QSTRING ')' 
  802.                         | '.export' comtAttr name1 
  803.                         ;
  804.  
  805. comtAttr                : /* EMPTY */ 
  806.                         | comtAttr 'private' 
  807.                         | comtAttr 'public' 
  808.                                                 | comtAttr 'nested' 'public' 
  809.                                                 | comtAttr 'nested' 'private' 
  810.                                                 | comtAttr 'nested' 'family' 
  811.                                                 | comtAttr 'nested' 'assembly' 
  812.                                                 | comtAttr 'nested' 'famandassem' 
  813.                                                 | comtAttr 'nested' 'famorassem' 
  814.                         ;
  815.  
  816. comtypeDecls                    : /* EMPTY */
  817.                         | comtypeDecls comtypeDecl
  818.                         ;
  819.  
  820. comtypeDecl             : '.file' name1 
  821.                         | '.assembly' 'extern' name1 
  822.                                                 | '.comtype' name1 
  823.                         | '.class'  int32 
  824.                         | '.exeloc' name1 
  825.                         | customAttrDecl
  826.                         ;
  827.  
  828. manifestResHead                 : '.manifestres' manresAttr name1 '(' QSTRING ')' 
  829.                         | '.manifestres' manresAttr name1 
  830.                         ;
  831.  
  832. manresAttr              : /* EMPTY */ 
  833.                         | manresAttr 'public' 
  834.                         | manresAttr 'private' 
  835.                         ;
  836.  
  837. manifestResDecls                : /* EMPTY */
  838.                         | manifestResDecls manifestResDecl
  839.                         ;
  840.  
  841. manifestResDecl                 : '.mime' QSTRING 
  842.                         | mimeHead bytes ')' 
  843.                                                 | '.file' name1 'at' int32 
  844.                         | '.assembly' 'extern' name1 
  845.                         | '.locale' QSTRING 
  846.                                                 | localeHead bytes ')' 
  847.                         | customAttrDecl
  848.                         ;
  849.  
  850. mimeHead                : '.mime' '=' '(' 
  851.                         ;
  852.  
  853.  
  854.