2 Feb 2006 11:46:36 -0500

Related articles |
---|

Extended CFGs rpboland@gmail.com (Ralph Boland) (2006-02-02) |

Re: Extended CFGs cfc@shell01.TheWorld.com (Chris F Clark) (2006-02-03) |

Re: Extended CFGs wyrmwif@tsoft.org (SM Ryan) (2006-02-03) |

From: | "Ralph Boland" <rpboland@gmail.com> |

Newsgroups: | comp.compilers |

Date: | 2 Feb 2006 11:46:36 -0500 |

Organization: | Compilers Central |

Keywords: | parse, tools |

Posted-Date: | 02 Feb 2006 11:46:36 EST |

I am developing a parser generator tool which supports regular

expressions on the lefthand side of productions. My task is made

somewhat simpler if I disallow nullable production left hand sides. I

have been trying to come up with reasons why this might be a bad idea.

So far the only problem I have come up with is that of a nullable

terminal. For example, mulitplication in arithmetic can be a terminal

symbol such as '*' or may be implied by the juxtaposition of two

expressions. Thus we may write the multiplication of two variables B

and C by:

B * C

or by:

BC

I might want to write productions to capture this idea as follows:

Mult --> MULT ? # ? means optional

Multiply --> Expression Mult Expression

etc.

where MULT is a token defined as:

MULT --> '*'

Now the Mult production is nullable and thus not allowed in my parser

generator. I have a workaround for this particular problem but

perhaps there are other problems.

CAN ANYONE POINT OUT FURTHER PROBLEMS RESULTING FROM DISALLOWING

NULLABLE PRODUCTIONS?

Thanks

May all your software be patent free.

Ralph Boland

Post a followup to this message

Return to the
comp.compilers page.

Search the
comp.compilers archives again.