Parsing items

Parsing ("Analyze selection" in the "Action" menu) is the attempt to check whether or not the arbitrary item you selected might have been produced by the grammar. Parsing is also called a membership test. There are severe restrictions in the grammar format that make this test valid. When compiling a grammar BP2 checks whether it is a " true" BP grammar (see reference manual §7) and then only it authorises parsing.

Grammar "-gr.dhin--" is an example of a "true" BP grammar. First you should compile the grammar (cmd-k) and generate its templates (see Control panel or "Action" menu). Then produce a few items in the "Data" window. You will notice that the produced items are displayed without any structural marker (brackets indicating repetitions, etc.). This display is a comprehensive "score" for Indian drum players. Structural markers will be automatically inserted when matching items against the templates.

Select one or several items and select "Analyse selection" in the "Action" menu (or click the same on the Control panel). BP2 will prompt you to use templates. Answer "yes". You may then decide whether you want to find only the first template matching each item and yielding a positive membership test, or check all templates to find which ones are acceptable. While the first method yields a quick assessment of the item in reference to the language generated by the grammar, the second will also point out structural ambiguity, e.g. the same item may be assessed "correct" by the grammar while matching several templates:

>>> Analyzing item: /6 dhin--dhagenadha--dhagenadhatigegenakadheenedheenagenatagetirakitadhin--dhagenadhatigegenakateeneteenakenadhagenadhin--dhagenadha--dhagenadha--dhagenadha--tagetirakitadhin--dhagenadhatigegenakateeneteenakenatin--takenata--takenatatikekenakateeneteenakenataketirakitatin--takenatatikekenakateeneteenakenadhagenadhin--dhagenadha--dhagenadha--dhagenadha--tagetirakitadhin--dhagenadhatigegenakadheenedheenagena
Item matched template [15]
>>> Item matching template [15] accepted by grammar...

Item matched template [19]
>>> Item matching template [19] accepted by grammar...

Item matched template [20]
>>> Item matching template [20] accepted by grammar...