help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison deterministic LALR parser for C++ (kind of complex langauge) w


From: Hans Aberg
Subject: Re: Bison deterministic LALR parser for C++ (kind of complex langauge) without 'lexar hack' support
Date: Sat, 18 Aug 2012 22:48:07 +0200

On 18 Aug 2012, at 22:39, John Levine wrote:

>>> You mean, Fortran is not parseable by Bison, is that what you mean?
>> 
>> Not practical.
> 
> I've written Fortran 77 parsers in yacc.  It's quite easy.
> 
> The lexical structure of Fortran is dreadful, but once you understand
> the hacks required, it's straightforward to pre-scan each statement to
> figure out whether it's an assignment or something else.  After that,
> the tokenization is somewhat context dependent, but not hard.
> 
> It got a lot easier after 1990 once you were allowed to pay attention
> to spaces.

I remembered that you mentioned the problem with the lexing, and had a vague 
memory about that is was about the earlier Fortran versions, but thanks for 
clarifying the Yacc/Bison part and later Fortran.

Hans





reply via email to

[Prev in Thread] Current Thread [Next in Thread]