help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grammar definition problem.


From: Hans Aberg
Subject: Re: Grammar definition problem.
Date: Tue, 22 Mar 2005 14:36:27 +0100

Please continue to cc the Help-Bison list, so that more can help.

Often one is using a program like Flex to generate a lexer, a program that tokenizes the input. Then the Bison generated parser gets token number to parse. This kind of setup is described, for example, in the book by Aho, Sethi & Ullman, "Compilers..." (the "Dragon Book").

At 10:12 +0530 2005/03/22, Atul Kulkarni wrote:
hi,
Read your reply on the Bison mailing list, but failed to under stand
your point. Can you please explain?

Regards,
Atul.


On Mon, 21 Mar 2005 19:18:28 +0100, Hans Aberg <address@hidden> wrote:
 In addition, note that most wold put this stuff in the lexer
 (generated say by Flex).

 At 14:55 +0530 2005/03/21, Atul Kulkarni wrote:
 >Hi All,
 >I am facing problem in defining the following grammar for Bison.
 >
 >X -> letter { letter | digit }.
 >  here letter and digit are terminals and X is the non terminal symbol.
 >
 >I am not able to put this rule in the bison grammar form hence need
 >some advice on this.
 >
 >in particular I am not able to express the
 >
 >letter AND {letter OR digit } rule in the Bison grammar.
 >
 >how do I put the OR part of the rule inconsideration of the fact that
 >that scentence has to start with the "letter" and later have any
 >number of of digit?
 >
 >
 >Regards,
 >Atul.
 >
 >
 >_______________________________________________
 >address@hidden http://lists.gnu.org/mailman/listinfo/help-bison








reply via email to

[Prev in Thread] Current Thread [Next in Thread]