Example Language

 [Previous Chapter]  [Previous Page]  [Contents]  [Next Page]  [Next Chapter]

*To demonstrate the denotational semantics, a tiny programming language is provided:

<stmts> ---> <stmt> ; <stmts> | <stmt> | epsilon
<stmt> ---> <variable> := <expression>
<stmt> ---> if ( <expression> ) { <stmts> }
<stmt> ---> while ( <expression> ) { <stmts> }
<stmt> ---> read <variable>
<stmt> ---> write <expression>
<expression> ---> <simple-expression>
<expression> ---> <simple-expression> <relop> <simple-expression>
<simple-expression> ---> <term>
<simple-expression> ---> <term> <addop> <simple-expression>
<term> ---> <factor>
<term> ---> <factor> <multop> <term>
<factor> ---> ( <expression> )
<factor> ---> <variable>
<factor> ---> <constant>
<relop> ---> < | <= | = | != | >= | >
<multop> ---> * | /
<addop> ---> + | -

 

*This language offers two primitive domains for Boolean values and integers:

B = { true, false, _|_ }
N = { ..., -1, 0, 1, 2, ..., _|_ }

 

 [Previous Chapter]  [Previous Page]  [Contents]  [Next Page]  [Next Chapter]
Copyright © 2002 Andreas Borchert, converted to HTML on May 02, 2002