The Language RL
BNF Converter


%This txt2tags file is machine-generated by the BNF-converter
%Process by txt2tags to generate html or latex



This document was automatically generated by the //BNF-Converter//. It was generated together with the lexer, the parser, and the abstract syntax module, which guarantees that the document matches with the implementation of the language (provided no hand-hacking has taken place).

==The lexical structure of RL==
===Identifiers===
Identifiers //Ident// are unquoted strings beginning with a letter,
followed by any combination of letters, digits, and the characters ``_ '``
reserved words excluded.


===Literals===
Integer literals //Integer// are nonempty sequences of digits.




===Reserved words and symbols===
The set of reserved words is the set of terminals appearing in the grammar. Those reserved words that consist of non-letter characters are called symbols, and they are treated in a different way from those that are similar to identifiers. The lexer follows rules familiar from languages like Haskell, C, and Java, including longest match and spacing conventions.

The reserved words used in RL are the following:
  | ``else`` | ``empty`` | ``entry`` | ``exit``
  | ``fi`` | ``from`` | ``goto`` | ``if``
  | ``pop`` | ``push`` | ``skip`` | ``top``

The symbols used in RL are the following:
  | : | += | -= | ^=
  | [ | ] | ^ | =
  | != | < | > | >=
  | <= | + | - | *
  | / | ( | ) |

===Comments===
Single-line comments begin with //.Multiple-line comments are  enclosed with /* and */.

==The syntactic structure of RL==
Non-terminals are enclosed between < and >.
The symbols -> (production),  **|**  (union)
and **eps** (empty rule) belong to the BNF notation.
All other symbols are terminals.

  | //RL// | -> | //[Rlblk]//
  | //[Rlblk]// | -> | //Rlblk//
  |  |  **|**  | //Rlblk// //[Rlblk]//
  | //Rlblk// | -> | //Ident// ``:`` //From// //[Step]// //Jump//
  | //[Step]// | -> | **eps**
  |  |  **|**  | //Step// //[Step]//
  | //From// | -> | ``from`` //Ident//
  |  |  **|**  | ``fi`` //Exp// ``from`` //Ident// ``else`` //Ident//
  |  |  **|**  | ``entry``
  | //Jump// | -> | ``goto`` //Ident//
  |  |  **|**  | ``if`` //Exp// ``goto`` //Ident// ``else`` //Ident//
  |  |  **|**  | ``exit``
  | //Step// | -> | //Ident// ``+=`` //Exp//
  |  |  **|**  | //Ident// ``-=`` //Exp//
  |  |  **|**  | //Ident// ``^=`` //Exp//
  |  |  **|**  | //Ident// ``[`` //Exp// ``]`` ``+=`` //Exp//
  |  |  **|**  | //Ident// ``[`` //Exp// ``]`` ``-=`` //Exp//
  |  |  **|**  | //Ident// ``[`` //Exp// ``]`` ``^=`` //Exp//
  |  |  **|**  | ``push`` //Ident// //Ident//
  |  |  **|**  | ``pop`` //Ident// //Ident//
  |  |  **|**  | ``skip``
  | //Exp// | -> | ``top`` //Exp2//
  |  |  **|**  | //Exp1//
  | //Exp2// | -> | ``empty`` //Exp3//
  |  |  **|**  | //Exp3//
  | //Exp3// | -> | //Exp3// ``^`` //Exp4//
  |  |  **|**  | //Exp4//
  | //Exp4// | -> | //Exp4// ``=`` //Exp5//
  |  |  **|**  | //Exp4// ``!=`` //Exp5//
  |  |  **|**  | //Exp5//
  | //Exp5// | -> | //Exp5// ``<`` //Exp6//
  |  |  **|**  | //Exp5// ``>`` //Exp6//
  |  |  **|**  | //Exp5// ``>=`` //Exp6//
  |  |  **|**  | //Exp5// ``<=`` //Exp6//
  |  |  **|**  | //Exp6//
  | //Exp6// | -> | //Exp6// ``+`` //Exp7//
  |  |  **|**  | //Exp6// ``-`` //Exp7//
  |  |  **|**  | //Exp7//
  | //Exp7// | -> | //Exp7// ``*`` //Exp8//
  |  |  **|**  | //Exp7// ``/`` //Exp8//
  |  |  **|**  | //Exp8//
  | //Exp8// | -> | //Exp9// ``[`` //Exp// ``]``
  |  |  **|**  | //Exp9//
  | //Exp9// | -> | //Integer//
  |  |  **|**  | //Ident//
  |  |  **|**  | ``(`` //Exp// ``)``
  | //Exp1// | -> | //Exp2//


