Part 1 Lexical Conventions of TINY+
1. The keywords of the language are the following:
or and int bool char while do
if then else end repeat until read write
All keywords are reserved and must be written in lowcase
2. Special symbols are the following:
> <= >= , '
{ } ; := + - * / ( ) < =
3. Other tokens are ID, NUM and STRING which are defined by the
following regular expressions:
ID=letter (letter | digit)*
Identifier is letter followed by letters and digits
NUM=digit digit*
STRING=' any character except ' '
A STRING is enclosed in brackets '…', any character except ' can
appear in a STRING. A STRING can’t be defined more than a line
letter=a|…|z|A|…|Z
digit=0|…|9
Lower and uppercase letters are distinct
4. White space consists of blanks, newlines and tabs. White space is
ignored except that it must separate IDs, NUMs, and keywords
5. Comments are enclosed in curly brackets {…} and cannot be nested.