Interstage Application Server アプリケーション作成ガイド (CORBAサービス編)
目次 索引 前ページ次ページ

付録A IDL定義

A.9 IDLのフォーマット

 IDLの書式のフォーマットを以下に示します。::= は、以下のように定義されます。

  |       または
  <文字>     非終端文字
  "文字"   リテラル
  *        記号の前にある構文の要素を0回以上繰り返すことができます。
  +        記号の前にある構文の要素を1回以上繰り返すことができます。
  {}       { }で括られた構文の要素は1つの要素として取り扱われます。
  []       [ ]で括られた構文の要素はオプションで、0回以上現れます。
IDL仕様
  <specification>      ::=<definition>+
IDLの定義
  <definition>         ::=<type_dcl>";"
                       | <const_dcl>";"
                       | <except_dcl>";"
                       | <interface>";"
                       | <module>";"
モジュール宣言
  <module>             ::="module"<identifier>"{"<definition>"+}"
インタフェース宣言
  <interface>          ::=<interface_dcl>
                       | <forward_dcl>
  <interface_dcl>      ::=<interface_header>"{"<interface_body>"}"
  <forward_dcl>        ::="interface"<identifier>
  <interface_header>   ::="interface"<identifier>[<inheritance_spec>]
  <interface_body>     ::=<export>*
  <export>             ::=<type_dcl>";"
                       | <const_dcl>";"
                       | <except_dcl>";"
                       | <attr_dcl>";"
                       | <op_dcl>";"
継承の仕様
  <inheritance_spec>   ::="":"<scoped name>{","<scoped name>}*
  <scoped_name>        ::=<identifier>
                       | "::"<identifier>
                       | <scoped_name>"::"<identifier>
定数宣言
  <const_dcl>          ::="const"<const_type><identifier>"="<const_exp>
  <const_type>         ::=<integer_type>
                       | <char_type>
                       | <boolean_type>
                       | <floating_pt_type>
                       | <string_type>
                       | <scoped_name>
定数式
  <const_exp>          ::=<or_expr>
  <or_expr>            ::=<xor_expr>
                       | <or_expr>"|"<xor_expr>
  <xor_expr>           ::=<and_expr>
                       | <xor_expr>"^"<and_expr>
  <and_expr>           ::=<shift_expr>
                       | <add_expr>"&"<shift_expr>
  <shift_expr>         ::=<add_expr>
                       | <shift_expr>">>"<add_expr>
                       | <shift_expr>"<<"<add_expr>
  <add_expr>           ::=<mult_expr>
                       | <add_expr>"+"<mult_expr>
                       | <add_expr>"-"<mult_expr>
  <mult_expr>          ::=<unary_expr>
                       | <mult_expr>"*"<unary_expr>
                       | <mult_expr>"/"<unary_expr>
                       | <mult_expr>"%"<unary_expr>
  <unary_expr>         ::=<unary_operator><primary_expr>
                       | <primary_expr>
  <unary_operator>     ::="-"
                       | "+"
                       | "〜"
  <primary_expr>       ::=<scoped_name>
                       | <literal>
                       | "("<const_exp>")"
  <literal>            ::=<integer_literal>
                       | <string_literal>
                       | <character_literal>
                       | <floating_literal>
                       | <boolean_literal>
  <boolean_literal>    ::="TRUE"
                       | "FALSE"
  <positive_int_const> ::=<const_exp>
