1 / 12

Tabular Parsing

Tabular Parsing. Tabular Parsing. Tabular Parsing Primitive Item : X . for X  V   Phrase Item : A  X . Y for some A  XY  P. Source string z = z 1 z 2 . . z n where z I   Table T i,j contains any primitive item X .

yael-kirby
Download Presentation

Tabular Parsing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tabular Parsing

  2. Tabular Parsing Tabular Parsing Primitive Item : X . for X  V  Phrase Item : A  X . Y for some A  XY  P. • Source string z = z1 z2 . . zn where zI • Table Ti,j contains any • primitive item X . • for which X  zj . . zj+i-1 and any • phrase item A  X . Y for which • X  zj . . zj+i-1 .

  3. Tabular Parsing Example N. dAn. dA.n d.An d.n d. A. a. . n.

  4. Tabular Parsing Example

  5. Tabular Parsing Pseudo Code Initialize Table for j = 1 to n, add z1 . to Tij . Process Rest of Table for j = n down to 1 Process jth column for i = 1 to n+j-1 repeat for each completed phrase item A  Z. in Ti,j add primitive item A. to Ti,j for each primitive item X. in Ti,j if A  XY then add initial phrase item A  X . Y to Ti,j for each partial phrase item A  X.UY in TI,j , Process( i,j, A  X.UY) until no change in Ti,j

  6. Tabular Parsing Pseudo Code Process( i,j, A  X.UY ) Let k = i+j Process kth column For p = 1 to n+k-1 for each primitive item U. in Tp,k add extended phrase item A  XU.Y to TI+p,j

  7. Tabular Parsing Example An attribute grammar for converting Infix to Postfix Note: Grammar is not LL(1)

  8. Tabular Parsing Based Translation

  9. Tabular Parsing Example 3

  10. Tabular Parsing Example 4

More Related