OmniRPC User's Guide Version 1.2: http://www.omni.hpcc.jp/omnirpc/ <omnirpc@omni.hpcc.jp> | ||
---|---|---|
Prev | Appendix B. IDL (Interface Description Language) | Next |
We show the informal definitions of IDL grammar as follows.
'...' indicates a literal.
IDENTIFIER is an identifier, CONSTANT is a constant.
STRING is one or more character inside double quotation marks("..."). OPT_STRING is a STRING which can be omitted.
{..}* stands iteration which not less than 0.
C_PROGRAM stands for any program in C.
type_specifier are fundamental data types of C, string, filename which stands for file and filepointer which stands for FILE pointer.
program := {declaration}* declaration:= 'Module' IDENTIFIER ';' | 'Define' interface_definition OPT_STRING interface_body | 'Globals' '{' C_PROGRAM '}' | 'Fortranformat' STRING ';' ; interface_definition:= IDENTIFIER '(' parameter {',' parameter}* ')' ; parameter:= decl_specifier declarator ; decl_specifier: type_specifier | MODE | MODE type_specifier | type_specifier MODE | type_specifier MODE type_specifier ; MODE := 'mode_in' | 'IN' | 'mode_out' | 'OUT'; declarator=: IDENTIFIER | '(' declarator ')' | declarator '['expr_or_null ']' | declarator '['expr_or_null ':' range_spec ']' | '*' declarator ; range_spec=: expr | expr ',' expr | expr ',' expr ',' expr ; interface_body: '{' C_PROGRAM '}' | CALLS OPT_STRING IDENTIFIER '(' IDENTIFIER {',' IDEFINTIER}* ')' ';' ; expr_or_null:= expr | /* null */; expr:= primary_expr | '*' expr /* pointer reference */ | '-' expr /* unary minus */ | expr '/' expr | expr '%' expr | expr '+' expr | expr '-' expr | expr '*' expr | expr '^' expr | expr RELOP expr | expr '?' expr ':' expr ; primary_expr:= primary_expr '[' expr ']' | IDENTIFIER | CONSTANT | '(' expr ')' ;