view corba/src/share/classes/com/sun/tools/corba/se/idl/grammar.idl @ 12:7c56bb8ffc4b jdk6-b11

Import b11
author Mark Wielaard <mark@klomp.org>
date Thu, 10 Jul 2008 00:00:00 +0200
parents a5c0d00d3895
children
line wrap: on
line source

/*
 * Copyright 1999 Sun Microsystems, Inc.  All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Sun designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Sun in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 * CA 95054 USA or visit www.sun.com if you need additional information or
 * have any questions.
 */

/*
 *    COMPONENT_NAME:  idl.parser
 *
 *    ORIGINS: 27
 *
 *    5639-D57, (C) COPYRIGHT International Business Machines Corp., 1997, 1998
 *
 */

CORBA 2.3 IDL
---------------

(1) <specification>	<definition><specification'>

(1) <specification'>	e
			<definition><specification'>

(2) <definition>	<type_dcl> ";"
			<const_dcl> ";"
			<except_dcl> ";"
			<interface> ";"
			<module> ";"
			<value> ";"

(3) <module>		"module" <id> "{" <module'> "}"

(3) <module'>		<definition><module''>

(3) <module''>		<definition><module''>
                        e

(4) <interface>		<interface_dcl>
			<forward_dcl>

(5) <interface_dcl>	<interface_header> "{" <interface_body> "}"

(6) <forward_dcl>	"abstract" "interface" <id>
			"interface" <id>

(7) <interface_header>	"abstract" "interface" <id> <interface_header'>
			"interface" <id> <interface_header'>

(7) <interface_header'>	e
			<interface_inheritance_spec>

(8) <interface_body>	<export><interface_body'>

(8) <interface_body'>	e
			<export><interface_body'>

(9) <export>		<type_dcl> ";"
			<const_dcl> ";"
			<except_dcl> ";"
			<attr_dcl> ";"
			<op_dcl> ";"



(10) <interface_inheritance_spec>	":" <scoped_name> <inheritance_spec'>

(10) <interface_inheritance_spec'>	e
			"," <scoped_name> <inheritance_spec'>

(12) <scoped_name>	<id> <scoped_name'>
			"::" <id> <scoped_name'>

(12) <scoped_name'>	e
			"::" <id> <scoped_name'>

(13) <value>		<value_dcl>
			<value_abs_dcl>
			<value_box_dcl>
			<value_forward_dcl>

(14) <value_forward_dcl>    "abstract" "valuetype" <id>
			"valuetype" <id>

(15) <value_box_dcl>	"valuetype" <id> <type_spec>

(16) <value_abs_dcl>	"abstract" "valuetype" <id> <value_inheritance_spec> "{" <export> <vad> "}"
			"abstract" "valuetype" <id> "{" <export> <vad> "}"

(16) <vad>		e
			<export> <vad>

(17) <value_dcl>	<value_header> "{" <value_element> <ve> "}"

(17) <ve>		e
			<value_element> <ve>

(18) <value_header>	"custom" "valuetype" <id> <value_inheritance_spec>
			"valuetype" <id> <value_inheritance_spec>
			"custom" "valuetype" <id>
			"valuetype" <id>

(19) <value_inheritance_spec>	<opt_inherits> <opt_supports>

(19) <opt_inherits>	e
			":" "truncatable" <value_name> <value_name_list>
			":" <value_name> <value_name_list>

(19) <value_name_list>	e
			"," <value_name> <value_name_list>

(19) <opt_supports>	e
			"supports" <interface_name> <interface_name_list>

(19) <interface_name_list>  e
			"," <interface_name> <interface_name_list>

(20) <value_name>	<scoped_name>

(21) <value_element>	<export>
			<state_member>
			<init_dcl>

(22) <state_member>	"public" <type_spec> <declarators> ";"
			"private" <type_spec> <declarators> ";"

(23) <init_dcl>		"factory" <id> "(" ")"
			"factory" <id> "(" <init_param_dcls> ")"

(24) <init_param_dcls>	<init_param_decl>
			<init_param_decl> "," <init_param_dcls>

(25) <init_param_dcl>	<init_param_attribute> <param_type_spec> <simple_declarator>

(26) <init_param_attribute> "in"

(27) <const_dcl>	"const" <const_type> <id> "=" <const_exp>

(28) <const_type>	<integer_type>
			<char_type>
			<wide_char_type>
			<boolean_type>
			<floating_pt_type>
			<string_type>
			<wide_string_type>
			<scoped_name>
			<octet_type>

(29) <const_exp>	<or_expr>

(30) <or_expr>		<xor_expr> <or_expr'>

(30) <or_expr'>		e
			"|" <xor_expr> <or_expr'>

(31) <xor_expr>		<and_expr> <xor_expr'>

(31) <xor_expr'>	e
			"^" <and_expr> <xor_expr'>

(32) <and_expr>		<shift_expr><and_expr'>

(32) <and_expr'>	e
			"&" <shift_expr> <and_expr'>

(33) <shift_expr>	<add_expr> <shift_expr'>

(33) <shift_expr'>	e
			">>" <add_expr> <shift_expr'>
			"<<" <add_expr> <shift_expr'>

(34) <add_expr>		<mult_expr> <add_expr'>

(34) <add_expr'>	e
			"+" <mult_expr> <add_expr'>
			"-" <mult_expr> <add_expr'>

(35) <mult_expr>	<unary_expr> <mult_expr'>

(35) <mult_expr'>	e
			"*" <unary_expr> <mult_expr'>
			"/" <unary_expr> <mult_expr'>
			"%" <unary_expr> <mult_expr'>

(36) <unary_expr>	<unary_operator> <primary_expr>
			<primary_expr>

