SOM IDL Language Grammar
Appearance
Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation
specification : [comment] definition+
definition : type_dcl ; [comment]
| const_dcl ; [comment]
| interface ; [comment]
| module ; [comment]
| pragma_stm
module : module identifier [comment]
{ [comment] definition+ }
interface : interface identifier
| interface_dcl
interface_dcl : interface identifier [inheritance] [comment]
{ [comment] export* } [comment]
inheritance : scoped_name {, scoped_name}*
export : type_dcl ; [comment]
| const_dcl ; [comment]
| attr_dcl ; [comment]
| op_dcl ; [comment]
| implementation_body ; [comment]
| pragma_stm
scoped_name : identifier
| :: identifer
| scoped_name :: identifer
const_dcl : const const_type identifier =
const_expr
const_type : integer_type
| char_type
| boolean_type
| floating_pt_type
| string_type
| scoped_name
const_expr : or_expr
or_expr : xor_expr
| or_expr
| xor_expr
xor_expr : and_expr|xor_expr ^ and_expr
and_expr : shift_expr
| and_expr & shift_expr
shift_expr : add_expr:
| shift_expr:epv.:pk. >> add_expr
| shift_expr:epv. << 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_expr )
literal : integer_literal
| string_literal
| character_literal
| floating_pt_literal
| boolean_literal
type_dcl : typedef type_declarator
| constr_type_spec
type_declarator : type_spec declarator {, declarator}*
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
| boolean_type
| octet_type
| any_type
| voidptr_type
template_type_spec : sequence_type
| string_type
constr_type_spec : struct_type
| union_type
| enum_type
declarator : [stars] std_declarator
std_declarator : simple_declarator
| complex_declarator
simple_declarator : identifier
complex_declarator : array_declarator
array_declarator : simple_declarator fixed_array_size+
fixed_array_size : [ const_expr ]
floating_pt_type : float
| double
integer_type : signed_int
| unsigned_int
signed_int : long
| short
unsigned_int : unsigned signed_int
char_type : char
boolean_type : boolean
octet_type : octet
any_type : any
voidptr_type : void stars
struct_type : ( struct|exception) identifier
| ( struct|exception) [comment]
{ [comment] member* }
member : type_declarator ; [comment]
union_type : union identifier
| union identifier switch
( switch_type_spec ) [
comment]
{ [comment] case+ }
switch_type_spec : integer_type
| char_type
| boolean_type
| enum_type
| scoped_name
case : case_label+ element_spec ; [comment]
case_label : case const_expr : [comment]
| default : [comment]
element_spec : type_spec declarator
enum_type : enum identifier { identifier
{, identifier}* [comment] }
sequence_type : sequence < simple_type_spec , const_expr >
| sequence < simple_type_spec >
string_type : string < const_expr >
| string
attr_dcl : [readonly] attribute simple_type_spec
declarator {, declarator}*
op_dcl : [oneway] op_type_spec [stars] identifier
parameter_dcls [raises_expr] [context_expr]
op_type_spec : simple_type_spec
| void
parameter_dcls : ( param_dcl {, param_dcl}* [comme nt] )
| ( )
param_dcl : param_attribute simple_type_spec declarator
param_attribute : in
| out
| inout
raises_expr : raises ( scope_name+ )
context_expr : context ( context_string{, context_string}* )
implementation_body : implementation [comment]
{ [comment] implementation+ }
implementation : modifier_stm
| pragma_stm
| passthru
| member
pragma_stm : #pragma modifier modifier_stm
| #pragma somtemittypes on
| #pragma somtemittypes off
modifier_stm : smidentifier : [modifier {, modifier}*] ;[comment]
| modifier ; [comment]
modifier : smidentifier
| smidentifier = modifier_value
modifier_value : smidentifier
| string_literal
| integer_literal
| keyword
passthru : passthru identifier = string_literal+ ; [comment]
smidentifier : identifer
| _identifier
stars | *+