A Vision for Open Hypermedia Systems Nürnberg and Leggett

Appendix D. Sproc Interface Format

This appendix describes one possibility for how to specify interfaces to Sprocs. Alternative formats, such as CORBA Interface Definition Language (IDL) [OMG 1997] or other standards should also be considered. This format is based on a subset of the PDCL specifications of the HOSS system. A HOSS program named the Protocol Definition Compiler (PDC) maps PDCL specifications into IPC libraries. Currently, the target libraries generated use HOSS specific IPC calls. With modification, this compiler could generate code that includes the Sproc Generic and Generic Encoding Layer functionality as well, mapping directly from specifications to byte blocks suitable for transport via an OSI Layer 4 medium.

The semantics of the grammar below are not specified in detail here, but a brief description follows. Basically, specifications consist of a protocol (interface) identifier, a list of legal "targets" or classes of processes in the protocol (often "client" and "server"), a list of type definitions, and a list of services. There are several built-in types including cardinal, integer, byte, NULL-terminated strings, and identifier (opaque byte block), as well as arrays of these types. The type declaration facilities allow other types to be composed into arrays, structures, and linked lists.

Each service definition (sequence) consists of a name, an initiator target, and an arbitrary number of parts (messages). Each part consists of a name, a source target, a destination target, and an arbitrary number of parameters.

Currently, the PDC generates two "basic" libraries per protocol and one library per target per protocol. The basic libraries contain code to initialize the source process identifier and to encode and decode parameters of protocol-specific types. The target libraries contain messages to send and receive messages for which the target was specified as the source or destination, respectively. Also, for sequences that specify the target as the initiator, a message that composes the appropriate sending and receiving functions is generated. (This provides an "RPC-like" synchronous blocking interface to services for initiators.) The examples provided in Section 5 and the Appendix E specification of the current Davis et al. proposal in this format should provide clarifying examples.

Character sequence definitions. The following are shorthand for sequences of characters referred to in this specification. They are specified as UNIX regular expressions. Although not shown here, the regular expression for the ID sequence should be understood to exclude the keywords listed below.

WS[ \t\n]
COMMENT#.*\n
ID[a-zA-Z]+[a-zA-Zo-0_]*
DECNUM[0-9]+
HEXNUM0x[a-fA-F0-9]+
STRING\"[^\"\n]*\"

Keyword list.

ALIASFORSEQUENCE
ARRAYGENERATESIZE
DECLAREDLISTSTATIC
DECODE_FNMESSAGESTRUCTURE
DIMENSIONNEXTTARGET
DYNAMICOFTO
ENCODE_FNPOINTERTYPE

Grammar specification. The grammar consists of special token sequences and keywords. Tokens are delimited by white space as defined in the WS sequence. Additionally, the grammar refers to characters in the set {':', ';', ',', '.', '{', '}', '[', ']', '(', ')', '-', '>', '='}, which are rendered in bold to distinguish them from the grammar specification symbols. Comments are ignored.

PDCLFile:: TargetDecl* TypeDecl* SeqDecl*
TargetDecl:: TARGET Id
TypeDecl:: TypeDeclHeader Id TypeDeclRest ;
TypeDeclHeader:: TYPE [ ( Loc [ , Loc ]* ) ]
Loc:: ( DECLARED | ENCODE_FN | DECODE_FN ) = ( GENERATE | STRING )
TypeDeclRest:: ( SimpleTypeDeclRest | AliasTypeDeclRest | StaticArrayTypeDeclRest | DynArrayTypeDeclRest | StructTypeDeclRest | ListTypeDeclRest | PointerTypeDeclRest )
SimpleTypeDeclRest:: SIZE STRING
AliasTypeDeclRest:: ALIAS FOR Id
StaticArrayTypeDeclRest:: STATIC ARRAY [ SimpleDim [ , SimpleDim ]* ] OF Id
SimpleDim:: ( Id | STRING | NUMBER )
DynArrayTypeDeclRest:: DYNAMIC NUMBER DIMENSION ARRAY OF Id
StructTypeDeclRest:: STRUCTURE ( FieldDecl* )
FieldDecl:: Id : [ [ Index [ , Index ]* ] ] ;
Index:: Id [ ( ) ]*
ListTypeDeclRest:: LIST ( FieldDecl* ) NEXT = Id
PointerTypeDeclRest:: POINTER TO Id
SeqDecl:: SEQUENCE Id Id MessageDecl*
MessageDecl:: MESSAGE Id Id -> Id ( ParamDecl* ) ;
ParamDecl:: Id : Id [ [ Index [ , Index ]* ] ] ;
Id:: ID | ALIAS | ARRAY | DECLARED | DECODE_FN | DIMENSION | DYNAMIC | ENCODE_FN | FOR | GENERATE | LIST | MESSAGE | NEXT | OF | POINTER | SEQUENCE | SIZE | STATIC | STRUCTURE | TARGET | TO | TYPE


Contents


Peter J. Nürnberg, John J. Leggett
HRL, CSDL, Texas A&M
original page URL: http://jodi.ecs.soton.ac.uk/Articles/v01/i02/Nurnberg/appd.html