|Need a Fortran 90 BNF email@example.com (1992-06-24)|
|From:||firstname.lastname@example.org (Trevor Janes)|
|Date:||Wed, 24 Jun 1992 15:03:39 GMT|
|Summary:||I need a non-ambiguous BNF for fortan 8X or 90|
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.
Return to the
Search the comp.compilers archives again.