src/share/classes/com/sun/tools/corba/se/idl/grammar.idl

Thu, 31 Aug 2017 18:10:36 +0800

author
aoqi
date
Thu, 31 Aug 2017 18:10:36 +0800
changeset 748
6845b95cba6b
parent 158
91006f157c46
parent 0
7ef37b2cdcad
permissions
-rw-r--r--

merge

     1 /*
     2  * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    24  */
    26 /*
    27  *    COMPONENT_NAME:  idl.parser
    28  *
    29  *    ORIGINS: 27
    30  *
    31  *    5639-D57, (C) COPYRIGHT International Business Machines Corp., 1997, 1998
    32  *
    33  */
    35 CORBA 2.3 IDL
    36 ---------------
    38 (1) <specification>	<definition><specification'>
    40 (1) <specification'>	e
    41 			<definition><specification'>
    43 (2) <definition>	<type_dcl> ";"
    44 			<const_dcl> ";"
    45 			<except_dcl> ";"
    46 			<interface> ";"
    47 			<module> ";"
    48 			<value> ";"
    50 (3) <module>		"module" <id> "{" <module'> "}"
    52 (3) <module'>		<definition><module''>
    54 (3) <module''>		<definition><module''>
    55                         e
    57 (4) <interface>		<interface_dcl>
    58 			<forward_dcl>
    60 (5) <interface_dcl>	<interface_header> "{" <interface_body> "}"
    62 (6) <forward_dcl>	"abstract" "interface" <id>
    63 			"interface" <id>
    65 (7) <interface_header>	"abstract" "interface" <id> <interface_header'>
    66 			"interface" <id> <interface_header'>
    68 (7) <interface_header'>	e
    69 			<interface_inheritance_spec>
    71 (8) <interface_body>	<export><interface_body'>
    73 (8) <interface_body'>	e
    74 			<export><interface_body'>
    76 (9) <export>		<type_dcl> ";"
    77 			<const_dcl> ";"
    78 			<except_dcl> ";"
    79 			<attr_dcl> ";"
    80 			<op_dcl> ";"
    84 (10) <interface_inheritance_spec>	":" <scoped_name> <inheritance_spec'>
    86 (10) <interface_inheritance_spec'>	e
    87 			"," <scoped_name> <inheritance_spec'>
    89 (12) <scoped_name>	<id> <scoped_name'>
    90 			"::" <id> <scoped_name'>
    92 (12) <scoped_name'>	e
    93 			"::" <id> <scoped_name'>
    95 (13) <value>		<value_dcl>
    96 			<value_abs_dcl>
    97 			<value_box_dcl>
    98 			<value_forward_dcl>
   100 (14) <value_forward_dcl>    "abstract" "valuetype" <id>
   101 			"valuetype" <id>
   103 (15) <value_box_dcl>	"valuetype" <id> <type_spec>
   105 (16) <value_abs_dcl>	"abstract" "valuetype" <id> <value_inheritance_spec> "{" <export> <vad> "}"
   106 			"abstract" "valuetype" <id> "{" <export> <vad> "}"
   108 (16) <vad>		e
   109 			<export> <vad>
   111 (17) <value_dcl>	<value_header> "{" <value_element> <ve> "}"
   113 (17) <ve>		e
   114 			<value_element> <ve>
   116 (18) <value_header>	"custom" "valuetype" <id> <value_inheritance_spec>
   117 			"valuetype" <id> <value_inheritance_spec>
   118 			"custom" "valuetype" <id>
   119 			"valuetype" <id>
   121 (19) <value_inheritance_spec>	<opt_inherits> <opt_supports>
   123 (19) <opt_inherits>	e
   124 			":" "truncatable" <value_name> <value_name_list>
   125 			":" <value_name> <value_name_list>
   127 (19) <value_name_list>	e
   128 			"," <value_name> <value_name_list>
   130 (19) <opt_supports>	e
   131 			"supports" <interface_name> <interface_name_list>
   133 (19) <interface_name_list>  e
   134 			"," <interface_name> <interface_name_list>
   136 (20) <value_name>	<scoped_name>
   138 (21) <value_element>	<export>
   139 			<state_member>
   140 			<init_dcl>
   142 (22) <state_member>	"public" <type_spec> <declarators> ";"
   143 			"private" <type_spec> <declarators> ";"
   145 (23) <init_dcl>		"factory" <id> "(" ")"
   146 			"factory" <id> "(" <init_param_dcls> ")"
   148 (24) <init_param_dcls>	<init_param_decl>
   149 			<init_param_decl> "," <init_param_dcls>
   151 (25) <init_param_dcl>	<init_param_attribute> <param_type_spec> <simple_declarator>
   153 (26) <init_param_attribute> "in"
   155 (27) <const_dcl>	"const" <const_type> <id> "=" <const_exp>
   157 (28) <const_type>	<integer_type>
   158 			<char_type>
   159 			<wide_char_type>
   160 			<boolean_type>
   161 			<floating_pt_type>
   162 			<string_type>
   163 			<wide_string_type>
   164 			<scoped_name>
   165 			<octet_type>
   167 (29) <const_exp>	<or_expr>
   169 (30) <or_expr>		<xor_expr> <or_expr'>
   171 (30) <or_expr'>		e
   172 			"|" <xor_expr> <or_expr'>
   174 (31) <xor_expr>		<and_expr> <xor_expr'>
   176 (31) <xor_expr'>	e
   177 			"^" <and_expr> <xor_expr'>
   179 (32) <and_expr>		<shift_expr><and_expr'>
   181 (32) <and_expr'>	e
   182 			"&" <shift_expr> <and_expr'>
   184 (33) <shift_expr>	<add_expr> <shift_expr'>
   186 (33) <shift_expr'>	e
   187 			">>" <add_expr> <shift_expr'>
   188 			"<<" <add_expr> <shift_expr'>
   190 (34) <add_expr>		<mult_expr> <add_expr'>
   192 (34) <add_expr'>	e
   193 			"+" <mult_expr> <add_expr'>
   194 			"-" <mult_expr> <add_expr'>
   196 (35) <mult_expr>	<unary_expr> <mult_expr'>
   198 (35) <mult_expr'>	e
   199 			"*" <unary_expr> <mult_expr'>
   200 			"/" <unary_expr> <mult_expr'>
   201 			"%" <unary_expr> <mult_expr'>
   203 (36) <unary_expr>	<unary_operator> <primary_expr>
   204 			<primary_expr>
   206 (37) <unary_operator>	"-"
   207 			"+"
   208 			"~"
   210 (38) <primary_expr>	<scoped_name>
   211 			<literal>
   212 			"(" <const_exp> ")"
   214 (39) <literal>		<<integer_literal>>
   215 			<<string_literal>>>
   216 			<<wide_string_literal>>>
   217 			<<character_literal>>
   218 			<<wide_character_literal>>
   219 			<<fixed_pt_literal>>
   220 			<<floating_pt_literal>>
   221 			<<boolean_literal>>
   223 (40) <boolean_literal>	"TRUE"
   224 			"FALSE"
   226 (41) <positive_int_const>   <const_exp>
   228 (42) <type_dcl>		"typedef" <type_declarator>
   229 			<struct_type>
   230 			<union_type>
   231 			<enum_type>
   232 			"native" <simple_declarator>
   234 (43) <type_declarator>	<type_spec> <declarators>
   236 (44) <type_spec>	<simple_type_spec>
   237 			<constr_type_spec>
   239 (45) <simple_type_spec>	<base_type_spec>
   240 			<template_type_spec>
   241 			<scoped_name>
   243 (46) <base_type_spec>	<floating_pt_type>
   244 			<integer_type>
   245 			<char_type>
   246 			<wide_char_type>
   247 			<boolean_type>
   248 			<octet_type>
   249 			<any_type>
   250 			<object_type>
   251 			<value_base_type>
   253 (47) <template_type_spec> <sequence_type>
   254 			<string_type>
   255 			<wide_string_type>
   256 			<fixed_pt_type>
   258 (48) <constr_type_spec>	<struct_type>
   259 			<union_type>
   260 			<enum_type>
   262 (49) <declarators>	<declarator> <declarators'>
   264 (49) <declarators'>	e
   265 			"," <declarator> <declarators'>
   267 (50) <declarator>	<simple_declarator>
   268 			<complex_declarator>
   270 (51) <simple_declarator> <id>
   272 (52) <complex_declarator>   <array_declarator>
   274 (53) <floating_pt_type>	"float"
   275 			"double"
   276 			"long" "double"
   278 (54) <integer_type>	<signed_int>
   279 			<unsigned_int>
   281 (55) <signed_int>	"long"
   282 			"short"
   283 			"long" "long"
   285 // 56-58 omitted
   287 (59) <unsigned_int>	"unsigned" <signed_int>
   289 // 60-62 omitted
   291 (63) <char_type>	"char"
   293 (64) <wide_char_type>	"wchar"
   295 (65) <boolean_type>	"boolean"
   297 (66) <octet_type>	"octet"
   299 (67) <any_type>		"any"
   301 (68) <object_type>	"Object"
   303 (69) <struct_type>	"struct" <id> "{" <member_list> "}"
   305 (70) <member_list>	<member> <member_list'>
   307 (70) <member_list'>	e
   308 			<member> <member_list'>
   310 (71) <member>		<type_spec> <declarators> ";"
   312 (72) <union_type>	"union" <id> "switch" "(" <switch_type_spec> ")" "{" <switch_body> "}"
   314 (73) <switch_type_spec>	<integer_type>
   315 			<char_type>
   316 			<boolean_type>
   317 			<enum_type>
   318 			<scoped_name>
   320 (74) <switch_body>	<case> <switch_body'>
   322 (74) <switch_body'>	e
   323 			<case> <switch_body'>
   325 (75) <case>		<case_label> <case'> <element_spec> ";"
   327 (75) <case'>		e
   328 			<case_label> <case'>
   330 (76) <case_label>	"case" <const_exp> ":"
   331 			"default" ":"
   333 (77) <element_spec>	<type_spec> <declarator>
   335 (78) <enum_type>	"enum" <id> "{" <id> <enum_type'> "}"
   337 (78) <enum_type'>	e
   338 			"," <id> <enum_type'>
   340 // 79 omitted
   342 (80) <sequence_type>	"sequence" "<" <simple_type_spec> <sequence_type'>
   344 (80) <sequence_type'>	"," <positive_int_const> ">"
   345 			">"
   347 (81) <string_type>	"string"
   348 			"string" "<" <positive_int_const> ">"
   350 (82) <wide_string_type>	"wstring"
   351 			"wstring" "<" <positive_int_const> ">"
   353 (83) <array_declarator>	<id> <fixed_array_size>
   355 (84) <fixed_array_size>	"[" <positive_int_const> "]"
   357 (85) <attr_dcl>		"readonly" "attribute" <param_type_spec> <id> <attr_dcl'>
   358 			"attribute" <param_type_spec> <id> <attr_dcl'>
   360 (85) <attr_dcl'>	e
   361 			"," <id> <attr_dcl'>
   363 (86) <except_dcl>	"exception" <id> "{" <except_dcl'> "}"
   365 (86) <except_dcl'>	e
   366 			<member> <except_dcl'>
   368 (87) <op_dcl>		<op_attribute> <op_type_spec> <op_dcl'>
   369 			<op_type_spec> <op_dcl'>
   371 (87) <op_dcl'>		<id> <parameter_dcls> <op_dcl''>
   372 			<macroID> <parameter_dcls'> <op_dcl''>
   374 (87) <op_dcl''>		e
   375 			<context_expr>
   376 			<raises_expr>
   377 			<raises_expr> <context_expr>
   379 (88) <op_attribute>	"oneway"
   381 (89) <op_type_spec>	<param_type_spec>
   382 			"void"
   384 (90) <parameter_dcls>	"(" <parameter_dcls'>
   386 (90) <parameter_dcls'>	<param_dcl> <parameter_dcls''> ")"
   387 			")"
   389 (90) <parameter_dcls''>	e
   390 			"," <param_dcl> <parameter_dcls''>
   392 (91) <param_dcl>	<param_attribute> <param_type_spec> <id>
   394 (92) <param_attribute>	"in"
   395 			"out"
   396 			"inout"
   398 (93) <raises_expr>	"raises" "(" <scoped_name> <raises_expr'> ")"
   400 (93) <raises_expr'>	e
   401 			"," <scoped_name> <raises_expr'>
   403 (94) <context_expr>	"context" "(" <string_literal> <context_expr'> ")"
   405 (94) <context_expr'>        e
   406 			"," <string_literal> <context_expr'>
   408 (95) <param_type_spec>	<base_type_spec>
   409 			<string_type>
   410 			<wide_string_type>
   411 			<scoped_name>
   413 (96) <fixed_pt_type>	"fixed" "<" <positive_int_const> "," <positive_int_const> ">"
   415 (97) <fixed_pt_const_type> "fixed"
   417 (98) <value_base_type>	"ValueBase"
   419 NOTES:
   421 - #define id(id, id, ...) token-string is a macro definition.  There can be no space between the first id and the left paren.  Since id( must be treated as a token and id( can also appear in op_dcl, see that production for the effect of this token.

mercurial