The notation is as follows:
Note that the two characters ">>" are always interpreted as a right shift operator. This means that a declaration of the form:
// IDL typedef sequence<sequence<long> > sslong;cannot be written without a white space between the two > characters:
// IDL // Illegal typedef sequence<sequence<long>> sslong;
(1) <specification> ::= <definition>+(2) <definition> ::= <type_dcl> ";"
| <const_dcl> ";"
| <except_dcl> ";"
| <interface> ";"
| <module> ";"
(3) <module> ::= "module" <identifier>
"{" <definition>+ "}"
(4) <interface> ::= <interface_dcl>
| <forward_dcl>
(5) <interface_dcl> ::= <interface_header>
"{" <interface-body> "}"
(6) <forward_dcl> ::= "interface" <identifier>
(7) <interface_header> ::= "interface" <identifier>
[<inheritance_spec>]
(8) <interface_body> ::= <export>*
(9) <export> ::= <type_dcl> ";"
| <const_dcl> ";"
| <except_dcl> ";"
| <attr_dcl> ";"
| <op_dcl> ";"
(10) <inheritance_spec> ::= ":" <scoped_name> {"," <scoped_name>}*
(11) <scoped_name> ::= <identifier>
| "::" <identifier>
| <scoped_name> "::" <identifier>
(12) <const_dcl> ::= "const" <const_type> <identifier>
"="<const_exp>
(13) <const_type> ::= <integer_type>
| <char_type>
| <boolean_type>
| <floating_pt_type>
| <string_type>
| <scoped_name>
(14) <const_exp> ::= <or_expr>
(15) <or_expr> ::= <xor_expr>
| <or_expr> "|" <xor_expr>
(16) <xor_expr> ::= <and_expr>
| <xor_expr> "^" <and_expr>
(17) <and_expr> ::= <shift_expr>
| <and_expr> "&" <shift_expr>
(18) <shift_expr> ::= <add_expr>
| <shift_expr> ">>"<add_expr>
| <shift_expr> "<<"<add_expr>
(19) <add_expr> ::= <mult_expr>
| <add_expr> "+" <mult_expr>
| <add_expr> "-" <mult_expr>
(20) <mult_expr> ::= <unary_expr>
| <mult_expr> "*" <unary_expr>
| <mult_expr> "/" <unary_expr>
| <mult_expr> "%" <unary_expr>
(21) <unary_expr> ::= <unary_operator> <primary_expr>
| <primary_expr>
(22) <unary_operator> ::= "-"
| "+"
| "~"
(23) <primary_expr> ::= <scoped_name>
| <literal>
| "(" <const_exp> ")"
(24) <literal> ::= <integer_literal>
| <string_literal>
| <character_literal>
| <floating_pt_literal>
| <boolean_literal>
(25) <boolean_literal> ::= "TRUE"
| "FALSE"
(26) <positive_int_const> ::= <const_exp>
(27) <type_dcl> ::= "typedef" <type_declarator>
| <struct_type>
| <union_type>
| <enum_type>
(28) <type_declarator> ::= <type_spec> <declarators>
(29) <type_spec> ::= <simple_type_spec>
| <constr_type_spec>
(30) <simple_type_spec> ::= <base_type_spec>
| <template_type_spec>
| <scoped_name>
(31) <base_type_spec> ::= <floating_pt_type>
| <integer_type>
| <char_type>
| <boolean_type>
| <octet_type>
| <any_type>
(32) <template_type_spec> ::= <sequence_type>
| <string_type>
(33) <constr_type_spec> ::= <struct_type>
| <union_type>
| <enum_type>
(34) <declarators> ::= <declarator> { "," <declarator> }*
(35) <declarator> ::= <simple_declarator>
| <complex_declarator>
(36) <simple_declarator> ::= <identifier>
(37) <complex_declarator> ::= <array_declarator>
(38) <floating_pt_type> ::= "float"
| "double"
(39) <integer_type> ::= <signed_int>
| <unsigned_int>
(40) <signed_int> ::= <signed_long_int>
| <signed_short_int>
(41) <signed_long_int> ::= "long"
(42) <signed_short_int> ::= "short"
(43) <unsigned_int> ::= <unsigned_long_int>
| <unsigned_short_int>
(44) <unsigned_long_int> ::= "unsigned" "long"
(45) <unsigned_short_int> ::= "unsigned" "short"
(46) <char_type> ::= "char"
(47) <boolean_type> ::= "boolean"
(48) <octet_type> ::= "octet"
(49) <any_type> ::= "any"
(50) <struct_type> ::= "struct" <identifier>
"{" <member_list> "}"
(51) <member_list> ::= <member>+
(52) <member> ::= <type_spec> <declarators> ";"
(53) <union_type> ::= "union" <identifier> "switch"
"(" <switch_type_spec> ")"
"{" <switch_body> "}"
(54) <switch_type_spec> ::= <integer_type>
| <char_type>
| <boolean_type>
| <enum_type>
| <scoped_name>
(55) <switch_body> ::= <case>+
(56) <case> ::= <case_label>+ <element_spec> ";"
(57) <case_label> ::= "case" <const_exp> ":"
| "default" ":"
(58) <element_spec> ::= <type_spec> <declarator>
(59) <enum_type> ::= "enum" <identifier> "{" <enumerator>
{ "," <enumerator> }* "}"
(60) <enumerator> ::= <identifier>
(61) <sequence_type> ::= "sequence" "<" <simple_type_spec>
"," <positive_int_const> ">"
| "sequence" "<" <simple_type_spec> ">"
(62) <string_type> ::= "string" "<" <positive_int_const> ">"
| "string"
(63) <array_declarator> ::= <identifier> <fixed_array_size>+
(64) <fixed_array_size> ::= "[" <positive_int_const> "]"
(65) <attr_dcl> ::= ["readonly"] "attribute"
<param_type_spec>
<simple_declarator>
{","<simple_declarator>}*
(66) <except_dcl> ::= "exception" <identifier>
"{" <member>* "}"
(67) <op_dcl> ::= [<op_attribute>] <op_type_spec>
<identifier>
<parameter_dcls>
[<raises_expr>] [<context_expr>]
(68) <op_attribute> := "oneway"
(69) <op_type_spec> ::= <param_type_spec>
| "void"
(70) <parameter_dcls> ::= "(" <param_dcl> {"," <param_dcl>}* ")"
| "(" ")"
(71) <param_dcl> ::= <param_attribute> <param_type_spec>
<simple_declarator>
(72) <param_attribute> ::= "in"
| "out"
| "inout"
(73) <raises_expr> ::= "raises" "(" <scoped_name>
{ "," <scoped_name> }* ")"
(74) <context_expr> ::= "context" "(" <string_literal>
{ "," <string_literal>}* ")"
(75) <param_type_spec> ::= <base_type_spec> <string_type>
<scoped_name>
any | default | interface | readonly | unsigned |
attribute | double | long | sequence | union |
boolean | enum | module | short | void |
case | exception | octet | string | FALSE |
char | float | oneway | struct | Object |
const | in | out | switch | TRUE |
context | inout | raises | typedef |
Keywords must be written exactly as shown. For example, writing
Boolean
rather than boolean
will give a compilation error.