Petit programming language and compiler
Petit is an educational programming language for learning compilers. Here's an example:
factorial(integer n) =
if n then n * factorial(n-1) else 1
program: IDENTIFIER '(' parameters ')' '=' expression
| program IDENTIFIER '(' parameters ')' '=' expression
parameters: parameter
| parameters ',' parameter
parameter: INTEGER IDENTIFIER
| DOUBLE IDENTIFIER
arguments: expression
| arguments ',' expression
expression: IDENTIFIER
| NATURAL
| DECIMAL
| IDENTIFIER '(' arguments ')'
| IF expression THEN expression ELSE expression
| expression '+' expression
| expression '-' expression
| expression '*' expression
| expression '/' expression
| '(' expression ')'