Questions tagged [happy]

Happy is a YACC-like parse generator for Haskell

Happy is a like parse generator for the programming language.

108 questions
0
votes
0 answers

parse with Happy and add semantics/bindings

Is there a way, whilst parsing source of a statically-scoped nested language such as Pascal (which allows nested subroutines), of maintaining binding information (list of name-value pairs as they are encountered in the source) ? The difficulty is…
0
votes
1 answer

How can I remove some terms when parsing this BNF?

I am attempting to parse a boolean expression using the Happy library. The problem is that the result is not as good as I would want it when I introduce parentheses. I have made the following grammar. Query : Expr { $1 } Expr …
PetaPetaPeta
  • 97
  • 1
  • 12
0
votes
1 answer

No instance for (Show ([(String, Int)] -> Int))

to calculate the value of the expression on the fly at the production rules in happy doesn't work if I'm using the lambda expressions. For example this code Exp : let var '=' Exp in Exp { \p -> $6 (($2,$4 p):p) } | Exp1 …
jimmyt
  • 491
  • 4
  • 10
1 2 3 4 5 6 7
8