Re: Grammar help
2 Jul 2002 01:04:29 -0400

          From comp.compilers

Related articles
grammar help (Peter Haynes) (2000-04-05)
Grammar help (Randy Beckwith) (2002-06-28)
Re: Grammar help (2002-07-02)
Re: Grammar help (Casse Hugues) (2002-07-15)
| List of all articles for this month |

Newsgroups: comp.compilers
Date: 2 Jul 2002 01:04:29 -0400
Organization: Solution Technology
References: 02-06-077
Keywords: parse
Posted-Date: 02 Jul 2002 01:04:29 EDT

On Fri, 28 Jun 2002 22:11:25 UTC, "Randy Beckwith"
<> wrote:

> Hello, all.
> I'm trying to write a simple grammar that will eventually be used with
> Bison but have run into a snag. Basically, I'm trying to get at a list
> of rules:
> rules_list := rule | rule rules_list
> That's the easy part. <g> Now a rule can be based on CallerID,
> CalledID, Date or ExcludeDate. There can be 0 or 1 CallerID, 0 or 1
> CalledID, 0 or more Date and 0 or more ExcludeDate. I can do the the
> "0 or 1's" and the "0 or more's" but can't figure out how to get them
> all together.
Hopefully they must appear in that order.
Is the token "AND" required?
If it is not part of the language, it is slightly easier.
Also is there a key word that preceeds of the 4 components?

rule := rule-component | rule-component "AND" rule

This makes the single callerId and calledId requirements symantic
Otherwise you must enumerate the prefix combinations
and then add the dates list similar the the production above.

Post a followup to this message

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