Programming Thread

Viewing single post

Started by the-pi-guy, Mar 13, 2016, 10:39 PM

previous topic - next topic

the-pi-guy

May 21, 2019, 01:31 PM Last Edit: May 23, 2019, 02:38 AM by the-pi-guy
In progress:

set_func-> set id( args ) = statements

any_exp -> bool_exp | set_exp | mod_exp
bool_exp -> (bool_exp bool_op bool_exp) | exp op exp | true | false | null
set_exp -> SET id = any_exp
mod_exp -> exp (MOD exp)

exp -> exp + factor | exp - factor
factor -> factor * fact | factor / fact | factor % fact
fact -> fac ^ fact
fac -> term !
term -> (exp) | real | id | id( in_args )

op -> = | != | >= | <= |  < | >
bool_op -> || &

statements -> while bool_exp { statements }
statements -> if bool_exp { statements } (else{ statements })?
statements -> set_exp;
statements -> return exp;
statements -> print exp;


----------------------

PRINT
RETURN
SET
IF
WHILE
LPAREN
RPAREN
LBRACK
RBRACK
LSQ
RSQ
EXP
ADD
SUB
DIV
MUL
FACTORIAL
OR
AND
EQUAL
NEQUAL
GT
LT
GEQ
LEQ
MOD
REMAIN
REAL = (0-9)*.?(0-9)*
ID = (A-Z | a-z) (A-Z | a-z | 0-9 | _)*