|Parsing techniques for generating sentences from grammar firstname.lastname@example.org (Amit Rekhi) (1999-07-10)|
|Re: Parsing techniques for generating sentences from grammar email@example.com (James Jones) (1999-07-14)|
|Re: Parsing techniques for generating sentences from grammar firstname.lastname@example.org (1999-07-19)|
|Re: Parsing techniques for generating sentences from grammar email@example.com (Peter Wilson) (1999-07-28)|
|From:||"Amit Rekhi" <firstname.lastname@example.org>|
|Date:||10 Jul 1999 01:25:14 -0400|
|Keywords:||testing, syntax, comment|
I am currently designing a sentence generator. It will output parse
trees of sentences conforming to a grammar the generator understands.
The kind of sentences it generates will depend upon user input. My
problem is that I am not clear as to which parsing technique to use to
generate the parse trees of sentences.
Let me illustrate my point with an example : Let's say I have the
following production rules :
 A := (B|C)+
 B := 'Leaf1'
 C:= 'Leaf2'
Let's also assume that I want to design a sentence generator which
will output sentences conforming to this grammar depending upon user
input. eg. If user wants = "Leaf1Leaf2Leaf2Leaf1" , the generator
should generate the parse tree of the above sentence by running
through the rules -. My problem is that
1) What kind of parsing(bottomup or topdown) should be applied to
generate parse trees of sentences? Why should the choosen method be
Thanks in advance for any replies,
A.B. Infosys Private Limited,
B-102, Gulmohar Park,
New Delhi - 110049,
Note: Not related to Infosys Technologies Limited
[Pretty much has to be top down, bottom up needs an existing sentence to
drive its state machine. -John]
Return to the
Search the comp.compilers archives again.