how to compute the follow-position of a regular expression(R.E) from a parse tree

858 views Asked by At

I was computing the follow position of a regular expression R.E = (a|b)*abb by using these algorithms. From given algorithm by using second property i found a problem and can not get the answer. How can be the i is a position in lastposition(n)

1.If n is a cat-node with left child C1 and right child C2 then for every position i in lastpos(C1) , all positions in firstpos(C2) are in followpos(i).

2.If n is a star-node, and i is a position in lastpos(n) , then all positions in firstpos(n) are in followpos(i).

The fistpostion and the lastposition at every node computed first.

0

There are 0 answers