Need a Fortran 90 BNF

trevor@homer.shec.hypercomp.ns.ca (Trevor Janes)
Wed, 24 Jun 1992 15:03:39 GMT

          From comp.compilers

Related articles
Need a Fortran 90 BNF trevor@homer.shec.hypercomp.ns.ca (1992-06-24)
| List of all articles for this month |
Newsgroups: comp.compilers
From: trevor@homer.shec.hypercomp.ns.ca (Trevor Janes)
Organization: Acadia University
Date: Wed, 24 Jun 1992 15:03:39 GMT
Summary: I need a non-ambiguous BNF for fortan 8X or 90
Keywords: Fortran, yacc

Hello,
      I've got a problem with the Fortran grammar (that's Fortran 8X or 90).
I've got a copy of the ansi standard but I've found it to be ambiguous
when I try to run Yacc (actually Yacc++) on it. For anyone familiar with
BNF form, it contains productions of the following forms:


1) a : b [c] d ;


        c : [e] [f] [g] ; ([] means 'optional')


2) a : b | c ;


        d : e | c ; ( | means 'or')




When these ambiguities are spread across several levels of the grammar
tree, they can become VERY difficult to remove (especially since the
grammar contains literally hundreds of productions).


Has anyone else ever tried to yacc the Fortran grammar and found this? Is
there a non-ambiguous BNF available somewhere? Does anyone have any
suggestions for getting around this problem (besides manual debugging)?


Any help would be greatly appreciated.
--
Trevor Janes
trevor@homer.shec.hypercomp.ns.ca
(902) 453-1117
--


Post a followup to this message

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