next up previous contents
Next: A..3 EBNF for export Up: A. CM description file Previous: A..1 Lexical Analysis   Contents

A..2 EBNF for preprocessor expressions

Lexical conventions: Syntax definitions use Extended Backus-Naur Form (EBNF). This means that vertical bars  $\vert$ separate two or more alternatives, curly braces {} indicate zero or more copies of what they enclose (``Kleene-closure''), and square brackets $[]$ specify zero or one instances of their enclosed contents. Round parentheses () are used for grouping. Non-terminal symbols appear in this typeface; terminal symbols are underlined.

The following set of rules defines the syntax for CM's preprocessor expressions ( ppexp):

aatom $\rightarrow$ number  $\vert$  cmid  $\vert$ ( asum )  $\vert$ ($\tilde{~}$  $\vert$ -) aatom
aprod $\rightarrow$ { aatom (*  $\vert$ div  $\vert$ mod)  $\vert$ /  $\vert$ % } aatom
asum $\rightarrow$ { aprod (+  $\vert$ -)} aprod
     
ns $\rightarrow$ structure  $\vert$ signature  $\vert$ functor  $\vert$ funsig
mlsym $\rightarrow$ ns mlid
query $\rightarrow$ defined ( cmid )  $\vert$ defined ( mlsym )
     
acmp $\rightarrow$ asum (<  $\vert$ <=  $\vert$ >  $\vert$ >=  $\vert$ =  $\vert$ ==  $\vert$ <>  $\vert$ !=) asum
     
batom $\rightarrow$ query  $\vert$  acmp  $\vert$ (not  $\vert$ !) batom  $\vert$ ( bdisj )
bcmp $\rightarrow$ batom [(=  $\vert$ ==  $\vert$ <>  $\vert$ !=) batom]
bconj $\rightarrow$ { bcmp (andalso  $\vert$ &&)} bcmp
bdisj $\rightarrow$ { bconj (orelse  $\vert$ ||)} bconj
     
ppexp $\rightarrow$ bdisj


next up previous contents
Next: A..3 EBNF for export Up: A. CM description file Previous: A..1 Lexical Analysis   Contents
Matthias Blume
2001-07-19