TERM string = 1
ident = 2
number = 3
programk = 4
ddt = 5
constant = 6
integer = 7
real = 8
cond = 9
for = 10
put = 11
else = 12
lts = 13
gts = 14
lfp = 15
rtp = 16
lbr = 17
rbr = 18
lsb = 19
rsb = 20
pls = 21
mns = 22
str = 23
fsl = 24
amp = 25
vrt = 26
exc = 27
smc = 28
eqs = 29
spc = 30
invalid = 31;
program : programk ident statement # program (2)
statement : varac lts mns expression smc # assign (0 3)
| lbr decl st_list rbr # vblock (1 2)
| cond lbr c_list # condit (2)
| for lfp statement expression smc statement rtp statement # foritr (2 3 5 7)
| put p_list smc # output (1)
| smc # -
expression : expression dop factor # double (0 1 2)
| uop factor # single (0 1)
| factor # expression (0)
factor : varac # factor (0)
| number # factor (0)
| lfp expression rtp # factor (1)
dop : pls # 0
| mns # 0
| str # 0
| fsl # 0
| vrt # 0
| amp # 0
| eqs # 0
| gts # 0
| lts # 0
uop : pls # 0
| mns # 0
| exc # 0
decl : ident_list ddt specif smc decl # declare (0 2 4)
| # -
ident_list : ident ident_list # idl (0 1)
| # -
specif : integer as # integer (1)
| real as # real (1)
| constant number # constant (1)
as : lsb number rsb # 1
| # -
st_list : statement st_list # st_list (0 1)
| # -
c_list : expression statement c_list # elsif (0 1 2)
| else statement rbr # else (- 1 -)
| rbr # -
p_list : expression p_list # expressionel (0 1)
| string p_list # stringel (0 1)
| # -
varac : ident # varac (0)
| ident lsb expression rsb # array (0 2)