Chart Parser Demonstration Appliet - S. Tanimoto, Univ. of Washington |
CSE 341: Programming Languages The University of Washington, Seattle, Winter 2012 |
![]() |
Caption: This page presents a Java applet that demonstrates a form of chart-parsing. Using a context-free grammar for a small language called "Englishish" the program sets up a chart representation of a directed graph, in which each vertical line represents one vertex of the graph, and each horizontal segment represents one edge of the graph. There exists an edge from vi to vj provided that the algorithm has discovered that there is a possibility of describing the input sentence portion beginning at word i and ending at word j as a partial (or possibly complete) right-hand-side of some production rule in the grammar. |
The Applet: To operate the applet, scroll to the bottom of the applet and click on the Execute button. Then scroll back up to see the output. |
;Enter commands here. DELAY 50 ; from here wait only 50 ms between updates BEGIN-GRAMMAR E -> NUM E -> E OP E E -> ( E ) NUM -> 1 | 2 | 3 OP -> + | * END-GRAMMAR BEGIN-TEXT 1 + 2 * 3 END-TEXT TOKENIZE BOTTOM-UP-PARSEAs a convenience a screen shot of the output of the chart parser when run on the above example is shown here.