DIPARTIMENTO   DI   INFORMATICA
Università di Torino

Rank 2 intersection for a simple language of modules (built on a subset of Caml)

Interface(-sequence) syntax

     
interface-sequence ::= interface {interface}+ ;;
     
interface ::= interface module-type end
     
module-type ::= [imported imported-typedef {, imported-typedef}*]
[exported exported-typedef {, exported-typedef}*]
[declared declaration {, declaration}*]
defined <{[environment-entry {, environment-entry}*]}; { definition {, definition}*}>
     
imported-typedef ::= type type-declaration
| type imported-type-definition {and imported-type-definition}*
imported-type-definition ::= type-definition
| readonly type-definition
     
type-declaration ::= typeconstr-name
| 'ident typeconstr-name
| ( 'ident {, 'ident }+ ) typeconstr-name
type-definition ::= typeconstr-name = type-representation
| 'ident typeconstr-name = type-representation
| ( 'ident {, 'ident }+ ) typeconstr-name = type-representation
type-representation ::= constr-decl {| constr-decl }*
constr-decl ::= cconstr-name
| ncconstr-name of typexpr
     
exported-typedef ::= type exported-type-definition {and exported-type-definition}*
exported-type-definition ::= type-definition
| readonly type-definition
| opaque type-declaration
     
declaration ::= value-name : { rank2-typexpr {, rank2-typexpr}*}
     
rank2-typexpr ::= conj -> rank2-typexpr
| typexpr -> rank2-typexpr
| typexpr
conj ::= ( typexpr {^ typexpr}+ )
typexpr ::= int | bool | unit | 'ident |
| typexpr -> typexpr | ( typexpr {* typexpr }+ )
| typeconstr-name | typexpr typeconstr-name
| ( typexpr {, typexpr }+ ) typeconstr-name
     
environment-entry ::= value-name : conj
  | value-name : typexpr
     
definition ::= value-name : rank2-typexpr


[Back]

Comments to: damiani[at]di[dot]unito[dot]it