(37) <unary_operator>	"-"
			"+"
			"~"

(38) <primary_expr>	<scoped_name>
			<literal>
			"(" <const_exp> ")"

(39) <literal>		<<integer_literal>>
			<<string_literal>>>
			<<wide_string_literal>>>
			<<character_literal>>
			<<wide_character_literal>>
			<<fixed_pt_literal>>
			<<floating_pt_literal>>
			<<boolean_literal>>

(40) <boolean_literal>	"TRUE"
			"FALSE"

(41) <positive_int_const>   <const_exp>

(42) <type_dcl>		"typedef" <type_declarator>
			<struct_type>
			<union_type>
			<enum_type>
			"native" <simple_declarator>

(43) <type_declarator>	<type_spec> <declarators>

(44) <type_spec>	<simple_type_spec>
			<constr_type_spec>

(45) <simple_type_spec>	<base_type_spec>
			<template_type_spec>
			<scoped_name>

(46) <base_type_spec>	<floating_pt_type>
			<integer_type>
			<char_type>
			<wide_char_type>
			<boolean_type>
			<octet_type>
			<any_type>
			<object_type>
			<value_base_type>

(47) <template_type_spec> <sequence_type>
			<string_type>
			<wide_string_type>
			<fixed_pt_type>

(48) <constr_type_spec>	<struct_type>
			<union_type>
			<enum_type>

(49) <declarators>	<declarator> <declarators'>

(49) <declarators'>	e
			"," <declarator> <declarators'>

(50) <declarator>	<simple_declarator>
			<complex_declarator>

(51) <simple_declarator> <id>

(52) <complex_declarator>   <array_declarator>

(53) <floating_pt_type>	"float"
			"double"
			"long" "double"

(54) <integer_type>	<signed_int>
			<unsigned_int>

(55) <signed_int>	"long"
			"short"
			"long" "long"

// 56-58 omitted

(59) <unsigned_int>	"unsigned" <signed_int>

// 60-62 omitted

(63) <char_type>	"char"

(64) <wide_char_type>	"wchar"

(65) <boolean_type>	"boolean"

(66) <octet_type>	"octet"

(67) <any_type>		"any"

(68) <object_type>	"Object"

(69) <struct_type>	"struct" <id> "{" <member_list> "}"

(70) <member_list>	<member> <member_list'>

(70) <member_list'>	e
			<member> <member_list'>

(71) <member>		<type_spec> <declarators> ";"

(72) <union_type>	"union" <id> "switch" "(" <switch_type_spec> ")" "{" <switch_body> "}"

(73) <switch_type_spec>	<integer_type>
			<char_type>
			<boolean_type>
			<enum_type>
			<scoped_name>

(74) <switch_body>	<case> <switch_body'>

(74) <switch_body'>	e
			<case> <switch_body'>

(75) <case>		<case_label> <case'> <element_spec> ";"

(75) <case'>		e
			<case_label> <case'>

(76) <case_label>	"case" <const_exp> ":"
			"default" ":"

(77) <element_spec>	<type_spec> <declarator>

(78) <enum_type>	"enum" <id> "{" <id> <enum_type'> "}"

(78) <enum_type'>	e
			"," <id> <enum_type'>

// 79 omitted

(80) <sequence_type>	"sequence" "<" <simple_type_spec> <sequence_type'>

(80) <sequence_type'>	"," <positive_int_const> ">"
			">"

(81) <string_type>	"string"
			"string" "<" <positive_int_const> ">"

(82) <wide_string_type>	"wstring"
			"wstring" "<" <positive_int_const> ">"

(83) <array_declarator>	<id> <fixed_array_size>

(84) <fixed_array_size>	"[" <positive_int_const> "]"

(85) <attr_dcl>		"readonly" "attribute" <param_type_spec> <id> <attr_dcl'>
			"attribute" <param_type_spec> <id> <attr_dcl'>

(85) <attr_dcl'>	e
			"," <id> <attr_dcl'>

(86) <except_dcl>	"exception" <id> "{" <except_dcl'> "}"

(86) <except_dcl'>	e
			<member> <except_dcl'>

(87) <op_dcl>		<op_attribute> <op_type_spec> <op_dcl'>
			<op_type_spec> <op_dcl'>

(87) <op_dcl'>		<id> <parameter_dcls> <op_dcl''>
			<macroID> <parameter_dcls'> <op_dcl''>

(87) <op_dcl''>		e
			<context_expr>
			<raises_expr>
			<raises_expr> <context_expr>

(88) <op_attribute>	"oneway"

(89) <op_type_spec>	<param_type_spec>
			"void"

(90) <parameter_dcls>	"(" <parameter_dcls'>

(90) <parameter_dcls'>	<param_dcl> <parameter_dcls''> ")"
			")"

(90) <parameter_dcls''>	e
			"," <param_dcl> <parameter_dcls''>

(91) <param_dcl>	<param_attribute> <param_type_spec> <id>

(92) <param_attribute>	"in"
			"out"
			"inout"

(93) <raises_expr>	"raises" "(" <scoped_name> <raises_expr'> ")"

(93) <raises_expr'>	e
			"," <scoped_name> <raises_expr'>

(94) <context_expr>	"context" "(" <string_literal> <context_expr'> ")"

(94) <context_expr'>        e
			"," <string_literal> <context_expr'>

(95) <param_type_spec>	<base_type_spec>
			<string_type>
			<wide_string_type>
			<scoped_name>

(96) <fixed_pt_type>	"fixed" "<" <positive_int_const> "," <positive_int_const> ">"

(97) <fixed_pt_const_type> "fixed"

(98) <value_base_type>	"ValueBase"

NOTES:

- #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.