
Is there an example of how to build a Cabal package that has a lexer generated with Alex and a parser generated with Happy? As far as I can tell, the way to do this is to add "Other-Modules: Module.Name.Of.Parser.y Module.Name.Of.Lexer.x" to each executable/library stanza. But, when I try this, I get: Could not find module `GHC.Exts': it is a member of package base-1.0, which is hidden The generated parser code contains: #if __GLASGOW_HASKELL__ >= 503 import GHC.Exts #else import GlaExts #endif Also, I don't see any way of passing options to preprocessors using Cabal. In particular, how do you pass options to Happy? I am using GHC and Cabal from the CVS head, built about two weeks ago. Thanks, Brian

On 6/13/05, Brian Smith
Is there an example of how to build a Cabal package that has a lexer generated with Alex and a parser generated with Happy? As far as I can tell, the way to do this is to add "Other-Modules: Module.Name.Of.Parser.y Module.Name.Of.Lexer.x" to each executable/library stanza. But, when I try this, I get:
Could not find module `GHC.Exts': it is a member of package base-1.0, which is hidden
The generated parser code contains:
#if __GLASGOW_HASKELL__ >= 503 import GHC.Exts #else import GlaExts #endif
Also, I don't see any way of passing options to preprocessors using Cabal. In particular, how do you pass options to Happy?
I am using GHC and Cabal from the CVS head, built about two weeks ago.
You probably forgot to add 'base' to Build-Depends. -- Friendly, Lemmih

On 6/13/05, Brian Smith
Is there an example of how to build a Cabal package that has a lexer generated with Alex and a parser generated with Happy? As far as I can tell, the way to do this is to add "Other-Modules: Module.Name.Of.Parser.y Module.Name.Of.Lexer.x" to each executable/library stanza. But, when I try this, I get:
Could not find module `GHC.Exts': it is a member of package base-1.0, which is hidden
try:
ghc-pkg expose base-1.0
/S -- Sebastian Sylvan +46(0)736-818655 UIN: 44640862

On 6/13/05, Sebastian Sylvan
On 6/13/05, Brian Smith
wrote: Is there an example of how to build a Cabal package that has a lexer generated with Alex and a parser generated with Happy? As far as I can tell, the way to do this is to add "Other-Modules: Module.Name.Of.Parser.y Module.Name.Of.Lexer.x" to each executable/library stanza. But, when I try this, I get:
Could not find module `GHC.Exts': it is a member of package base-1.0, which is hidden
try:
ghc-pkg expose base-1.0
That shouldn't matter since Cabal invokes >GHC-6.4 with -hide-all-packages. -- Friendly, Lemmih

Brian Smith
Is there an example of how to build a Cabal package that has a lexer generated with Alex and a parser generated with Happy? As far as I can tell, the way to do this is to add "Other-Modules: Module.Name.Of.Parser.y Module.Name.Of.Lexer.x" to each executable/library stanza. But, when I try this, I get:
No, they should just be "Module.Name.Of.Parser" and "Module.Name.Of.Lexer".
Could not find module `GHC.Exts': it is a member of package base-1.0, which is hidden
The generated parser code contains:
But your real problem is answered by the other replies on this thread. peace, isaac
participants (4)
-
Brian Smith
-
Isaac Jones
-
Lemmih
-
Sebastian Sylvan