happy

Generate Fortran 77 parser from a yacc grammar using Happy (Haskell)

I have stumbled upon the following F77 yacc grammar: http://yaxx.cvs.sourceforge.net/viewvc/yaxx/yaxx/fortran/fortran.y?revision=1.3&view=markup. How can I make a Fortran 77 parser out of this file using Happy? Why is there some C?/C++? code in that .y file? UPDATE: Thank you for your replies! I've been playing with two fresh app...

Parser in Happy

I'm trying to do a parser with Happy (Haskell Tool) But I'm getting a message error: "unused ruled: 11 and unused terminals: 10" and I don't know what this means. In other hand I'm really not sure about the use of $i parameters in the statements of the rules, I think my error is because of that. If any can help me... ...

Are there any tutorials on building a simple interpreter using Alex + Happy?

I'm working on a school project where I have to build an interpreter for a simple language using Alex + Happy in Haskell. After looking through the documentation I understand most of it, but would like to see a full blown example on using the tools. ...

How do we keep multiple semantic values during parsing with Happy/Haskell

Hi, I'm trying to build a simple lexer/parser with Alex/Happy in Haskell, and I would like to keep some localisation information from the text file into my final AST. I managed to build a lexer using Alex that build a list of Tokens with localisation: data Token = Token AlexPosn Foo Bar lexer :: String -> [Token] in my Happy file, w...

What goes in between { and } when writing BNF?

I'm having some trouble with BNF. I can't tell what seems to be the standard way of doing things (if there is one), and whether or not there are types like char or int or whatever already built in. However, my main problem is not understand how the part of the BNF in curly braces works. Given something like: exp : term ...