weak precedence grammar

Raphael Benedet <s970000@student.ulg.ac.be>
20 Jun 2000 02:44:19 -0400

          From comp.compilers

Related articles
weak precedence grammar s970000@student.ulg.ac.be (Raphael Benedet) (2000-06-20)
weak precedence grammar filsfils@montefiore.ulg.ac.be (1994-11-30)
| List of all articles for this month |
From: Raphael Benedet <s970000@student.ulg.ac.be>
Newsgroups: comp.compilers
Date: 20 Jun 2000 02:44:19 -0400
Organization: Université de Liège
Keywords: parse, question

Hello,


I'm trying to write a compiler which would use a weak precedence
grammar. From what I've read, when using this type of grammar, you
must have only one possible derivation for your input text.


But how would you modify a grammar such as the one below in order that
everything beginning with an <alpha> (e.g. "abc") give you a <ialpha>
and not a <xalpha> ?


<ialpha>::=<alpha>|<alpha><xalphas>
<xalpha>::=<alpha>|<extra>
<xalphas>::=<xalphas><xalpha>|<xalpha>
<alpha>::=a|...|z|A|...|Z
<extra>::=.|,|;|:


What are the rules to modify such a grammar in order to obtain a weak
precedence one?


Also, if you could point me to good www references about the subject,
that might help me too.


As you can see, I'm pretty new to compiler programming. Any help would
be greatly appreciated. Thanks in advance.


Raph


Post a followup to this message

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