型宣言
  <type_dcl>            ::="typedef"<type_declarator>
                        | <struct_type>
                        | <union_type>
                        | <enum_type>
  <type_declarator>     ::=<type_spec><declarators>
  <type_spec>           ::=<simple_type_spec>
                        | <constr_type_spec>
  <simple_type_spec>    ::=<base_type_spec>
                        | <template_type_spec>
                        | <scoped_name>
  <base_type_spec>      ::=<floating_pt_type>
                        | <integer_type>
                        | <char_type>
                        | <wide_char_type>
                        | <boolean_type>
                        | <octet_type>
                        | <any_type>
                        | <object_type>
  <template_type_spec>  ::=<sequence_type>
                        | <string_type>
                        | <wide_string_type>
                        | <fixed_pt_type>
  <constr_type_spec>    ::=<struct_type>
                        | <union_type>
                        | <enum_type>
  <declarators>         ::=<declarator>{","<declarator>}*
  <declarator>          ::=<simple_declarator>
                        | <complex_declarator>
  <simple_declarator>   ::=<identifier>
  <complex_declarator>  ::=<array_declarator>
データ型
  <floating_pt_type>    ::="float"
                        | "double"
                        | "long" "double"
  <integer_type>        ::=<signed_int>
                        | <unsigned_int>
  <signed_int>          ::=<signed_long_int>
                        | <signed_short_int>
                        | <signed_longlong_int>
  <signed_long_int>     ::="long"
  <signed_short_int>    ::="short"
  <signed_longlong_int> ::="long""long"
  <unsigned_int>        ::=<unsigned_long_int>
                        | <unsigned_short_int>
  <unsigned_long_int>   ::="unsigned""long"
  <unsigned_short_int>  ::="unsigned""short"
  <char_type>           ::="char"
  <wide_char_type>      ::="wchar"
  <boolean_type>        ::="boolean"
  <octet_type>          ::="octet"
  <struct_type>         ::="struct"<identifier>"{"<member_list>"}"
  <member_list>         ::=<member>+
  <member>              ::=<type_spec><declarator>";"
  <union_type>          ::="union"<identifier>"switch"
                        "("<switch_type_spec>")"
                        "{"<switch_body>"}"
  <switch_type_spec>    ::=<integer_type>
                        | <char_type>
                        | <boolean_type>
                        | <enum_type>
                        | <scoped_name>
  <switch_body> ::=<case>+
  <case>                ::=<case_label>+<element_spec>";"
  <case_label>          ::="case"<const_exp>";"
                        | "default"";"
  <element_spec>        ::=<type_spec><declarators>
  <sequence_type>       ::="sequence""<"<simple_type_spec>","
                        <positive_int_const>">"
                        | "sequence""<"<simple_type_spec>>","
  <string_type>         ::="string""<"<positive_int_const>">"
                        | "string"
  <wide_string_type>    ::="wstring""<"<positive_int_const>">"
                        | "wstring"
  <fixed_pt_type>       ::="fixed""<"<positive_int_const>","<integer_literal>">"
  <array_declarator>    ::=<indentifier><fixed_array_size>+
  <fixed_array_size>    ::="["<positive_int_const>"]"
  <attr_dcl>            ::=["readonly"]"attribute"<param_type_spec>
                        <simple_declarator>{"."<simple_declarator>}*
例外宣言
  <except_dcl>          ::="exception"<identifier>"{"<member>*"}"
オペレーション宣言
  <op_dcl>              ::=[<op_attribute>]<op_type_spec><identifier>
                        <parameter_dcls>[<raises_expr>][<context_expr>]
  <op_attribute>        ::="oneway"
  <op_type_spec>        ::=<param_type_spec>
                        | "void"
  <parameter_dcls>      ::="("<param_dcl>{","<param_dcl>}*")"
                        | "("")"
  <param_dcl>           ::=<param_attribute><param_type_spec> <simple_declarator>
  <param_attribute>     ::="in"
                        | "out"
                        | "inout"
  <raises_expr>         ::="raises""("<scoped_name>{","<scoped_name>}*")"
  <context_expr>        ::="context""("<string_literal>{","<string_literal>}*")"
  <param_type_spec>     ::=<base_type_spec>
                        | <string_type>
                        | <wide_string_type>
                        | <fixed_pt_type>
                        | <scoped_name>

目次 索引 前ページ次ページ

All Rights Reserved, Copyright(C) 富士通株式会社 2005