Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing alex/happy with Cabal
    text
    copied!<p>I'm writing a compiler for a class I'm taking. The class isn't specifically Haskell but I'm using Haskell to write my compiler and interpreter. I have a cabal package setup to hopefully make it easy for my prof to run/compile. I have happy and alex in the build-tools field for both executables but Cabal ignores that and then complains that it cannot find the modules that Happy and Alex should be generating. If I manually run: </p> <pre><code>alex LimpScanner.x happy LimpParser.y </code></pre> <p>then cabal runs perfectly.</p> <p>I thought I had cabal automatically running them earlier but perhaps I remember imperfectly.</p> <p>limp.cabal:</p> <pre><code>-- limp.cabal auto-generated by cabal init. For additional options, -- see -- http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html#pkg-descr. -- The name of the package. Name: limp -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented. Version: 0.1 -- A short (one-line) description of the package. Synopsis: LIMP Compiler (Compiler Construction course project) -- A longer description of the package. -- Description: -- URL for the project homepage or repository. Homepage: http://www.cs.rit.edu/~eca7215/limp/ -- The license under which the package is released. License: AllRightsReserved -- The file containing the license text. License-file: LICENSE -- The package author(s). Author: Edward Amsden -- An email address to which users can send suggestions, bug reports, -- and patches. Maintainer: eca7215@cs.rit.edu -- A copyright notice. -- Copyright: Category: Language Build-type: Simple -- Extra files to be distributed with the package, such as examples or -- a README. -- Extra-source-files: -- Constraint on the version of Cabal needed to build this package. Cabal-version: &gt;=1.2 Executable limp -- .hs or .lhs file containing the Main module. Main-is: Limp.hs hs-source-dirs: src -- Packages needed in order to build this package. Build-depends: base, array, haskell98 -- Modules not exported by this package. -- Other-modules: -- Extra tools (e.g. alex, hsc2hs, ...) needed to build the source. Build-tools: alex, happy Executable limpi Main-is: LimpInterpreter.hs hs-source-dirs: src Build-depends: base, array, haskell98 Build-tools: alex, happy </code></pre> <p>Directory layout: </p> <pre><code>limp/ ├── Setup.hs ├── limp.cabal └── src/ ├── Limp.hs ├── LimpInterpreter.hs ├── LimpParser.ly ├── LimpScanner.x └── LimpToken.hs </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload