The following steps are repeated until no dotted rules
are added into the table:

- Prediction:
If **A** → **w**_{1}. B w_{2}
is in E(i, j), we add all rules **B** →** . v **to
E(j, j)

We have recognized **w**_{1} from **i** to **j** and we expect
a substring starting at **j** to be of type **B**

- Moving the dot (reduction):
If **A** → **w**_{1}. is in E(i, j)
and if **B** → **w**_{1}. A w_{2}
is in some E(k, i),

we add **B** → **w**_{1} A . w_{2}
to E(k, j).

We have recognized a substring **w**_{1} from **i**
to **j** to be of type **A**.

We record this fact in all rules
that expect **A** from position **i** by moving the dot

after **A** and expanding the interval to **j**.

- Completion:
If **A** → **. x**_{j} is in E(j-1, j-1) ,
we add **A** → **x**_{j}. in E(j-1,j).

The meaning is: if A is a pre-terminal symbol and the current
terminal symbol is **x**_{j},

we consider
**x**_{j} to
be recognized**.**

**
****
**

**
**The algorithm works in **cycles:** prediction,
reduction, completion.

Since in a given cell in the table we may have more
than one dotted rule, we can explore

the possible solutions
either in a **depth-first manner** or in a
**breadth-first manner**,

by storing the dotted rules to be processed
in a stack (depth-first) or in a queue (breadth-first).

The algorithm as described above works in a top-down manner.

It can be modified to work in a bottom-up manner by changing the initialization step.