File: happy-lib.cabal

package info (click to toggle)
haskell-happy-lib 2.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 484 kB
  • sloc: haskell: 5,574; sh: 3; makefile: 2
file content (172 lines) | stat: -rw-r--r-- 6,081 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
cabal-version: 3.0
name: happy-lib
version: 2.1.7
license: BSD-2-Clause
copyright: (c) Andy Gill, Simon Marlow
author: Andy Gill and Simon Marlow
maintainer: https://github.com/haskell/happy
bug-reports: https://github.com/haskell/happy/issues
stability: stable
homepage: https://www.haskell.org/happy/
synopsis: Happy is a parser generator for Haskell implemented using this library
category: Development
build-type: Simple

Description:
  Happy is a parser generator for Haskell.  Given a grammar
  specification in BNF, Happy generates Haskell code to parse the
  grammar.  Happy works in a similar way to the @yacc@ tool for C.

  This library provides the following functionality:

    * Data type definitions for the Grammar AST type, capturing the information in .y-files (Happy.Grammar)

    * A parser for happy grammar files (.y) to produce a Grammar (Happy.Frontend.*)

    * Implementations of the text book algorithms that compute the LR action and
      goto tables for the given 'Grammar' (Happy.Tabular.*)

    * An LALR code generator to produce table-driven, deterministic parsing code
      in Haskell (Happy.Backend.LALR.*)

    * A (less maintained) GLR code generator to produce table-driven,
      non-deterministic parsing code in Haskell, where ambiguous parses produce
      multiple parse trees (Happy.Backend.GLR.*)

tested-with:
        GHC == 9.12.2
        GHC == 9.10.2
        GHC == 9.8.4
        GHC == 9.6.7
        GHC == 9.4.8
        GHC == 9.2.8
        GHC == 9.0.2
        GHC == 8.10.7
        GHC == 8.8.4
        GHC == 8.6.5
        GHC == 8.4.4
        GHC == 8.2.2
        GHC == 8.0.2

extra-doc-files:
        ChangeLog.md
        README.md

extra-source-files:
        frontend/bootstrap.sh
        frontend/boot-src/Parser.ly
        frontend/boot-src/AttrGrammarParser.ly

data-dir: data

data-files:
        HappyTemplate.hs
        GLR_Base.hs
        GLR_Lib.hs

source-repository head
  type:     git
  location: https://github.com/haskell/happy.git

common common-stanza
  default-language:    Haskell98
  default-extensions:  CPP, MagicHash, FlexibleContexts, NamedFieldPuns, PatternGuards
  ghc-options: -Wall -Wno-incomplete-uni-patterns

library grammar
  import: common-stanza
  hs-source-dirs:      grammar/src
  exposed-modules:
       Happy.Grammar
       Happy.Grammar.ExpressionWithHole
  build-depends:       base < 5, array

library frontend
  import: common-stanza
  hs-source-dirs:      frontend/src
  exposed-modules:     Happy.Frontend,
                       Happy.Frontend.AbsSyn,
                       Happy.Frontend.Mangler,
                       Happy.Frontend.PrettyGrammar
  build-depends:       base < 5, array, transformers, containers, mtl, grammar
  other-modules:
        Happy.Frontend.ParseMonad
        Happy.Frontend.ParseMonad.Class
        Happy.Frontend.Mangler.Monad
        Happy.Frontend.Parser
        Happy.Frontend.Lexer
        Happy.Frontend.ParamRules
        Happy.Frontend.AttrGrammar
        Happy.Frontend.AttrGrammar.Parser
        Happy.Frontend.AttrGrammar.Mangler

library tabular
  import: common-stanza
  hs-source-dirs:      tabular/src
  exposed-modules:     Happy.Tabular,
                       Happy.Tabular.First,
                       Happy.Tabular.Info,
                       Happy.Tabular.LALR,
                       Happy.Tabular.NameSet,
  -- The following 3 lines constitute a workaround for cabal#10687, triggered by #328.
  -- The setup in #328 triggers a clashing use of Paths_happy_lib between
  -- `backend-lalr` and `backend-glr` in the presence of --libsubdir.
  -- The workaround moves Paths_happy_lib into `tabular` where it can be shared.
  -- However, in order to really refer to the Paths_happy_lib from `tabular`,
  -- we have to reexport it under a different name, because otherwise we get
  --
  --    These modules are needed for compilation but not listed in your .cabal file's other-modules for ‘happy-lib-2.1.3-inplace-backend-lalr’ :
  --        Paths_happy_libsuppress
  --
                       Paths_happy_lib
  reexported-modules:  Paths_happy_lib as Happy.Paths
  autogen-modules:     Paths_happy_lib
  -- end of workaround. Delete the workaround and use the bash script posted at
  -- https://github.com/haskell/happy/issues/328#issuecomment-2597598320
  -- to test whether the workaround is still needed.
  build-depends:       base < 5, array, containers, grammar


library backend-lalr
  import: common-stanza
  hs-source-dirs:      backend-lalr/src
  exposed-modules:     Happy.Backend.LALR,
                       Happy.Backend.LALR.ProduceCode
  build-depends:       base < 5, array, grammar, tabular

library backend-glr
  import: common-stanza
  hs-source-dirs:      backend-glr/src
  exposed-modules:     Happy.Backend.GLR,
                       Happy.Backend.GLR.ProduceCode
  build-depends:       base < 5, array, grammar, tabular

library
  import: common-stanza
  reexported-modules:  Happy.Grammar,
                       Happy.Grammar.ExpressionWithHole,
                       Happy.Frontend,
                       Happy.Frontend.AbsSyn,
                       Happy.Frontend.Mangler,
                       Happy.Frontend.PrettyGrammar,
                       Happy.Tabular,
                       Happy.Tabular.First,
                       Happy.Tabular.Info,
                       Happy.Tabular.LALR,
                       Happy.Tabular.NameSet,
                       Happy.Backend.LALR,
                       Happy.Backend.LALR.ProduceCode,
                       Happy.Backend.GLR,
                       Happy.Backend.GLR.ProduceCode
  build-depends: base >= 4.9 && < 5,
                 array >= 0.5,
                 containers >= 0.4.2,
                 transformers >= 0.5.6.2,
                 mtl >= 2.2.1,
                 -- NB: omit the `happy-lib:` prefix in happy-lib:grammar.
                 -- Otherwise we unnecessarily break Cabal < 3.4
                 grammar,
                 tabular,
                 frontend,
                 backend-lalr,
                 backend-glr