camlog syntax overview

//==============================================================================
// global program structure, special forms

//   src : tdcls spf
//   spf : fml0 | deftm | lbdtm

//==============================================================================
// logical formulae

//   fml0 : cls0 [ ; [lblF] fml0 ]      fml1 : cls1 [ ; [lblF] fml1 ]
//        | Failure                          | Failure
//   cls0 : lit0 [ cls1 ]               cls1 : [ frm ] bdy1
//   lit0 : ~ lit0                           | frm
//        | (: fml0 )                        | (: fml1 ) [ cls1 ]
//        | exp                         bdy1 : , [lblS] cls0
//                                           | -> [lblS] cls0
//==============================================================================
// functional expressions

//   exp : trm [act] | act
//   act : < [ tup ]
//   tup : trm +

//==============================================================================
// operator priority terms

//   trm : rel [ `op` trm ]
//   rel : add [ addop rel ]
//   add : mul [ addop add ]
//   mul : mon [ addop mul ]
//   mon : { `op` | addop } montrm
//       | prm

//==============================================================================
// primary terms

//   prm : vbl | con | '[' lst ']' | ( spf | op )
//   lst : trm lst
//       | '|' trm
//       |    

//==============================================================================
// definition terms

//   deftm : def { id < pat0 > tup0 : fml0 . }+ fml0
//   lbdtm : > pat0 : fml0

//==============================================================================
// patterns

//   frm   : > ptup0
//   pat   : con [ ppar ] | ppar | ptrm
//   ppar  : < ptup0
//   ptup0 : [ ptup ]
//   ptup  : ptrm [ptup]
//   ptrm  : pmtrm [ op ptrm ]
//   pmtrm : op pmtrm | pprm
//   pprm  : var | int | ( pat ) | '[' plst ']'
//   plst  : ptrm plst | '|' pat |

//==============================================================================
// type expressions

// tdcls : ( type id : texp . ) *
// texp  : texp1 [ ; texp ]
// texp1 : [ id < ] ttrm
// ttrm  : [ ttrm1 [ , ttrm ] ]
// ttrm1 : [ id > ] tlit
// tlit  : tatm [ -> tlit ]
// tatm  : ( texp ) | int | string | 0 | 1 | id

