Estoy escribiendo un compilador para una clase que estoy tomando. La clase no es específicamente Haskell, pero estoy usando Haskell para escribir mi compilador e intérprete. Tengo una configuración de paquete cabal para que sea más fácil para mi prof ejecutar/compilar. Tengo happy y alex en el campo de construcción de herramientas para ambos ejecutables, pero Cabal lo ignora y luego se queja de que no puede encontrar los módulos que Happy y Alex deberían estar generando. Si ejecuto manualmente:Usando alex/feliz con Cabal
alex LimpScanner.x
happy LimpParser.y
luego cabal funciona perfectamente.
Pensé que tenía a la cabana ejecutándolas automáticamente antes, pero quizás lo recuerdo de manera imperfecta.
limp.cabal:
-- 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: [email protected]
-- 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: >=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
disposición de directorios:
limp/
├── Setup.hs
├── limp.cabal
└── src/
├── Limp.hs
├── LimpInterpreter.hs
├── LimpParser.ly
├── LimpScanner.x
└── LimpToken.hs
Mientras usted afirma que utilizar módulos '' LimpParser' y LimpScanner', tener archivos con el nombre 'LimpParser.x' y' LimpScanner.ly', y tienen instalado Alex y Happy, entonces cualquier versión de Cabal del último año más o menos debería haber ejecutado automáticamente 'alex' y' happy'. Hmm. – ephemient
Necesitamos más detalles. ¿Cuál es su diseño de directorio? ¿Cuál es tu archivo cabal? –
¿No se supone que es al revés? LimpParser.ly y LimpScanner.x? – Edward