Re: Regular expression grammar?

Zalman Stern <zalman@netcom18.netcom.com>
24 Sep 1999 22:53:48 -0400

          From comp.compilers

Related articles
Regular expression grammar? bediger@teal.csn.net (Bruce Ediger) (1999-09-16)
Re: Regular expression grammar? jjan@cs.rug.nl (J.H.Jongejan) (1999-09-20)
Re: Regular expression grammar? terryg@uswest.net (1999-09-20)
Re: Regular expression grammar? lex@cc.gatech.edu (1999-09-20)
Re: Regular expression grammar? cbarron3@ix.netcom.com (1999-09-20)
Re: Regular expression grammar? zalman@netcom18.netcom.com (Zalman Stern) (1999-09-24)
Re: Regular expression grammar? zalman@netcom18.netcom.com (Zalman Stern) (1999-09-24)
Re: Regular expression grammar? zalman@netcom18.netcom.com (Zalman Stern) (1999-09-24)
Re: Regular expression grammar? cbarron3@ix.netcom.com (1999-09-27)
| List of all articles for this month |

From: Zalman Stern <zalman@netcom18.netcom.com>
Newsgroups: comp.compilers
Date: 24 Sep 1999 22:53:48 -0400
Organization: Netcom
References: 99-09-051 99-09-068
Keywords: lex, parse

J.H.Jongejan <jjan@cs.rug.nl> wrote:
: I can give you an LL(1) grammar:
: E : T E'
: E': OR T E'
: E':
: T : F T'
: T': F T'
: T':
: F : P F'
: F': STAR
: P : SYMBOL
: P : EPSILON
: P : LPAR E RPAR


Maybe I'm clueless, but I can't see how to derive "a" from this as the F
rule seems to always require an ending STAR. I think the fix is to add rule:
      F':


Also, what is EPSILON? If it means the same thing as no token or end of
input, the gramar can derive "*" which is not a valid regexp. If so, what
is the purpose of the "P : EPSILON" rule.


-Z-


Post a followup to this message

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