Related articles |
---|
Parsing techniques for generating sentences from grammar amitr@abinfosys.com (Amit Rekhi) (1999-07-10) |
Re: Parsing techniques for generating sentences from grammar jejones@microware.com (James Jones) (1999-07-14) |
Re: Parsing techniques for generating sentences from grammar adrian@dcs.rhbnc.ac.uk (1999-07-19) |
Re: Parsing techniques for generating sentences from grammar peter.r.wilson@boeing.com (Peter Wilson) (1999-07-28) |
From: | "Amit Rekhi" <amitr@abinfosys.com> |
Newsgroups: | comp.compilers |
Date: | 10 Jul 1999 01:25:14 -0400 |
Organization: | Compilers Central |
Keywords: | testing, syntax, comment |
Hello,
PROBLEM STATEMENT
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 :
[1] A := (B|C)+
[2] B := 'Leaf1'
[3] 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 [1]-[3]. 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
used?
Thanks in advance for any replies,
Amit Rekhi,
Software Engineer,
A.B. Infosys Private Limited,
B-102, Gulmohar Park,
New Delhi - 110049,
INDIA.
Tel: +91-11-6512816,6512822,6968976
Fax: +91-11-6518873
Website: http://www.abinfosys.com
EMail: amit@abinfosys.com
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
comp.compilers page.
Search the
comp.compilers archives again.