[antlr-interest] Fortran lexer problem

William B. Clodius wclodius at los-alamos.net
Fri Jan 15 19:04:02 PST 2010


As this is at least your second question on Fortran and ANTLR I suggest you check out the Open Fortran Project. http://fortran-parser.sourceforge.net/
As to the question regarding Fortran comments, Lexing Fortran, particularly the fixed source form, where spacing is not significant, is a pain not really suited to automated tools such as ANTLR. Check out Sale's Algorithm.

On Jan 15, 2010, at 10:50 AM, Юрушкин Михаил wrote:

> Good day,
> 
> I want to add comments of Fortran 77:
> 
> "c xxxxx";
> First symbol in column is 'c' - it means that the following line is a line
> of comment.
> 
> but I also have NAME token, that will conflict with such COMMENT rule.
> ('c' can be a name).
> 
> Is it possible to select rule by my own predicate? Are there any other
> more clear solvings of
> this problem?
> 
> 
> -- 
> Best regards,
> Michael
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> 



More information about the antlr-interest mailing list