8 Appendix C: Full ABNF

 start-rule = 
       *( interface / import / export / oa-scope / oa-dispinterface )
  
 ; Automation scope
 oa-scope = oa-library-header LWSP "{" oa-library-body "}" LWSP [";"]
 oa-library-header = 
     "[" LWSP library-attributes LWSP "]" LWSP kw-library LWSP 
     Identifier
 oa-library-body = *oa-library-declarator
  
 library-attributes = 
     library-attribute *( "," LWSP library-attribute LWSP )
 library-attribute = uuid-attr / 
     version-attr / 
     lcid-attr / 
     help-attr / 
     custom-attr / 
     kw-control / 
     kw-hidden / 
     kw-restricted
  
 uuid-attr = kw-uuid LWSP "(" LWSP uuid-rep LWSP ")"
  
 version-attr = 
     kw-version LWSP "(" LWSP 1*DIGIT *( "." 1*DIGIT ) LWSP ")"
  
 lcid-attr = kw-lcid LWSP "(" LWSP integer-const-exp LWSP ")"
  
 help-attr = helpcontext-attr / 
     helpfile-attr / 
     helpstring-attr / 
     helpstringcontext-attr / 
     helpstringdll-attr
 helpcontext-attr = 
     kw-helpcontext LWSP "(" LWSP integer-const-exp LWSP ")"
 helpfile-attr = kw-helpfile LWSP "(" LWSP string LWSP ")"
 helpstring-attr = kw-helpstring LWSP "(" LWSP string LWSP ")"
 helpstringcontext-attr = 
     kw-helpstringcontext LWSP "(" LWSP integer-const-exp LWSP ")"
 helpstringdll-attr = kw-helpstringdll LWSP "(" LWSP string LWSP ")"
  
 custom-attr = 
     kw-custom LWSP "(" uuid-rep LWSP "," LWSP const-exp LWSP ")"
  
 oa-library-declarator = interface / 
     import / 
     export / 
     oa-importlib / 
     oa-module / 
     oa-dispinterface / 
     oa-coclass
  
 type-attribute = rpcidl-defined / 
     uuid-attr / 
     help-attr / 
     custom-attr / 
     kw-public / 
     kw-restricted
  
 ; Automation Compatible Types
 oa-type-spec = oa-base-type-spec / 
     oa-safearray-type-spec / 
     oa-ptr-type-spec / 
     Identifier
  
 oa-base-type-spec = oa-base-nondecimal-type-spec / kw-Decimal
  
 oa-base-nondecimal-type-spec = kw-boolean / 
     [kw-unsigned] LWSP kw-char / 
     [kw-unsigned] LWSP kw-short / 
     [kw-unsigned] LWSP kw-int / 
     [kw-unsigned] LWSP kw-long / 
     kw-double / 
     kw-float / 
     kw-BSTR / 
     kw-CURRENCY / 
     kw-DATE / 
     kw-SCODE
     
 oa-safearray-type-spec = 
     kw-SAFEARRAY "(" oa-base-nondecimal-type-spec ")" / 
     kw-SAFEARRAY "(" oa-ptr-type-spec ")" / 
     kw-SAFEARRAY "(" Identifier ")"
  
 oa-ptr-type-spec = oa-base-nondecimal-type-spec "*" / 
     oa-safearray-type-spec "*" / 
     Identifier "*"
  
 ; Automation Interfaces
 interface-attribute = rpcidl-defined / 
     attr-oleautomation / 
     attr-dual / 
     kw-nonextensible / 
     kw-proxy / 
     custom-attr
  
 attr-oleautomation = kw-oleautomation
 attr-dual = kw-dual
  
 oa-dispinterface = 
     oa-dispitf-header LWSP "{" LWSP oa-dispitf-body LWSP "}"
 oa-dispitf-header = "[" interface-attributes "]" 
     LWSP kw-dispinterface LWSP Identifier
 oa-dispitf-body = oa-itf-ref / oa-odl-body
 oa-itf-ref = kw-interface LWSP Identifier LWSP ";"
  
 ; Automation Members
 operation-attribute = rpcidl-defined / 
     kw-id LWSP "(" LWSP integer-const-exp LWSP ")" / 
     kw-propget / 
     kw-propput / 
     kw-propputref / 
     kw-vararg / 
     kw-defaultcollelem / 
     kw-nonbrowsable / 
     kw-replaceable / 
     kw-restricted / 
     kw-uidefault / 
     kw-hidden / 
     oa-bindable-attr / 
     readonly-attr / 
     help-attr / 
     custom-attr
  
 oa-bindable-attr = kw-bindable / 
     kw-immediatebind / 
     kw-defaultbind / 
     kw-displaybind / 
     kw-requestedit
  
 oa-odl-body = 
     kw-properties LWSP ":" LWSP *oa-odl-prop LWSP 
     kw-methods LWSP ":" LWSP *oa-odl-method
 oa-odl-prop = 
     *( operation-attributes ) LWSP oa-type-spec LWSP 
     Identifier LWSP ";"
 oa-odl-method = op-declarator
 readonly-attr = kw-readonly
     
 ; Automation Parameters
 param-attribute = rpcidl-defined / 
     kw-defaultvalue LWSP "("   LWSP const-exp LWSP ")" / 
     kw-optional / 
     kw-lcid / 
     kw-retval / 
     custom-attr
  
 oa-coclass = "[" LWSP oa-coclass-attrs LWSP "]" LWSP 
       kw-coclass LWSP Identifier 
       LWSP "{" LWSP oa-coclass-body LWSP "}"
  
 oa-coclass-attrs = oa-coclass-attr *( LWSP ","  LWSP 
                    oa-coclass-attr)
 oa-coclass-attr = uuid-attr / 
     help-attr / 
     version-attr / 
     custom-attr / 
     kw-aggregatable / 
     kw-appobject / 
     kw-control / 
     kw-hidden / 
     kw-licensed / 
     kw-noncreatable / 
     kw-predeclid
  
 oa-coclass-body = *( oa-coclass-itf-decl )
 oa-coclass-itf-decl = [ "[" LWSP oa-cid-attrs LWSP "]" LWSP ] 
       ( kw-interface / kw-dispinterface ) LWSP Identifier LWSP ";"
 oa-cid-attrs = oa-cid-attr *( LWSP "," LWSP oa-cid-attr )
 oa-cid-attr = kw-source / 
     kw-default / 
     kw-defaultvtable / 
     kw-restricted
  
 oa-module = [ "[" LWSP oa-module-attrs  LWSP "]"  LWSP ] 
       kw-module LWSP Identifier LWSP 
       "{" oa-module-body "}"
  
 oa-module-attrs = oa-module-attr *( LWSP "," LWSP oa-module-attr )
 oa-module-attr = uuid-attr / 
     version-attr / 
     help-attr / 
     kw-dllname LWSP "(" LWSP string LWSP ")" / 
     kw-hidden
  
 oa-module-body = *( oa-const-stmt / oa-mmethod-stmt )
 oa-const-stmt = [ "[" LWSP *( help-attr ) LWSP "]" LWSP ] 
       ( kw-const / kw-static ) LWSP 
       oa-base-type-spec LWSP Identifier LWSP 
       "=" LWSP const-exp LWSP ";"
  
 oa-mmethod-stmt = [ "[" LWSP oa-mmethod-attrs LWSP "]" LWSP ] 
       oa-type-spec LWSP [ oa-mmethod-cc LWSP ] 
       Identifier LWSP param-declarators LWSP ";"
 oa-mmethod-attrs = oa-mmethod-attr *( LWSP "," LWSP oa-mmethod-attr )
 oa-mmethod-attr = 
     kw-entry LWSP "(" LWSP oa-entry-id LWSP ")" / 
     kw-propget / 
     kw-propput / 
     kw-propputref / 
     kw-usesgetlasterror / 
     kw-vararg / 
     help-attr
  
 oa-entry-id = string / integer-const-exp
 oa-mmethod-cc = kw-cdecl / 
     kw-stdcall / 
     kw-pascal
  
 oa-importlib = kw-importlib LWSP "(" LWSP string LWSP ")" LWSP ";"
  
 ; Automation keywords: case sensitive
 kw-aggregatable = %d97.103.103.114.101.103.97.116.97.98.108.101
 kw-appobject = %d97.112.112.111.98.106.101.99.116
 kw-bindable = %d98.105.110.100.97.98.108.101
 kw-boolean = %d98.111.111.108.101.97.110
 kw-BSTR = %d66.83.84.82
 kw-cdecl = %d99.100.101.99.108
 kw-char = %d99.104.97.114
 kw-coclass = %d99.111.99.108.97.115.115
 kw-const = %d99.111.110.115.116
 kw-control = %d99.111.110.116.114.111.108
 kw-CURRENCY = %d67.85.82.82.69.78.67.89
 kw-custom = %d99.117.115.116.111.109
 kw-DATE = %d68.65.84.69
 kw-Decimal = %d68.101.99.105.109.97.108
 kw-default = %d100.101.102.97.117.108.116
 kw-defaultbind = %d100.101.102.97.117.108.116.98.105.110.100
 kw-defaultcollelem = 
     %d100.101.102.97.117.108.116.99.111.108.108.101.108.101.109
 kw-defaultvalue = 
     %d100.101.102.97.117.108.116.118.97.108.117.101
 kw-defaultvtable = 
     %d100.101.102.97.117.108.116.118.116.97.98.108.101
 kw-dispinterface = 
     %d100.105.115.112.105.110.116.101.114.102.97.99.101
 kw-displaybind = 
     %d100.105.115.112.108.97.121.98.105.110.100
 kw-dllname = %d100.108.108.110.97.109.101
 kw-double = %d100.111.117.98.108.101
 kw-dual = %d100.117.97.108
 kw-entry = %d101.110.116.114.121
 kw-float = %d102.108.111.97.116
 kw-helpcontext = %d104.101.108.112.99.111.110.116.101.120.116
 kw-helpfile = %d104.101.108.112.102.105.108.101
 kw-helpstring = %d104.101.108.112.115.116.114.105.110.103
 kw-helpstringcontext = 
    %d104.101.108.112.115.116.114.105.110.103.99.111.110.116.101.120.116
 kw-helpstringdll = 
     %d104.101.108.112.115.116.114.105.110.103.100.108.108
 kw-hidden = %d104.105.100.100.101.110
 kw-id = %d105.100
 kw-immediatebind = 
    %d105.109.109.101.100.105.97.116.101.98.105.110.100
 kw-importlib = %d105.109.112.111.114.116.108.105.98
 kw-int = %d105.110.116
 kw-interface = %d105.110.116.101.114.102.97.99.101
 kw-lcid = %d108.99.105.100
 kw-library = %d108.105.98.114.97.114.121
 kw-licensed = %d108.105.99.101.110.115.101.100
 kw-long = %d108.111.110.103
 kw-methods = %d109.101.116.104.111.100.115
 kw-module = %d109.111.100.117.108.101
 kw-nonbrowsable = %d110.111.110.98.114.111.119.115.97.98.108.101
 kw-noncreatable = %d110.111.110.99.114.101.97.116.97.98.108.101
 kw-nonextensible = 
     %d110.111.110.101.120.116.101.110.115.105.98.108.101
 kw-oleautomation = 
     %d111.108.101.97.117.116.111.109.97.116.105.111.110
 kw-optional = %d111.112.116.105.111.110.97.108
 kw-pascal = %d112.97.115.99.97.108
 kw-predeclid = %d112.114.101.100.101.99.108.105.100
 kw-properties = %d112.114.111.112.101.114.116.105.101.115
 kw-propget = %d112.114.111.112.103.101.116
 kw-propput = %d112.114.111.112.112.117.116
 kw-propputref = %d112.114.111.112.112.117.116.114.101.102
 kw-proxy = %d112.114.111.120.121
 kw-public = %d112.117.98.108.105.99
 kw-readonly = %d114.101.97.100.111.110.108.121
 kw-replaceable = %d114.101.112.108.97.99.101.97.98.108.101
 kw-requestedit = %d114.101.113.117.101.115.116.101.100.105.116
 kw-restricted = %d114.101.115.116.114.105.99.116.101.100
 kw-retval = %d114.101.116.118.97.108
 kw-SAFEARRAY = %d83.65.70.69.65.82.82.65.89
 kw-SCODE = %d83.67.79.68.69
 kw-short = %d115.104.111.114.116
 kw-source = %d115.111.117.114.99.101
 kw-static = %d115.116.97.116.105.99
 kw-stdcall = %d115.116.100.99.97.108.108
 kw-uidefault = %d117.105.100.101.102.97.117.108.116
 kw-unsigned = %d117.110.115.105.103.110.101.100
 kw-uuid = %d117.117.105.100
 kw-usesgetlasterror = 
   %d117.115.101.115.103.101.116.108.97.115.116.101.114.114.111.114
 kw-vararg = %d118.97.114.97.114.103
 kw-version = %d118.101.114.115.105.111.110
  
 ; Rules defined in the [C706] IDL specification
 uuid-rep = rpcidl-defined
 string = rpcidl-defined
 const-exp = rpcidl-defined
 integer-const-exp = rpcidl-defined
 operation-attributes = rpcidl-defined
 op-declarator = rpcidl-defined
 interface-attributes = rpcidl-defined
 interface = rpcidl-defined
 import = rpcidl-defined
 export = rpcidl-defined
 param-declarators = rpcidl-defined
 Identifier = rpcidl-defined
  
 rpcidl-defined = "already defined"
  
 ;Tokens
  
  
 ; The ABNF Core rules
 ALPHA = %x41-5A / %x61-7A   ; A-Z / a-z
 BIT = "0" / "1"
 CHAR = %x01-7F
     ; any 7-bit US-ASCII character,
     ;  excluding NUL
 CR = %x0D
     ; carriage return
 CRLF = CR LF
     ; Internet standard newline
 CTL = %x00-1F / %x7F
     ; controls
 DIGIT = %x30-39
     ; 0-9
 DQUOTE = %x22
     ; " (Double Quote)
 HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
 HTAB = %x09
     ; horizontal tab
 LF = %x0A
     ; linefeed
 LWSP = *(WSP / CRLF WSP)
     ; linear white space (past newline)
 OCTET = %x00-FF
     ; 8 bits of data
 SP = %x20
 VCHAR = %x21-7E
     ; visible (printing) characters
 WSP = SP / HTAB
     ; white space