-
Notifications
You must be signed in to change notification settings - Fork 165
/
BNFC.cabal
352 lines (332 loc) · 9.47 KB
/
BNFC.cabal
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
Name: BNFC
Version: 2.9.6
cabal-version: 2.0
-- >=2.0 for build-tool-depends: hspec-discover
-- Andreas, 2022-12-16, issue #429:
-- Putting cabal-version: x.y could mean putting extra-deps: [Cabal-x.y]
-- into stack-a.b.c.yaml if that snapshot does not have Cabal at least x.y.
-- This will then require a Setup.[l]hs file with stack even for build-type: Simple.
-- Shunning this extra effort, we only support stack snapshot that have a sufficient Cabal.
build-type: Simple
category: Parsing
Copyright: (c) Andreas Abel, Jonas Almström Duregård, Krasimir Angelov, Jean-Philippe Bernardy, Björn Bringert, Johan Broberg, Kyle Butt, Paul Callaghan, Grégoire Détrez, Markus Forsberg, Ola Frid, Peter Gammie, Thomas Hallgren, Pascal Hof, Simon Huber, Patrik Jansson, Kristofer Johannisson, Antti-Juhani Kaijanaho, Andreas Lööw, Justin Meiners, Kent Mein, Ulf Norell, Gabriele Paganelli, Michael Pellauer, Michał Radwański, Fabian Ruch, and Aarne Ranta 2002 - 2023. Free software under the BSD 3-clause license.
License: BSD3
License-File: LICENSE
Maintainer: bnfc-dev@googlegroups.com
Homepage: https://bnfc.digitalgrammars.com/
bug-reports: https://github.com/BNFC/bnfc/issues
Synopsis: A compiler front-end generator.
Description:
The BNF Converter is a compiler construction tool generating a compiler front-end
from a Labelled BNF grammar. It was originally written to generate Haskell code,
but can also be used for generating Agda, C, C++, Java, Ocaml and XML code.
.
Given a Labelled BNF grammar the tool produces:
an abstract syntax as a Haskell, Agda, C, C++, Ocaml module or Java package,
a case skeleton for the abstract syntax in the same language,
an Alex, Flex, JLex, JFlex, or ocamllex lexer generator file,
a Happy, CUP, Bison, Antlr, ocamlyacc or menhir parser generator file,
a pretty-printer as a Haskell, Agda, C, C++, Java, or Ocaml module,
an XML representation,
a LaTeX file containing a readable specification of the language.
-- Support range when build with cabal
tested-with:
GHC == 9.12.0
GHC == 9.10.1
GHC == 9.8.2
GHC == 9.6.6
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:
README.md
CHANGELOG.md
-- LICENSE is automatically included
extra-source-files:
Makefile
src/BNFC.cf
src/Makefile
-- Support range when build with stack
stack-9.8.yaml
stack-9.6.yaml
stack-9.4.yaml
stack-9.2.yaml
stack-9.0.yaml
stack-8.10.yaml
stack-8.8.yaml
stack-8.6.yaml
stack-8.4.yaml
source-repository head
type: git
location: https://github.com/BNFC/bnfc.git
subdir: source
executable bnfc
default-language: Haskell2010
main-is: Main.hs
hs-source-dirs: main
build-depends:
BNFC
, base
other-modules:
-- Generated by cabal
Paths_BNFC
autogen-modules:
-- Generated by cabal
Paths_BNFC
default-extensions:
-- Keep in alphabetical order.
LambdaCase
-- The library goal is there for internal reasons:
-- It gives us a dependency BNFC which we can use to steer the build order.
-- The bundling of the library saves us from compiling every module twice:
-- once for the executable, and once for unit-tests.
-- Now, both can depend on the library.
library
default-language:
Haskell2010
build-depends:
base >= 4.8 && < 5
, array
, containers
, deepseq
, directory
, filepath
, mtl >= 2.2.1
, pretty >= 1.1 && < 1.2
, process
, string-qq
, time
, transformers
-- for Control.Monad.IO.Class, which is in base >= 4.9 but not below
if impl(ghc < 8.0)
build-depends:
semigroups
build-tool-depends:
alex:alex,
happy:happy
hs-source-dirs:
src
ghc-options:
-Wall
-fno-warn-dodgy-imports
-fno-warn-name-shadowing
-- for cabal repl -w doctest :
-- -fno-warn-type-defaults
if impl(ghc >= 8.0)
ghc-options:
-Wcompat
if impl(ghc >= 9.2)
ghc-options:
-Wno-incomplete-uni-patterns
default-extensions:
-- Keep the list of language extensions in sync with its other occurrences.
-- Keep in alphabetical order.
-- No CPP since doctest doesn't like it.
DefaultSignatures
DoAndIfThenElse
FlexibleContexts
FlexibleInstances
LambdaCase
MultiWayIf
NamedFieldPuns
OverloadedStrings
PatternGuards
RecordWildCards
ScopedTypeVariables
TupleSections
TypeOperators
-- 2021-01-22 The following autogen section seems wrong, breaks Haskell CI:
-- E.g. https://github.com/BNFC/bnfc/runs/1750769442?check_suite_focus=true
-- autogen-modules:
-- -- Generated by cabal
-- Paths_BNFC
-- -- Generated by alex
-- BNFC.Lex
-- -- Generated by happy
-- BNFC.Par
-- 2023-11-03 We cannot add BNFC.{Lex,Par} as then the Lex.x and Par.y files
-- are not bundled by cabal dist.
-- Just make sure that there is no src/BNFC/{Lex,Par}.hs before running cabal sdist,
-- otherwise we will end up with both Lex.hs and Lex.x (resp. Par.{hs,y})
-- which will cause alex/happy to not be run, leading to build failures.
autogen-modules:
-- Generated by cabal
Paths_BNFC
other-modules:
-- Generated by cabal
Paths_BNFC
exposed-modules:
-- Generated from LICENSE
BNFC.License
-- Generated by bnfc
BNFC.Abs
BNFC.Lex
BNFC.Par
BNFC.Print
-- BNFC core
BNFC.Utils
BNFC.CF
BNFC.Check.EmptyTypes
BNFC.Regex
BNFC.TypeChecker
BNFC.GetCF
BNFC.Lexing
BNFC.Backend.Base
BNFC.Backend.Common
BNFC.Backend.Common.Makefile
BNFC.Backend.Common.NamedVariables
BNFC.Backend.Common.OOAbstract
BNFC.Backend.Common.StrUtils
BNFC.Options
BNFC.PrettyPrint
-- Documentation backends
BNFC.Backend.Latex
BNFC.Backend.Txt2Tag
-- Haskell backend
BNFC.Backend.Haskell
BNFC.Backend.Haskell.CFtoTemplate
BNFC.Backend.Haskell.CFtoAlex3
BNFC.Backend.Haskell.CFtoHappy
BNFC.Backend.Haskell.CFtoPrinter
BNFC.Backend.Haskell.CFtoAbstract
BNFC.Backend.Haskell.CFtoLayout
BNFC.Backend.Haskell.MkErrM
BNFC.Backend.Haskell.HsOpts
BNFC.Backend.Haskell.Utils
-- Haskell GADT
BNFC.Backend.HaskellGADT
BNFC.Backend.HaskellGADT.HaskellGADTCommon
BNFC.Backend.HaskellGADT.CFtoTemplateGADT
BNFC.Backend.HaskellGADT.CFtoAbstractGADT
-- O'Caml backend
BNFC.Backend.OCaml
BNFC.Backend.OCaml.OCamlUtil
BNFC.Backend.OCaml.CFtoOCamlTest
BNFC.Backend.OCaml.CFtoOCamlShow
BNFC.Backend.OCaml.CFtoOCamlPrinter
BNFC.Backend.OCaml.CFtoOCamlTemplate
BNFC.Backend.OCaml.CFtoOCamlAbs
BNFC.Backend.OCaml.CFtoOCamlYacc
BNFC.Backend.OCaml.CFtoOCamlLex
-- C backend
BNFC.Backend.C
BNFC.Backend.C.Common
BNFC.Backend.C.CFtoCPrinter
BNFC.Backend.C.CFtoCSkel
BNFC.Backend.C.CFtoBisonC
BNFC.Backend.C.CFtoFlexC
BNFC.Backend.C.CFtoCAbs
BNFC.Backend.C.RegToFlex
-- C++ backend
BNFC.Backend.CPP.Common
BNFC.Backend.CPP.PrettyPrinter
BNFC.Backend.CPP.Makefile
BNFC.Backend.CPP.Naming
BNFC.Backend.CPP.NoSTL
BNFC.Backend.CPP.NoSTL.CFtoCPPAbs
-- C++ STL backend
BNFC.Backend.CPP.STL
BNFC.Backend.CPP.STL.CFtoSTLAbs
BNFC.Backend.CPP.STL.STLUtils
BNFC.Backend.CPP.STL.CFtoCVisitSkelSTL
-- Java backend
BNFC.Backend.Java
BNFC.Backend.Java.CFtoAntlr4Lexer
BNFC.Backend.Java.CFtoAntlr4Parser
BNFC.Backend.Java.CFtoJavaAbs15
BNFC.Backend.Java.CFtoAllVisitor
BNFC.Backend.Java.CFtoFoldVisitor
BNFC.Backend.Java.CFtoAbstractVisitor
BNFC.Backend.Java.CFtoComposVisitor
BNFC.Backend.Java.CFtoVisitSkel15
BNFC.Backend.Java.CFtoJavaPrinter15
BNFC.Backend.Java.CFtoJLex15
BNFC.Backend.Java.CFtoCup15
BNFC.Backend.Java.RegToJLex
BNFC.Backend.Java.RegToAntlrLexer
BNFC.Backend.Java.Utils
-- XML backend
BNFC.Backend.XML
-- Pygments backend
BNFC.Backend.Pygments
-- Agda backend
BNFC.Backend.Agda
-- Tree-sitter backend
BNFC.Backend.TreeSitter
BNFC.Backend.TreeSitter.CFtoTreeSitter
BNFC.Backend.TreeSitter.RegToJSReg
----- Testing --------------------------------------------------------------
test-suite unit-tests
default-language:
Haskell2010
type:
exitcode-stdio-1.0
build-depends:
BNFC,
-- base-4.9 would be needed for Show1 needed for Show WriterT
base,
mtl,
directory,
array,
process,
filepath,
pretty,
hspec,
QuickCheck >= 2.5,
HUnit,
temporary,
containers,
deepseq,
string-qq,
time
if impl(ghc < 8.0)
build-depends:
semigroups
build-tool-depends:
alex:alex,
happy:happy,
hspec-discover:hspec-discover
main-is:
unit-tests.hs
hs-source-dirs:
test
ghc-options:
-W
-- TODO: -Wall
-fno-warn-name-shadowing
if impl(ghc >= 8.0)
ghc-options:
-Wcompat
default-extensions:
-- Keep in alphabetical order.
LambdaCase
OverloadedStrings
other-modules:
BNFC.CFSpec
BNFC.GetCFSpec
BNFC.OptionsSpec
BNFC.Hspec
BNFC.Backend.BaseSpec
BNFC.Backend.Common.MakefileSpec
BNFC.Backend.Common.NamedVariablesSpec
BNFC.Backend.CPP.NoSTLSpec
BNFC.Backend.CPP.STLSpec
BNFC.Backend.CSpec
BNFC.Backend.HaskellSpec
BNFC.Backend.HaskellGADTSpec
BNFC.Backend.Haskell.CFtoHappySpec
BNFC.Backend.JavaSpec
BNFC.Backend.LatexSpec
BNFC.Backend.OCamlSpec
BNFC.Backend.TreeSitterSpec
-- Generated by cabal
Paths_BNFC
autogen-modules:
-- Generated by cabal
Paths_BNFC