text/x-calc

(Mp : Mersenne prime ; cf. http://en.wikipedia.org/wiki/Mersenne_prime#List_of_known_Mersenne_primes) — posted on LtU — also, Damas-Hindley-Milner Algorithm W
(use the keyword "print" (vs. "show") to log to the console (vs. a message box)) Test :
Grammar excerpt (x-calc's language in 50 lines)
syntax   ::=  Stmts
Stmts    ::=  Stmt+
Stmt     ::= (Const | Print | Show) ';'
Const    ::= 'const' Identifier '=' Expr
Print    ::= 'print' Expr
Show     ::= 'show'  Expr
Expr     ::=  Sum
Sum      ::=  Product (Add | Subtract)*
Product  ::=  Value   (Multiply |
                       Divide |
                       Modulo)*
Subtract ::= '-' Product
Add      ::= '+' Product
Modulo   ::= '%' Value
Divide   ::= '/' Value
Multiply ::= '*' Value
Value    ::=  Integer | Paren | Call
Call     ::=  Unary | Binary | Var
Var      ::=  Identifier
Binary   ::=  Identifier
             '(' Expr ',' Expr ')'
Unary    ::=  Identifier '(' Expr ')'
Paren    ::= '(' Expr ')'

Copyright (c) 2012 Cyril Jandia
See the file copying.txt for copying permission.