Historical Note

This page was migrated from the original p-nand-q.com site which was last updated in 2015. The content has been preserved exactly as it was, with only formatting updated for modern browsers. Over the coming days and weeks, the content will be reviewed and may be updated for accuracy and relevance. If you find any issues, please contact me.

gplz.easy

The syntax reads as follows:

SOURCE = STATEMENT {STATEMENT}.
STATEMENT = CODE ['.'|'\n'].
CODE = FUNCTION ':' DESCRIPTION.
FUNCTION = FUNCNAME '(' [ARG {',' ARG}] ')'.
FUNCNAME = NAME | BUILTIN.
BUILTIN = 'if','while','until','do'...
NAME = CHAR { CHAR | DIGIT }.
CHAR = 'a' .. 'z'.
DIGIT = '0' .. '9'.
DESCRIPTION = CODEM {'.' CODEM}
CODEM = ASSIGNMENT | FUNCCALL | PRINT | EXPRESSION.
FUNCCALL = NAME '(' [EXPRESSION {',' EXPRESSION}] ')'.
PRINT = '<<' EXPRESSION
ASSIGNMENT = VARIABLE ('='|'+='|'-='|'*='|'/='|'%='|'|='|'&=') EXPRESSION.
EXPRESSION = OP0 {('<'|'=='|'>'|'<='|'>='|'!=') OP0}.
OP0 = OP1 {('+'|'-')OP1}.
OP1 = OP2 {('*'|'/'|'%')OP2}.
OP2 = OP3 {('|')OP3}.
OP3 = OP4 {('&')OP4}.
OP4 = ['!'] ('(' EXPRESSION ')' | FUNCCALL | VARIABLE | LITERAL).
LITERAL = DECINT.
DECINT = DIGIT {DIGIT}.
VARIABLE = NAME.

Some points to notice:

Easy.

Example

Hello, .easy World

# HELLO, WORLD in .easy

do:<<"Hello, World"

The following programm will print the first 20 fibonacci numbers

# FIBONACCI in .easy

f(x):i=x.j=x.c=x-x
do:f(1)
while:c<20.<<j.h=j+i.j=i.i=h.c+=1

The first line declares a function f(x) that assigns x to both the variables i and j, and 0 to c. The second line calls the function f(1). The while loop iterates c >= 20, and repeats the sequence "print j, h=j+i, j=i, i=h, c++". Easy.