A method of static code analysis

by Logan w. Lee

[email protected]

Definitions

The two columns are identical:

for F
if I
else if EI
else E

This can be also represented as F, I, EI, E.

(I) is one of

I
EI
E
or
I
EI
or
I
E
.

(I)[3]=I, EI, E

(I)[2]=I, EI or I, E.

Sample Code 1

Let's try to represent:

for
if
else if

in terms of our definition above.

It is equivalent to ((I))1[3] or F, (I)[2]. Actually

((I))1[3]=F, (I)[2].

Note 1. We haven't distinguished between I, EI and I, E.

Sample Code 2

F 1
I 1
EI 1
E 0
F 0
=
F=a=1
(I)[0]=b=1
(I)[1]=c=1
or
((I))1=a=1
((I))1=b=1
((I))1=c=1
.

((I))1[3]=F, (I)[2].

Sample Code 3

if 1
else if 1
else
for 1
if 1
else if
else 1

((I))2[5]=(I)[2], F, (I)[2].

Hosted by www.Geocities.ws

1