Start of Interpreter for program P2.tri at Sun Sep 28 14:06:58 2003

Program

# F:=1
I:=0
M1: I:=(I+1)
IF (I>5) THEN GOTO M2
F:=(F*I)
GOTO M1
M2: F:=F#

Parsing tree

root
:=
F1
:=
I0
label
M1
:=
I+
I1
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
label
M2
:=
FF

Table of constants

c1=1c2=0c3=5

Table of identifiers

i1=Fi2=Ii3=M1i4=M2

label 'M1' is address of the operator {omistamine} (00481A70)
label 'M2' is address of the operator {omistamine} (00481890)

Modified tree

root
:=
F1
:=
I0
:=
I+
I1
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF


Stackid F=0

Stackid F=0const=1
interpreting the operator F:=1
:=
F1
:=
I0
:=
I+
I1
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

F:=1

Stack

Stackid I=0

Stackid I=0const=0
interpreting the operator I:=0
:=
I0
:=
I+
I1
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

I:=0

Stack
M1:
Stackid I=0

Stackid I=0id I=0

Stackid I=0id I=0const=1
interpreting the operator (I+1)
+
I1

1 = 0 + 1

Stackid I=0tm=1
interpreting the operator I:=(I+1)
:=
I+
I1
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

I:=1

Stack

Stackid I=1

Stackid I=1const=5
interpreting the operator (I>5)
>
I5

1 > 5 ?

Stacktm=0
interpreting the operator IF (I>5) THEN
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

Stackid F=1

Stackid F=1id F=1

Stackid F=1id F=1id I=1
interpreting the operator (F*I)
*
FI

1 = 1 * 1

Stackid F=1tm=1
interpreting the operator F:=(F*I)
:=
F*
FI
GOTO
label
M1
:=
FF

F:=1

Stack

StackM1:
interpreting the operator M1:
label
M1

StackM1:
interpreting the operator GOTO M1
GOTO
label
M1
:=
FF
goto M1
M1:
Stackid I=1

Stackid I=1id I=1

Stackid I=1id I=1const=1
interpreting the operator (I+1)
+
I1

2 = 1 + 1

Stackid I=1tm=2
interpreting the operator I:=(I+1)
:=
I+
I1
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

I:=2

Stack

Stackid I=2

Stackid I=2const=5
interpreting the operator (I>5)
>
I5

2 > 5 ?

Stacktm=0
interpreting the operator IF (I>5) THEN
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

Stackid F=1

Stackid F=1id F=1

Stackid F=1id F=1id I=2
interpreting the operator (F*I)
*
FI

2 = 1 * 2

Stackid F=1tm=2
interpreting the operator F:=(F*I)
:=
F*
FI
GOTO
label
M1
:=
FF

F:=2

Stack

StackM1:
interpreting the operator M1:
label
M1

StackM1:
interpreting the operator GOTO M1
GOTO
label
M1
:=
FF
goto M1
M1:
Stackid I=2

Stackid I=2id I=2

Stackid I=2id I=2const=1
interpreting the operator (I+1)
+
I1

3 = 2 + 1

Stackid I=2tm=3
interpreting the operator I:=(I+1)
:=
I+
I1
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

I:=3

Stack

Stackid I=3

Stackid I=3const=5
interpreting the operator (I>5)
>
I5

3 > 5 ?

Stacktm=0
interpreting the operator IF (I>5) THEN
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

Stackid F=2

Stackid F=2id F=2

Stackid F=2id F=2id I=3
interpreting the operator (F*I)
*
FI

6 = 2 * 3

Stackid F=2tm=6
interpreting the operator F:=(F*I)
:=
F*
FI
GOTO
label
M1
:=
FF

F:=6

Stack

StackM1:
interpreting the operator M1:
label
M1

StackM1:
interpreting the operator GOTO M1
GOTO
label
M1
:=
FF
goto M1
M1:
Stackid I=3

Stackid I=3id I=3

Stackid I=3id I=3const=1
interpreting the operator (I+1)
+
I1

4 = 3 + 1

Stackid I=3tm=4
interpreting the operator I:=(I+1)
:=
I+
I1
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

I:=4

Stack

Stackid I=4

Stackid I=4const=5
interpreting the operator (I>5)
>
I5

4 > 5 ?

Stacktm=0
interpreting the operator IF (I>5) THEN
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

Stackid F=6

Stackid F=6id F=6

Stackid F=6id F=6id I=4
interpreting the operator (F*I)
*
FI

24 = 6 * 4

Stackid F=6tm=24
interpreting the operator F:=(F*I)
:=
F*
FI
GOTO
label
M1
:=
FF

F:=24

Stack

StackM1:
interpreting the operator M1:
label
M1

StackM1:
interpreting the operator GOTO M1
GOTO
label
M1
:=
FF
goto M1
M1:
Stackid I=4

Stackid I=4id I=4

Stackid I=4id I=4const=1
interpreting the operator (I+1)
+
I1

5 = 4 + 1

Stackid I=4tm=5
interpreting the operator I:=(I+1)
:=
I+
I1
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

I:=5

Stack

Stackid I=5

Stackid I=5const=5
interpreting the operator (I>5)
>
I5

5 > 5 ?

Stacktm=0
interpreting the operator IF (I>5) THEN
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

Stackid F=24

Stackid F=24id F=24

Stackid F=24id F=24id I=5
interpreting the operator (F*I)
*
FI

120 = 24 * 5

Stackid F=24tm=120
interpreting the operator F:=(F*I)
:=
F*
FI
GOTO
label
M1
:=
FF

F:=120

Stack

StackM1:
interpreting the operator M1:
label
M1

StackM1:
interpreting the operator GOTO M1
GOTO
label
M1
:=
FF
goto M1
M1:
Stackid I=5

Stackid I=5id I=5

Stackid I=5id I=5const=1
interpreting the operator (I+1)
+
I1

6 = 5 + 1

Stackid I=5tm=6
interpreting the operator I:=(I+1)
:=
I+
I1
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

I:=6

Stack

Stackid I=6

Stackid I=6const=5
interpreting the operator (I>5)
>
I5

6 > 5 ?

Stacktm=1
interpreting the operator IF (I>5) THEN
IF
>
I5
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF

Stack

StackM2:
interpreting the operator M2:
label
M2

StackM2:
interpreting the operator GOTO M2
GOTO
label
M2
:=
F*
FI
GOTO
label
M1
:=
FF
goto M2
M2:
Stackid F=120

Stackid F=120id F=120
interpreting the operator F:=F
:=
FF

F:=120

Stack
program P2.tri is completed

THE VARIABLES:

F=120
I=6

Interpreter ended at Sun Sep 28 14:06:58 2003