shailavi shah
shailavi shah

Reputation: 181

parsing Block using flex and bison

Is it possible to parse Block through flex and bison??

Example:

Suppose

BEGIN BLOCK BLK_ROWDEC
            NAME                          cell_rowdec
            SIZE                          UNI_rowdecSize
            ITERATE                       itr_rows
            DIRECTION                     lgDir_rowdec
            STRAP                         STRD1,STRD3,STRD2
            WRAP                          WRD1
            VIA                           VIAB,VIAC,VIAD
ENDS BLK_ROWDEC

Now I want to check Is BEGIN and END is belong to same block or not?/Is it possible with flex and bison

Upvotes: 0

Views: 107

Answers (1)

user207421
user207421

Reputation: 311054

Yes it's possible, just save the block name with the BEGIN and check it when you get the END.

But the block name is redundant here, and Bison will match up begins and ends automatically. If you can remove it from your syntax I would do so.

Upvotes: 1

Related Questions