next up previous contents
Next: 2.3 Semantics Up: 2. The MURZ language Previous: 2.1 Introduction

2.2 Syntax

The concrete syntax of the MURZ language is here shown. We highlight the fact that MURZ is very strict about the usage of semicolon, that has to be used only between two commands or to declarations in a sequence (it won't be used before end or else). Comments can be opened with // and end with the end of the line.



program

::= declListOpt block .
     
identListOpt ::= $\varepsilon$
  | identList
     
identList ::= identifier
  | identList , identifier
     
declListOpt ::= $\varepsilon$
  | declList ;
     
declList ::= decl
  | declList ; decl
     
args ::= typedIdentList
  | args ; typedIdentList
     
decl ::= var typedIdentList
  | procedure identifier ; declListOpt block
  | procedure identifier ( args ) ; declListOpt block
     
typedIdentList ::= identList : typename
     
typename ::= integer
  | boolean
     
expr ::= int
  | identifier
  | ( expr )
  | expr + expr
  | expr - expr
  | expr * expr
  | expr / expr
  | expr and expr
  | expr or expr
  | expr > expr
  | expr < expr
  | expr = expr
  | not expr
     

block ::= begin commandSeq end
     
exprListOpt ::= $\varepsilon$
  | exprList
     
exprList ::= expr
  | exprList , expr
     
command ::= skip
  | identifier ( exprListOpt )
  | read identifier
  | write expr
  | identifier := expr
  | block
  | while expr do command
  | if expr then command else command
     
commandSeq ::= commandSeq ; command
  | command
     

   




next up previous contents
Next: 2.3 Semantics Up: 2. The MURZ language Previous: 2.1 Introduction
Diego
2000-05-17