Re: Grammar generator

Thomas Duwe <>
21 Apr 2006 23:49:29 -0400

          From comp.compilers

Related articles
Grammar generator (Thomas Duwe) (2006-04-08)
Re: Grammar generator (Thomas Duwe) (2006-04-21)
Re: Grammar generator (Hans-Peter Diettrich) (2006-04-23)
| List of all articles for this month |

From: Thomas Duwe <>
Newsgroups: comp.compilers
Date: 21 Apr 2006 23:49:29 -0400
Organization: Humboldt University of Berlin, Department of Computer Science
References: 06-04-042
Keywords: testing, parse
Posted-Date: 21 Apr 2006 23:49:29 EDT

Hello NG,

> [We've seen sentence generators that generate random source code from
> a grammar, shouldn't be any harder than that. -John]

That's in principle right.

But I Want To Generate A Grammar ( in ebnf or bnf ) where the
rules, if i parse the resulting grammar, are producing something.

So I Have To Specify, That I Need To Generate A Random Grammar,
where the rules produce something and all the rules are also used.

I read some papers regarding generating sentences from a grammar
( e.g. Purdom's algorithm and variants of that ).

Unfortunately, that isn't helping me much.

Perhaps someone have further suggestions?

I've taken now following steps to accomplish my task :

-I've taken the grammar of ebnf and implemented these rules as methods,
    which are recursively called according to the grammar of ebnf.

-And i specified some rules, such as nesting level of +,*,?, so
    that the generated tree is not to deep.

But up till now, nothing 'useful' is generated.

Any suggestions?


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.