Re: Can this grammar be modified for lookahead of 1 ?

David=Cook%Diag%Mfg=Hou@bangate.compaq.com
Fri, 19 Aug 1994 19:14:42 GMT

          From comp.compilers

Related articles
Can this grammar be modified for lookahead of 1 ? rahul@lsil.com (1994-08-15)
Can this grammar be modified for lookahead of 1 ? ssimmons@convex.com (1994-08-18)
Re: Can this grammar be modified for lookahead of 1 ? salomon@silver.cs.umanitoba.ca (1994-08-18)
Re: Can this grammar be modified for lookahead of 1 ? David=Cook%Diag%Mfg=Hou@bangate.compaq.com (1994-08-19)
| List of all articles for this month |
Newsgroups: comp.compilers
From: David=Cook%Diag%Mfg=Hou@bangate.compaq.com
Keywords: yacc, parse
Organization: Compaq Computer Corporation
References: 94-08-098
Date: Fri, 19 Aug 1994 19:14:42 GMT

>I am trying to generate a parser using yacc for the following grammar:
>
> s -> l (1)
> l -> L i F i e (2)
> i -> A | ACA | CA | AC | C (3)
> e -> C (4)


Try this:


s -> l
l -> L i F ii
i -> A | A C A | A C | C A | C
ii -> A e | A C A e | A C e | C A e | C e
e -> C






David R. Cook
Compaq Computer Corporation
--


Post a followup to this message

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