Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Conversion to LR grammar
I want to write an LR grammar whose corresponding non-LR version is
with me. Does any algorithm exists for do this? I know some of the
tricks for conversion but had not encountered with any algorithm.

Report this thread to moderator Post Follow-up to this message
Old Post
Alpana
05-02-05 02:12 AM


Re: Conversion to LR grammar
alpanad@gmail.com (Alpana) wrote:

> I want to write an LR grammar whose corresponding non-LR version is
> with me. Does any algorithm exists for do this? I know some of the
> tricks for conversion but had not encountered with any algorithm.

If you just have a general grammar, and want to decide whether it is
LR(k) for some k, I think that such problem might not be decidable,
even though I do not remember for sure.

There are grammar rewritings from LR(k) to LR(1), but those are not
usable for in practical implementations. In addition, many computer
languages are context sensitive, but by clever programming, one can
put that into the semantics, and reduce to a context free
grammar. Sometimes special tweaks are needed, in the lexer or the
parser, so that one can implement a language using LL(1) or LALR(1).

So it depends really what you want to do with you language: Is it
theoretical or a practical implementation?

--
Hans Aberg

Report this thread to moderator Post Follow-up to this message
Old Post
Hans Aberg
05-15-05 12:14 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Compilers archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:13 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.